X-Git-Url: http://git.maemo.org/git/?p=qtrapids;a=blobdiff_plain;f=src%2Fengine%2FQBittorrentSession.h;h=7d2ea436800a523e2e0de3e56ff87a860789c081;hp=19de9d79ce8362042ad8638a5021c40a24cdc4e8;hb=d3d85653bf84dadcf6c2890cc2ddf9f629ee7619;hpb=afa034e0adbbeaf337e34671efd44f5e487c17ba diff --git a/src/engine/QBittorrentSession.h b/src/engine/QBittorrentSession.h index 19de9d7..7d2ea43 100644 --- a/src/engine/QBittorrentSession.h +++ b/src/engine/QBittorrentSession.h @@ -20,20 +20,54 @@ #ifndef QBITTORRENTSESSION_H #define QBITTORRENTSESSION_H +#include + +#include + +#include +#include +#include + +#include "QTorrentHandle.h" + + +// Forward declarations and typedefs +class AlertWaiterThread; +typedef libtorrent::session TorrentSession; +typedef libtorrent::add_torrent_params AddTorrentParams; +typedef libtorrent::alert Alert; +typedef libtorrent::torrent_alert TorrentAlert; +typedef libtorrent::sha1_hash Sha1Hash; + + +namespace qtrapids { + /** @author Lassi Väätämöinen */ -class QBittorrentSession { - +class QBittorrentSession : public QObject { + Q_OBJECT +// class BitTorrentSession; + public: - QBittorrentSession(); - + QBittorrentSession(QObject *parent = 0); ~QBittorrentSession(); - public slots: + + /// @brief Add torrent to session. + qtrapids::QTorrentHandle addTorrent(AddTorrentParams const& params); + void removeTorrent(qtrapids::QTorrentHandle const& handle); + + signals: + void alert(std::auto_ptr al); + private slots: + void on_alert(Alert const *al); + private: + TorrentSession btSession_; + AlertWaiterThread *alertWaiter_; - }; +} //namespace qtrapids #endif