1 /***************************************************************************
2 * Copyright (C) 2010 by Ixonos Plc *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; version 2 of the License. *
8 * This program is distributed in the hope that it will be useful, *
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
11 * GNU General Public License for more details. *
13 * You should have received a copy of the GNU General Public License *
14 * along with this program; if not, write to the *
15 * Free Software Foundation, Inc., *
16 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
17 ***************************************************************************/
18 #ifndef QTORRENTHANDLE_H
19 #define QTORRENTHANDLE_H
23 #include <libtorrent/torrent_handle.hpp>
26 typedef libtorrent::torrent_status TorrentStatus;
27 typedef libtorrent::torrent_info TorrentInfo;
28 typedef libtorrent::torrent_handle TorrentHandle;
32 @author Lassi Väätämöinen <lassi.vaatamoinen@ixonos.com>
43 QUEUED_FOR_CHECKING = TorrentStatus::queued_for_checking,
53 QTorrentHandle(libtorrent::torrent_handle handle);
58 TorrentInfo const& getTorrentInfo() const;
63 size_t getTotalSize() const;
64 QTorrentHandle::State state() const;
65 float progress() const;
66 float uploadRate() const;
67 float downloadRate() const;
68 qint32 numSeeds() const;
69 qint32 numLeeches() const;
72 TorrentHandle getHandle() const;
74 bool operator==(QTorrentHandle const& h) const;
75 bool operator<(QTorrentHandle const& h) const;
78 QTorrentHandle(); // Prevent default construct.
79 TorrentHandle torrentHandle_;
81 TorrentStatus status() const;
85 } // namespace qtrapids