26 #include <apgcli.h> |
26 #include <apgcli.h> |
27 #include <telephonyvariant.hrh> |
27 #include <telephonyvariant.hrh> |
28 #include <featmgr.h> |
28 #include <featmgr.h> |
29 #include <settingsinternalcrkeys.h> |
29 #include <settingsinternalcrkeys.h> |
30 #include <mpeengineinfo.h> |
30 #include <mpeengineinfo.h> |
31 #include <activeidle2domainpskeys.h> |
|
32 #include <mpeclientinformation.h> |
31 #include <mpeclientinformation.h> |
33 #include <bldvariant.hrh> |
32 #include <bldvariant.hrh> |
34 |
33 |
35 #include "cphonepubsubproxy.h" |
34 #include "cphonepubsubproxy.h" |
36 #include "cphonecenrepproxy.h" |
35 #include "cphonecenrepproxy.h" |
37 #include "cphonestateidle.h" |
36 #include "cphonestateidle.h" |
38 #include "tphonecmdparaminteger.h" |
37 #include "tphonecmdparaminteger.h" |
39 #include "tphonecmdparamboolean.h" |
38 #include "tphonecmdparamboolean.h" |
40 #include "tphonecmdparamglobalnote.h" |
39 #include "tphonecmdparamglobalnote.h" |
|
40 #include "tphonecmdparamkeycapture.h" |
41 #include "tphonecmdparamstring.h" |
41 #include "tphonecmdparamstring.h" |
42 #include "tphonecmdparamspeeddial.h" |
|
43 #include "tphonecmdparamboolean.h" |
42 #include "tphonecmdparamboolean.h" |
44 #include "mphonestatemachine.h" |
43 #include "mphonestatemachine.h" |
45 #include "phonestatedefinitions.h" |
44 #include "phonestatedefinitions.h" |
46 #include "tphonecmdparamappinfo.h" |
45 #include "tphonecmdparamappinfo.h" |
47 #include "cphonekeys.h" |
46 #include "cphonekeys.h" |
718 iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
691 iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
719 |
692 |
720 // Remove any phone dialogs if they are displayed |
693 // Remove any phone dialogs if they are displayed |
721 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
694 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
722 |
695 |
|
696 TPhoneCmdParamKeyCapture captureParam; |
|
697 captureParam.SetKeyCode( EKeyNo ); |
|
698 iViewCommandHandle->ExecuteCommand( EPhoneViewStartCapturingKey, &captureParam ); |
|
699 |
723 // Capture keys when there is an incoming call |
700 // Capture keys when there is an incoming call |
724 CaptureKeysDuringCallNotificationL( ETrue ); |
701 CaptureKeysDuringCallNotificationL( ETrue ); |
725 |
702 |
726 // Indicate that the Phone needs to be sent to the background if |
703 // Indicate that the Phone needs to be sent to the background if |
727 // an application other than the top application is in the foreground |
704 // an application other than the top application is in the foreground |
762 __ASSERT_DEBUG( aCallId > KErrNotFound, Panic( EPhoneCtrlParameterNotInitialized ) ); |
739 __ASSERT_DEBUG( aCallId > KErrNotFound, Panic( EPhoneCtrlParameterNotInitialized ) ); |
763 |
740 |
764 // Close menu bar, if it is displayed |
741 // Close menu bar, if it is displayed |
765 iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
742 iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
766 |
743 |
|
744 TPhoneCmdParamKeyCapture captureParam; |
|
745 captureParam.SetKeyCode( EKeyNo ); |
|
746 iViewCommandHandle->ExecuteCommand( EPhoneViewStartCapturingKey, &captureParam ); |
|
747 |
767 // Capture keys when the phone is dialling |
748 // Capture keys when the phone is dialling |
768 CaptureKeysDuringCallNotificationL( ETrue ); |
749 CaptureKeysDuringCallNotificationL( ETrue ); |
769 |
750 |
770 // Indicate that the Phone needs to be sent to the background if |
751 // Indicate that the Phone needs to be sent to the background if |
771 // an application other than the top application is in the foreground |
752 // an application other than the top application is in the foreground |
856 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
837 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
857 |
838 |
858 // Remove all notes and dialogs |
839 // Remove all notes and dialogs |
859 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
840 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
860 } |
841 } |
861 |
|
862 // ----------------------------------------------------------- |
|
863 // CPhoneStateIdle::SpeedDialL |
|
864 // ----------------------------------------------------------- |
|
865 // |
|
866 EXPORT_C void CPhoneStateIdle::SpeedDialL( const TUint& aDigit, |
|
867 TDialInitiationMethod aDialMethod ) |
|
868 { |
|
869 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::SpeedDialL( ) "); |
|
870 |
|
871 iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); |
|
872 |
|
873 TPhoneCmdParamSpeedDial speedDialParam; |
|
874 HBufC* phoneNumber = NumberForSpeedDialLocationL( aDigit, speedDialParam ); |
|
875 |
|
876 // Store serviceId received from vmbx handler |
|
877 iStateMachine->PhoneEngineInfo()->SetServiceIdCommand( speedDialParam.ServiceId() ); |
|
878 CleanupStack::PushL( phoneNumber ); |
|
879 |
|
880 if ( NULL != phoneNumber && KNullDesC() != *phoneNumber ) |
|
881 { |
|
882 |
|
883 |
|
884 DialL( *phoneNumber, speedDialParam.NumberType(), aDialMethod ); |
|
885 |
|
886 if ( IsNumberEntryUsedL() ) |
|
887 { |
|
888 BeginTransEffectLC( ENumberEntryClose ); |
|
889 |
|
890 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
891 |
|
892 // Set Idle background, if still idle |
|
893 if ( iStateMachine->State() == this ) |
|
894 { |
|
895 SetupIdleScreenInBackgroundL(); |
|
896 } |
|
897 |
|
898 EndTransEffect(); |
|
899 } |
|
900 } |
|
901 else |
|
902 { |
|
903 // User cancelled dialog or didn't give a valid number |
|
904 SpeedDialCanceledL( aDigit ); |
|
905 } |
|
906 |
|
907 CleanupStack::PopAndDestroy( phoneNumber ); |
|
908 } |
|
909 |
|
910 // ----------------------------------------------------------- |
|
911 // CPhoneStateIdle:SpeedDialCanceledL |
|
912 // ----------------------------------------------------------- |
|
913 // |
|
914 EXPORT_C void CPhoneStateIdle::SpeedDialCanceledL( const TUint& aDigit ) |
|
915 |
|
916 { |
|
917 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::SpeedDialCanceledL( ) "); |
|
918 if ( IsNumberEntryUsedL() ) |
|
919 { |
|
920 if ( aDigit == KPhoneDtmf1Character || |
|
921 ( aDigit == KPhoneDtmf2Character && |
|
922 iViewCommandHandle->HandleCommandL( |
|
923 EPhoneViewIsStraightCallToVideoMailBox ) == EPhoneViewResponseSuccess ) ) |
|
924 { |
|
925 // Remove number entry and set idle background on non-touch products |
|
926 if ( !FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
|
927 { |
|
928 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
929 |
|
930 // Set Idle background, if still idle ( f.e not incoming call arrived ) |
|
931 if ( iStateMachine->State() == this ) |
|
932 { |
|
933 // idle screen in the background |
|
934 SetupIdleScreenInBackgroundL(); |
|
935 } |
|
936 } |
|
937 } |
|
938 } |
|
939 } |
|
940 |
|
941 // ----------------------------------------------------------- |
|
942 // CPhoneStateIdle::HandleNumberLongKeyPressL() |
|
943 // ----------------------------------------------------------- |
|
944 // |
|
945 EXPORT_C void CPhoneStateIdle::HandleNumberLongKeyPressL() |
|
946 { |
|
947 __LOGMETHODSTARTEND(EPhoneControl, |
|
948 "CPhoneStateIdle::HandleNumberLongKeyPressL( ) "); |
|
949 |
|
950 HBufC* phoneNumber = PhoneNumberFromEntryLC(); |
|
951 |
|
952 if ( phoneNumber && IsSpeedDialNumber ( *phoneNumber ) ) |
|
953 { |
|
954 SpeedDialL( (*phoneNumber)[0], EDialMethodOneKeyDialing ); |
|
955 } |
|
956 |
|
957 CleanupStack::PopAndDestroy( phoneNumber ); |
|
958 } |
|
959 |
|
960 // ----------------------------------------------------------- |
|
961 // CPhoneStateIdle::IsSpeedDialNumber() |
|
962 // ----------------------------------------------------------- |
|
963 // |
|
964 EXPORT_C TBool CPhoneStateIdle::IsSpeedDialNumber( |
|
965 const TDesC& aNumber ) const |
|
966 { |
|
967 return ( aNumber.Length() == KPhoneDtmfSpeedDialPrefixLength |
|
968 && aNumber[0] >= KPhoneDtmf1Character |
|
969 && aNumber[0] <= KPhoneDtmf9Character ); |
|
970 } |
|
971 |
842 |
972 // ----------------------------------------------------------- |
843 // ----------------------------------------------------------- |
973 // CPhoneStateIdle::HandleSendCommandL() |
844 // CPhoneStateIdle::HandleSendCommandL() |
974 // ----------------------------------------------------------- |
845 // ----------------------------------------------------------- |
975 // |
846 // |
976 EXPORT_C void CPhoneStateIdle::HandleSendCommandL() |
847 EXPORT_C void CPhoneStateIdle::HandleSendCommandL() |
977 { |
848 { |
978 __LOGMETHODSTARTEND( |
849 __LOGMETHODSTARTEND( |
979 EPhoneControl, "CPhoneStateIdle::HandleSendCommandL()" ); |
850 EPhoneControl, "CPhoneStateIdle::HandleSendCommandL()" ); |
980 |
851 |
981 HandleVoiceCallCommandL( ETrue ); |
852 HandleVoiceCallCommandL(); |
982 } |
853 } |
983 |
854 |
984 // ----------------------------------------------------------- |
855 // ----------------------------------------------------------- |
985 // CPhoneStateIdle::LaunchApplicationL() |
856 // CPhoneStateIdle::LaunchApplicationL() |
986 // ----------------------------------------------------------- |
857 // ----------------------------------------------------------- |
1155 // CPhoneStateIdle::ChangeMannerModeL |
1026 // CPhoneStateIdle::ChangeMannerModeL |
1156 // --------------------------------------------------------- |
1027 // --------------------------------------------------------- |
1157 // |
1028 // |
1158 void CPhoneStateIdle::ChangeMannerModeL() |
1029 void CPhoneStateIdle::ChangeMannerModeL() |
1159 { |
1030 { |
1160 __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::ChangeMannerModeL( ) "); |
1031 __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::ChangeMannerModeL( ) "); |
1161 |
|
1162 // Get the profile information |
|
1163 const TInt profileId = |
|
1164 iStateMachine->PhoneEngineInfo()->ProfileId(); |
|
1165 TInt newProfile; |
|
1166 |
|
1167 if ( profileId == EProfileSilentId ) |
|
1168 { |
|
1169 newProfile = EProfileGeneralId; |
|
1170 } |
|
1171 else |
|
1172 { |
|
1173 newProfile = EProfileSilentId; |
|
1174 } |
|
1175 |
|
1176 if ( !iEngine ) |
|
1177 { |
|
1178 iEngine = CreateProfileEngineL(); |
|
1179 } |
|
1180 |
|
1181 iEngine->SetActiveProfileL( newProfile ); |
|
1182 |
|
1183 // Stop playing DTMF tone |
|
1184 iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); |
|
1185 |
|
1186 if ( !iOnScreenDialer ) |
|
1187 { |
|
1188 // Remove the number entry |
|
1189 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
1190 } |
|
1191 else |
|
1192 { |
|
1193 NumberEntryClearL(); |
|
1194 } |
|
1195 |
|
1196 iCbaManager->UpdateCbaL( EPhoneEmptyCBA ); |
|
1197 |
|
1198 // Bring Idle app to the top app |
|
1199 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetIdleTopApplication ); |
|
1200 } |
1032 } |
1201 |
1033 |
1202 // ----------------------------------------------------------- |
1034 // ----------------------------------------------------------- |
1203 // CPhoneStateIdle::DialMultimediaCallL |
1035 // CPhoneStateIdle::DialMultimediaCallL |
1204 // ----------------------------------------------------------- |
1036 // ----------------------------------------------------------- |
1316 CleanupStack::PopAndDestroy( appParam ); |
1148 CleanupStack::PopAndDestroy( appParam ); |
1317 return valuesFetched; |
1149 return valuesFetched; |
1318 } |
1150 } |
1319 |
1151 |
1320 // ----------------------------------------------------------- |
1152 // ----------------------------------------------------------- |
1321 // CPhoneStateIdle::NumberForSpeedDialLocationL |
|
1322 // ----------------------------------------------------------- |
|
1323 // |
|
1324 HBufC* CPhoneStateIdle::NumberForSpeedDialLocationL( |
|
1325 const TUint& aDigit, |
|
1326 TPhoneCmdParamSpeedDial& aSpeedDialParam ) const |
|
1327 { |
|
1328 // Set the speed dial location from the digit in buffer. Character |
|
1329 // '1' means location 1, and so on. |
|
1330 const TInt location = aDigit - KPhoneDtmf1Character + 1; |
|
1331 aSpeedDialParam.SetLocation( location ); |
|
1332 |
|
1333 // Get the number and type from the speed dial location. |
|
1334 HBufC* phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize ); |
|
1335 |
|
1336 TPtr ptr( phoneNumber->Des() ); |
|
1337 aSpeedDialParam.SetPhoneNumber( &ptr ); |
|
1338 iViewCommandHandle->HandleCommandL( |
|
1339 EPhoneViewGetNumberFromSpeedDialLocation, &aSpeedDialParam ); |
|
1340 |
|
1341 CleanupStack::Pop( phoneNumber ); |
|
1342 return phoneNumber; |
|
1343 } |
|
1344 |
|
1345 // ----------------------------------------------------------- |
|
1346 // CPhoneStateIdle::HandleVoiceCallCommandL() |
1153 // CPhoneStateIdle::HandleVoiceCallCommandL() |
1347 // ----------------------------------------------------------- |
1154 // ----------------------------------------------------------- |
1348 // |
1155 // |
1349 void CPhoneStateIdle::HandleVoiceCallCommandL( TBool aSendKey ) |
1156 void CPhoneStateIdle::HandleVoiceCallCommandL() |
1350 { |
1157 { |
1351 __LOGMETHODSTARTEND( |
1158 __LOGMETHODSTARTEND( |
1352 EPhoneControl, "CPhoneStateIdle::HandleVoiceCallCommandL()" ); |
1159 EPhoneControl, "CPhoneStateIdle::HandleVoiceCallCommandL()" ); |
1353 |
1160 |
1354 if ( IsNumberEntryUsedL() ) |
1161 if ( IsNumberEntryUsedL() ) |