From 3a755f46d9cf6e3650d40a960d0d0db8c1ad9fa1 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Sat, 17 Sep 2011 03:03:23 +0200 Subject: preparing for library package --- libsowatch/watch.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 libsowatch/watch.h (limited to 'libsowatch/watch.h') diff --git a/libsowatch/watch.h b/libsowatch/watch.h new file mode 100644 index 0000000..3581ada --- /dev/null +++ b/libsowatch/watch.h @@ -0,0 +1,49 @@ +#ifndef WATCH_H +#define WATCH_H + +#include +#include +#include + +namespace sowatch +{ + +class Watch : public QObject, public QPaintDevice +{ + Q_OBJECT + Q_PROPERTY(QString model READ model) + Q_PROPERTY(bool connected READ isConnected) +public: + explicit Watch(const QImage& image, QObject* parent = 0); + ~Watch(); + + QPaintEngine* paintEngine() const; + int metric(PaintDeviceMetric metric) const; + + Q_INVOKABLE virtual QString model() const = 0; + Q_INVOKABLE virtual bool isConnected() const = 0; + + /** Indicates if watch is too busy atm and we should limit frame rate. */ + Q_INVOKABLE virtual bool busy() const = 0; + +signals: + void connected(); + void disconnected(); + void buttonPressed(int button); + void buttonReleased(int button); + +public slots: + virtual void update(const QList& rects) = 0; + virtual void update(const QRect& rect); + virtual void vibrate(bool on) = 0; + +protected: + QImage _image; + mutable QPaintEngine* _paintEngine; + +friend class WatchPaintEngine; +}; + +} + +#endif // WATCH_H -- cgit v1.2.3