#ifndef NOTIFICATIONMONITOR_H #define NOTIFICATIONMONITOR_H #include #include #include 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 public: ~NotificationMonitor(); static NotificationMonitor *instance(); void processIncomingNotification(quint32 id, const QVariantHash &content); void processCloseNotification(quint32 id, quint32 reason); signals: void notification(IncomingNotification *n); private: explicit NotificationMonitor(QObject *parent = 0); QMap _notifs; }; #endif // NOTIFICATIONMONITOR_H