From a4084dcd38a78dfc9113168e378b5fa7f7e9f6ea Mon Sep 17 00:00:00 2001 From: Philipp Andreas Date: Thu, 10 Jul 2014 21:56:19 +0200 Subject: Adding support for default notifications. --- daemon/notificationmanager.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 daemon/notificationmanager.h (limited to 'daemon/notificationmanager.h') diff --git a/daemon/notificationmanager.h b/daemon/notificationmanager.h new file mode 100644 index 0000000..dd3f8bb --- /dev/null +++ b/daemon/notificationmanager.h @@ -0,0 +1,41 @@ +#ifndef NOTIFICATIONMANAGER_H +#define NOTIFICATIONMANAGER_H + +#include + +#include +#include + +class NotificationManager : public QObject +{ + Q_OBJECT + 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 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); + +protected Q_SLOTS: + void initialize(bool notifyError = false); + +private: + class NotificationManagerPrivate *d_ptr; + + QString detectCleanAppname(QString app_name); + + Q_DISABLE_COPY(NotificationManager) + Q_DECLARE_PRIVATE(NotificationManager) +}; + +#endif // NOTIFICATIONMANAGER_H -- cgit v1.2.3