30 |
30 |
31 #include <AknTasHook.h> |
31 #include <AknTasHook.h> |
32 #include <touchfeedback.h> |
32 #include <touchfeedback.h> |
33 #include <aknnotedialog.h> |
33 #include <aknnotedialog.h> |
34 |
34 |
|
35 #include <e32property.h> |
|
36 #include <AvkonInternalCRKeys.h> // for checking qwerty availability |
|
37 |
|
38 |
35 static const TInt KPlainTextPos = 0; |
39 static const TInt KPlainTextPos = 0; |
36 |
40 |
37 typedef CArrayFixFlat<CAknPhoneNumberEditor::TFormat> CFormatArray; |
41 typedef CArrayFixFlat<CAknPhoneNumberEditor::TFormat> CFormatArray; |
38 |
42 |
39 NONSHARABLE_CLASS( CAknPhoneNumberEditorExtension ) : public CBase, |
43 NONSHARABLE_CLASS( CAknPhoneNumberEditorExtension ) : public CBase, |
50 CFormatArray* iFormats; |
54 CFormatArray* iFormats; |
51 CAknExtendedInputCapabilities* iExtendedInputCapabilities; |
55 CAknExtendedInputCapabilities* iExtendedInputCapabilities; |
52 TInt iPointPos; |
56 TInt iPointPos; |
53 CAknCcpuSupport* iCcpuSupport; |
57 CAknCcpuSupport* iCcpuSupport; |
54 HBufC* iPasteText; |
58 HBufC* iPasteText; |
|
59 TBool iQwertyAllowed; |
|
60 TBool iHybridModeAllowed; |
55 }; |
61 }; |
56 |
62 |
57 CAknPhoneNumberEditorExtension::CAknPhoneNumberEditorExtension() |
63 CAknPhoneNumberEditorExtension::CAknPhoneNumberEditorExtension() |
58 { |
64 { |
59 iFormats = NULL; |
65 iFormats = NULL; |
433 iView->Draw( SystemGc(), iFlags[ERedrawAll], this ); |
439 iView->Draw( SystemGc(), iFlags[ERedrawAll], this ); |
434 } |
440 } |
435 |
441 |
436 EXPORT_C TCoeInputCapabilities CAknPhoneNumberEditor::InputCapabilities() const |
442 EXPORT_C TCoeInputCapabilities CAknPhoneNumberEditor::InputCapabilities() const |
437 { |
443 { |
438 if ( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) ) |
444 if ( iExtension->iQwertyAllowed ) |
439 { |
445 { |
440 TCoeInputCapabilities inputCaps( |
446 TCoeInputCapabilities inputCaps( |
441 TCoeInputCapabilities::EWesternAlphabetic | |
447 TCoeInputCapabilities::EWesternAlphabetic | |
442 TCoeInputCapabilities::ENavigation, |
448 TCoeInputCapabilities::ENavigation, |
443 const_cast<CAknPhoneNumberEditor*>( this ), NULL ); |
449 const_cast<CAknPhoneNumberEditor*>( this ), NULL ); |
444 |
450 |
|
451 //iExtension->iExtendedInputCapabilities->SetEditorType( |
|
452 // CAknExtendedInputCapabilities::EPhoneNumberEditor ); |
|
453 TInt qwertyActive = 0; |
|
454 RProperty::Get( KCRUidAvkon, KAknQwertyInputModeActive, qwertyActive ); |
|
455 if ( qwertyActive && iExtension->iHybridModeAllowed ) |
|
456 { |
|
457 iExtension->iExtendedInputCapabilities->SetEditorType( |
|
458 CAknExtendedInputCapabilities::EHybridAlphaNumericEditor ); |
|
459 } |
|
460 else |
|
461 { |
|
462 iExtension->iExtendedInputCapabilities->SetEditorType( |
|
463 CAknExtendedInputCapabilities::EPhoneNumberEditor ); |
|
464 } |
|
465 |
445 // Voip-enabled phone editor wants to use edit-key style hash key mode selection. |
466 // Voip-enabled phone editor wants to use edit-key style hash key mode selection. |
446 iExtension->iExtendedInputCapabilities->SetEditorType( |
|
447 CAknExtendedInputCapabilities::EPhoneNumberEditor ); |
|
448 iExtension->iExtendedInputCapabilities->SetCapabilities( |
467 iExtension->iExtendedInputCapabilities->SetCapabilities( |
449 CAknExtendedInputCapabilities::EForceHashKeySelectionStatusFlagOff | |
468 CAknExtendedInputCapabilities::EForceHashKeySelectionStatusFlagOff | |
450 CAknExtendedInputCapabilities::EForceEditSubmenuStatusFlagOff ); |
469 CAknExtendedInputCapabilities::EForceEditSubmenuStatusFlagOff ); |
451 inputCaps.SetObjectProvider( |
470 inputCaps.SetObjectProvider( |
452 const_cast<CAknPhoneNumberEditorExtension*>( iExtension ) ); |
471 const_cast<CAknPhoneNumberEditorExtension*>( iExtension ) ); |
770 // |
789 // |
771 EXPORT_C TInt CAknPhoneNumberEditor::ChangeEditorMode( TBool aDefaultMode ) |
790 EXPORT_C TInt CAknPhoneNumberEditor::ChangeEditorMode( TBool aDefaultMode ) |
772 { |
791 { |
773 TInt value( EAknEditorNumericInputMode ); // Return value. |
792 TInt value( EAknEditorNumericInputMode ); // Return value. |
774 |
793 |
775 if ( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) ) |
794 if ( iExtension->iQwertyAllowed ) |
776 { |
795 { |
777 CAknEdwinState* fepState = ( CAknEdwinState* )iFepState; |
796 CAknEdwinState* fepState = ( CAknEdwinState* )iFepState; |
778 |
797 |
779 // Get current input mode. |
798 // Get current input mode. |
780 TInt currentInputMode = fepState->CurrentInputMode(); |
799 TInt currentInputMode = fepState->CurrentInputMode(); |
874 fepState->SetCurrentCase( EAknEditorLowerCase ); |
893 fepState->SetCurrentCase( EAknEditorLowerCase ); |
875 fepState->SetPermittedCases( EAknEditorLowerCase | EAknEditorUpperCase ); |
894 fepState->SetPermittedCases( EAknEditorLowerCase | EAknEditorUpperCase ); |
876 fepState->SetSpecialCharacterTableResourceId( 0 ); |
895 fepState->SetSpecialCharacterTableResourceId( 0 ); |
877 fepState->SetNumericKeymap( EAknEditorStandardNumberModeKeymap ); |
896 fepState->SetNumericKeymap( EAknEditorStandardNumberModeKeymap ); |
878 |
897 |
|
898 iExtension->iQwertyAllowed = EFalse; |
|
899 iExtension->iHybridModeAllowed = EFalse; |
|
900 |
879 DrawChanges(); |
901 DrawChanges(); |
880 } |
902 } |
|
903 |
|
904 |
|
905 // -------------------------------------------------------------------------- |
|
906 // CAknPhoneNumberEditor::SetQwertyAllowed |
|
907 // -------------------------------------------------------------------------- |
|
908 // |
|
909 EXPORT_C void CAknPhoneNumberEditor::SetQwertyAllowed( TBool aQwertyAllowed ) |
|
910 { |
|
911 iExtension->iQwertyAllowed = aQwertyAllowed; |
|
912 } |
|
913 |
|
914 // -------------------------------------------------------------------------- |
|
915 // CAknPhoneNumberEditor::SetHybridModeAllowed |
|
916 // -------------------------------------------------------------------------- |
|
917 // |
|
918 EXPORT_C void CAknPhoneNumberEditor::SetHybridModeAllowed( TBool aHybridModeAllowed ) |
|
919 { |
|
920 iExtension->iHybridModeAllowed = aHybridModeAllowed; |
|
921 } |
|
922 |
881 |
923 |
882 // -------------------------------------------------------------------------- |
924 // -------------------------------------------------------------------------- |
883 // CAknPhoneNumberEditor::HandlePointerEventL |
925 // CAknPhoneNumberEditor::HandlePointerEventL |
884 // -------------------------------------------------------------------------- |
926 // -------------------------------------------------------------------------- |
885 // |
927 // |