source: trunk/macosx/Torrent.h @ 10212

Last change on this file since 10212 was 10212, checked in by livings124, 12 years ago

when adding a new tracker, display tier as "New Tier"

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