phoneapp/phoneuistates/src/cphonesingleandwaiting.cpp
branchRCL_3
changeset 23 40a3f856b14d
parent 9 91c2fb4b78df
child 24 41a7f70b3818
equal deleted inserted replaced
22:94dc1107e8b2 23:40a3f856b14d
   147         case MEngineMonitor::EPEMessageConnected:
   147         case MEngineMonitor::EPEMessageConnected:
   148             HandleConnectedL( aCallId );
   148             HandleConnectedL( aCallId );
   149             break;
   149             break;
   150 
   150 
   151         case MEngineMonitor::EPEMessageDialing:
   151         case MEngineMonitor::EPEMessageDialing:
   152             HandleDiallingL( aCallId );
   152             HandleDialingL( aCallId );
   153             break;
   153             break;
   154             
   154             
   155         case MEngineMonitor::EPEMessageDisconnecting:
   155         case MEngineMonitor::EPEMessageDisconnecting:
   156             HandleDisconnectingL( aCallId );
   156             HandleDisconnectingL( aCallId );
   157             /* Flow through */
   157             /* Flow through */
   432         {
   432         {
   433         BeginUiUpdateLC();
   433         BeginUiUpdateLC();
   434 
   434 
   435         // Remove call
   435         // Remove call
   436         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   436         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   437 
       
   438         // Idle message came for waiting call
   437         // Idle message came for waiting call
   439         if ( IsNumberEntryUsedL() )
   438         if ( IsNumberEntryUsedL() )
   440             {
   439             {
   441             if ( NeedToReturnToForegroundAppL() )
   440             if ( NeedToReturnToForegroundAppL() )
   442                 {
   441                 {
   443                 // Return phone to the background if send to background is needed.
   442                 // Return phone to the background if send to background is needed.
   444                 iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
   443                 iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
   445 
       
   446                 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility );
   444                 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility );
   447 
       
   448                 UpdateCbaL( EPhoneCallHandlingInCallCBA );
   445                 UpdateCbaL( EPhoneCallHandlingInCallCBA );
   449                 }
   446                 }
   450             else
   447             else
   451                 {
   448                 {
   452                 // Show the number entry if it exists
   449                 // Show the number entry if it exists
   463                 // Return phone to the background if send to background is needed.
   460                 // Return phone to the background if send to background is needed.
   464                 iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
   461                 iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
   465                 }
   462                 }
   466             }
   463             }
   467         
   464         
       
   465         if ( IsVideoCall( iSingleCallId ) )
       
   466             {
       
   467             TPhoneCmdParamInteger uidParam;
       
   468             uidParam.SetInteger( KVtUiAppUidValue.iUid );
       
   469 
       
   470             // Set video Phone as the top application
       
   471             iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
       
   472                 &uidParam );
       
   473             }
       
   474         
   468         SetTouchPaneButtons( EPhoneIncallButtons );
   475         SetTouchPaneButtons( EPhoneIncallButtons );
   469         EndUiUpdate();
   476         EndUiUpdate();
   470 
       
   471         // CBA updates in above if-else conditions
   477         // CBA updates in above if-else conditions
   472         iStateMachine->ChangeState( EPhoneStateSingle );
   478         iStateMachine->ChangeState( EPhoneStateSingle );
   473         }
   479         }
   474 
       
   475     }
   480     }
   476 
   481 
   477 // -----------------------------------------------------------
   482 // -----------------------------------------------------------
   478 // CPhoneSingleAndWaiting::HandleHeldL
   483 // CPhoneSingleAndWaiting::HandleHeldL
   479 // -----------------------------------------------------------
   484 // -----------------------------------------------------------
   576 //
   581 //
   577 void CPhoneSingleAndWaiting::MakeStateTransitionToTwoSinglesL( TInt aCallId )
   582 void CPhoneSingleAndWaiting::MakeStateTransitionToTwoSinglesL( TInt aCallId )
   578     {
   583     {
   579     __LOGMETHODSTARTEND( EPhoneUIStates,
   584     __LOGMETHODSTARTEND( EPhoneUIStates,
   580         "CPhoneSingleAndWaiting::MakeStateTransitionToTwoSinglesL() ");
   585         "CPhoneSingleAndWaiting::MakeStateTransitionToTwoSinglesL() ");
   581 
       
   582     BeginUiUpdateLC();
   586     BeginUiUpdateLC();
   583 
       
   584     UpdateRemoteInfoDataL ( aCallId );
   587     UpdateRemoteInfoDataL ( aCallId );
   585     // Show bubble
   588     // Show bubble
   586     TPhoneCmdParamCallHeaderData callHeaderParam;
   589     TPhoneCmdParamCallHeaderData callHeaderParam;
   587     callHeaderParam.SetCallState( EPEStateConnected );
   590     callHeaderParam.SetCallState( EPEStateConnected );
   588     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId,
   591     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId,
   604         }
   607         }
   605      
   608      
   606     if ( IsNumberEntryUsedL() && NeedToReturnToForegroundAppL() )
   609     if ( IsNumberEntryUsedL() && NeedToReturnToForegroundAppL() )
   607         {
   610         {
   608         iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility );
   611         iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility );
   609 
       
   610         UpdateCbaL( EPhoneCallHandlingInCallCBA );
   612         UpdateCbaL( EPhoneCallHandlingInCallCBA );
   611         }
   613         }
   612     else
   614     else
   613         {
   615         {
   614         // Set Two singles softkeys
   616         // Set Two singles state softkeys
   615         UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA );
   617         UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA );
   616         }
   618         }
   617 
   619     
   618     SetTouchPaneButtons( EPhoneTwoSinglesButtons );
   620     SetTouchPaneButtons( EPhoneTwoSinglesButtons );
   619     EndUiUpdate();
   621     EndUiUpdate();
   620 
       
   621     // Go to two singles state
       
   622     // CBA updates in above if-else conditions
   622     // CBA updates in above if-else conditions
   623     iStateMachine->ChangeState( EPhoneStateTwoSingles );
   623     iStateMachine->ChangeState( EPhoneStateTwoSingles );
   624     }
   624     }
   625 
   625 
   626 // ---------------------------------------------------------
   626 // ---------------------------------------------------------
   647 
   647 
   648     DialVoiceCallL();
   648     DialVoiceCallL();
   649     }
   649     }
   650 
   650 
   651 // -----------------------------------------------------------
   651 // -----------------------------------------------------------
   652 // CPhoneSingleAndWaiting::HandleDiallingL
   652 // CPhoneSingleAndWaiting::HandleDialingL
   653 // -----------------------------------------------------------
   653 // -----------------------------------------------------------
   654 //
   654 //
   655 void CPhoneSingleAndWaiting::HandleDiallingL( TInt aCallId )
   655 void CPhoneSingleAndWaiting::HandleDialingL( TInt aCallId )
   656     {
   656     {
   657     __LOGMETHODSTARTEND( EPhoneUIStates,
   657     __LOGMETHODSTARTEND( EPhoneUIStates,
   658         "CPhoneSingleAndWaiting::HandleDiallingL() ");
   658         "CPhoneSingleAndWaiting::HandleDialingL() ");
   659 
       
   660     BeginUiUpdateLC();
       
   661 
       
   662     // Hide number entry if it exists
       
   663     SetNumberEntryVisibilityL(EFalse);
       
   664 
       
   665     // Display call setup
   659     // Display call setup
   666     DisplayCallSetupL( aCallId );
   660     DisplayCallSetupL( aCallId );
   667 
   661     // Go to Single And Waiting And Call Setup state
       
   662     iStateMachine->ChangeState( EPhoneStateSingleAndCallSetupAndWaiting );
       
   663     }
       
   664 
       
   665 // -----------------------------------------------------------
       
   666 // CPhoneSingleAndWaiting::DoStateSpecificCallSetUpDefinitionsL
       
   667 // -----------------------------------------------------------
       
   668 //
       
   669 EXPORT_C void CPhoneSingleAndWaiting::DoStateSpecificCallSetUpDefinitionsL()
       
   670     {
   668     // Set Hold flag to view ( DTMF menu label have to present )
   671     // Set Hold flag to view ( DTMF menu label have to present )
   669     TPhoneCmdParamBoolean holdFlag;
   672     TPhoneCmdParamBoolean holdFlag;
   670     holdFlag.SetBoolean( EFalse );
   673     holdFlag.SetBoolean( EFalse );
   671     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
   674     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
   672 
       
   673     SetTouchPaneButtons( EPhoneCallSetupButtons );
   675     SetTouchPaneButtons( EPhoneCallSetupButtons );
   674 
       
   675     EndUiUpdate();
       
   676 
       
   677     // Update call setup CBAs
       
   678     UpdateCbaL( EPhoneCallHandlingCallSetupCBA );
       
   679 
       
   680     // Go to Single And Waiting And Call Setup state
       
   681     iStateMachine->ChangeState( EPhoneStateSingleAndCallSetupAndWaiting );
       
   682     }
       
   683 
       
   684 // -----------------------------------------------------------
       
   685 // CPhoneSingleAndWaiting::DisplayCallSetupL
       
   686 // -----------------------------------------------------------
       
   687 //
       
   688 void CPhoneSingleAndWaiting::DisplayCallSetupL( TInt aCallId )
       
   689     {
       
   690     __LOGMETHODSTARTEND( EPhoneUIStates,
       
   691         "CPhoneSingleAndWaiting::DisplayCallSetupL() ");
       
   692     // Close menu bar, if it is displayed
       
   693     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
       
   694 
       
   695     // Remove dialogs if necessary
       
   696     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
       
   697 
       
   698     // Capture keys when the phone is dialling
       
   699     CaptureKeysDuringCallNotificationL( ETrue );
       
   700 
       
   701     // Force telephony to the foreground
       
   702     TPhoneCmdParamInteger uidParam;
       
   703     uidParam.SetInteger( KUidPhoneApplication.iUid );
       
   704     iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
       
   705         &uidParam );
       
   706 
       
   707     // Display call setup header
       
   708     DisplayHeaderForOutgoingCallL( aCallId );
       
   709     }
   676     }
   710 
   677 
   711 // -----------------------------------------------------------
   678 // -----------------------------------------------------------
   712 // CPhoneSingleAndWaiting::UpdateInCallCbaL
   679 // CPhoneSingleAndWaiting::UpdateInCallCbaL
   713 // -----------------------------------------------------------
   680 // -----------------------------------------------------------
   742 
   709 
   743 // -----------------------------------------------------------
   710 // -----------------------------------------------------------
   744 // CPhoneSingleAndWaiting::HandleDisconnectingL
   711 // CPhoneSingleAndWaiting::HandleDisconnectingL
   745 // -----------------------------------------------------------
   712 // -----------------------------------------------------------
   746 //
   713 //
   747 void CPhoneSingleAndWaiting::HandleDisconnectingL( TInt aCallId )
   714 void CPhoneSingleAndWaiting::HandleDisconnectingL( TInt /*aCallId*/ )
   748     {
   715     {
   749     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndWaiting::HandleDisconnectingL( ) ");
   716     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndWaiting::HandleDisconnectingL( ) ");
   750     }
   717     }
   751 
   718 
   752 // End of File
   719 // End of File