43 #include "tphonecmdparamaudiooutput.h" |
43 #include "tphonecmdparamaudiooutput.h" |
44 #include "cphonesecuritymodeobserver.h" |
44 #include "cphonesecuritymodeobserver.h" |
45 |
45 |
46 // ================= MEMBER FUNCTIONS ======================= |
46 // ================= MEMBER FUNCTIONS ======================= |
47 |
47 |
|
48 // ----------------------------------------------------------- |
48 // C++ default constructor can NOT contain any code, that |
49 // C++ default constructor can NOT contain any code, that |
49 // might leave. |
50 // might leave. |
|
51 // ----------------------------------------------------------- |
50 // |
52 // |
51 CPhoneEmergency::CPhoneEmergency( |
53 CPhoneEmergency::CPhoneEmergency( |
52 MPhoneStateMachine* aStateMachine, |
54 MPhoneStateMachine* aStateMachine, |
53 MPhoneViewCommandHandle* aViewCommandHandle, |
55 MPhoneViewCommandHandle* aViewCommandHandle, |
54 MPhoneCustomization* aPhoneCustomization ) : |
56 MPhoneCustomization* aPhoneCustomization ) : |
60 // ----------------------------------------------------------- |
62 // ----------------------------------------------------------- |
61 // CPhoneEmergency::~CPhoneEmergency() |
63 // CPhoneEmergency::~CPhoneEmergency() |
62 // Destructor |
64 // Destructor |
63 // (other items were commented in a header). |
65 // (other items were commented in a header). |
64 // ----------------------------------------------------------- |
66 // ----------------------------------------------------------- |
65 |
67 // |
66 CPhoneEmergency::~CPhoneEmergency() |
68 CPhoneEmergency::~CPhoneEmergency() |
67 { |
69 { |
68 } |
70 } |
69 |
71 |
70 // ----------------------------------------------------------- |
72 // ----------------------------------------------------------- |
549 { |
551 { |
550 resourceId = EPhoneInCallNumberAcqCBA; |
552 resourceId = EPhoneInCallNumberAcqCBA; |
551 } |
553 } |
552 } |
554 } |
553 else if ( iStateMachine->SecurityMode()->IsAutolockEnabled() |
555 else if ( iStateMachine->SecurityMode()->IsAutolockEnabled() |
554 || SimState() != EPESimUsable |
556 || SimState() != EPESimUsable |
555 || iStartupInterrupted ) |
557 || iStartupInterrupted ) |
556 { |
558 { |
557 if ( TouchCallHandlingSupported() ) |
559 if ( TouchCallHandlingSupported() ) |
558 { |
560 { |
559 resourceId = EPhoneCallHandlingEmergencyInCallNoOptions; |
561 resourceId = EPhoneCallHandlingEmergencyInCallNoOptions; |
560 } |
562 } |
561 else if ( audioOutput == EPEWiredAudioAccessory || IsSwivelClosed()) |
563 else if ( audioOutput == EPEWiredAudioAccessory || IsSwivelClosed()) |
562 { |
564 { |
563 resourceId = EPhoneCallHandlingEmergencyNoOptionsNoIhfCBA; |
565 resourceId = EPhoneCallHandlingEmergencyNoOptionsNoIhfCBA; |
641 |
643 |
642 default: |
644 default: |
643 { |
645 { |
644 if ( TouchCallHandlingSupported() ) |
646 if ( TouchCallHandlingSupported() ) |
645 { |
647 { |
646 CPhoneGsmInCall::HandleKeyMessageL( aMessage, aCode ); |
648 CPhoneGsmInCall::HandleKeyMessageL( aMessage, aCode ); |
647 } |
649 } |
648 else if ( !iStateMachine->SecurityMode()->IsAutolockEnabled() |
650 else if ( !iStateMachine->SecurityMode()->IsAutolockEnabled() |
649 && SimState() == EPESimUsable ) |
651 && SimState() == EPESimUsable ) |
650 { |
652 { |
651 // do base operation |
653 // do base operation |
652 CPhoneGsmInCall::HandleKeyMessageL( aMessage, aCode ); |
654 CPhoneGsmInCall::HandleKeyMessageL( aMessage, aCode ); |
653 } |
655 } |
654 break; |
656 break; |
766 void CPhoneEmergency::HandleKeyEventL( |
772 void CPhoneEmergency::HandleKeyEventL( |
767 const TKeyEvent& aKeyEvent, |
773 const TKeyEvent& aKeyEvent, |
768 TEventCode aEventCode ) |
774 TEventCode aEventCode ) |
769 { |
775 { |
770 __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleKeyEventL( ) "); |
776 __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleKeyEventL( ) "); |
771 |
777 |
772 if ( TouchCallHandlingSupported() ) |
778 if ( TouchCallHandlingSupported() ) |
773 { |
779 { |
774 CPhoneState::HandleKeyEventL( aKeyEvent, aEventCode ); |
780 CPhoneState::HandleKeyEventL( aKeyEvent, aEventCode ); |
775 } |
781 } |
776 else |
782 else |
777 { |
783 { |
778 if ( iStateMachine->SecurityMode()->IsAutolockEnabled() |
784 if ( iStateMachine->SecurityMode()->IsAutolockEnabled() |
779 && CPhoneKeys::IsNumericKey( aKeyEvent, aEventCode ) ) |
785 && CPhoneKeys::IsNumericKey( aKeyEvent, aEventCode ) ) |
780 { |
786 { |
781 // Send the key event to the phone engine |
787 // Send the key event to the phone engine |
782 SendKeyEventL( aKeyEvent, aEventCode ); |
788 SendKeyEventL( aKeyEvent, aEventCode ); |
783 } |
789 } |
784 else |
790 else |
785 { |
791 { |
786 // Handle numeric keys when key events are received in idle state |
792 // Handle numeric keys when key events are received in idle state |
787 CPhoneState::HandleKeyEventL( aKeyEvent, aEventCode ); |
793 CPhoneState::HandleKeyEventL( aKeyEvent, aEventCode ); |
788 } |
794 } |
789 } |
795 } |
790 } |
796 } |
791 |
797 |
792 // ----------------------------------------------------------- |
798 // ----------------------------------------------------------- |
793 // CPhoneEmergency::SendKeyEventL |
799 // CPhoneEmergency::SendKeyEventL |
878 TInt resourceId = EPhoneCallHandlingCallSetupCBA; |
884 TInt resourceId = EPhoneCallHandlingCallSetupCBA; |
879 |
885 |
880 const TPEAudioOutput audioOutput = |
886 const TPEAudioOutput audioOutput = |
881 iStateMachine->PhoneEngineInfo()->AudioOutput(); |
887 iStateMachine->PhoneEngineInfo()->AudioOutput(); |
882 |
888 |
883 if ( !( TouchCallHandlingSupported() ) |
889 if ( !( TouchCallHandlingSupported() ) |
884 && iCallSetup && audioOutput != EPENotActive ) |
890 && iCallSetup && audioOutput != EPENotActive ) |
885 { |
891 { |
886 if ( audioOutput == EPELoudspeaker ) |
892 if ( audioOutput == EPELoudspeaker ) |
887 { |
893 { |
888 resourceId = EPhoneCallHandlingCallSetupToHandsetCBA; |
894 resourceId = EPhoneCallHandlingCallSetupToHandsetCBA; |
889 } |
895 } |
949 // -------------------------------------------------------------- |
955 // -------------------------------------------------------------- |
950 // CPhoneEmergency::TouchCallHandlingSupported |
956 // CPhoneEmergency::TouchCallHandlingSupported |
951 // -------------------------------------------------------------- |
957 // -------------------------------------------------------------- |
952 // |
958 // |
953 TBool CPhoneEmergency::TouchCallHandlingSupported () const |
959 TBool CPhoneEmergency::TouchCallHandlingSupported () const |
954 { |
960 { |
955 if ( FeatureManager::FeatureSupported ( KFeatureIdTouchCallHandling ) ) |
961 if ( FeatureManager::FeatureSupported ( KFeatureIdTouchCallHandling ) ) |
956 { |
962 { |
957 return ETrue; |
963 return ETrue; |
958 } |
964 } |
959 else |
965 else |
960 { |
966 { |
961 return EFalse; |
967 return EFalse; |
962 } |
968 } |
963 } |
969 } |
964 |
970 |
965 // -------------------------------------------------------------- |
971 // -------------------------------------------------------------- |
966 // CPhoneEmergency::UseEmergencyNoIhfCBA |
972 // CPhoneEmergency::UseEmergencyNoIhfCBA |
967 // -------------------------------------------------------------- |
973 // -------------------------------------------------------------- |
968 // |
974 // |
969 TBool CPhoneEmergency::UseEmergencyNoIhfCBA( const TPEAudioOutput& aAudioOutput ) const |
975 TBool CPhoneEmergency::UseEmergencyNoIhfCBA( const TPEAudioOutput& aAudioOutput ) const |
970 { |
976 { |
971 if ( !( TouchCallHandlingSupported() ) |
977 if ( !( TouchCallHandlingSupported() ) |
972 && ( ( aAudioOutput == EPEWiredAudioAccessory ) || ( IsSwivelClosed() ) ) ) |
978 && ( ( aAudioOutput == EPEWiredAudioAccessory ) || ( IsSwivelClosed() ) ) ) |
973 { |
979 { |
974 return ETrue; |
980 return ETrue; |
975 } |
981 } |
976 else |
982 else |
977 { |
983 { |
978 return EFalse; |
984 return EFalse; |
979 } |
985 } |
980 } |
986 } |
981 |
987 |
982 // -------------------------------------------------------------- |
988 // -------------------------------------------------------------- |
983 // CPhoneEmergency::UseHandsetEmergencyCBA |
989 // CPhoneEmergency::UseHandsetEmergencyCBA |
984 // -------------------------------------------------------------- |
990 // -------------------------------------------------------------- |
985 // |
991 // |
986 TBool CPhoneEmergency::UseHandsetEmergencyCBA( const TPEAudioOutput& aAudioOutput ) const |
992 TBool CPhoneEmergency::UseHandsetEmergencyCBA( const TPEAudioOutput& aAudioOutput ) const |
987 { |
993 { |
988 if ( !( TouchCallHandlingSupported() ) |
994 if ( !( TouchCallHandlingSupported() ) |
989 && ( ( aAudioOutput == EPELoudspeaker ) || ( aAudioOutput == EPEBTAudioAccessory ) ) ) |
995 && ( ( aAudioOutput == EPELoudspeaker ) || ( aAudioOutput == EPEBTAudioAccessory ) ) ) |
990 { |
996 { |
991 return ETrue; |
997 return ETrue; |
992 } |
998 } |
993 else |
999 else |
994 { |
1000 { |
995 return EFalse; |
1001 return EFalse; |
996 } |
1002 } |
997 } |
1003 } |
998 |
1004 |
999 // -------------------------------------------------------------- |
1005 // -------------------------------------------------------------- |
1000 // CPhoneEmergency::HandlePhoneStartupL |
1006 // CPhoneEmergency::HandlePhoneStartupL |
1001 // -------------------------------------------------------------- |
1007 // -------------------------------------------------------------- |