source: trunk/gtk/tr_backend.h @ 1125

Last change on this file since 1125 was 760, checked in by joshe, 15 years ago

Change all my 2-clause BSD licenses to the same MIT/X11 license as libtransmission.

  • Property svn:keywords set to Date Rev Author Id
File size: 2.7 KB
Line 
1/******************************************************************************
2 * $Id: tr_backend.h 760 2006-08-13 00:26:52Z 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#ifndef TR_BACKEND_H
26#define TR_BACKEND_H
27
28#include <glib-object.h>
29
30#include "transmission.h"
31#include "bencode.h"
32
33#define TR_BACKEND_TYPE           (tr_backend_get_type ())
34#define TR_BACKEND(obj) \
35  (G_TYPE_CHECK_INSTANCE_CAST ((obj), TR_BACKEND_TYPE, TrBackend))
36#define TR_BACKEND_CLASS(klass) \
37  (G_TYPE_CHECK_CLASS_CAST ((klass), TR_BACKEND_TYPE, TrBackendClass))
38#define TR_IS_BACKEND(obj) \
39  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TR_BACKEND_TYPE))
40#define TR_IS_BACKEND_CLASS(klass) \
41  (G_TYPE_CHECK_CLASS_TYPE ((klass), TR_BACKEND_TYPE))
42#define TR_BACKEND_GET_CLASS(obj) \
43  (G_TYPE_INSTANCE_GET_CLASS ((obj), TR_BACKEND_TYPE, TrBackendClass))
44
45typedef struct _TrBackend TrBackend;
46typedef struct _TrBackendClass TrBackendClass;
47
48/* treat the contents of this structure as private */
49struct _TrBackend {
50  GObject parent;
51  tr_handle_t *handle;
52  GList *torrents;
53  gboolean disposed;
54};
55
56struct _TrBackendClass {
57  GObjectClass parent;
58};
59
60GType
61tr_backend_get_type(void);
62
63TrBackend *
64tr_backend_new(void);
65
66tr_handle_t *
67tr_backend_handle(TrBackend *back);
68
69void
70tr_backend_save_state(TrBackend *back, char **errstr);
71
72GList *
73tr_backend_load_state(TrBackend *back, benc_val_t *state, GList **errors);
74
75void
76tr_backend_stop_torrents(TrBackend *back);
77
78gboolean
79tr_backend_torrents_stopped(TrBackend *back);
80
81#ifdef TR_WANT_BACKEND_PRIVATE
82void
83tr_backend_add_torrent(TrBackend *back, GObject *tor);
84#endif
85
86#endif
Note: See TracBrowser for help on using the repository browser.