1
/***************************************************************************
2
* Copyright (C) 2007 by Joris Guisson and Ivan Vasic *
3
* joris.guisson@gmail.com *
6
* This program is free software; you can redistribute it and/or modify *
7
* it under the terms of the GNU General Public License as published by *
8
* the Free Software Foundation; either version 2 of the License, or *
9
* (at your option) any later version. *
11
* This program is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
* GNU General Public License for more details. *
16
* You should have received a copy of the GNU General Public License *
17
* along with this program; if not, write to the *
18
* Free Software Foundation, Inc., *
19
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
20
***************************************************************************/
25
#include <util/ptrmap.h>
31
class TorrentInterface;
34
* Class which handles DBus calls
36
class DBus : public QObject
39
Q_CLASSINFO("D-Bus Interface", "org.ktorrent.KTorrent")
41
DBus(GUI* gui,Core* core);
45
/// Get the names of all torrents
46
Q_SCRIPTABLE QStringList torrents();
49
Q_SCRIPTABLE void start(const QString & torrent);
52
Q_SCRIPTABLE void stop(const QString & torrent);
54
/// Start all torrents
55
Q_SCRIPTABLE void startAll();
58
Q_SCRIPTABLE void stopAll();
60
/// Get the download speed of a torrent
61
Q_SCRIPTABLE int downloadSpeed(const QString & torrent);
63
/// Get the upload speed of a torrent
64
Q_SCRIPTABLE int uploadSpeed(const QString & torrent);
66
void torrentAdded(bt::TorrentInterface* tc);
67
void torrentRemoved(bt::TorrentInterface* tc);
70
/// DBus signal emitted when a torrent has been added
71
Q_SCRIPTABLE void torrentAdded(const QString & tor);
73
/// DBus signal emitted when a torrent has been removed
74
Q_SCRIPTABLE void torrentRemoved(const QString & tor);
79
bt::PtrMap<QString,bt::TorrentInterface> torrent_map;