phoneapp/phoneuicontrol/src/cphonestateincall.cpp
branchRCL_3
changeset 58 40a3f856b14d
parent 39 b8d67d6176f5
child 61 41a7f70b3818
equal deleted inserted replaced
57:94dc1107e8b2 58:40a3f856b14d
   304 EXPORT_C void CPhoneStateInCall::HandleIdleL( TInt aCallId )
   304 EXPORT_C void CPhoneStateInCall::HandleIdleL( TInt aCallId )
   305     {
   305     {
   306     __LOGMETHODSTARTEND(EPhoneControl,  
   306     __LOGMETHODSTARTEND(EPhoneControl,  
   307         "CPhoneStateInCall::HandleIdleL()" );
   307         "CPhoneStateInCall::HandleIdleL()" );
   308     __ASSERT_DEBUG( aCallId >= 0, Panic( EPhoneCtrlParameterNotInitialized ) );
   308     __ASSERT_DEBUG( aCallId >= 0, Panic( EPhoneCtrlParameterNotInitialized ) );
   309     // Remove call 
       
   310     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   309     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   311   
   310     iViewCommandHandle->ExecuteCommandL( EPhoneViewHideToolbar );
       
   311     if (  IsNumberEntryUsedL() )
       
   312         {
       
   313         BeginTransEffectLC( ECallUiDisappear );
       
   314         }
       
   315     else 
       
   316         {
       
   317         BeginTransEffectLC( ENumberEntryClose );
       
   318         }
   312     BeginUiUpdateLC();
   319     BeginUiUpdateLC();
   313     SetDefaultFlagsL();
   320     SetDefaultFlagsL();
       
   321         
   314     if ( IsNumberEntryUsedL() )
   322     if ( IsNumberEntryUsedL() )
   315         {
   323         {
   316         if ( NeedToReturnToForegroundAppL() )
   324         // Show the number entry if it exists and update cba's.
   317             {
   325         SetNumberEntryVisibilityL( ETrue );
   318             // Return phone to the background if menu application is needed to foreground.
   326         // Close dtmf dialer when call is disconnected.
   319             iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
   327         if ( IsDTMFEditorVisibleL() )
   320     
   328             {      
   321             iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility );
   329             CloseDTMFEditorL();
   322     
   330             // Display idle screen and update CBA's
   323             // Set Number Entry CBA
   331             DisplayIdleScreenL();
   324             iCbaManager->SetCbaL( EPhoneNumberAcqCBA );
   332             }
   325             }
   333         else if ( iOnScreenDialer && IsCustomizedDialerVisibleL() )
   326         else
   334             {            
   327             {
   335             CloseCustomizedDialerL();
   328             // Show the number entry if it exists and update cba's.
   336             // Display idle screen and update CBA's
   329             SetNumberEntryVisibilityL( ETrue );
   337             DisplayIdleScreenL();
   330             
   338             } 
   331             // Close dtmf dialer when call is disconnected.
   339         }            
   332             if ( IsDTMFEditorVisibleL() )
       
   333                 {      
       
   334                 CloseDTMFEditorL();
       
   335                 
       
   336                 // Display idle screen and update CBA's
       
   337                 DisplayIdleScreenL();
       
   338                 }
       
   339             else if ( iOnScreenDialer && IsCustomizedDialerVisibleL() )
       
   340                 {            
       
   341                 CloseCustomizedDialerL();
       
   342                 // Display idle screen and update CBA's
       
   343                 DisplayIdleScreenL();
       
   344                 } 
       
   345             }
       
   346         }
       
   347     else
   340     else
   348         {
   341         {
   349         // Close menu bar, if it is displayed
       
   350         iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
   342         iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
   351         
       
   352         if ( !TopAppIsDisplayedL() || IsAutoLockOn() || NeedToReturnToForegroundAppL() )
   343         if ( !TopAppIsDisplayedL() || IsAutoLockOn() || NeedToReturnToForegroundAppL() )
   353             {        
   344             {        
   354             // Continue displaying current app but set up the 
   345             // Continue displaying current app but set up the 
   355             // idle screen in the background
   346             // idle screen in the background
   356             SetupIdleScreenInBackgroundL();
   347             SetupIdleScreenInBackgroundL();
   360             // Display idle screen and update CBAs
   351             // Display idle screen and update CBAs
   361             DisplayIdleScreenL();
   352             DisplayIdleScreenL();
   362             }
   353             }
   363         }
   354         }
   364         
   355         
   365     DeleteTouchPaneButtons();        
   356     DeleteTouchPaneButtons();
   366     EndUiUpdate();
   357     EndUiUpdate();
   367     
   358     EndTransEffect();
   368     // Display call termination note, if necessary
       
   369     DisplayCallTerminationNoteL();
   359     DisplayCallTerminationNoteL();
   370 
       
   371     // Go to idle state
       
   372     iStateMachine->ChangeState( EPhoneStateIdle );
   360     iStateMachine->ChangeState( EPhoneStateIdle );
   373 
       
   374     //Make sure that toolbar is not shown
       
   375     iViewCommandHandle->ExecuteCommandL( EPhoneViewHideToolbar );
   361     iViewCommandHandle->ExecuteCommandL( EPhoneViewHideToolbar );
   376     }
   362     }
   377 
   363 
   378 // -----------------------------------------------------------
   364 // -----------------------------------------------------------
   379 // CPhoneStateInCall::UpdateInCallCbaL
   365 // CPhoneStateInCall::UpdateInCallCbaL
   421     if ( !IsNumberEntryUsedL() )
   407     if ( !IsNumberEntryUsedL() )
   422         {
   408         {
   423         // Go to current state implementation
   409         // Go to current state implementation
   424         UpdateInCallCbaL();
   410         UpdateInCallCbaL();
   425         }
   411         }
       
   412 	TBool audioMute = iStateMachine->PhoneEngineInfo()->AudioMute();
       
   413     TPhoneCmdParamCallStateData callStateData;
       
   414     callStateData.SetCallState( EPEStateConnected );
       
   415     iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState, &callStateData );
       
   416     TInt call = callStateData.CallId();
       
   417     if ( call != KErrNotFound  && iStateMachine->PhoneEngineInfo()->CallType( call ) == EPECallTypeVoIP
       
   418             && audioMute )
       
   419 		{
       
   420 			  TPhoneCmdParamBoolean dtmfSendFlag;
       
   421 			  dtmfSendFlag.SetBoolean( ETrue );
       
   422 			  iViewCommandHandle->ExecuteCommandL( EPhoneViewSetVoipCallDTMFVisibilityFlag,
       
   423 																							   &dtmfSendFlag );
       
   424 		}
       
   425     else
       
   426 		{           
       
   427 		 TPhoneCmdParamBoolean dtmfSendFlag;
       
   428 		  dtmfSendFlag.SetBoolean( EFalse );
       
   429 		  iViewCommandHandle->ExecuteCommandL( EPhoneViewSetVoipCallDTMFVisibilityFlag,
       
   430 																						   &dtmfSendFlag );
       
   431 		} 
   426     }
   432     }
   427 
   433 
   428 // -----------------------------------------------------------
   434 // -----------------------------------------------------------
   429 // CPhoneStateInCall::HandleAudioOutputChangedL
   435 // CPhoneStateInCall::HandleAudioOutputChangedL
   430 // -----------------------------------------------------------
   436 // -----------------------------------------------------------
   603     TBool commandStatus = ETrue;
   609     TBool commandStatus = ETrue;
   604 
   610 
   605     switch( aCommand )
   611     switch( aCommand )
   606         {
   612         {
   607         case EPhoneInCallCmdDialer:
   613         case EPhoneInCallCmdDialer:
       
   614             BeginTransEffectLC( ECallUiDisappear );
   608             if ( !IsNumberEntryUsedL() )
   615             if ( !IsNumberEntryUsedL() )
   609                 {
   616                 {
   610                 CreateNumberEntryL();
   617                 CreateNumberEntryL();
   611                 }
   618                 }
   612             SetNumberEntryVisibilityL(ETrue ); 
   619             SetNumberEntryVisibilityL( ETrue ); 
       
   620             EndTransEffect();
   613           break;
   621           break;
   614           
   622           
   615         case EPhoneCmdOptions:
   623         case EPhoneCmdOptions:
   616             OpenMenuBarL();
   624             OpenMenuBarL();
   617             break;
   625             break;
   841             break;
   849             break;
   842 
   850 
   843        case EPhoneViewOpenCallHandling:
   851        case EPhoneViewOpenCallHandling:
   844             if ( iOnScreenDialer && IsNumberEntryUsedL() )
   852             if ( iOnScreenDialer && IsNumberEntryUsedL() )
   845                 {
   853                 {
       
   854                 BeginTransEffectLC( ECallUiAppear );
   846                 // Remove number entry from screen
   855                 // Remove number entry from screen
   847                 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   856                 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
       
   857                 EndTransEffect();
   848                 HandleNumberEntryClearedL();
   858                 HandleNumberEntryClearedL();
   849                 }
   859                 }
   850             commandStatus = CPhoneState::HandleCommandL( aCommand );        
   860             commandStatus = CPhoneState::HandleCommandL( aCommand );        
   851             break;
   861             break;
   852  
   862  
   917         "CPhoneStateInCall::LaunchNewCallQueryL()" );
   927         "CPhoneStateInCall::LaunchNewCallQueryL()" );
   918     
   928     
   919     if ( iOnScreenDialer )
   929     if ( iOnScreenDialer )
   920         {
   930         {
   921         //In touch, just activate dialer
   931         //In touch, just activate dialer
       
   932         BeginTransEffectLC( ECallUiDisappear );
   922         if ( IsNumberEntryUsedL() )
   933         if ( IsNumberEntryUsedL() )
   923             {
   934             {
   924             SetNumberEntryVisibilityL(ETrue);   
   935             SetNumberEntryVisibilityL(ETrue);   
   925             }
   936             }
   926         else
   937         else
   927             {
   938             {
   928             CreateNumberEntryL();
   939             CreateNumberEntryL();
   929             SetNumberEntryVisibilityL(ETrue); 
   940             SetNumberEntryVisibilityL(ETrue); 
   930             }
   941             }
       
   942         EndTransEffect();
   931         }
   943         }
   932     else
   944     else
   933         {
   945         {
   934         HBufC *text = HBufC::NewLC( KPhoneNumberEntryBufferSize );
   946         HBufC *text = HBufC::NewLC( KPhoneNumberEntryBufferSize );
   935         TPtr ptr( text->Des() );
   947         TPtr ptr( text->Des() );
  1543             if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
  1555             if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
  1544                 {
  1556                 {
  1545                 CloseDTMFEditorL();
  1557                 CloseDTMFEditorL();
  1546                 }
  1558                 }
  1547             else
  1559             else
  1548                 {
  1560                 {    
  1549                 // Remove number entry from screen
  1561                 CloseClearNumberEntryAndLoadEffectL( ENumberEntryClose );
  1550                 iViewCommandHandle->ExecuteCommandL( 
       
  1551                     EPhoneViewRemoveNumberEntry );
       
  1552                 // Do state-specific operation when number entry is cleared
       
  1553                 HandleNumberEntryClearedL();         
       
  1554                 }
  1562                 }
  1555             }
  1563             }
  1556 
  1564 
  1557         if ( !TopAppIsDisplayedL() )
  1565         if ( !TopAppIsDisplayedL() )
  1558             {
  1566             {