54 #include <videotelcontrolmediatorapi.h> |
54 #include <videotelcontrolmediatorapi.h> |
55 #include <textresolver.h> |
55 #include <textresolver.h> |
56 #include <phoneappvoipcommands.hrh> |
56 #include <phoneappvoipcommands.hrh> |
57 #include <hwrmdomainpskeys.h> |
57 #include <hwrmdomainpskeys.h> |
58 #include <hal.h> |
58 #include <hal.h> |
|
59 #include <phoneui.rsg> |
59 |
60 |
60 #include "phoneui.pan" |
61 #include "phoneui.pan" |
61 #include "cphonestate.h" |
62 #include "cphonestate.h" |
62 #include "mphonestatemachine.h" |
63 #include "mphonestatemachine.h" |
63 #include "mphoneviewcommandhandle.h" |
64 #include "mphoneviewcommandhandle.h" |
76 #include "tphonecmdparamcallstatedata.h" |
77 #include "tphonecmdparamcallstatedata.h" |
77 #include "tphonecmdparambitmap.h" |
78 #include "tphonecmdparambitmap.h" |
78 #include "tphonecmdparamaudiooutput.h" |
79 #include "tphonecmdparamaudiooutput.h" |
79 #include "tphonecmdparamaudioavailability.h" |
80 #include "tphonecmdparamaudioavailability.h" |
80 #include "tphonecmdparamappinfo.h" |
81 #include "tphonecmdparamappinfo.h" |
81 #include "tphonecmdparamtranseffect.h" |
|
82 #include "tphonecmdparamringtone.h" |
82 #include "tphonecmdparamringtone.h" |
83 #include "tphonecmdparamcustomdialer.h" |
83 #include "tphonecmdparamcustomdialer.h" |
84 #include "cphonekeys.h" |
84 #include "cphonekeys.h" |
85 #include "phoneui.hrh" |
85 #include "phoneui.hrh" |
86 #include "phonerssbase.h" |
86 #include "phonerssbase.h" |
2218 EXPORT_C void CPhoneState::UpdateSingleActiveCallL( TInt aCallId ) |
2219 EXPORT_C void CPhoneState::UpdateSingleActiveCallL( TInt aCallId ) |
2219 { |
2220 { |
2220 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateSingleActiveCallL( ) "); |
2221 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateSingleActiveCallL( ) "); |
2221 // Stop capturing keys |
2222 // Stop capturing keys |
2222 CaptureKeysDuringCallNotificationL( EFalse ); |
2223 CaptureKeysDuringCallNotificationL( EFalse ); |
2223 BeginUiUpdateLC(); |
2224 TransitionHandlerL().BeginUiUpdateLC(); |
2224 |
2225 |
2225 SetTouchPaneButtonEnabled( EPhoneInCallCmdHold ); |
2226 SetTouchPaneButtonEnabled( EPhoneInCallCmdHold ); |
2226 |
2227 |
2227 // Update call state |
2228 // Update call state |
2228 TPhoneCmdParamCallHeaderData callHeaderParam; |
2229 TPhoneCmdParamCallHeaderData callHeaderParam; |
3679 } |
3680 } |
3680 |
3681 |
3681 // Show number busy note |
3682 // Show number busy note |
3682 TPhoneCmdParamGlobalNote globalNoteParam; |
3683 TPhoneCmdParamGlobalNote globalNoteParam; |
3683 globalNoteParam.SetType( EAknGlobalInformationNote ); |
3684 globalNoteParam.SetType( EAknGlobalInformationNote ); |
3684 globalNoteParam.SetTextResourceId( |
3685 |
3685 CPhoneMainResourceResolver::Instance()-> |
3686 if ( CPhoneCenRepProxy::Instance()-> |
3686 ResolveResourceID( resource ) ); |
3687 IsTelephonyFeatureSupported( KTelephonyLVFlagClearCodeCustomization ) ) |
|
3688 { |
|
3689 // Show varied Number busy -note when clear code customization |
|
3690 // is enabled |
|
3691 globalNoteParam.SetTextResourceId( R_NOTE_VAR_CAUSE_17 ); |
|
3692 } |
|
3693 else |
|
3694 { |
|
3695 globalNoteParam.SetTextResourceId( |
|
3696 CPhoneMainResourceResolver::Instance()-> |
|
3697 ResolveResourceID( resource ) ); |
|
3698 } |
|
3699 |
3687 globalNoteParam.SetTone( EAvkonSIDInformationTone ); |
3700 globalNoteParam.SetTone( EAvkonSIDInformationTone ); |
3688 iViewCommandHandle->ExecuteCommandL( EPhoneViewShowGlobalNote, |
3701 iViewCommandHandle->ExecuteCommandL( EPhoneViewShowGlobalNote, |
3689 &globalNoteParam ); |
3702 &globalNoteParam ); |
3690 } |
3703 } |
3691 |
3704 |
3743 // |
3756 // |
3744 EXPORT_C void CPhoneState::SetTouchPaneButtons( TInt aResourceId ) |
3757 EXPORT_C void CPhoneState::SetTouchPaneButtons( TInt aResourceId ) |
3745 { |
3758 { |
3746 if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
3759 if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
3747 { |
3760 { |
3748 // Display Video Share button instead of Hold Button if |
|
3749 // the feature is enabled and video sharing is currently available. |
|
3750 if ( aResourceId == EPhoneIncallButtons && |
|
3751 FeatureManager::FeatureSupported( KFeatureIdFfEntryPointForVideoShare ) && |
|
3752 CPhonePubSubProxy::Instance()->Value |
|
3753 ( KPSUidCoreApplicationUIs, KCoreAppUIsVideoSharingIndicator ) |
|
3754 == ECoreAppUIsVideoSharingIndicatorOn ) |
|
3755 { |
|
3756 aResourceId = EPhoneIncallVideoShareButtons; |
|
3757 } |
|
3758 TPhoneCmdParamInteger integerParam; |
3761 TPhoneCmdParamInteger integerParam; |
3759 integerParam.SetInteger( CPhoneMainResourceResolver::Instance()-> |
3762 integerParam.SetInteger( CPhoneMainResourceResolver::Instance()-> |
3760 ResolveResourceID( aResourceId ) ); |
3763 ResolveResourceID( aResourceId ) ); |
3761 TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( |
3764 TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( |
3762 EPhoneViewSetTouchPaneButtons, |
3765 EPhoneViewSetTouchPaneButtons, |
3862 __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::OpenVKB() "); |
3865 __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::OpenVKB() "); |
3863 iViewCommandHandle->ExecuteCommandL( EPhoneViewOpenVirtualKeyBoard ); |
3866 iViewCommandHandle->ExecuteCommandL( EPhoneViewOpenVirtualKeyBoard ); |
3864 } |
3867 } |
3865 |
3868 |
3866 // ----------------------------------------------------------- |
3869 // ----------------------------------------------------------- |
3867 // CPhoneState::BeginUiUpdateLC |
|
3868 // ----------------------------------------------------------- |
|
3869 // |
|
3870 EXPORT_C void CPhoneState::BeginUiUpdateLC() |
|
3871 { |
|
3872 iViewCommandHandle->ExecuteCommand( EPhoneViewBeginUpdate ); |
|
3873 TCleanupItem operation( UiUpdateCleanup, this ); |
|
3874 CleanupStack::PushL( operation ); |
|
3875 } |
|
3876 |
|
3877 // ----------------------------------------------------------- |
|
3878 // CPhoneState::EndUiUpdate |
|
3879 // ----------------------------------------------------------- |
|
3880 // |
|
3881 EXPORT_C void CPhoneState::EndUiUpdate() |
|
3882 { |
|
3883 CleanupStack::PopAndDestroy(); // Call UiUpdateCleanup |
|
3884 } |
|
3885 |
|
3886 // ----------------------------------------------------------- |
|
3887 // CPhoneState::BeginTransEffectLC |
|
3888 // ----------------------------------------------------------- |
|
3889 // |
|
3890 EXPORT_C void CPhoneState::BeginTransEffectLC( TStateTransEffectType aType ) |
|
3891 { |
|
3892 __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::BeginTransEffectLC( ) "); |
|
3893 TPhoneCmdParamTransEffect effectParam; |
|
3894 switch ( aType ) |
|
3895 { |
|
3896 case ENumberEntryOpen: |
|
3897 effectParam.SetType( EPhoneTransEffectDialerOpen ); |
|
3898 break; |
|
3899 case ENumberEntryClose: |
|
3900 effectParam.SetType( EPhoneTransEffectDialerClose ); |
|
3901 break; |
|
3902 case ENumberEntryCreate: |
|
3903 effectParam.SetType( EPhoneTransEffectDialerCreate ); |
|
3904 break; |
|
3905 case ECallUiAppear: |
|
3906 effectParam.SetType( EPhoneTransEffectCallUiAppear ); |
|
3907 break; |
|
3908 case ECallUiDisappear: |
|
3909 effectParam.SetType( EPhoneTransEffectCallUiDisappear ); |
|
3910 break; |
|
3911 default: |
|
3912 effectParam.SetType( EPhoneTransEffectNone ); |
|
3913 } |
|
3914 effectParam.SetAppUid( KUidPhoneApplication ); |
|
3915 iViewCommandHandle->ExecuteCommand( |
|
3916 EPhoneViewBeginTransEffect, |
|
3917 &effectParam ); |
|
3918 // Always put the cleanup item into stack as expected by the caller. |
|
3919 TCleanupItem operation( EffectCleanup, this ); |
|
3920 CleanupStack::PushL( operation ); |
|
3921 } |
|
3922 |
|
3923 // ----------------------------------------------------------- |
|
3924 // CPhoneState::EndTransEffect |
|
3925 // ----------------------------------------------------------- |
|
3926 // |
|
3927 EXPORT_C void CPhoneState::EndTransEffect() |
|
3928 { |
|
3929 CleanupStack::PopAndDestroy(); // Call EffectCleanup |
|
3930 } |
|
3931 |
|
3932 // ----------------------------------------------------------- |
|
3933 // CPhoneState::CheckIfShowTerminationNote |
3870 // CPhoneState::CheckIfShowTerminationNote |
3934 // This method is intended to be overridden in states |
3871 // This method is intended to be overridden in states |
3935 // that contain more info about decision. |
3872 // that contain more info about decision. |
3936 // ----------------------------------------------------------- |
3873 // ----------------------------------------------------------- |
3937 // |
3874 // |
3965 { |
3902 { |
3966 SendDtmfKeyEventL( aKeyEvent, aEventCode ); |
3903 SendDtmfKeyEventL( aKeyEvent, aEventCode ); |
3967 } |
3904 } |
3968 |
3905 |
3969 // ----------------------------------------------------------------------------- |
3906 // ----------------------------------------------------------------------------- |
3970 // CPhoneState::UiUpdateCleanup |
|
3971 // ----------------------------------------------------------------------------- |
|
3972 // |
|
3973 void CPhoneState::UiUpdateCleanup(TAny* aThis ) |
|
3974 { |
|
3975 static_cast<CPhoneState*>( aThis )->iViewCommandHandle->ExecuteCommand( |
|
3976 EPhoneViewEndUpdate ); |
|
3977 } |
|
3978 |
|
3979 // ----------------------------------------------------------------------------- |
|
3980 // CPhoneState::EffectCleanup |
|
3981 // ----------------------------------------------------------------------------- |
|
3982 // |
|
3983 void CPhoneState::EffectCleanup(TAny* aThis ) |
|
3984 { |
|
3985 TPhoneCmdParamTransEffect effectParam; |
|
3986 effectParam.SetType( EPhoneTransEffectStop ); |
|
3987 // won't do anything if effect wasn't started |
|
3988 static_cast<CPhoneState*>( aThis )->iViewCommandHandle->ExecuteCommand( |
|
3989 EPhoneViewEndTransEffect, &effectParam ); |
|
3990 } |
|
3991 |
|
3992 // ----------------------------------------------------------------------------- |
|
3993 // CPhoneState::IsDTMFEditorVisibleL |
3907 // CPhoneState::IsDTMFEditorVisibleL |
3994 // ----------------------------------------------------------------------------- |
3908 // ----------------------------------------------------------------------------- |
3995 // |
3909 // |
3996 EXPORT_C TBool CPhoneState::IsDTMFEditorVisibleL() const |
3910 EXPORT_C TBool CPhoneState::IsDTMFEditorVisibleL() const |
3997 { |
3911 { |
4013 TPhoneCmdParamBoolean booleanParam; |
3927 TPhoneCmdParamBoolean booleanParam; |
4014 booleanParam.SetBoolean( EFalse ); |
3928 booleanParam.SetBoolean( EFalse ); |
4015 iViewCommandHandle->ExecuteCommandL( |
3929 iViewCommandHandle->ExecuteCommandL( |
4016 EPhoneViewSetDtmfDialerViewVisible, |
3930 EPhoneViewSetDtmfDialerViewVisible, |
4017 &booleanParam ); |
3931 &booleanParam ); |
4018 CloseClearNumberEntryAndLoadEffectL( ECallUiAppear ); |
3932 CloseClearNumberEntryAndLoadEffectL( EPhoneTransEffectCallUiAppear ); |
4019 } |
3933 } |
4020 else // Non-Touch |
3934 else // Non-Touch |
4021 { |
3935 { |
4022 // If dtmf query is visible then remove number entry |
3936 // If dtmf query is visible then remove number entry |
4023 // because it should not be shown if user has pressed end key. |
3937 // because it should not be shown if user has pressed end key. |
4321 CleanupStack::PopAndDestroy( buf ); |
4235 CleanupStack::PopAndDestroy( buf ); |
4322 } |
4236 } |
4323 } |
4237 } |
4324 |
4238 |
4325 // ----------------------------------------------------------- |
4239 // ----------------------------------------------------------- |
|
4240 // CPhoneState::TransitionHandlerL |
|
4241 // ----------------------------------------------------------- |
|
4242 // |
|
4243 EXPORT_C TPhoneTransitionHandler& CPhoneState::TransitionHandlerL() |
|
4244 { |
|
4245 __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::TransitionHandlerL() "); |
|
4246 if ( !iTransitionHandler ) |
|
4247 { |
|
4248 iTransitionHandler = new (ELeave)TPhoneTransitionHandler( |
|
4249 *this, *iViewCommandHandle ); |
|
4250 } |
|
4251 return *iTransitionHandler; |
|
4252 } |
|
4253 |
|
4254 // ----------------------------------------------------------- |
4326 // CPhoneState::CallheaderManagerL |
4255 // CPhoneState::CallheaderManagerL |
4327 // ----------------------------------------------------------- |
4256 // ----------------------------------------------------------- |
4328 // |
4257 // |
4329 CPhoneCallHeaderManager* CPhoneState::CallheaderManagerL() |
4258 CPhoneCallHeaderManager* CPhoneState::CallheaderManagerL() |
4330 { |
4259 { |
4346 EXPORT_C void CPhoneState::CloseCustomizedDialerL() |
4275 EXPORT_C void CPhoneState::CloseCustomizedDialerL() |
4347 { |
4276 { |
4348 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CloseCustomizedDialerL( ) "); |
4277 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CloseCustomizedDialerL( ) "); |
4349 // Set dialer back to default mode. |
4278 // Set dialer back to default mode. |
4350 iViewCommandHandle->HandleCommandL( EPhoneViewHideCustomizedDialer ); |
4279 iViewCommandHandle->HandleCommandL( EPhoneViewHideCustomizedDialer ); |
4351 CloseClearNumberEntryAndLoadEffectL( ENumberEntryClose ); |
4280 CloseClearNumberEntryAndLoadEffectL( EPhoneTransEffectPhoneUiClose ); |
4352 } |
4281 } |
4353 |
4282 |
4354 // ----------------------------------------------------------------------------- |
4283 // ----------------------------------------------------------------------------- |
4355 // CPhoneState::CustomizedDialerMenuResourceId |
4284 // CPhoneState::CustomizedDialerMenuResourceId |
4356 // ----------------------------------------------------------------------------- |
4285 // ----------------------------------------------------------------------------- |
4395 // Set dialer to DTMF mode. |
4324 // Set dialer to DTMF mode. |
4396 TPhoneCmdParamBoolean booleanParam; |
4325 TPhoneCmdParamBoolean booleanParam; |
4397 booleanParam.SetBoolean( ETrue ); |
4326 booleanParam.SetBoolean( ETrue ); |
4398 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetDtmfDialerViewVisible, |
4327 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetDtmfDialerViewVisible, |
4399 &booleanParam ); |
4328 &booleanParam ); |
4400 BeginTransEffectLC( ECallUiDisappear ); |
4329 TransitionHandlerL(). |
|
4330 BeginTransEffectLC( EPhoneTransEffectCallUiDisappear ); |
4401 if ( IsNumberEntryUsedL() ) |
4331 if ( IsNumberEntryUsedL() ) |
4402 { |
4332 { |
4403 // Store the number entry content to cache |
4333 // Store the number entry content to cache |
4404 if ( !IsNumberEntryContentStored() ) |
4334 if ( !IsNumberEntryContentStored() ) |
4405 { |
4335 { |
4875 // ----------------------------------------------------------- |
4805 // ----------------------------------------------------------- |
4876 // |
4806 // |
4877 EXPORT_C void CPhoneState::DisplayCallSetupL( TInt aCallId ) |
4807 EXPORT_C void CPhoneState::DisplayCallSetupL( TInt aCallId ) |
4878 { |
4808 { |
4879 __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::DisplayCallSetupL() "); |
4809 __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::DisplayCallSetupL() "); |
4880 BeginTransEffectLC( ECallUiAppear ); |
4810 TransitionHandlerL().BeginTransEffectLC( EPhoneTransEffectCallUiAppear ); |
4881 BeginUiUpdateLC(); |
4811 TransitionHandlerL().BeginUiUpdateLC(); |
4882 SetNumberEntryVisibilityL( EFalse ); |
4812 SetNumberEntryVisibilityL( EFalse ); |
4883 CaptureKeysDuringCallNotificationL( ETrue ); |
4813 CaptureKeysDuringCallNotificationL( ETrue ); |
4884 iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
4814 iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
4885 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
4815 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
4886 TPhoneCmdParamInteger uidParam; |
4816 TPhoneCmdParamInteger uidParam; |
4888 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
4818 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
4889 &uidParam ); |
4819 &uidParam ); |
4890 // Do state-specific operations. |
4820 // Do state-specific operations. |
4891 DoStateSpecificCallSetUpDefinitionsL(); |
4821 DoStateSpecificCallSetUpDefinitionsL(); |
4892 DisplayHeaderForOutgoingCallL(aCallId); |
4822 DisplayHeaderForOutgoingCallL(aCallId); |
4893 EndUiUpdate(); |
4823 TransitionHandlerL().EndUiUpdateAndEffect(); |
4894 EndTransEffect(); |
|
4895 iCbaManager->UpdateCbaL(EPhoneCallHandlingCallSetupCBA); |
4824 iCbaManager->UpdateCbaL(EPhoneCallHandlingCallSetupCBA); |
4896 } |
4825 } |
4897 |
4826 |
4898 // ----------------------------------------------------------- |
4827 // ----------------------------------------------------------- |
4899 // Sends command to viewcontroller to store the flag |
4828 // Sends command to viewcontroller to store the flag |
4921 // ----------------------------------------------------------- |
4850 // ----------------------------------------------------------- |
4922 // CPhoneState::CloseClearNumberEntryAndLoadEffect |
4851 // CPhoneState::CloseClearNumberEntryAndLoadEffect |
4923 // ----------------------------------------------------------- |
4852 // ----------------------------------------------------------- |
4924 // |
4853 // |
4925 EXPORT_C void CPhoneState::CloseClearNumberEntryAndLoadEffectL( |
4854 EXPORT_C void CPhoneState::CloseClearNumberEntryAndLoadEffectL( |
4926 TStateTransEffectType aType ) |
4855 TPhoneTransEffectType aType ) |
4927 { |
4856 { |
4928 __LOGMETHODSTARTEND( EPhoneControl, |
4857 __LOGMETHODSTARTEND( EPhoneControl, |
4929 "CPhoneState::CloseClearNumberEntryAndLoadEffectL() "); |
4858 "CPhoneState::CloseClearNumberEntryAndLoadEffectL() "); |
4930 BeginTransEffectLC( aType ); |
4859 TransitionHandlerL().BeginTransEffectLC( aType ); |
4931 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
4860 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
4932 EndTransEffect(); |
4861 TransitionHandlerL().EndTransEffect(); |
4933 // Do state-specific operation when number entry is cleared |
4862 // Do state-specific operation when number entry is cleared |
4934 HandleNumberEntryClearedL(); |
4863 HandleNumberEntryClearedL(); |
4935 } |
4864 } |
4936 |
4865 |
4937 // End of File |
4866 // End of File |