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" |
41 #include "tphonecmdparamstring.h" |
40 #include "tphonecmdparamstring.h" |
42 #include "tphonecmdparamspeeddial.h" |
|
43 #include "tphonecmdparamboolean.h" |
41 #include "tphonecmdparamboolean.h" |
44 #include "mphonestatemachine.h" |
42 #include "mphonestatemachine.h" |
45 #include "phonestatedefinitions.h" |
43 #include "phonestatedefinitions.h" |
46 #include "tphonecmdparamappinfo.h" |
44 #include "tphonecmdparamappinfo.h" |
47 #include "cphonekeys.h" |
45 #include "cphonekeys.h" |
856 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
828 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
857 |
829 |
858 // Remove all notes and dialogs |
830 // Remove all notes and dialogs |
859 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
831 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
860 } |
832 } |
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 |
833 |
972 // ----------------------------------------------------------- |
834 // ----------------------------------------------------------- |
973 // CPhoneStateIdle::HandleSendCommandL() |
835 // CPhoneStateIdle::HandleSendCommandL() |
974 // ----------------------------------------------------------- |
836 // ----------------------------------------------------------- |
975 // |
837 // |
976 EXPORT_C void CPhoneStateIdle::HandleSendCommandL() |
838 EXPORT_C void CPhoneStateIdle::HandleSendCommandL() |
977 { |
839 { |
978 __LOGMETHODSTARTEND( |
840 __LOGMETHODSTARTEND( |
979 EPhoneControl, "CPhoneStateIdle::HandleSendCommandL()" ); |
841 EPhoneControl, "CPhoneStateIdle::HandleSendCommandL()" ); |
980 |
842 |
981 HandleVoiceCallCommandL( ETrue ); |
843 HandleVoiceCallCommandL(); |
982 } |
844 } |
983 |
845 |
984 // ----------------------------------------------------------- |
846 // ----------------------------------------------------------- |
985 // CPhoneStateIdle::LaunchApplicationL() |
847 // CPhoneStateIdle::LaunchApplicationL() |
986 // ----------------------------------------------------------- |
848 // ----------------------------------------------------------- |
1316 CleanupStack::PopAndDestroy( appParam ); |
1178 CleanupStack::PopAndDestroy( appParam ); |
1317 return valuesFetched; |
1179 return valuesFetched; |
1318 } |
1180 } |
1319 |
1181 |
1320 // ----------------------------------------------------------- |
1182 // ----------------------------------------------------------- |
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() |
1183 // CPhoneStateIdle::HandleVoiceCallCommandL() |
1347 // ----------------------------------------------------------- |
1184 // ----------------------------------------------------------- |
1348 // |
1185 // |
1349 void CPhoneStateIdle::HandleVoiceCallCommandL( TBool aSendKey ) |
1186 void CPhoneStateIdle::HandleVoiceCallCommandL() |
1350 { |
1187 { |
1351 __LOGMETHODSTARTEND( |
1188 __LOGMETHODSTARTEND( |
1352 EPhoneControl, "CPhoneStateIdle::HandleVoiceCallCommandL()" ); |
1189 EPhoneControl, "CPhoneStateIdle::HandleVoiceCallCommandL()" ); |
1353 |
1190 |
1354 if ( IsNumberEntryUsedL() ) |
1191 if ( IsNumberEntryUsedL() ) |