From a1ec50943454ba4674c8c5e5d5dadcdbd414b111 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Sat, 24 Sep 2011 20:52:17 +0200 Subject: Incoming phone calls working! --- metawatch/metawatch.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'metawatch/metawatch.h') diff --git a/metawatch/metawatch.h b/metawatch/metawatch.h index 48b7be6..da0f323 100644 --- a/metawatch/metawatch.h +++ b/metawatch/metawatch.h @@ -78,10 +78,10 @@ public: void updateNotificationCount(Notification::Type type, int count); - void vibrate(bool on); - void showNotification(const Notification& n); - void startRinging(const QString &text); - void stopRinging(); + void displayIdleScreen(); + void displayNotification(Notification *n); + void displayApplication(); + Mode currentMode() const; Mode paintTargetMode() const; @@ -92,6 +92,9 @@ public: void renderIdleScreen(); void renderIdleWeather(); void renderIdleCounts(); + void renderNotificationScreen(); + + QImage iconForNotification(const Notification *n); protected: mutable MetaWatchPaintEngine* _paintEngine; @@ -100,9 +103,12 @@ protected: QBluetoothAddress _address; QBluetoothSocket* _socket; + /* Some configurable stuff. */ bool _24hMode : 1; bool _dayMonthOrder : 1; + short _notificationTimeout; + static const int connectRetryTimesSize = 6; static const int connectRetryTimes[connectRetryTimesSize]; short _connectRetries; @@ -130,6 +136,10 @@ protected: // Notifications: Unread count uint _nMails, _nCalls, _nIms, _nSms, _nMms; + // Notifications: timers + QTimer* _idleTimer; + QTimer* _ringTimer; + static const quint8 bitRevTable[16]; static const quint16 crcTable[256]; quint16 calcCrc(const QByteArray& data, int size); @@ -138,6 +148,7 @@ protected: 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); void updateLines(Mode mode, const QImage& image, int lineA, int lineB); void updateLines(Mode mode, const QImage& image, const QVector& lines); @@ -157,6 +168,7 @@ protected slots: void socketState(QBluetoothSocket::SocketState error); void retryConnect(); void timedSend(); + void timedRing(); private: void realSend(const Message& msg); -- cgit v1.2.3