Release 0.5-1 contains (Muti-profile support, Contacts Integration)
[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 DBUS_SERVICE        "org.freedesktop.DBus.Properties"
19 #define DBUS_OBJ_PATH       "/org/freedesktop/DBus/Properties"
20 #define DBUS_PROPS_IFACE     "org.freedesktop.DBus.Properties"
21
22 namespace org {
23 namespace freedesktop {
24 namespace Telepathy {
25 struct SimplePresence
26 {
27     uint type;
28     QString status;
29     QString statusMessage;
30 };
31 }//Telepathy
32 }//freedesktop
33 }//org
34
35 Q_DECLARE_METATYPE(org::freedesktop::Telepathy::SimplePresence);
36
37 bool operator==(const org::freedesktop::Telepathy::SimplePresence& v1, const org::freedesktop::Telepathy::SimplePresence& v2);
38 inline bool operator!=(const org::freedesktop::Telepathy::SimplePresence& v1, const org::freedesktop::Telepathy::SimplePresence& v2)
39 {
40     return !operator==(v1, v2);
41 }
42 QDBusArgument& operator<<(QDBusArgument& arg, const org::freedesktop::Telepathy::SimplePresence& val);
43 const QDBusArgument& operator>>(const QDBusArgument& arg, org::freedesktop::Telepathy::SimplePresence& val);
44
45 class TelepathyUtility : public QObject
46 {
47     Q_OBJECT
48 public:
49     TelepathyUtility(QObject *parent = 0);
50     ~TelepathyUtility();
51     QList<QDBusObjectPath> getAllAccounts();
52     QString getAccountStatus();
53     bool accountExists();
54     bool createAccount();
55     bool deleteAccount();
56 };
57
58 #endif // TELEPATHYUTILITY_H