24 |
24 |
25 HOMESCREEN_TEST_CLASS(TestClockWidget) |
25 HOMESCREEN_TEST_CLASS(TestClockWidget) |
26 |
26 |
27 class HbFrameItem; |
27 class HbFrameItem; |
28 class HbIconItem; |
28 class HbIconItem; |
29 class HbTouchArea; |
29 class QGestureEvent; |
30 |
30 |
31 class HsDigitalClockWidget : public HbWidget |
31 class HsDigitalClockWidget : public HbWidget |
32 { |
32 { |
33 Q_OBJECT |
33 Q_OBJECT |
34 |
34 |
35 public: |
35 public: |
36 explicit HsDigitalClockWidget(bool useAmPm = true, QGraphicsItem *parent = 0); |
36 explicit HsDigitalClockWidget(bool useAmPm = true, QGraphicsItem *parent = 0); |
37 ~HsDigitalClockWidget(); |
37 ~HsDigitalClockWidget(); |
38 |
38 |
39 bool eventFilter(QObject *watched, QEvent *event); |
|
40 QPainterPath shape() const; |
39 QPainterPath shape() const; |
41 signals: |
40 signals: |
42 void clockTapped(); |
41 void clockTapped(); |
43 |
42 |
44 public slots: |
43 public slots: |
45 void tick(); |
44 void tick(); |
46 void setAmPm(bool useAmPm); |
45 void setAmPm(bool useAmPm); |
47 |
46 |
48 protected: |
47 protected: |
49 void resizeEvent(QGraphicsSceneResizeEvent *event); |
48 void resizeEvent(QGraphicsSceneResizeEvent *event); |
|
49 void gestureEvent(QGestureEvent *event); |
50 |
50 |
51 private: |
51 private: |
52 Q_DISABLE_COPY(HsDigitalClockWidget) |
52 Q_DISABLE_COPY(HsDigitalClockWidget) |
53 void createPrimitives(); |
53 void createPrimitives(); |
54 void updatePrimitives(); |
54 void updatePrimitives(); |
55 void handleMouseReleaseEvent(QGraphicsSceneMouseEvent *event); |
|
56 |
55 |
57 private: |
56 private: |
58 HbFrameItem *mBackground; |
57 HbFrameItem *mBackground; |
59 HbIconItem *mDigit1; |
58 HbIconItem *mDigit1; |
60 HbIconItem *mDigit2; |
59 HbIconItem *mDigit2; |
61 HbIconItem *mDigit3; |
60 HbIconItem *mDigit3; |
62 HbIconItem *mDigit4; |
61 HbIconItem *mDigit4; |
63 HbIconItem *mDigit5; |
62 HbIconItem *mDigit5; |
64 HbIconItem *mDigit6; |
63 HbIconItem *mDigit6; |
65 HbIconItem *mAmPm; |
64 HbIconItem *mAmPm; |
66 HbTouchArea *mTouchArea; |
|
67 bool mUseAmPm; |
65 bool mUseAmPm; |
68 QMap<QChar, QString> mDigitMap; |
66 QMap<QChar, QString> mDigitMap; |
69 |
67 |
70 HOMESCREEN_TEST_FRIEND_CLASS(TestClockWidget) |
68 HOMESCREEN_TEST_FRIEND_CLASS(TestClockWidget) |
71 }; |
69 }; |