phoneapp/phoneuistates/src/cphonesingleandcallsetupandwaiting.cpp
branchRCL_3
changeset 24 41a7f70b3818
parent 23 40a3f856b14d
child 25 5266b1f337bd
equal deleted inserted replaced
23:40a3f856b14d 24:41a7f70b3818
   120         {
   120         {
   121         // send-key
   121         // send-key
   122         case EKeyYes:
   122         case EKeyYes:
   123             if( IsNumberEntryVisibleL() )
   123             if( IsNumberEntryVisibleL() )
   124                 {
   124                 {
   125                 CPhoneState::CallFromNumberEntryL();
   125                 CPhoneState::CallFromNumberEntryL();                            
   126                 }
   126                 }
   127             else
   127             else
   128                 {
   128                 {
   129                 // Number entry is behind waiting call bubble
   129                 // Number entry is behind waiting call bubble
   130                 // We can't answer to waiting call in this state
   130                 // We can't answer to waiting call in this state
   131                 // so display Not allowed -note.
   131                 // so display Not allowed -note.                        
   132                 CPhoneState::SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed );
   132                 CPhoneState::SendGlobalErrorNoteL( 
       
   133                     EPhoneNoteTextNotAllowed, ETrue );
   133                 }
   134                 }
   134             break;
   135             break;
   135             
   136             
   136         // end-key
   137         // end-key
   137         case EKeyNo:
   138         case EKeyNo:
   146                     ClearNumberEntryContentCache();
   147                     ClearNumberEntryContentCache();
   147                     }
   148                     }
   148                 
   149                 
   149                 if ( CPhoneState::IsNumberEntryUsedL() )
   150                 if ( CPhoneState::IsNumberEntryUsedL() )
   150                     {
   151                     {
   151                     if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
   152                     // Remove number entry from screen
   152                         {
   153                     iViewCommandHandle->ExecuteCommandL( 
   153                         CloseDTMFEditorL();
   154                         EPhoneViewRemoveNumberEntry );
   154                         } 
   155                     // Do state-specific operation when number entry is cleared
   155                     else
   156                     HandleNumberEntryClearedL();
   156                         {
       
   157                         // Remove number entry from screen
       
   158                         iViewCommandHandle->ExecuteCommandL( 
       
   159                             EPhoneViewRemoveNumberEntry );
       
   160                         // Do state-specific operation when number entry is cleared
       
   161                         HandleNumberEntryClearedL();
       
   162                         }
       
   163                     }
   157                     }
   164                 if ( !TopAppIsDisplayedL() )
   158                 if ( !TopAppIsDisplayedL() )
   165                     {
   159                     {
   166                     // Bring app to foreground
   160                     // Bring app to foreground
   167                     TPhoneCmdParamInteger uidParam;
   161                     TPhoneCmdParamInteger uidParam;
   171                     }
   165                     }
   172                 }
   166                 }
   173             else
   167             else
   174                 {
   168                 {
   175                 // handle end key
   169                 // handle end key
   176                 DisconnectOutgoingCallL();
   170                 DisconnectOutgoingCallL();              
   177                 }
   171                 }
   178             break;
   172             break;
   179             
   173             
   180         default:
   174         default:
   181             // do base operation
   175             // do base operation
   194     {
   188     {
   195     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::HandlePhoneEngineMessageL() ");
   189     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::HandlePhoneEngineMessageL() ");
   196     switch ( aMessage )
   190     switch ( aMessage )
   197         {
   191         {
   198         case MEngineMonitor::EPEMessageConnecting:
   192         case MEngineMonitor::EPEMessageConnecting:
   199             {
       
   200             iAlerting = ETrue;
   193             iAlerting = ETrue;
   201             HandleConnectingL( aCallId );
   194             HandleConnectingL( aCallId );
   202             }
       
   203             break;
   195             break;
   204         
   196         
   205         case MEngineMonitor::EPEMessageConnected:
   197         case MEngineMonitor::EPEMessageConnected:
   206             {
       
   207             HandleConnectedL( aCallId );
   198             HandleConnectedL( aCallId );
   208             }
       
   209             break;
   199             break;
   210         
   200         
   211         case MEngineMonitor::EPEMessageIdle:
   201         case MEngineMonitor::EPEMessageIdle:
   212             {
       
   213             HandleIdleL( aCallId );
   202             HandleIdleL( aCallId );
   214             }
       
   215             break;
   203             break;
   216                     
   204                     
   217         case MEngineMonitor::EPEMessageRemoteBusy:
   205         case MEngineMonitor::EPEMessageRemoteBusy:
   218             {
       
   219             // If call setup failed then stop capturing keys.
   206             // If call setup failed then stop capturing keys.
   220             // Flow through to default branch.
       
   221             CaptureKeysDuringCallNotificationL( EFalse );
   207             CaptureKeysDuringCallNotificationL( EFalse );
   222             }
   208             CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
   223            
   209             break;
   224         default:
   210         default:
   225             {
       
   226             CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
   211             CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
   227             }
       
   228             break;
   212             break;
   229         }
   213         }
   230     }
   214     }
   231 
   215 
   232 
   216 
   252                 MPEPhoneModel::EPEMessageReleaseAll );
   236                 MPEPhoneModel::EPEMessageReleaseAll );
   253             break;
   237             break;
   254             
   238             
   255         case EPhoneDtmfDialerCancel:
   239         case EPhoneDtmfDialerCancel:
   256             {
   240             {
   257             CloseDTMFEditorL();
       
   258             }
   241             }
   259             break;    
   242             break;    
   260             
   243             
   261         default:
   244         default:
   262             commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand );
   245             commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand );
   263             break;
   246             break;
   264         }
   247         }
   265 
   248 
   266     return commandStatus;
   249     return commandStatus;
   267     }
       
   268 
       
   269 // -----------------------------------------------------------
       
   270 // CPhoneSingleAndCallSetupAndWaiting::HandleErrorL
       
   271 // -----------------------------------------------------------
       
   272 //
       
   273 EXPORT_C void CPhoneSingleAndCallSetupAndWaiting::HandleErrorL( 
       
   274         const TPEErrorInfo& aErrorInfo )
       
   275     {
       
   276     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::HandleErrorL()");
       
   277     
       
   278     if( aErrorInfo.iErrorCode == ECCPErrorCCUserAlertingNoAnswer )
       
   279         {
       
   280         // Should not shown "No Answer" note
       
   281         __PHONELOG1( EBasic, EPhoneUIStates,
       
   282        "PhoneUIStates: CPhoneSingleAndCallSetupAndWaiting::HandleErrorL - aErrorInfo.iErrorCode =%d ",
       
   283             aErrorInfo.iErrorCode);
       
   284         }
       
   285     else
       
   286         {
       
   287         CPhoneState::HandleErrorL( aErrorInfo );
       
   288         }
       
   289     }
       
   290 
       
   291 // -----------------------------------------------------------
       
   292 // CPhoneSingleAndCallSetupAndWaiting::OpenMenuBarL
       
   293 // -----------------------------------------------------------
       
   294 //
       
   295 void CPhoneSingleAndCallSetupAndWaiting::OpenMenuBarL()
       
   296     {
       
   297     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::OpenMenuBarL() ");
       
   298     TInt resourceId;
       
   299 
       
   300     if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
       
   301         {
       
   302         resourceId = EPhoneDtmfDialerMenubar;
       
   303         }
       
   304     else if ( IsNumberEntryVisibleL() )
       
   305         {
       
   306         resourceId = EPhoneAlertingHeldAndWaitingCallMenuBarWithNumberEntry;
       
   307         }
       
   308     else
       
   309         {
       
   310         resourceId = EPhoneAlertingHeldAndWaitingCallMenuBar;
       
   311         }
       
   312 
       
   313     TPhoneCmdParamInteger integerParam;
       
   314     integerParam.SetInteger( 
       
   315         CPhoneMainResourceResolver::Instance()->
       
   316         ResolveResourceID( resourceId ) );
       
   317     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, 
       
   318         &integerParam );
       
   319     }
   250     }
   320 
   251 
   321 // -----------------------------------------------------------
   252 // -----------------------------------------------------------
   322 // CPhoneSingleAndCallSetupAndWaiting:HandleIdleL
   253 // CPhoneSingleAndCallSetupAndWaiting:HandleIdleL
   323 // -----------------------------------------------------------
   254 // -----------------------------------------------------------
   413 void CPhoneSingleAndCallSetupAndWaiting::HandleConnectingL( TInt aCallId )
   344 void CPhoneSingleAndCallSetupAndWaiting::HandleConnectingL( TInt aCallId )
   414     {
   345     {
   415     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::HandleConnectingL() ");
   346     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::HandleConnectingL() ");
   416     
   347     
   417     // Remove the number entry if it isn't DTMF dialer
   348     // Remove the number entry if it isn't DTMF dialer
   418     if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || !IsDTMFEditorVisibleL() )
   349     if ( !iOnScreenDialer || !IsNumberEntryVisibleL() )
   419         {
   350         {
   420         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   351         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   421         }
   352         }
   422     
   353     
   423     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote );
   354     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote );
   454 //
   385 //
   455 void CPhoneSingleAndCallSetupAndWaiting::HandleConnectedL( TInt aCallId )
   386 void CPhoneSingleAndCallSetupAndWaiting::HandleConnectedL( TInt aCallId )
   456     {
   387     {
   457     __LOGMETHODSTARTEND( EPhoneUIStates, 
   388     __LOGMETHODSTARTEND( EPhoneUIStates, 
   458         "CPhoneSingleAndCallSetupAndWaiting::HandleConnectedL()");
   389         "CPhoneSingleAndCallSetupAndWaiting::HandleConnectedL()");
   459   
   390     // Keep Phone in the foreground
   460     // Close menu bar, if it is displayed
   391     TPhoneCmdParamBoolean booleanParam;
   461     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
   392     booleanParam.SetBoolean( EFalse );
       
   393     iViewCommandHandle->ExecuteCommandL( 
       
   394         EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam );
   462 
   395 
   463     // Show bubble
   396     // Show bubble
   464     TPhoneCmdParamCallHeaderData callHeaderParam;
   397     TPhoneCmdParamCallHeaderData callHeaderParam;
   465     callHeaderParam.SetCallState( EPEStateConnected );
   398     callHeaderParam.SetCallState( EPEStateConnected );
   466     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
   399     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
   469     // Capturing keys and number entry must be removed because some
   402     // Capturing keys and number entry must be removed because some
   470     // networks jump over connecting state directly to connected state.
   403     // networks jump over connecting state directly to connected state.
   471     CaptureKeysDuringCallNotificationL( EFalse );
   404     CaptureKeysDuringCallNotificationL( EFalse );
   472     
   405     
   473     // Remove the number entry if it isn't DTMF dialer
   406     // Remove the number entry if it isn't DTMF dialer
   474     if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || !IsDTMFEditorVisibleL() )
   407     if ( !iOnScreenDialer || !IsNumberEntryVisibleL() )
   475         {
   408         {
   476         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   409         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   477         }
   410         }
   478     
   411     
   479     if ( aCallId != iWaitingCallId )
   412     if ( aCallId != iWaitingCallId )
   496 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToCallSetupAndWaitingL( TInt aCallId )
   429 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToCallSetupAndWaitingL( TInt aCallId )
   497     {
   430     {
   498     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::StateChangeToCallSetupAndWaitingL() ");
   431     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::StateChangeToCallSetupAndWaitingL() ");
   499     // Remove call 
   432     // Remove call 
   500     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   433     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   501         
       
   502     // Close menu bar, if it is displayed
       
   503     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
       
   504     
   434     
   505     // Reset Hold flag to view
   435     // Reset Hold flag to view
   506     TPhoneCmdParamBoolean holdFlag;
   436     TPhoneCmdParamBoolean holdFlag;
   507     holdFlag.SetBoolean( EFalse );
   437     holdFlag.SetBoolean( EFalse );
   508     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );       
   438     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );       
   509 
   439 
   510     BeginUiUpdateLC();
   440     BeginUiUpdateLC();
   511     
   441     
   512     SetTouchPaneButtons( EPhoneCallSetupButtons );
   442     SetTouchPaneButtons( EPhoneCallSetupButtons );
   513     SetToolbarDimming( ETrue );
       
   514     SetToolbarButtonLoudspeakerEnabled();
   443     SetToolbarButtonLoudspeakerEnabled();
   515     
   444     
   516     EndUiUpdate();
   445     EndUiUpdate();
   517     
   446     
   518     // Go to Call Setup And Waiting state
   447     // Go to Call Setup And Waiting state
   537         // Show number entry
   466         // Show number entry
   538         TPhoneCmdParamBoolean booleanParam;
   467         TPhoneCmdParamBoolean booleanParam;
   539         booleanParam.SetBoolean( ETrue );
   468         booleanParam.SetBoolean( ETrue );
   540         iViewCommandHandle->ExecuteCommandL( EPhoneViewSetNumberEntryVisible, &booleanParam );
   469         iViewCommandHandle->ExecuteCommandL( EPhoneViewSetNumberEntryVisible, &booleanParam );
   541         }
   470         }
   542 
       
   543     // Close menu bar, if it is displayed
       
   544     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
       
   545     
   471     
   546         // Set Hold flag to view
   472         // Set Hold flag to view
   547     TPhoneCmdParamBoolean holdFlag;
   473     TPhoneCmdParamBoolean holdFlag;
   548     holdFlag.SetBoolean( ETrue );
   474     holdFlag.SetBoolean( ETrue );
   549     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
   475     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
   566     {
   492     {
   567     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndAlertingL() ");
   493     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndAlertingL() ");
   568     // Remove call 
   494     // Remove call 
   569     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   495     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   570 
   496 
   571     // Close menu bar, if it is displayed
       
   572     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
       
   573 
       
   574     // Remove the number entry if it isn't DTMF dialer
   497     // Remove the number entry if it isn't DTMF dialer
   575     if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || !IsDTMFEditorVisibleL() )
   498     if ( !iOnScreenDialer || !IsNumberEntryVisibleL() )
   576         {
   499         {
   577         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   500         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   578         }
   501         }
   579     
   502     
   580     // Set Hold flag to view EFalse that dtmf menu item not delete
   503     // Set Hold flag to view EFalse that dtmf menu item not delete
   585     BeginUiUpdateLC();
   508     BeginUiUpdateLC();
   586     
   509     
   587     SetTouchPaneButtons( EPhoneCallSetupButtons );
   510     SetTouchPaneButtons( EPhoneCallSetupButtons );
   588     
   511     
   589     EndUiUpdate();
   512     EndUiUpdate();
   590 	// Go to Single And Alerting state
   513     // Go to Single And Alerting state
   591 	UpdateCbaL( EPhoneCallHandlingInCallCBA );
   514     UpdateCbaL( EPhoneCallHandlingInCallCBA );
   592     iStateMachine->ChangeState( EPhoneStateAlertingInSingle );        
   515     iStateMachine->ChangeState( EPhoneStateAlertingInSingle );        
   593     }
   516     }
   594 
   517 
   595 // -----------------------------------------------------------
   518 // -----------------------------------------------------------
   596 // CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesL
   519 // CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesL
   597 // -----------------------------------------------------------
   520 // -----------------------------------------------------------
   598 //
   521 //
   599 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesL( TInt /*aCallId*/ )
   522 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesL( TInt /*aCallId*/ )
   600     {
   523     {
   601     __LOGMETHODSTARTEND( EPhoneUIStates, 
   524     __LOGMETHODSTARTEND( EPhoneUIStates, 
   602 	    "CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesL()");
   525         "CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesL()");
   603 
   526 
   604     BeginUiUpdateLC();
   527     BeginUiUpdateLC();
   605     
   528     
   606     SetTouchPaneButtonEnabled( EPhoneCallComingCmdAnswer );
       
   607     SetTouchPaneButtons( EPhoneTwoSinglesButtons );
   529     SetTouchPaneButtons( EPhoneTwoSinglesButtons );
   608     
   530     
   609     EndUiUpdate();
   531     EndUiUpdate();
   610 
   532 
   611     // Go to two singles state 
   533     // Go to two singles state 
   618 // -----------------------------------------------------------
   540 // -----------------------------------------------------------
   619 //
   541 //
   620 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesAndWaitingL( TInt /*aCallId*/ )
   542 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesAndWaitingL( TInt /*aCallId*/ )
   621     {
   543     {
   622     __LOGMETHODSTARTEND( EPhoneUIStates, 
   544     __LOGMETHODSTARTEND( EPhoneUIStates, 
   623 	    "CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesAndWaitingL()");
   545         "CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesAndWaitingL()");
   624 
   546 
   625     BeginUiUpdateLC();
   547     BeginUiUpdateLC();
   626     
   548     
   627     SetTouchPaneButtons( EPhoneWaitingCallButtons );
   549     SetTouchPaneButtons( EPhoneWaitingCallButtons );
   628     SetTouchPaneButtonDisabled( EPhoneCallComingCmdAnswer );
       
   629     
   550     
   630     EndUiUpdate();
   551     EndUiUpdate();
   631 
   552 
   632     // Go to two singles state and waiting
   553     // Go to two singles state and waiting
   633     UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
   554     UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );