|
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 HSANALOGCLOCKWIDGET_H |
|
19 #define HSANALOGCLOCKWIDGET_H |
|
20 |
|
21 #include <HbWidget> |
|
22 |
|
23 #include <hstest_global.h> |
|
24 |
|
25 HOMESCREEN_TEST_CLASS(TestClockWidget) |
|
26 |
|
27 class HbIconItem; |
|
28 class QGestureEvent; |
|
29 |
|
30 class HsAnalogClockWidget : public HbWidget |
|
31 { |
|
32 Q_OBJECT |
|
33 |
|
34 public: |
|
35 explicit HsAnalogClockWidget(QGraphicsItem *parent = 0); |
|
36 ~HsAnalogClockWidget(); |
|
37 |
|
38 QRectF boundingRect() const; |
|
39 QPainterPath shape() const; |
|
40 |
|
41 signals: |
|
42 void clockTapped(); |
|
43 |
|
44 public slots: |
|
45 void tick(); |
|
46 |
|
47 protected: |
|
48 void resizeEvent(QGraphicsSceneResizeEvent *event); |
|
49 void gestureEvent(QGestureEvent *event); |
|
50 |
|
51 private: |
|
52 Q_DISABLE_COPY(HsAnalogClockWidget) |
|
53 void createPrimitives(); |
|
54 void updatePrimitives(); |
|
55 |
|
56 private: |
|
57 HbIconItem *mBackground; |
|
58 HbIconItem *mHourHand; |
|
59 HbIconItem *mMinuteHand; |
|
60 HbIconItem *mSecondHand; |
|
61 |
|
62 HOMESCREEN_TEST_FRIEND_CLASS(TestClockWidget) |
|
63 }; |
|
64 |
|
65 #endif |