#ifndef QTORRENTHANDLE_H
#define QTORRENTHANDLE_H
+#include <QtGlobal>
+
#include <libtorrent/torrent_handle.hpp>
+typedef libtorrent::torrent_status TorrentStatus;
+typedef libtorrent::torrent_info TorrentInfo;
/**
@author Lassi Väätämöinen <lassi.vaatamoinen@ixonos.com>
QTorrentHandle(libtorrent::torrent_handle handle);
~QTorrentHandle();
+
+ TorrentStatus status() const;
+
+ TorrentInfo const& getTorrentInfo() const;
+
bool isValid() const;
+
+ QString name() const;
+ size_t getTotalSize() const;
+ QString state() const;
+ float progress() const;
+ float uploadRate() const;
+ float downloadRate() const;
+ qint32 numSeeds() const;
+ qint32 numLeeches() const;
+ qint32 ratio() const;
+
+
+ bool operator==(QTorrentHandle const& h);
+ bool operator<(QTorrentHandle const& h);
private:
QTorrentHandle(); // Prevent default construct.
libtorrent::torrent_handle torrentHandle_;
+ // Private functions.
+ QString GetStatusString(TorrentStatus const& status) const;
};
#endif