source: trunk/macosx/Torrent.h @ 291

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

Initial support of moving torrent files in Mac version. Some things are incomplete and it's not yet guaranteed to work (in other words, only I should be even trying to use it).

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