source: trunk/macosx/Torrent.h @ 344

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

This should make the borders of the new progress bar a bit more consistent.

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