Version 0.7-0
[vicar] / src / vicar-lib / cpp / telepathyutility.h
diff --git a/src/vicar-lib/cpp/telepathyutility.h b/src/vicar-lib/cpp/telepathyutility.h
new file mode 100644 (file)
index 0000000..56f0147
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@license: GNU General Public License
+*/
+
+#ifndef TELEPATHYUTILITY_H
+#define TELEPATHYUTILITY_H
+
+#include <QObject>
+#include <QDBusObjectPath>
+#include <QDBusArgument>
+
+
+#define AM_SERVICE          "org.freedesktop.Telepathy.AccountManager"
+#define AM_OBJ_PATH         "/org/freedesktop/Telepathy/AccountManager"
+#define AM_INTERFACE        "org.freedesktop.Telepathy.AccountManager"
+#define RING_CONN_SERVICE   "org.freedesktop.Telepathy.Connection.ring.tel.ring"
+#define RING_CONN_PATH      "/org/freedesktop/Telepathy/Connection/ring/tel/ring"
+#define DBUS_SERVICE        "org.freedesktop.DBus.Properties"
+#define DBUS_OBJ_PATH       "/org/freedesktop/DBus/Properties"
+#define DBUS_PROPS_IFACE     "org.freedesktop.DBus.Properties"
+
+namespace org {
+namespace freedesktop {
+namespace Telepathy {
+struct SimplePresence
+{
+    uint type;
+    QString status;
+    QString statusMessage;
+};
+}//Telepathy
+}//freedesktop
+}//org
+
+Q_DECLARE_METATYPE(org::freedesktop::Telepathy::SimplePresence);
+
+bool operator==(const org::freedesktop::Telepathy::SimplePresence& v1, const org::freedesktop::Telepathy::SimplePresence& v2);
+inline bool operator!=(const org::freedesktop::Telepathy::SimplePresence& v1, const org::freedesktop::Telepathy::SimplePresence& v2)
+{
+    return !operator==(v1, v2);
+}
+QDBusArgument& operator<<(QDBusArgument& arg, const org::freedesktop::Telepathy::SimplePresence& val);
+const QDBusArgument& operator>>(const QDBusArgument& arg, org::freedesktop::Telepathy::SimplePresence& val);
+
+class TelepathyUtility : public QObject
+{
+    Q_OBJECT
+public:
+    TelepathyUtility(QObject *parent = 0);
+    ~TelepathyUtility();
+    QList<QDBusObjectPath> getAllAccounts();
+    QString getAccountStatus();
+    bool accountExists();
+    bool createAccount();
+    bool deleteAccount();
+    bool callNumberWithRing(QString number);
+    bool sendDTMFTone(QString tone);
+};
+
+#endif // TELEPATHYUTILITY_H