phoneapp/phoneuiqtviewadapter/src/phoneresourceadapter.cpp
changeset 45 6b911d05207e
parent 37 ba76fc04e6c2
child 46 bc5a64e5bc3c
equal deleted inserted replaced
37:ba76fc04e6c2 45:6b911d05207e
    17 #include "phoneresourceadapter.h"
    17 #include "phoneresourceadapter.h"
    18 #include "phoneresourceids.h"
    18 #include "phoneresourceids.h"
    19 #include "phoneui.hrh"
    19 #include "phoneui.hrh"
    20 #include "phoneuiqtbuttonscontroller.h"
    20 #include "phoneuiqtbuttonscontroller.h"
    21 #include <phoneappvoipcommands.hrh>
    21 #include <phoneappvoipcommands.hrh>
       
    22 #include <xqphoneappcommands.h>
    22 #include <QApplication>
    23 #include <QApplication>
    23 #include <QLocale>
    24 #include <QLocale>
    24 #include <QTranslator>
    25 #include <QTranslator>
    25 #include <QtDebug>
    26 #include <QtDebug>
    26 #include <QVariant>
    27 #include <QVariant>
    63 QMap<PhoneAction::ActionType, PhoneAction *> PhoneResourceAdapter::convert (int symbianResourceId, ...)
    64 QMap<PhoneAction::ActionType, PhoneAction *> PhoneResourceAdapter::convert (int symbianResourceId, ...)
    64 {
    65 {
    65     QMap<PhoneAction::ActionType, PhoneAction *> translatedActions;
    66     QMap<PhoneAction::ActionType, PhoneAction *> translatedActions;
    66     
    67     
    67     switch (symbianResourceId) {
    68     switch (symbianResourceId) {
    68     
    69 	
    69     case R_PHONEUI_CALLHANDLING_INCOMINGCALL_CBA:
       
    70         {
       
    71         PhoneAction *leftButton = new PhoneAction;
       
    72         leftButton->setIcon (HbIcon("qtg_mono_send"));
       
    73         leftButton->setCommand(EPhoneCallComingCmdSoftReject);
       
    74         translatedActions [PhoneAction::ToolbarButton1] = leftButton;       
       
    75         
       
    76         PhoneAction *rightButton = new PhoneAction;
       
    77         rightButton->setIcon (HbIcon("qtg_mono_speaker_off"));
       
    78         rightButton->setCommand (EPhoneCallComingCmdSilent);
       
    79         translatedActions [PhoneAction::ToolbarButton2] = rightButton;            
       
    80         }
       
    81         break;
       
    82 
       
    83     case R_PHONEUI_CALLHANDLING_INCOMINGCALL_REJECT_CBA:
       
    84         {
       
    85         PhoneAction *leftButton = new PhoneAction;
       
    86         leftButton->setIcon (HbIcon("qtg_mono_send"));
       
    87         leftButton->setCommand(EPhoneCallComingCmdSoftReject);
       
    88         translatedActions [PhoneAction::ToolbarButton1] = leftButton;
       
    89                
       
    90         PhoneAction *rightButton = new PhoneAction;
       
    91         rightButton->setIcon (HbIcon("qtg_mono_reject_call"));
       
    92         rightButton->setCommand (EPhoneCallComingCmdReject);
       
    93         translatedActions [PhoneAction::ToolbarButton2] = rightButton;      
       
    94         }
       
    95         break;
       
    96         
       
    97     case R_PHONEUI_CALLHANDLING_INCOMINGCALL_SOFT_REJECT_CBA:
       
    98         {
       
    99         PhoneAction *leftButton = new PhoneAction;
       
   100         leftButton->setIcon (HbIcon("qtg_mono_send"));
       
   101         leftButton->setCommand(EPhoneCallComingCmdSoftReject);
       
   102         translatedActions [PhoneAction::ToolbarButton1] = leftButton;    
       
   103         
       
   104         PhoneAction *rightButton = new PhoneAction;
       
   105         rightButton->setIcon (HbIcon("qtg_mono_speaker_off"));
       
   106         rightButton->setDisabled(true);
       
   107         translatedActions [PhoneAction::ToolbarButton2] = rightButton;        
       
   108         }
       
   109         break;
       
   110         
       
   111     case R_PHONEUI_CALLHANDLING_CALLWAITING_CBA:        
       
   112         {
       
   113         PhoneAction *leftButton = new PhoneAction;
       
   114         leftButton->setIcon (HbIcon("qtg_mono_send"));
       
   115         leftButton->setCommand(EPhoneCallComingCmdSoftReject);
       
   116         translatedActions [PhoneAction::ToolbarButton1] = leftButton;       
       
   117         
       
   118         PhoneAction *rightButton = new PhoneAction;
       
   119         rightButton->setIcon (HbIcon("qtg_mono_join_call"));
       
   120         rightButton->setCommand (EPhoneInCallCmdJoin);
       
   121         rightButton->setDisabled(true);
       
   122         translatedActions [PhoneAction::ToolbarButton2] = rightButton;            
       
   123         }
       
   124         break;        
       
   125         
       
   126     case R_PHONEUI_DIALER_CBA:
       
   127     case R_PHONEUI_INCALL_DIALER_CBA:
       
   128     case R_PHONEUI_CALLHANDLING_CALLSETUP_EMPTY_DTMFDIALER_CBA:
       
   129     case R_PHONEUI_CALLHANDLING_INCALL_UNHOLD_CBA:
       
   130         {
       
   131         PhoneAction *leftButton = new PhoneAction;
       
   132         leftButton->setIcon (HbIcon("qtg_mono_dialer"));
       
   133         leftButton->setCommand(EPhoneInCallCmdDialer);
       
   134         translatedActions [PhoneAction::ToolbarButton1] = leftButton;
       
   135         
       
   136         PhoneAction *centerButton = new PhoneAction;
       
   137         centerButton->setIcon (HbIcon("qtg_mono_mic_mute"));
       
   138         centerButton->setCommand (EPhoneInCallCmdMute);
       
   139         translatedActions [PhoneAction::ToolbarButton2] = centerButton;        
       
   140 
       
   141         PhoneAction *centerButton2 = new PhoneAction;
       
   142         if (!m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Ihf))
       
   143             {
       
   144             centerButton2->setIcon (HbIcon("qtg_mono_speaker"));
       
   145             centerButton2->setCommand (EPhoneInCallCmdActivateIhf);
       
   146             }
       
   147         else
       
   148             {
       
   149             centerButton2->setIcon (HbIcon("qtg_mono_mobile"));
       
   150             centerButton2->setCommand (EPhoneInCallCmdDeactivateIhf);
       
   151             }
       
   152         translatedActions [PhoneAction::ToolbarButton3] = centerButton2; 
       
   153         
       
   154         PhoneAction *rightButton = new PhoneAction;
       
   155         rightButton->setIcon(HbIcon("qtg_mono_contacts"));
       
   156         rightButton->setDisabled( 
       
   157                 (symbianResourceId==
       
   158                  R_PHONEUI_CALLHANDLING_CALLSETUP_EMPTY_DTMFDIALER_CBA));        
       
   159         rightButton->setCommand(EPhoneInCallCmdContacts);
       
   160         
       
   161         translatedActions[PhoneAction::ToolbarButton4] = rightButton;
       
   162         }
       
   163         break;
       
   164         
       
   165     case R_PHONEUI_CALLHANDLING_EMERGENCY_CBA:
       
   166         {
       
   167         PhoneAction *leftButton = new PhoneAction;
       
   168         leftButton->setIcon (HbIcon("qtg_mono_dialer"));
       
   169         leftButton->setCommand(EPhoneInCallCmdDialer);
       
   170         translatedActions [PhoneAction::ToolbarButton1] = leftButton;
       
   171         
       
   172         PhoneAction *rightButton = new PhoneAction;
       
   173         if (!m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Ihf))
       
   174             {
       
   175             rightButton->setIcon (HbIcon("qtg_mono_speaker"));
       
   176             rightButton->setCommand (EPhoneInCallCmdActivateIhf);
       
   177             }
       
   178         else
       
   179             {
       
   180             rightButton->setIcon (HbIcon("qtg_mono_mobile"));
       
   181             rightButton->setCommand (EPhoneInCallCmdDeactivateIhf);
       
   182             }
       
   183         translatedActions [PhoneAction::ToolbarButton2] = rightButton;                    
       
   184         }
       
   185         break;
       
   186         
       
   187     case R_PHONEUI_CALLHANDLING_INCALL_UNMUTE_CBA:
       
   188         {
       
   189         PhoneAction *leftButton = new PhoneAction;
       
   190         leftButton->setIcon (HbIcon("qtg_mono_dialer"));
       
   191         leftButton->setCommand(EPhoneInCallCmdDialer);
       
   192         translatedActions [PhoneAction::ToolbarButton1] = leftButton;
       
   193         
       
   194         PhoneAction *centerButton = new PhoneAction;
       
   195         centerButton->setIcon (HbIcon("qtg_mono_mic_unmute"));
       
   196         centerButton->setCommand (EPhoneInCallCmdUnmute);
       
   197         translatedActions [PhoneAction::ToolbarButton2] = centerButton;        
       
   198 
       
   199         PhoneAction *centerButton2 = new PhoneAction;
       
   200         if (!m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Ihf))
       
   201             {
       
   202             centerButton2->setIcon (HbIcon("qtg_mono_speaker"));
       
   203             centerButton2->setCommand (EPhoneInCallCmdActivateIhf);
       
   204             }
       
   205         else
       
   206             {
       
   207             centerButton2->setIcon (HbIcon("qtg_mono_mobile"));
       
   208             centerButton2->setCommand (EPhoneInCallCmdDeactivateIhf);
       
   209             }
       
   210         translatedActions [PhoneAction::ToolbarButton3] = centerButton2;     
       
   211         
       
   212         PhoneAction *rightButton = new PhoneAction;
       
   213         rightButton->setIcon(HbIcon("qtg_mono_contacts"));
       
   214         rightButton->setCommand(EPhoneInCallCmdContacts);
       
   215         translatedActions[PhoneAction::ToolbarButton4] = rightButton;   
       
   216         }
       
   217         break;
       
   218         
       
   219     case R_PHONEUI_CALLHANDLING_INCALL_HANDSET_CBA:
       
   220         {
       
   221         PhoneAction *leftButton = new PhoneAction;
       
   222         leftButton->setIcon (HbIcon("qtg_mono_dialer"));
       
   223         leftButton->setCommand(EPhoneInCallCmdDialer);
       
   224         translatedActions [PhoneAction::ToolbarButton1] = leftButton;
       
   225         
       
   226         PhoneAction *centerButton1 = new PhoneAction;
       
   227         if (!m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Hold))
       
   228             {
       
   229             centerButton1->setIcon (HbIcon("qtg_mono_mic_mute"));
       
   230             centerButton1->setCommand (EPhoneInCallCmdMute);
       
   231             }
       
   232         else
       
   233             {
       
   234             centerButton1->setIcon (HbIcon("qtg_mono_mic_unmute"));
       
   235             centerButton1->setCommand (EPhoneInCallCmdUnmute);
       
   236             }
       
   237         translatedActions [PhoneAction::ToolbarButton2] = centerButton1;
       
   238 
       
   239         PhoneAction *centerButton2 = new PhoneAction;
       
   240         centerButton2->setIcon (HbIcon("qtg_mono_mobile"));
       
   241         centerButton2->setCommand (EPhoneInCallCmdDeactivateIhf);
       
   242         translatedActions [PhoneAction::ToolbarButton3] = centerButton2;
       
   243         
       
   244         PhoneAction *rightButton = new PhoneAction;
       
   245         rightButton->setIcon(HbIcon("qtg_mono_contacts"));
       
   246         rightButton->setCommand(EPhoneInCallCmdContacts);
       
   247         translatedActions[PhoneAction::ToolbarButton4] = rightButton;
       
   248         }
       
   249         break;
       
   250 
       
   251     case R_PHONEUI_MTCAL_INCOMING_CALL:
    70     case R_PHONEUI_MTCAL_INCOMING_CALL:
   252         {
    71         {
   253         PhoneAction *text = new PhoneAction;
    72         PhoneAction *text = new PhoneAction;
   254         text->setText (hbTrId("txt_phone_other_incoming_call"));
    73         text->setText (hbTrId("txt_phone_other_incoming_call"));
   255         translatedActions [PhoneAction::Text] = text;
    74         translatedActions [PhoneAction::Text] = text;
   278         text->setText (hbTrId("txt_phone_other_waiting"));
    97         text->setText (hbTrId("txt_phone_other_waiting"));
   279         translatedActions [PhoneAction::Text] = text;
    98         translatedActions [PhoneAction::Text] = text;
   280         }
    99         }
   281         break; 
   100         break; 
   282 
   101 
   283     case R_PHONEUI_INCALL_CALL_NUMBER:
   102        
   284         {
       
   285         PhoneAction *text = new PhoneAction;
       
   286         VA_LIST list;
       
   287         VA_START (list, symbianResourceId);
       
   288         int intValue = VA_ARG (list, int);
       
   289         text->setText(hbTrId("txt_phone_other_call_ln").arg(intValue));
       
   290         translatedActions [PhoneAction::Text] = text;
       
   291         VA_END (list);
       
   292         }
       
   293         break;
       
   294         
       
   295     case R_PHONEUI_TIME_DURAT_LONG_WITH_ZERO:
   103     case R_PHONEUI_TIME_DURAT_LONG_WITH_ZERO:
   296         {
   104         {
   297         PhoneAction *text = new PhoneAction;
   105         PhoneAction *text = new PhoneAction;
   298         // Symbian modifier used here: %:0%H%:1%T%:2%S%:3
   106         // Symbian modifier used here: %:0%H%:1%T%:2%S%:3
   299         // This is because this text is used by Symbian localization
   107         // This is because this text is used by Symbian localization
   316         PhoneAction *text = new PhoneAction;
   124         PhoneAction *text = new PhoneAction;
   317         text->setText (hbTrId("txt_phone_other_private_number"));
   125         text->setText (hbTrId("txt_phone_other_private_number"));
   318         translatedActions [PhoneAction::Text] = text;
   126         translatedActions [PhoneAction::Text] = text;
   319         break;
   127         break;
   320         }
   128         }
   321     case R_PHONEUI_MTCAL_CALL:
   129     case R_PHONEUI_MTCAL_CLI_UNKNOWN:
   322         {
   130         {
   323         PhoneAction *text = new PhoneAction;
   131         PhoneAction *text = new PhoneAction;
   324         text->setText (hbTrId("txt_common_button_call")); //Call
   132         text->setText (hbTrId("txt_phone_other_unknown_number"));
       
   133         translatedActions [PhoneAction::Text] = text;
       
   134         break;
       
   135         }
       
   136         
       
   137     case R_PHONE_MTCAL_CLI_PAYPHONE:
       
   138         {
       
   139         PhoneAction *text = new PhoneAction;
       
   140         text->setText (hbTrId("Payphone number"));
   325         translatedActions [PhoneAction::Text] = text;
   141         translatedActions [PhoneAction::Text] = text;
   326         break;
   142         break;
   327         }
   143         }
   328 
   144 
   329     case R_PHONEUI_EMERGENCY_CALL_HEADER:
   145     case R_PHONEUI_EMERGENCY_CALL_HEADER:
   381                 string->Length())));
   197                 string->Length())));
   382         translatedActions [PhoneAction::Text] = text;
   198         translatedActions [PhoneAction::Text] = text;
   383         VA_END (list);
   199         VA_END (list);
   384         }
   200         }
   385         break;
   201         break;
   386     case R_PHONE_IMEI_STRING:
       
   387         {
       
   388         QScopedPointer<PhoneAction> text(new PhoneAction);
       
   389         VA_LIST list;
       
   390         VA_START(list, symbianResourceId);
       
   391         const TDesC *string = static_cast<TDesC*>(VA_ARG(list, TDesC*));
       
   392         QString serialNumber = 
       
   393             QString::fromUtf16(string->Ptr(), string->Length());
       
   394         text->setText(hbTrId("txt_phone_info_serial_no").arg(serialNumber));
       
   395         translatedActions[PhoneAction::Text] = text.take();
       
   396         VA_END(list);
       
   397         }
       
   398         break;
       
   399     case R_PHONEUI_LIFE_TIMER_STRING:
       
   400         {
       
   401         QScopedPointer<PhoneAction> text(new PhoneAction);
       
   402         VA_LIST list;
       
   403         VA_START(list, symbianResourceId);
       
   404         const TDesC *string = static_cast<TDesC*>(VA_ARG(list, TDesC*));
       
   405         QString lifeTimerText =
       
   406             QString::fromUtf16(string->Ptr(), string->Length());
       
   407         text->setText(hbTrId("txt_phone_info_life_timer").arg(lifeTimerText));
       
   408         translatedActions[PhoneAction::Text] = text.take();
       
   409         VA_END(list);
       
   410         }
       
   411         break;
       
   412     default:
   202     default:
   413         break;
   203         break;
   414     }
   204     }
   415     
   205     
   416     return translatedActions;
   206     return translatedActions;
   516             }
   306             }
   517             break;
   307             break;
   518         case R_PHONE_ERROR_NO_SERVICE:
   308         case R_PHONE_ERROR_NO_SERVICE:
   519             {
   309             {
   520             ret = hbTrId("txt_phone_dpopinfo_no_network_coverage");         
   310             ret = hbTrId("txt_phone_dpopinfo_no_network_coverage");         
       
   311             }
       
   312             break;
       
   313         case R_NOTETEXT_NUMBER_BARRED:
       
   314             {
       
   315             ret = hbTrId("txt_phone_info_number_barred");
       
   316             }
       
   317             break;
       
   318         case R_PHONEUI_NO_VIDEO_NETWORK:
       
   319             {
       
   320             ret = hbTrId("txt_phone_info_video_call_setup_failed");
       
   321             }
       
   322             break;
       
   323         case R_PHONEUI_VIDEO_CALL_NOT_POSSIBLE:
       
   324             {
       
   325             ret = hbTrId("txt_phone_info_video_call_didnt_succeed_to_called");
       
   326             }
       
   327             break;
       
   328         case R_CALL_INFO_CAUSE_VALUE127:
       
   329         case R_CALL_INFO_NOT_SUPPORTED:
       
   330         case R_CALL_INFO_SERVICE_NOT_AVAILABLE:
       
   331         case R_CALL_INFO_CAUSE_VALUE38:
       
   332         case R_CALL_INFO_CAUSE_VALUE55:
       
   333         case R_CALL_INFO_CAUSE_VALUE58:
       
   334         case R_NOTE_UNABLE_TO_MAKE_VIDEO_CALL_NOT_SUPPORTED_BY_OTHER_PHONE:
       
   335             {
       
   336             ret = hbTrId("txt_phone_info_unable_to_make_video_call_not_supp");
       
   337             }
       
   338             break;
       
   339         case R_NOTE_PHONE_OUT_OF_3G_COVERAGE:
       
   340             {
       
   341             ret = hbTrId("txt_phone_info_phone_switched_off_or_out_of_3g");
       
   342             }
       
   343             break;
       
   344         case R_NOTE_VIDEO_CALL_ONLY_POSSIBLE_UNDER_3G_COVERAGE:
       
   345             {
       
   346             ret = hbTrId("txt_phone_info_videocall_only_possible_under_3g");
       
   347             }
       
   348             break;
       
   349         case R_NOTE_CALLED_NUMBER_HAS_BARRED_INCOMING_CALLS:
       
   350             {
       
   351             ret = hbTrId("txt_phone_info_called_number_has_barred_incoming");
       
   352             }
       
   353             break;
       
   354         case R_INCAL_REMOTE_CREATE_CONFERENCE_TEXT:
       
   355             {
       
   356             ret = hbTrId("txt_phone_info_conference_call_active");
       
   357             }
       
   358             break;
       
   359         case R_NOTETEXT_CALL_BARRINGS:
       
   360             {
       
   361             ret = hbTrId("txt_phone_dpopinfo_note_you_have_active_barrings");
       
   362             }
       
   363             break;
       
   364         case R_CALL_INFO_CAUSE_VALUE16:
       
   365             {
       
   366             ret = hbTrId("txt_phone_info_call_ended");
       
   367             }
       
   368             break;
       
   369         case R_CALL_INFO_CAUSE_VALUE18:
       
   370             {
       
   371             ret = hbTrId("txt_phone_info_no_answer");
       
   372             }
       
   373             break;
       
   374         case R_CALL_INFO_CAUSE_VALUE21:
       
   375             {
       
   376             ret = hbTrId("txt_phone_info_call_rejected");
       
   377             }
       
   378             break;
       
   379         case R_CALL_INFO_CAUSE_VALUE22:
       
   380             {
       
   381             ret = hbTrId("txt_phone_info_number_not_in_use");
       
   382             }
       
   383             break;
       
   384         case R_CALL_INFO_CAUSE_VALUE34:
       
   385             {
       
   386             ret = hbTrId("txt_phone_info_network_busy");
       
   387             }
       
   388             break;
       
   389         case R_PHONE_ERROR_CALL_NOT_ALLOWED_FDN:
       
   390             {
       
   391             ret = hbTrId("txt_phone_info_call_not_allowed_fixed_dialling");
       
   392             }
       
   393             break;
       
   394         case R_NOTETEXT_DIVERTING_INCOMING_CALL:
       
   395         case R_NOTETEXT_DIVERTING:
       
   396             {
       
   397             ret = hbTrId("txt_phone_dpopinfo_diverting");
       
   398             }
       
   399             break;
       
   400         case R_NOTETEXT_ALL_INCOMING_CALLS_DIVERTED:
       
   401             {
       
   402             ret = hbTrId("txt_phone_dpopinfo_note_all_incoming_calls_diver");
       
   403             }
       
   404             break;
       
   405         case R_PHONE_ERROR_CHECK_CLIR:
       
   406             {
       
   407             ret = hbTrId("txt_phone_info_check_own_number_sending");
       
   408             }
       
   409             break;
       
   410         case R_PHONE_SS_NOTIFICATION_CLIR_SUPPR_REJECT_TEXT:
       
   411             {
       
   412             ret = hbTrId("txt_phone_info_could_not_send_own_number");
       
   413             }
       
   414             break;
       
   415         case R_NOTE_TEXT_CLIR_CHANGE:
       
   416             {
       
   417             ret = hbTrId("txt_phone_info_activate_own_number_sending");
       
   418             }
       
   419             break;
       
   420         case R_PHONE_ERROR_CHECK_NETWORK_SERVICES:
       
   421             {
       
   422             ret = hbTrId("txt_phone_info_check_network_services");
       
   423             }
       
   424             break;
       
   425         case R_PHONE_INCALL_INFO_VIDEO_CALL_NOT_ALLOWED_DURING_RESTORE:
       
   426             {
       
   427             ret = hbTrId("txt_phone_info_video_call_not_allowed_during_resto");
   521             }
   428             }
   522             break;
   429             break;
   523         default:
   430         default:
   524             break;
   431             break;
   525     }
   432     }
   560     case EPhoneInCallCmdEndAllCalls:
   467     case EPhoneInCallCmdEndAllCalls:
   561         ret = hbTrId("txt_phone_opt_end_all_calls");
   468         ret = hbTrId("txt_phone_opt_end_all_calls");
   562         break;     
   469         break;     
   563     case EPhoneInCallCmdTransfer:
   470     case EPhoneInCallCmdTransfer:
   564         ret = hbTrId("txt_phone_opt_transfer");
   471         ret = hbTrId("txt_phone_opt_transfer");
   565         break;    
   472         break;
   566     case EPhoneInCallCmdSwitchToVideo:
       
   567         ret = hbTrId("Call back with video call");
       
   568         break;  
       
   569     case EPhoneCmdHandoverToWlan:
   473     case EPhoneCmdHandoverToWlan:
   570         ret = hbTrId("Handover to WLAN");
   474         ret = hbTrId("Handover to WLAN");
   571         break;  
   475         break;  
   572     case EPhoneCmdHandoverToGsm:
   476     case EPhoneCmdHandoverToGsm:
   573         ret = hbTrId("Handover to GSM");
   477         ret = hbTrId("Handover to GSM");
   610     }
   514     }
   611 
   515 
   612     return ret;
   516     return ret;
   613 }
   517 }
   614 
   518 
       
   519 QList<PhoneAction::ToolBarItem> PhoneResourceAdapter::convertToToolBarCommandList(
       
   520         int symbianResourceId ) const
       
   521 {
       
   522     QList<PhoneAction::ToolBarItem> ret;
       
   523     
       
   524     switch(symbianResourceId) {
       
   525         case R_PHONEUI_CALLHANDLING_INCOMINGCALL_CBA:
       
   526             {
       
   527             ret.append(PhoneAction::ToolBarItem(PhoneCallComingCmdSoftReject,true)); 
       
   528             ret.append(PhoneAction::ToolBarItem(PhoneCallComingCmdSilent,true));      
       
   529             }
       
   530             break;
       
   531 
       
   532         case R_PHONEUI_CALLHANDLING_INCOMINGCALL_REJECT_CBA:
       
   533             {
       
   534             ret.append(PhoneAction::ToolBarItem(PhoneCallComingCmdSoftReject,true));
       
   535             ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdReject,true));  
       
   536             }
       
   537             break;
       
   538             
       
   539         case R_PHONEUI_CALLHANDLING_INCOMINGCALL_SOFT_REJECT_CBA:
       
   540             {
       
   541             ret.append(PhoneAction::ToolBarItem(PhoneCallComingCmdSoftReject,true));            
       
   542             ret.append(PhoneAction::ToolBarItem(PhoneCallComingCmdSilent,false)); 
       
   543             }
       
   544             break;
       
   545             
       
   546         case R_PHONEUI_CALLHANDLING_CALLWAITING_CBA:        
       
   547             {
       
   548             ret.append(PhoneAction::ToolBarItem(PhoneCallComingCmdSoftReject,true));            
       
   549             ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdJoinToConference,false));        
       
   550             }
       
   551             break;        
       
   552             
       
   553         case R_PHONEUI_DIALER_CBA:
       
   554         case R_PHONEUI_INCALL_DIALER_CBA:
       
   555         case R_PHONEUI_CALLHANDLING_INCALL_UNHOLD_CBA:
       
   556         case R_PHONEUI_CALLHANDLING_INCALL_UNMUTE_CBA:
       
   557         case R_PHONEUI_CALLHANDLING_INCALL_HANDSET_CBA:
       
   558         case R_PHONEUI_CALLHANDLING_CALLSETUP_EMPTY_DTMFDIALER_CBA:
       
   559             {
       
   560             if (!m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Ihf))
       
   561                 {
       
   562                 ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdActivateIhf,true));
       
   563                 }
       
   564             else
       
   565                 {
       
   566                 ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdDeactivateIhf,true));
       
   567                 }
       
   568             
       
   569             if (!m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::MultiCall)) {
       
   570                 bool outgoing(m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Outgoing));
       
   571                 if (m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Hold))
       
   572                     {
       
   573                     ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdUnhold,!outgoing));
       
   574                     }
       
   575                 else
       
   576                     {
       
   577                     ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdHold,!outgoing));
       
   578                     }
       
   579                          
       
   580                 ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdOpenContacts,true));
       
   581             } else {
       
   582                 bool outgoing(m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Outgoing));
       
   583                 bool disableJoin(outgoing ? true : m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::DisableJoin));
       
   584                 
       
   585                 ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdSwap,!outgoing));
       
   586                 if (m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Conference)) {
       
   587                     ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdJoinToConference,!disableJoin));
       
   588                 } else {
       
   589                     ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdCreateConference,!disableJoin));
       
   590                 }
       
   591             }
       
   592             
       
   593             ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdOpenDialer,true)); 
       
   594             }
       
   595             break;
       
   596             
       
   597         case R_PHONEUI_CALLHANDLING_EMERGENCY_CBA:
       
   598             {
       
   599             
       
   600             if (!m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Ihf))
       
   601                 {
       
   602                 ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdActivateIhf,true));
       
   603                 }
       
   604             else
       
   605                 {
       
   606                 ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdDeactivateIhf,true));
       
   607                 }                 
       
   608             }
       
   609 			
       
   610             ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdOpenDialer,true));
       
   611             break;
       
   612             
       
   613         /*case R_PHONEUI_CALLHANDLING_INCALL_HANDSET_CBA:
       
   614             {
       
   615             ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdOpenDialer,true));
       
   616 
       
   617             if (m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Hold))
       
   618                 {
       
   619                 ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdUnhold,true));
       
   620                 }
       
   621             else
       
   622                 {
       
   623                 ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdHold,true));
       
   624                 }
       
   625             if (!m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Hold))
       
   626                 {
       
   627                 ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdMute,true));
       
   628                 }
       
   629             else
       
   630                 {
       
   631                 ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdUnmute,true));
       
   632                 }
       
   633 
       
   634             ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdDeactivateIhf,true));
       
   635             ret.append(PhoneAction::ToolBarItem(PhoneInCallCmdOpenContacts,true));
       
   636             }
       
   637             break;*/
       
   638         default:
       
   639             break;
       
   640     }
       
   641 
       
   642     return ret;
       
   643 }
       
   644 
       
   645