|
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: Converts Symbian resources to PhoneAction objects. |
|
15 */ |
|
16 |
|
17 #include "phoneresourceadapter.h" |
|
18 #include "phoneresourceids.h" |
|
19 #include "phoneui.hrh" |
|
20 #include "phoneuiqtbuttonscontroller.h" |
|
21 #include <phoneappvoipcommands.hrh> |
|
22 #include <xqphoneappcommands.h> |
|
23 #include <QApplication> |
|
24 #include <QLocale> |
|
25 #include <QTranslator> |
|
26 #include <QtDebug> |
|
27 #include <QVariant> |
|
28 #include <hbaction.h> |
|
29 |
|
30 PhoneResourceAdapter *pinstance = 0;// initialize pointer |
|
31 |
|
32 PhoneResourceAdapter* PhoneResourceAdapter::Instance (QObject *parent) |
|
33 { |
|
34 if (pinstance == 0) // is it the first call? |
|
35 { |
|
36 pinstance = new PhoneResourceAdapter (parent); // create sole instance |
|
37 } |
|
38 return pinstance; // address of sole instance |
|
39 } |
|
40 |
|
41 PhoneResourceAdapter::PhoneResourceAdapter (QObject *parent) : QObject (parent) |
|
42 { |
|
43 m_buttonsCtrl = new PhoneUIQtButtonsController(); |
|
44 |
|
45 } |
|
46 |
|
47 PhoneResourceAdapter::~PhoneResourceAdapter () |
|
48 { |
|
49 delete m_buttonsCtrl; |
|
50 } |
|
51 |
|
52 PhoneUIQtButtonsController* PhoneResourceAdapter::buttonsController () |
|
53 { |
|
54 PhoneUIQtButtonsController* retValue = 0; |
|
55 |
|
56 if (m_buttonsCtrl) |
|
57 { |
|
58 retValue = m_buttonsCtrl; |
|
59 } |
|
60 |
|
61 return retValue; |
|
62 } |
|
63 |
|
64 QMap<PhoneAction::ActionType, PhoneAction *> PhoneResourceAdapter::convert (int symbianResourceId, ...) |
|
65 { |
|
66 QMap<PhoneAction::ActionType, PhoneAction *> translatedActions; |
|
67 |
|
68 switch (symbianResourceId) { |
|
69 |
|
70 case R_PHONEUI_MTCAL_INCOMING_CALL: |
|
71 { |
|
72 PhoneAction *text = new PhoneAction; |
|
73 text->setText (hbTrId("txt_phone_other_incoming_call")); |
|
74 translatedActions [PhoneAction::Text] = text; |
|
75 } |
|
76 break; |
|
77 |
|
78 case R_PHONEUI_INCALL_CALL_DISCONNECTED: |
|
79 { |
|
80 PhoneAction *text = new PhoneAction; |
|
81 text->setText (hbTrId("txt_phone_other_disconnected")); |
|
82 translatedActions [PhoneAction::Text] = text; |
|
83 } |
|
84 break; |
|
85 |
|
86 case R_PHONEUI_INCALL_CALL_HELD: |
|
87 { |
|
88 PhoneAction *text = new PhoneAction; |
|
89 text->setText (hbTrId("txt_phone_other_on_hold")); |
|
90 translatedActions [PhoneAction::Text] = text; |
|
91 break; |
|
92 } |
|
93 |
|
94 case R_PHONEUI_MULTC_WAITING: |
|
95 { |
|
96 PhoneAction *text = new PhoneAction; |
|
97 text->setText (hbTrId("txt_phone_other_waiting")); |
|
98 translatedActions [PhoneAction::Text] = text; |
|
99 } |
|
100 break; |
|
101 |
|
102 |
|
103 case R_PHONEUI_TIME_DURAT_LONG_WITH_ZERO: |
|
104 { |
|
105 PhoneAction *text = new PhoneAction; |
|
106 // Symbian modifier used here: %:0%H%:1%T%:2%S%:3 |
|
107 // This is because this text is used by Symbian localization |
|
108 // for formatting later on. |
|
109 text->setText ("%:0%H%:1%T%:2%S%:3"); |
|
110 translatedActions [PhoneAction::Text] = text; |
|
111 break; |
|
112 } |
|
113 |
|
114 case R_PHONEUI_OUT_GOING_CALL: |
|
115 case R_PHONEUI_OUT_GOING_VIDEO_CALL: |
|
116 { |
|
117 PhoneAction *text = new PhoneAction; |
|
118 text->setText (hbTrId("txt_phone_other_calling")); |
|
119 translatedActions [PhoneAction::Text] = text; |
|
120 break; |
|
121 } |
|
122 |
|
123 case R_PHONEUI_MTCAL_CLI_WITHHELD: |
|
124 { |
|
125 PhoneAction *text = new PhoneAction; |
|
126 text->setText (hbTrId("txt_phone_other_private_number")); |
|
127 translatedActions [PhoneAction::Text] = text; |
|
128 break; |
|
129 } |
|
130 case R_PHONEUI_MTCAL_CLI_UNKNOWN: |
|
131 { |
|
132 PhoneAction *text = new PhoneAction; |
|
133 text->setText (hbTrId("txt_phone_other_unknown_number")); |
|
134 translatedActions [PhoneAction::Text] = text; |
|
135 break; |
|
136 } |
|
137 |
|
138 case R_PHONE_MTCAL_CLI_PAYPHONE: |
|
139 { |
|
140 PhoneAction *text = new PhoneAction; |
|
141 text->setText (hbTrId("Payphone number")); |
|
142 translatedActions [PhoneAction::Text] = text; |
|
143 break; |
|
144 } |
|
145 |
|
146 case R_PHONEUI_EMERGENCY_CALL_HEADER: |
|
147 { |
|
148 PhoneAction *text = new PhoneAction; |
|
149 text->setText (hbTrId("txt_phone_other_emergency_call")); |
|
150 translatedActions [PhoneAction::Text] = text; |
|
151 break; |
|
152 } |
|
153 |
|
154 case R_PHONEUI_EMERGENCY_CALL_BUTTONS: |
|
155 { |
|
156 PhoneAction *button = new PhoneAction; |
|
157 button->setText (hbTrId("txt_phone_button_end_call")); |
|
158 button->setIcon (HbIcon("qtg_mono_end_call")); |
|
159 button->setCommand (EPhoneCmdEnd); |
|
160 translatedActions [PhoneAction::LeftButton] = button; |
|
161 } |
|
162 break; |
|
163 |
|
164 case R_PHONEUI_ATTEMPTING_EMERGENCY_CALL_TEXT: |
|
165 { |
|
166 PhoneAction *text = new PhoneAction; |
|
167 text->setText (hbTrId("txt_phone_other_attempting")); |
|
168 translatedActions [PhoneAction::Text] = text; |
|
169 } |
|
170 break; |
|
171 |
|
172 case R_PHONEUI_CONFERENCE_CALL: |
|
173 { |
|
174 PhoneAction *text = new PhoneAction; |
|
175 text->setText (hbTrId("txt_phone_other_conference_call")); |
|
176 translatedActions [PhoneAction::Text] = text; |
|
177 } |
|
178 break; |
|
179 case R_PHONEUI_SENDING_DTMF_WAIT_NOTE_TEXT: |
|
180 { |
|
181 PhoneAction *text = new PhoneAction; |
|
182 VA_LIST list; |
|
183 VA_START (list, symbianResourceId); |
|
184 const TDesC *string = (TDesC*)VA_ARG(list, TDesC*); |
|
185 text->setText (hbTrId("txt_phone_info_sending").arg(QString::fromUtf16(string->Ptr(), |
|
186 string->Length()))); |
|
187 translatedActions [PhoneAction::Text] = text; |
|
188 VA_END (list); |
|
189 } |
|
190 break; |
|
191 case R_PHONEUI_DTMF_WAIT_CHARACTER_CONFIRMATION_QUERY_TEXT: |
|
192 { |
|
193 PhoneAction *text = new PhoneAction; |
|
194 VA_LIST list; |
|
195 VA_START (list, symbianResourceId); |
|
196 const TDesC *string = (TDesC*)VA_ARG(list, TDesC*); |
|
197 text->setText (hbTrId("txt_phone_info_send_string").arg(QString::fromUtf16(string->Ptr(), |
|
198 string->Length()))); |
|
199 translatedActions [PhoneAction::Text] = text; |
|
200 VA_END (list); |
|
201 } |
|
202 break; |
|
203 default: |
|
204 break; |
|
205 } |
|
206 |
|
207 return translatedActions; |
|
208 } |
|
209 |
|
210 QString PhoneResourceAdapter::convertToString( |
|
211 int symbianResourceId, const QString &causeCode) const |
|
212 { |
|
213 QString ret; |
|
214 |
|
215 switch (symbianResourceId) { |
|
216 case R_PHONE_ERROR_CALL_NOT_ALLOWED: |
|
217 { |
|
218 ret = hbTrId("txt_phone_dpopinfo_not_allowed").arg(causeCode); |
|
219 } |
|
220 break; |
|
221 |
|
222 case R_ERROR_NOTE_NOT_ALLOWED: |
|
223 { |
|
224 ret = hbTrId("txt_phone_dpopinfo_not_allowed").arg(causeCode); |
|
225 } |
|
226 break; |
|
227 |
|
228 case R_NOTETEXT_INVALID_PHONENUMBER: |
|
229 { |
|
230 ret = hbTrId("txt_phone_info_invalid_phone_number").arg(causeCode); |
|
231 } |
|
232 break; |
|
233 |
|
234 case R_NOTETEXT_NO_ANSWER: |
|
235 { |
|
236 ret = hbTrId("txt_phone_info_no_answer").arg(causeCode); |
|
237 } |
|
238 break; |
|
239 |
|
240 case R_PHONE_ERROR_NUMBER_BUSY: |
|
241 { |
|
242 ret = hbTrId("txt_phone_info_number_busy").arg(causeCode); |
|
243 } |
|
244 break; |
|
245 |
|
246 case R_PHONE_ERROR_REQUEST_REJECTED: |
|
247 { |
|
248 ret = hbTrId("txt_phone_dpopinfo_request_rejected_l1").arg(causeCode); |
|
249 } |
|
250 break; |
|
251 |
|
252 case R_PHONE_SS_NOTIFICATION_INCAL_INFO_HOLD_TEXT: |
|
253 { |
|
254 ret = hbTrId("txt_phone_dpopinfo_on_hold"); |
|
255 } |
|
256 break; |
|
257 |
|
258 case R_INCAL_INFO_HOLD_TEXT: |
|
259 { |
|
260 ret = hbTrId("txt_phone_dpopinfo_on_hold"); |
|
261 } |
|
262 break; |
|
263 |
|
264 case R_INCAL_REMOTE_ACTIVE_TEXT: |
|
265 { |
|
266 ret = hbTrId("txt_phone_info_connected"); |
|
267 } |
|
268 break; |
|
269 |
|
270 case R_PHONE_INCALL_INFO_NO_NETWORK_SUPPORT: |
|
271 { |
|
272 ret = hbTrId("txt_phone_info_videocall_only_possible_under_3g").arg(causeCode); |
|
273 } |
|
274 break; |
|
275 case R_PHONE_ERROR_EMERGENCY_CALLS_ONLY: |
|
276 { |
|
277 ret = hbTrId("txt_phone_info_emergency_calls_only").arg(causeCode); |
|
278 } |
|
279 break; |
|
280 case R_NOTETEXT_NUMBER_NOT_IN_USE: |
|
281 { |
|
282 ret = hbTrId("txt_phone_info_number_not_in_use").arg(causeCode); |
|
283 } |
|
284 break; |
|
285 case R_NOTETEXT_NETWORK_BUSY: |
|
286 { |
|
287 ret = hbTrId("txt_phone_info_network_busy").arg(causeCode); |
|
288 } |
|
289 break; |
|
290 case R_NOTETEXT_ERROR_IN_CONNECTION: |
|
291 { |
|
292 ret = hbTrId("txt_phone_info_error_in_connection").arg(causeCode); |
|
293 } |
|
294 break; |
|
295 case R_PHONEUI_ERROR_EMERGENCY_ATTEMPT_FAILED: |
|
296 { |
|
297 ret = hbTrId("txt_phone_info_emergency_call_failed").arg(causeCode); |
|
298 } |
|
299 break; |
|
300 case R_PHONE_SS_NOTIFICATION_INCAL_TRANSFERRED_TEXT: |
|
301 { |
|
302 ret = hbTrId("txt_phone_info_transferred"); |
|
303 } |
|
304 break; |
|
305 case R_PHONE_ERROR_NO_SERVICE: |
|
306 { |
|
307 ret = hbTrId("txt_phone_dpopinfo_no_network_coverage").arg(causeCode); |
|
308 } |
|
309 break; |
|
310 case R_NOTETEXT_NUMBER_BARRED: |
|
311 { |
|
312 ret = hbTrId("txt_phone_info_number_barred").arg(causeCode); |
|
313 } |
|
314 break; |
|
315 case R_PHONEUI_VIDEO_CALL_NOT_POSSIBLE: |
|
316 { |
|
317 ret = hbTrId("txt_phone_info_video_call_didnt_succeed_to_called").arg(causeCode); |
|
318 } |
|
319 break; |
|
320 case R_CALL_INFO_CAUSE_VALUE127: |
|
321 case R_CALL_INFO_NOT_SUPPORTED: |
|
322 case R_CALL_INFO_SERVICE_NOT_AVAILABLE: |
|
323 case R_CALL_INFO_CAUSE_VALUE38: |
|
324 case R_CALL_INFO_CAUSE_VALUE55: |
|
325 case R_CALL_INFO_CAUSE_VALUE58: |
|
326 case R_NOTE_UNABLE_TO_MAKE_VIDEO_CALL_NOT_SUPPORTED_BY_OTHER_PHONE: |
|
327 { |
|
328 ret = hbTrId("txt_phone_info_unable_to_make_video_call_not_supp").arg(causeCode); |
|
329 } |
|
330 break; |
|
331 case R_NOTE_PHONE_OUT_OF_3G_COVERAGE: |
|
332 { |
|
333 ret = hbTrId("txt_phone_info_phone_switched_off_or_out_of_3g").arg(causeCode); |
|
334 } |
|
335 break; |
|
336 case R_NOTE_VIDEO_CALL_ONLY_POSSIBLE_UNDER_3G_COVERAGE: |
|
337 { |
|
338 ret = hbTrId("txt_phone_info_videocall_only_possible_under_3g").arg(causeCode); |
|
339 } |
|
340 break; |
|
341 case R_NOTE_CALLED_NUMBER_HAS_BARRED_INCOMING_CALLS: |
|
342 { |
|
343 ret = hbTrId("txt_phone_info_called_number_has_barred_incoming").arg(causeCode); |
|
344 } |
|
345 break; |
|
346 case R_INCAL_REMOTE_CREATE_CONFERENCE_TEXT: |
|
347 { |
|
348 ret = hbTrId("txt_phone_info_conference_call_active"); |
|
349 } |
|
350 break; |
|
351 case R_NOTETEXT_CALL_BARRINGS: |
|
352 { |
|
353 ret = hbTrId("txt_phone_dpopinfo_note_you_have_active_barrings"); |
|
354 } |
|
355 break; |
|
356 case R_CALL_INFO_CAUSE_VALUE16: |
|
357 { |
|
358 ret = hbTrId("txt_phone_info_no_answer").arg(causeCode); |
|
359 } |
|
360 break; |
|
361 case R_CALL_INFO_CAUSE_VALUE18: |
|
362 { |
|
363 ret = hbTrId("txt_phone_info_no_answer").arg(causeCode); |
|
364 } |
|
365 break; |
|
366 case R_CALL_INFO_CAUSE_VALUE21: |
|
367 { |
|
368 ret = hbTrId("txt_phone_info_request_rejected"); |
|
369 } |
|
370 break; |
|
371 case R_CALL_INFO_CAUSE_VALUE22: |
|
372 { |
|
373 ret = hbTrId("txt_phone_info_number_not_in_use").arg(causeCode); |
|
374 } |
|
375 break; |
|
376 case R_CALL_INFO_CAUSE_VALUE34: |
|
377 { |
|
378 ret = hbTrId("txt_phone_info_network_busy").arg(causeCode); |
|
379 } |
|
380 break; |
|
381 case R_PHONE_ERROR_CALL_NOT_ALLOWED_FDN: |
|
382 { |
|
383 ret = hbTrId("txt_phone_info_call_not_allowed_fixed_dialling").arg(causeCode); |
|
384 } |
|
385 break; |
|
386 case R_NOTETEXT_DIVERTING_INCOMING_CALL: |
|
387 case R_NOTETEXT_DIVERTING: |
|
388 { |
|
389 ret = hbTrId("txt_phone_dpopinfo_diverting"); |
|
390 } |
|
391 break; |
|
392 case R_NOTETEXT_ALL_INCOMING_CALLS_DIVERTED: |
|
393 { |
|
394 ret = hbTrId("txt_phone_dpopinfo_note_all_incoming_calls_diver"); |
|
395 } |
|
396 break; |
|
397 case R_PHONE_ERROR_CHECK_CLIR: |
|
398 { |
|
399 ret = hbTrId("txt_phone_info_check_own_number_sending").arg(causeCode); |
|
400 } |
|
401 break; |
|
402 case R_PHONE_SS_NOTIFICATION_CLIR_SUPPR_REJECT_TEXT: |
|
403 { |
|
404 ret = hbTrId("txt_phone_info_could_not_send_own_number").arg(causeCode); |
|
405 } |
|
406 break; |
|
407 case R_NOTE_TEXT_CLIR_CHANGE: |
|
408 { |
|
409 ret = hbTrId("txt_phone_info_activate_own_number_sending").arg(causeCode); |
|
410 } |
|
411 break; |
|
412 case R_PHONE_ERROR_CHECK_NETWORK_SERVICES: |
|
413 { |
|
414 ret = hbTrId("txt_phone_info_check_network_services").arg(causeCode); |
|
415 } |
|
416 break; |
|
417 case R_PHONE_INCALL_INFO_VIDEO_CALL_NOT_ALLOWED_DURING_RESTORE: |
|
418 { |
|
419 ret = hbTrId("txt_phone_info_video_call_not_allowed_during_resto").arg(causeCode); |
|
420 } |
|
421 break; |
|
422 case R_NOTETEXT_NUMBER_NOT_IN_CUG: |
|
423 { |
|
424 ret = hbTrId("txt_phone_info_number_not_in_closed_group").arg(causeCode); |
|
425 } |
|
426 break; |
|
427 default: |
|
428 break; |
|
429 } |
|
430 |
|
431 return ret; |
|
432 } |
|
433 |
|
434 QString PhoneResourceAdapter::convertToStringWithParam( |
|
435 int symbianResourceId, const QString &text) const |
|
436 { |
|
437 QString ret; |
|
438 |
|
439 switch (symbianResourceId) { |
|
440 |
|
441 case R_PHONE_TEXT_COLP_CONNECTED: |
|
442 { |
|
443 ret = hbTrId("txt_phone_info_connected_to_1").arg(text); |
|
444 } |
|
445 break; |
|
446 default: |
|
447 break; |
|
448 } |
|
449 |
|
450 return ret; |
|
451 } |
|
452 |
|
453 int PhoneResourceAdapter::defaultToolbarResourceId() const |
|
454 { |
|
455 return R_PHONEUI_INCALL_DIALER_CBA; //R_PHONEUI_CALLHANDLING_INCOMINGCALL_CBA; |
|
456 } |
|
457 |
|
458 QString PhoneResourceAdapter::convertCommandToString( |
|
459 int symbianCommandId ) const |
|
460 { |
|
461 QString ret; |
|
462 |
|
463 switch(symbianCommandId) { |
|
464 case EPhoneInCallCmdEndAllCalls: |
|
465 ret = hbTrId("txt_phone_opt_end_all_calls"); |
|
466 break; |
|
467 case EPhoneInCallCmdTransfer: |
|
468 ret = hbTrId("txt_phone_opt_transfer"); |
|
469 break; |
|
470 case EPhoneCmdHandoverToWlan: |
|
471 ret = hbTrId("Handover to WLAN"); |
|
472 break; |
|
473 case EPhoneCmdHandoverToGsm: |
|
474 ret = hbTrId("Handover to GSM"); |
|
475 break; |
|
476 |
|
477 // TODO |
|
478 default: |
|
479 break; |
|
480 } |
|
481 |
|
482 return ret; |
|
483 } |
|
484 |
|
485 QList<HbAction*> PhoneResourceAdapter::convertToHbActions( |
|
486 int symbianResourceId ) const |
|
487 { |
|
488 QList<HbAction*> ret; |
|
489 |
|
490 switch(symbianResourceId) { |
|
491 case R_PHONEUI_DTMF_WAIT_CHARACTER_CONFIRMATION_QUERY: |
|
492 { |
|
493 HbAction *leftButton = new HbAction(hbTrId("txt_common_button_send")); |
|
494 leftButton->setData(QVariant(EPhoneInCallCmdContinueSendingDtmfString)); |
|
495 ret.append(leftButton); |
|
496 |
|
497 HbAction *rightButton = new HbAction(hbTrId("txt_common_button_cancel")); |
|
498 rightButton->setData(QVariant(EPhoneInCallCmdCancelSendingDtmfString)); |
|
499 ret.append(rightButton); |
|
500 } |
|
501 break; |
|
502 case R_PHONEUI_SENDING_DTMF_WAIT_NOTE: |
|
503 { |
|
504 HbAction *button = new HbAction(hbTrId("txt_common_button_cancel")); |
|
505 button->setData(QVariant(EPhoneInCallCmdCancelSendingDtmfString)); |
|
506 ret.append(button); |
|
507 } |
|
508 break; |
|
509 default: |
|
510 break; |
|
511 } |
|
512 |
|
513 return ret; |
|
514 } |
|
515 |
|
516 QList<PhoneAction::ToolBarItem> PhoneResourceAdapter::convertToToolBarCommandList( |
|
517 int symbianResourceId ) const |
|
518 { |
|
519 QList<PhoneAction::ToolBarItem> ret; |
|
520 |
|
521 switch(symbianResourceId) { |
|
522 case R_PHONEUI_CALLHANDLING_INCOMINGCALL_CBA: |
|
523 { |
|
524 ret.append(PhoneAction::ToolBarItem(PhoneCallComingCmdSoftReject,true)); |
|
525 ret.append(PhoneAction::ToolBarItem(PhoneCallComingCmdSilent,true)); |
|
526 } |
|
527 break; |
|
528 |
|
529 case R_PHONEUI_CALLHANDLING_INCOMINGCALL_REJECT_CBA: |
|
530 { |
|
531 ret.append(PhoneAction::ToolBarItem(PhoneCallComingCmdSoftReject,true)); |
|
532 ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdReject,true)); |
|
533 } |
|
534 break; |
|
535 |
|
536 case R_PHONEUI_CALLHANDLING_INCOMINGCALL_SOFT_REJECT_CBA: |
|
537 { |
|
538 ret.append(PhoneAction::ToolBarItem(PhoneCallComingCmdSoftReject,true)); |
|
539 ret.append(PhoneAction::ToolBarItem(PhoneCallComingCmdSilent,false)); |
|
540 } |
|
541 break; |
|
542 |
|
543 case R_PHONEUI_CALLHANDLING_CALLWAITING_CBA: |
|
544 { |
|
545 ret.append(PhoneAction::ToolBarItem(PhoneCallComingCmdSoftReject,true)); |
|
546 ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdJoinToConference,false)); |
|
547 } |
|
548 break; |
|
549 |
|
550 case R_PHONEUI_DIALER_CBA: |
|
551 case R_PHONEUI_INCALL_DIALER_CBA: |
|
552 case R_PHONEUI_CALLHANDLING_INCALL_UNHOLD_CBA: |
|
553 case R_PHONEUI_CALLHANDLING_INCALL_UNMUTE_CBA: |
|
554 case R_PHONEUI_CALLHANDLING_INCALL_HANDSET_CBA: |
|
555 case R_PHONEUI_CALLHANDLING_CALLSETUP_EMPTY_DTMFDIALER_CBA: |
|
556 case R_PHONEUI_CALLHANDLING_INCALL_BTAA_CBA: |
|
557 { |
|
558 if (m_buttonsCtrl->getButtonFlags( |
|
559 PhoneUIQtButtonsController::IhfAsPushButton)) { |
|
560 if (m_buttonsCtrl->getButtonFlags( |
|
561 PhoneUIQtButtonsController::Mute)) { |
|
562 ret.append(PhoneAction::ToolBarItem( |
|
563 PhoneInCallCmdUnmute,true)); |
|
564 } else { |
|
565 ret.append(PhoneAction::ToolBarItem( |
|
566 PhoneInCallCmdMute,true)); |
|
567 } |
|
568 } else { |
|
569 if (m_buttonsCtrl->getButtonFlags( |
|
570 PhoneUIQtButtonsController::BluetoothAvailable)) { |
|
571 if (m_buttonsCtrl->getButtonFlags( |
|
572 PhoneUIQtButtonsController::Btaa)) { |
|
573 ret.append(PhoneAction::ToolBarItem( |
|
574 PhoneInCallCmdHandset,true)); |
|
575 } else { |
|
576 ret.append(PhoneAction::ToolBarItem( |
|
577 PhoneInCallCmdBtHandsfree,true)); |
|
578 } |
|
579 } else { |
|
580 if (!m_buttonsCtrl->getButtonFlags( |
|
581 PhoneUIQtButtonsController::Ihf)) { |
|
582 ret.append(PhoneAction::ToolBarItem( |
|
583 PhoneInCallCmdActivateIhf,true)); |
|
584 } else { |
|
585 ret.append(PhoneAction::ToolBarItem( |
|
586 PhoneInCallCmdDeactivateIhf,true)); |
|
587 } |
|
588 } |
|
589 } |
|
590 |
|
591 if (!m_buttonsCtrl->getButtonFlags( |
|
592 PhoneUIQtButtonsController::MultiCall)) { |
|
593 bool outgoing(m_buttonsCtrl->getButtonFlags( |
|
594 PhoneUIQtButtonsController::Outgoing)); |
|
595 if (m_buttonsCtrl->getButtonFlags( |
|
596 PhoneUIQtButtonsController::Hold)) { |
|
597 ret.append(PhoneAction::ToolBarItem( |
|
598 PhoneInCallCmdUnhold,!outgoing)); |
|
599 } else { |
|
600 ret.append(PhoneAction::ToolBarItem( |
|
601 PhoneInCallCmdHold,!outgoing)); |
|
602 } |
|
603 |
|
604 ret.append(PhoneAction::ToolBarItem( |
|
605 PhoneInCallCmdOpenContacts,true)); |
|
606 } else { |
|
607 bool outgoing(m_buttonsCtrl->getButtonFlags( |
|
608 PhoneUIQtButtonsController::Outgoing)); |
|
609 bool disableJoin(outgoing ? true : |
|
610 m_buttonsCtrl->getButtonFlags( |
|
611 PhoneUIQtButtonsController::DisableJoin)); |
|
612 |
|
613 ret.append(PhoneAction::ToolBarItem( |
|
614 PhoneInCallCmdSwap,!outgoing)); |
|
615 |
|
616 if (m_buttonsCtrl->getButtonFlags( |
|
617 PhoneUIQtButtonsController::Conference)) { |
|
618 ret.append(PhoneAction::ToolBarItem( |
|
619 PhoneInCallCmdJoinToConference,!disableJoin)); |
|
620 } else { |
|
621 ret.append(PhoneAction::ToolBarItem( |
|
622 PhoneInCallCmdCreateConference,!disableJoin)); |
|
623 } |
|
624 } |
|
625 |
|
626 ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdOpenDialer,true)); |
|
627 } |
|
628 break; |
|
629 |
|
630 case R_PHONEUI_CALLHANDLING_EMERGENCY_CBA: |
|
631 { |
|
632 |
|
633 if (!m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Ihf)) |
|
634 { |
|
635 ret.append(PhoneAction::ToolBarItem( |
|
636 PhoneInCallCmdActivateIhf,true)); |
|
637 } |
|
638 else |
|
639 { |
|
640 ret.append(PhoneAction::ToolBarItem( |
|
641 PhoneInCallCmdDeactivateIhf,true)); |
|
642 } |
|
643 } |
|
644 |
|
645 ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdOpenDialer,true)); |
|
646 break; |
|
647 |
|
648 /*case R_PHONEUI_CALLHANDLING_INCALL_HANDSET_CBA: |
|
649 { |
|
650 ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdOpenDialer,true)); |
|
651 |
|
652 if (m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Hold)) |
|
653 { |
|
654 ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdUnhold,true)); |
|
655 } |
|
656 else |
|
657 { |
|
658 ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdHold,true)); |
|
659 } |
|
660 if (!m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Hold)) |
|
661 { |
|
662 ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdMute,true)); |
|
663 } |
|
664 else |
|
665 { |
|
666 ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdUnmute,true)); |
|
667 } |
|
668 |
|
669 ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdDeactivateIhf,true)); |
|
670 ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdOpenContacts,true)); |
|
671 } |
|
672 break;*/ |
|
673 default: |
|
674 break; |
|
675 } |
|
676 |
|
677 return ret; |
|
678 } |
|
679 |
|
680 |