summaryrefslogtreecommitdiff
path: root/metawatch/metawatch.h
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2011-10-15 23:57:14 +0200
committerJavier S. Pedro <maemo@javispedro.com>2011-10-15 23:57:14 +0200
commitde66281645cea6073659ff4d9f534a2f403588cc (patch)
tree1183f1242d8b7be061668e903cd51867b696e438 /metawatch/metawatch.h
parentf0052223da8290fb9273c4901f6309e612ea55ff (diff)
downloadsowatch-de66281645cea6073659ff4d9f534a2f403588cc.tar.gz
sowatch-de66281645cea6073659ff4d9f534a2f403588cc.zip
Moving MetaWatchDigital stuff into its own class
Diffstat (limited to 'metawatch/metawatch.h')
-rw-r--r--metawatch/metawatch.h36
1 files changed, 13 insertions, 23 deletions
diff --git a/metawatch/metawatch.h b/metawatch/metawatch.h
index 9a25134..9c4680b 100644
--- a/metawatch/metawatch.h
+++ b/metawatch/metawatch.h
@@ -26,10 +26,6 @@ public:
explicit MetaWatch(const QBluetoothAddress& address, QSettings* settings = 0, QObject *parent = 0);
~MetaWatch();
- static const int screenWidth = 96;
- static const int screenHeight = 96;
- static const int systemAreaHeight = 30;
-
enum MessageType {
NoMessage = 0,
GetDeviceType = 0x01,
@@ -83,7 +79,7 @@ public:
};
QPaintEngine* paintEngine() const;
- int metric(PaintDeviceMetric metric) const;
+ int metric(PaintDeviceMetric metric) const = 0;
QString model() const;
QStringList buttons() const;
@@ -106,19 +102,15 @@ public:
Mode currentMode() const;
Mode paintTargetMode() const;
+
QImage* imageFor(Mode mode);
- void clear(Mode mode, bool black = false);
- void update(Mode mode, const QList<QRect>& rects = QList<QRect>());
+ QRect rectFor(Mode mode);
+
+ virtual void clear(Mode mode, bool black = false) = 0;
+ virtual void update(Mode mode, const QList<QRect>& rects = QList<QRect>()) = 0;
void grabButton(Mode mode, Button button);
void ungrabButton(Mode mode, Button button);
- void renderIdleScreen();
- void renderIdleWeather();
- void renderIdleCounts();
- void renderNotificationScreen();
-
- QImage iconForNotification(const Notification *n);
-
protected:
// Some configurable stuff.
bool _24hMode : 1;
@@ -128,9 +120,6 @@ protected:
bool _invertedApplications : 1;
short _notificationTimeout;
- // Notifications: Unread count
- uint _nMails, _nCalls, _nIms, _nSms, _nMms;
-
// Notifications: timers
QTimer* _idleTimer;
QTimer* _ringTimer;
@@ -175,11 +164,10 @@ protected:
static const quint8 bitRevTable[16];
static const quint16 crcTable[256];
- quint16 calcCrc(const QByteArray& data, int size);
- quint16 calcCrc(const Message& msg);
+ static quint16 calcCrc(const QByteArray& data, int size);
+ static quint16 calcCrc(const Message& msg);
void send(const Message& msg);
- void handleMessage(const Message& msg);
void setVibrateMode(bool enable, uint on, uint off, uint cycles);
void updateLine(Mode mode, const QImage& image, int line);
@@ -192,10 +180,12 @@ protected:
void enableButton(Mode mode, Button button, ButtonPress press);
void disableButton(Mode mode, Button button, ButtonPress press);
- void handleStatusChange(const Message& msg);
- void handleButtonEvent(const Message& msg);
+ virtual void handleWatchConnected() = 0;
+ virtual void handleStatusChange(const Message& msg);
+ virtual void handleButtonEvent(const Message& msg);
-protected slots:
+private slots:
+ void handleMessage(const Message& msg);
void socketConnected();
void socketDisconnected();
void socketData();