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 |
/*!
|
|
193 |
\fn void PhoneUIQtView::bringToForeground()
|
|
194 |
|
|
195 |
Brings to foreground.
|
|
196 |
*/
|
|
197 |
void bringToForeground();
|
|
198 |
|
|
199 |
/*!
|
|
200 |
\fn void PhoneUIQtViewIF::setToolbarActions()
|
|
201 |
|
|
202 |
Sets menu actions for call handling.
|
|
203 |
*/
|
|
204 |
void setMenuActions(const QList<PhoneAction*>& actions);
|
|
205 |
|
|
206 |
/*!
|
|
207 |
\fn void PhoneUIQtView::setBackButtonVisible()
|
|
208 |
|
|
209 |
Set the Back command visibility in TitleBar
|
|
210 |
*/
|
|
211 |
void setBackButtonVisible(bool visible);
|
|
212 |
|
|
213 |
/*!
|
|
214 |
\fn void PhoneUIQtViewIF::menuReference()
|
|
215 |
|
|
216 |
Returns HbMenu reference.
|
|
217 |
*/
|
|
218 |
HbMenu &menuReference();
|
|
219 |
|
|
220 |
public slots:
|
|
221 |
|
|
222 |
/*!
|
|
223 |
\fn void PhoneUIQtView::volumeSliderClosed ()
|
|
224 |
|
|
225 |
HbVolumeSliderPopup calls this method when slider
|
|
226 |
is going to be closed.
|
|
227 |
*/
|
|
228 |
void volumeSliderClosed ();
|
|
229 |
|
|
230 |
/*!
|
|
231 |
\fn void PhoneUIQtView::volumeSliderChanged (int value)
|
|
232 |
|
|
233 |
HbVolumeSliderPopup calls this method when it's value is changed.
|
|
234 |
*/
|
|
235 |
void volumeSliderChanged(int value);
|
|
236 |
|
|
237 |
/*!
|
|
238 |
\fn void PhoneUIQtView::handleOrientationChange(Qt::Orientation orientation)
|
|
239 |
|
|
240 |
HbMainWindow calls this method when orientation is changed.
|
|
241 |
*/
|
|
242 |
void handleOrientationChange(Qt::Orientation orientation);
|
|
243 |
|
|
244 |
/*!
|
|
245 |
\fn void PhoneUIQtView::backButtonClicked(Qt::Orientation orientation)
|
|
246 |
|
|
247 |
HbMainWindow calls this method when back softkey is clicked.
|
|
248 |
*/
|
|
249 |
void backButtonClicked();
|
|
250 |
|
|
251 |
/*!
|
|
252 |
\fn void PhoneUIQtView::onEditorContentChanged()
|
|
253 |
|
|
254 |
Dialpad calls this method when dialpad content is changed.
|
|
255 |
*/
|
|
256 |
void onEditorContentChanged();
|
|
257 |
|
|
258 |
/*!
|
|
259 |
\fn void dialpadClosed()
|
|
260 |
|
|
261 |
Dialpad calls this method when dialpad is closed.
|
|
262 |
*/
|
|
263 |
void dialpadClosed();
|
|
264 |
|
|
265 |
/*!
|
|
266 |
\fn void PhoneUIQtView::shutdownPhoneApp()
|
|
267 |
|
|
268 |
Shutdown phone application.
|
|
269 |
*/
|
|
270 |
void shutdownPhoneApp();
|
|
271 |
|
|
272 |
/*!
|
|
273 |
\fn void PhoneUIQtView::networkNameChanged(QSystemNetworkInfo::NetworkMode mode, const QString &netName)
|
|
274 |
|
|
275 |
Network name change is informed via this method.
|
|
276 |
*/
|
|
277 |
void networkNameChanged(QSystemNetworkInfo::NetworkMode mode, const QString &netName);
|
|
278 |
|
|
279 |
|
|
280 |
signals:
|
|
281 |
|
|
282 |
/*!
|
|
283 |
\fn void keyPressed (QKeyEvent *event)
|
|
284 |
|
|
285 |
This signal is emitted when key is pressed down.
|
|
286 |
*/
|
|
287 |
void keyPressed (QKeyEvent *event);
|
|
288 |
|
|
289 |
/*!
|
|
290 |
\fn void keyPressed (QKeyEvent *event)
|
|
291 |
|
|
292 |
This signal is emitted when key is released.
|
|
293 |
*/
|
|
294 |
void keyReleased (QKeyEvent *event);
|
|
295 |
|
|
296 |
/*!
|
|
297 |
\fn void command(int command)
|
|
298 |
|
|
299 |
This signal is emitted when UI action is handled.
|
|
300 |
*/
|
|
301 |
void command (int command);
|
|
302 |
|
|
303 |
/*!
|
|
304 |
\fn void dialpadIsAboutToClose()
|
|
305 |
|
|
306 |
This signal is emitted when dialpad is about to close.
|
|
307 |
*/
|
|
308 |
void dialpadIsAboutToClose();
|
|
309 |
|
|
310 |
/*!
|
|
311 |
\fn void windowActivated();
|
|
312 |
|
|
313 |
This signal is emitted when window is activated
|
|
314 |
*/
|
|
315 |
void windowActivated();
|
|
316 |
|
|
317 |
/*!
|
|
318 |
\fn void windowDeactivated();
|
|
319 |
|
|
320 |
This signal is emitted when window is deactivated
|
|
321 |
*/
|
|
322 |
void windowDeactivated();
|
|
323 |
|
|
324 |
protected:
|
|
325 |
|
|
326 |
/*!
|
|
327 |
\fn void eventFilter(int command)
|
|
328 |
|
|
329 |
Handles key events.
|
|
330 |
*/
|
|
331 |
bool eventFilter(QObject * watched, QEvent * event);
|
|
332 |
|
|
333 |
private:
|
|
334 |
|
|
335 |
/*!
|
|
336 |
\fn void setDialpadPosition(int command)
|
|
337 |
|
|
338 |
Sets dialpad position.
|
|
339 |
*/
|
|
340 |
void setDialpadPosition();
|
|
341 |
|
|
342 |
/*!
|
|
343 |
\fn void setActionRole()
|
|
344 |
|
|
345 |
Sets action role.
|
|
346 |
*/
|
|
347 |
static void setActionRole(const PhoneAction& pa, HbAction& action);
|
|
348 |
|
|
349 |
/*!
|
|
350 |
\fn void createToolBarActions()
|
|
351 |
|
|
352 |
Creates tool bar actions.
|
|
353 |
*/
|
|
354 |
void createToolBarActions();
|
|
355 |
|
|
356 |
private:
|
|
357 |
HbMainWindow &m_window;
|
|
358 |
BubbleManager *m_bubbleManager;
|
|
359 |
QMap<int , QSignalMapper *> m_bubbleMap;
|
|
360 |
QMap<int , QList<HbAction *> *> m_bubbleActionMap;
|
|
361 |
QSignalMapper *m_signalMapper;
|
|
362 |
QList<HbAction *> m_toolbarActions;
|
|
363 |
HbVolumeSliderPopup *m_volumeSlider;
|
|
364 |
QSignalMapper *m_expandSignalMapper;
|
|
365 |
QMap<int , HbAction*> m_expandActionMap;
|
|
366 |
QSignalMapper *m_participantListSignalMapper;
|
|
367 |
QList<HbAction *> m_participantListActions;
|
|
368 |
int m_volumeCommandId;
|
|
369 |
HbAction *m_backAction;
|
|
370 |
Dialpad *m_dialpad;
|
|
371 |
QSignalMapper *m_menuSignalMapper;
|
|
372 |
XqKeyCapture *m_keyCapture;
|
|
373 |
QSystemNetworkInfo *m_networkInfo;
|
|
374 |
};
|
|
375 |
|
|
376 |
#endif // PHONEUIQTVIEW_H
|