diff options
Diffstat (limited to 'saltoqd/notificationmonitor.h')
-rw-r--r-- | saltoqd/notificationmonitor.h | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/saltoqd/notificationmonitor.h b/saltoqd/notificationmonitor.h index c0f7691..8ac49c5 100644 --- a/saltoqd/notificationmonitor.h +++ b/saltoqd/notificationmonitor.h @@ -2,10 +2,32 @@ #define NOTIFICATIONMONITOR_H #include <QtCore/QObject> +#include <QtCore/QMap> #include <QtCore/QDateTime> -#include <QtDBus/QDBusContext> -class NotificationMonitor : public QObject, protected QDBusContext +class IncomingNotification : public QObject +{ + Q_OBJECT + Q_PROPERTY(QString sender READ sender) + Q_PROPERTY(QString summary READ summary NOTIFY summaryChanged) + + explicit IncomingNotification(QObject *parent = 0); + +public: + inline QString sender() const { return _sender; } + inline QString summary() const { return _summary; } + +signals: + void summaryChanged(); + +private: + friend class NotificationMonitor; + + QString _sender; + QString _summary; +}; + +class NotificationMonitor : public QObject { Q_OBJECT @@ -14,15 +36,16 @@ public: static NotificationMonitor *instance(); + void processIncomingNotification(quint32 id, const QVariantHash &content); + void processCloseNotification(quint32 id, quint32 reason); + signals: - void incomingNotification(const QString &sender, const QIcon &icon, const QString &summary, int count, const QString &body, const QDateTime &dateTime); + void notification(IncomingNotification *n); private: explicit NotificationMonitor(QObject *parent = 0); + QMap<quint32, IncomingNotification*> _notifs; -private slots: - friend class NotificationsAdaptor; - uint 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); }; #endif // NOTIFICATIONMONITOR_H |