|
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 symbian adapter for Qt view. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef PHONEUIQTVIEWADAPTER_H |
|
19 #define PHONEUIQTVIEWADAPTER_H |
|
20 |
|
21 #ifdef BUILD_PHONEUIQTVIEWADAPTER |
|
22 #define PHONEUIQTVIEWADAPTER_EXPORT Q_DECL_EXPORT |
|
23 #else |
|
24 #define PHONEUIQTVIEWADAPTER_EXPORT Q_DECL_IMPORT |
|
25 #endif |
|
26 |
|
27 #include <QObject> |
|
28 #include <QMap> |
|
29 #include "mphoneviewcommandhandle.h" |
|
30 #include "phoneaction.h" |
|
31 |
|
32 class PhoneUIQtViewIF; |
|
33 class PhoneBubbleWrapper; |
|
34 class CPhoneRingingToneController; |
|
35 class PhoneResourceAdapter; |
|
36 class PhoneUIQtButtonsController; |
|
37 class PhoneNoteController; |
|
38 class PhoneUiCommandController; |
|
39 class TelephonyService; |
|
40 class QKeyEvent; |
|
41 |
|
42 class PHONEUIQTVIEWADAPTER_EXPORT PhoneUIQtViewAdapter : |
|
43 public QObject, |
|
44 public MPhoneViewCommandHandle |
|
45 { |
|
46 Q_OBJECT |
|
47 |
|
48 public: |
|
49 |
|
50 /** |
|
51 * Constructor |
|
52 */ |
|
53 explicit PhoneUIQtViewAdapter (PhoneUIQtViewIF &view, QObject *parent = 0); |
|
54 |
|
55 /** |
|
56 * Destructor |
|
57 */ |
|
58 virtual ~PhoneUIQtViewAdapter(); |
|
59 |
|
60 |
|
61 public: // From MPhoneViewCommandHandle |
|
62 |
|
63 /** |
|
64 * Execute Command with given Command Id |
|
65 * @param aCmdId Command Id |
|
66 * @return None |
|
67 */ |
|
68 void ExecuteCommandL (TPhoneViewCommandId aCmdId); |
|
69 |
|
70 /** |
|
71 * Execute Command with given Command Id and Call Id |
|
72 * @param aCmdId Command Id |
|
73 * @param aCallId Call Id |
|
74 * @return None |
|
75 */ |
|
76 void ExecuteCommandL (TPhoneViewCommandId aCmdId, TInt aCallId); |
|
77 |
|
78 /** |
|
79 * Execute Command with given command id, call id and command parameter. |
|
80 * @param aCmdId Command Id |
|
81 * @param aCommandParam Command parameter |
|
82 * @return None |
|
83 */ |
|
84 void ExecuteCommandL (TPhoneViewCommandId aCmdId, TPhoneCommandParam* aCommandParam); |
|
85 |
|
86 /** |
|
87 * Execute Command with given command id, call id and command parameter. |
|
88 * @param aCmdId Command Id |
|
89 * @param aCallId Call Id |
|
90 * @param aCommandParam Command parameter |
|
91 * @return None |
|
92 */ |
|
93 void ExecuteCommandL (TPhoneViewCommandId aCmdId, TInt aCallId, |
|
94 TPhoneCommandParam* aCommandParam); |
|
95 |
|
96 /** |
|
97 * Execute Command with given command id, call id and message. |
|
98 * @param aCmdId Command Id |
|
99 * @param aCallId Call Id |
|
100 * @param aMessage Command message |
|
101 */ |
|
102 void ExecuteCommandL (TPhoneViewCommandId aCmdId, TInt aCallId, TDesC& aMessage); |
|
103 |
|
104 /** |
|
105 * Handle Command with given Command Id |
|
106 * @param aCmdId Command Id |
|
107 * @return TPhoneViewResponseId |
|
108 */ |
|
109 TPhoneViewResponseId HandleCommandL (TPhoneViewCommandId aCmdId); |
|
110 |
|
111 /** |
|
112 * Handle Command with given command id and command parameter. |
|
113 * @param aCmdId Command Id |
|
114 * @param aCommandParam Command parameter |
|
115 * @return TPhoneViewResponseId |
|
116 */ |
|
117 TPhoneViewResponseId HandleCommandL (TPhoneViewCommandId aCmdId, |
|
118 TPhoneCommandParam* aCommandParam); |
|
119 |
|
120 /** |
|
121 * Execute Command with given Command Id |
|
122 * @param aCmdId Command Id |
|
123 * @return None |
|
124 */ |
|
125 void ExecuteCommand (TPhoneViewCommandId aCmdId); |
|
126 |
|
127 /** |
|
128 * Execute Command with given command id and command parameter. |
|
129 * @param aCmdId Command Id |
|
130 * @param aCommandParam Command parameter |
|
131 * @return None |
|
132 */ |
|
133 void ExecuteCommand (TPhoneViewCommandId aCmdId, TPhoneCommandParam* aCommandParam); |
|
134 |
|
135 /** |
|
136 * Execute Command with given Command Id |
|
137 */ |
|
138 const TDesC& FetchContent (); |
|
139 |
|
140 /*! |
|
141 \fn void PhoneUIQtViewAdapter::noteController () |
|
142 |
|
143 Returns pointer to PhoneNoteController |
|
144 */ |
|
145 PhoneNoteController* noteController() const; |
|
146 |
|
147 private slots: |
|
148 |
|
149 /*! |
|
150 \fn void PhoneUIQtViewAdapter::dialpadClosed () |
|
151 |
|
152 PhoneView calls this method when dialpad |
|
153 is going to be closed. |
|
154 */ |
|
155 void dialpadClosed(); |
|
156 |
|
157 /*! |
|
158 \fn void PhoneUIQtViewAdapter::keyPressed () |
|
159 |
|
160 PhoneView calls this method when key press is released. |
|
161 */ |
|
162 void keyReleased(QKeyEvent *event); |
|
163 |
|
164 private: |
|
165 |
|
166 /*! |
|
167 \fn void PhoneUIQtViewAdapter::setTopApplication (TPhoneCommandParam *) |
|
168 |
|
169 This method is called when EPhoneViewSetTopApplication or |
|
170 EPhoneViewSetIdleTopApplication command is received. |
|
171 */ |
|
172 void setTopApplication (TPhoneCommandParam *commandParam); |
|
173 |
|
174 /*! |
|
175 \fn int PhoneUIQtViewAdapter::idleAppUid() |
|
176 |
|
177 This method fetches Idle application's Id from PubSub and returns it. |
|
178 */ |
|
179 int idleAppUid(); |
|
180 |
|
181 /*! |
|
182 \fn int PhoneUIQtViewAdapter::createCallHeader() |
|
183 |
|
184 This method creates new call header. |
|
185 */ |
|
186 void createCallHeader (int callId, TPhoneCommandParam *commandParam); |
|
187 |
|
188 /*! |
|
189 \fn int PhoneUIQtViewAdapter::createCallHeader() |
|
190 |
|
191 This method creates new call header. |
|
192 */ |
|
193 void createEmergencyCallHeader (int callId, TPhoneCommandParam *commandParam); |
|
194 |
|
195 /*! |
|
196 \fn int PhoneUIQtViewAdapter::updateCallHeader() |
|
197 |
|
198 This method updates call state information in call header. |
|
199 */ |
|
200 void updateCallHeaderState (int callId, TPhoneCommandParam *commandParam); |
|
201 |
|
202 /*! |
|
203 \fn int PhoneUIQtViewAdapter::updateCallHeaderRemoteInfo() |
|
204 |
|
205 This method updates remote information in call header. |
|
206 */ |
|
207 void updateCallHeaderRemoteInfo (int callId, TPhoneCommandParam *commandParam); |
|
208 |
|
209 /*! |
|
210 \fn int PhoneUIQtViewAdapter::updateCallHeaderRemoteInfo() |
|
211 |
|
212 This method updates remote information in call header and label. |
|
213 */ |
|
214 void updateCallHeaderRemoteInfoAndLabel (int callId, TPhoneCommandParam *commandParam); |
|
215 |
|
216 /*! |
|
217 \fn int PhoneUIQtViewAdapter::callIdByState() |
|
218 |
|
219 This method writes to commandParam the call id matching |
|
220 given call state. |
|
221 |
|
222 Returns EPhoneViewResponseSuccess operation is succesful |
|
223 otherwise EPhoneViewResponseFailed. |
|
224 */ |
|
225 TPhoneViewResponseId callIdByState (TPhoneCommandParam *commandParam); |
|
226 |
|
227 /*! |
|
228 \fn void PhoneUIQtViewAdapter::setTouchButtons (TPhoneCmdParam *commandParam) |
|
229 |
|
230 This method sets buttons to call bubble. |
|
231 */ |
|
232 void setTouchButtons (TPhoneCommandParam *commandParam); |
|
233 |
|
234 /*! |
|
235 \fn void PhoneUIQtViewAdapter::setToolbarButtons (TPhoneCmdParam *commandParam) |
|
236 |
|
237 This method sets buttons to toolbar. |
|
238 */ |
|
239 void setToolbarButtons (TPhoneCommandParam *commandParam); |
|
240 |
|
241 /*! |
|
242 \fn void PhoneUIQtViewAdapter::setCallHoldFlag (TPhoneCmdParam *commandParam) |
|
243 |
|
244 This method sets flag telling is the call hold or not. |
|
245 */ |
|
246 void setCallHoldFlag (TPhoneCommandParam *commandParam); |
|
247 |
|
248 /*! |
|
249 \fn void PhoneUIQtViewAdapter::callHoldFlag (TPhoneCmdParam *commandParam) |
|
250 |
|
251 This method retrieves flag telling is the call hold or not and writes |
|
252 it into given command parameter. |
|
253 */ |
|
254 void callHoldFlag (TPhoneCommandParam *commandParam); |
|
255 |
|
256 /*! |
|
257 \fn void PhoneUIQtViewAdapter::writeAudioVolumeLevel (TPhoneCmdParam *commandParam) |
|
258 |
|
259 This method writes audio volume value into given command parameter. |
|
260 */ |
|
261 void writeAudioVolumeLevel (TPhoneCommandParam *commandParam); |
|
262 |
|
263 /*! |
|
264 \fn void PhoneUIQtViewAdapter::setAudioVolumeSliderValue (TPhoneCmdParam *commandParam) |
|
265 |
|
266 This method sets volume value to view. |
|
267 */ |
|
268 void setAudioVolumeSliderValue (TPhoneCommandParam *commandParam); |
|
269 |
|
270 /*! |
|
271 \fn void PhoneUIQtViewAdapter::setMuteIndication (TPhoneCmdParam *commandParam) |
|
272 |
|
273 This method sets muted indication to view. |
|
274 */ |
|
275 void setMuteIndication (TPhoneCommandParam *commandParam); |
|
276 |
|
277 |
|
278 /*! |
|
279 \fn void PhoneUIQtViewAdapter::callHoldFlag (TPhoneCmdParam *commandParam) |
|
280 |
|
281 This method retrieves number of calls. Conference call counts one call, |
|
282 participant calls are not count. |
|
283 */ |
|
284 void activeCallCount (TPhoneCommandParam *commandParam); |
|
285 |
|
286 /*! |
|
287 \fn void PhoneUIQtViewAdapter::setAudioPath (TPhoneCommandParam *commandParam) |
|
288 |
|
289 This method sets audio paths |
|
290 */ |
|
291 void setAudioPath (TPhoneCommandParam *commandParam); |
|
292 |
|
293 /*! |
|
294 \fn void PhoneUIQtViewAdapter::expandedBubbleCallId(TPhoneCommandParam *commandParam) |
|
295 |
|
296 This method gets call id of the expanded call bubble. |
|
297 */ |
|
298 void expandedBubbleCallId(TPhoneCommandParam *commandParam); |
|
299 |
|
300 /*! |
|
301 \fn void openDialpad() |
|
302 |
|
303 This method opens dialpad. |
|
304 */ |
|
305 void openDialpad(); |
|
306 |
|
307 /*! |
|
308 \fn int PhoneUIQtViewAdapter::createConference() |
|
309 |
|
310 This method creates conference bubble. |
|
311 */ |
|
312 void createConferenceBubble(int callId, TPhoneCommandParam *commandParam); |
|
313 |
|
314 /*! |
|
315 \fn int PhoneUIQtViewAdapter::conferenceCallId() |
|
316 |
|
317 This method checks if call id belongs to conference call. |
|
318 */ |
|
319 void conferenceCallId(int callId, TPhoneCommandParam *commandParam); |
|
320 |
|
321 /*! |
|
322 \fn int PhoneUIQtViewAdapter::removeConferenceBubble() |
|
323 |
|
324 This method removes conference bubble. |
|
325 */ |
|
326 void removeConferenceBubble(); |
|
327 |
|
328 /*! |
|
329 \fn int PhoneUIQtViewAdapter::isConference() |
|
330 |
|
331 This method checks is conference bubble active. |
|
332 */ |
|
333 void isConference(TPhoneCommandParam *commandParam); |
|
334 |
|
335 /*! |
|
336 \fn int PhoneUIQtViewAdapter::removeCallFromConference() |
|
337 |
|
338 This method removes a call from conference. |
|
339 */ |
|
340 void removeCallFromConference(int callId); |
|
341 |
|
342 /*! |
|
343 \fn TPhoneViewResponseId PhoneUIQtViewAdapter::getSelectedConferenceMember() |
|
344 |
|
345 This method gets call id of selected conference member. |
|
346 Used in drop and private commands. |
|
347 */ |
|
348 TPhoneViewResponseId getSelectedConferenceMember( |
|
349 TPhoneCommandParam *commandParam); |
|
350 |
|
351 /*! |
|
352 \fn void PhoneUIQtViewAdapter::setPrivateFromConference() |
|
353 |
|
354 This method removes call from converence bubble. |
|
355 Used in private command. |
|
356 */ |
|
357 void setPrivateFromConference(int callId); |
|
358 |
|
359 /*! |
|
360 \fn void PhoneUIQtViewAdapter::setExpandActions() |
|
361 |
|
362 This method sets expand action if needed. |
|
363 */ |
|
364 void setExpandActions(); |
|
365 |
|
366 /*! |
|
367 \fn void PhoneUIQtViewAdapter::setParticipantListActions() |
|
368 |
|
369 This method sets participant list actions if needed. |
|
370 */ |
|
371 void setParticipantListActions(); |
|
372 |
|
373 /*! |
|
374 \fn void PhoneUIQtViewAdapter::setExpandedConferenceCallHeader() |
|
375 |
|
376 This method sets conference call header expanded if needed. |
|
377 */ |
|
378 void setExpandedConferenceCallHeader(); |
|
379 |
|
380 /*! |
|
381 \fn void PhoneUIQtViewAdapter::bringToForeground() |
|
382 |
|
383 This method brings application to foreground. |
|
384 */ |
|
385 void bringToForeground(); |
|
386 |
|
387 /*! |
|
388 \fn void PhoneUIQtViewAdapter::showGlobalNote() |
|
389 |
|
390 This method shows global note. |
|
391 */ |
|
392 void showGlobalNote(TPhoneCommandParam *commandParam); |
|
393 |
|
394 /*! |
|
395 \fn void PhoneUIQtViewAdapter::callsExists() |
|
396 |
|
397 This method checks if there are calls in given states. |
|
398 */ |
|
399 bool callsExists(int call1State, int call2State); |
|
400 |
|
401 /*! |
|
402 \fn void PhoneUIQtViewAdapter::setDialpadVisibility() |
|
403 |
|
404 This method sets dialpad visibility. |
|
405 */ |
|
406 void setDialpadVisibility(TPhoneCommandParam *commandParam); |
|
407 |
|
408 /*! |
|
409 \fn void PhoneUIQtViewAdapter::removeAllCallHeaders() |
|
410 |
|
411 This method removes all call headers. |
|
412 */ |
|
413 void removeAllCallHeaders(); |
|
414 |
|
415 /*! |
|
416 \fn void PhoneUIQtViewAdapter::getNumberFromDialpad() |
|
417 |
|
418 This method gets number from dialpad. |
|
419 */ |
|
420 void getNumberFromDialpad(TPhoneCommandParam *commandParam); |
|
421 |
|
422 /*! |
|
423 \fn void PhoneUIQtViewAdapter::getNumberEntryStringLength() |
|
424 |
|
425 This method gets text length from the dialpad. |
|
426 */ |
|
427 void getDialpadStringLength(TPhoneCommandParam *commandParam); |
|
428 |
|
429 /*! |
|
430 \fn void PhoneUIQtViewAdapter::getNumberEntryStringLength() |
|
431 |
|
432 This method clears and removes dialpad from the view. |
|
433 */ |
|
434 void removeDialpad(); |
|
435 |
|
436 /*! |
|
437 \fn void PhoneUIQtViewAdapter::addToConference() |
|
438 |
|
439 This method adds call to conference. |
|
440 */ |
|
441 void addToConference(); |
|
442 |
|
443 /*! |
|
444 \fn void PhoneUIQtViewAdapter::setMenu() |
|
445 |
|
446 This method sets actions for menu. |
|
447 */ |
|
448 void setMenu(); |
|
449 |
|
450 /*! |
|
451 \fn void PhoneUIQtViewAdapter::setMenu() |
|
452 |
|
453 This method sets actions for menu in call handling view. |
|
454 */ |
|
455 void setCallMenu(); |
|
456 |
|
457 /*! |
|
458 \fn void PhoneUIQtViewAdapter::setMenu() |
|
459 |
|
460 This method sets actions for menu in dialpad view. |
|
461 */ |
|
462 void setDialpadMenu(); |
|
463 |
|
464 /*! |
|
465 \fn int PhoneUIQtViewAdapter::showNote() |
|
466 |
|
467 This method shows a note by command params. |
|
468 */ |
|
469 void showNote(TPhoneCommandParam *commandParam); |
|
470 |
|
471 private: |
|
472 |
|
473 PhoneUIQtViewIF &m_view; |
|
474 int m_idleUid; |
|
475 PhoneBubbleWrapper *m_bubbleWrapper; |
|
476 CPhoneRingingToneController *m_ringingtonecontroller; |
|
477 PhoneResourceAdapter *m_resourceAdapter; |
|
478 PhoneNoteController *m_noteController; |
|
479 TelephonyService *m_telephonyService; |
|
480 PhoneUiCommandController *m_uiCommandController; |
|
481 bool m_dialpadAboutToClose; |
|
482 }; |
|
483 |
|
484 #endif // PHONEUIQTVIEWADAPTER_H |