This repository has been archived by the owner on Aug 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
ORSCanaryController.h
306 lines (285 loc) · 11.1 KB
/
ORSCanaryController.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
//
// ORSCanaryController.h
// Canary
//
// Created by Nicholas Toumpelis on 12/04/2009.
// Copyright 2009 Ocean Road Software. All rights reserved.
//
// Version 0.7
#import <Cocoa/Cocoa.h>
#import <CoreFoundation/CoreFoundation.h>
#import <CoreServices/CoreServices.h>
#import <Quartz/Quartz.h>
#import "ORSShortener.h"
#import "ORSCredentialsManager.h"
#import "ORSTwitterEngine.h"
#import "ORSShortenerFactory.h"
#import "ORSUpdateDispatcher.h"
#import "ORSDateDifferenceFormatter.h"
#import "NSXMLNode+ORSTwitterStatusAdditions.h"
#import "NSXMLNode+ORSTwitterDMAdditions.h"
#import "ORSCanaryPreferencesController.h"
#import "ORSCanaryAboutController.h"
#import "ORSTimelineCacheManager.h"
#import <Growl/GrowlApplicationBridge.h>
#import "ORSCanaryLoginController.h"
#import "ORSTwitPicDispatcher.h"
#import "ORSAsyncTwitPicDispatcher.h"
#import "iTunes.h"
#import "ORSFilter.h"
#import "ORSFilterTransformer.h"
#import "ORSFilterArrayTransformer.h"
#import "ORSScreenNameToBoolTransformer.h"
@interface ORSCanaryController : NSWindowController < GrowlApplicationBridgeDelegate > {
// Fundamentals
ORSCredentialsManager *authenticator;
ORSTwitterEngine *twitterEngine;
id <ORSShortener> urlShortener;
ORSUpdateDispatcher *updateDispatcher;
ORSTimelineCacheManager *cacheManager;
// Extra Windows
IBOutlet NSWindow *aboutWindow;
IBOutlet NSWindow *newUserWindow;
// Status View Outlets
IBOutlet NSButton *statusNameButton;
IBOutlet NSTextField *statusTextField;
IBOutlet NSView *statusView;
IBOutlet NSBox *statusBox;
IBOutlet NSTextField *dateDifferenceTextField;
// Main Window Outlets
IBOutlet NSCollectionView *mainTimelineCollectionView;
IBOutlet NSScrollView *mainTimelineScrollView;
IBOutlet NSTextField *newStatusTextField;
IBOutlet NSButton *tweetButton;
IBOutlet NSLevelIndicator *charsLeftIndicator;
IBOutlet NSPopUpButton *timelineButton;
IBOutlet NSProgressIndicator *indicator;
IBOutlet NSView *contentView;
IBOutlet NSCollectionViewItem *statusTimelineCollectionViewItem;
IBOutlet NSImageView *statusBarImageView;
IBOutlet NSTextField *statusBarTextField;
IBOutlet NSButton *statusBarButton;
IBOutlet NSMenuItem *switchNamesMenuItem;
// Received DMs Collection View Item Outlets
IBOutlet NSCollectionViewItem *receivedDMsCollectionViewItem;
// Sent DMs Collection View Item Outlets
IBOutlet NSCollectionViewItem *sentDMsCollectionViewItem;
// Received DMs View Outlets
IBOutlet NSButton *receivedDMButton;
IBOutlet NSTextField *receivedDMTextField;
IBOutlet NSView *receivedDMView;
IBOutlet NSBox *receivedDMBox;
IBOutlet NSTextField *receivedDMDateDifferenceTextField;
// Sent DMs View Outlets
IBOutlet NSButton *sentDMButton;
IBOutlet NSTextField *sentDMTextField;
IBOutlet NSView *sentDMView;
IBOutlet NSBox *sentDMBox;
IBOutlet NSTextField *sentDMDateDifferenceTextField;
// Array Controllers
IBOutlet NSArrayController *statusArrayController;
IBOutlet NSArrayController *receivedDMsArrayController;
IBOutlet NSArrayController *sentDMsArrayController;
// View Options
IBOutlet NSBox *viewOptionsBox;
IBOutlet NSButton *viewOptionsButton;
IBOutlet NSSegmentedControl *viewOptionsNamesControl;
IBOutlet NSMenuItem *filterMenuItem;
IBOutlet NSMenu *availableFiltersMenu;
IBOutlet NSSegmentedControl *fontSizeControl;
int namesSelectedSegment;
IBOutlet NSPopUpButton *filterPopUpButton;
IBOutlet NSBox *instaFilterBox;
IBOutlet NSBox *smallInstaFilterBox;
IBOutlet NSMenu *viewMenu;
IBOutlet NSMenu* filterMenu;
IBOutlet NSSearchField *smallInstaFilterSearchField;
IBOutlet NSSearchField *largeInstaFilterSearchField;
IBOutlet NSArrayController *filterArrayController;
NSString *previousUpdateText; // The text of the last attempted update
NSArray *statuses;
NSArray *receivedDirectMessages;
NSArray *sentDirectMessages;
NSUserDefaults *defaults;
NSTimer *refreshTimer;
NSTimer *backgroundReceivedDMTimer;
NSTimer *messageDurationTimer;
SecKeychainItemRef loginItem;
NSString *visibleUserID;
NSString *prevUserID;
NSString *prevPassword;
NSArray *spokenCommands;
NSSpeechRecognizer *recognizer;
NSString *previousTimeline;
BOOL firstBackgroundReceivedDMRetrieval;
BOOL connectionErrorShown;
BOOL betweenUsers;
// Selected status update text field
NSRange realSelectedRange;
BOOL firstFollowingTimelineRun;
BOOL showScreenNames;
}
+ (ORSCanaryController *) sharedController;
+ (id) allocWithZone:(NSZone *)zone;
- (id) copyWithZone:(NSZone *)zone;
- (void) applicationDidFinishLaunching:(NSNotification *)aNotification;
- (IBAction) sendUpdate:sender;
- (IBAction) retypePreviousUpdate:sender;
- (IBAction) changeTimeline:sender;
- (void) scrollToTop;
- (void) updateTimer;
- (void) setupReceivedDMTimer;
- (void) updateMaxNoOfShownUpdates;
- (void) updateSelectedURLShortener;
- (void) setStatusesAsynchronously:(NSNotification *)note;
- (void) setUsersAsynchronously:(NSNotification *)note;
- (void) setDMsAsynchronously:(NSNotification *)note;
- (void) addSentStatusAsynchronously:(NSNotification *)note;
- (void) addSentDMsAsynchronously:(NSNotification *)note;
- (void) getFriendsTimeline;
- (void) getUserTimeline;
- (void) getPublicTimeline;
- (void) getReplies;
- (void) getFavorites;
- (void) getReceivedMessages;
- (void) getSentMessages;
- (IBAction) goHome:sender;
- (IBAction) typeUserID:sender;
- (IBAction) dmUserID:sender;
- (IBAction) shortenURL:sender;
- (IBAction) openUserURL:sender;
- (void) applicationWillTerminate:(NSNotification *)notification;
- (void) saveLastIDs;
- (void) retweetStatus:(NSString *)statusText
fromUserWithID:(NSString *)userID;
- (void) updateNewStatusTextField;
- (IBAction) invokeActionOnUser:sender;
- (void) showUserBlockAlertSheet:(NSString *)userScreenName;
- (void) blockUserAlertDidEnd:(NSAlert *)alert
returnCode:(int)returnCode
contextInfo:(void *)contextInfo;
- (IBAction) showAboutWindow:sender;
- (IBAction) showPreferencesWindow:sender;
- (IBAction) showLoginWindow:sender;
- (void) showNewUserWindow;
- (IBAction) signupForNewAccountCall:sender;
- (IBAction) loginCall:sender;
- (IBAction) closeCall:sender;
- (IBAction) quitCall:sender;
- (void) didEndNewUserSheet:(NSWindow *)sheet
returnCode:(int)returnCode
contextInfo:(void *)contextInfo;
- (IBAction) sendFeedback:sender;
- (IBAction) changeToReceivedDMs:sender;
- (IBAction) createNewTwitterAccount:sender;
- (IBAction) sendImageToTwitPic:sender;
- (void) executeCallToTwitPicWithFile:(NSString *)filename;
- (void) executeCallToTwitPicWithData:(NSData *)imageData;
- (void) executeAsyncCallToTwitPicWithFile:(NSString *)filename;
- (void) executeAsyncCallToTwitPicWithData:(NSData *)imageData;
- (void) printTwitPicURL:(NSNotification *)note;
- (void) showConnectionFailure:(NSNotification *)note;
- (void) showReceivedResponse:(NSNotification *)note;
- (IBAction) showPictureTaker:sender;
- (void) pictureTakerDidEnd:(IKPictureTaker *)picker
returnCode:(NSInteger)code
contextInfo:(void *)contextInfo;
- (BOOL) applicationShouldHandleReopen:(NSApplication *)theApplication
hasVisibleWindows:(BOOL)flag;
- (void) hideStatusBar;
- (IBAction) insertITunesCurrentTrackFull:sender;
- (IBAction) insertITunesCurrentTrackName:sender;
- (IBAction) insertITunesCurrentTrackAlbum:sender;
- (IBAction) insertITunesCurrentTrackArtist:sender;
- (IBAction) insertITunesCurrentTrackGenre:sender;
- (IBAction) insertITunesCurrentTrackComposer:sender;
- (void) insertStringTokenInNewStatusTextField:(NSString *)stringToken;
- (IBAction) switchBetweenUserNames:sender;
- (void) changeToUsernames;
- (void) changeToScreenNames;
- (void) populateWithStatuses;
- (void) populateWithReceivedDMs;
- (void) populateWithSentDMs;
- (IBAction) switchViewOptions:sender;
- (IBAction) followMacsphere:sender;
- (IBAction) visitCanaryWebsite:sender;
- (IBAction) switchFontSize:sender;
- (void) changeToSmallFont;
- (void) changeToLargeFont;
- (IBAction) performInstaFiltering:sender;
- (IBAction) listen:sender;
- (void) speechRecognizer:(NSSpeechRecognizer *)sender
didRecognizeCommand:(id)aCommand;
// Friendship methods
- (void) createFriendshipWithUser:(NSString *)userID;
- (void) destroyFriendshipWithUser:(NSString *)userID;
// Block methods
- (void) blockUserWithID:(NSString *)userID;
- (void) unblockUserWithID:(NSString *)userID;
// Notification methods
- (void) followUserWithID:(NSString *)userID;
- (void) leaveUserWithID:(NSString *)userID;
// Favorite methods
- (void) favoriteStatusWithID:(NSString *)statusID;
// Methods using the main preferences
- (float) timelineRefreshPeriod ;
- (NSUInteger) maxShownUpdates;
- (int) selectedURLShortener;
- (BOOL) willRetrieveAllUpdates;
- (NSString *) statusIDSinceLastExecution;
- (NSString *) receivedDMIDSinceLastExecution;
- (IBAction) paste:sender;
- (void) setStatuses:(NSArray *)theStatuses;
- (NSArray *) statuses;
- (void) setReceivedDirectMessages:(NSArray *)receivedDMs;
- (NSArray *) receivedDirectMessages;
- (void) setSentDirectMessages:(NSArray *)sentDMs;
- (NSArray *) sentDirectMessages;
@property (copy) NSArray *statuses;
@property (copy) NSArray *receivedDirectMessages;
@property (assign) NSArray *sentDirectMessages;
@property (assign) NSString *visibleUserID;
@property (assign) NSString *previousTimeline;
@property (assign) ORSCredentialsManager *authenticator;
@property (assign) ORSTwitterEngine *twitterEngine;
@property (assign) id <ORSShortener> urlShortener;
@property (assign) ORSUpdateDispatcher *updateDispatcher;
@property (assign) ORSTimelineCacheManager *cacheManager;
@property (assign) NSWindow *aboutWindow;
@property (assign) NSTextField *statusTextField;
@property (assign) NSView *statusView;
@property (assign) NSBox *statusBox;
@property (assign) NSTextField *dateDifferenceTextField;
@property (assign) NSCollectionView *mainTimelineCollectionView;
@property (assign) NSScrollView *mainTimelineScrollView;
@property (assign) NSTextField *newStatusTextField;
@property (assign) NSButton *tweetButton;
@property (assign) NSLevelIndicator *charsLeftIndicator;
@property (assign) NSPopUpButton *timelineButton;
@property (assign) NSProgressIndicator *indicator;
@property (assign) NSView *contentView;
@property (assign) NSCollectionViewItem *statusTimelineCollectionViewItem;
@property (assign) NSTextField *receivedDMTextField;
@property (assign) NSView *receivedDMView;
@property (assign) NSBox *receivedDMBox;
@property (assign) NSTextField *receivedDMDateDifferenceTextField;
@property (assign) NSTextField *sentDMTextField;
@property (assign) NSView *sentDMView;
@property (assign) NSBox *sentDMBox;
@property (assign) NSTextField *sentDMDateDifferenceTextField;
@property (assign) NSArrayController *statusArrayController;
@property (assign) NSUserDefaults *defaults;
@property (assign) NSTimer *refreshTimer;
@property SecKeychainItemRef loginItem;
@property (assign) NSString *prevUserID;
@property (assign) NSString *prevPassword;
@property (assign) NSArray *spokenCommands;
@property (assign) NSSpeechRecognizer *recognizer;
@property () BOOL firstBackgroundReceivedDMRetrieval;
@property () BOOL betweenUsers;
@property () NSRange realSelectedRange;
@property () BOOL showScreenNames;
@property (assign) NSTextField *statusBarTextField;
@property (assign) NSImageView *statusBarImageView;
@property (assign) NSButton *statusBarButton;
@end