~ubuntu-branches/ubuntu/lucid/ktorrent/lucid

« back to all changes in this revision

Viewing changes to ktorrent/dbus.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Thomas
  • Date: 2009-02-16 18:37:14 UTC
  • mfrom: (1.1.25 upstream) (0.4.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090216183714-52tf47jrnmk4xkmp
Tags: 3.2+dfsg.1-2ubuntu1
* Merge with Debian, remaining changes: (LP: #296433)
  - Use Kubuntu's kde4.mk
  - Build-depend on libboost-serialization1.35-dev since unversioned -dev is
    in universe
  - Change plasma-applet-ktorrent to plasma-widget-ktorrent since we're
    supposed to call them widgets for the users

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 *   Copyright (C) 2007 by Joris Guisson and Ivan Vasic                    *
3
 
 *   joris.guisson@gmail.com                                               *
4
 
 *   ivasic@gmail.com                                                      *
5
 
 *                                                                         *
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.                                   *
10
 
 *                                                                         *
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.                          *
15
 
 *                                                                         *
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
 
 ***************************************************************************/
21
 
#ifndef KT_DBUS_HH
22
 
#define KT_DBUS_HH
23
 
 
24
 
#include <QObject>
25
 
#include <util/ptrmap.h>
26
 
 
27
 
namespace kt
28
 
{
29
 
        class GUI;
30
 
        class Core;
31
 
        class TorrentInterface;
32
 
 
33
 
        /**
34
 
         * Class which handles DBus calls
35
 
         * */
36
 
        class DBus : public QObject
37
 
        {
38
 
                Q_OBJECT
39
 
                Q_CLASSINFO("D-Bus Interface", "org.ktorrent.KTorrent")
40
 
        public:
41
 
                DBus(GUI* gui,Core* core);
42
 
                virtual ~DBus();
43
 
 
44
 
        public Q_SLOTS:
45
 
                /// Get the names of all torrents
46
 
                Q_SCRIPTABLE QStringList torrents();
47
 
 
48
 
                /// Start a torrent
49
 
                Q_SCRIPTABLE void start(const QString & torrent);
50
 
 
51
 
                /// Stop a torrent
52
 
                Q_SCRIPTABLE void stop(const QString & torrent);
53
 
 
54
 
                /// Start all torrents
55
 
                Q_SCRIPTABLE void startAll();
56
 
 
57
 
                /// Stop all torrents
58
 
                Q_SCRIPTABLE void stopAll();
59
 
 
60
 
                /// Get the download speed of a torrent
61
 
                Q_SCRIPTABLE int downloadSpeed(const QString & torrent);
62
 
 
63
 
                /// Get the upload speed of a torrent
64
 
                Q_SCRIPTABLE int uploadSpeed(const QString & torrent);
65
 
 
66
 
                void torrentAdded(bt::TorrentInterface* tc);
67
 
                void torrentRemoved(bt::TorrentInterface* tc);
68
 
 
69
 
         Q_SIGNALS: 
70
 
                /// DBus signal emitted when a torrent has been added
71
 
                Q_SCRIPTABLE void torrentAdded(const QString & tor);
72
 
 
73
 
                /// DBus signal emitted when a torrent has been removed
74
 
                Q_SCRIPTABLE void torrentRemoved(const QString & tor);
75
 
 
76
 
        private:
77
 
                GUI* gui;
78
 
                Core* core;
79
 
                bt::PtrMap<QString,bt::TorrentInterface> torrent_map;
80
 
        };
81
 
 
82
 
}
83
 
 
84
 
#endif