transmission/macosx/Torrent.h

187 lines
5.3 KiB
C
Raw Normal View History

2006-07-16 19:39:23 +00:00
/******************************************************************************
* $Id$
*
* Copyright (c) 2006 Transmission authors and contributors
*
* 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.
*****************************************************************************/
#import <Cocoa/Cocoa.h>
#import <transmission.h>
@interface Torrent : NSObject
{
tr_handle_t * fLib;
tr_torrent_t * fHandle;
tr_info_t * fInfo;
tr_stat_t * fStat;
BOOL fResumeOnWake;
NSDate * fDate, * fAnnounceDate;
2006-07-16 19:39:23 +00:00
BOOL fUseIncompleteFolder;
NSString * fDownloadFolder, * fIncompleteFolder;
BOOL fPublicTorrent;
2006-07-16 19:39:23 +00:00
NSString * fPublicTorrentLocation;
NSUserDefaults * fDefaults;
NSImage * fIcon, * fIconFlipped, * fIconSmall;
NSMutableString * fNameString, * fProgressString, * fStatusString, * fShortStatusString, * fRemainingTimeString;
2006-07-16 19:39:23 +00:00
int fUploadLimit, fDownloadLimit;
2006-07-16 19:39:23 +00:00
float fRatioLimit;
BOOL fLimitCustom, fCheckUpload, fCheckDownload,
fRatioCustom, fShouldStopAtRatio,
fFinishedSeeding, fWaitToStart, fError;
2006-07-16 19:39:23 +00:00
int fOrderValue;
NSBitmapImageRep * fBitmap;
int8_t * fPieces;
2006-07-16 19:39:23 +00:00
}
- (id) initWithPath: (NSString *) path forceDeleteTorrent: (BOOL) delete lib: (tr_handle_t *) lib;
2006-07-16 19:39:23 +00:00
- (id) initWithHistory: (NSDictionary *) history lib: (tr_handle_t *) lib;
- (NSDictionary *) history;
- (void) setDownloadFolder: (NSString *) path;
- (NSString *) downloadFolder;
- (void) getAvailability: (int8_t *) tab size: (int) size;
2006-10-13 01:34:15 +00:00
- (void) getAmountFinished: (float *) tab size: (int) size;
2006-07-16 19:39:23 +00:00
- (void) update;
- (NSDictionary *) infoForCurrentView;
2006-07-16 19:39:23 +00:00
- (void) startTransfer;
- (void) stopTransfer;
- (void) stopTransferForQuit;
- (void) sleep;
- (void) wakeUp;
- (void) announce;
- (NSDate *) announceDate;
2006-07-16 19:39:23 +00:00
- (float) ratio;
- (BOOL) customRatioSetting;
- (void) setCustomRatioSetting: (BOOL) setting;
- (BOOL) shouldStopAtRatio;
- (void) setShouldStopAtRatio: (BOOL) setting;
2006-07-16 19:39:23 +00:00
- (float) ratioLimit;
- (void) setRatioLimit: (float) limit;
- (BOOL) checkUpload;
- (void) setLimitUpload: (BOOL) limit;
- (int) uploadLimit;
- (void) setUploadLimit: (int) limit;
- (BOOL) checkDownload;
- (void) setLimitDownload: (BOOL) limit;
- (int) downloadLimit;
- (void) setDownloadLimit: (int) limit;
- (BOOL) customLimitSetting;
- (void) setCustomLimitSetting: (BOOL) setting;
- (void) updateSpeedSetting: (NSNotification *) notification;
2006-07-16 19:39:23 +00:00
- (void) setWaitToStart: (BOOL) wait;
- (BOOL) waitingToStart;
- (void) revealData;
- (void) revealPublicTorrent;
2006-07-16 19:39:23 +00:00
- (void) trashData;
- (void) trashTorrent;
- (BOOL) alertForRemainingDiskSpace;
- (BOOL) alertForVolumeAvailable;
- (BOOL) alertForMoveVolumeAvailable;
2006-07-16 19:39:23 +00:00
- (NSImage *) icon;
- (NSImage *) iconFlipped;
- (NSImage *) iconSmall;
- (NSString *) name;
- (uint64_t) size;
- (NSString *) trackerAddress;
- (NSString *) trackerAddressAnnounce;
- (NSString *) comment;
- (NSString *) creator;
- (NSDate *) dateCreated;
2006-07-16 19:39:23 +00:00
- (int) pieceSize;
- (int) pieceCount;
- (NSString *) hashString;
- (BOOL) privateTorrent;
2006-07-16 19:39:23 +00:00
- (NSString *) torrentLocation;
- (NSString *) publicTorrentLocation;
- (NSString *) dataLocation;
- (BOOL) publicTorrent;
- (NSString *) stateString;
- (float) progress;
- (int) eta;
- (BOOL) isActive;
- (BOOL) isSeeding;
- (BOOL) isPaused;
- (BOOL) isError;
- (NSString *) errorMessage;
- (BOOL) justFinished;
2006-07-16 19:39:23 +00:00
- (NSArray *) peers;
- (NSString *) progressString;
- (NSString *) statusString;
- (NSString *) shortStatusString;
- (NSString *) remainingTimeString;
2006-07-16 19:39:23 +00:00
- (int) seeders;
- (int) leechers;
- (int) completedFromTracker;
2006-07-16 19:39:23 +00:00
- (int) totalPeers;
- (int) totalPeersIncoming;
- (int) totalPeersOutgoing;
2006-07-16 19:39:23 +00:00
- (int) peersUploading;
- (int) peersDownloading;
- (float) downloadRate;
- (float) uploadRate;
- (float) downloadedValid;
- (uint64_t) downloadedTotal;
- (uint64_t) uploadedTotal;
2006-08-17 03:12:40 +00:00
- (float) swarmSpeed;
2006-07-16 19:39:23 +00:00
- (NSNumber *) orderValue;
- (void) setOrderValue: (int) orderValue;
- (NSArray *) fileList;
- (NSDate *) date;
- (NSNumber *) stateSortKey;
- (NSNumber *) progressSortKey;
@end