phoneapp/phoneuicontrol/src/cphonestateidle.cpp
branchRCL_3
changeset 26 8baf28733c3d
parent 25 5266b1f337bd
equal deleted inserted replaced
25:5266b1f337bd 26:8baf28733c3d
   418 // -----------------------------------------------------------
   418 // -----------------------------------------------------------
   419 //
   419 //
   420 void CPhoneStateIdle::HandleIncomingL( TInt aCallId )
   420 void CPhoneStateIdle::HandleIncomingL( TInt aCallId )
   421     {
   421     {
   422     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIncomingL( ) ");
   422     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIncomingL( ) ");
   423 
       
   424     HandleAudioAvailableOutputChangedL();
   423     HandleAudioAvailableOutputChangedL();
   425     
       
   426     iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNaviPaneAudioVolume );
   424     iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNaviPaneAudioVolume );
   427 
       
   428     SetRingingTonePlaybackL( aCallId );
   425     SetRingingTonePlaybackL( aCallId );
   429     
   426     
   430     CPhonePubSubProxy::Instance()->ChangePropertyValue(
   427     CPhonePubSubProxy::Instance()->ChangePropertyValue(
   431         KPSUidScreenSaver,
   428         KPSUidScreenSaver,
   432         KScreenSaverAllowScreenSaver,
   429         KScreenSaverAllowScreenSaver,
   433         EPhoneScreensaverNotAllowed );
   430         EPhoneScreensaverNotAllowed );
   434     
   431     
   435     IsNumberEntryUsedL() ? 
   432     TransitionHandlerL().IncomingCallUiUpdateLC();
   436         BeginTransEffectLC( ECallUiAppear ) :
       
   437         BeginTransEffectLC( ENumberEntryOpen );
       
   438     BeginUiUpdateLC();
       
   439     
   433     
   440     // Hide the number entry if it exists
   434     // Hide the number entry if it exists
   441     if ( IsNumberEntryUsedL() )
   435     if ( IsNumberEntryUsedL() )
   442         {
   436         {
   443         SetNumberEntryVisibilityL(EFalse);    
   437         SetNumberEntryVisibilityL(EFalse);    
   449     // Show incoming call buttons
   443     // Show incoming call buttons
   450     SetTouchPaneButtons( EPhoneIncomingCallButtons );
   444     SetTouchPaneButtons( EPhoneIncomingCallButtons );
   451     SetTouchPaneButtonEnabled( EPhoneCallComingCmdSilent );
   445     SetTouchPaneButtonEnabled( EPhoneCallComingCmdSilent );
   452     SetTouchPaneButtonEnabled( EPhoneInCallCmdHold );
   446     SetTouchPaneButtonEnabled( EPhoneInCallCmdHold );
   453     
   447     
   454     // Display incoming call
       
   455     DisplayIncomingCallL( aCallId );
   448     DisplayIncomingCallL( aCallId );
   456 
   449     TransitionHandlerL().EndUiUpdateAndEffect();
   457     EndUiUpdate();
   450     
   458     EndTransEffect();
       
   459     
       
   460     // Go to incoming state
       
   461     iCbaManager->UpdateIncomingCbaL( aCallId );
   451     iCbaManager->UpdateIncomingCbaL( aCallId );
   462     UpdateSilenceButtonDimming();
   452     UpdateSilenceButtonDimming();
   463     UpdateIncomingContextMenuL( aCallId );
   453     UpdateIncomingContextMenuL( aCallId );
   464     //Dim toolbar items
   454     //Dim toolbar items
   465     SetToolbarDimming( ETrue );
   455     SetToolbarDimming( ETrue );
   466     //request that dimmed toolbar is visible.
   456     //request that dimmed toolbar is visible.
   467     iViewCommandHandle->HandleCommandL( EPhoneViewShowToolbar );
   457     iViewCommandHandle->HandleCommandL( EPhoneViewShowToolbar );
   468     
       
   469     ChangeTo( EPhoneStateIncoming );
   458     ChangeTo( EPhoneStateIncoming );
   470     }
   459     }
   471 
   460 
   472 // -----------------------------------------------------------
   461 // -----------------------------------------------------------
   473 // CPhoneStateIdle::HandleDialingL
   462 // CPhoneStateIdle::HandleDialingL
   498 
   487 
   499     SetToolbarDimming( ETrue );
   488     SetToolbarDimming( ETrue );
   500     SetToolbarButtonLoudspeakerEnabled();
   489     SetToolbarButtonLoudspeakerEnabled();
   501     SetToolbarButtonHandsetEnabled();
   490     SetToolbarButtonHandsetEnabled();
   502     SetToolbarButtonBTHFEnabled();
   491     SetToolbarButtonBTHFEnabled();
       
   492 
       
   493     TPhoneCmdParamInteger uidParam;
       
   494     uidParam.SetInteger( KUidPhoneApplication.iUid );
       
   495 
       
   496     // Set Phone as the top application
       
   497     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
       
   498        &uidParam );
   503     }
   499     }
   504 
   500 
   505 // -----------------------------------------------------------
   501 // -----------------------------------------------------------
   506 // CPhoneStateIdle::HandleConnectedL
   502 // CPhoneStateIdle::HandleConnectedL
   507 // Message Handling function for message EPEMessageConnected
   503 // Message Handling function for message EPEMessageConnected
   521         TPhoneCmdParamInteger uidParam;
   517         TPhoneCmdParamInteger uidParam;
   522         uidParam.SetInteger( KUidPhoneApplication.iUid );
   518         uidParam.SetInteger( KUidPhoneApplication.iUid );
   523         iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, 
   519         iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, 
   524             &uidParam );
   520             &uidParam );
   525         }
   521         }
   526     BeginTransEffectLC( ENumberEntryClose );
   522     TransitionHandlerL().BeginTransEffectLC( EPhoneTransEffectPhoneUiClose );
   527     BeginUiUpdateLC();
   523     TransitionHandlerL().BeginUiUpdateLC();
   528     
   524     
   529     // Remove the number entry
   525     // Remove the number entry
   530     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   526     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   531  
   527  
   532     // Display call setup header
   528     // Display call setup header
   537     
   533     
   538     // Update touch buttons
   534     // Update touch buttons
   539     SetTouchPaneButtons( EPhoneIncallButtons );
   535     SetTouchPaneButtons( EPhoneIncallButtons );
   540     SetToolbarDimming( EFalse );
   536     SetToolbarDimming( EFalse );
   541     
   537     
   542     EndUiUpdate();
   538     TransitionHandlerL().EndUiUpdateAndEffect();
   543     EndTransEffect();
       
   544   
   539   
   545     // Go to single state
       
   546     iCbaManager->UpdateCbaL( EPhoneCallHandlingInCallCBA );
   540     iCbaManager->UpdateCbaL( EPhoneCallHandlingInCallCBA );
   547     ChangeTo( EPhoneStateSingle );
   541     ChangeTo( EPhoneStateSingle );
   548     }
   542     }
   549 
   543 
   550 // -----------------------------------------------------------
   544 // -----------------------------------------------------------
   578         case EPhoneNumberAcqCmdVideoCall:
   572         case EPhoneNumberAcqCmdVideoCall:
   579             DialVideoCallL();
   573             DialVideoCallL();
   580             break;
   574             break;
   581             
   575             
   582         case EPhoneCmdBack:
   576         case EPhoneCmdBack:
   583             BeginTransEffectLC( ENumberEntryClose );
   577             TransitionHandlerL().BeginTransEffectLC( EPhoneTransEffectPhoneUiClose );
   584             HandleBackCommandL();
   578             HandleBackCommandL();
   585             EndTransEffect();
   579             TransitionHandlerL().EndTransEffect();
   586             break;
   580             break;
   587         
   581         
   588         case EPhoneViewOpenNumberEntry:
   582         case EPhoneViewOpenNumberEntry:
   589             BeginTransEffectLC( ENumberEntryOpen );
   583             TransitionHandlerL().BeginTransEffectLC( EPhoneTransEffectPhoneUiOpen );
   590             commandStatus = CPhoneState::HandleCommandL( aCommand );
   584             commandStatus = CPhoneState::HandleCommandL( aCommand );
   591             EndTransEffect();
   585             TransitionHandlerL().EndTransEffect();
   592             break;
   586             break;
   593             
   587             
   594         default:
   588         default:
   595             commandStatus = CPhoneState::HandleCommandL( aCommand );
   589             commandStatus = CPhoneState::HandleCommandL( aCommand );
   596             break;
   590             break;
   884 //
   878 //
   885 void CPhoneStateIdle::HandleIdleL( TInt /*aCallId*/ )
   879 void CPhoneStateIdle::HandleIdleL( TInt /*aCallId*/ )
   886     {
   880     {
   887     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIdleL()" );
   881     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIdleL()" );
   888     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveAllCallHeaders );
   882     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveAllCallHeaders );
   889     CloseClearNumberEntryAndLoadEffectL( ECallUiDisappear );
   883     CloseClearNumberEntryAndLoadEffectL( EPhoneTransEffectCallUiDisappear );
   890     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
   884     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
   891     // Reset flag.
   885     // Reset flag.
   892     SetCallInitialized( EFalse );
   886     SetCallInitialized( EFalse );
   893     }
   887     }
   894  
   888  
   930     {
   924     {
   931     __LOGMETHODSTARTEND(EPhoneControl, 
   925     __LOGMETHODSTARTEND(EPhoneControl, 
   932     "CPhoneStateIdle::RemoveNumberEntryAndSetIdleToBackgroundIfNeededL( ) ");
   926     "CPhoneStateIdle::RemoveNumberEntryAndSetIdleToBackgroundIfNeededL( ) ");
   933     if ( IsNumberEntryUsedL() )
   927     if ( IsNumberEntryUsedL() )
   934         {
   928         {
   935         BeginTransEffectLC( ECallUiAppear );
   929         TransitionHandlerL().BeginTransEffectLC( EPhoneTransEffectCallUiAppear );
   936         /*NE should be removed because if speeddial dial is interupted during
   930         /*NE should be removed because if speeddial dial is interupted during
   937         call setup phone should not return to NE/Dialler view.*/
   931         call setup phone should not return to NE/Dialler view.*/
   938         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   932         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   939         
   933         
   940         /*It might be possible that some async operation was ongoing and 
   934         /*It might be possible that some async operation was ongoing and 
   942         if ( iStateMachine->State() == this )
   936         if ( iStateMachine->State() == this )
   943             {
   937             {
   944             iCbaManager->UpdateCbaL( EPhoneEmptyCBA );
   938             iCbaManager->UpdateCbaL( EPhoneEmptyCBA );
   945             iViewCommandHandle->ExecuteCommandL( EPhoneViewSetIdleTopApplication );
   939             iViewCommandHandle->ExecuteCommandL( EPhoneViewSetIdleTopApplication );
   946             }
   940             }
   947         EndTransEffect();
   941         TransitionHandlerL().EndTransEffect();
   948         }
   942         }
   949     }
   943     }
   950 
   944 
   951 // -----------------------------------------------------------
   945 // -----------------------------------------------------------
   952 // CPhoneStateIdle::SpeedDialCanceledL
   946 // CPhoneStateIdle::SpeedDialCanceledL
  1105                 iStateMachine->SendPhoneEngineMessage(
  1099                 iStateMachine->SendPhoneEngineMessage(
  1106                         MPEPhoneModel::EPEMessageTerminateAllConnections );   
  1100                         MPEPhoneModel::EPEMessageTerminateAllConnections );   
  1107 
  1101 
  1108                 if ( IsNumberEntryUsedL() )
  1102                 if ( IsNumberEntryUsedL() )
  1109                     {
  1103                     {
  1110                     CloseClearNumberEntryAndLoadEffectL( ENumberEntryClose );
  1104                     CloseClearNumberEntryAndLoadEffectL( EPhoneTransEffectPhoneUiClose );
  1111                     // If long end key event occures then all calls are terminated and
  1105                     // If long end key event occures then all calls are terminated and
  1112                     // dialer is closed, therefore tel.icon must be removed from FSW.
  1106                     // dialer is closed, therefore tel.icon must be removed from FSW.
  1113                     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW );
  1107                     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW );
  1114                     }
  1108                     }
  1115                 if ( !TopAppIsDisplayedL() )
  1109                 if ( !TopAppIsDisplayedL() )
  1118                     DisplayIdleScreenL();
  1112                     DisplayIdleScreenL();
  1119                     }
  1113                     }
  1120                 }
  1114                 }
  1121             else if ( IsNumberEntryUsedL() && TopAppIsDisplayedL() )
  1115             else if ( IsNumberEntryUsedL() && TopAppIsDisplayedL() )
  1122                 {
  1116                 {
  1123                 CloseClearNumberEntryAndLoadEffectL( ENumberEntryClose );
  1117                 CloseClearNumberEntryAndLoadEffectL( EPhoneTransEffectPhoneUiClose );
  1124                 }
  1118                 }
  1125             else if ( !TopAppIsDisplayedL() )
  1119             else if ( !TopAppIsDisplayedL() )
  1126                 {
  1120                 {
  1127                 // Phone might not be the topmost app since it has
  1121                 // Phone might not be the topmost app since it has
  1128                 // some dialog/query open therefore we need to remove dialog/phone.
  1122                 // some dialog/query open therefore we need to remove dialog/phone.