|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef DIALERWIDGET_H |
|
19 #define DIALERWIDGET_H |
|
20 |
|
21 #include <hswidget.h> |
|
22 |
|
23 |
|
24 #ifndef HOMESCREEN_TEST |
|
25 #define HOMESCREEN_TEST_CLASS(aClassName) |
|
26 #define HOMESCREEN_TEST_FRIEND_CLASS(aClassName) |
|
27 #else |
|
28 #define HOMESCREEN_TEST_CLASS(aClassName) class aClassName; |
|
29 #define HOMESCREEN_TEST_FRIEND_CLASS(aClassName) friend class aClassName; |
|
30 #endif //HOMESCREEN_TEST |
|
31 |
|
32 HOMESCREEN_TEST_CLASS(TestDialerWidgetPlugin) |
|
33 |
|
34 |
|
35 class DialerWidgetEngine; |
|
36 class HbFrameItem; |
|
37 class HbIconItem; |
|
38 class HbTextItem; |
|
39 class HbTouchArea; |
|
40 |
|
41 class DialerWidget : public HsWidget |
|
42 { |
|
43 Q_OBJECT |
|
44 |
|
45 public: |
|
46 DialerWidget(QGraphicsItem* parent = 0, Qt::WindowFlags flags = 0); |
|
47 ~DialerWidget(); |
|
48 |
|
49 public slots: |
|
50 void startDialer(); |
|
51 |
|
52 // from HS fw |
|
53 void onInitialize(); |
|
54 void onShow(); |
|
55 void onHide(); |
|
56 void onUninitialize(); |
|
57 |
|
58 // from engine |
|
59 void onEngineException(const int& exc); |
|
60 |
|
61 void onMissedCallsCountChange(const int& count); |
|
62 |
|
63 signals: |
|
64 void error(); |
|
65 |
|
66 protected: |
|
67 void mousePressEvent(QGraphicsSceneMouseEvent *event); |
|
68 void handleMouseMoveEvent(QGraphicsSceneMouseEvent *event); |
|
69 void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); |
|
70 bool sceneEvent(QEvent *event); |
|
71 StartResult onStart(); |
|
72 StopResult onStop(); |
|
73 SuspendResult onSuspend(); |
|
74 ResumeResult onResume(); |
|
75 |
|
76 private: |
|
77 void createPrimitives(); |
|
78 void setBackgroundToNormal(); |
|
79 void setBackgroundToPressed(); |
|
80 |
|
81 private: |
|
82 |
|
83 HbFrameItem *m_background; |
|
84 HbFrameItem *m_badgeBackground; |
|
85 HbTextItem *m_text; |
|
86 HbTouchArea *m_touchArea; |
|
87 DialerWidgetEngine *m_engine; |
|
88 |
|
89 HOMESCREEN_TEST_FRIEND_CLASS(TestDialerWidgetPlugin) |
|
90 }; |
|
91 |
|
92 #endif |