source: trunk/macosx/Torrent.h @ 12773

Last change on this file since 12773 was 12773, checked in by livings124, 10 years ago

remove redundant code

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