phoneapp/phoneuiqtviewadapter/src/phoneresourceadapter.cpp
changeset 21 92ab7f8d0eab
child 22 6bb1b21d2484
equal deleted inserted replaced
4:c84cf270c54f 21:92ab7f8d0eab
       
     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 <QApplication>
       
    23 #include <QLocale>
       
    24 #include <QTranslator>
       
    25 #include <QtDebug>
       
    26 #include <QVariant>
       
    27 #include <hbaction.h>
       
    28 
       
    29 PhoneResourceAdapter *pinstance = 0;// initialize pointer
       
    30 
       
    31 PhoneResourceAdapter* PhoneResourceAdapter::Instance (QObject *parent) 
       
    32 {
       
    33     if (pinstance == 0)  // is it the first call?
       
    34     {  
       
    35         pinstance = new PhoneResourceAdapter (parent); // create sole instance
       
    36     }
       
    37     return pinstance; // address of sole instance
       
    38 }
       
    39   
       
    40 PhoneResourceAdapter::PhoneResourceAdapter (QObject *parent) : QObject (parent)
       
    41 {
       
    42     m_buttonsCtrl = new PhoneUIQtButtonsController();
       
    43     
       
    44 }
       
    45 
       
    46 PhoneResourceAdapter::~PhoneResourceAdapter ()
       
    47 {
       
    48     delete m_buttonsCtrl;
       
    49 }
       
    50 
       
    51 PhoneUIQtButtonsController* PhoneResourceAdapter::buttonsController ()
       
    52 {
       
    53     PhoneUIQtButtonsController* retValue = 0;
       
    54     
       
    55     if (m_buttonsCtrl) 
       
    56         {
       
    57         retValue = m_buttonsCtrl;
       
    58         }
       
    59     
       
    60     return retValue;
       
    61 }
       
    62 
       
    63 QMap<PhoneAction::ActionType, PhoneAction *> PhoneResourceAdapter::convert (int symbianResourceId, ...)
       
    64 {
       
    65     QMap<PhoneAction::ActionType, PhoneAction *> translatedActions;
       
    66     
       
    67     switch (symbianResourceId) {
       
    68     case R_PHONEUI_INCOMING_CALL_BUTTONS:
       
    69     case R_PHONEUI_WAITING_CALL_BUTTONS:        
       
    70         {
       
    71         PhoneAction *leftButton = new PhoneAction;
       
    72         leftButton->setText (hbTrId("txt_common_button_answer"));
       
    73         leftButton->setIcon (HbIcon(":/pri_large_button_answer.svg"));
       
    74         leftButton->setCommand (EPhoneCallComingCmdAnswer);
       
    75         translatedActions [PhoneAction::LeftButton] = leftButton;
       
    76         
       
    77         PhoneAction *rightButton = new PhoneAction;
       
    78         rightButton->setText (hbTrId("txt_common_button_reject"));
       
    79         rightButton->setIcon (HbIcon(":/qtg_large_button_reject.svg"));
       
    80         rightButton->setCommand (EPhoneCallComingCmdReject);
       
    81         translatedActions [PhoneAction::RightButton] = rightButton;
       
    82         }
       
    83         break;
       
    84         
       
    85     case R_PHONEUI_CALL_SETUP_BUTTONS:
       
    86         {
       
    87         PhoneAction *leftButton = new PhoneAction;
       
    88         leftButton->setText (hbTrId("txt_phone_button_end_call"));
       
    89         leftButton->setIcon (HbIcon(":/pri_large_button_endcall.svg"));
       
    90         leftButton->setCommand (EPhoneInCallCmdEndThisOutgoingCall);
       
    91         translatedActions [PhoneAction::LeftButton] = leftButton;
       
    92         }
       
    93         break;
       
    94 
       
    95     case R_PHONEUI_INCALL_BUTTONS:
       
    96         {
       
    97         PhoneAction *leftButton = new PhoneAction;
       
    98         leftButton->setText (hbTrId("txt_phone_button_hold"));
       
    99         leftButton->setIcon (HbIcon(":/qtg_large_button_hold.svg"));
       
   100         leftButton->setCommand (EPhoneInCallCmdHold);
       
   101         translatedActions [PhoneAction::LeftButton] = leftButton;
       
   102 
       
   103         PhoneAction *rightButton = new PhoneAction;
       
   104         rightButton->setText (hbTrId("txt_phone_button_end_call"));
       
   105         rightButton->setIcon (HbIcon(":/pri_large_button_endcall.svg"));
       
   106         rightButton->setCommand (EPhoneInCallCmdEndThisActiveCall);
       
   107         translatedActions [PhoneAction::RightButton] = rightButton;
       
   108         }
       
   109         break;
       
   110         
       
   111     case R_PHONEUI_INCALL_HELD_BUTTONS:
       
   112         {
       
   113         PhoneAction *leftButton = new PhoneAction;
       
   114         leftButton->setText (hbTrId("txt_phone_button_unhold"));
       
   115         leftButton->setIcon (HbIcon(":/qtg_large_button_onhold.svg"));
       
   116         leftButton->setCommand (EPhoneInCallCmdUnhold);
       
   117         translatedActions [PhoneAction::LeftButton] = leftButton;
       
   118 
       
   119         PhoneAction *rightButton = new PhoneAction;
       
   120         rightButton->setText (hbTrId("txt_phone_button_end_call"));
       
   121         rightButton->setIcon (HbIcon(":/pri_large_button_endcall.svg"));
       
   122         rightButton->setCommand (EPhoneInCallCmdEndThisActiveCall);
       
   123         translatedActions [PhoneAction::RightButton] = rightButton;
       
   124         }
       
   125         break;
       
   126 
       
   127     case R_PHONEUI_TWO_SINGLES_BUTTONS:
       
   128         {
       
   129         PhoneAction *leftButton = new PhoneAction;
       
   130         leftButton->setText (hbTrId("txt_phone_button_swap"));
       
   131         leftButton->setIcon (HbIcon(":/qgn_indi_button_swap.svg"));
       
   132         leftButton->setCommand (EPhoneInCallCmdSwap);
       
   133         translatedActions [PhoneAction::LeftButton] = leftButton;
       
   134 
       
   135         PhoneAction *rightButton = new PhoneAction;
       
   136         rightButton->setText (hbTrId("txt_phone_button_end_call"));
       
   137         rightButton->setIcon (HbIcon(":/pri_large_button_endcall.svg"));
       
   138         rightButton->setCommand (EPhoneInCallCmdEndThisActiveCall);
       
   139         translatedActions [PhoneAction::RightButton] = rightButton;                        
       
   140         }
       
   141         break;
       
   142     
       
   143     case R_PHONEUI_CALLHANDLING_INCOMINGCALL_CBA:
       
   144         {
       
   145         PhoneAction *leftButton = new PhoneAction;
       
   146         leftButton->setIcon (HbIcon(":/qtg_large_comp_message.svg"));
       
   147         translatedActions [PhoneAction::ToolbarButton1] = leftButton;       
       
   148         
       
   149         PhoneAction *rightButton = new PhoneAction;
       
   150         rightButton->setIcon (HbIcon(":/qtg_large_tb_silence.svg"));
       
   151         rightButton->setCommand (EPhoneCallComingCmdSilent);
       
   152         translatedActions [PhoneAction::ToolbarButton2] = rightButton;            
       
   153         }
       
   154         break;
       
   155 
       
   156     case R_PHONEUI_CALLHANDLING_INCOMINGCALL_REJECT_CBA:
       
   157     case R_PHONEUI_CALLHANDLING_INCOMINGCALL_SOFT_REJECT_CBA:
       
   158         {
       
   159         PhoneAction *leftButton = new PhoneAction;
       
   160         leftButton->setIcon (HbIcon(":/qtg_large_comp_message.svg"));
       
   161         translatedActions [PhoneAction::ToolbarButton1] = leftButton;
       
   162         
       
   163         PhoneAction *rightButton = new PhoneAction;
       
   164         rightButton->setIcon (HbIcon(":/qtg_large_tb_silence.svg"));
       
   165         rightButton->setDisabled(true);
       
   166         translatedActions [PhoneAction::ToolbarButton2] = rightButton;        
       
   167         }
       
   168         break;
       
   169         
       
   170     case R_PHONEUI_CALLHANDLING_CALLWAITING_CBA:        
       
   171         {
       
   172         PhoneAction *leftButton = new PhoneAction;
       
   173         leftButton->setIcon (HbIcon(":/qtg_large_comp_message.svg"));
       
   174         translatedActions [PhoneAction::ToolbarButton1] = leftButton;       
       
   175         
       
   176         PhoneAction *rightButton = new PhoneAction;
       
   177         rightButton->setIcon (HbIcon(":/qtg_large_tb_join.svg"));
       
   178         rightButton->setCommand (EPhoneInCallCmdJoin);
       
   179         translatedActions [PhoneAction::ToolbarButton2] = rightButton;            
       
   180         }
       
   181         break;        
       
   182         
       
   183     case R_PHONEUI_DIALER_CBA:
       
   184     case R_PHONEUI_INCALL_DIALER_CBA:
       
   185     case R_PHONEUI_CALLHANDLING_CALLSETUP_EMPTY_DTMFDIALER_CBA:
       
   186     case R_PHONEUI_CALLHANDLING_INCALL_UNHOLD_CBA:
       
   187         {
       
   188         PhoneAction *leftButton = new PhoneAction;
       
   189         leftButton->setIcon (HbIcon(":/qtg_large_tb_dialler.svg"));
       
   190         leftButton->setCommand(EPhoneInCallCmdDialer);
       
   191         translatedActions [PhoneAction::ToolbarButton1] = leftButton;
       
   192         
       
   193         PhoneAction *centerButton = new PhoneAction;
       
   194         centerButton->setIcon (HbIcon(":/qtg_large_tb_mute.svg"));
       
   195         centerButton->setCommand (EPhoneInCallCmdMute);
       
   196         translatedActions [PhoneAction::ToolbarButton2] = centerButton;        
       
   197 
       
   198         PhoneAction *centerButton2 = new PhoneAction;
       
   199         if (!m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Ihf))
       
   200             {
       
   201             centerButton2->setIcon (HbIcon(":/qtg_large_tb_loudsp_unmute.svg"));
       
   202             centerButton2->setCommand (EPhoneInCallCmdActivateIhf);
       
   203             }
       
   204         else
       
   205             {
       
   206             centerButton2->setIcon (HbIcon(":/qtg_large_tb_loudsp_mute.svg"));
       
   207             centerButton2->setCommand (EPhoneInCallCmdDeactivateIhf);
       
   208             }
       
   209         translatedActions [PhoneAction::ToolbarButton3] = centerButton2; 
       
   210         
       
   211         PhoneAction *rightButton = new PhoneAction;
       
   212         rightButton->setIcon(HbIcon(":/qtg_large_tb_contacts.svg"));
       
   213         rightButton->setDisabled( 
       
   214                 (symbianResourceId==
       
   215                  R_PHONEUI_CALLHANDLING_CALLSETUP_EMPTY_DTMFDIALER_CBA));
       
   216         
       
   217         translatedActions[PhoneAction::ToolbarButton4] = rightButton;
       
   218         }
       
   219         break;
       
   220         
       
   221     case R_PHONEUI_CALLHANDLING_EMERGENCY_CBA:
       
   222         {
       
   223         PhoneAction *leftButton = new PhoneAction;
       
   224         leftButton->setIcon (HbIcon(":/qtg_large_tb_dialler.svg"));
       
   225         leftButton->setCommand(EPhoneInCallCmdDialer);
       
   226         translatedActions [PhoneAction::ToolbarButton1] = leftButton;
       
   227         
       
   228         PhoneAction *rightButton = new PhoneAction;
       
   229         if (!m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Ihf))
       
   230             {
       
   231             rightButton->setIcon (HbIcon(":/qtg_large_tb_loudsp_unmute.svg"));
       
   232             rightButton->setCommand (EPhoneInCallCmdActivateIhf);
       
   233             }
       
   234         else
       
   235             {
       
   236             rightButton->setIcon (HbIcon(":/qtg_large_tb_loudsp_mute.svg"));
       
   237             rightButton->setCommand (EPhoneInCallCmdDeactivateIhf);
       
   238             }
       
   239         translatedActions [PhoneAction::ToolbarButton2] = rightButton;                    
       
   240         }
       
   241         break;
       
   242         
       
   243     case R_PHONEUI_CALLHANDLING_INCALL_UNMUTE_CBA:
       
   244         {
       
   245         PhoneAction *leftButton = new PhoneAction;
       
   246         leftButton->setIcon (HbIcon(":/qtg_large_tb_dialler.svg"));
       
   247         leftButton->setCommand(EPhoneInCallCmdDialer);
       
   248         translatedActions [PhoneAction::ToolbarButton1] = leftButton;
       
   249         
       
   250         PhoneAction *centerButton = new PhoneAction;
       
   251         centerButton->setIcon (HbIcon(":/qtg_large_tb_unmute.svg"));
       
   252         centerButton->setCommand (EPhoneInCallCmdUnmute);
       
   253         translatedActions [PhoneAction::ToolbarButton2] = centerButton;        
       
   254 
       
   255         PhoneAction *centerButton2 = new PhoneAction;
       
   256         if (!m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Ihf))
       
   257             {
       
   258             centerButton2->setIcon (HbIcon(":/qtg_large_tb_loudsp_unmute.svg"));
       
   259             centerButton2->setCommand (EPhoneInCallCmdActivateIhf);
       
   260             }
       
   261         else
       
   262             {
       
   263             centerButton2->setIcon (HbIcon(":/qtg_large_tb_loudsp_mute.svg"));
       
   264             centerButton2->setCommand (EPhoneInCallCmdDeactivateIhf);
       
   265             }
       
   266         translatedActions [PhoneAction::ToolbarButton3] = centerButton2;     
       
   267         
       
   268         PhoneAction *rightButton = new PhoneAction;
       
   269         rightButton->setIcon(HbIcon(":/qtg_large_tb_contacts.svg"));
       
   270         translatedActions[PhoneAction::ToolbarButton4] = rightButton;   
       
   271         }
       
   272         break;
       
   273         
       
   274     case R_PHONEUI_CALLHANDLING_INCALL_HANDSET_CBA:
       
   275         {
       
   276         PhoneAction *leftButton = new PhoneAction;
       
   277         leftButton->setIcon (HbIcon(":/qtg_large_tb_dialler.svg"));
       
   278         leftButton->setCommand(EPhoneInCallCmdDialer);
       
   279         translatedActions [PhoneAction::ToolbarButton1] = leftButton;
       
   280         
       
   281         PhoneAction *centerButton1 = new PhoneAction;
       
   282         if (!m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Hold))
       
   283             {
       
   284             centerButton1->setIcon (HbIcon(":/qtg_large_tb_mute.svg"));
       
   285             centerButton1->setCommand (EPhoneInCallCmdMute);
       
   286             }
       
   287         else
       
   288             {
       
   289             centerButton1->setIcon (HbIcon(":/qtg_large_tb_unmute.svg"));
       
   290             centerButton1->setCommand (EPhoneInCallCmdUnmute);
       
   291             }
       
   292         translatedActions [PhoneAction::ToolbarButton2] = centerButton1;
       
   293 
       
   294         PhoneAction *centerButton2 = new PhoneAction;
       
   295         centerButton2->setIcon (HbIcon(":/qtg_large_tb_loudsp_mute.svg"));
       
   296         centerButton2->setCommand (EPhoneInCallCmdDeactivateIhf);
       
   297         translatedActions [PhoneAction::ToolbarButton3] = centerButton2;
       
   298         
       
   299         PhoneAction *rightButton = new PhoneAction;
       
   300         rightButton->setIcon(HbIcon(":/qtg_large_tb_contacts.svg"));
       
   301         translatedActions[PhoneAction::ToolbarButton4] = rightButton;
       
   302         }
       
   303         break;
       
   304 
       
   305     case R_PHONEUI_MTCAL_INCOMING_CALL:
       
   306         {
       
   307         PhoneAction *text = new PhoneAction;
       
   308         text->setText (hbTrId("calling"));
       
   309         translatedActions [PhoneAction::Text] = text;
       
   310         }
       
   311         break;
       
   312         
       
   313     case R_PHONEUI_INCALL_CALL_DISCONNECTED:
       
   314         {
       
   315         PhoneAction *text = new PhoneAction;
       
   316         text->setText (hbTrId("disconnected"));
       
   317         translatedActions [PhoneAction::Text] = text;
       
   318         }
       
   319         break;      
       
   320         
       
   321     case R_PHONEUI_INCALL_CALL_HELD:
       
   322         {
       
   323         PhoneAction *text = new PhoneAction;
       
   324         text->setText (hbTrId("txt_phone_other_on_hold"));
       
   325         translatedActions [PhoneAction::Text] = text;    
       
   326         break;
       
   327         }
       
   328 
       
   329     case R_PHONEUI_MULTC_WAITING:
       
   330         {
       
   331         PhoneAction *text = new PhoneAction;
       
   332         text->setText (hbTrId("txt_phone_other_waiting"));
       
   333         translatedActions [PhoneAction::Text] = text;
       
   334         }
       
   335         break; 
       
   336 
       
   337     case R_PHONEUI_INCALL_CALL_NUMBER:
       
   338         {
       
   339         PhoneAction *text = new PhoneAction;
       
   340         VA_LIST list;
       
   341         VA_START (list, symbianResourceId);
       
   342         int intValue = VA_ARG (list, int);
       
   343         text->setText (hbTrId("txt_phone_other_call_ln").arg (intValue));
       
   344         translatedActions [PhoneAction::Text] = text;
       
   345         VA_END (list);
       
   346         }
       
   347         break;
       
   348         
       
   349     case R_PHONEUI_TIME_DURAT_LONG_WITH_ZERO:
       
   350         {
       
   351         PhoneAction *text = new PhoneAction;
       
   352         // Symbian modifier used here: %:0%H%:1%T%:2%S%:3
       
   353         // This is because this text is used by Symbian localization
       
   354         // for formatting later on.
       
   355         text->setText ("%:0%H%:1%T%:2%S%:3");
       
   356         translatedActions [PhoneAction::Text] = text;
       
   357         break;
       
   358         }
       
   359         
       
   360     case R_PHONEUI_OUT_GOING_CALL:
       
   361         {
       
   362         PhoneAction *text = new PhoneAction;
       
   363         text->setText (hbTrId("txt_phone_other_calling"));
       
   364         translatedActions [PhoneAction::Text] = text;
       
   365         break;
       
   366         }
       
   367         
       
   368     case R_PHONEUI_MTCAL_CLI_WITHHELD:
       
   369         {
       
   370         PhoneAction *text = new PhoneAction;
       
   371         text->setText (hbTrId("txt_phone_other_private_number"));
       
   372         translatedActions [PhoneAction::Text] = text;
       
   373         break;
       
   374         }
       
   375     case R_PHONEUI_MTCAL_CALL:
       
   376         {
       
   377         PhoneAction *text = new PhoneAction;
       
   378         text->setText (hbTrId("txt_common_button_call")); //Call
       
   379         translatedActions [PhoneAction::Text] = text;
       
   380         break;
       
   381         }
       
   382 
       
   383     case R_PHONEUI_EMERGENCY_CALL_HEADER:
       
   384         {
       
   385         PhoneAction *text = new PhoneAction;
       
   386         text->setText (hbTrId("txt_phone_other_emergency_call"));
       
   387         translatedActions [PhoneAction::Text] = text;            
       
   388         break;            
       
   389         }
       
   390         
       
   391     case R_PHONEUI_EMERGENCY_CALL_BUTTONS:
       
   392         {
       
   393         PhoneAction *button = new PhoneAction;
       
   394         button->setText (hbTrId("txt_phone_button_end_call"));
       
   395         button->setIcon (HbIcon(":/pri_large_button_endcall.svg"));
       
   396         button->setCommand (EPhoneCmdEnd);
       
   397         translatedActions [PhoneAction::LeftButton] = button;
       
   398         }
       
   399         break;
       
   400         
       
   401     case R_PHONEUI_ATTEMPTING_EMERGENCY_CALL_TEXT:
       
   402         {
       
   403         PhoneAction *text = new PhoneAction;
       
   404         text->setText (hbTrId("txt_phone_other_attempting"));
       
   405         translatedActions [PhoneAction::Text] = text;            
       
   406         }
       
   407         break;
       
   408 
       
   409     case R_PHONEUI_CONFERENCE_CALL:
       
   410         {
       
   411         PhoneAction *text = new PhoneAction;
       
   412         text->setText (hbTrId("txt_phone_other_conference_call"));
       
   413         translatedActions [PhoneAction::Text] = text; 
       
   414         }
       
   415         break;
       
   416     case R_PHONEUI_SENDING_DTMF_WAIT_NOTE_TEXT:
       
   417         {
       
   418         PhoneAction *text = new PhoneAction;
       
   419         VA_LIST list;
       
   420         VA_START (list, symbianResourceId);
       
   421         const TDesC *string = (TDesC*)VA_ARG(list, TDesC*);
       
   422         text->setText (hbTrId("Sending:\n%1").arg(QString::fromUtf16(string->Ptr(), 
       
   423                 string->Length())));
       
   424         translatedActions [PhoneAction::Text] = text;
       
   425         VA_END (list);
       
   426         }
       
   427         break;
       
   428     case R_PHONEUI_DTMF_WAIT_CHARACTER_CONFIRMATION_QUERY_TEXT:
       
   429         {
       
   430         PhoneAction *text = new PhoneAction;
       
   431         VA_LIST list;
       
   432         VA_START (list, symbianResourceId);
       
   433         const TDesC *string = (TDesC*)VA_ARG(list, TDesC*);
       
   434         text->setText (hbTrId("Send string:\n%1").arg(QString::fromUtf16(string->Ptr(), 
       
   435                 string->Length())));
       
   436         translatedActions [PhoneAction::Text] = text;
       
   437         VA_END (list);
       
   438         }
       
   439         break;
       
   440 
       
   441     default:
       
   442         break;
       
   443     }
       
   444     
       
   445     return translatedActions;
       
   446 }
       
   447 
       
   448 QString PhoneResourceAdapter::convertToString(int symbianResourceId) const
       
   449 {
       
   450     QString ret;
       
   451     
       
   452     switch (symbianResourceId) {
       
   453         case R_PHONE_ERROR_CALL_NOT_ALLOWED:
       
   454             {
       
   455             ret = hbTrId("Call not allowed");      
       
   456             }
       
   457             break;
       
   458             
       
   459         case R_ERROR_NOTE_NOT_ALLOWED:
       
   460             {
       
   461             ret =  hbTrId("Not allowed");  
       
   462             }
       
   463             break;
       
   464             
       
   465         case R_NOTETEXT_INVALID_PHONENUMBER:
       
   466             {
       
   467             ret = hbTrId("Invalid phone number"); 
       
   468             }
       
   469             break;
       
   470             
       
   471         case R_NOTETEXT_NO_ANSWER:
       
   472             {
       
   473             ret = hbTrId("No answer"); 
       
   474             }
       
   475             break;
       
   476         
       
   477         case R_PHONE_ERROR_NUMBER_BUSY:
       
   478             {
       
   479             ret = hbTrId("Number busy"); 
       
   480             }
       
   481             break;
       
   482             
       
   483         case R_PHONE_SS_NOTIFICATION_MOCAL_WAITING_TEXT:
       
   484             {
       
   485             ret = hbTrId("txt_phone_other_waiting");
       
   486             }
       
   487             break;
       
   488             
       
   489         case R_PHONE_SS_NOTIFICATION_INCAL_INFO_HOLD_TEXT:
       
   490             {
       
   491             ret = hbTrId("txt_phone_other_on_hold");
       
   492             }
       
   493             break;
       
   494             
       
   495         case R_INCAL_INFO_HOLD_TEXT:
       
   496             {
       
   497             ret = hbTrId("txt_phone_other_on_hold");
       
   498             }
       
   499             break;
       
   500             
       
   501         case R_INCAL_REMOTE_ACTIVE_TEXT:
       
   502             {
       
   503             ret = hbTrId("Connected");
       
   504             }
       
   505             break;
       
   506             
       
   507         case R_INCAL_INFO_CONF_HOLD_TEXT:
       
   508             {
       
   509             ret = hbTrId("Conference on hold");
       
   510             }
       
   511             break;
       
   512         case R_PHONE_INCALL_INFO_NO_NETWORK_SUPPORT:
       
   513             {
       
   514             ret = hbTrId("No network support for video call");
       
   515             }
       
   516             break;
       
   517         default:
       
   518             break;
       
   519     }
       
   520 
       
   521     return ret;
       
   522 }
       
   523 
       
   524 QString PhoneResourceAdapter::convertToString(
       
   525         int symbianResourceId, const QString &text) const
       
   526 {
       
   527     QString ret;
       
   528     
       
   529     switch (symbianResourceId) {
       
   530 
       
   531         case R_PHONE_TEXT_COLP_CONNECTED:
       
   532             {
       
   533             ret = hbTrId("Connected to %1").arg(text);
       
   534             }
       
   535             break;
       
   536         default:
       
   537             break;
       
   538     }
       
   539 
       
   540     return ret;
       
   541 }
       
   542 
       
   543 int PhoneResourceAdapter::defaultToolbarResourceId() const
       
   544 {
       
   545     return R_PHONEUI_CALLHANDLING_INCOMINGCALL_CBA;
       
   546 }
       
   547 
       
   548 QString PhoneResourceAdapter::convertCommandToString(
       
   549         int symbianCommandId ) const
       
   550 {
       
   551     QString ret;
       
   552     
       
   553     switch(symbianCommandId) {
       
   554     case EPhoneInCallCmdEndAllCalls:
       
   555         ret = hbTrId("txt_phone_opt_end_all_calls");
       
   556         break;     
       
   557     case EPhoneInCallCmdTransfer:
       
   558         ret = hbTrId("txt_phone_opt_transfer");
       
   559         break;    
       
   560     case EPhoneInCallCmdSwitchToVideo:
       
   561         ret = hbTrId("Call back with video call");
       
   562         break;  
       
   563     case EPhoneCmdHandoverToWlan:
       
   564         ret = hbTrId("Handover to WLAN");
       
   565         break;  
       
   566     case EPhoneCmdHandoverToGsm:
       
   567         ret = hbTrId("Handover to GSM");
       
   568         break;  
       
   569         
       
   570     // TODO
       
   571     default:
       
   572         break;
       
   573     }
       
   574 
       
   575     return ret;
       
   576 }
       
   577 
       
   578 QList<HbAction*> PhoneResourceAdapter::convertToHbActions(
       
   579         int symbianResourceId ) const
       
   580 {
       
   581     QList<HbAction*> ret;
       
   582     
       
   583     switch(symbianResourceId) {
       
   584         case R_PHONEUI_DTMF_WAIT_CHARACTER_CONFIRMATION_QUERY:
       
   585             {
       
   586             HbAction *leftButton = new HbAction(hbTrId("txt_common_button_send"));
       
   587             leftButton->setData(QVariant(EPhoneInCallCmdContinueSendingDtmfString));
       
   588             ret.append(leftButton);
       
   589     
       
   590             HbAction *rightButton = new HbAction(hbTrId("txt_common_button_cancel"));
       
   591             rightButton->setData(QVariant(EPhoneInCallCmdCancelSendingDtmfString));
       
   592             ret.append(rightButton);
       
   593             }
       
   594             break;
       
   595         case R_PHONEUI_SENDING_DTMF_WAIT_NOTE:
       
   596             {     
       
   597             HbAction *button = new HbAction(hbTrId("txt_common_button_cancel"));
       
   598             button->setData(QVariant(EPhoneInCallCmdCancelSendingDtmfString));
       
   599             ret.append(button); 
       
   600             }
       
   601             break;
       
   602         default:
       
   603             break;
       
   604     }
       
   605 
       
   606     return ret;
       
   607 }
       
   608