transmission/macosx/Controller.h

194 lines
6.3 KiB
C
Raw Normal View History

// This file Copyright © 2005-2023 Transmission authors and contributors.
// It may be used under the MIT (SPDX: MIT) license.
// License text can be found in the licenses/ folder.
2007-09-16 01:02:06 +00:00
#import <AppKit/AppKit.h>
#import <Quartz/Quartz.h>
#import <Sparkle/SUUpdaterDelegate.h>
#include <libtransmission/transmission.h>
#import "VDKQueue.h"
2007-09-16 01:02:06 +00:00
@class AddMagnetWindowController;
2009-10-11 02:22:38 +00:00
@class AddWindowController;
@class MessageWindowController;
@class PrefsController;
@class Torrent;
2007-09-16 01:02:06 +00:00
typedef NS_ENUM(NSUInteger, AddType) { //
AddTypeManual,
AddTypeAuto,
AddTypeShowOptions,
AddTypeURL,
AddTypeCreated
};
@interface Controller
: NSObject<NSApplicationDelegate, NSPopoverDelegate, NSSharingServiceDelegate, NSSharingServicePickerDelegate, NSSoundDelegate, NSToolbarDelegate, NSWindowDelegate, QLPreviewPanelDataSource, QLPreviewPanelDelegate, VDKQueueDelegate, SUUpdaterDelegate>
2007-09-16 01:02:06 +00:00
- (void)openFiles:(NSArray<NSString*>*)filenames addType:(AddType)type forcePath:(NSString*)path;
- (void)askOpenConfirmed:(AddWindowController*)addController add:(BOOL)add;
- (void)openCreatedFile:(NSNotification*)notification;
- (void)openFilesWithDict:(NSDictionary*)dictionary;
2022-11-15 16:50:16 +00:00
- (IBAction)openShowSheet:(id)sender;
2007-09-16 01:02:06 +00:00
- (void)openMagnet:(NSString*)address;
- (void)askOpenMagnetConfirmed:(AddMagnetWindowController*)addController add:(BOOL)add;
- (void)invalidOpenAlert:(NSString*)filename;
- (void)invalidOpenMagnetAlert:(NSString*)address;
- (void)duplicateOpenAlert:(NSString*)name;
- (void)duplicateOpenMagnetAlert:(NSString*)address transferName:(NSString*)name;
2007-09-16 01:02:06 +00:00
- (void)openURL:(NSString*)urlString;
2022-11-15 16:50:16 +00:00
- (IBAction)openURLShowSheet:(id)sender;
2007-09-16 01:02:06 +00:00
@property(nonatomic, readonly) tr_session* sessionHandle;
2022-11-15 16:50:16 +00:00
- (IBAction)createFile:(id)sender;
2007-09-16 01:02:06 +00:00
2022-11-15 16:50:16 +00:00
- (IBAction)resumeSelectedTorrents:(id)sender;
- (IBAction)resumeAllTorrents:(id)sender;
- (void)resumeTorrents:(NSArray<Torrent*>*)torrents;
2007-09-16 01:02:06 +00:00
2022-11-15 16:50:16 +00:00
- (IBAction)resumeSelectedTorrentsNoWait:(id)sender;
- (IBAction)resumeWaitingTorrents:(id)sender;
2022-04-29 22:51:40 +00:00
- (void)resumeTorrentsNoWait:(NSArray<Torrent*>*)torrents;
2007-09-16 01:02:06 +00:00
2022-11-15 16:50:16 +00:00
- (IBAction)stopSelectedTorrents:(id)sender;
- (IBAction)stopAllTorrents:(id)sender;
2022-04-29 22:51:40 +00:00
- (void)stopTorrents:(NSArray<Torrent*>*)torrents;
2007-09-16 01:02:06 +00:00
2022-04-29 22:51:40 +00:00
- (void)removeTorrents:(NSArray<Torrent*>*)torrents deleteData:(BOOL)deleteData;
- (void)confirmRemoveTorrents:(NSArray<Torrent*>*)torrents deleteData:(BOOL)deleteData;
2022-11-15 16:50:16 +00:00
- (IBAction)removeNoDelete:(id)sender;
- (IBAction)removeDeleteData:(id)sender;
2007-09-16 01:02:06 +00:00
2022-11-15 16:50:16 +00:00
- (IBAction)clearCompleted:(id)sender;
2022-11-15 16:50:16 +00:00
- (IBAction)moveDataFilesSelected:(id)sender;
2022-04-29 22:51:40 +00:00
- (void)moveDataFiles:(NSArray<Torrent*>*)torrents;
2007-09-16 01:02:06 +00:00
2022-11-15 16:50:16 +00:00
- (IBAction)copyTorrentFiles:(id)sender;
2022-04-29 22:51:40 +00:00
- (void)copyTorrentFileForTorrents:(NSMutableArray<Torrent*>*)torrents;
2007-09-16 01:02:06 +00:00
2022-11-15 16:50:16 +00:00
- (IBAction)copyMagnetLinks:(id)sender;
2022-11-15 16:50:16 +00:00
- (IBAction)revealFile:(id)sender;
2007-09-16 01:02:06 +00:00
- (IBAction)renameSelected:(id)sender;
2022-11-15 16:50:16 +00:00
- (IBAction)announceSelectedTorrents:(id)sender;
2007-09-16 01:02:06 +00:00
2022-11-15 16:50:16 +00:00
- (IBAction)verifySelectedTorrents:(id)sender;
- (void)verifyTorrents:(NSArray<Torrent*>*)torrents;
2007-09-16 01:02:06 +00:00
2022-04-29 22:51:40 +00:00
@property(nonatomic, readonly) NSArray<Torrent*>* selectedTorrents;
@property(nonatomic, readonly) PrefsController* prefsController;
2022-11-15 16:50:16 +00:00
- (IBAction)showPreferenceWindow:(id)sender;
2007-09-16 01:02:06 +00:00
2022-11-15 16:50:16 +00:00
- (IBAction)showAboutWindow:(id)sender;
2007-09-16 01:02:06 +00:00
2022-11-15 16:50:16 +00:00
- (IBAction)showInfo:(id)sender;
- (void)resetInfo;
2022-11-15 16:50:16 +00:00
- (IBAction)setInfoTab:(id)sender;
2007-09-16 01:02:06 +00:00
@property(nonatomic, readonly) MessageWindowController* messageWindowController;
2022-11-15 16:50:16 +00:00
- (IBAction)showMessageWindow:(id)sender;
- (IBAction)showStatsWindow:(id)sender;
2007-09-16 01:02:06 +00:00
- (void)updateUI;
- (void)fullUpdateUI;
2007-09-16 01:02:06 +00:00
- (void)setBottomCountText:(BOOL)filtering;
- (Torrent*)torrentForHash:(NSString*)hash;
- (void)torrentFinishedDownloading:(NSNotification*)notification;
- (void)torrentRestartedDownloading:(NSNotification*)notification;
- (void)torrentFinishedSeeding:(NSNotification*)notification;
2007-09-16 01:02:06 +00:00
- (void)updateTorrentHistory;
2007-09-16 01:02:06 +00:00
- (void)applyFilter;
- (void)sortTorrentsAndIncludeQueueOrder:(BOOL)includeQueueOrder;
- (void)sortTorrentsCallUpdates:(BOOL)callUpdates includeQueueOrder:(BOOL)includeQueueOrder;
- (void)rearrangeTorrentTableArray:(NSMutableArray*)rearrangeArray
forParent:(id)parent
withSortDescriptors:(NSArray*)descriptors
beganTableUpdate:(BOOL*)beganTableUpdate;
2022-11-15 16:50:16 +00:00
- (IBAction)setSort:(id)sender;
- (IBAction)setSortByGroup:(id)sender;
- (IBAction)setSortReverse:(id)sender;
2007-12-17 19:47:06 +00:00
2022-11-15 16:50:16 +00:00
- (IBAction)switchFilter:(id)sender;
2007-09-16 01:02:06 +00:00
- (IBAction)showGlobalPopover:(id)sender;
- (void)setGroup:(id)sender; //used by delegate-generated menu items
2007-12-17 16:06:20 +00:00
2022-11-15 16:50:16 +00:00
- (IBAction)toggleSpeedLimit:(id)sender;
- (IBAction)speedLimitChanged:(id)sender;
- (void)altSpeedToggledCallbackIsLimited:(NSDictionary*)dict;
2007-09-16 01:02:06 +00:00
- (void)changeAutoImport;
- (void)checkAutoImportDirectory;
2007-09-16 01:02:06 +00:00
- (void)beginCreateFile:(NSNotification*)notification;
2007-09-16 01:02:06 +00:00
- (void)sleepCallback:(natural_t)messageType argument:(void*)messageArgument;
2007-09-16 01:02:06 +00:00
@property(nonatomic, readonly) VDKQueue* fileWatcherQueue;
- (void)torrentTableViewSelectionDidChange:(NSNotification*)notification;
2007-09-16 01:02:06 +00:00
2022-11-15 16:50:16 +00:00
- (IBAction)toggleSmallView:(id)sender;
- (IBAction)togglePiecesBar:(id)sender;
- (IBAction)toggleAvailabilityBar:(id)sender;
2007-09-16 01:02:06 +00:00
2022-11-15 16:50:16 +00:00
- (IBAction)toggleStatusBar:(id)sender;
- (IBAction)toggleFilterBar:(id)sender;
- (IBAction)toggleToolbarShown:(id)sender;
- (void)focusFilterField;
2007-09-16 01:02:06 +00:00
- (void)allToolbarClicked:(id)sender;
- (void)selectedToolbarClicked:(id)sender;
2022-06-16 19:59:54 +00:00
- (void)updateMainWindow;
- (void)setWindowSizeToFit;
- (void)updateForAutoSize;
- (void)updateWindowAfterToolbarChange;
2022-06-16 19:59:54 +00:00
- (void)removeStackViewHeightConstraints;
@property(nonatomic, readonly) CGFloat minScrollViewHeightAllowed;
@property(nonatomic, readonly) CGFloat toolbarHeight;
@property(nonatomic, readonly) CGFloat mainWindowComponentHeight;
@property(nonatomic, readonly) CGFloat scrollViewHeight;
@property(nonatomic, getter=isFullScreen, readonly) BOOL fullScreen;
- (void)updateForExpandCollapse;
2022-11-15 16:50:16 +00:00
- (IBAction)showMainWindow:(id)sender;
2007-09-16 01:02:06 +00:00
2022-11-15 16:50:16 +00:00
- (IBAction)toggleQuickLook:(id)sender;
2022-11-15 16:50:16 +00:00
- (IBAction)linkHomepage:(id)sender;
- (IBAction)linkForums:(id)sender;
- (IBAction)linkGitHub:(id)sender;
- (IBAction)linkDonate:(id)sender;
2007-09-16 01:02:06 +00:00
- (void)rpcCallback:(tr_rpc_callback_type)type forTorrentStruct:(struct tr_torrent*)torrentStruct;
- (void)rpcAddTorrentStruct:(struct tr_torrent*)torrentStruct;
- (void)rpcRemoveTorrent:(Torrent*)torrent deleteData:(BOOL)deleteData;
- (void)rpcStartedStoppedTorrent:(Torrent*)torrent;
- (void)rpcChangedTorrent:(Torrent*)torrent;
- (void)rpcMovedTorrent:(Torrent*)torrent;
- (void)rpcUpdateQueue;
2007-09-16 01:02:06 +00:00
@end