- Torrent can be now opened and download starts
[qtrapids] / src / engine / QTorrentHandle.h
index 14d969b..c102086 100644 (file)
 #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>
@@ -34,12 +38,33 @@ class QTorrentHandle
                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