author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 23 Jun 2010 18:12:20 +0300 | |
changeset 45 | 6b911d05207e |
parent 37 | ba76fc04e6c2 |
child 46 | bc5a64e5bc3c |
permissions | -rw-r--r-- |
37 | 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: Phone UI's Qt view. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#ifndef PHONEUIQTVIEW_H |
|
19 |
#define PHONEUIQTVIEW_H |
|
20 |
||
21 |
#include <QObject> |
|
22 |
#include <hbview.h> |
|
23 |
#include "phoneuiqtviewif.h" |
|
24 |
#include <bubblemanagerif.h> |
|
25 |
#include <qsysteminfo.h> |
|
26 |
||
27 |
class BubbleManager; |
|
28 |
class HbAction; |
|
29 |
class QSignalMapper; |
|
30 |
class HbToolBar; |
|
31 |
class HbVolumeSliderPopup; |
|
32 |
class Dialpad; |
|
33 |
class XqKeyCapture; |
|
34 |
||
35 |
#ifdef BUILD_PHONEUIQTVIEW |
|
36 |
#define PHONEUIQTVIEW_EXPORT Q_DECL_EXPORT |
|
37 |
#else |
|
38 |
#define PHONEUIQTVIEW_EXPORT Q_DECL_IMPORT |
|
39 |
#endif |
|
40 |
||
41 |
using namespace QtMobility; |
|
42 |
||
43 |
||
44 |
class PHONEUIQTVIEW_EXPORT PhoneUIQtView : public HbView, public PhoneUIQtViewIF |
|
45 |
{ |
|
46 |
Q_OBJECT |
|
47 |
||
48 |
public: |
|
49 |
||
50 |
/*! |
|
51 |
Constructor |
|
52 |
*/ |
|
53 |
PhoneUIQtView (HbMainWindow &window, QGraphicsItem *parent = 0); |
|
54 |
||
55 |
/*! |
|
56 |
Destructor |
|
57 |
*/ |
|
58 |
virtual ~PhoneUIQtView (); |
|
59 |
||
60 |
/*! |
|
61 |
\fn void PhoneUIQtView::bubbleManager () |
|
62 |
||
63 |
Returns BubbleManager interface. |
|
64 |
*/ |
|
65 |
BubbleManagerIF& bubbleManager(); |
|
66 |
||
67 |
/*! |
|
68 |
\fn void PhoneUIQtView::addBubbleCommand () |
|
69 |
||
70 |
Adds new command to bubble. Command id will be emitted as |
|
71 |
a parameter from view's command(int) signal. |
|
72 |
*/ |
|
73 |
void addBubbleCommand (int bubbleId, const PhoneAction& action); |
|
74 |
||
75 |
/*! |
|
76 |
\fn void PhoneUIQtView::clearBubbleCommands () |
|
77 |
||
78 |
Clears commands from bubble. |
|
79 |
*/ |
|
80 |
void clearBubbleCommands (int bubbleId); |
|
81 |
||
82 |
/*! |
|
83 |
\fn void PhoneUIQtView::addParticipantListAction () |
|
84 |
||
85 |
Adds new patricipant list command to conference bubble. |
|
86 |
*/ |
|
87 |
void addParticipantListAction(int commandId, const QString &text, const HbIcon &icon); |
|
88 |
||
89 |
/*! |
|
90 |
\fn void PhoneUIQtView::clearBubbleCommands () |
|
91 |
||
92 |
Clears participant list commands from conference bubble. |
|
93 |
*/ |
|
94 |
void clearParticipantListActions(); |
|
95 |
||
96 |
/*! |
|
97 |
\fn void PhoneUIQtViewIF::setToolbarActions() |
|
98 |
||
99 |
Sets toolbar actions. |
|
100 |
*/ |
|
101 |
void setToolbarActions(const QList<PhoneAction*>& actions); |
|
102 |
||
103 |
/*! |
|
104 |
\fn void PhoneUIQtView::hideToolbar () |
|
105 |
||
106 |
Hides toolbar. |
|
107 |
*/ |
|
108 |
void hideToolbar (); |
|
109 |
||
110 |
/*! |
|
111 |
\fn void PhoneUIQtView::showToolbar () |
|
112 |
||
113 |
Shows toolbar. |
|
114 |
*/ |
|
115 |
void showToolbar (); |
|
116 |
||
117 |
/*! |
|
118 |
\fn void PhoneUIQtView::volumeSliderValue () |
|
119 |
||
120 |
Returns HbVolumeSliderPopup's volume value. |
|
121 |
If this volume slider isn't active -1 is returned. |
|
122 |
*/ |
|
123 |
int volumeSliderValue (); |
|
124 |
||
125 |
/*! |
|
126 |
\fn void PhoneUIQtView::setVolumeSliderValue (int value) |
|
127 |
||
128 |
Sets slider value to HbVolumeSliderPopup. |
|
129 |
*/ |
|
130 |
void setVolumeSliderValue ( |
|
131 |
int value, |
|
132 |
int commandId, |
|
133 |
int maxVolumeValue, |
|
134 |
int minVolumeValue); |
|
135 |
||
136 |
/*! |
|
137 |
\fn void PhoneUIQtView::removeVolumeSlider () |
|
138 |
||
139 |
Removes HbVolumeSliderPopup. |
|
140 |
*/ |
|
141 |
void removeVolumeSlider (); |
|
142 |
||
143 |
/*! |
|
144 |
\fn void PhoneUIQtView::setExpandAction () |
|
145 |
||
146 |
Sets expand action. |
|
147 |
*/ |
|
148 |
void setExpandAction(int bubbleId, int commandId); |
|
149 |
||
150 |
/*! |
|
151 |
\fn void PhoneUIQtView::removeExpandAction () |
|
152 |
||
153 |
Removes expand action. |
|
154 |
*/ |
|
155 |
void removeExpandAction(int bubbleId); |
|
156 |
||
157 |
/*! |
|
158 |
\fn void PhoneUIQtView::showDialpad() |
|
159 |
||
160 |
Shows dialpad widget. |
|
161 |
*/ |
|
162 |
void showDialpad(); |
|
163 |
||
164 |
/*! |
|
165 |
\fn void PhoneUIQtView::hideDialpad() |
|
166 |
||
167 |
Hides dialer widget. |
|
168 |
*/ |
|
169 |
void hideDialpad(); |
|
170 |
||
171 |
/*! |
|
172 |
\fn void PhoneUIQtView::isDialpadVisible() |
|
173 |
||
174 |
Checks is dialpad visible. |
|
175 |
*/ |
|
176 |
bool isDialpadVisible(); |
|
177 |
||
178 |
/*! |
|
179 |
\fn void PhoneUIQtView::dialpadText() |
|
180 |
||
181 |
Returns content of the dialpad. |
|
182 |
*/ |
|
183 |
QString dialpadText(); |
|
184 |
||
185 |
/*! |
|
186 |
\fn void PhoneUIQtView::dialpadString() |
|
187 |
||
188 |
Clears and hides dialpad. |
|
189 |
*/ |
|
190 |
void clearAndHideDialpad(); |
|
191 |
||
192 |
/*! |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
193 |
\fn void PhoneUIQtView::clearDialpad() |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
194 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
195 |
Clears text from dialpad. |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
196 |
*/ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
197 |
void clearDialpad(); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
198 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
199 |
/*! |
37 | 200 |
\fn void PhoneUIQtView::bringToForeground() |
201 |
||
202 |
Brings to foreground. |
|
203 |
*/ |
|
204 |
void bringToForeground(); |
|
205 |
||
206 |
/*! |
|
207 |
\fn void PhoneUIQtViewIF::setToolbarActions() |
|
208 |
||
209 |
Sets menu actions for call handling. |
|
210 |
*/ |
|
211 |
void setMenuActions(const QList<PhoneAction*>& actions); |
|
212 |
||
213 |
/*! |
|
214 |
\fn void PhoneUIQtView::setBackButtonVisible() |
|
215 |
||
216 |
Set the Back command visibility in TitleBar |
|
217 |
*/ |
|
218 |
void setBackButtonVisible(bool visible); |
|
219 |
||
220 |
/*! |
|
221 |
\fn void PhoneUIQtViewIF::menuReference() |
|
222 |
||
223 |
Returns HbMenu reference. |
|
224 |
*/ |
|
225 |
HbMenu &menuReference(); |
|
226 |
||
227 |
public slots: |
|
228 |
||
229 |
/*! |
|
230 |
\fn void PhoneUIQtView::volumeSliderClosed () |
|
231 |
||
232 |
HbVolumeSliderPopup calls this method when slider |
|
233 |
is going to be closed. |
|
234 |
*/ |
|
235 |
void volumeSliderClosed (); |
|
236 |
||
237 |
/*! |
|
238 |
\fn void PhoneUIQtView::volumeSliderChanged (int value) |
|
239 |
||
240 |
HbVolumeSliderPopup calls this method when it's value is changed. |
|
241 |
*/ |
|
242 |
void volumeSliderChanged(int value); |
|
243 |
||
244 |
/*! |
|
245 |
\fn void PhoneUIQtView::handleOrientationChange(Qt::Orientation orientation) |
|
246 |
||
247 |
HbMainWindow calls this method when orientation is changed. |
|
248 |
*/ |
|
249 |
void handleOrientationChange(Qt::Orientation orientation); |
|
250 |
||
251 |
/*! |
|
252 |
\fn void PhoneUIQtView::backButtonClicked(Qt::Orientation orientation) |
|
253 |
||
254 |
HbMainWindow calls this method when back softkey is clicked. |
|
255 |
*/ |
|
256 |
void backButtonClicked(); |
|
257 |
||
258 |
/*! |
|
259 |
\fn void PhoneUIQtView::onEditorContentChanged() |
|
260 |
||
261 |
Dialpad calls this method when dialpad content is changed. |
|
262 |
*/ |
|
263 |
void onEditorContentChanged(); |
|
264 |
||
265 |
/*! |
|
266 |
\fn void dialpadClosed() |
|
267 |
||
268 |
Dialpad calls this method when dialpad is closed. |
|
269 |
*/ |
|
270 |
void dialpadClosed(); |
|
271 |
||
272 |
/*! |
|
273 |
\fn void PhoneUIQtView::shutdownPhoneApp() |
|
274 |
||
275 |
Shutdown phone application. |
|
276 |
*/ |
|
277 |
void shutdownPhoneApp(); |
|
278 |
||
279 |
/*! |
|
280 |
\fn void PhoneUIQtView::networkNameChanged(QSystemNetworkInfo::NetworkMode mode, const QString &netName) |
|
281 |
||
282 |
Network name change is informed via this method. |
|
283 |
*/ |
|
284 |
void networkNameChanged(QSystemNetworkInfo::NetworkMode mode, const QString &netName); |
|
285 |
||
286 |
||
287 |
signals: |
|
288 |
||
289 |
/*! |
|
290 |
\fn void keyPressed (QKeyEvent *event) |
|
291 |
||
292 |
This signal is emitted when key is pressed down. |
|
293 |
*/ |
|
294 |
void keyPressed (QKeyEvent *event); |
|
295 |
||
296 |
/*! |
|
297 |
\fn void keyPressed (QKeyEvent *event) |
|
298 |
||
299 |
This signal is emitted when key is released. |
|
300 |
*/ |
|
301 |
void keyReleased (QKeyEvent *event); |
|
302 |
||
303 |
/*! |
|
304 |
\fn void command(int command) |
|
305 |
||
306 |
This signal is emitted when UI action is handled. |
|
307 |
*/ |
|
308 |
void command (int command); |
|
309 |
||
310 |
/*! |
|
311 |
\fn void dialpadIsAboutToClose() |
|
312 |
||
313 |
This signal is emitted when dialpad is about to close. |
|
314 |
*/ |
|
315 |
void dialpadIsAboutToClose(); |
|
316 |
||
317 |
/*! |
|
318 |
\fn void windowActivated(); |
|
319 |
||
320 |
This signal is emitted when window is activated |
|
321 |
*/ |
|
322 |
void windowActivated(); |
|
323 |
||
324 |
/*! |
|
325 |
\fn void windowDeactivated(); |
|
326 |
||
327 |
This signal is emitted when window is deactivated |
|
328 |
*/ |
|
329 |
void windowDeactivated(); |
|
330 |
||
331 |
protected: |
|
332 |
||
333 |
/*! |
|
334 |
\fn void eventFilter(int command) |
|
335 |
||
336 |
Handles key events. |
|
337 |
*/ |
|
338 |
bool eventFilter(QObject * watched, QEvent * event); |
|
339 |
||
340 |
private: |
|
341 |
||
342 |
/*! |
|
343 |
\fn void setDialpadPosition(int command) |
|
344 |
||
345 |
Sets dialpad position. |
|
346 |
*/ |
|
347 |
void setDialpadPosition(); |
|
348 |
||
349 |
/*! |
|
350 |
\fn void setActionRole() |
|
351 |
||
352 |
Sets action role. |
|
353 |
*/ |
|
354 |
static void setActionRole(const PhoneAction& pa, HbAction& action); |
|
355 |
||
356 |
/*! |
|
357 |
\fn void createToolBarActions() |
|
358 |
||
359 |
Creates tool bar actions. |
|
360 |
*/ |
|
361 |
void createToolBarActions(); |
|
362 |
||
363 |
private: |
|
364 |
HbMainWindow &m_window; |
|
365 |
BubbleManager *m_bubbleManager; |
|
366 |
QMap<int , QSignalMapper *> m_bubbleMap; |
|
367 |
QMap<int , QList<HbAction *> *> m_bubbleActionMap; |
|
368 |
QSignalMapper *m_signalMapper; |
|
369 |
QList<HbAction *> m_toolbarActions; |
|
370 |
HbVolumeSliderPopup *m_volumeSlider; |
|
371 |
QSignalMapper *m_expandSignalMapper; |
|
372 |
QMap<int , HbAction*> m_expandActionMap; |
|
373 |
QSignalMapper *m_participantListSignalMapper; |
|
374 |
QList<HbAction *> m_participantListActions; |
|
375 |
int m_volumeCommandId; |
|
376 |
HbAction *m_backAction; |
|
377 |
Dialpad *m_dialpad; |
|
378 |
QSignalMapper *m_menuSignalMapper; |
|
379 |
XqKeyCapture *m_keyCapture; |
|
380 |
QSystemNetworkInfo *m_networkInfo; |
|
381 |
}; |
|
382 |
||
383 |
#endif // PHONEUIQTVIEW_H |