diff options
| author | Tomasz Sterna <tomek@xiaoka.com> | 2014-07-14 16:49:27 +0200 |
|---|---|---|
| committer | Tomasz Sterna <tomek@xiaoka.com> | 2014-07-14 16:49:27 +0200 |
| commit | c358544734ae26770e91d56a92dcd8e22da71be5 (patch) | |
| tree | 8227bed64b6cbd7088102c762285e64a30418d56 /daemon/notificationmanager.h | |
| parent | 9160f139d399bce61c67a4ebc31dfdf1cc5d3e62 (diff) | |
| parent | c911932934f0a7d8bf1c252be4a3e718859b3b09 (diff) | |
Merge branch 'notifications' of github.com:smurfy/pebble into smurfy-notifications
Conflicts:
daemon/daemon.pro
daemon/manager.cpp
daemon/manager.h
Diffstat (limited to 'daemon/notificationmanager.h')
| -rw-r--r-- | daemon/notificationmanager.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/daemon/notificationmanager.h b/daemon/notificationmanager.h new file mode 100644 index 0000000..d2640eb --- /dev/null +++ b/daemon/notificationmanager.h @@ -0,0 +1,46 @@ +#ifndef NOTIFICATIONMANAGER_H +#define NOTIFICATIONMANAGER_H + +#include <QObject> +#include "Logger" + +#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 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 getCleanAppName(QString app_name); + QStringHash getCategoryParams(QString category); + + Q_DISABLE_COPY(NotificationManager) + Q_DECLARE_PRIVATE(NotificationManager) +}; + +#endif // NOTIFICATIONMANAGER_H |
