phoneapp/phoneuiqtviewadapter/src/phoneuiqtviewadapter.cpp
changeset 78 baacf668fe89
parent 76 cfea66083b62
equal deleted inserted replaced
76:cfea66083b62 78:baacf668fe89
    13 *
    13 *
    14 * Description:  Phone UI's symbian adapter for Qt view.
    14 * Description:  Phone UI's symbian adapter for Qt view.
    15 *
    15 *
    16 */
    16 */
    17 
    17 
       
    18 #include "cphonemediatorsender.h"
    18 #include "phoneuiqtviewadapter.h"
    19 #include "phoneuiqtviewadapter.h"
    19 #include "phoneuiqtviewif.h"
    20 #include "phoneuiqtviewif.h"
    20 #include "phonebubblewrapper.h"
    21 #include "phonebubblewrapper.h"
    21 #include "tphonecmdparaminteger.h"
    22 #include "tphonecmdparaminteger.h"
    22 #include "tphonecmdparamboolean.h"
    23 #include "tphonecmdparamboolean.h"
    27 #include "tphonecmdparamemergencycallheaderdata.h"
    28 #include "tphonecmdparamemergencycallheaderdata.h"
    28 #include "tphonecmdparamstring.h"
    29 #include "tphonecmdparamstring.h"
    29 #include "tphonecmdparamkeycapture.h"
    30 #include "tphonecmdparamkeycapture.h"
    30 #include "cphonepubsubproxy.h"
    31 #include "cphonepubsubproxy.h"
    31 #include "pevirtualengine.h"
    32 #include "pevirtualengine.h"
    32 #include "cphoneringingtonecontroller.h"
    33 #include "rphonetoneclient.h"
    33 #include "phoneresourceadapter.h"
    34 #include "phoneresourceadapter.h"
    34 #include "phoneui.hrh"
    35 #include "phoneui.hrh"
    35 #include "cphonemediatorfactory.h"
    36 #include "cphonemediatorfactory.h"
    36 #include "phoneuiqtbuttonscontroller.h"
    37 #include "phoneuiqtbuttonscontroller.h"
    37 #include "phoneconstants.h"
    38 #include "phoneconstants.h"
    58 #include <eikenv.h>
    59 #include <eikenv.h>
    59 #include <w32std.h>
    60 #include <w32std.h>
    60 #include <hbstringutil.h>
    61 #include <hbstringutil.h>
    61 #include <xqaiwdecl.h>
    62 #include <xqaiwdecl.h>
    62 #include <mpeengineinfo.h>
    63 #include <mpeengineinfo.h>
       
    64 #include <xqsystemtoneservice.h>
    63 
    65 
    64 
    66 
    65 //CONSTANTS
    67 //CONSTANTS
    66 static const int PHONE_CALL_NOT_FOUND = -1;
    68 static const int PHONE_CALL_NOT_FOUND = -1;
    67 
    69 
    78 
    80 
    79 PhoneUIQtViewAdapter::PhoneUIQtViewAdapter (PhoneUIQtViewIF &view, QObject *parent) :
    81 PhoneUIQtViewAdapter::PhoneUIQtViewAdapter (PhoneUIQtViewIF &view, QObject *parent) :
    80     QObject (parent),
    82     QObject (parent),
    81     m_view (view),
    83     m_view (view),
    82     m_bubbleWrapper(0),
    84     m_bubbleWrapper(0),
    83     m_ringingtonecontroller(0),
       
    84     m_resourceAdapter(0),
    85     m_resourceAdapter(0),
    85     m_noteController(0),
    86     m_noteController(0),
    86     m_telephonyService(0),
    87     m_telephonyService(0),
    87     m_uiCommandController(0),
    88     m_uiCommandController(0),
    88     m_messageController(0),
    89     m_messageController(0),
    89     m_indicatorController(0),
    90     m_indicatorController(0),
    90     m_phoneCallHeaderManager(0),
    91     m_phoneCallHeaderManager(0),
    91     m_dialpadAboutToClose(false),
    92     m_dialpadAboutToClose(false),
    92     m_homeScreenToForeground(false),
       
    93     m_visibilityHandler(0),
    93     m_visibilityHandler(0),
    94     m_appLauncher(0),
    94     m_appLauncher(0),
    95     m_clearDialpadOnClose(true),
    95     m_clearDialpadOnClose(true),
    96     m_speakerAsDefaultButton(false),
    96     m_speakerAsDefaultButton(false),
    97     m_ringingTonePlaying(false)
    97     m_ringingTonePlaying(false)
    98 {
    98 {
       
    99     m_toneService = new XQSystemToneService(this);
    99     m_bubbleWrapper = new PhoneBubbleWrapper(m_view.bubbleManager(), this);
   100     m_bubbleWrapper = new PhoneBubbleWrapper(m_view.bubbleManager(), this);
   100     m_noteController = new PhoneNoteController(this);
   101     m_noteController = new PhoneNoteController(*m_toneService, this);
   101     m_uiCommandController = new PhoneUiCommandController(view, this);
   102     m_uiCommandController = new PhoneUiCommandController(view, this);
   102     m_phoneCallHeaderManager = new PhoneCallHeaderManager(*m_bubbleWrapper, m_view, this);
   103     m_phoneCallHeaderManager = new PhoneCallHeaderManager(*m_bubbleWrapper,
   103 
   104                                                           m_view, this);
   104     TRAPD( error, m_ringingtonecontroller = CPhoneRingingToneController::NewL () );
   105 
       
   106     int error = m_toneClient.Connect();
   105     qt_symbian_throwIfError(error);
   107     qt_symbian_throwIfError(error);
   106     m_resourceAdapter = PhoneResourceAdapter::Instance(this);
   108     m_resourceAdapter = PhoneResourceAdapter::Instance(this);
   107 
   109 
   108     // display initial toolbar to make client area size correct
   110     // display initial toolbar to make client area size correct
   109     TPhoneCmdParamInteger intParam;
   111     TPhoneCmdParamInteger intParam;
   128     
   130     
   129 }
   131 }
   130 
   132 
   131 PhoneUIQtViewAdapter::~PhoneUIQtViewAdapter ()
   133 PhoneUIQtViewAdapter::~PhoneUIQtViewAdapter ()
   132 {
   134 {
   133     delete m_ringingtonecontroller;
   135     m_toneClient.Close();
   134 }
   136 }
   135 
   137 
   136 void PhoneUIQtViewAdapter::ExecuteCommandL (TPhoneViewCommandId aCmdId)
   138 void PhoneUIQtViewAdapter::ExecuteCommandL (TPhoneViewCommandId aCmdId)
   137 {
   139 {
       
   140     PHONE_TRACE1(aCmdId)
   138     switch (aCmdId) {
   141     switch (aCmdId) {
   139     case EPhoneAppShutDown:
   142     case EPhoneAppShutDown:
   140         {
   143         {
   141         m_view.shutdownPhoneApp();
   144         m_view.shutdownPhoneApp();
   142         }
   145         }
   145     case EPhoneViewBringPhoneAppToForeground:
   148     case EPhoneViewBringPhoneAppToForeground:
   146         bringToForeground();
   149         bringToForeground();
   147         break;
   150         break;
   148         
   151         
   149     case EPhoneViewMuteRingToneOnAnswer:
   152     case EPhoneViewMuteRingToneOnAnswer:
   150         m_ringingtonecontroller->MuteRingingToneOnAnswer();
   153         m_toneClient.StopPlayingL();
   151         break;
   154         break;
   152 
   155 
   153     case EPhoneViewStopRingTone:
   156     case EPhoneViewStopRingTone:
   154         m_ringingTonePlaying = false;
   157          m_ringingTonePlaying = false;
   155         m_ringingtonecontroller->StopPlaying();
   158          m_toneClient.StopPlayingL();
   156         break;
   159         break;
   157 
   160 
   158     case EPhoneViewMuteRingTone:
   161     case EPhoneViewMuteRingTone:
   159         m_ringingTonePlaying = false;
   162         m_ringingTonePlaying = false;
   160         m_ringingtonecontroller->MuteRingingTone();
   163          m_toneClient.StopPlayingL();
   161         break;
   164         break;
   162 
   165 
   163     case EPhoneViewHideNaviPaneAudioVolume:
   166     case EPhoneViewHideNaviPaneAudioVolume:
   164         m_view.removeVolumeSlider ();
   167         m_view.removeVolumeSlider ();
   165         break;
   168         break;
   172         removeConferenceBubble();
   175         removeConferenceBubble();
   173         break;
   176         break;
   174 
   177 
   175     case EPhoneViewSendToBackground:
   178     case EPhoneViewSendToBackground:
   176     case EPhoneViewBringIdleToForeground:
   179     case EPhoneViewBringIdleToForeground:
   177         m_visibilityHandler->sendToBackground(m_homeScreenToForeground);
   180         m_visibilityHandler->sendToBackground();
   178         m_homeScreenToForeground = false;
       
   179         break;
   181         break;
   180     case EPhoneViewRemoveAllCallHeaders:
   182     case EPhoneViewRemoveAllCallHeaders:
   181         removeAllCallHeaders();
   183         removeAllCallHeaders();
   182         break;
   184         break;
   183     case EPhoneViewRemoveNumberEntry:
   185     case EPhoneViewRemoveNumberEntry:
   207         m_noteController->removeGlobalWaitNote();
   209         m_noteController->removeGlobalWaitNote();
   208         break;
   210         break;
   209     case EPhoneViewUpdateFSW:
   211     case EPhoneViewUpdateFSW:
   210         setHidden(true);
   212         setHidden(true);
   211         break;
   213         break;
       
   214     case EPhoneViewPlayHandsFreeActivatedTone:
       
   215         playHandsFreeActivatedTone();
       
   216         break;        
   212     default:
   217     default:
   213         break;
   218         break;
   214     }
   219     }
   215  CPhoneMediatorFactory::Instance()->Sender()->SendEvent( aCmdId );
   220     CPhoneMediatorFactory::Instance()->Sender()->SendEvent( aCmdId );
   216 }
   221 }
   217 
   222 
   218 void PhoneUIQtViewAdapter::ExecuteCommandL (TPhoneViewCommandId aCmdId, TInt aCallId)
   223 void PhoneUIQtViewAdapter::ExecuteCommandL (TPhoneViewCommandId aCmdId, TInt aCallId)
   219 {
   224 {
       
   225     PHONE_TRACE1(aCmdId)
   220     switch (aCmdId) {
   226     switch (aCmdId) {
   221     case EPhoneViewRemoveCallHeader:
   227     case EPhoneViewRemoveCallHeader:
   222         {
   228         {
   223 	        m_phoneCallHeaderManager->removeCallHeader(aCallId);
   229 	        m_phoneCallHeaderManager->removeCallHeader(aCallId);
   224         
   230         
   255    CPhoneMediatorFactory::Instance()->Sender()->SendEvent( aCmdId, aCallId );
   261    CPhoneMediatorFactory::Instance()->Sender()->SendEvent( aCmdId, aCallId );
   256 }
   262 }
   257 
   263 
   258 void PhoneUIQtViewAdapter::ExecuteCommandL (TPhoneViewCommandId aCmdId, TPhoneCommandParam* aCommandParam)
   264 void PhoneUIQtViewAdapter::ExecuteCommandL (TPhoneViewCommandId aCmdId, TPhoneCommandParam* aCommandParam)
   259 {
   265 {
       
   266     PHONE_TRACE1(aCmdId)
   260     switch (aCmdId) {
   267     switch (aCmdId) {
   261     case EPhoneViewPlayRingTone:
   268     case EPhoneViewPlayRingTone:
   262         m_ringingTonePlaying = true;
   269         m_ringingTonePlaying = true;
   263         m_ringingtonecontroller->PlayRingToneL( aCommandParam );
   270         m_toneClient.PlayRingingToneL( aCommandParam );
   264         break;
   271         break;
   265     case EPhoneViewSetNaviPaneAudioVolume:
   272     case EPhoneViewSetNaviPaneAudioVolume:
   266         setAudioVolumeSliderValue (aCommandParam);
   273         setAudioVolumeSliderValue (aCommandParam);
   267         break;
   274         break;
   268     case EPhoneViewActivateMuteUIChanges:
   275     case EPhoneViewActivateMuteUIChanges:
   312 }
   319 }
   313 
   320 
   314 void PhoneUIQtViewAdapter::ExecuteCommandL (TPhoneViewCommandId aCmdId, TInt aCallId,
   321 void PhoneUIQtViewAdapter::ExecuteCommandL (TPhoneViewCommandId aCmdId, TInt aCallId,
   315     TPhoneCommandParam *aCommandParam)
   322     TPhoneCommandParam *aCommandParam)
   316 {
   323 {
       
   324     PHONE_TRACE1(aCmdId)
   317     switch (aCmdId) {
   325     switch (aCmdId) {
   318     case EPhoneViewGetCallExistsInConference:
   326     case EPhoneViewGetCallExistsInConference:
   319         conferenceCallId(aCallId, aCommandParam);
   327         conferenceCallId(aCallId, aCommandParam);
   320         break;
   328         break;
   321     case EPhoneViewUpdateCallHeaderCallDuration:
   329     case EPhoneViewUpdateCallHeaderCallDuration:
   338 }
   346 }
   339 
   347 
   340 void PhoneUIQtViewAdapter::ExecuteCommandL (TPhoneViewCommandId aCmdId, TInt aCallId,
   348 void PhoneUIQtViewAdapter::ExecuteCommandL (TPhoneViewCommandId aCmdId, TInt aCallId,
   341     TDesC &aMessage)
   349     TDesC &aMessage)
   342 {
   350 {
       
   351     PHONE_TRACE1(aCmdId)
   343     switch (aCmdId) {
   352     switch (aCmdId) {
   344 
   353 
   345     default:
   354     default:
   346         break;
   355         break;
   347     }
   356     }
   348     CPhoneMediatorFactory::Instance()->Sender()->SendEvent( aCmdId, aCallId, &aMessage );
   357     CPhoneMediatorFactory::Instance()->Sender()->SendEvent( aCmdId, aCallId, &aMessage );
   349 }
   358 }
   350 
   359 
   351 TPhoneViewResponseId PhoneUIQtViewAdapter::HandleCommandL (TPhoneViewCommandId aCmdId)
   360 TPhoneViewResponseId PhoneUIQtViewAdapter::HandleCommandL (TPhoneViewCommandId aCmdId)
   352 {
   361 {
       
   362     PHONE_TRACE1(aCmdId)
   353     TPhoneViewResponseId response = EPhoneViewResponseSuccess;
   363     TPhoneViewResponseId response = EPhoneViewResponseSuccess;
   354 
   364 
   355     switch (aCmdId) {
   365     switch (aCmdId) {
   356     case EPhoneIsDTMFDialerVisible:
   366     case EPhoneIsDTMFDialerVisible:
   357     case EPhoneIsCustomizedDialerVisible:
   367     case EPhoneIsCustomizedDialerVisible:
   374 }
   384 }
   375 
   385 
   376 TPhoneViewResponseId PhoneUIQtViewAdapter::HandleCommandL (TPhoneViewCommandId aCmdId,
   386 TPhoneViewResponseId PhoneUIQtViewAdapter::HandleCommandL (TPhoneViewCommandId aCmdId,
   377     TPhoneCommandParam *aCommandParam)
   387     TPhoneCommandParam *aCommandParam)
   378 {
   388 {
       
   389     PHONE_TRACE1(aCmdId)
   379     TPhoneViewResponseId viewResponse = EPhoneViewResponseSuccess;
   390     TPhoneViewResponseId viewResponse = EPhoneViewResponseSuccess;
   380 
   391 
   381     switch (aCmdId) {
   392     switch (aCmdId) {
   382     case EPhoneViewGetCallIdByState:
       
   383         viewResponse = callIdByState (aCommandParam);
       
   384         break;
       
   385     case EPhoneViewSelectedConfMember:
   393     case EPhoneViewSelectedConfMember:
   386         viewResponse = getSelectedConferenceMember (aCommandParam);
   394         viewResponse = getSelectedConferenceMember (aCommandParam);
   387         break;
   395         break;
   388     default:
   396     default:
   389         break;
   397         break;
   392     return viewResponse;
   400     return viewResponse;
   393 }
   401 }
   394 
   402 
   395 void PhoneUIQtViewAdapter::ExecuteCommand (TPhoneViewCommandId aCmdId)
   403 void PhoneUIQtViewAdapter::ExecuteCommand (TPhoneViewCommandId aCmdId)
   396 {
   404 {
       
   405     PHONE_TRACE1(aCmdId)
   397     switch (aCmdId) {
   406     switch (aCmdId) {
   398     case EPhoneSetConferenceExpanded:
   407     case EPhoneSetConferenceExpanded:
   399         m_bubbleWrapper->bubbleManager ().startChanges ();
   408         m_bubbleWrapper->bubbleManager ().startChanges ();
   400         m_bubbleWrapper->bubbleManager().setExpandedConferenceCallHeader(
   409         m_bubbleWrapper->bubbleManager().setExpandedConferenceCallHeader(
   401                 m_bubbleWrapper->conferenceCallList().size());
   410                 m_bubbleWrapper->conferenceCallList().size());
   408         m_bubbleWrapper->bubbleManager ().endChanges ();
   417         m_bubbleWrapper->bubbleManager ().endChanges ();
   409         break;
   418         break;
   410     case EPhoneViewOpenContacts:
   419     case EPhoneViewOpenContacts:
   411         openContacts();
   420         openContacts();
   412         break;
   421         break;
       
   422     case EPhoneViewSetVideoCallOnTop:
       
   423         m_visibilityHandler->bringVideoCallToForeground();
       
   424         break;
   413     default:
   425     default:
   414         break;
   426         break;
   415     }
   427     }
   416 }
   428 }
   417 
   429 
   418 void PhoneUIQtViewAdapter::ExecuteCommand (TPhoneViewCommandId aCmdId, TPhoneCommandParam *aCommandParam)
   430 void PhoneUIQtViewAdapter::ExecuteCommand (TPhoneViewCommandId aCmdId, TPhoneCommandParam *aCommandParam)
   419 {
   431 {
       
   432     PHONE_TRACE1(aCmdId)
   420     switch (aCmdId) {
   433     switch (aCmdId) {
   421     case EPhoneViewGetAudioVolumeLevel:
   434     case EPhoneViewGetAudioVolumeLevel:
   422         writeAudioVolumeLevel (aCommandParam);
   435         writeAudioVolumeLevel (aCommandParam);
   423         break;
   436         break;
   424     case EPhoneViewGetNumberFromEntry:
   437     case EPhoneViewGetNumberFromEntry:
   428         TPhoneCmdParamBoolean *param = static_cast<TPhoneCmdParamBoolean *>(aCommandParam);
   441         TPhoneCmdParamBoolean *param = static_cast<TPhoneCmdParamBoolean *>(aCommandParam);
   429         m_view.setBackButtonVisible(param->Boolean());
   442         m_view.setBackButtonVisible(param->Boolean());
   430 		}
   443 		}
   431         break;
   444         break;
   432     case EPhoneViewHsToForegroundAfterCall: {
   445     case EPhoneViewHsToForegroundAfterCall: {
   433         TPhoneCmdParamBoolean *param = static_cast<TPhoneCmdParamBoolean *>(aCommandParam);
   446         //TODO: remove EPhoneViewHsToForegroundAfterCall
   434         m_homeScreenToForeground = param->Boolean();
       
   435         }
   447         }
   436         break;
   448         break;
   437     case EPhoneViewSetIhfFlag: {
   449     case EPhoneViewSetIhfFlag: {
   438         TPhoneCmdParamBoolean *param = static_cast<TPhoneCmdParamBoolean *>(aCommandParam);
   450         TPhoneCmdParamBoolean *param = static_cast<TPhoneCmdParamBoolean *>(aCommandParam);
   439 
   451 
   462         TPhoneCmdParamBoolean *param = static_cast<TPhoneCmdParamBoolean *>(aCommandParam);
   474         TPhoneCmdParamBoolean *param = static_cast<TPhoneCmdParamBoolean *>(aCommandParam);
   463     
   475     
   464         PhoneResourceAdapter::Instance()->buttonsController()->
   476         PhoneResourceAdapter::Instance()->buttonsController()->
   465                 setButtonFlags(PhoneUIQtButtonsController::BluetoothAvailable, 
   477                 setButtonFlags(PhoneUIQtButtonsController::BluetoothAvailable, 
   466                                param->Boolean());
   478                                param->Boolean());
       
   479         }
       
   480         break;
       
   481     case EPhoneViewSetRingingFlag: {
       
   482         TPhoneCmdParamBoolean *param = static_cast<TPhoneCmdParamBoolean *>(aCommandParam);
       
   483         m_ringingTonePlaying = param->Boolean();
   467         }
   484         }
   468         break;
   485         break;
   469     case EPhoneViewStartCapturingKey: {
   486     case EPhoneViewStartCapturingKey: {
   470         TPhoneCmdParamKeyCapture *captureParam = 
   487         TPhoneCmdParamKeyCapture *captureParam = 
   471                 static_cast<TPhoneCmdParamKeyCapture *>(aCommandParam);        
   488                 static_cast<TPhoneCmdParamKeyCapture *>(aCommandParam);        
   507         break;
   524         break;
   508     case EPhoneViewSetTouchPaneButtons:
   525     case EPhoneViewSetTouchPaneButtons:
   509         setTouchButtons (aCommandParam);
   526         setTouchButtons (aCommandParam);
   510         setExpandActions();
   527         setExpandActions();
   511         break;
   528         break;
       
   529     case EPhoneViewGetCallIdByState:
       
   530         callIdByState(aCommandParam);
       
   531         break;
   512     default:
   532     default:
   513         break;
   533         break;
   514     }
   534     }
   515 }
   535 }
   516 
   536 
   558     m_view.captureKey(Qt::Key_Yes, false);
   578     m_view.captureKey(Qt::Key_Yes, false);
   559 }
   579 }
   560 
   580 
   561 void PhoneUIQtViewAdapter::onFocusLost()
   581 void PhoneUIQtViewAdapter::onFocusLost()
   562 {
   582 {
       
   583     m_visibilityHandler->windowVisibilityChange(false);
   563     m_indicatorController->enableActiveCallIndicator();
   584     m_indicatorController->enableActiveCallIndicator();
   564 }
   585 }
   565 
   586 
   566 void PhoneUIQtViewAdapter::onFocusGained()
   587 void PhoneUIQtViewAdapter::onFocusGained()
   567 {
   588 {
       
   589     m_visibilityHandler->windowVisibilityChange(true);
   568     m_indicatorController->disableActiveCallIndicator();
   590     m_indicatorController->disableActiveCallIndicator();
   569 }
   591 }
   570 
   592 
   571 void PhoneUIQtViewAdapter::createCallHeader(
   593 void PhoneUIQtViewAdapter::createCallHeader(
   572     int callId )
   594     int callId )
   578     }
   600     }
   579 
   601 
   580     if( m_phoneCallHeaderManager->isVoiceCall(callId) ){
   602     if( m_phoneCallHeaderManager->isVoiceCall(callId) ){
   581         m_indicatorController->setActiveCallData();
   603         m_indicatorController->setActiveCallData();
   582     }
   604     }
   583 
       
   584 }
   605 }
   585 
   606 
   586 void PhoneUIQtViewAdapter::createEmergencyCallHeader(int callId)
   607 void PhoneUIQtViewAdapter::createEmergencyCallHeader(int callId)
   587 {
   608 {
   588     m_phoneCallHeaderManager->createEmergencyCallHeader(callId);    
   609     m_phoneCallHeaderManager->createEmergencyCallHeader(callId);    
   637         int callId = bubbles.at(j);
   658         int callId = bubbles.at(j);
   638         // Clear bubble
   659         // Clear bubble
   639         m_view.clearBubbleCommands(m_bubbleWrapper->bubbles().value(callId));
   660         m_view.clearBubbleCommands(m_bubbleWrapper->bubbles().value(callId));
   640 
   661 
   641 		// Get bubble actions by call type
   662 		// Get bubble actions by call type
   642         QMap<PhoneAction::ActionType, PhoneAction *> actions =
   663         QList<HbAction *> actions =
   643             m_uiCommandController->pushButtonActionsForCall(
   664             m_uiCommandController->pushButtonActionsForCall(
   644                                m_bubbleWrapper->callStates().value(callId),
   665                                m_bubbleWrapper->callStates().value(callId),
   645                                emergencyCall,
   666                                emergencyCall,
   646                                m_bubbleWrapper->callStates(),
   667                                m_bubbleWrapper->callStates(),
   647                                m_bubbleWrapper->serviceIds(),
   668                                m_bubbleWrapper->serviceIds(),
   648                                m_bubbleWrapper->serviceIdByCallId(callId),
   669                                m_bubbleWrapper->serviceIdByCallId(callId),
   649                                callId);
   670                                callId);
   650 
   671 
   651         QList<PhoneAction *> values = actions.values();
   672         foreach (HbAction *action, actions) {
   652         for (int i = 0; i < values.size (); ++i) {
   673             m_view.addBubbleCommand(
   653             PhoneAction *action = values.at (i);
   674                     m_bubbleWrapper->bubbles().value(callId), action);
   654             m_view.addBubbleCommand(m_bubbleWrapper->bubbles().value(callId),
   675         }
   655                                     *action);
   676 
   656             delete action;
       
   657         }
       
   658     }
   677     }
   659 
   678 
   660     setExpandedConferenceCallHeader();
   679     setExpandedConferenceCallHeader();
   661     setBubbleSelectionFlag();
   680     setBubbleSelectionFlag();
   662     setMenu();
   681     setMenu();
   679         int bubbleId = m_bubbleWrapper->bubbleManager().expandedBubble();
   698         int bubbleId = m_bubbleWrapper->bubbleManager().expandedBubble();
   680         callId = m_bubbleWrapper->callIdByBubbleId(bubbleId);
   699         callId = m_bubbleWrapper->callIdByBubbleId(bubbleId);
   681         serviceId = m_bubbleWrapper->serviceIdByCallId(callId);
   700         serviceId = m_bubbleWrapper->serviceIdByCallId(callId);
   682     }
   701     }
   683     
   702     
   684     QList<PhoneAction*> actions = m_uiCommandController->toolBarActions(
   703     QList<HbAction *> actions = m_uiCommandController->toolBarActions(
   685                                         intParam.Integer(),
   704                                         intParam.Integer(),
   686                                         m_bubbleWrapper->callStates(),
   705                                         m_bubbleWrapper->callStates(),
   687                                         m_bubbleWrapper->serviceIds(),
   706                                         m_bubbleWrapper->serviceIds(),
   688                                         serviceId,
   707                                         serviceId,
   689                                         callId );
   708                                         callId );
   690     
   709     
   691     if (actions.count()) {
   710     if (actions.count()) {
   692         m_view.setToolbarActions(actions);
   711         m_view.setToolbarActions(actions);
   693     }
   712     }
   694 
   713 
   695     qDeleteAll(actions);
       
   696 }
   714 }
   697 
   715 
   698 void PhoneUIQtViewAdapter::writeAudioVolumeLevel (TPhoneCommandParam *commandParam)
   716 void PhoneUIQtViewAdapter::writeAudioVolumeLevel (TPhoneCommandParam *commandParam)
   699 {
   717 {
   700     Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdInteger);
   718     Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdInteger);
   930         static_cast<TPhoneCmdParamBoolean*>(commandParam);
   948         static_cast<TPhoneCmdParamBoolean*>(commandParam);
   931 
   949 
   932     if (booleanParam->Boolean()) {
   950     if (booleanParam->Boolean()) {
   933         m_dialpadAboutToClose = false;
   951         m_dialpadAboutToClose = false;
   934         m_view.showDialpad();
   952         m_view.showDialpad();
   935     } else {
   953     } else if (m_view.isDialpadVisible()) {
   936         m_clearDialpadOnClose = false;
   954         m_clearDialpadOnClose = false;
   937         m_view.hideDialpad();
   955         m_view.hideDialpad();
   938     }
   956     }
   939 }
   957 }
   940 
   958 
  1080     TPhoneCmdParamString* entryContent =
  1098     TPhoneCmdParamString* entryContent =
  1081             static_cast<TPhoneCmdParamString*>(commandParam);
  1099             static_cast<TPhoneCmdParamString*>(commandParam);
  1082     
  1100     
  1083     bool phoneVisible = m_visibilityHandler->phoneVisible();
  1101     bool phoneVisible = m_visibilityHandler->phoneVisible();
  1084     
  1102     
  1085     m_homeScreenToForeground = false;
  1103     m_visibilityHandler->sendToBackground();
  1086     m_visibilityHandler->sendToBackground(m_homeScreenToForeground);
       
  1087     
  1104     
  1088     if (phoneVisible) { 
  1105     if (phoneVisible) { 
  1089         // Activate logs dialer only if telephone is on the top.
  1106         // Activate logs dialer only if telephone is on the top.
  1090         m_appLauncher->launchLogs(
  1107         m_appLauncher->launchLogs(
  1091                 XQService::LogsViewAll,
  1108                 XQService::LogsViewAll,
  1123     }
  1140     }
  1124     
  1141     
  1125     return ret;
  1142     return ret;
  1126 }
  1143 }
  1127 
  1144 
  1128 
  1145 void PhoneUIQtViewAdapter::playHandsFreeActivatedTone()
       
  1146 {
       
  1147     m_toneService->playTone(
       
  1148             XQSystemToneService::IntegratedHandsFreeActivatedTone); 
       
  1149 }