source: trunk/macosx/Torrent.h @ 361

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

By popular demand: the return of "Remove Torrent File." It only applies to the files not moved to the private folder.

  • Property svn:keywords set to Date Rev Author Id
File size: 3.6 KB
Line 
1/******************************************************************************
2 * $Id: Torrent.h 361 2006-06-15 02:07:50Z 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;
48    NSMutableString * fNameString, * fProgressString, * fStatusString;
49   
50    int     fStopRatioSetting;
51    float   fRatioLimit;
52    BOOL    fFinishedSeeding;
53}
54
55- (id)  initWithPath: (NSString *) path lib: (tr_handle_t *) lib;
56- (id)  initWithHistory: (NSDictionary *) history lib: (tr_handle_t *) lib;
57
58- (NSDictionary *) history;
59                   
60- (void)       setDownloadFolder: (NSString *) path;
61- (NSString *) downloadFolder;
62- (void)       getAvailability: (int8_t *) tab size: (int) size;
63
64- (void)        update;
65- (void)        start;
66- (void)        stop;
67- (void)        removeForever;
68- (void)        sleep;
69- (void)        wakeUp;
70
71- (float)       ratio;
72- (int)         stopRatioSetting;
73- (void)        setStopRatioSetting: (int) setting;
74- (float)       ratioLimit;
75- (void)        setRatioLimit: (float) limit;
76
77- (void)    reveal;
78- (void)    trashData;
79- (void)    trashTorrent;
80
81- (NSImage *)  icon;
82- (NSImage *)  iconFlipped;
83
84- (NSString *) name;
85- (uint64_t)   size;
86- (NSString *) tracker;
87- (NSString *) announce;
88- (int)        pieceSize;
89- (int)        pieceCount;
90- (NSString *) hashString;
91
92- (NSString *) torrentLocation;
93- (NSString *) publicTorrentLocation;
94- (NSString *) dataLocation;
95
96- (BOOL) publicTorrent;
97- (BOOL) privateTorrent;
98
99- (NSString *) state;
100
101- (float)   progress;
102- (BOOL)    isActive;
103- (BOOL)    isSeeding;
104- (BOOL)    isPaused;
105- (BOOL)    justFinished;
106
107- (NSString *)  progressString;
108- (NSString *)  statusString;
109
110- (int) seeders;
111- (int) leechers;
112- (int) totalPeers;
113- (int) peersUploading;
114- (int) peersDownloading;
115
116- (float)       downloadRate;
117- (float)       uploadRate;
118- (float)       downloadedValid;
119- (uint64_t)    downloadedTotal;
120- (uint64_t)    uploadedTotal;
121
122- (NSArray *) fileList;
123
124- (NSDate *) date;
125- (NSNumber *) stateSortKey;
126- (NSNumber *) progressSortKey;
127
128@end
Note: See TracBrowser for help on using the repository browser.