|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Clock widget |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CLOCKWIDGET_H |
|
19 #define CLOCKWIDGET_H |
|
20 |
|
21 // System includes |
|
22 #include <hbwidget.h> |
|
23 #include <QPointer> |
|
24 // User includes |
|
25 #include "clockwidgetdefines.h" |
|
26 |
|
27 //Forward declarations |
|
28 |
|
29 class QGraphicsLinearLayout; |
|
30 class AnalogClockWidget; |
|
31 class DigitalClockWidget; |
|
32 |
|
33 class CLOCKWIDGET_EXPORT ClockWidget : public HbWidget |
|
34 { |
|
35 Q_OBJECT |
|
36 Q_PROPERTY(ClockType clockType READ clockType WRITE setClockType) |
|
37 Q_PROPERTY(TimeFormat timeFormat READ timeFormat WRITE setTimeFormat) |
|
38 |
|
39 public: |
|
40 enum ClockType |
|
41 { |
|
42 ClockTypeAnalog, |
|
43 ClockTypeDigital |
|
44 }; |
|
45 enum TimeFormat |
|
46 { |
|
47 TimeFormat12Hrs, |
|
48 TimeFormat24Hrs |
|
49 }; |
|
50 |
|
51 ClockWidget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0); |
|
52 ~ClockWidget(); |
|
53 ClockType clockType() const; |
|
54 void setClockType(const ClockType &type); |
|
55 void loadClockWidget(); |
|
56 TimeFormat timeFormat() const; |
|
57 void setTimeFormat(const TimeFormat &timeFormat); |
|
58 |
|
59 public slots: |
|
60 void updateTime(); |
|
61 |
|
62 private: |
|
63 void updateClockWidget(); |
|
64 private: |
|
65 ClockType mClockType; |
|
66 TimeFormat mTimeFormat; |
|
67 QPointer<AnalogClockWidget> mAnalogClock; |
|
68 QPointer<DigitalClockWidget> mDigitalClock; |
|
69 QGraphicsLinearLayout *mLayout; |
|
70 }; |
|
71 |
|
72 #endif // CLOCKWIDGET_H |
|
73 |
|
74 // End of file --Don't remove this. |