summaryrefslogtreecommitdiff
path: root/meegohandsetnotification/watchnotificationsink.h
blob: dc586a29359851e5d6981cd2eaa94001ed4a695b (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
35
36
37
38
39
40
41
#ifndef WATCHNOTIFICATIONSINK_H
#define WATCHNOTIFICATIONSINK_H

#include <QtCore/QMap>
#include <sowatch.h>
#include <notificationsystem/notification.h>
#include <notificationsystem/notificationsink.h>
#include <notificationsystem/notificationparameters.h>

namespace sowatch {
	class MeegoHandsetNotificationProvider;
}

class WatchNotificationSink : public NotificationSink
{
    Q_OBJECT
public:
	explicit WatchNotificationSink(sowatch::MeegoHandsetNotificationProvider* parent);

	void addNotification(const Notification &notification);
	void removeNotification(uint notificationId);

	void addGroup(uint groupId, const NotificationParameters &parameters);
	void removeGroup(uint groupId);

	int getCount(sowatch::Notification::Type type);

signals:
	void incomingNotification(const sowatch::Notification& notification);
	void countsChanged(sowatch::Notification::Type type);

protected:
	static const uint maxTypes = sowatch::Notification::TypeCount;
	static sowatch::Notification::Type notificationTypeFromEventType(const QString& eventType);

	sowatch::MeegoHandsetNotificationProvider* _parent;
	QMap<uint, Notification> _trackedNotifications;
	uint _counts[maxTypes];
};

#endif // WATCHNOTIFICATIONSINK_H