source: trunk/macosx/Torrent.h @ 961

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

Torrents that have errors aren't counted in the queue, and when a torrent encounters an error the next torrent in the queue will start (even though that torrent might still be active).

  • Property svn:keywords set to Date Rev Author Id
File size: 4.2 KB
Line 
1/******************************************************************************
2 * $Id: Torrent.h 961 2006-09-29 05:30:36Z 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;
41   
42    BOOL        fPrivateTorrent, fPublicTorrent;
43    NSString    * fPublicTorrentLocation;
44
45    NSUserDefaults  * fDefaults;
46
47    NSImage         * fIcon, * fIconFlipped, * fIconSmall;
48    NSMutableString * fNameString, * fProgressString, * fStatusString, * fShortStatusString, * fRemainingTimeString;
49   
50    int     fStopRatioSetting;
51    float   fRatioLimit;
52    BOOL    fFinishedSeeding, fWaitToStart, fError;
53   
54    int fOrderValue;
55}
56
57- (id)  initWithPath: (NSString *) path lib: (tr_handle_t *) lib;
58- (id)  initWithHistory: (NSDictionary *) history lib: (tr_handle_t *) lib;
59
60- (NSDictionary *) history;
61                   
62- (void)       setDownloadFolder: (NSString *) path;
63- (NSString *) downloadFolder;
64- (void)       getAvailability: (int8_t *) tab size: (int) size;
65
66- (void)            update;
67- (NSDictionary *)  infoForCurrentView;
68
69- (void)        startTransfer;
70- (void)        stopTransfer;
71- (void)        stopTransferForQuit;
72- (void)        removeForever;
73- (void)        sleep;
74- (void)        wakeUp;
75
76- (float)       ratio;
77- (int)         stopRatioSetting;
78- (void)        setStopRatioSetting: (int) setting;
79- (float)       ratioLimit;
80- (void)        setRatioLimit: (float) limit;
81
82- (void) setWaitToStart: (BOOL) wait;
83- (BOOL) waitingToStart;
84
85- (void)    revealData;
86- (void)    trashData;
87- (void)    trashTorrent;
88
89- (BOOL) remainingDiskSpaceForTorrent;
90
91- (NSImage *)   icon;
92- (NSImage *)   iconFlipped;
93- (NSImage *)   iconSmall;
94
95- (NSString *) name;
96- (uint64_t)   size;
97- (NSString *) tracker;
98- (NSString *) announce;
99- (int)        pieceSize;
100- (int)        pieceCount;
101- (NSString *) hashString;
102
103- (NSString *) torrentLocation;
104- (NSString *) publicTorrentLocation;
105- (NSString *) torrentLocationString;
106- (NSString *) dataLocation;
107
108- (BOOL) publicTorrent;
109- (BOOL) privateTorrent;
110
111- (NSString *) stateString;
112
113- (float)   progress;
114- (int)     eta;
115
116- (BOOL)    isActive;
117- (BOOL)    isSeeding;
118- (BOOL)    isPaused;
119- (BOOL)    isError;
120- (BOOL)    justFinished;
121
122- (NSArray *) peers;
123
124- (NSString *) progressString;
125- (NSString *) statusString;
126- (NSString *) shortStatusString;
127- (NSString *) remainingTimeString;
128
129- (int) seeders;
130- (int) leechers;
131- (int) totalPeers;
132- (int) peersUploading;
133- (int) peersDownloading;
134
135- (float)       downloadRate;
136- (float)       uploadRate;
137- (float)       downloadedValid;
138- (uint64_t)    downloadedTotal;
139- (uint64_t)    uploadedTotal;
140- (float)       swarmSpeed;
141
142- (NSNumber *) orderValue;
143- (void) setOrderValue: (int) orderValue;
144
145- (NSArray *) fileList;
146
147- (NSDate *) date;
148- (NSNumber *) stateSortKey;
149- (NSNumber *) progressSortKey;
150
151@end
Note: See TracBrowser for help on using the repository browser.