683 SendIcfDataL(EPluginSyncUpdatedText); |
683 SendIcfDataL(EPluginSyncUpdatedText); |
684 } |
684 } |
685 break; |
685 break; |
686 case ESignalEnterSpellMode: |
686 case ESignalEnterSpellMode: |
687 { |
687 { |
|
688 iCurrentPluginInputFepUI->HandleCommandL(ECmdPeninputDisableLayoutDrawing,ETrue); |
688 iFepMan.LaunchEditWordQueryL(); |
689 iFepMan.LaunchEditWordQueryL(); |
689 } |
690 } |
690 break; |
691 break; |
691 case ESignalExitSpellMode: |
692 case ESignalExitSpellMode: |
692 { |
693 { |
693 TInt* ptrData = (TInt*)(pBuf.Ptr()); |
694 TInt* ptrData = (TInt*)(pBuf.Ptr()); |
694 TBool exitbyok = *(ptrData); |
695 TBool exitbyok = *(ptrData); |
695 |
696 |
|
697 //remove spell mode editor will cause focus change, so as pen UI is closed and opened again. |
|
698 iFocuschangedForSpellEditor = ETrue; |
|
699 iCurrentPluginInputFepUI->HandleCommandL(ECmdPeninputDisableLayoutDrawing,ETrue); |
|
700 |
696 exitbyok ? iFepMan.ExitPluginSpellModeByOk() : |
701 exitbyok ? iFepMan.ExitPluginSpellModeByOk() : |
697 iFepMan.ExitPluginSpellModeByCancel(); |
702 iFepMan.ExitPluginSpellModeByCancel(); |
698 } |
703 } |
699 break; |
704 break; |
700 case ESignalLaunchSCT: |
705 case ESignalLaunchSCT: |
766 { |
771 { |
767 // Commit autocompletion |
772 // Commit autocompletion |
768 iFepMan.CommitInlineEditL(); |
773 iFepMan.CommitInlineEditL(); |
769 // Need to commit into engine, it will clear textbuffer in it. |
774 // Need to commit into engine, it will clear textbuffer in it. |
770 iFepMan.PtiEngine()->CommitCurrentWord(); |
775 iFepMan.PtiEngine()->CommitCurrentWord(); |
|
776 } |
|
777 break; |
|
778 case ESignalDeleteLastInput: |
|
779 { |
|
780 |
|
781 iFepMan.SetFlag( CAknFepManager::EFlagSupressAutoUpdate ); |
|
782 |
|
783 //set selection |
|
784 MCoeFepAwareTextEditor* edit = iFepMan.FepAwareTextEditor(); |
|
785 if( iFepMan.IsFepAwareTextEditor() && edit ) |
|
786 { |
|
787 TCursorSelection curSor; |
|
788 edit->GetCursorSelectionForFep(curSor); |
|
789 if ( curSor.iAnchorPos == curSor.iCursorPos ) |
|
790 { |
|
791 curSor.iAnchorPos = curSor.iCursorPos - iLastSubmitCount; |
|
792 |
|
793 if (curSor.iAnchorPos<0 || |
|
794 curSor.iAnchorPos>edit->DocumentLengthForFep()) |
|
795 { |
|
796 break; |
|
797 } |
|
798 |
|
799 if (curSor.iCursorPos > curSor.iAnchorPos) |
|
800 { |
|
801 edit->SetCursorSelectionForFepL(curSor); |
|
802 } |
|
803 } |
|
804 TBuf<1> backSpace; |
|
805 backSpace.Append(TChar(EKeyBackspace)); |
|
806 SubmitUiPluginTextL(backSpace, EKeyEvent); |
|
807 } |
|
808 iFepMan.ClearFlag( CAknFepManager::EFlagSupressAutoUpdate ); |
|
809 |
|
810 } |
|
811 break; |
|
812 case ESignalArabicSCTChar: |
|
813 { |
|
814 TPtrC ptr( const_cast<TUint16*>(pBuf.Ptr()), pBuf.Length()); |
|
815 // if(iFepMan.InputMode() == ELatin && (iPluginInputMode == EPluginInputModeVkb || |
|
816 // iPluginInputMode == EPluginInputModeFSQ)) |
|
817 // { |
|
818 // AdjustDataCase( ptr ); |
|
819 // } |
|
820 iFepMan.StartInlineEditL(ptr); |
|
821 iFepMan.CommitInlineEditL(); |
|
822 SendIcfDataL( EPluginSyncAll ); |
|
823 // OnPenInputServerKeyEventL(pBuf); |
771 } |
824 } |
772 break; |
825 break; |
773 default: |
826 default: |
774 break; |
827 break; |
775 } |
828 } |
1105 TBool landscape = size.iPixelSize.iWidth > size.iPixelSize.iHeight; |
1165 TBool landscape = size.iPixelSize.iWidth > size.iPixelSize.iHeight; |
1106 TBool disableFSQ = |
1166 TBool disableFSQ = |
1107 ( aSuggestMode == EPluginInputModeFSQ && |
1167 ( aSuggestMode == EPluginInputModeFSQ && |
1108 ( iDefaultOrientation == CAknAppUiBase::EAppUiOrientationPortrait || |
1168 ( iDefaultOrientation == CAknAppUiBase::EAppUiOrientationPortrait || |
1109 ( !landscape && !iAvkonAppUi->OrientationCanBeChanged() ) ) ); |
1169 ( !landscape && !iAvkonAppUi->OrientationCanBeChanged() ) ) ); |
|
1170 |
1110 |
1171 |
1111 if ( disableFSQ ) |
1172 if ( disableFSQ ) |
1112 { |
1173 { |
1113 iPenInputServer.SetDisabledLayout( EPluginInputModeFSQ ); |
1174 iPenInputServer.SetDisabledLayout( EPluginInputModeFSQ ); |
1114 } |
1175 } |
1115 |
1176 |
1116 if ( aSuggestMode == EPluginInputModeFSQ || (aSuggestMode == EPluginInputModeFingerHwr |
1177 TBool disableITUT = |
1117 && iSharedData.InputTextLanguage() == ELangArabic |
1178 ( iDefaultOrientation == CAknAppUiBase::EAppUiOrientationLandscape || |
1118 && iSharedData.AutoRotateEnabled())) |
1179 ( landscape && !iAvkonAppUi->OrientationCanBeChanged() ) ) ; |
|
1180 |
|
1181 if( disableITUT ) |
|
1182 { |
|
1183 //disable V-ITUT, and if current aSuggestMode is EPluginInputModeItut, replace it with EPluginInputModeFSQ; |
|
1184 iPenInputServer.SetDisabledLayout( EPluginInputModeItut ); |
|
1185 if( aSuggestMode == EPluginInputModeItut ) |
|
1186 { |
|
1187 aSuggestMode = EPluginInputModeFSQ; |
|
1188 } |
|
1189 } |
|
1190 else |
|
1191 { |
|
1192 // if V-ITUT had been disabled before, enable it now; |
|
1193 TInt disableMode = iPenInputServer.DisabledLayout(); |
|
1194 if( disableMode & EPluginInputModeItut ) |
|
1195 { |
|
1196 iPenInputServer.SetDisabledLayout( -1 );//reset |
|
1197 iPenInputServer.SetDisabledLayout( disableMode & ~EPluginInputModeItut ); |
|
1198 } |
|
1199 } |
|
1200 |
|
1201 |
|
1202 if ( aSuggestMode == EPluginInputModeFSQ) |
1119 { |
1203 { |
1120 TPluginInputMode tempInputMode = iPluginInputMode; |
1204 TPluginInputMode tempInputMode = iPluginInputMode; |
1121 iPluginInputMode = aSuggestMode; |
1205 iPluginInputMode = aSuggestMode; |
1122 |
1206 |
1123 if (disableFSQ && (aSuggestMode != EPluginInputModeFingerHwr)) |
1207 if (disableFSQ && (aSuggestMode != EPluginInputModeFingerHwr)) |
1551 LaunchPenInputSettingL(); |
1651 LaunchPenInputSettingL(); |
1552 } |
1652 } |
1553 break; |
1653 break; |
1554 case EPenInputCmdVITUT: |
1654 case EPenInputCmdVITUT: |
1555 { |
1655 { |
|
1656 //Here calling this function is to reset menu state when the focus change caused by |
|
1657 //the screen orientation, in the normal circumstance the foucus change should not |
|
1658 //occur while the screen orientation is handling. So directly resetting menu state |
|
1659 //to avoid the above case, preconditon is that the option menu must be closed. |
|
1660 ResetMenuState(); |
1556 ClosePluginInputModeL(ETrue); |
1661 ClosePluginInputModeL(ETrue); |
1557 iFepMan.TryCloseUiL(); |
1662 iFepMan.TryCloseUiL(); |
1558 TryChangePluginInputModeByModeL(EPluginInputModeItut, |
1663 TryChangePluginInputModeByModeL(EPluginInputModeItut, |
1559 EPenInputOpenManually, |
1664 EPenInputOpenManually, |
1560 ERangeInvalid); |
1665 ERangeInvalid); |
1561 } |
1666 } |
1562 break; |
1667 break; |
1563 case EPeninputCmdFSQ: |
1668 case EPeninputCmdFSQ: |
1564 { |
1669 { |
|
1670 //Here calling this function is to reset menu state when the focus change caused by |
|
1671 //the screen orientation, in the normal circumstance the foucus change should not |
|
1672 //occur while the screen orientation is handling. So directly resetting menu state |
|
1673 //to avoid the above case, preconditon is that the option menu must be closed. |
|
1674 ResetMenuState(); |
1565 ClosePluginInputModeL(ETrue); |
1675 ClosePluginInputModeL(ETrue); |
1566 iFepMan.TryCloseUiL(); |
1676 iFepMan.TryCloseUiL(); |
1567 TryChangePluginInputModeByModeL(EPluginInputModeFSQ, |
1677 TryChangePluginInputModeByModeL(EPluginInputModeFSQ, |
1568 EPenInputOpenManually, |
1678 EPenInputOpenManually, |
1569 ERangeInvalid); |
1679 ERangeInvalid); |
1570 } |
1680 } |
1571 break; |
1681 break; |
1572 case EPeninputCmdHwr: |
1682 case EPeninputCmdHwr: |
1573 { |
1683 { |
|
1684 //Here calling this function is to reset menu state when the focus change caused by |
|
1685 //the screen orientation, in the normal circumstance the foucus change should not |
|
1686 //occur while the screen orientation is handling. So directly resetting menu state |
|
1687 //to avoid the above case, preconditon is that the option menu must be closed. |
|
1688 ResetMenuState(); |
1574 ClosePluginInputModeL(ETrue); |
1689 ClosePluginInputModeL(ETrue); |
1575 iFepMan.TryCloseUiL(); |
1690 iFepMan.TryCloseUiL(); |
1576 TryChangePluginInputModeByModeL( EPluginInputModeFingerHwr, |
1691 TryChangePluginInputModeByModeL( EPluginInputModeFingerHwr, |
1577 EPenInputOpenManually, |
1692 EPenInputOpenManually, |
1578 ERangeInvalid ); |
1693 ERangeInvalid ); |
1938 && !( disabledInputMode & EPluginInputModeItut )) |
2053 && !( disabledInputMode & EPluginInputModeItut )) |
1939 { |
2054 { |
1940 aMenuPane->SetItemDimmed(EPenInputCmdVITUT, EFalse); |
2055 aMenuPane->SetItemDimmed(EPenInputCmdVITUT, EFalse); |
1941 } |
2056 } |
1942 |
2057 |
1943 //if ( iFepMan.IsArabicInputLanguage() && ( curInputMode != EPluginInputModeFingerHwr ) |
2058 if ( FeatureManager::FeatureSupported( KFeatureIdArabicHandwritingRecognitionInput ) |
1944 // && !( disabledInputMode & EPluginInputModeFingerHwr )) |
2059 &&iFepMan.IsArabicInputLanguage() |
1945 // { |
2060 && ( curInputMode != EPluginInputModeFingerHwr ) |
1946 // aMenuPane->SetItemDimmed( EPeninputCmdHwr, EFalse ); |
2061 && !( disabledInputMode & EPluginInputModeFingerHwr )) |
1947 // } |
2062 { |
1948 //For arabic finger hwr input orientation. |
2063 aMenuPane->SetItemDimmed( EPeninputCmdHwr, EFalse ); |
1949 TInt index = 0; |
2064 } |
1950 if(iPluginInputMode == EPluginInputModeFingerHwr |
2065 |
1951 && (ELangArabic == iSharedData.InputTextLanguage()) |
2066 // check if this is the arabic finger hwr |
1952 && (!iSharedData.AutoRotateEnabled())) |
2067 TBool isArabicFingerHwr = (iPluginInputMode == EPluginInputModeFingerHwr |
1953 { |
2068 && ELangArabic == iSharedData.InputTextLanguage()); |
1954 TBool disableMenu = ETrue; |
2069 |
1955 TPixelsTwipsAndRotation size; |
2070 // Initialize the menu item for Arabic Finger HWR |
1956 CCoeEnv::Static()->ScreenDevice()->GetDefaultScreenSizeAndRotation(size); |
2071 if(isArabicFingerHwr) |
1957 TBool landscape = size.iPixelSize.iWidth > size.iPixelSize.iHeight; |
2072 { |
1958 if(landscape && aMenuPane->MenuItemExists(EPenInputCmdHwrInputToPortrait, index)) |
2073 InitMenuItemForArabicFingerHwrL(aMenuPane); |
1959 { |
2074 } |
1960 disableMenu = EFalse; |
|
1961 aMenuPane->SetItemDimmed(EPenInputCmdHwrInputToPortrait,disableMenu); |
|
1962 } |
|
1963 index = 0; |
|
1964 if(!landscape && aMenuPane->MenuItemExists(EPenInputCmdHwrInputToLandscape, index)) |
|
1965 { |
|
1966 disableMenu = EFalse; |
|
1967 aMenuPane->SetItemDimmed(EPenInputCmdHwrInputToLandscape,disableMenu); |
|
1968 } |
|
1969 } |
|
1970 |
|
1971 //For arabic finger hwr switch to key based input. |
|
1972 index = 0; |
|
1973 if(aMenuPane->MenuItemExists( |
|
1974 EPenInputCmdSwitchToVkeyBasedInput, index)) |
|
1975 { |
|
1976 TBool disableMenu = ETrue; |
|
1977 if(iPluginInputMode == EPluginInputModeFingerHwr |
|
1978 && (ELangArabic == iSharedData.InputTextLanguage())) |
|
1979 { |
|
1980 disableMenu = EFalse; |
|
1981 } |
|
1982 aMenuPane->SetItemDimmed(EPenInputCmdSwitchToVkeyBasedInput,disableMenu); |
|
1983 } |
|
1984 //For arabic finger hwr writing speed. |
|
1985 index = 0; |
|
1986 if(aMenuPane->MenuItemExists( |
|
1987 EPenInputCmdWritingSpeed, index)) |
|
1988 { |
|
1989 TBool disableMenu = ETrue; |
|
1990 if(iPluginInputMode == EPluginInputModeFingerHwr |
|
1991 && (ELangArabic == iSharedData.InputTextLanguage())) |
|
1992 { |
|
1993 disableMenu = EFalse; |
|
1994 } |
|
1995 aMenuPane->SetItemDimmed(EPenInputCmdWritingSpeed,disableMenu); |
|
1996 } |
|
1997 //For arabic finger hwr guide line. |
|
1998 index = 0; |
|
1999 if(aMenuPane->MenuItemExists( |
|
2000 EPenInputCmdGuidingLine, index)) |
|
2001 { |
|
2002 TBool disableMenu = ETrue; |
|
2003 if(iPluginInputMode == EPluginInputModeFingerHwr |
|
2004 && (ELangArabic == iSharedData.InputTextLanguage())) |
|
2005 { |
|
2006 disableMenu = EFalse; |
|
2007 } |
|
2008 aMenuPane->SetItemDimmed(EPenInputCmdGuidingLine,disableMenu); |
|
2009 } |
|
2010 |
2075 |
2011 iLangMan.CurrentImePlugin()->DynInitMenuPaneL(aMenuPane); |
2076 iLangMan.CurrentImePlugin()->DynInitMenuPaneL(aMenuPane); |
2012 } |
2077 } |
2013 |
2078 } |
2014 |
2079 |
2015 } |
2080 void CAknFepPluginManager::InitMenuItemForArabicFingerHwrL(CAknFepUiInterfaceMenuPane* aMenuPane) |
2016 |
2081 { |
|
2082 TInt index = 0; |
|
2083 TBool isAutoRotateEnabled = iSharedData.AutoRotateEnabled(); |
|
2084 // add menu item to switch to landscape or protrait |
|
2085 if(!isAutoRotateEnabled) |
|
2086 { |
|
2087 TPixelsTwipsAndRotation size; |
|
2088 CCoeEnv::Static()->ScreenDevice()->GetDefaultScreenSizeAndRotation(size); |
|
2089 TBool landscape = size.iPixelSize.iWidth > size.iPixelSize.iHeight; |
|
2090 if(landscape) |
|
2091 { |
|
2092 index = 0; |
|
2093 // add switch to protrait |
|
2094 if(aMenuPane->MenuItemExists(EPenInputCmdHwrInputToPortrait, index)) |
|
2095 { |
|
2096 aMenuPane->SetItemDimmed(EPenInputCmdHwrInputToPortrait,EFalse); |
|
2097 } |
|
2098 } |
|
2099 else |
|
2100 { |
|
2101 index = 0; |
|
2102 // add switch to landscape |
|
2103 if(aMenuPane->MenuItemExists(EPenInputCmdHwrInputToLandscape, index)) |
|
2104 { |
|
2105 aMenuPane->SetItemDimmed(EPenInputCmdHwrInputToLandscape,EFalse); |
|
2106 } |
|
2107 } |
|
2108 } |
|
2109 |
|
2110 // hide the setting menu |
|
2111 // index = 0; |
|
2112 // if(aMenuPane->MenuItemExists(EPenInputCmdSetting, index)) |
|
2113 // { |
|
2114 // aMenuPane->SetItemDimmed(EPenInputCmdSetting, ETrue); |
|
2115 // } |
|
2116 |
|
2117 //Show number mode menu item. |
|
2118 if(iFepMan.InputMode() == ENumber || iFepMan.InputMode() == ENativeNumber) |
|
2119 { |
|
2120 if(iSharedData.DefaultArabicNumberMode()) |
|
2121 { |
|
2122 aMenuPane->SetItemDimmed(EAknCmdEditModeNumber, EFalse); |
|
2123 } |
|
2124 else |
|
2125 { |
|
2126 aMenuPane->SetItemDimmed(EAknCmdEditModeArabicIndicNumber, EFalse); |
|
2127 } |
|
2128 } |
|
2129 // add the writing speed menu |
|
2130 index = 0; |
|
2131 if(aMenuPane->MenuItemExists(EPenInputCmdWritingSpeed, index)) |
|
2132 { |
|
2133 aMenuPane->SetItemDimmed(EPenInputCmdWritingSpeed,EFalse); |
|
2134 } |
|
2135 |
|
2136 // add the guidingline menu |
|
2137 index = 0; |
|
2138 if(aMenuPane->MenuItemExists(EPenInputCmdGuidingLine, index)) |
|
2139 { |
|
2140 aMenuPane->SetItemDimmed(EPenInputCmdGuidingLine,EFalse); |
|
2141 } |
|
2142 } |
|
2143 |
2017 // --------------------------------------------------------------------------- |
2144 // --------------------------------------------------------------------------- |
2018 // CAknFepPluginManager::OnFocusChangedL |
2145 // CAknFepPluginManager::OnFocusChangedL |
2019 // (other items were commented in a header) |
2146 // (other items were commented in a header) |
2020 // --------------------------------------------------------------------------- |
2147 // --------------------------------------------------------------------------- |
2021 // |
2148 // |
5606 // Do some configuration to make FSQ support ITI features. |
5761 // Do some configuration to make FSQ support ITI features. |
5607 // ----------------------------------------------------------------------------- |
5762 // ----------------------------------------------------------------------------- |
5608 // |
5763 // |
5609 void CAknFepPluginManager::SetItiStateL() |
5764 void CAknFepPluginManager::SetItiStateL() |
5610 { |
5765 { |
5611 if ( iIsITIConfigured || !IsSupportITIOnFSQ() ) |
5766 if ( !IsSupportITIOnFSQ() ) |
5612 { |
5767 { |
5613 return; |
5768 return; |
|
5769 } |
|
5770 if ( iIsITIConfigured ) |
|
5771 { |
|
5772 // if fep state has been configed to iti status before, |
|
5773 // there is no need to config fep state again, |
|
5774 // but sending command to fsq to update iti status flag is needed. |
|
5775 iCurrentPluginInputFepUI->HandleCommandL( ECmdPeninputITIStatus, |
|
5776 iFepMan.WesternPredictive() ); |
|
5777 return; |
5614 } |
5778 } |
5615 // 1. Config keyboard layout type |
5779 // 1. Config keyboard layout type |
5616 SetItiKeyboardLayoutL(); |
5780 SetItiKeyboardLayoutL(); |
5617 |
5781 |
5618 // 2. Change FEP to qwerty mode. |
5782 // 2. Change FEP to qwerty mode. |