summaryrefslogtreecommitdiff
path: root/libsowatch/declarativewatchwrapper.h
blob: 74f569caddd0fabec7d984f14111405f9b84e452 (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
47
48
49
50
51
52
#ifndef SOWATCH_DECLARATIVEWATCHWRAPPER_H
#define SOWATCH_DECLARATIVEWATCHWRAPPER_H

#include <QtDeclarative/QtDeclarative>
#include "sowatch_global.h"

namespace sowatch
{

class WatchServer;
class Watch;
class DeclarativeWatchlet;
class Notification;

class SOWATCH_EXPORT DeclarativeWatchWrapper : public QObject
{
    Q_OBJECT
	Q_PROPERTY(QString model READ model CONSTANT)
	Q_PROPERTY(bool active READ active NOTIFY activeChanged)

public:
	explicit DeclarativeWatchWrapper(WatchServer *server, Watch *watch, QObject *parent = 0);

	QString model() const;
	bool active() const;

public slots:
	void vibrate(int msecs);

signals:
	void buttonPressed(int button);
	void buttonReleased(int button);

	void activeChanged();
	void notificationsChanged();

private:
	WatchServer *_server;
	Watch* _watch;
	bool _active;

	void activate();
	void deactivate();

friend class DeclarativeWatchlet;
};

}

QML_DECLARE_TYPE(sowatch::DeclarativeWatchWrapper)

#endif // SOWATCH_DECLARATIVEWATCHWRAPPER_H