4 #include "TorrentHandle.hpp"
9 #include <QSharedPointer>
10 #include <QWeakPointer>
12 #include <qtrapids/dbus.hpp>
14 #include <libtorrent/session.hpp>
15 #include <libtorrent/torrent_info.hpp>
16 #include <libtorrent/alert_types.hpp>
17 #include <libtorrent/error_code.hpp>
24 typedef QWeakPointer<QSettings> settings_weak_ptr;
26 class AlertWaiterThread;
27 typedef libtorrent::session session_t;
28 typedef libtorrent::session const* session_cptr;
30 typedef libtorrent::add_torrent_params add_torrent_params_t;
31 typedef libtorrent::alert alert_t;
32 // typedef libtorrent::alert const* alert_cptr;
33 typedef libtorrent::torrent_alert torrent_alert_t;
34 typedef libtorrent::libtorrent_exception torrent_exception_t;
36 typedef QSharedPointer<TorrentHandle> TorrentHandlePtr;
37 typedef QHash<QString, TorrentHandlePtr > torrents_t;
42 class TorrentSession : public QObject
46 Q_CLASSINFO("D-Bus Interface", "com.ixonos.qtrapids");
50 TorrentSession(QObject *parent, QSettings *);
55 void addTorrent(const QString &path, const QString &save_path
56 , qtrapids::ParamsMap_t other_params);
57 void removeTorrent(const QString &hash);
60 void alert(qtrapids::TorrentState info, qtrapids::ParamsMap_t other_info);
67 AlertWaiterThread *alertWaiter_;
71 } // namespace qtrapids