source: trunk/macosx/Torrent.h @ 9204

Last change on this file since 9204 was 9204, checked in by livings124, 13 years ago

dead code removal

  • Property svn:keywords set to Date Rev Author Id
File size: 6.8 KB
Line 
1/******************************************************************************
2 * $Id: Torrent.h 9204 2009-09-28 04:29:38Z livings124 $
3 *
4 * Copyright (c) 2006-2009 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#import <Quartz/Quartz.h>
28
29@class FileListNode;
30
31#warning remove!?
32#define STAT_TIME_NONE -1
33#define STAT_TIME_NOW -2
34
35@interface Torrent : NSObject <QLPreviewItem>
36{
37    tr_torrent * fHandle;
38    const tr_info * fInfo;
39    const tr_stat * fStat;
40   
41    BOOL fResumeOnWake;
42   
43    BOOL fUseIncompleteFolder;
44    NSString * fDownloadFolder, * fIncompleteFolder;
45       
46    NSUserDefaults * fDefaults;
47
48    NSImage * fIcon;
49   
50    NSString * fNameString, * fHashString;
51   
52    tr_file_stat * fFileStat;
53    NSArray * fFileList, * fFlatFileList;
54   
55    NSIndexSet * fPreviousFinishedIndexes;
56    NSDate * fPreviousFinishedIndexesDate;
57   
58    BOOL fFinishedSeeding, fWaitToStart, fStalled;
59   
60    NSInteger fGroupValue;
61   
62    NSDictionary * fQuickPauseDict;
63}
64
65- (id) initWithPath: (NSString *) path location: (NSString *) location deleteTorrentFile: (BOOL) torrentDelete
66        lib: (tr_session *) lib;
67- (id) initWithTorrentStruct: (tr_torrent *) torrentStruct location: (NSString *) location lib: (tr_session *) lib;
68- (id) initWithHistory: (NSDictionary *) history lib: (tr_session *) lib forcePause: (BOOL) pause;
69
70- (NSDictionary *) history;
71
72- (void) closeRemoveTorrent;
73
74- (void) changeIncompleteDownloadFolder: (NSString *) folder;
75- (void) changeDownloadFolder: (NSString *) folder;
76- (NSString *) downloadFolder;
77
78- (void) getAvailability: (int8_t *) tab size: (NSInteger) size;
79- (void) getAmountFinished: (float *) tab size: (NSInteger) size;
80- (NSIndexSet *) previousFinishedPieces;
81-(void) setPreviousFinishedPieces: (NSIndexSet *) indexes;
82
83- (void) update;
84
85- (void) startTransfer;
86- (void) stopTransfer;
87- (void) sleep;
88- (void) wakeUp;
89
90- (void) manualAnnounce;
91- (BOOL) canManualAnnounce;
92
93- (void) resetCache;
94
95- (CGFloat) ratio;
96- (tr_ratiolimit) ratioSetting;
97- (void) setRatioSetting: (tr_ratiolimit) setting;
98- (CGFloat) ratioLimit;
99- (void) setRatioLimit: (CGFloat) limit;
100- (BOOL) seedRatioSet;
101- (CGFloat) progressStopRatio;
102
103- (BOOL) usesSpeedLimit: (BOOL) upload;
104- (void) setUseSpeedLimit: (BOOL) use upload: (BOOL) upload;
105- (NSInteger) speedLimit: (BOOL) upload;
106- (void) setSpeedLimit: (NSInteger) limit upload: (BOOL) upload;
107- (BOOL) usesGlobalSpeedLimit;
108- (void) setUseGlobalSpeedLimit: (BOOL) use;
109
110- (void) setMaxPeerConnect: (uint16_t) count;
111- (uint16_t) maxPeerConnect;
112
113- (void) setWaitToStart: (BOOL) wait;
114- (BOOL) waitingToStart;
115
116- (tr_priority_t) priority;
117- (void) setPriority: (tr_priority_t) priority;
118
119+ (void) trashFile: (NSString *) path;
120- (void) trashData;
121- (void) moveTorrentDataFileTo: (NSString *) folder;
122- (void) copyTorrentFileTo: (NSString *) path;
123
124- (BOOL) alertForRemainingDiskSpace;
125- (BOOL) alertForFolderAvailable;
126- (BOOL) alertForMoveFolderAvailable;
127
128- (NSImage *) icon;
129
130- (NSString *) name;
131- (BOOL) isFolder;
132- (uint64_t) size;
133- (uint64_t) sizeLeft;
134
135- (NSArray *) allTrackerStats;
136- (NSArray *) allTrackersFlat; //used by GroupRules
137/*- (BOOL) updateAllTrackersForAdd: (NSMutableArray *) trackers;
138- (void) updateAllTrackersForRemove: (NSMutableArray *) trackers;*/
139
140- (NSString *) comment;
141- (NSString *) creator;
142- (NSDate *) dateCreated;
143
144- (NSInteger) pieceSize;
145- (NSInteger) pieceCount;
146- (NSString *) hashString;
147- (BOOL) privateTorrent;
148
149- (NSString *) torrentLocation;
150- (NSString *) dataLocation;
151
152- (CGFloat) progress;
153- (CGFloat) progressDone;
154- (CGFloat) checkingProgress;
155
156- (NSInteger) eta;
157
158- (CGFloat) availableDesired;
159
160- (BOOL) isActive;
161- (BOOL) isSeeding;
162- (BOOL) isChecking;
163- (BOOL) isCheckingWaiting;
164- (BOOL) allDownloaded;
165- (BOOL) isComplete;
166- (BOOL) isError;
167- (BOOL) isErrorOrWarning;
168- (NSString *) errorMessage;
169
170- (NSArray *) peers;
171
172- (NSUInteger) webSeedCount;
173- (NSArray *) webSeeds;
174
175- (NSString *) progressString;
176- (NSString *) statusString;
177- (NSString *) shortStatusString;
178- (NSString *) remainingTimeString;
179
180- (NSString *) stateString;
181- (NSInteger) totalPeersConnected;
182- (NSInteger) totalPeersTracker;
183- (NSInteger) totalPeersIncoming;
184- (NSInteger) totalPeersCache;
185- (NSInteger) totalPeersPex;
186- (NSInteger) totalPeersDHT;
187- (NSInteger) totalPeersKnown;
188
189- (NSInteger) peersSendingToUs;
190- (NSInteger) peersGettingFromUs;
191
192- (CGFloat) downloadRate;
193- (CGFloat) uploadRate;
194- (CGFloat) totalRate;
195- (uint64_t) haveVerified;
196- (uint64_t) haveTotal;
197- (uint64_t) totalSizeSelected;
198- (uint64_t) downloadedTotal;
199- (uint64_t) uploadedTotal;
200- (uint64_t) failedHash;
201- (CGFloat) swarmSpeed;
202
203- (NSInteger) groupValue;
204- (void) setGroupValue: (NSInteger) groupValue;
205- (NSInteger) groupOrderValue;
206- (void) checkGroupValueForRemoval: (NSNotification *) notification;
207
208- (NSArray *) fileList;
209- (NSInteger) fileCount;
210- (void) updateFileStat;
211- (NSArray *) flatFileList;
212
213//methods require fileStats to have been updated recently to be accurate
214- (CGFloat) fileProgress: (FileListNode *) node;
215- (BOOL) canChangeDownloadCheckForFile: (NSInteger) index;
216- (BOOL) canChangeDownloadCheckForFiles: (NSIndexSet *) indexSet;
217- (NSInteger) checkForFiles: (NSIndexSet *) indexSet;
218- (void) setFileCheckState: (NSInteger) state forIndexes: (NSIndexSet *) indexSet;
219- (void) setFilePriority: (tr_priority_t) priority forIndexes: (NSIndexSet *) indexSet;
220- (BOOL) hasFilePriority: (tr_priority_t) priority forIndexes: (NSIndexSet *) indexSet;
221- (NSSet *) filePrioritiesForIndexes: (NSIndexSet *) indexSet;
222
223- (NSDate *) dateAdded;
224- (NSDate *) dateCompleted;
225- (NSDate *) dateActivity;
226- (NSDate *) dateActivityOrAdd;
227
228- (NSInteger) stalledMinutes;
229- (BOOL) isStalled;
230
231- (NSInteger) stateSortKey;
232
233- (tr_torrent *) torrentStruct;
234
235@end
Note: See TracBrowser for help on using the repository browser.