source: trunk/macosx/Torrent.h @ 998

Last change on this file since 998 was 998, checked in by livings124, 15 years ago

Pieces View is working again

  • Property svn:keywords set to Date Rev Author Id
File size: 4.3 KB
Line 
1/******************************************************************************
2 * $Id: Torrent.h 998 2006-10-13 01:34:15Z 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    NSBitmapImageRep * fBitmap;
57    int8_t * fPieces;
58}
59
60- (id)  initWithPath: (NSString *) path lib: (tr_handle_t *) lib;
61- (id)  initWithHistory: (NSDictionary *) history lib: (tr_handle_t *) lib;
62
63- (NSDictionary *) history;
64                   
65- (void)       setDownloadFolder: (NSString *) path;
66- (NSString *) downloadFolder;
67
68- (void) getAvailability: (int8_t *) tab size: (int) size;
69- (void) getAmountFinished: (float *) tab size: (int) size;
70
71- (void)            update;
72- (NSDictionary *)  infoForCurrentView;
73
74- (void)        startTransfer;
75- (void)        stopTransfer;
76- (void)        stopTransferForQuit;
77- (void)        removeForever;
78- (void)        sleep;
79- (void)        wakeUp;
80
81- (float)       ratio;
82- (int)         stopRatioSetting;
83- (void)        setStopRatioSetting: (int) setting;
84- (float)       ratioLimit;
85- (void)        setRatioLimit: (float) limit;
86
87- (void) setWaitToStart: (BOOL) wait;
88- (BOOL) waitingToStart;
89
90- (void)    revealData;
91- (void)    trashData;
92- (void)    trashTorrent;
93
94- (BOOL) remainingDiskSpaceForTorrent;
95
96- (NSImage *)   icon;
97- (NSImage *)   iconFlipped;
98- (NSImage *)   iconSmall;
99
100- (NSString *) name;
101- (uint64_t)   size;
102- (NSString *) tracker;
103- (NSString *) announce;
104- (int)        pieceSize;
105- (int)        pieceCount;
106- (NSString *) hashString;
107
108- (NSString *) torrentLocation;
109- (NSString *) publicTorrentLocation;
110- (NSString *) torrentLocationString;
111- (NSString *) dataLocation;
112
113- (BOOL) publicTorrent;
114- (BOOL) privateTorrent;
115
116- (NSString *) stateString;
117
118- (float)   progress;
119- (int)     eta;
120
121- (BOOL)    isActive;
122- (BOOL)    isSeeding;
123- (BOOL)    isPaused;
124- (BOOL)    isError;
125- (BOOL)    justFinished;
126
127- (NSArray *) peers;
128
129- (NSString *) progressString;
130- (NSString *) statusString;
131- (NSString *) shortStatusString;
132- (NSString *) remainingTimeString;
133
134- (int) seeders;
135- (int) leechers;
136- (int) totalPeers;
137- (int) peersUploading;
138- (int) peersDownloading;
139
140- (float)       downloadRate;
141- (float)       uploadRate;
142- (float)       downloadedValid;
143- (uint64_t)    downloadedTotal;
144- (uint64_t)    uploadedTotal;
145- (float)       swarmSpeed;
146
147- (NSNumber *) orderValue;
148- (void) setOrderValue: (int) orderValue;
149
150- (NSArray *) fileList;
151
152- (NSDate *) date;
153- (NSNumber *) stateSortKey;
154- (NSNumber *) progressSortKey;
155
156@end
Note: See TracBrowser for help on using the repository browser.