summaryrefslogtreecommitdiff
path: root/sowatchd/watchhandler.h
blob: 39c1d1742b34077633620ab97097168fa541f712 (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
42
43
44
#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);
	void handleDriverUnloaded(const QString& id);
	void handleWatchletUnloaded(const QString& id);
	void handleProviderUnloaded(const QString& id);

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

}

#endif // WATCHHANDLER_H