Version 0.7-0
[vicar] / src / vicar-lib / cpp / dbusutility.h
diff --git a/src/vicar-lib/cpp/dbusutility.h b/src/vicar-lib/cpp/dbusutility.h
new file mode 100755 (executable)
index 0000000..f362b70
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@license: GNU General Public License
+*/
+
+#ifndef DBUSUTILITY_H
+#define DBUSUTILITY_H
+
+#include <QDBusMessage>
+#include <QDBusConnection>
+
+#define NOTIFICATION_SERVICE    "org.freedesktop.Notifications"
+#define NOTIFICATION_PATH       "/org/freedesktop/Notifications"
+#define NOTIFICATION_INTERFACE  "org.freedesktop.Notifications"
+
+class DbusUtility: public QObject
+{
+ Q_OBJECT
+protected:
+    QDBusConnection connection;
+public:
+    DbusUtility(QObject * parent = 0);
+    ~DbusUtility();
+    QDBusConnection getConnection(bool systemBus = true);
+    void setConnection(QDBusConnection connection);
+    bool sendSignal(QString strPath,QString strInterface,QString strName,bool systemBus = true);
+    bool sendMethodCall(QString strService,QString strPath,
+                        QString strInterface,QString strMethodName,
+                        QList<QVariant> & arguments,bool systemBus = true);
+    bool displayNotification(QString strMessage);
+    QString getErrorMessage();
+};
+
+#endif // DBUSUTILITY_H