PageRenderTime 98ms CodeModel.GetById 73ms app.highlight 20ms RepoModel.GetById 1ms app.codeStats 0ms

/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//
 17//  EmUpWindowController.h
 18//
 19
 20#import <Cocoa/Cocoa.h>
 21
 22#import "GDataElements.h"
 23#import "OutlineViewItem.h"
 24#import "AppleMailItemsController.h"
 25#import "MBoxItemsController.h"
 26
 27@interface EmUpWindowController : NSWindowController {
 28
 29  IBOutlet NSOutlineView *outlineView_;
 30  IBOutlet NSTextView *progressReportTextView_;
 31  IBOutlet NSTabView *tabView_;
 32  IBOutlet NSTextField *outlineViewTitle_;
 33  
 34  IBOutlet NSTextView *skippedMessageTextView_;
 35  IBOutlet NSPopUpButton *skippedMessagePopup_;
 36  IBOutlet NSButton *showSkippedMessageFileButton_;
 37  IBOutlet NSTextField *skippedMessagePathField_;
 38  IBOutlet NSTextField *skippedMessageErrorField_;
 39
 40  IBOutlet NSTextField *usernameField_;
 41  IBOutlet NSSecureTextField *passwordField_;
 42
 43  IBOutlet NSProgressIndicator *progressIndicator_;
 44  IBOutlet NSProgressIndicator *spinner_;
 45
 46  IBOutlet NSTextField *messagesSelectedNumField_;
 47  IBOutlet NSTextField *messagesTransferredField_;
 48
 49  IBOutlet NSButton *uploadButton_;
 50  IBOutlet NSButton *stopButton_;
 51  IBOutlet NSButton *pauseButton_;
 52
 53  IBOutlet NSButton *maiboxNamesAsLabelsCheckbox_;
 54  IBOutlet NSButton *preserveMailPropertiesCheckbox_;
 55  IBOutlet NSButton *putAllMailInInboxCheckbox_;
 56  IBOutlet NSButton *assignAdditionalLabelCheckbox_;
 57  IBOutlet NSTextField *additionalLabelField_;
 58
 59  IBOutlet NSTextField *pausedMessageField_;
 60
 61  IBOutlet NSTextField *uploadTimeEstimateField_;
 62
 63  // each top-level item in the outline view has an item controller
 64  // object of type id<MailItemController>
 65  NSMutableArray *itemsControllers_;
 66
 67  // index into itemControllers_ for the controller we're currently
 68  // uploading from, and the name of the current mailbox being uploaded from
 69  unsigned int currentUploadingControllerIndex_;
 70  NSString *currentUploadingMailboxName_;
 71
 72  // status 503 responses cause us to back off for (15, 30, 60, 120) seconds,
 73  // enter slow upload mode, and add the 503'd entries to the retry list
 74  int backoffCounter_;
 75
 76  NSMutableArray *entriesToRetry_;
 77
 78  NSMutableDictionary *messageIDsUploaded_; // maps ID to file path
 79  
 80  NSDate *lastUploadDate_; // time last message was uploadded
 81
 82  // app user interface state
 83  BOOL isLoadingMailboxes_;
 84  BOOL isUploading_;         // is uploading, though may be paused
 85  BOOL isPaused_;
 86  unsigned long messagesUploadedCount_;
 87  unsigned long messagesSkippedCount_;
 88
 89  // we upload fast up to 500 messages upload fast, or until
 90  // we get a 503 status from the server
 91  BOOL isSlowUploadMode_;
 92
 93  NSMutableArray *uploadTickets_;
 94  
 95  BOOL shouldSimulateUploads_;
 96}
 97
 98+ (EmUpWindowController *)sharedEmUpWindowController;
 99
100- (BOOL)canAppQuitNow;
101
102- (IBAction)uploadClicked:(id)sender;
103- (IBAction)stopClicked:(id)sender;
104- (IBAction)pauseClicked:(id)sender;
105- (IBAction)showSkippedMessageFileClicked:(id)sender;
106- (IBAction)reloadMailboxesClicked:(id)sender;
107
108// addMailboxes is sent by menu items with a tag of 0 (Apple), 1 (Eudora),
109// 2 (Thunderbird), or 3 (Entourage RGE)
110- (IBAction)addMailboxes:(id)sender;
111
112// import will use Apple script to ask Entourage to create an RGE archive
113- (IBAction)importRGEArchiveFromEntourage:(id)sender;
114- (void)deleteImportedEntourageArchive;
115
116- (void)setSimulateUploads:(BOOL)flag;
117
118@end