summaryrefslogtreecommitdiff
path: root/src/notificationmonitor.h
blob: eac06ffc41d38b09b4519aed6a79a1c52061ce7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef NOTIFICATIONMONITOR_H
#define NOTIFICATIONMONITOR_H

#include <QtCore/QObject>
#include <QtCore/QHash>
#include <QtDBus/QDBusServiceWatcher>

#include "notification.h"

class NotificationMonitor : public QObject
{
	Q_OBJECT

public:
	~NotificationMonitor();

	static NotificationMonitor *instance();

signals:
	void newNotification(Notification *notification);

private:
	explicit NotificationMonitor(QObject *parent = 0);

private slots:
    void handleServiceOwnerChanged(const QString &serviceName, const QString &oldOwner, const QString &newOwner);

private:
    QDBusServiceWatcher *_watcher;
    QHash<uint, Notification*> _pendingNotifications;
    QHash<uint, Notification*> _notifications;
};

#endif // NOTIFICATIONMONITOR_H