Fix for publish/subscribe error
[vicar] / src / vicar-lib / src / telepathyutility.h
1 /*
2 @version: 0.5
3 @author: Sudheer K. <scifi1947 at gmail.com>
4 @license: GNU General Public License
5 */
6
7 #ifndef TELEPATHYUTILITY_H
8 #define TELEPATHYUTILITY_H
9
10 #include <QObject>
11 #include <QDBusObjectPath>
12 #include <QDBusArgument>
13
14
15 #define AM_SERVICE          "org.freedesktop.Telepathy.AccountManager"
16 #define AM_OBJ_PATH         "/org/freedesktop/Telepathy/AccountManager"
17 #define AM_INTERFACE        "org.freedesktop.Telepathy.AccountManager"
18 #define RING_CONN_SERVICE   "org.freedesktop.Telepathy.Connection.ring.tel.ring"
19 #define RING_CONN_PATH      "/org/freedesktop/Telepathy/Connection/ring/tel/ring"
20 #define DBUS_SERVICE        "org.freedesktop.DBus.Properties"
21 #define DBUS_OBJ_PATH       "/org/freedesktop/DBus/Properties"
22 #define DBUS_PROPS_IFACE     "org.freedesktop.DBus.Properties"
23
24 namespace org {
25 namespace freedesktop {
26 namespace Telepathy {
27 struct SimplePresence
28 {
29     uint type;
30     QString status;
31     QString statusMessage;
32 };
33 }//Telepathy
34 }//freedesktop
35 }//org
36
37 Q_DECLARE_METATYPE(org::freedesktop::Telepathy::SimplePresence);
38
39 bool operator==(const org::freedesktop::Telepathy::SimplePresence& v1, const org::freedesktop::Telepathy::SimplePresence& v2);
40 inline bool operator!=(const org::freedesktop::Telepathy::SimplePresence& v1, const org::freedesktop::Telepathy::SimplePresence& v2)
41 {
42     return !operator==(v1, v2);
43 }
44 QDBusArgument& operator<<(QDBusArgument& arg, const org::freedesktop::Telepathy::SimplePresence& val);
45 const QDBusArgument& operator>>(const QDBusArgument& arg, org::freedesktop::Telepathy::SimplePresence& val);
46
47 class TelepathyUtility : public QObject
48 {
49     Q_OBJECT
50 public:
51     TelepathyUtility(QObject *parent = 0);
52     ~TelepathyUtility();
53     QList<QDBusObjectPath> getAllAccounts();
54     QString getAccountStatus();
55     bool accountExists();
56     bool createAccount();
57     bool deleteAccount();
58     bool callNumberWithRing(QString number);
59     bool sendDTMFTone(QString tone);
60 };
61
62 #endif // TELEPATHYUTILITY_H