summaryrefslogtreecommitdiff
path: root/declarativewatchlet.h
blob: 1e940074cef71b164ab31e3e798bdb7674aadb4a (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
#ifndef DECLARATIVEWATCHLET_H
#define DECLARATIVEWATCHLET_H

#include <QtDeclarative/QDeclarativeEngine>
#include <QtDeclarative/QDeclarativeComponent>
#include <QtDeclarative/QDeclarativeItem>
#include "graphicswatchlet.h"

namespace sowatch
{

class DeclarativeWatchWrapper;

class DeclarativeWatchlet : public GraphicsWatchlet
{
    Q_OBJECT
public:
	explicit DeclarativeWatchlet(WatchServer* server, const QString& id);

	void setSource(const QUrl& url);

protected slots:
	void handleComponentStatus(QDeclarativeComponent::Status status);

protected:
	void activate();
	void deactivate();

	static bool _registered;
	QDeclarativeEngine* _engine;
	QDeclarativeComponent* _component;
	QDeclarativeItem* _item;
	DeclarativeWatchWrapper* _wrapper;

};

}

#endif // DECLARATIVEWATCHLET_H