phoneapp/phoneuicontrol/src/cphonestate.cpp
branchRCL_3
changeset 23 40a3f856b14d
parent 20 3c221667e687
child 24 41a7f70b3818
equal deleted inserted replaced
22:94dc1107e8b2 23:40a3f856b14d
   115     MPhoneStateMachine* aStateMachine,
   115     MPhoneStateMachine* aStateMachine,
   116     MPhoneViewCommandHandle* aViewCommandHandle,
   116     MPhoneViewCommandHandle* aViewCommandHandle,
   117     MPhoneCustomization* aCustomization) :
   117     MPhoneCustomization* aCustomization) :
   118     iStateMachine( aStateMachine ),
   118     iStateMachine( aStateMachine ),
   119     iViewCommandHandle( aViewCommandHandle ),
   119     iViewCommandHandle( aViewCommandHandle ),
   120     iCustomization( aCustomization ),
   120     iCustomization( aCustomization )
   121     iEnv( *CEikonEnv::Static() )
       
   122     {
   121     {
   123     // Need to get current SimState for inherited classis
   122     // Need to get current SimState for inherited classis
   124     iPreviousSimState = SimState();
   123     iPreviousSimState = SimState();
   125     __ASSERT_ALWAYS(
   124     __ASSERT_ALWAYS(
   126         aStateMachine && aViewCommandHandle,
   125         aStateMachine && aViewCommandHandle,
   376             // Message should be only handled by CPhoneStateIdle, 
   375             // Message should be only handled by CPhoneStateIdle, 
   377             // if state is something else than idle then do nothing.
   376             // if state is something else than idle then do nothing.
   378             break;
   377             break;
   379 
   378 
   380         default:
   379         default:
   381 
       
   382             TBool handled( EFalse );
   380             TBool handled( EFalse );
   383 
       
   384             handled = ForwardPEMessageToPhoneCustomizationL( aMessage, aCallId );
   381             handled = ForwardPEMessageToPhoneCustomizationL( aMessage, aCallId );
   385 
       
   386             if ( EFalse == handled )
   382             if ( EFalse == handled )
   387                 {
   383                 {
   388             	MPhoneMediatorMessage* mediatorMessage = CPhoneMediatorFactory::Instance()->MediatorMessage( aMessage, aCallId );
   384                 MPhoneMediatorMessage* mediatorMessage = CPhoneMediatorFactory::Instance()->MediatorMessage( aMessage, aCallId );
   389             	if( mediatorMessage )
   385                 if( mediatorMessage )
   390     	        	{
   386                     {
   391     	        	CleanupDeletePushL( mediatorMessage );
   387                     CleanupDeletePushL( mediatorMessage );
   392 	        		mediatorMessage->ExecuteL();
   388                     mediatorMessage->ExecuteL();
   393 	        		CleanupStack::PopAndDestroy( mediatorMessage );
   389                     CleanupStack::PopAndDestroy( mediatorMessage );
   394 	        		mediatorMessage = NULL;
   390                     mediatorMessage = NULL;
   395     	        	}
   391                     }
   396                 }
   392                 }
   397             break;
   393             break;
   398         }
   394         }
   399     }
   395     }
   400 
   396 
   473         CPhoneBtaaDisconnectHandler::InstanceL()->Cancel();
   469         CPhoneBtaaDisconnectHandler::InstanceL()->Cancel();
   474         }
   470         }
   475     else if ( RouteParameters.iShowNote && audioOutput == EPELoudspeaker )
   471     else if ( RouteParameters.iShowNote && audioOutput == EPELoudspeaker )
   476         {
   472         {
   477         CAknKeySoundSystem* keySounds =
   473         CAknKeySoundSystem* keySounds =
   478                static_cast<CAknAppUi*>( iEnv.EikAppUi() )->KeySounds();
   474                static_cast<CAknAppUi*>( EikonEnv()->EikAppUi() )->KeySounds();
   479         keySounds->PlaySound( EAvkonSIDIHFActive );
   475         keySounds->PlaySound( EAvkonSIDIHFActive );
   480         }
   476         }
   481     }
   477     }
   482 
   478 
   483 // -----------------------------------------------------------
   479 // -----------------------------------------------------------
  1163         EPhoneViewGetEasyDialingInFocusStatus ) ==
  1159         EPhoneViewGetEasyDialingInFocusStatus ) ==
  1164         EPhoneViewResponseSuccess;
  1160         EPhoneViewResponseSuccess;
  1165     }
  1161     }
  1166 
  1162 
  1167 // -----------------------------------------------------------
  1163 // -----------------------------------------------------------
       
  1164 // CPhoneState::EikonEnv
       
  1165 // -----------------------------------------------------------
       
  1166 //
       
  1167 EXPORT_C CEikonEnv* CPhoneState::EikonEnv() const
       
  1168     {
       
  1169     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::EikonEnv( ) ");
       
  1170     return iEnv;
       
  1171     }
       
  1172 
       
  1173 // -----------------------------------------------------------
       
  1174 // CPhoneState::SetEikonEnv
       
  1175 // -----------------------------------------------------------
       
  1176 //
       
  1177 EXPORT_C void CPhoneState::SetEikonEnv( CEikonEnv* aEnv )
       
  1178     {
       
  1179     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetEikonEnv( ) ");
       
  1180     iEnv = aEnv;
       
  1181     }
       
  1182 
       
  1183 // -----------------------------------------------------------
  1168 // CPhoneState::SendKeyEventL
  1184 // CPhoneState::SendKeyEventL
  1169 // -----------------------------------------------------------
  1185 // -----------------------------------------------------------
  1170 //
  1186 //
  1171 void CPhoneState::SendKeyEventL(
  1187 void CPhoneState::SendKeyEventL(
  1172     const TKeyEvent& aKeyEvent,
  1188     const TKeyEvent& aKeyEvent,
  1551         {
  1567         {
  1552         case EPhoneEmergencyCmdExit:
  1568         case EPhoneEmergencyCmdExit:
  1553             // this should be bypasses?
  1569             // this should be bypasses?
  1554         case EPhoneDialerCallHandling:
  1570         case EPhoneDialerCallHandling:
  1555         case EPhoneCmdBack:
  1571         case EPhoneCmdBack:
  1556             // Remove number entry from screen
  1572             CloseClearNumberEntryAndLoadEffectL( ECallUiAppear );
  1557             iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
       
  1558             // Do state-specific behaviour if number entry is cleared
       
  1559             HandleNumberEntryClearedL();
       
  1560             break;
  1573             break;
  1561 
  1574 
  1562         case EPhoneDialerCmdTouchInput:
  1575         case EPhoneDialerCmdTouchInput:
  1563             OpenVkbL();
  1576             OpenVkbL();
  1564             break;
  1577             break;
  1904             MPEPhoneModel::EPEMessageSetAudioVolume );
  1917             MPEPhoneModel::EPEMessageSetAudioVolume );
  1905         }
  1918         }
  1906     else
  1919     else
  1907         {
  1920         {
  1908         CAknKeySoundSystem* keySounds =
  1921         CAknKeySoundSystem* keySounds =
  1909             static_cast<CAknAppUi*>( iEnv.EikAppUi() )
  1922             static_cast<CAknAppUi*>( EikonEnv()->EikAppUi() )
  1910                 ->KeySounds();
  1923                 ->KeySounds();
  1911 
  1924 
  1912         if ( aLevel < KPhoneVolumeMinValue )
  1925         if ( aLevel < KPhoneVolumeMinValue )
  1913             {
  1926             {
  1914             // Set the volume value to volume control
  1927             // Set the volume value to volume control
  1958 EXPORT_C void CPhoneState::DialVoiceCallL()
  1971 EXPORT_C void CPhoneState::DialVoiceCallL()
  1959     {
  1972     {
  1960     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DialVoiceCallL() ");
  1973     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DialVoiceCallL() ");
  1961     __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
  1974     __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
  1962         Panic( EPhoneCtrlInvariant ) );
  1975         Panic( EPhoneCtrlInvariant ) );
  1963 
       
  1964     // Disable global notes
  1976     // Disable global notes
  1965     TPhoneCmdParamBoolean globalNotifierParam;
  1977     TPhoneCmdParamBoolean globalNotifierParam;
  1966     globalNotifierParam.SetBoolean( ETrue );
  1978     globalNotifierParam.SetBoolean( ETrue );
  1967     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
  1979     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
  1968             &globalNotifierParam );
  1980             &globalNotifierParam );
  1969    iStateMachine->PhoneEngineInfo()->SetCallTypeCommand( EPECallTypeCSVoice );
  1981     iStateMachine->PhoneEngineInfo()->SetCallTypeCommand( EPECallTypeCSVoice );
  1970     iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageDial );
  1982     iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageDial );
  1971     }
  1983     }
  1972 
  1984 
  1973 // -----------------------------------------------------------
  1985 // -----------------------------------------------------------
  1974 // CPhoneState::DisconnectCallL
  1986 // CPhoneState::DisconnectCallL
  2074     {
  2086     {
  2075     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetupIdleScreenInBackgroundL( ) ");
  2087     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetupIdleScreenInBackgroundL( ) ");
  2076     // Don't remove reconnect query if it's shown
  2088     // Don't remove reconnect query if it's shown
  2077     if( !CPhoneReconnectQuery::InstanceL()->IsDisplayingQuery() )
  2089     if( !CPhoneReconnectQuery::InstanceL()->IsDisplayingQuery() )
  2078         {
  2090         {
  2079         // Remove dialogs if necessary
       
  2080         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
  2091         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
  2081         }
  2092         }
  2082     // Return phone to the background
  2093     // Return phone to the background
  2083     iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
  2094     iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
  2084 
  2095     // Set Idle app as the top app to PS key this way we know if need to 
  2085     // Set Idle app as the top app
  2096     // bring idle to fore in next phone acitvation event.
  2086     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetIdleTopApplication );
  2097     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetIdleTopApplication );
  2087 
       
  2088 	// Go to Homescreen when application, which was open when answered incoming call,
       
  2089 	// is closed during active call    
       
  2090     if( TopAppIsDisplayedL() )
       
  2091         {
       
  2092         DisplayIdleScreenL();
       
  2093         }
       
  2094 
       
  2095     // Set Empty CBA
       
  2096     iCbaManager->SetCbaL( EPhoneEmptyCBA );
  2098     iCbaManager->SetCbaL( EPhoneEmptyCBA );
  2097     }
  2099     }
  2098 
  2100 
  2099 // ---------------------------------------------------------
  2101 // ---------------------------------------------------------
  2100 // CPhoneState::CallFromNumberEntryL
  2102 // CPhoneState::CallFromNumberEntryL
  2154         
  2156         
  2155         // Call the number
  2157         // Call the number
  2156         iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber );
  2158         iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber );
  2157     
  2159     
  2158         if ( phoneNumber->Des().Length() < KPhoneValidPhoneNumberLength )
  2160         if ( phoneNumber->Des().Length() < KPhoneValidPhoneNumberLength )
  2159             {        
  2161             {
  2160             iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
  2162             CloseClearNumberEntryAndLoadEffectL( ECallUiAppear );
  2161             HandleNumberEntryClearedL();
       
  2162             }
  2163             }
  2163     
  2164     
  2164         CleanupStack::PopAndDestroy( phoneNumber );        
  2165         CleanupStack::PopAndDestroy( phoneNumber );        
  2165     
  2166     
  2166         if ( !iCustomization || 
  2167         if ( !iCustomization || 
  2208     {
  2209     {
  2209     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisplayHeaderForOutgoingCallL( ) ");
  2210     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisplayHeaderForOutgoingCallL( ) ");
  2210     CallheaderManagerL()->DisplayHeaderForOutgoingCallL(aCallId);
  2211     CallheaderManagerL()->DisplayHeaderForOutgoingCallL(aCallId);
  2211     }
  2212     }
  2212 
  2213 
  2213 
       
  2214 // -----------------------------------------------------------
       
  2215 // CPhoneState::DisplayHeaderForInitializingCallL
       
  2216 // -----------------------------------------------------------
       
  2217 //
       
  2218 EXPORT_C void CPhoneState::DisplayHeaderForInitializingCallL( TInt aCallId )
       
  2219     {
       
  2220     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisplayHeaderForInitializingCallL( ) ");
       
  2221     CallheaderManagerL()->DisplayHeaderForInitializingCallL( aCallId );
       
  2222     }
       
  2223 	
       
  2224 // -----------------------------------------------------------
  2214 // -----------------------------------------------------------
  2225 // CPhoneState::UpdateSingleActiveCallL
  2215 // CPhoneState::UpdateSingleActiveCallL
  2226 // -----------------------------------------------------------
  2216 // -----------------------------------------------------------
  2227 //
  2217 //
  2228 EXPORT_C void CPhoneState::UpdateSingleActiveCallL( TInt aCallId )
  2218 EXPORT_C void CPhoneState::UpdateSingleActiveCallL( TInt aCallId )
  2229     {
  2219     {
  2230     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateSingleActiveCallL( ) ");
  2220     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateSingleActiveCallL( ) ");
  2231 
       
  2232     // Stop capturing keys
  2221     // Stop capturing keys
  2233     CaptureKeysDuringCallNotificationL( EFalse );
  2222     CaptureKeysDuringCallNotificationL( EFalse );
  2234 
       
  2235     BeginUiUpdateLC();
  2223     BeginUiUpdateLC();
  2236 
  2224 
  2237     SetTouchPaneButtonEnabled( EPhoneInCallCmdHold );
  2225     SetTouchPaneButtonEnabled( EPhoneInCallCmdHold );
  2238 
  2226 
  2239     // Update call state
  2227     // Update call state
  3383         }
  3371         }
  3384     else
  3372     else
  3385         {
  3373         {
  3386         return EFalse;
  3374         return EFalse;
  3387         }
  3375         }
  3388     }
       
  3389 
       
  3390 // ---------------------------------------------------------
       
  3391 // CPhoneState::SetDivertIndication
       
  3392 // ---------------------------------------------------------
       
  3393 //
       
  3394 EXPORT_C void CPhoneState::SetDivertIndication( const TBool aDivertIndication )
       
  3395     {
       
  3396     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::SetDivertIndication()");
       
  3397     TRAP_IGNORE( CallheaderManagerL()->SetDivertIndication( aDivertIndication ) );
       
  3398     }
  3376     }
  3399 
  3377 
  3400 // ---------------------------------------------------------
  3378 // ---------------------------------------------------------
  3401 // CPhoneState::StartAlsLineChangeTimerL
  3379 // CPhoneState::StartAlsLineChangeTimerL
  3402 // ---------------------------------------------------------
  3380 // ---------------------------------------------------------
  3770         // Display Video Share button instead of Hold Button if
  3748         // Display Video Share button instead of Hold Button if
  3771         // the feature is enabled and video sharing is currently available.
  3749         // the feature is enabled and video sharing is currently available.
  3772         if ( aResourceId == EPhoneIncallButtons &&
  3750         if ( aResourceId == EPhoneIncallButtons &&
  3773              FeatureManager::FeatureSupported( KFeatureIdFfEntryPointForVideoShare ) &&
  3751              FeatureManager::FeatureSupported( KFeatureIdFfEntryPointForVideoShare ) &&
  3774              CPhonePubSubProxy::Instance()->Value
  3752              CPhonePubSubProxy::Instance()->Value
  3775                 ( KPSUidCoreApplicationUIs, KCoreAppUIsVideoSharingIndicator ) )
  3753                 ( KPSUidCoreApplicationUIs, KCoreAppUIsVideoSharingIndicator )
       
  3754                 == ECoreAppUIsVideoSharingIndicatorOn )
  3776             {
  3755             {
  3777             aResourceId = EPhoneIncallVideoShareButtons;
  3756             aResourceId = EPhoneIncallVideoShareButtons;
  3778             }
  3757             }
  3779         TPhoneCmdParamInteger integerParam;
  3758         TPhoneCmdParamInteger integerParam;
  3780         integerParam.SetInteger( CPhoneMainResourceResolver::Instance()->
  3759         integerParam.SetInteger( CPhoneMainResourceResolver::Instance()->
  3888 // CPhoneState::BeginUiUpdateLC
  3867 // CPhoneState::BeginUiUpdateLC
  3889 // -----------------------------------------------------------
  3868 // -----------------------------------------------------------
  3890 //
  3869 //
  3891 EXPORT_C void CPhoneState::BeginUiUpdateLC()
  3870 EXPORT_C void CPhoneState::BeginUiUpdateLC()
  3892     {
  3871     {
  3893 
       
  3894     iViewCommandHandle->ExecuteCommand( EPhoneViewBeginUpdate );
  3872     iViewCommandHandle->ExecuteCommand( EPhoneViewBeginUpdate );
  3895 
       
  3896     TCleanupItem operation( UiUpdateCleanup, this );
  3873     TCleanupItem operation( UiUpdateCleanup, this );
  3897     CleanupStack::PushL( operation );
  3874     CleanupStack::PushL( operation );
  3898     }
  3875     }
  3899 
  3876 
  3900 // -----------------------------------------------------------
  3877 // -----------------------------------------------------------
       
  3878 // CPhoneState::EndUiUpdate
       
  3879 // -----------------------------------------------------------
       
  3880 //
       
  3881 EXPORT_C void CPhoneState::EndUiUpdate()
       
  3882     {
       
  3883      CleanupStack::PopAndDestroy(); // Call UiUpdateCleanup
       
  3884     }
       
  3885 	
       
  3886 // -----------------------------------------------------------
  3901 // CPhoneState::BeginTransEffectLC
  3887 // CPhoneState::BeginTransEffectLC
  3902 // -----------------------------------------------------------
  3888 // -----------------------------------------------------------
  3903 //
  3889 //
  3904 EXPORT_C void CPhoneState::BeginTransEffectLC(  TStateTransEffectType aType )
  3890 EXPORT_C void CPhoneState::BeginTransEffectLC( TStateTransEffectType aType )
  3905     {
  3891     {
  3906     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::BeginTransEffectLC( ) ");
  3892     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::BeginTransEffectLC( ) ");
  3907     
  3893     TPhoneCmdParamTransEffect effectParam;
  3908     // Check if this particular effect can be used in the current state.
  3894     switch ( aType )
  3909     if ( CanTransEffectTypeBeUsed( aType ) )
  3895         {
  3910         {
  3896         case ENumberEntryOpen:
  3911         TPhoneCmdParamTransEffect effectParam;
  3897             effectParam.SetType( EPhoneTransEffectDialerOpen );
  3912         switch ( aType )
  3898             break;
  3913             {
  3899         case ENumberEntryClose:
  3914             case ENumberEntryOpen:
  3900             effectParam.SetType( EPhoneTransEffectDialerClose );
  3915                 effectParam.SetType( EPhoneTransEffectDialerOpen );
  3901             break;
  3916                 break;
  3902         case ENumberEntryCreate:
  3917             case ENumberEntryClose:
  3903             effectParam.SetType( EPhoneTransEffectDialerCreate );
  3918                 effectParam.SetType( EPhoneTransEffectDialerClose );
  3904             break;
  3919                 break;
  3905         case ECallUiAppear:
  3920             case ENumberEntryCreate:
  3906             effectParam.SetType( EPhoneTransEffectCallUiAppear );
  3921                 effectParam.SetType( EPhoneTransEffectDialerCreate );
  3907             break;
  3922                 break;
  3908         case ECallUiDisappear:
  3923             default:
  3909             effectParam.SetType( EPhoneTransEffectCallUiDisappear );
  3924                 effectParam.SetType( EPhoneTransEffectNone );
  3910             break;
  3925             }
  3911         default:
  3926 
  3912             effectParam.SetType( EPhoneTransEffectNone );
  3927         iViewCommandHandle->ExecuteCommand( EPhoneViewBeginTransEffect,  
  3913         }
  3928                                             &effectParam );
  3914     effectParam.SetAppUid( KUidPhoneApplication );
  3929         }
  3915     iViewCommandHandle->ExecuteCommand( 
  3930 
  3916             EPhoneViewBeginTransEffect, 
       
  3917             &effectParam );
  3931     // Always put the cleanup item into stack as expected by the caller.
  3918     // Always put the cleanup item into stack as expected by the caller.
  3932     TCleanupItem operation( EffectCleanup, this );
  3919     TCleanupItem operation( EffectCleanup, this );
  3933     CleanupStack::PushL( operation );
  3920     CleanupStack::PushL( operation );
  3934     }
       
  3935 
       
  3936 // -----------------------------------------------------------
       
  3937 // CPhoneState::EndUiUpdate
       
  3938 // -----------------------------------------------------------
       
  3939 //
       
  3940 EXPORT_C void CPhoneState::EndUiUpdate()
       
  3941     {
       
  3942     CleanupStack::PopAndDestroy(); // Call UiUpdateCleanup
       
  3943     }
  3921     }
  3944 
  3922 
  3945 // -----------------------------------------------------------
  3923 // -----------------------------------------------------------
  3946 // CPhoneState::EndTransEffect
  3924 // CPhoneState::EndTransEffect
  3947 // -----------------------------------------------------------
  3925 // -----------------------------------------------------------
  4032     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CloseDTMFEditorL()");
  4010     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CloseDTMFEditorL()");
  4033     if ( iOnScreenDialer ) // Touch
  4011     if ( iOnScreenDialer ) // Touch
  4034         {
  4012         {
  4035         TPhoneCmdParamBoolean booleanParam;
  4013         TPhoneCmdParamBoolean booleanParam;
  4036         booleanParam.SetBoolean( EFalse );
  4014         booleanParam.SetBoolean( EFalse );
  4037         // Disable dialer DTMF mode
  4015         iViewCommandHandle->ExecuteCommandL( 
  4038         iViewCommandHandle->ExecuteCommandL( EPhoneViewSetDtmfDialerViewVisible,
  4016                 EPhoneViewSetDtmfDialerViewVisible,
  4039                                              &booleanParam );
  4017                 &booleanParam );
  4040 
  4018         CloseClearNumberEntryAndLoadEffectL( ECallUiAppear );
  4041         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
       
  4042         }
  4019         }
  4043     else // Non-Touch
  4020     else // Non-Touch
  4044         {
  4021         {
  4045         // If dtmf query is visible then remove number entry
  4022         // If dtmf query is visible then remove number entry
  4046         // because it should not be shown if user has pressed end key.
  4023         // because it should not be shown if user has pressed end key.
  4047         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
  4024         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
  4048         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery );
  4025         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery );
  4049         }
  4026         // Do state-specific behaviour if number entry is cleared
  4050 
  4027         HandleNumberEntryClearedL();
  4051     // Do state-specific behaviour if number entry is cleared
  4028         }
  4052     HandleNumberEntryClearedL();
       
  4053     }
  4029     }
  4054 
  4030 
  4055 // -----------------------------------------------------------
  4031 // -----------------------------------------------------------
  4056 // CPhoneState::SetDefaultFlagsL()
  4032 // CPhoneState::SetDefaultFlagsL()
  4057 // -----------------------------------------------------------
  4033 // -----------------------------------------------------------
  4368 // -----------------------------------------------------------------------------
  4344 // -----------------------------------------------------------------------------
  4369 //
  4345 //
  4370 EXPORT_C void CPhoneState::CloseCustomizedDialerL()
  4346 EXPORT_C void CPhoneState::CloseCustomizedDialerL()
  4371     {
  4347     {
  4372     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CloseCustomizedDialerL( ) ");
  4348     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CloseCustomizedDialerL( ) ");
  4373 
       
  4374     // Set dialer back to default mode.
  4349     // Set dialer back to default mode.
  4375     iViewCommandHandle->HandleCommandL( EPhoneViewHideCustomizedDialer );
  4350     iViewCommandHandle->HandleCommandL( EPhoneViewHideCustomizedDialer );
  4376 
  4351     CloseClearNumberEntryAndLoadEffectL( ENumberEntryClose );
  4377     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
       
  4378 
       
  4379     // Do state-specific behaviour if number entry is cleared
       
  4380     HandleNumberEntryClearedL();
       
  4381     }
  4352     }
  4382 
  4353 
  4383 // -----------------------------------------------------------------------------
  4354 // -----------------------------------------------------------------------------
  4384 // CPhoneState::CustomizedDialerMenuResourceId
  4355 // CPhoneState::CustomizedDialerMenuResourceId
  4385 // -----------------------------------------------------------------------------
  4356 // -----------------------------------------------------------------------------
  4424     // Set dialer to DTMF mode.
  4395     // Set dialer to DTMF mode.
  4425     TPhoneCmdParamBoolean booleanParam;
  4396     TPhoneCmdParamBoolean booleanParam;
  4426     booleanParam.SetBoolean( ETrue );
  4397     booleanParam.SetBoolean( ETrue );
  4427     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetDtmfDialerViewVisible,
  4398     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetDtmfDialerViewVisible,
  4428                                          &booleanParam );
  4399                                          &booleanParam );
       
  4400     BeginTransEffectLC( ECallUiDisappear );
  4429     if ( IsNumberEntryUsedL() )
  4401     if ( IsNumberEntryUsedL() )
  4430         {
  4402         {
  4431         // Store the number entry content to cache
  4403         // Store the number entry content to cache
  4432         if ( !IsNumberEntryContentStored() )
  4404         if ( !IsNumberEntryContentStored() )
  4433             {
  4405             {
  4440     else
  4412     else
  4441         {
  4413         {
  4442         // Create and display DTMF dialer
  4414         // Create and display DTMF dialer
  4443         NumberEntryManagerL()->CreateNumberEntryL();
  4415         NumberEntryManagerL()->CreateNumberEntryL();
  4444         }
  4416         }
       
  4417     EndTransEffect();
  4445 
  4418 
  4446     // Update CBA
  4419     // Update CBA
  4447     iCbaManager->UpdateInCallCbaL();
  4420     iCbaManager->UpdateInCallCbaL();
  4448     
  4421     
  4449     if( EPSCTsyCallStateDialling == 
  4422     if( EPSCTsyCallStateDialling == 
  4507     {
  4480     {
  4508     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::LoadResource() ");
  4481     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::LoadResource() ");
  4509     __PHONELOG1( EBasic, EPhoneControl, "CPhoneState::LoadResource - aResource: %d", aResource );
  4482     __PHONELOG1( EBasic, EPhoneControl, "CPhoneState::LoadResource - aResource: %d", aResource );
  4510     StringLoader::Load(  aData,
  4483     StringLoader::Load(  aData,
  4511                          CPhoneMainResourceResolver::Instance()->ResolveResourceID( aResource ),
  4484                          CPhoneMainResourceResolver::Instance()->ResolveResourceID( aResource ),
  4512                          &iEnv  );
  4485                          EikonEnv() );
  4513     }
  4486     }
  4514 
  4487 
  4515 // -----------------------------------------------------------
  4488 // -----------------------------------------------------------
  4516 // CPhoneState::IsAnyConnectedCalls
  4489 // CPhoneState::IsAnyConnectedCalls
  4517 // -----------------------------------------------------------
  4490 // -----------------------------------------------------------
  4694 EXPORT_C void CPhoneState::OnlyHashInNumberEntryL()
  4667 EXPORT_C void CPhoneState::OnlyHashInNumberEntryL()
  4695     {
  4668     {
  4696     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::OnlyHashInNumberEntryL( ) ");
  4669     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::OnlyHashInNumberEntryL( ) ");
  4697     // 0.8 seconds has passed, start ALS line change timer
  4670     // 0.8 seconds has passed, start ALS line change timer
  4698     StartAlsLineChangeTimerL();
  4671     StartAlsLineChangeTimerL();
  4699     }
       
  4700 
       
  4701 // ---------------------------------------------------------
       
  4702 // CPhoneState::CanTransEffectTypeBeUsed
       
  4703 // ---------------------------------------------------------
       
  4704 //
       
  4705 EXPORT_C TBool CPhoneState::CanTransEffectTypeBeUsed( TStateTransEffectType /*aType*/ )
       
  4706     {
       
  4707     // State dependant so return EFalse by default.
       
  4708     return EFalse;
       
  4709     }
  4672     }
  4710 
  4673 
  4711 // -----------------------------------------------------------
  4674 // -----------------------------------------------------------
  4712 // CPhoneState::NumberEntryClearL
  4675 // CPhoneState::NumberEntryClearL
  4713 // -----------------------------------------------------------
  4676 // -----------------------------------------------------------
  4781     {
  4744     {
  4782     if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
  4745     if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
  4783         {
  4746         {
  4784         TPhoneCmdParamInteger integerParam;
  4747         TPhoneCmdParamInteger integerParam;
  4785         integerParam.SetInteger( EPhoneInCallCmdHandset );
  4748         integerParam.SetInteger( EPhoneInCallCmdHandset );
       
  4749         iViewCommandHandle->ExecuteCommand(
       
  4750             EPhoneViewEnableToolbarButton, &integerParam );
       
  4751         }
       
  4752     }
       
  4753 
       
  4754 // ---------------------------------------------------------
       
  4755 // CPhoneState::SetToolbarButtonBTHFEnabled
       
  4756 // ---------------------------------------------------------
       
  4757 //
       
  4758 EXPORT_C void CPhoneState::SetToolbarButtonBTHFEnabled()
       
  4759     {
       
  4760     if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
       
  4761         {
       
  4762         TPhoneCmdParamInteger integerParam;
       
  4763         integerParam.SetInteger( EPhoneInCallCmdBtHandsfree );
  4786         iViewCommandHandle->ExecuteCommand(
  4764         iViewCommandHandle->ExecuteCommand(
  4787             EPhoneViewEnableToolbarButton, &integerParam );
  4765             EPhoneViewEnableToolbarButton, &integerParam );
  4788         }
  4766         }
  4789     }
  4767     }
  4790 
  4768 
  4890                break;
  4868                break;
  4891            }
  4869            }
  4892         } 
  4870         } 
  4893     }
  4871     }
  4894 
  4872 
       
  4873 // -----------------------------------------------------------
       
  4874 // CPhoneState::DisplayCallSetupL
       
  4875 // -----------------------------------------------------------
       
  4876 //
       
  4877 EXPORT_C void CPhoneState::DisplayCallSetupL( TInt aCallId )
       
  4878     {
       
  4879     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::DisplayCallSetupL() ");
       
  4880     BeginTransEffectLC( ECallUiAppear );
       
  4881     BeginUiUpdateLC();
       
  4882     SetNumberEntryVisibilityL( EFalse );
       
  4883     CaptureKeysDuringCallNotificationL( ETrue );
       
  4884     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
       
  4885     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
       
  4886     TPhoneCmdParamInteger uidParam;
       
  4887     uidParam.SetInteger( KUidPhoneApplication.iUid );
       
  4888     iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
       
  4889         &uidParam );
       
  4890     // Do state-specific operations.
       
  4891     DoStateSpecificCallSetUpDefinitionsL();
       
  4892     DisplayHeaderForOutgoingCallL(aCallId);
       
  4893     EndUiUpdate();
       
  4894     EndTransEffect();
       
  4895     iCbaManager->UpdateCbaL(EPhoneCallHandlingCallSetupCBA);
       
  4896     }
       
  4897 
       
  4898 // -----------------------------------------------------------
       
  4899 // Sends command to viewcontroller to store the flag
       
  4900 // -----------------------------------------------------------
       
  4901 //
       
  4902 EXPORT_C void CPhoneState::SetNeedToReturnToForegroundAppStatusL( 
       
  4903     TBool aNeedToReturn )
       
  4904     {
       
  4905     TPhoneCmdParamBoolean booleanParam;
       
  4906     booleanParam.SetBoolean( aNeedToReturn );
       
  4907     iViewCommandHandle->ExecuteCommandL( 
       
  4908         EPhoneViewSetNeedToReturnToForegroundAppStatus,
       
  4909         &booleanParam );
       
  4910     }
       
  4911 
       
  4912 // -----------------------------------------------------------
       
  4913 // CPhoneState::DoStateSpecificCallSetUpDefinitionsL
       
  4914 // -----------------------------------------------------------
       
  4915 //
       
  4916 EXPORT_C void CPhoneState::DoStateSpecificCallSetUpDefinitionsL()
       
  4917     {
       
  4918     // do nothing
       
  4919     }
       
  4920 
       
  4921 // -----------------------------------------------------------
       
  4922 // CPhoneState::CloseClearNumberEntryAndLoadEffect
       
  4923 // -----------------------------------------------------------
       
  4924 //
       
  4925 EXPORT_C void CPhoneState::CloseClearNumberEntryAndLoadEffectL( 
       
  4926         TStateTransEffectType aType )
       
  4927     {
       
  4928     __LOGMETHODSTARTEND( EPhoneControl, 
       
  4929             "CPhoneState::CloseClearNumberEntryAndLoadEffectL() ");
       
  4930     BeginTransEffectLC( aType );
       
  4931     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
       
  4932     EndTransEffect();
       
  4933     // Do state-specific operation when number entry is cleared
       
  4934     HandleNumberEntryClearedL();
       
  4935     }
       
  4936 
  4895 //  End of File
  4937 //  End of File
  4896 
  4938