Version 0.7-0
[vicar] / src / vicar-lib / cpp / dbusutility.h
1 /*
2 @version: 0.6
3 @author: Sudheer K. <scifi1947 at gmail.com>
4 @license: GNU General Public License
5 */
6
7 #ifndef DBUSUTILITY_H
8 #define DBUSUTILITY_H
9
10 #include <QDBusMessage>
11 #include <QDBusConnection>
12
13 #define NOTIFICATION_SERVICE    "org.freedesktop.Notifications"
14 #define NOTIFICATION_PATH       "/org/freedesktop/Notifications"
15 #define NOTIFICATION_INTERFACE  "org.freedesktop.Notifications"
16
17 class DbusUtility: public QObject
18 {
19  Q_OBJECT
20 protected:
21     QDBusConnection connection;
22 public:
23     DbusUtility(QObject * parent = 0);
24     ~DbusUtility();
25     QDBusConnection getConnection(bool systemBus = true);
26     void setConnection(QDBusConnection connection);
27     bool sendSignal(QString strPath,QString strInterface,QString strName,bool systemBus = true);
28     bool sendMethodCall(QString strService,QString strPath,
29                         QString strInterface,QString strMethodName,
30                         QList<QVariant> & arguments,bool systemBus = true);
31     bool displayNotification(QString strMessage);
32     QString getErrorMessage();
33 };
34
35 #endif // DBUSUTILITY_H