1 | /****************************************************************************** |
---|
2 | * $Id: Controller.h 555 2006-07-08 21:03:00Z livings124 $ |
---|
3 | * |
---|
4 | * Copyright (c) 2005-2006 Transmission authors and contributors |
---|
5 | * |
---|
6 | * Permission is hereby granted, free of charge, to any person obtaining a |
---|
7 | * copy of this software and associated documentation files (the "Software"), |
---|
8 | * to deal in the Software without restriction, including without limitation |
---|
9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
---|
10 | * and/or sell copies of the Software, and to permit persons to whom the |
---|
11 | * Software is furnished to do so, subject to the following conditions: |
---|
12 | * |
---|
13 | * The above copyright notice and this permission notice shall be included in |
---|
14 | * all copies or substantial portions of the Software. |
---|
15 | * |
---|
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
---|
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
---|
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
---|
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
---|
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
---|
21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
---|
22 | * DEALINGS IN THE SOFTWARE. |
---|
23 | *****************************************************************************/ |
---|
24 | |
---|
25 | #ifndef CONTROLLER_H |
---|
26 | #define CONTROLLER_H |
---|
27 | |
---|
28 | #import <Cocoa/Cocoa.h> |
---|
29 | #import <transmission.h> |
---|
30 | #import "PrefsController.h" |
---|
31 | #import "InfoWindowController.h" |
---|
32 | #import "Badger.h" |
---|
33 | #import "SmoothAquaView.h" |
---|
34 | |
---|
35 | @class TorrentTableView; |
---|
36 | |
---|
37 | @interface Controller : NSObject |
---|
38 | { |
---|
39 | tr_handle_t * fLib; |
---|
40 | int fCompleted; |
---|
41 | NSMutableArray * fTorrents; |
---|
42 | |
---|
43 | PrefsController * fPrefsController; |
---|
44 | NSUserDefaults * fDefaults; |
---|
45 | InfoWindowController * fInfoController; |
---|
46 | |
---|
47 | IBOutlet NSWindow * fWindow; |
---|
48 | IBOutlet NSScrollView * fScrollView; |
---|
49 | IBOutlet TorrentTableView * fTableView; |
---|
50 | NSToolbar * fToolbar; |
---|
51 | |
---|
52 | IBOutlet NSMenuItem * fAdvancedBarItem, * fSmallViewItem, |
---|
53 | * fSpeedLimitItem, * fSpeedLimitDockItem; |
---|
54 | IBOutlet NSButton * fActionButton, * fSpeedLimitButton; |
---|
55 | |
---|
56 | IBOutlet SmoothAquaView * fStatusBar; |
---|
57 | BOOL fStatusBarVisible; |
---|
58 | IBOutlet NSTextField * fTotalDLField, * fTotalULField, * fTotalTorrentsField; |
---|
59 | |
---|
60 | NSString * fSortType; |
---|
61 | IBOutlet NSMenuItem * fNameSortItem, * fStateSortItem, * fProgressSortItem, |
---|
62 | * fDateSortItem, * fOrderSortItem; |
---|
63 | |
---|
64 | IBOutlet NSMenuItem * fNextInfoTabItem, * fPrevInfoTabItem; |
---|
65 | |
---|
66 | IBOutlet NSMenu * fUploadMenu, * fDownloadMenu; |
---|
67 | IBOutlet NSMenuItem * fUploadLimitItem, * fUploadNoLimitItem, |
---|
68 | * fDownloadLimitItem, * fDownloadNoLimitItem, |
---|
69 | * fRatioSetItem, * fRatioNotSetItem; |
---|
70 | |
---|
71 | io_connect_t fRootPort; |
---|
72 | NSTimer * fTimer; |
---|
73 | |
---|
74 | NSTimer * fAutoImportTimer; |
---|
75 | NSArray * fAutoImportedNames; |
---|
76 | |
---|
77 | BOOL fHasGrowl; |
---|
78 | Badger * fBadger; |
---|
79 | BOOL fUpdateInProgress; |
---|
80 | } |
---|
81 | |
---|
82 | - (void) openShowSheet: (id) sender; |
---|
83 | - (void) openSheetClosed: (NSOpenPanel *) s returnCode: (int) code |
---|
84 | contextInfo: (void *) info; |
---|
85 | |
---|
86 | - (void) quitSheetDidEnd: (NSWindow *) sheet returnCode: (int) returnCode |
---|
87 | contextInfo: (void *) contextInfo; |
---|
88 | |
---|
89 | - (NSArray *) torrentsAtIndexes: (NSIndexSet *) indexSet; |
---|
90 | - (void) torrentNumberChanged; |
---|
91 | |
---|
92 | - (void) resumeSelectedTorrents: (id) sender; |
---|
93 | - (void) resumeAllTorrents: (id) sender; |
---|
94 | - (void) resumeTorrents: (NSArray *) torrents; |
---|
95 | - (void) stopSelectedTorrents: (id) sender; |
---|
96 | - (void) stopAllTorrents: (id) sender; |
---|
97 | - (void) stopTorrents: (NSArray *) torrents; |
---|
98 | |
---|
99 | - (void) removeTorrents: (NSArray *) torrents |
---|
100 | deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteData; |
---|
101 | - (void) removeSheetDidEnd: (NSWindow *) sheet returnCode: (int) returnCode |
---|
102 | contextInfo: (NSDictionary *) dict; |
---|
103 | - (void) confirmRemoveTorrents: (NSArray *) torrents |
---|
104 | deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteTorrent; |
---|
105 | - (void) removeNoDelete: (id) sender; |
---|
106 | - (void) removeDeleteData: (id) sender; |
---|
107 | - (void) removeDeleteTorrent: (id) sender; |
---|
108 | - (void) removeDeleteDataAndTorrent: (id) sender; |
---|
109 | |
---|
110 | - (void) copyTorrentFile: (id) sender; |
---|
111 | - (void) copyTorrentFileForTorrents: (NSMutableArray *) torrents; |
---|
112 | - (void) saveTorrentCopySheetClosed: (NSSavePanel *) panel returnCode: (int) code |
---|
113 | contextInfo: (NSMutableArray *) torrents; |
---|
114 | |
---|
115 | - (void) revealFile: (id) sender; |
---|
116 | |
---|
117 | - (void) showPreferenceWindow: (id) sender; |
---|
118 | |
---|
119 | - (void) showInfo: (id) sender; |
---|
120 | - (void) setInfoTab: (id) sender; |
---|
121 | |
---|
122 | - (void) updateUI: (NSTimer *) timer; |
---|
123 | - (void) updateTorrentHistory; |
---|
124 | |
---|
125 | - (void) sortTorrents; |
---|
126 | - (void) setSort: (id) sender; |
---|
127 | |
---|
128 | - (void) toggleSpeedLimit: (id) sender; |
---|
129 | |
---|
130 | - (void) setLimitGlobalEnabled: (id) sender; |
---|
131 | - (void) setQuickLimitGlobal: (id) sender; |
---|
132 | - (void) limitGlobalChange: (NSNotification *) notification; |
---|
133 | |
---|
134 | - (void) setRatioGlobalEnabled: (id) sender; |
---|
135 | - (void) setQuickRatioGlobal: (id) sender; |
---|
136 | - (void) ratioGlobalChange: (NSNotification *) notification; |
---|
137 | |
---|
138 | - (void) checkWaitingForStopped: (NSNotification *) notification; |
---|
139 | - (void) checkWaitingForFinished: (Torrent *) finishedTorrent; |
---|
140 | - (void) torrentStartSettingChange: (NSNotification *) notification; |
---|
141 | - (void) globalStartSettingChange: (NSNotification *) notification; |
---|
142 | |
---|
143 | - (void) torrentStoppedForRatio: (NSNotification *) notification; |
---|
144 | |
---|
145 | - (void) attemptToStartAuto: (Torrent *) torrent; |
---|
146 | - (void) attemptToStartMultipleAuto: (NSArray *) torrents; |
---|
147 | |
---|
148 | - (void) reloadInspectorSettings: (NSNotification *) notification; |
---|
149 | |
---|
150 | - (void) checkAutoImportDirectory: (NSTimer *) t; |
---|
151 | - (void) autoImportChange: (NSNotification *) notification; |
---|
152 | |
---|
153 | - (void) sleepCallBack: (natural_t) messageType argument: |
---|
154 | (void *) messageArgument; |
---|
155 | |
---|
156 | - (void) toggleSmallView: (id) sender; |
---|
157 | |
---|
158 | - (void) toggleStatusBar: (id) sender; |
---|
159 | - (void) showStatusBar: (BOOL) show animate: (BOOL) animate; |
---|
160 | - (void) toggleAdvancedBar: (id) sender; |
---|
161 | |
---|
162 | - (void) showMainWindow: (id) sender; |
---|
163 | - (void) linkHomepage: (id) sender; |
---|
164 | - (void) linkForums: (id) sender; |
---|
165 | |
---|
166 | - (void) notifyGrowl: (NSString *) title message: (NSString *) message identifier: (NSString *) ident; |
---|
167 | - (void) growlRegister; |
---|
168 | |
---|
169 | - (void) checkUpdate: (id) sender; |
---|
170 | - (void) prepareForUpdate: (NSNotification *) notification; |
---|
171 | |
---|
172 | @end |
---|
173 | |
---|
174 | #endif |
---|