phoneapp/phoneuistates/src/cphonesingleandcallsetupandwaiting.cpp
changeset 77 2be0b271d017
parent 72 c76a0b1755b9
child 76 cfea66083b62
equal deleted inserted replaced
72:c76a0b1755b9 77:2be0b271d017
   117     {
   117     {
   118     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::HandleKeyMessageL() ");
   118     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::HandleKeyMessageL() ");
   119     switch ( aCode )
   119     switch ( aCode )
   120         {
   120         {
   121         case EKeyYes: // send-key
   121         case EKeyYes: // send-key
   122             if( IsNumberEntryVisibleL() )
   122             if( iNumberEntryManager->IsNumberEntryVisibleL() )
   123                 {
   123                 {
   124                 CPhoneState::CallFromNumberEntryL();
   124                 iNumberEntryManager->CallFromNumberEntryL();
   125                 }
   125                 }
   126             else
   126             else
   127                 {
   127                 {
   128                 // Number entry is behind waiting call bubble
   128                 // Number entry is behind waiting call bubble
   129                 // We can't answer to waiting call in this state
   129                 // We can't answer to waiting call in this state
   136         case EKeyNo: // end-key
   136         case EKeyNo: // end-key
   137             if ( aMessage == EPhoneKeyLongPress )
   137             if ( aMessage == EPhoneKeyLongPress )
   138                 {
   138                 {
   139                 iStateMachine->SendPhoneEngineMessage(
   139                 iStateMachine->SendPhoneEngineMessage(
   140                     MPEPhoneModel::EPEMessageTerminateAllConnections );
   140                     MPEPhoneModel::EPEMessageTerminateAllConnections );
   141                  
   141                 iNumberEntryManager->ClearNumberEntryContentCacheIfContentStored();
   142                 if ( IsNumberEntryContentStored() )
   142                 if ( iNumberEntryManager->IsNumberEntryUsedL() )
   143                     {
       
   144                     ClearNumberEntryContentCache();
       
   145                     }
       
   146                 
       
   147                 if ( CPhoneState::IsNumberEntryUsedL() )
       
   148                     {
   143                     {
   149                     iViewCommandHandle->ExecuteCommandL( 
   144                     iViewCommandHandle->ExecuteCommandL( 
   150                         EPhoneViewRemoveNumberEntry );
   145                         EPhoneViewRemoveNumberEntry );
   151                     // Do state-specific operation when number entry is cleared
   146                     // Do state-specific operation when number entry is cleared
   152                     HandleNumberEntryClearedL();
   147                     HandleNumberEntryClearedL();
   153                     }
       
   154                 if ( !TopAppIsDisplayedL() )
       
   155                     {
       
   156                     TPhoneCmdParamInteger uidParam;
       
   157                     uidParam.SetInteger( KUidPhoneApplication.iUid );
       
   158                     iViewCommandHandle->ExecuteCommandL(
       
   159                         EPhoneViewBringAppToForeground, &uidParam );
       
   160                     }
   148                     }
   161                 }
   149                 }
   162             else // handle short end key
   150             else // handle short end key
   163                 {
   151                 {
   164                 DisconnectOutgoingCallL();
   152                 DisconnectOutgoingCallL();
   319 // -----------------------------------------------------------
   307 // -----------------------------------------------------------
   320 //
   308 //
   321 void CPhoneSingleAndCallSetupAndWaiting::HandleConnectingL( TInt aCallId )
   309 void CPhoneSingleAndCallSetupAndWaiting::HandleConnectingL( TInt aCallId )
   322     {
   310     {
   323     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::HandleConnectingL() ");
   311     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::HandleConnectingL() ");
   324     // Remove the number entry if it isn't DTMF dialer
   312     iNumberEntryManager->RemoveNumberEntryIfVisibilityIsFalseL();
   325     if ( !IsNumberEntryVisibleL() )
       
   326         {
       
   327         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
       
   328         }
       
   329     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote );
   313     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote );
   330     
   314     
   331     TPhoneCmdParamBoolean globalNotifierParam;
   315     TPhoneCmdParamBoolean globalNotifierParam;
   332     globalNotifierParam.SetBoolean( EFalse );
   316     globalNotifierParam.SetBoolean( EFalse );
   333     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
   317     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
   334         &globalNotifierParam );
   318         &globalNotifierParam );
   335 
   319 
   336     BeginUiUpdateLC();
   320     BeginUiUpdateLC();
   337     UpdateRemoteInfoDataL( aCallId );
   321     UpdateRemoteInfoDataL( aCallId );
   338     TPhoneCmdParamCallHeaderData callHeaderParam;
       
   339     callHeaderParam.SetCallState( EPEStateConnecting );
       
   340     iViewCommandHandle->ExecuteCommandL( 
   322     iViewCommandHandle->ExecuteCommandL( 
   341             EPhoneViewUpdateBubble, 
   323             EPhoneViewUpdateBubble, 
   342             aCallId, 
   324             aCallId );
   343             &callHeaderParam );
   325 
   344     EndUiUpdate();
   326     UpdateUiCommands();
   345     UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
   327     EndUiUpdate();
   346     }
   328     }
   347 
   329 
   348 // -----------------------------------------------------------
   330 // -----------------------------------------------------------
   349 // CPhoneSingleAndCallSetupAndWaiting::HandleConnectedL
   331 // CPhoneSingleAndCallSetupAndWaiting::HandleConnectedL
   350 // -----------------------------------------------------------
   332 // -----------------------------------------------------------
   351 //
   333 //
   352 void CPhoneSingleAndCallSetupAndWaiting::HandleConnectedL( TInt aCallId )
   334 void CPhoneSingleAndCallSetupAndWaiting::HandleConnectedL( TInt aCallId )
   353     {
   335     {
   354     __LOGMETHODSTARTEND( EPhoneUIStates, 
   336     __LOGMETHODSTARTEND( EPhoneUIStates, 
   355         "CPhoneSingleAndCallSetupAndWaiting::HandleConnectedL()");
   337         "CPhoneSingleAndCallSetupAndWaiting::HandleConnectedL()");
   356     TPhoneCmdParamBoolean booleanParam;
   338     
   357     booleanParam.SetBoolean( EFalse );
   339     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId );
   358     iViewCommandHandle->ExecuteCommandL( 
   340     
   359         EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam );
   341     iNumberEntryManager->RemoveNumberEntryIfVisibilityIsFalseL();
   360     
   342 
   361     TPhoneCmdParamCallHeaderData callHeaderParam;
       
   362     callHeaderParam.SetCallState( EPEStateConnected );
       
   363     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
       
   364         &callHeaderParam );
       
   365     
       
   366     // Remove the number entry if it isn't DTMF dialer
       
   367     if ( !IsNumberEntryVisibleL() )
       
   368         {
       
   369         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
       
   370         }
       
   371     
   343     
   372     if ( aCallId != iWaitingCallId ) // Alerting call is connected
   344     if ( aCallId != iWaitingCallId ) // Alerting call is connected
   373         {
   345         {
   374         StateChangeToTwoSinglesAndWaitingL( aCallId );
   346         StateChangeToTwoSinglesAndWaitingL( aCallId );
   375         }
   347         }
   386 // -----------------------------------------------------------
   358 // -----------------------------------------------------------
   387 //
   359 //
   388 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToCallSetupAndWaitingL( TInt aCallId )
   360 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToCallSetupAndWaitingL( TInt aCallId )
   389     {
   361     {
   390     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::StateChangeToCallSetupAndWaitingL() ");
   362     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::StateChangeToCallSetupAndWaitingL() ");
   391     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   363     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );  
   392     
   364 
   393     TPhoneCmdParamBoolean holdFlag;
   365     BeginUiUpdateLC();
   394     holdFlag.SetBoolean( EFalse );
   366     
   395     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );       
   367     UpdateUiCommands();
   396 
       
   397     BeginUiUpdateLC();
       
   398     
       
   399     SetTouchPaneButtons( EPhoneCallSetupButtons );
       
   400     SetToolbarButtonLoudspeakerEnabled();
   368     SetToolbarButtonLoudspeakerEnabled();
   401     
   369     
   402     EndUiUpdate();
   370     EndUiUpdate();
   403     iStateMachine->ChangeState( EPhoneStateCallSetupAndWaiting );
   371     iStateMachine->ChangeState( EPhoneStateCallSetupAndWaiting );
   404     }
   372     }
   409 //
   377 //
   410 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndWaitingL( TInt aCallId )
   378 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndWaitingL( TInt aCallId )
   411     {
   379     {
   412     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndWaitingL() ");
   380     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndWaitingL() ");
   413     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   381     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   414     if ( CPhoneState::IsNumberEntryUsedL() )
   382     if ( iNumberEntryManager->IsNumberEntryUsedL() )
   415         {
   383         {
   416         TPhoneCmdParamBoolean booleanParam;
   384         TPhoneCmdParamBoolean booleanParam;
   417         booleanParam.SetBoolean( ETrue );
   385         booleanParam.SetBoolean( ETrue );
   418         iViewCommandHandle->ExecuteCommandL( EPhoneViewSetNumberEntryVisible, &booleanParam );
   386         iViewCommandHandle->ExecuteCommandL( EPhoneViewSetNumberEntryVisible, &booleanParam );
   419         }
   387         }
   420     
   388 
   421     TPhoneCmdParamBoolean holdFlag;
   389     BeginUiUpdateLC();
   422     holdFlag.SetBoolean( ETrue );
   390     
   423     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
   391     UpdateUiCommands();
   424 
   392     
   425     BeginUiUpdateLC();
   393     EndUiUpdate();
   426     
   394  
   427     SetTouchPaneButtons( EPhoneWaitingCallButtons );
       
   428     
       
   429     EndUiUpdate();
       
   430     UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );  
       
   431     iStateMachine->ChangeState( EPhoneStateWaitingInSingle );
   395     iStateMachine->ChangeState( EPhoneStateWaitingInSingle );
   432     }
   396     }
   433 
   397 
   434 // -----------------------------------------------------------
   398 // -----------------------------------------------------------
   435 // CPhoneSingleAndCallSetupAndWaiting:StateChangeToSingleAndAlertingL
   399 // CPhoneSingleAndCallSetupAndWaiting:StateChangeToSingleAndAlertingL
   437 //
   401 //
   438 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndAlertingL( TInt aCallId )
   402 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndAlertingL( TInt aCallId )
   439     {
   403     {
   440     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndAlertingL() ");
   404     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndAlertingL() ");
   441     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   405     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   442 
   406     iNumberEntryManager->RemoveNumberEntryIfVisibilityIsFalseL();
   443     // Remove the number entry if it isn't DTMF dialer
   407     BeginUiUpdateLC();
   444     if ( !IsNumberEntryVisibleL() )
   408     UpdateUiCommands();
   445         {
   409     EndUiUpdate();
   446         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   410 
   447         }
       
   448     
       
   449     // Set Hold flag to view EFalse that dtmf menu item not delete
       
   450     TPhoneCmdParamBoolean holdFlag;
       
   451     holdFlag.SetBoolean( EFalse );
       
   452     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
       
   453 
       
   454     BeginUiUpdateLC();
       
   455     SetTouchPaneButtons( EPhoneCallSetupButtons );
       
   456     EndUiUpdate();
       
   457     
       
   458     UpdateCbaL( EPhoneCallHandlingInCallCBA );
       
   459     iStateMachine->ChangeState( EPhoneStateAlertingInSingle );        
   411     iStateMachine->ChangeState( EPhoneStateAlertingInSingle );        
   460     }
   412     }
   461 
   413 
   462 // -----------------------------------------------------------
   414 // -----------------------------------------------------------
   463 // CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesL
   415 // CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesL
   466 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesL( TInt /*aCallId*/ )
   418 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesL( TInt /*aCallId*/ )
   467     {
   419     {
   468     __LOGMETHODSTARTEND( EPhoneUIStates, 
   420     __LOGMETHODSTARTEND( EPhoneUIStates, 
   469         "CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesL()");
   421         "CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesL()");
   470     BeginUiUpdateLC();
   422     BeginUiUpdateLC();
   471     SetTouchPaneButtons( EPhoneTwoSinglesButtons );
   423     UpdateUiCommands();
   472     EndUiUpdate();
   424     EndUiUpdate();
   473 
   425 
   474     UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA );
       
   475     iStateMachine->ChangeState( EPhoneStateTwoSingles );
   426     iStateMachine->ChangeState( EPhoneStateTwoSingles );
   476     }
   427     }
   477 
   428 
   478 // -----------------------------------------------------------
   429 // -----------------------------------------------------------
   479 // CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesAndWaitingL
   430 // CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesAndWaitingL
   482 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesAndWaitingL( TInt /*aCallId*/ )
   433 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesAndWaitingL( TInt /*aCallId*/ )
   483     {
   434     {
   484     __LOGMETHODSTARTEND( EPhoneUIStates, 
   435     __LOGMETHODSTARTEND( EPhoneUIStates, 
   485         "CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesAndWaitingL()");
   436         "CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesAndWaitingL()");
   486     BeginUiUpdateLC();
   437     BeginUiUpdateLC();
   487     SetTouchPaneButtons( EPhoneWaitingCallButtons );
   438     UpdateUiCommands();
   488     EndUiUpdate();
   439     EndUiUpdate();
   489 
   440 
   490     UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
       
   491     iStateMachine->ChangeState( EPhoneStateTwoSinglesAndWaiting );
   441     iStateMachine->ChangeState( EPhoneStateTwoSinglesAndWaiting );
   492     }
   442     }
   493 
   443 
   494 // -----------------------------------------------------------
       
   495 // CPhoneSingleAndCallSetupAndWaiting::UpdateInCallCbaL
       
   496 // -----------------------------------------------------------
       
   497 //
       
   498 void CPhoneSingleAndCallSetupAndWaiting::UpdateInCallCbaL()
       
   499     {
       
   500     __LOGMETHODSTARTEND( EPhoneUIStates, 
       
   501         "CPhoneSingleAndCallSetupAndWaiting::UpdateInCallCbaL() ");
       
   502     if ( iAlerting )
       
   503         {
       
   504         UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
       
   505         }
       
   506     else
       
   507         {
       
   508         UpdateCbaL( EPhoneCallHandlingCallSetupCBA );
       
   509         }
       
   510     }
       
   511 
   444 
   512 // End of File
   445 // End of File