1 | /****************************************************************************** |
---|
2 | * $Id: tr-torrent.h 5947 2008-05-27 17:47:39Z charles $ |
---|
3 | * |
---|
4 | * Copyright (c) 2006-2008 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 | #ifndef TR_TORRENT_H |
---|
26 | #define TR_TORRENT_H |
---|
27 | |
---|
28 | #include <glib-object.h> |
---|
29 | #include <libtransmission/transmission.h> |
---|
30 | #include <libtransmission/bencode.h> |
---|
31 | #include "util.h" |
---|
32 | |
---|
33 | #define TR_TORRENT_TYPE (tr_torrent_get_type ()) |
---|
34 | #define TR_TORRENT(obj) \ |
---|
35 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), TR_TORRENT_TYPE, TrTorrent)) |
---|
36 | #define TR_TORRENT_CLASS(klass) \ |
---|
37 | (G_TYPE_CHECK_CLASS_CAST ((klass), TR_TORRENT_TYPE, TrTorrentClass)) |
---|
38 | #define TR_IS_TORRENT(obj) \ |
---|
39 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TR_TORRENT_TYPE)) |
---|
40 | #define TR_IS_TORRENT_CLASS(klass) \ |
---|
41 | (G_TYPE_CHECK_CLASS_TYPE ((klass), TR_TORRENT_TYPE)) |
---|
42 | #define TR_TORRENT_GET_CLASS(obj) \ |
---|
43 | (G_TYPE_INSTANCE_GET_CLASS ((obj), TR_TORRENT_TYPE, TrTorrentClass)) |
---|
44 | |
---|
45 | typedef struct _TrTorrent |
---|
46 | { |
---|
47 | GObject parent; |
---|
48 | struct TrTorrentPrivate * priv; |
---|
49 | } |
---|
50 | TrTorrent; |
---|
51 | |
---|
52 | typedef struct TrTorrentClass |
---|
53 | { |
---|
54 | GObjectClass parent; |
---|
55 | } |
---|
56 | TrTorrentClass; |
---|
57 | |
---|
58 | GType |
---|
59 | tr_torrent_get_type(void); |
---|
60 | |
---|
61 | tr_torrent * |
---|
62 | tr_torrent_handle(TrTorrent *tor); |
---|
63 | |
---|
64 | const tr_stat * |
---|
65 | tr_torrent_stat(TrTorrent *tor); |
---|
66 | |
---|
67 | const tr_info * |
---|
68 | tr_torrent_info(TrTorrent *tor); |
---|
69 | |
---|
70 | char* |
---|
71 | tr_torrent_status_str ( TrTorrent * tor ); |
---|
72 | |
---|
73 | void |
---|
74 | tr_torrent_delete_files( TrTorrent * tor ); |
---|
75 | |
---|
76 | void |
---|
77 | tr_torrent_open_folder( TrTorrent * tor ); |
---|
78 | |
---|
79 | TrTorrent * |
---|
80 | tr_torrent_new_preexisting( tr_torrent * tor ); |
---|
81 | |
---|
82 | TrTorrent * |
---|
83 | tr_torrent_new_ctor( tr_handle * handle, tr_ctor * ctor, char ** err ); |
---|
84 | |
---|
85 | void |
---|
86 | tr_torrent_set_remove_flag( TrTorrent *, gboolean ); |
---|
87 | |
---|
88 | #endif |
---|