2006-08-13 00:26:52 +00:00
|
|
|
/******************************************************************************
|
|
|
|
* $Id$
|
|
|
|
*
|
2008-01-01 17:20:20 +00:00
|
|
|
* Copyright (c) 2006-2008 Transmission authors and contributors
|
2006-08-13 00:26:52 +00:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
* DEALINGS IN THE SOFTWARE.
|
|
|
|
*****************************************************************************/
|
2006-07-16 19:39:23 +00:00
|
|
|
|
|
|
|
#ifndef TR_TORRENT_H
|
|
|
|
#define TR_TORRENT_H
|
|
|
|
|
|
|
|
#include <glib-object.h>
|
2007-07-18 23:04:26 +00:00
|
|
|
#include <libtransmission/transmission.h>
|
|
|
|
#include <libtransmission/bencode.h>
|
2007-05-23 19:26:29 +00:00
|
|
|
#include "util.h"
|
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
#define TR_TORRENT_TYPE ( tr_torrent_get_type ( ) )
|
|
|
|
#define TR_TORRENT( obj ) \
|
|
|
|
( G_TYPE_CHECK_INSTANCE_CAST ( ( obj ), TR_TORRENT_TYPE, TrTorrent ) )
|
|
|
|
#define TR_TORRENT_CLASS( klass ) \
|
|
|
|
( G_TYPE_CHECK_CLASS_CAST ( ( klass ), TR_TORRENT_TYPE, TrTorrentClass ) )
|
|
|
|
#define TR_IS_TORRENT( obj ) \
|
|
|
|
( G_TYPE_CHECK_INSTANCE_TYPE ( ( obj ), TR_TORRENT_TYPE ) )
|
|
|
|
#define TR_IS_TORRENT_CLASS( klass ) \
|
|
|
|
( G_TYPE_CHECK_CLASS_TYPE ( ( klass ), TR_TORRENT_TYPE ) )
|
|
|
|
#define TR_TORRENT_GET_CLASS( obj ) \
|
|
|
|
( G_TYPE_INSTANCE_GET_CLASS ( ( obj ), TR_TORRENT_TYPE, TrTorrentClass ) )
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-02-11 15:27:36 +00:00
|
|
|
typedef struct _TrTorrent
|
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
GObject parent;
|
2008-02-11 15:27:36 +00:00
|
|
|
struct TrTorrentPrivate * priv;
|
|
|
|
}
|
|
|
|
TrTorrent;
|
|
|
|
|
|
|
|
typedef struct TrTorrentClass
|
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
GObjectClass parent;
|
2008-02-11 15:27:36 +00:00
|
|
|
}
|
|
|
|
TrTorrentClass;
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
GType tr_torrent_get_type( void );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
tr_torrent * tr_torrent_handle( TrTorrent *tor );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
const tr_stat *tr_torrent_stat( TrTorrent *tor );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
const tr_info *tr_torrent_info( TrTorrent *tor );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
void tr_torrent_open_folder( TrTorrent * tor );
|
2008-04-11 02:21:33 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
TrTorrent * tr_torrent_new_preexisting( tr_torrent * tor );
|
2007-07-23 03:03:45 +00:00
|
|
|
|
2008-10-28 19:49:33 +00:00
|
|
|
TrTorrent * tr_torrent_new_ctor( tr_session * session,
|
|
|
|
tr_ctor * ctor,
|
2009-02-09 20:08:33 +00:00
|
|
|
int * errcode );
|
2007-05-24 10:37:07 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
void tr_torrent_set_remove_flag( TrTorrent *,
|
|
|
|
gboolean );
|
2008-02-19 05:03:56 +00:00
|
|
|
|
2006-07-16 19:39:23 +00:00
|
|
|
#endif
|