1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +00:00
transmission/macosx/Controller.h

183 lines
7 KiB
C
Raw Normal View History

2006-01-12 17:43:21 +00:00
/******************************************************************************
* $Id$
*
2006-03-23 12:39:39 +00:00
* Copyright (c) 2005-2006 Transmission authors and contributors
2006-01-12 17:43:21 +00:00
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*****************************************************************************/
2006-01-12 18:20:48 +00:00
#ifndef CONTROLLER_H
#define CONTROLLER_H
#import <Cocoa/Cocoa.h>
#import <transmission.h>
#import "PrefsController.h"
#import "InfoWindowController.h"
2006-01-20 01:51:07 +00:00
#import "Badger.h"
#import "SmoothAquaView.h"
2006-07-15 18:05:59 +00:00
#import "FilterBarView.h"
2006-07-15 16:22:42 +00:00
#import "BarButton.h"
2006-01-12 17:43:21 +00:00
2006-01-12 18:29:20 +00:00
@class TorrentTableView;
2006-01-12 18:40:47 +00:00
@interface Controller : NSObject
2006-01-12 17:43:21 +00:00
{
2006-03-23 12:39:39 +00:00
tr_handle_t * fLib;
2006-04-05 13:52:00 +00:00
int fCompleted;
NSMutableArray * fTorrents, * fFilteredTorrents;
PrefsController * fPrefsController;
NSUserDefaults * fDefaults;
InfoWindowController * fInfoController;
2006-01-12 18:57:23 +00:00
IBOutlet NSWindow * fWindow;
IBOutlet NSScrollView * fScrollView;
2006-01-12 18:57:23 +00:00
IBOutlet TorrentTableView * fTableView;
NSToolbar * fToolbar;
IBOutlet NSMenuItem * fAdvancedBarItem, * fSmallViewItem,
* fSpeedLimitItem, * fSpeedLimitDockItem;
IBOutlet NSButton * fActionButton, * fSpeedLimitButton;
IBOutlet SmoothAquaView * fStatusBar;
BOOL fStatusBarVisible;
IBOutlet NSTextField * fTotalDLField, * fTotalULField, * fTotalTorrentsField;
NSString * fSortType;
2006-06-25 18:33:52 +00:00
IBOutlet NSMenuItem * fNameSortItem, * fStateSortItem, * fProgressSortItem,
* fDateSortItem, * fOrderSortItem;
2006-07-15 16:22:42 +00:00
2006-07-15 18:05:59 +00:00
IBOutlet FilterBarView * fFilterBar;
2006-07-15 16:22:42 +00:00
BOOL fFilterBarVisible;
NSString * fFilterType;
2006-07-15 16:22:42 +00:00
IBOutlet BarButton * fNoFilterButton, * fPauseFilterButton,
* fSeedFilterButton, * fDownloadFilterButton;
IBOutlet NSMenuItem * fNextInfoTabItem, * fPrevInfoTabItem;
IBOutlet NSMenu * fUploadMenu, * fDownloadMenu;
IBOutlet NSMenuItem * fUploadLimitItem, * fUploadNoLimitItem,
* fDownloadLimitItem, * fDownloadNoLimitItem,
* fRatioSetItem, * fRatioNotSetItem;
2006-01-12 18:57:23 +00:00
io_connect_t fRootPort;
NSTimer * fTimer;
NSTimer * fAutoImportTimer;
2006-07-13 11:30:38 +00:00
NSMutableArray * fAutoImportedNames;
BOOL fUpdateInProgress;
Badger * fBadger;
2006-01-12 17:43:21 +00:00
}
- (void) openShowSheet: (id) sender;
- (void) openSheetClosed: (NSOpenPanel *) s returnCode: (int) code contextInfo: (void *) info;
2006-01-12 18:57:23 +00:00
- (void) quitSheetDidEnd: (NSWindow *) sheet returnCode: (int) returnCode contextInfo: (void *) contextInfo;
- (NSArray *) torrentsAtIndexes: (NSIndexSet *) indexSet;
- (void) torrentNumberChanged;
- (void) resumeSelectedTorrents: (id) sender;
2006-01-12 18:57:23 +00:00
- (void) resumeAllTorrents: (id) sender;
- (void) resumeTorrents: (NSArray *) torrents;
- (void) stopSelectedTorrents: (id) sender;
2006-04-07 13:09:19 +00:00
- (void) stopAllTorrents: (id) sender;
- (void) stopTorrents: (NSArray *) torrents;
2006-01-12 18:57:23 +00:00
2006-07-08 21:03:00 +00:00
- (void) removeTorrents: (NSArray *) torrents
deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteData;
- (void) removeSheetDidEnd: (NSWindow *) sheet returnCode: (int) returnCode
contextInfo: (NSDictionary *) dict;
2006-07-08 21:03:00 +00:00
- (void) confirmRemoveTorrents: (NSArray *) torrents
deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteTorrent;
- (void) removeNoDelete: (id) sender;
2006-07-08 21:03:00 +00:00
- (void) removeDeleteData: (id) sender;
- (void) removeDeleteTorrent: (id) sender;
- (void) removeDeleteDataAndTorrent: (id) sender;
- (void) copyTorrentFile: (id) sender;
2006-06-11 00:16:31 +00:00
- (void) copyTorrentFileForTorrents: (NSMutableArray *) torrents;
- (void) saveTorrentCopySheetClosed: (NSSavePanel *) panel returnCode: (int) code
contextInfo: (NSMutableArray *) torrents;
- (void) revealFile: (id) sender;
- (void) showPreferenceWindow: (id) sender;
2006-01-12 17:43:21 +00:00
- (void) showInfo: (id) sender;
- (void) setInfoTab: (id) sender;
- (void) updateUI: (NSTimer *) timer;
- (void) updateTorrentHistory;
- (void) sortTorrents;
2006-07-16 06:20:15 +00:00
- (void) sortTorrentsIgnoreSelected;
- (void) setSort: (id) sender;
- (void) applyFilter;
- (void) setFilter: (id) sender;
- (void) toggleSpeedLimit: (id) sender;
- (void) setLimitGlobalEnabled: (id) sender;
- (void) setQuickLimitGlobal: (id) sender;
- (void) limitGlobalChange: (NSNotification *) notification;
- (void) setRatioGlobalEnabled: (id) sender;
- (void) setQuickRatioGlobal: (id) sender;
- (void) ratioGlobalChange: (NSNotification *) notification;
2006-06-23 22:32:01 +00:00
- (void) checkWaitingForStopped: (NSNotification *) notification;
- (void) checkToStartWaiting: (Torrent *) finishedTorrent;
2006-06-23 22:32:01 +00:00
- (void) torrentStartSettingChange: (NSNotification *) notification;
- (void) globalStartSettingChange: (NSNotification *) notification;
- (void) torrentStoppedForRatio: (NSNotification *) notification;
2006-06-23 22:32:01 +00:00
- (void) attemptToStartAuto: (Torrent *) torrent;
- (void) attemptToStartMultipleAuto: (NSArray *) torrents;
2006-07-04 18:42:12 +00:00
- (void) reloadInspectorSettings: (NSNotification *) notification;
- (void) checkAutoImportDirectory: (NSTimer *) t;
- (void) autoImportChange: (NSNotification *) notification;
- (void) sleepCallBack: (natural_t) messageType argument: (void *) messageArgument;
2006-01-12 18:29:20 +00:00
- (void) toggleSmallView: (id) sender;
- (void) toggleStatusBar: (id) sender;
- (void) showStatusBar: (BOOL) show animate: (BOOL) animate;
2006-07-15 16:22:42 +00:00
- (void) toggleFilterBar: (id) sender;
- (void) showFilterBar: (BOOL) show animate: (BOOL) animate;
- (void) toggleAdvancedBar: (id) sender;
2006-01-12 18:57:23 +00:00
- (void) showMainWindow: (id) sender;
- (void) linkHomepage: (id) sender;
- (void) linkForums: (id) sender;
- (void) checkUpdate: (id) sender;
- (void) prepareForUpdate: (NSNotification *) notification;
2006-01-29 22:01:08 +00:00
2006-01-12 17:43:21 +00:00
@end
2006-01-12 18:20:48 +00:00
#endif