summaryrefslogtreecommitdiff
path: root/daemon/notificationmanager.h
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/notificationmanager.h')
-rw-r--r--daemon/notificationmanager.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/daemon/notificationmanager.h b/daemon/notificationmanager.h
new file mode 100644
index 0000000..4695db9
--- /dev/null
+++ b/daemon/notificationmanager.h
@@ -0,0 +1,51 @@
+#ifndef NOTIFICATIONMANAGER_H
+#define NOTIFICATIONMANAGER_H
+
+#include <QObject>
+#include "Logger"
+#include "settings.h"
+
+#include <QDBusInterface>
+#include <QDBusPendingCallWatcher>
+
+typedef QHash<QString, QString> QStringHash;
+
+class NotificationManager : public QObject
+{
+ Q_OBJECT
+ LOG4QT_DECLARE_QCLASS_LOGGER
+ Q_CLASSINFO("D-Bus Interface", "org.freedesktop.Notifications")
+
+ Q_PROPERTY(QDBusInterface* interface READ interface)
+public:
+ explicit NotificationManager(QObject *parent = 0);
+ ~NotificationManager();
+
+ QDBusInterface* interface() const;
+
+Q_SIGNALS:
+ void error(const QString &message);
+ void smsNotify(const QString &sender, const QString &data);
+ void twitterNotify(const QString &sender, const QString &data);
+ void facebookNotify(const QString &sender, const QString &data);
+ void emailNotify(const QString &sender, const QString &data,const QString &subject);
+
+public Q_SLOTS:
+ void Notify(const QString &app_name, uint replaces_id, const QString &app_icon, const QString &summary, const QString &body, const QStringList &actions, const QVariantHash &hints, int expire_timeout);
+ void setSettings(Settings *settings);
+
+protected Q_SLOTS:
+ void initialize(bool notifyError = false);
+
+private:
+ class NotificationManagerPrivate *d_ptr;
+
+ QString getCleanAppName(QString app_name);
+ QStringHash getCategoryParams(QString category);
+ Settings *settings;
+
+ Q_DISABLE_COPY(NotificationManager)
+ Q_DECLARE_PRIVATE(NotificationManager)
+};
+
+#endif // NOTIFICATIONMANAGER_H