summaryrefslogtreecommitdiff
path: root/libsowatch/watchserver.h
blob: 78454d43d81134c2b9cef12f25619091e620d5fd (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
45
46
#ifndef WATCHSERVER_H
#define WATCHSERVER_H

#include <QtCore/QObject>
#include <QtCore/QMap>

namespace sowatch
{

class Watch;
class Watchlet;

class WatchServer : public QObject
{
    Q_OBJECT
	Q_PROPERTY(Watch* watch READ watch)
public:
	explicit WatchServer(Watch* watch, QObject* parent = 0);

	Watch* watch();

	void runWatchlet(const QString& id);
	void closeWatchlet();

signals:

public slots:

protected:
	Watch* _watch;
	Watchlet* _currentWatchlet;

	QMap<QString, Watchlet*> watchlets;

	void registerWatchlet(Watchlet *watchlet);

protected slots:
	void watchConnected();
	void watchDisconnected();

friend class Watchlet;
};

}

#endif // WATCHSERVER_H