summaryrefslogtreecommitdiff
path: root/metawatch/metawatchdigital.h
blob: 7ce195b958f53fbf01877c4a520cba8fcc1f8a69 (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
53
54
55
#ifndef METAWATCHDIGITAL_H
#define METAWATCHDIGITAL_H

#include "metawatch.h"

namespace sowatch
{

class MetaWatchDigital : public MetaWatch
{
    Q_OBJECT
public:
	explicit MetaWatchDigital(const QBluetoothAddress& address, QSettings* settings = 0, QObject *parent = 0);

	static const int screenWidth = 96;
	static const int screenHeight = 96;
	static const int systemAreaHeight = 30;

	int metric(PaintDeviceMetric metric) const;

	QString model() const;

	void updateNotificationCount(Notification::Type type, int count);
	void updateWeather(WeatherNotification *weather);

	void displayIdleScreen();
	void displayNotification(Notification *notification);
	void displayApplication();

	void clear(Mode mode, bool black = false);
	void update(Mode mode, const QList<QRect>& rects = QList<QRect>());

protected:
	// Idle screen: notifications unread count
	ushort _nMails, _nCalls, _nIms, _nSms, _nMms;
	// Idle screen: weather information
	WeatherNotification::WeatherType _wForecast;
	QString _wBody;
	short _wTemperature;
	bool _wMetric;

	void handleWatchConnected();

	void renderIdleScreen();
	void renderIdleWeather();
	QImage iconForWeather(WeatherNotification::WeatherType w);
	void renderIdleCounts();

	void renderNotification(Notification *n);
	QImage iconForNotification(const Notification *n);
};

}

#endif // METAWATCHDIGITAL_H