source: trunk/macosx/Torrent.h @ 1645

Last change on this file since 1645 was 1645, checked in by livings124, 15 years ago

update licenses to 2007

  • Property svn:keywords set to Date Rev Author Id
File size: 5.6 KB
Line 
1/******************************************************************************
2 * $Id: Torrent.h 1645 2007-04-03 02:22:25Z livings124 $
3 *
4 * Copyright (c) 2006-2007 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 INVALID -99
29
30@interface Torrent : NSObject
31{
32    tr_handle_t  * fLib;
33    tr_torrent_t * fHandle;
34    tr_info_t    * fInfo;
35    tr_stat_t    * fStat;
36   
37    BOOL         fResumeOnWake;
38    NSDate       * fDateAdded, * fDateCompleted, * fAnnounceDate;
39   
40    BOOL        fUseIncompleteFolder;
41    NSString    * fDownloadFolder, * fIncompleteFolder;
42   
43    BOOL        fPublicTorrent;
44    NSString    * fPublicTorrentLocation;
45       
46        BOOL fPex;
47
48    NSUserDefaults * fDefaults;
49
50    NSImage * fIcon, * fIconFlipped, * fIconSmall;
51    NSMutableString * fNameString, * fProgressString, * fStatusString, * fShortStatusString, * fRemainingTimeString;
52   
53    NSArray * fFileList, * fFileFlatList;
54   
55    int     fUploadLimit, fDownloadLimit;
56    float   fRatioLimit;
57    int     fCheckUpload, fCheckDownload, fRatioSetting;
58    BOOL    fFinishedSeeding, fWaitToStart, fError, fChecking;
59   
60    int fOrderValue;
61   
62    NSBitmapImageRep * fBitmap;
63    int8_t * fPieces;
64}
65
66- (id)  initWithPath: (NSString *) path forceDeleteTorrent: (BOOL) delete lib: (tr_handle_t *) lib;
67- (id)  initWithHistory: (NSDictionary *) history lib: (tr_handle_t *) lib;
68
69- (NSDictionary *) history;
70                   
71- (void)       setDownloadFolder: (NSString *) path;
72- (NSString *) downloadFolder;
73
74- (void) getAvailability: (int8_t *) tab size: (int) size;
75- (void) getAmountFinished: (float *) tab size: (int) size;
76
77- (void)            update;
78- (NSDictionary *)  infoForCurrentView;
79
80- (void)        startTransfer;
81- (void)        stopTransfer;
82- (void)        stopTransferForQuit;
83- (void)        sleep;
84- (void)        wakeUp;
85
86- (void)        announce;
87- (NSDate *)    announceDate;
88
89- (BOOL)        allDownloaded;
90
91- (float)       ratio;
92- (int)         ratioSetting;
93- (void)        setRatioSetting: (int) setting;
94- (float)       ratioLimit;
95- (void)        setRatioLimit: (float) limit;
96- (float)       actualStopRatio; //returns INVALID if will not stop
97
98- (int)     checkUpload;
99- (void)    setCheckUpload: (int) setting;
100- (int)     uploadLimit;
101- (void)    setUploadLimit: (int) limit;
102- (int)     checkDownload;
103- (void)    setCheckDownload: (int) setting;
104- (int)     downloadLimit;
105- (void)    setDownloadLimit: (int) limit;
106
107- (void)    updateSpeedSetting;
108
109- (void) setWaitToStart: (BOOL) wait;
110- (BOOL) waitingToStart;
111
112- (void)    revealData;
113- (void)    revealPublicTorrent;
114- (void)    trashData;
115- (void)    trashTorrent;
116
117- (BOOL) alertForRemainingDiskSpace;
118- (BOOL) alertForFolderAvailable;
119- (BOOL) alertForMoveFolderAvailable;
120
121- (NSImage *)   icon;
122- (NSImage *)   iconFlipped;
123- (NSImage *)   iconSmall;
124
125- (NSString *) name;
126- (uint64_t)   size;
127- (NSString *) trackerAddress;
128- (NSString *) trackerAddressAnnounce;
129
130- (NSString *) comment;
131- (NSString *) creator;
132- (NSDate *)   dateCreated;
133
134- (int)        pieceSize;
135- (int)        pieceCount;
136- (NSString *) hashString;
137- (BOOL)       privateTorrent;
138
139- (NSString *) torrentLocation;
140- (NSString *) publicTorrentLocation;
141- (NSString *) dataLocation;
142
143- (BOOL) publicTorrent;
144
145- (NSString *) stateString;
146
147- (float)   progress;
148- (int)     eta;
149
150- (BOOL)        isActive;
151- (BOOL)        isSeeding;
152- (BOOL)        isPaused;
153- (BOOL)        isError;
154- (NSString *)  errorMessage;
155- (BOOL)        justFinished;
156
157- (NSArray *) peers;
158
159- (NSString *) progressString;
160- (NSString *) statusString;
161- (NSString *) shortStatusString;
162- (NSString *) remainingTimeString;
163
164- (int) seeders;
165- (int) leechers;
166- (int) completedFromTracker;
167
168- (int) totalPeers;
169- (int) totalPeersTracker;
170- (int) totalPeersIncoming;
171- (int) totalPeersCache;
172- (int) totalPeersPex;
173
174- (int) peersUploading;
175- (int) peersDownloading;
176
177- (float)       downloadRate;
178- (float)       uploadRate;
179- (float)       downloadedValid;
180- (uint64_t)    downloadedTotal;
181- (uint64_t)    uploadedTotal;
182- (float)       swarmSpeed;
183
184- (BOOL) pex;
185- (void) setPex: (BOOL) setting;
186
187- (NSNumber *) orderValue;
188- (void) setOrderValue: (int) orderValue;
189
190- (NSArray *) fileList;
191- (int) fileCount;
192- (BOOL) updateFileProgress;
193- (void) setFileCheckState: (int) state forFileItem: (NSMutableDictionary *) item;
194- (NSMutableDictionary *) resetFileCheckStateForItemParent: (NSMutableDictionary *) originalChild;
195
196- (NSDate *) dateAdded;
197- (NSDate *) dateCompleted;
198
199- (NSNumber *) stateSortKey;
200- (NSNumber *) progressSortKey;
201- (NSNumber *) ratioSortKey;
202
203@end
Note: See TracBrowser for help on using the repository browser.