1 | /****************************************************************************** |
---|
2 | * $Id: Controller.h 291 2006-06-08 04:40:45Z 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; |
---|
53 | IBOutlet NSButton * fActionButton; |
---|
54 | |
---|
55 | IBOutlet SmoothAquaView * fStatusBar; |
---|
56 | BOOL fStatusBarVisible; |
---|
57 | IBOutlet NSTextField * fTotalDLField; |
---|
58 | IBOutlet NSTextField * fTotalULField; |
---|
59 | IBOutlet NSTextField * fTotalTorrentsField; |
---|
60 | |
---|
61 | NSString * fSortType; |
---|
62 | IBOutlet NSMenuItem * fNameSortItem, * fStateSortItem, |
---|
63 | * fProgressSortItem, * fDateSortItem; |
---|
64 | |
---|
65 | IBOutlet NSMenuItem * fNextInfoTabItem, * fPrevInfoTabItem; |
---|
66 | |
---|
67 | IBOutlet NSMenu * fUploadMenu, * fDownloadMenu; |
---|
68 | IBOutlet NSMenuItem * fUploadLimitItem, * fUploadNoLimitItem, |
---|
69 | * fDownloadLimitItem, * fDownloadNoLimitItem, |
---|
70 | * fRatioSetItem, * fRatioNotSetItem; |
---|
71 | |
---|
72 | io_connect_t fRootPort; |
---|
73 | NSTimer * fTimer; |
---|
74 | |
---|
75 | BOOL fHasGrowl; |
---|
76 | Badger * fBadger; |
---|
77 | BOOL fUpdateInProgress; |
---|
78 | } |
---|
79 | |
---|
80 | - (void) advancedChanged: (id) sender; |
---|
81 | - (void) openShowSheet: (id) sender; |
---|
82 | - (void) openSheetClosed: (NSOpenPanel *) s returnCode: (int) code |
---|
83 | contextInfo: (void *) info; |
---|
84 | |
---|
85 | - (void) quitSheetDidEnd: (NSWindow *) sheet returnCode: (int) returnCode |
---|
86 | contextInfo: (void *) contextInfo; |
---|
87 | |
---|
88 | - (NSArray *) torrentsAtIndexes: (NSIndexSet *) indexSet; |
---|
89 | - (void) torrentNumberChanged; |
---|
90 | |
---|
91 | - (void) resumeTorrent: (id) sender; |
---|
92 | - (void) resumeAllTorrents: (id) sender; |
---|
93 | - (void) resumeTorrentWithIndex: (NSIndexSet *) indexSet; |
---|
94 | - (void) stopTorrent: (id) sender; |
---|
95 | - (void) stopAllTorrents: (id) sender; |
---|
96 | - (void) stopTorrentWithIndex: (NSIndexSet *) indexSet; |
---|
97 | |
---|
98 | - (void) removeTorrent: (id) sender; |
---|
99 | - (void) removeTorrentDeleteData: (id) sender; |
---|
100 | - (void) removeTorrentWithIndex: (NSIndexSet *) indexSet |
---|
101 | deleteData: (BOOL) deleteData; |
---|
102 | |
---|
103 | - (void) removeSheetDidEnd: (NSWindow *) sheet returnCode: (int) returnCode |
---|
104 | contextInfo: (NSDictionary *) dict; |
---|
105 | - (void) confirmRemoveTorrents: (NSArray *) torrents |
---|
106 | deleteData: (BOOL) deleteData; |
---|
107 | |
---|
108 | - (void) revealFile: (id) sender; |
---|
109 | |
---|
110 | - (void) showPreferenceWindow: (id) sender; |
---|
111 | |
---|
112 | - (void) showInfo: (id) sender; |
---|
113 | - (void) setInfoTab: (id) sender; |
---|
114 | |
---|
115 | - (void) updateUI: (NSTimer *) timer; |
---|
116 | - (void) updateTorrentHistory; |
---|
117 | |
---|
118 | - (void) sortTorrents; |
---|
119 | - (void) setSort: (id) sender; |
---|
120 | |
---|
121 | - (void) setLimitGlobalEnabled: (id) sender; |
---|
122 | - (void) setQuickLimitGlobal: (id) sender; |
---|
123 | - (void) limitGlobalChange: (NSNotification *) notification; |
---|
124 | |
---|
125 | - (void) setRatioGlobalEnabled: (id) sender; |
---|
126 | - (void) setQuickRatioGlobal: (id) sender; |
---|
127 | - (void) ratioGlobalChange: (NSNotification *) notification; |
---|
128 | - (void) ratioSingleChange: (NSNotification *) notification; |
---|
129 | |
---|
130 | - (void) sleepCallBack: (natural_t) messageType argument: |
---|
131 | (void *) messageArgument; |
---|
132 | |
---|
133 | - (void) toggleStatusBar: (id) sender; |
---|
134 | - (void) showStatusBar: (BOOL) show animate: (BOOL) animate; |
---|
135 | |
---|
136 | - (void) showMainWindow: (id) sender; |
---|
137 | - (void) linkHomepage: (id) sender; |
---|
138 | - (void) linkForums: (id) sender; |
---|
139 | - (void) notifyGrowl: (NSString *) file; |
---|
140 | - (void) growlRegister: (id) sender; |
---|
141 | |
---|
142 | - (void) checkUpdate: (id) sender; |
---|
143 | - (void) prepareForUpdate: (NSNotification *) notification; |
---|
144 | |
---|
145 | @end |
---|
146 | |
---|
147 | #endif |
---|