source: trunk/macosx/Torrent.h @ 1283

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

manual announce in mac gui...only useable once per minute for each torrent

  • Property svn:keywords set to Date Rev Author Id
File size: 4.8 KB
Line 
1/******************************************************************************
2 * $Id: Torrent.h 1283 2006-12-26 21:02:00Z livings124 $
3 *
4 * Copyright (c) 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#import <Cocoa/Cocoa.h>
26#import <transmission.h>
27
28#define RATIO_CHECK 1
29#define RATIO_GLOBAL -1
30#define RATIO_NO_CHECK 0
31
32@interface Torrent : NSObject
33{
34    tr_handle_t  * fLib;
35    tr_torrent_t * fHandle;
36    tr_info_t    * fInfo;
37    tr_stat_t    * fStat;
38   
39    BOOL         fResumeOnWake;
40    NSDate       * fDate, * fAnnounceDate;
41   
42    BOOL        fUseIncompleteFolder;
43    NSString    * fDownloadFolder, * fIncompleteFolder;
44   
45    BOOL        fPublicTorrent;
46    NSString    * fPublicTorrentLocation;
47
48    NSUserDefaults  * fDefaults;
49
50    NSImage         * fIcon, * fIconFlipped, * fIconSmall;
51    NSMutableString * fNameString, * fProgressString, * fStatusString, * fShortStatusString, * fRemainingTimeString;
52   
53    int     fStopRatioSetting;
54    float   fRatioLimit;
55    BOOL    fFinishedSeeding, fWaitToStart, fError;
56   
57    int fOrderValue;
58   
59    NSBitmapImageRep * fBitmap;
60    int8_t * fPieces;
61}
62
63- (id)  initWithPath: (NSString *) path forceDeleteTorrent: (BOOL) delete lib: (tr_handle_t *) lib;
64- (id)  initWithHistory: (NSDictionary *) history lib: (tr_handle_t *) lib;
65
66- (NSDictionary *) history;
67                   
68- (void)       setDownloadFolder: (NSString *) path;
69- (NSString *) downloadFolder;
70
71- (void) getAvailability: (int8_t *) tab size: (int) size;
72- (void) getAmountFinished: (float *) tab size: (int) size;
73
74- (void)            update;
75- (NSDictionary *)  infoForCurrentView;
76
77- (void)        startTransfer;
78- (void)        stopTransfer;
79- (void)        stopTransferForQuit;
80- (void)        removeForever;
81- (void)        sleep;
82- (void)        wakeUp;
83
84- (void)        announce;
85- (NSDate *)    announceDate;
86
87- (float)       ratio;
88- (int)         stopRatioSetting;
89- (void)        setStopRatioSetting: (int) setting;
90- (float)       ratioLimit;
91- (void)        setRatioLimit: (float) limit;
92
93- (void) setWaitToStart: (BOOL) wait;
94- (BOOL) waitingToStart;
95
96- (void)    revealData;
97- (void)    revealPublicTorrent;
98- (void)    trashData;
99- (void)    trashTorrent;
100
101- (BOOL) alertForRemainingDiskSpace;
102- (BOOL) alertForVolumeAvailable;
103- (BOOL) alertForMoveVolumeAvailable;
104
105- (NSImage *)   icon;
106- (NSImage *)   iconFlipped;
107- (NSImage *)   iconSmall;
108
109- (NSString *) name;
110- (uint64_t)   size;
111- (NSString *) trackerAddress;
112- (NSString *) trackerAddressAnnounce;
113
114- (NSString *) comment;
115- (NSString *) creator;
116- (NSDate *)   dateCreated;
117
118- (int)        pieceSize;
119- (int)        pieceCount;
120- (NSString *) hashString;
121- (BOOL)       privateTorrent;
122
123- (NSString *) torrentLocation;
124- (NSString *) publicTorrentLocation;
125- (NSString *) dataLocation;
126
127- (BOOL) publicTorrent;
128
129- (NSString *) stateString;
130
131- (float)   progress;
132- (int)     eta;
133
134- (BOOL)        isActive;
135- (BOOL)        isSeeding;
136- (BOOL)        isPaused;
137- (BOOL)        isError;
138- (NSString *)  errorMessage;
139- (BOOL)        justFinished;
140
141- (NSArray *) peers;
142
143- (NSString *) progressString;
144- (NSString *) statusString;
145- (NSString *) shortStatusString;
146- (NSString *) remainingTimeString;
147
148- (int) seeders;
149- (int) leechers;
150- (int) completedFromTracker;
151- (int) totalPeers;
152- (int) totalPeersIncoming;
153- (int) totalPeersOutgoing;
154- (int) peersUploading;
155- (int) peersDownloading;
156
157- (float)       downloadRate;
158- (float)       uploadRate;
159- (float)       downloadedValid;
160- (uint64_t)    downloadedTotal;
161- (uint64_t)    uploadedTotal;
162- (float)       swarmSpeed;
163
164- (NSNumber *) orderValue;
165- (void) setOrderValue: (int) orderValue;
166
167- (NSArray *) fileList;
168
169- (NSDate *) date;
170- (NSNumber *) stateSortKey;
171- (NSNumber *) progressSortKey;
172
173@end
Note: See TracBrowser for help on using the repository browser.