source: trunk/macosx/Controller.h @ 446

Last change on this file since 446 was 446, checked in by livings124, 16 years ago

The beginning of queueing. Has some work to go, but the basic infrastructure is set up.

  • Property svn:keywords set to Date Rev Author Id
File size: 5.8 KB
Line 
1/******************************************************************************
2 * $Id: Controller.h 446 2006-06-23 15:06:27Z 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) removeWithIndex: (NSIndexSet *) indexSet
99        deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteData;
100- (void) removeSheetDidEnd: (NSWindow *) sheet returnCode: (int) returnCode
101                        contextInfo: (NSDictionary *) dict;
102- (void) confirmRemove: (NSArray *) torrents
103        deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteTorrent;
104- (void) removeNoDelete:                (id) sender;
105- (void) removeDeleteData:       (id) sender;
106- (void) removeDeleteTorrent:    (id) sender;
107- (void) removeDeleteBoth:       (id) sender;
108
109- (void) copyTorrentFile: (id) sender;
110- (void) copyTorrentFileForTorrents: (NSMutableArray *) torrents;
111- (void) saveTorrentCopySheetClosed: (NSSavePanel *) panel returnCode: (int) code
112    contextInfo: (NSMutableArray *) torrents;
113
114- (void) revealFile: (id) sender;
115
116- (void) showPreferenceWindow: (id) sender;
117
118- (void) showInfo: (id) sender;
119- (void) setInfoTab: (id) sender;
120
121- (void) updateUI: (NSTimer *) timer;
122- (void) updateTorrentHistory;
123
124- (void) sortTorrents;
125- (void) setSort: (id) sender;
126
127- (void) setLimitGlobalEnabled: (id) sender;
128- (void) setQuickLimitGlobal: (id) sender;
129- (void) limitGlobalChange: (NSNotification *) notification;
130
131- (void) setRatioGlobalEnabled: (id) sender;
132- (void) setQuickRatioGlobal: (id) sender;
133- (void) ratioGlobalChange: (NSNotification *) notification;
134- (void) ratioSingleChange: (NSNotification *) notification;
135
136- (void) checkWaitingForFinished: (NSNotification *) notification;
137
138- (void) sleepCallBack: (natural_t) messageType argument:
139                        (void *) messageArgument;
140
141- (void) toggleStatusBar: (id) sender;
142- (void) showStatusBar: (BOOL) show animate: (BOOL) animate;
143
144- (void) showMainWindow:    (id) sender;
145- (void) linkHomepage:      (id) sender;
146- (void) linkForums:        (id) sender;
147
148- (void) notifyGrowl:       (NSString *) file;
149- (void) growlRegister;
150
151- (void) checkUpdate:       (id) sender;
152- (void) prepareForUpdate:  (NSNotification *) notification;
153
154@end
155
156#endif
Note: See TracBrowser for help on using the repository browser.