source: trunk/macosx/Torrent.h @ 761

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

Basic peer info in info window...more to come.

  • Property svn:keywords set to Date Rev Author Id
File size: 4.0 KB
Line 
1/******************************************************************************
2 * $Id: Torrent.h 761 2006-08-13 15:46:02Z 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;
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- (void)        startTransfer;
68- (void)        stopTransfer;
69- (void)        stopTransferForQuit;
70- (void)        removeForever;
71- (void)        sleep;
72- (void)        wakeUp;
73
74- (float)       ratio;
75- (int)         stopRatioSetting;
76- (void)        setStopRatioSetting: (int) setting;
77- (float)       ratioLimit;
78- (void)        setRatioLimit: (float) limit;
79
80- (void) setWaitToStart: (BOOL) wait;
81- (BOOL) waitingToStart;
82
83- (void)    revealData;
84- (void)    trashData;
85- (void)    trashTorrent;
86
87- (NSImage *)   icon;
88- (NSImage *)   iconFlipped;
89- (NSImage *)   iconSmall;
90
91- (NSString *) name;
92- (uint64_t)   size;
93- (NSString *) tracker;
94- (NSString *) announce;
95- (int)        pieceSize;
96- (int)        pieceCount;
97- (NSString *) hashString;
98
99- (NSString *) torrentLocation;
100- (NSString *) publicTorrentLocation;
101- (NSString *) torrentLocationString;
102- (NSString *) dataLocation;
103
104- (BOOL) publicTorrent;
105- (BOOL) privateTorrent;
106
107- (NSString *) stateString;
108
109- (float)   progress;
110- (int)     eta;
111
112- (BOOL)    isActive;
113- (BOOL)    isSeeding;
114- (BOOL)    isPaused;
115- (BOOL)    justFinished;
116
117- (NSArray *) peers;
118
119- (NSString *) progressString;
120- (NSString *) statusString;
121- (NSString *) shortStatusString;
122- (NSString *) remainingTimeString;
123
124- (int) seeders;
125- (int) leechers;
126- (int) totalPeers;
127- (int) peersUploading;
128- (int) peersDownloading;
129
130- (float)       downloadRate;
131- (float)       uploadRate;
132- (float)       downloadedValid;
133- (uint64_t)    downloadedTotal;
134- (uint64_t)    uploadedTotal;
135
136- (NSNumber *) orderValue;
137- (void) setOrderValue: (int) orderValue;
138
139- (NSArray *) fileList;
140
141- (NSDate *) date;
142- (NSNumber *) stateSortKey;
143- (NSNumber *) progressSortKey;
144
145@end
Note: See TracBrowser for help on using the repository browser.