1 | /****************************************************************************** |
---|
2 | * Copyright (c) 2005-2006 Transmission authors and contributors |
---|
3 | * |
---|
4 | * Permission is hereby granted, free of charge, to any person obtaining a |
---|
5 | * copy of this software and associated documentation files (the "Software"), |
---|
6 | * to deal in the Software without restriction, including without limitation |
---|
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
---|
8 | * and/or sell copies of the Software, and to permit persons to whom the |
---|
9 | * Software is furnished to do so, subject to the following conditions: |
---|
10 | * |
---|
11 | * The above copyright notice and this permission notice shall be included in |
---|
12 | * all copies or substantial portions of the Software. |
---|
13 | * |
---|
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
---|
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
---|
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
---|
17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
---|
18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
---|
19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
---|
20 | * DEALINGS IN THE SOFTWARE. |
---|
21 | *****************************************************************************/ |
---|
22 | |
---|
23 | #import <Cocoa/Cocoa.h> |
---|
24 | #import <transmission.h> |
---|
25 | |
---|
26 | @interface Torrent : NSObject |
---|
27 | { |
---|
28 | tr_handle_t * fLib; |
---|
29 | tr_torrent_t * fHandle; |
---|
30 | tr_info_t * fInfo; |
---|
31 | tr_stat_t * fStat; |
---|
32 | BOOL fResumeOnWake; |
---|
33 | |
---|
34 | NSImage * fIcon; |
---|
35 | NSMutableString * fStatusString; |
---|
36 | NSMutableString * fInfoString; |
---|
37 | NSMutableString * fDownloadString; |
---|
38 | NSMutableString * fUploadString; |
---|
39 | } |
---|
40 | |
---|
41 | - (id) initWithPath: (NSString *) path lib: (tr_handle_t *) lib; |
---|
42 | - (void) setFolder: (NSString *) path; |
---|
43 | - (NSString *) getFolder; |
---|
44 | - (void) getAvailability: (int8_t *) tab size: (int) size; |
---|
45 | |
---|
46 | - (void) update; |
---|
47 | - (void) start; |
---|
48 | - (void) stop; |
---|
49 | - (void) sleep; |
---|
50 | - (void) wakeUp; |
---|
51 | - (void) reveal; |
---|
52 | |
---|
53 | - (NSImage *) icon; |
---|
54 | - (NSString *) path; |
---|
55 | - (NSString *) name; |
---|
56 | - (uint64_t) size; |
---|
57 | |
---|
58 | - (float) progress; |
---|
59 | - (BOOL) isActive; |
---|
60 | - (BOOL) isSeeding; |
---|
61 | - (BOOL) isPaused; |
---|
62 | - (BOOL) justFinished; |
---|
63 | - (NSString *) statusString; |
---|
64 | - (NSString *) infoString; |
---|
65 | - (NSString *) downloadString; |
---|
66 | - (NSString *) uploadString; |
---|
67 | |
---|
68 | @end |
---|