/Source/EmUpWindowController.h

http://google-email-uploader-mac.googlecode.com/ · C Header · 118 lines · 59 code · 30 blank · 29 comment · 0 complexity · c6c6429262374dc9cf17c226b27857c0 MD5 · raw file

  1. /* Copyright (c) 2009 Google Inc.
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. //
  16. // EmUpWindowController.h
  17. //
  18. #import <Cocoa/Cocoa.h>
  19. #import "GDataElements.h"
  20. #import "OutlineViewItem.h"
  21. #import "AppleMailItemsController.h"
  22. #import "MBoxItemsController.h"
  23. @interface EmUpWindowController : NSWindowController {
  24. IBOutlet NSOutlineView *outlineView_;
  25. IBOutlet NSTextView *progressReportTextView_;
  26. IBOutlet NSTabView *tabView_;
  27. IBOutlet NSTextField *outlineViewTitle_;
  28. IBOutlet NSTextView *skippedMessageTextView_;
  29. IBOutlet NSPopUpButton *skippedMessagePopup_;
  30. IBOutlet NSButton *showSkippedMessageFileButton_;
  31. IBOutlet NSTextField *skippedMessagePathField_;
  32. IBOutlet NSTextField *skippedMessageErrorField_;
  33. IBOutlet NSTextField *usernameField_;
  34. IBOutlet NSSecureTextField *passwordField_;
  35. IBOutlet NSProgressIndicator *progressIndicator_;
  36. IBOutlet NSProgressIndicator *spinner_;
  37. IBOutlet NSTextField *messagesSelectedNumField_;
  38. IBOutlet NSTextField *messagesTransferredField_;
  39. IBOutlet NSButton *uploadButton_;
  40. IBOutlet NSButton *stopButton_;
  41. IBOutlet NSButton *pauseButton_;
  42. IBOutlet NSButton *maiboxNamesAsLabelsCheckbox_;
  43. IBOutlet NSButton *preserveMailPropertiesCheckbox_;
  44. IBOutlet NSButton *putAllMailInInboxCheckbox_;
  45. IBOutlet NSButton *assignAdditionalLabelCheckbox_;
  46. IBOutlet NSTextField *additionalLabelField_;
  47. IBOutlet NSTextField *pausedMessageField_;
  48. IBOutlet NSTextField *uploadTimeEstimateField_;
  49. // each top-level item in the outline view has an item controller
  50. // object of type id<MailItemController>
  51. NSMutableArray *itemsControllers_;
  52. // index into itemControllers_ for the controller we're currently
  53. // uploading from, and the name of the current mailbox being uploaded from
  54. unsigned int currentUploadingControllerIndex_;
  55. NSString *currentUploadingMailboxName_;
  56. // status 503 responses cause us to back off for (15, 30, 60, 120) seconds,
  57. // enter slow upload mode, and add the 503'd entries to the retry list
  58. int backoffCounter_;
  59. NSMutableArray *entriesToRetry_;
  60. NSMutableDictionary *messageIDsUploaded_; // maps ID to file path
  61. NSDate *lastUploadDate_; // time last message was uploadded
  62. // app user interface state
  63. BOOL isLoadingMailboxes_;
  64. BOOL isUploading_; // is uploading, though may be paused
  65. BOOL isPaused_;
  66. unsigned long messagesUploadedCount_;
  67. unsigned long messagesSkippedCount_;
  68. // we upload fast up to 500 messages upload fast, or until
  69. // we get a 503 status from the server
  70. BOOL isSlowUploadMode_;
  71. NSMutableArray *uploadTickets_;
  72. BOOL shouldSimulateUploads_;
  73. }
  74. + (EmUpWindowController *)sharedEmUpWindowController;
  75. - (BOOL)canAppQuitNow;
  76. - (IBAction)uploadClicked:(id)sender;
  77. - (IBAction)stopClicked:(id)sender;
  78. - (IBAction)pauseClicked:(id)sender;
  79. - (IBAction)showSkippedMessageFileClicked:(id)sender;
  80. - (IBAction)reloadMailboxesClicked:(id)sender;
  81. // addMailboxes is sent by menu items with a tag of 0 (Apple), 1 (Eudora),
  82. // 2 (Thunderbird), or 3 (Entourage RGE)
  83. - (IBAction)addMailboxes:(id)sender;
  84. // import will use Apple script to ask Entourage to create an RGE archive
  85. - (IBAction)importRGEArchiveFromEntourage:(id)sender;
  86. - (void)deleteImportedEntourageArchive;
  87. - (void)setSimulateUploads:(BOOL)flag;
  88. @end