-Added QTorrentHandle and started torrent adding implementation
[qtrapids] / src / engine / QBittorrentSession.h
index 19de9d7..82665b4 100644 (file)
 #ifndef QBITTORRENTSESSION_H
 #define QBITTORRENTSESSION_H
 
+#include <QObject>
+
+#include <libtorrent/session.hpp>
+
+#include "QTorrentHandle.h"
+
+
+// Forward declarations and typedefs
+class AlertWaiterThread;
+typedef libtorrent::session TorrentSession;
+typedef libtorrent::add_torrent_params AddTorrentParams;
+typedef libtorrent::alert TorrentAlert;
+
+
 /**
        @author Lassi Väätämöinen <lassi.vaatamoinen@ixonos.com>
 */
-class QBittorrentSession {
-
+class QBittorrentSession : public QObject {
+       Q_OBJECT
+//             class   BitTorrentSession;
+                       
        public:
-    QBittorrentSession();
-
+               QBittorrentSession(QObject *parent = 0);
     ~QBittorrentSession();
-       public slots:
+               
+               /// @brief Add torrent to session.
+               QTorrentHandle addTorrent(AddTorrentParams const& params);
+               
+       signals:
+               void alert(TorrentAlert const *al);
+               
        private slots:
+               void on_alert(TorrentAlert const *al);
+               
        private:
+               TorrentSession btSession_;
+               AlertWaiterThread *alertWaiter_;
                
-
 };
 
 #endif