summaryrefslogtreecommitdiff
path: root/sowatchd/watchhandler.h
blob: 3fa7c6b50298bd3f84401153dfbdb411257c4d6d (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 WATCHHANDLER_H
#define WATCHHANDLER_H

#include <QtCore/QObject>
#include <QtCore/QList>

#include <sowatch.h>

namespace sowatch
{

class WatchHandler : public QObject
{
	Q_OBJECT
	Q_PROPERTY(QString status READ status NOTIFY statusChanged)

public:
	explicit WatchHandler(ConfigKey *config, QObject *parent = 0);

	QString status() const;

signals:
	void statusChanged();

private slots:
	void updateWatchlets();
	void updateProviders();
	void handleConfigSubkeyChanged(const QString& key);

private:
	ConfigKey *_config;
	Watch *_watch;
	WatchServer *_server;
	QList<QString> _watchlet_order;
	QMap<QString, Watchlet*> _watchlets;
	QMap<QString, NotificationProvider*> _providers;
};

}

#endif // WATCHHANDLER_H