|
1 /* |
|
2 * Copyright (c) 2010 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: Communication Launcher widget for Friend widget |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef COMMLAUNCHERWIDGET_H |
|
19 #define COMMLAUNCHERWIDGET_H |
|
20 |
|
21 #include <HbPopup> |
|
22 #include <qtcontacts.h> |
|
23 #include <xqaiwrequest.h> |
|
24 |
|
25 #include "contactwidgetplugin_global.h" |
|
26 |
|
27 class QGraphicsLinearLayout; |
|
28 class HbPushButton; |
|
29 class HbDocumentLoader; |
|
30 class XQApplicationManager; |
|
31 |
|
32 QTM_USE_NAMESPACE |
|
33 |
|
34 /** |
|
35 * CommLauncherWidget |
|
36 */ |
|
37 class CommLauncherWidget : public HbPopup |
|
38 { |
|
39 Q_OBJECT |
|
40 |
|
41 public: |
|
42 |
|
43 CommLauncherWidget(QGraphicsItem *parent = 0); |
|
44 ~CommLauncherWidget(); |
|
45 |
|
46 void setContact(QContact &contact); |
|
47 void setApplicationManager(XQApplicationManager &appManager); |
|
48 void createUI(); |
|
49 void openPhonebookCreateNew(); |
|
50 |
|
51 QPointF commLauncherPosition(QPointF widgetPosition, QRectF& widgetBoundingRect, |
|
52 QRectF& sceneRect, QRectF& launcherRect); |
|
53 void selectAppearEffect(QPointF FriendPos, QPointF LauncherPos); |
|
54 |
|
55 signals: |
|
56 void launcherClosed(); |
|
57 |
|
58 protected: |
|
59 void keyPressEvent(QKeyEvent *event); |
|
60 |
|
61 private: |
|
62 HbPushButton* createButton(const QString iconName, const QString buttonName, |
|
63 const HbDocumentLoader *documentLoader); |
|
64 |
|
65 private slots: |
|
66 void popupAboutToShow(); |
|
67 void popupAboutToClose(); |
|
68 |
|
69 void makeCall(); |
|
70 void sendMessage(); |
|
71 // EMAIL FUNCTIONALITY COMMENTED OUT BECAUSE PLATFORM DOES NOT SUPPORT IT! |
|
72 //void sendEmail(); |
|
73 void openPhonebook(); |
|
74 |
|
75 int commLauncherWidth(); |
|
76 |
|
77 private: |
|
78 |
|
79 QContact *mContact; |
|
80 QGraphicsLinearLayout *mLayout; |
|
81 |
|
82 int mButtonCount; |
|
83 |
|
84 XQAiwRequest *mRequest; |
|
85 |
|
86 HbPushButton *mCallButton; |
|
87 HbPushButton *mSendMsgButton; |
|
88 HbPushButton *mEmailButton; |
|
89 HbPushButton *mPhonebookButton; |
|
90 |
|
91 XQApplicationManager *mApplicationManager; |
|
92 QString mAppearEffect; |
|
93 |
|
94 CONTACTWIDGET_TEST_FRIEND_CLASS(TestContactWidget) |
|
95 |
|
96 }; |
|
97 |
|
98 #endif //COMMLAUNCHERWIDGET_H |