Ability to sort cur.playlist by long tap on it
[someplayer] / src / dbusadaptor.h
1 /*
2  * SomePlayer - An alternate music player for Maemo 5
3  * Copyright (C) 2010 Nikolay (somebody) Tischenko <niktischenko@gmail.com>
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18  */
19
20 #ifndef DBUSADAPTOR
21 #define DBUSADAPTOR
22
23 #include <QtCore/QObject>
24 #include <QtDBus/QtDBus>
25 #include <QTime>
26
27 #define _DBUS_ACTION_TIMEOUT_ (500)
28
29 class QByteArray;
30 template<class T> class QList;
31 template<class Key, class Value> class QMap;
32 class QString;
33 class QStringList;
34 class QVariant;
35
36 /*
37  * Adaptor class for interface ru.somebody.someplayer
38  */
39 class DBusAdaptop: public QDBusAbstractAdaptor
40 {
41     Q_OBJECT
42     Q_CLASSINFO("D-Bus Interface", "ru.somebody.someplayer")
43     Q_CLASSINFO("D-Bus Introspection", ""
44 "  <interface name=\"ru.somebody.someplayer\">\n"
45 "    <method name=\"prev\">\n"
46 "      <annotation value=\"true\" name=\"org.freedesktop.DBus.Method.NoReply\"/>\n"
47 "    </method>\n"
48 "    <method name=\"next\">\n"
49 "      <annotation value=\"true\" name=\"org.freedesktop.DBus.Method.NoReply\"/>\n"
50 "    </method>\n"
51 "    <method name=\"toggle\">\n"
52 "      <annotation value=\"true\" name=\"org.freedesktop.DBus.Method.NoReply\"/>\n"
53 "    </method>\n"
54 "    <method name=\"stop\">\n"
55 "      <annotation value=\"true\" name=\"org.freedesktop.DBus.Method.NoReply\"/>\n"
56 "    </method>\n"
57 "    <method name=\"artist\">\n"
58 "      <arg direction=\"out\" type=\"s\"/>\n"
59 "    </method>\n"
60 "    <method name=\"album\">\n"
61 "      <arg direction=\"out\" type=\"s\"/>\n"
62 "    </method>\n"
63 "    <method name=\"title\">\n"
64 "      <arg direction=\"out\" type=\"s\"/>\n"
65 "    </method>\n"
66 "  </interface>\n"
67         "")
68 public:
69     DBusAdaptop(QObject *parent);
70     virtual ~DBusAdaptop();
71
72 public: // PROPERTIES
73 public Q_SLOTS: // METHODS
74     QString album();
75     QString artist();
76     Q_NOREPLY void next();
77     Q_NOREPLY void prev();
78     Q_NOREPLY void stop();
79     QString title();
80     Q_NOREPLY void toggle();
81     Q_NOREPLY void pause();
82     Q_NOREPLY void playIfPaused();
83
84     void processBTSignal(QString, QString);
85 Q_SIGNALS: // SIGNALS
86 private:
87         QTime _time;
88 };
89
90 #endif