fep/aknfep/src/AknFepPluginManager.cpp
branchRCL_3
changeset 5 a47de9135b21
parent 3 f5a1e66df979
child 6 6ceef9a83b1a
equal deleted inserted replaced
3:f5a1e66df979 5:a47de9135b21
   102 _LIT(KVQWERTY_HLP_MAIN_VIEW, "VQWERTY_HLP_MAIN_VIEW"); 
   102 _LIT(KVQWERTY_HLP_MAIN_VIEW, "VQWERTY_HLP_MAIN_VIEW"); 
   103 _LIT(KVITU_HLP_MAIN_VIEW, "VITU_HLP_MAIN_VIEW");
   103 _LIT(KVITU_HLP_MAIN_VIEW, "VITU_HLP_MAIN_VIEW");
   104 
   104 
   105 const TInt KDefaultCandidateArraySize = 16;
   105 const TInt KDefaultCandidateArraySize = 16;
   106 const TInt KNumberOfCases = 6;
   106 const TInt KNumberOfCases = 6;
       
   107 
       
   108  _LIT_SECURE_ID(KPhoneSecureId, 0x100058b3);
   107 
   109 
   108 #define iAvkonAppUi ((CAknAppUi*)CEikonEnv::Static()->EikAppUi())
   110 #define iAvkonAppUi ((CAknAppUi*)CEikonEnv::Static()->EikAppUi())
   109 TUid AppUidFromWndGroupIdL(TInt aWndGrpId)
   111 TUid AppUidFromWndGroupIdL(TInt aWndGrpId)
   110     {
   112     {
   111     RWsSession &ws = CCoeEnv::Static()->WsSession();
   113     RWsSession &ws = CCoeEnv::Static()->WsSession();
   579                     TInt subrange = *(TInt* )( (TInt8* )(pBuf.Ptr()) + sizeof(TInt) );
   581                     TInt subrange = *(TInt* )( (TInt8* )(pBuf.Ptr()) + sizeof(TInt) );
   580                     iCurrentPluginInputFepUI->HandleCommandL(ECmdPenInputJapaneseSetSubRange, 
   582                     iCurrentPluginInputFepUI->HandleCommandL(ECmdPenInputJapaneseSetSubRange, 
   581                                                              subrange);
   583                                                              subrange);
   582                     }
   584                     }
   583                 SyncIndicatorWithPluginRangeL();
   585                 SyncIndicatorWithPluginRangeL();
       
   586                 if ( PluginInputMode() == EPluginInputModeFSQ )
       
   587                     {
       
   588 					UpdateFSQIndicator();
       
   589                     }
   584                 }
   590                 }
   585                 break;
   591                 break;
   586             case ESignalLayoutUIChanged:
   592             case ESignalLayoutUIChanged:
   587                 {
   593                 {
   588                 TInt8 *ptrData = (TInt8* )(pBuf.Ptr());
   594                 TInt8 *ptrData = (TInt8* )(pBuf.Ptr());
   780     {
   786     {
   781 
   787 
   782     if( iPluginInputMode == EPluginInputModeNone && 
   788     if( iPluginInputMode == EPluginInputModeNone && 
   783         aEventType != EPluginEditorActivate && 
   789         aEventType != EPluginEditorActivate && 
   784         aEventType != EPluginActivate &&
   790         aEventType != EPluginActivate &&
   785         aEventType != EPluginResourceChanged )
   791         aEventType != EPluginResourceChanged &&
       
   792         aEventType != EPluginSwitchMode &&
       
   793         aEventType != EPluginSwitchToPortrait &&
       
   794         aEventType != EPluginSwitchToLandscape)
   786         {      
   795         {      
   787         return;
   796         return;
   788         }
   797         }
   789         
   798         
   790     switch ( aEventType )
   799     switch ( aEventType )
   886             }
   895             }
   887             break;
   896             break;
   888         case EPluginUpdateIndicator:
   897         case EPluginUpdateIndicator:
   889             {
   898             {
   890             UpdateITUTIndicator();
   899             UpdateITUTIndicator();
       
   900             if ( PluginInputMode() == EPluginInputModeFSQ )
       
   901                 {
       
   902 				UpdateFSQIndicator();
       
   903                 }
   891             }
   904             }
   892             break;
   905             break;
   893         case EPluginPreview:
   906         case EPluginPreview:
   894             {
   907             {
   895             iCurrentPluginInputFepUI->HandleCommandL(ECmdPenInputCharacterPreview, 
   908             iCurrentPluginInputFepUI->HandleCommandL(ECmdPenInputCharacterPreview, 
   917         case EPluginHideTooltip:
   930         case EPluginHideTooltip:
   918         	{
   931         	{
   919         	HideTooltipOnFSQL();
   932         	HideTooltipOnFSQL();
   920         	}
   933         	}
   921         	break;
   934         	break;
       
   935         case EPluginSwitchToPortrait:
       
   936             {
       
   937             iSharedData.SetDefaultArabicFingerHwrOrientation(0);
       
   938             TryChangePluginInputModeByModeL(EPluginInputModeFingerHwr,
       
   939                                             EPenInputOpenManually,
       
   940                                             ERangeInvalid);
       
   941             }
       
   942             break;
       
   943         case EPluginSwitchToLandscape:
       
   944             {
       
   945             iSharedData.SetDefaultArabicFingerHwrOrientation(1);            
       
   946             TryChangePluginInputModeByModeL(EPluginInputModeFingerHwr,
       
   947                                             EPenInputOpenManually,
       
   948                                             ERangeInvalid);
       
   949             }
       
   950             break;
       
   951         case EPluginSwitchMode:
       
   952             {
       
   953             iPreferredUiMode = EFalse;
       
   954             TPluginInputMode defaultMode = EPluginInputModeNone;
       
   955             TPixelsTwipsAndRotation size; 
       
   956             CCoeEnv::Static()->ScreenDevice()->GetDefaultScreenSizeAndRotation(size);
       
   957         
       
   958             TBool landscape = size.iPixelSize.iWidth > size.iPixelSize.iHeight;
       
   959             if(iSharedData.AutoRotateEnabled())
       
   960                 {
       
   961                 if(landscape)
       
   962                     {
       
   963                     defaultMode = EPluginInputModeVkb;
       
   964                     }
       
   965                 else
       
   966                     {
       
   967                     defaultMode = EPluginInputModeItut;
       
   968                     }
       
   969                 }
       
   970             else
       
   971                 {
       
   972                 defaultMode = EPluginInputModeItut;
       
   973                 }
       
   974             TryChangePluginInputModeByModeL(defaultMode,
       
   975                                             EPenInputOpenManually,
       
   976                                             ERangeInvalid);
       
   977             }
       
   978             break;
   922         default:
   979         default:
   923             break;
   980             break;
   924         }
   981         }
   925     }
   982     }
   926             
   983             
  1006     if ( disableFSQ )
  1063     if ( disableFSQ )
  1007         {
  1064         {
  1008         iPenInputServer.SetDisabledLayout( EPluginInputModeFSQ );
  1065         iPenInputServer.SetDisabledLayout( EPluginInputModeFSQ );
  1009         }
  1066         }
  1010 
  1067 
  1011     if ( aSuggestMode == EPluginInputModeFSQ )
  1068     if ( aSuggestMode == EPluginInputModeFSQ || (aSuggestMode == EPluginInputModeFingerHwr 
       
  1069 	     && iSharedData.InputTextLanguage() == ELangArabic
       
  1070 	     && iSharedData.AutoRotateEnabled()))
  1012         {
  1071         {
  1013         TPluginInputMode tempInputMode = iPluginInputMode;           
  1072         TPluginInputMode tempInputMode = iPluginInputMode;           
  1014         iPluginInputMode = EPluginInputModeFSQ;
  1073         iPluginInputMode = aSuggestMode;
  1015         
  1074         
  1016         if (disableFSQ )
  1075         if (disableFSQ && (aSuggestMode != EPluginInputModeFingerHwr))
  1017             {
  1076             {
  1018             iPluginInputMode = tempInputMode;
  1077             iPluginInputMode = tempInputMode;
  1019             aSuggestMode = EPluginInputModeItut;
  1078             aSuggestMode = EPluginInputModeItut;
  1020             }
  1079             }
  1021         else
  1080         else
  1022             {
  1081             {
  1023             if ( !iSharedData.AutoRotateEnabled() )
  1082             if ( (!iSharedData.AutoRotateEnabled() 
       
  1083                     && aSuggestMode == EPluginInputModeFSQ) || 
       
  1084                   (aSuggestMode == EPluginInputModeFingerHwr))
  1024                 {
  1085                 {
  1025                 iFepMan.SetNotifyPlugin( EFalse );
  1086                 iFepMan.SetNotifyPlugin( EFalse );
  1026                 iAvkonAppUi->SetOrientationL( CAknAppUiBase::EAppUiOrientationLandscape );
  1087                 iAvkonAppUi->SetOrientationL( CAknAppUiBase::EAppUiOrientationLandscape );
  1027                 iFepMan.SetNotifyPlugin( ETrue );
  1088                 iFepMan.SetNotifyPlugin( ETrue );
  1028                 iOrientationChanged = ETrue;
  1089                 iOrientationChanged = ETrue;
  1032             landscape = size.iPixelSize.iWidth > size.iPixelSize.iHeight;  
  1093             landscape = size.iPixelSize.iWidth > size.iPixelSize.iHeight;  
  1033             if( !landscape )
  1094             if( !landscape )
  1034                 {
  1095                 {
  1035                 iPluginInputMode = tempInputMode;
  1096                 iPluginInputMode = tempInputMode;
  1036                 aSuggestMode = EPluginInputModeItut;
  1097                 aSuggestMode = EPluginInputModeItut;
       
  1098                 }
       
  1099             }
       
  1100         }
       
  1101     else if(aSuggestMode == EPluginInputModeFingerHwr 
       
  1102             && iSharedData.InputTextLanguage() == ELangArabic
       
  1103             && !iSharedData.AutoRotateEnabled())
       
  1104         {
       
  1105         TInt hOrient = iSharedData.DefaultArabicFingerHwrOrientation();
       
  1106         if(landscape)
       
  1107             {
       
  1108             if(!hOrient)
       
  1109                 {
       
  1110                 iAvkonAppUi->SetOrientationL( CAknAppUiBase::EAppUiOrientationPortrait );
       
  1111                 iOrientationChanged = ETrue;                
       
  1112                 }
       
  1113             }
       
  1114         else
       
  1115             {
       
  1116             if(hOrient)
       
  1117                 {
       
  1118                 iAvkonAppUi->SetOrientationL( CAknAppUiBase::EAppUiOrientationLandscape );
       
  1119                 iOrientationChanged = ETrue;                
  1037                 }
  1120                 }
  1038             }
  1121             }
  1039         }
  1122         }
  1040     else if ( iOrientationChanged )
  1123     else if ( iOrientationChanged )
  1041         {
  1124         {
  1112 		    {
  1195 		    {
  1113 		    iFepMan.UpdateCbaL( NULL );
  1196 		    iFepMan.UpdateCbaL( NULL );
  1114 		    }
  1197 		    }
  1115         
  1198         
  1116         // Notify application touch window state
  1199         // Notify application touch window state
  1117         NotifyAppUiImeTouchWndState( ETrue );
  1200         NotifyAppUiImeTouchWndStateL( ETrue );
  1118 
  1201 
  1119         rtn = ETrue;
  1202         rtn = ETrue;
  1120         }
  1203         }
  1121     else
  1204     else
  1122         {
  1205         {
  1172         }
  1255         }
  1173     
  1256     
  1174     if( aRestore && !iSharedData.QwertyInputMode() && iFepMan.InputMode() == ELatin)
  1257     if( aRestore && !iSharedData.QwertyInputMode() && iFepMan.InputMode() == ELatin)
  1175         {
  1258         {
  1176 	    RestorePredictStateL();
  1259 	    RestorePredictStateL();
  1177         if ( iFepMan.EditorType() == CAknExtendedInputCapabilities::EPhoneNumberEditor )
  1260         
  1178             {
  1261         // Fix bug EAHN-82C9M7, comment out the following code
  1179             if( AknTextUtils::NumericEditorDigitType() == EDigitTypeEasternArabicIndic || 
  1262         //if ( iFepMan.EditorType() == CAknExtendedInputCapabilities::EPhoneNumberEditor )
  1180                 AknTextUtils::NumericEditorDigitType() == EDigitTypeDevanagari ||
  1263         //    {
  1181                 AknTextUtils::NumericEditorDigitType() == EDigitTypeArabicIndic )
  1264         //    if( AknTextUtils::NumericEditorDigitType() == EDigitTypeEasternArabicIndic || 
  1182                 {
  1265         //        AknTextUtils::NumericEditorDigitType() == EDigitTypeDevanagari ||
  1183                 iFepMan.TryChangeModeL( ENativeNumber );
  1266         //        AknTextUtils::NumericEditorDigitType() == EDigitTypeArabicIndic )
  1184                 }
  1267         //        {
  1185             else
  1268         //        iFepMan.TryChangeModeL( ENativeNumber );
  1186                 {
  1269         //        }
  1187                 iFepMan.TryChangeModeL( ENumber );
  1270         //    else
  1188                 }
  1271         //        {
  1189             }
  1272         //        iFepMan.TryChangeModeL( ENumber );
       
  1273         //        }
       
  1274         //    }
  1190         }
  1275         }
  1191     //iFepMan.UpdateCbaL( NULL ); //pls refer to bug ESZG-7G7CGF
  1276     //iFepMan.UpdateCbaL( NULL ); //pls refer to bug ESZG-7G7CGF
  1192                 
  1277                 
  1193     iFepMan.UiInterface()->TouchPaneSetInputMethodIconActivated(EFalse);
  1278     iFepMan.UiInterface()->TouchPaneSetInputMethodIconActivated(EFalse);
  1194     
  1279     
  1234                 iIndicatorTextID = 0;           
  1319                 iIndicatorTextID = 0;           
  1235                 }            
  1320                 }            
  1236             }
  1321             }
  1237         }
  1322         }
  1238 
  1323 
  1239     if ( iPluginInputMode == EPluginInputModeFSQ  && iOrientationChanged 
  1324     if ( (iPluginInputMode == EPluginInputModeFSQ || (iPluginInputMode == EPluginInputModeFingerHwr 
       
  1325 	     && iSharedData.InputTextLanguage() == ELangArabic)) && iOrientationChanged 
  1240     	                                            && !iITISettingDialogOpen )
  1326     	                                            && !iITISettingDialogOpen )
  1241         {
  1327         {
  1242 		// This TRAP_IGNORE is essential to fix bug ECJA-7JDCKR, never delete it
  1328 		// This TRAP_IGNORE is essential to fix bug ECJA-7JDCKR, never delete it
  1243         TRAP_IGNORE( iAvkonAppUi->SetOrientationL( (CAknAppUiBase::TAppUiOrientation)iDefaultOrientation ) );
  1329         TRAP_IGNORE( iAvkonAppUi->SetOrientationL( (CAknAppUiBase::TAppUiOrientation)iDefaultOrientation ) );
  1244         iOrientationChanged = EFalse;
  1330         iOrientationChanged = EFalse;
  1245         } 
  1331         } 
  1246         
  1332         
  1247     // Notify editor the touch window has been closed
  1333     // Notify editor the touch window has been closed
  1248     NotifyAppUiImeTouchWndState( EFalse );
  1334     NotifyAppUiImeTouchWndStateL( EFalse );
  1249     
  1335     
  1250     iCharStartPostion = KInvalidValue;
  1336     iCharStartPostion = KInvalidValue;
  1251     }
  1337     }
  1252 
  1338 
  1253 // ---------------------------------------------------------------------------
  1339 // ---------------------------------------------------------------------------
  1262         {
  1348         {
  1263         return;
  1349         return;
  1264         }
  1350         }
  1265         
  1351         
  1266     if ( iPluginInputMode == EPluginInputModeFSQ && 
  1352     if ( iPluginInputMode == EPluginInputModeFSQ && 
  1267          !iSharedData.AutoRotateEnabled())
  1353          !iSharedData.AutoRotateEnabled() || (iPluginInputMode == EPluginInputModeFingerHwr 
       
  1354 	     && iSharedData.InputTextLanguage() == ELangArabic))
  1268         {
  1355         {
  1269         return;
  1356         return;
  1270         }
  1357         }
  1271         
  1358         
  1272     TBool setResChange = EFalse;
  1359     TBool setResChange = EFalse;
  1613             ClosePluginInputUiL( ETrue );
  1700             ClosePluginInputUiL( ETrue );
  1614             }
  1701             }
  1615             break;
  1702             break;
  1616         case EKeyEscape:
  1703         case EKeyEscape:
  1617             {
  1704             {
  1618 			ClosePluginInputUiL( ETrue );
  1705 			ClosePluginInputUiL( ETrue );			
       
  1706 			iFepMan.SetNotifyPlugin( EFalse );
  1619             DestroySpellEditor();
  1707             DestroySpellEditor();
  1620             }
  1708             }
  1621             break;
  1709             break;
  1622        }
  1710        }
  1623     }
  1711     }
  1757             aMenuPane->SetItemDimmed(
  1845             aMenuPane->SetItemDimmed(
  1758                     EPenInputCmdRecognitionWithDictionary, disableDic);
  1846                     EPenInputCmdRecognitionWithDictionary, disableDic);
  1759             }
  1847             }
  1760         
  1848         
  1761         // add some input mode in option menu
  1849         // add some input mode in option menu
  1762         TBool isSplitView = IsEditorSupportSplitIme();
  1850         
  1763     	if(isSplitView)
  1851     	TInt disabledInputMode = iPenInputServer.DisabledLayout();
       
  1852     	TInt curInputMode = iLangMan.CurrentImePlugin()->CurrentMode();
       
  1853     	TBool isChinese = iFepMan.IsChineseInputLanguage();
       
  1854     	
       
  1855     	if ( !isChinese && ( curInputMode == EPluginInputModeItut ) && 
       
  1856     	        !( disabledInputMode & EPluginInputModeFSQ ))
  1764     	    {
  1857     	    {
  1765     	    TInt disabledMode = iPenInputServer.DisabledLayout();
  1858     	    aMenuPane->SetItemDimmed( EPeninputCmdFSQ, EFalse );
  1766     	    TInt curMode =  iLangMan.CurrentImePlugin()->CurrentMode();
       
  1767     	    if(!(disabledMode & EPluginInputModeFSQ) && curMode != EPluginInputModeFSQ )
       
  1768     	        {
       
  1769     	        aMenuPane->SetItemDimmed(EPeninputCmdFSQ, EFalse);
       
  1770     	        }
       
  1771     	    if(!(disabledMode & EPluginInputModeItut) && curMode != EPluginInputModeItut)
       
  1772     	        {
       
  1773     	        aMenuPane->SetItemDimmed(EPenInputCmdVITUT, EFalse);
       
  1774     	        }
       
  1775 
       
  1776     	    }
  1859     	    }
       
  1860     	
       
  1861     	if ( !isChinese && ( curInputMode == EPluginInputModeFSQ ) &&
       
  1862     	        !( disabledInputMode & EPluginInputModeItut ))
       
  1863     	    {
       
  1864     	    aMenuPane->SetItemDimmed(EPenInputCmdVITUT, EFalse);
       
  1865     	    }
       
  1866         //For arabic finger hwr input orientation.
       
  1867         TInt index = 0;        
       
  1868         if(iPluginInputMode == EPluginInputModeFingerHwr
       
  1869                 && (ELangArabic == iSharedData.InputTextLanguage())
       
  1870                 && (!iSharedData.AutoRotateEnabled()))
       
  1871             {
       
  1872             TBool disableMenu = ETrue;
       
  1873             TPixelsTwipsAndRotation size; 
       
  1874             CCoeEnv::Static()->ScreenDevice()->GetDefaultScreenSizeAndRotation(size);
       
  1875             TBool landscape = size.iPixelSize.iWidth > size.iPixelSize.iHeight;
       
  1876             if(landscape && aMenuPane->MenuItemExists(EPenInputCmdHwrInputToPortrait, index))
       
  1877                 {
       
  1878                 disableMenu = EFalse;
       
  1879                 aMenuPane->SetItemDimmed(EPenInputCmdHwrInputToPortrait,disableMenu);
       
  1880                 }
       
  1881             index = 0;
       
  1882             if(!landscape && aMenuPane->MenuItemExists(EPenInputCmdHwrInputToLandscape, index))
       
  1883                 {
       
  1884                 disableMenu = EFalse;
       
  1885                 aMenuPane->SetItemDimmed(EPenInputCmdHwrInputToLandscape,disableMenu);
       
  1886                 }
       
  1887             }   
       
  1888         
       
  1889         //For arabic finger hwr switch to key based input.
       
  1890         index = 0;
       
  1891         if(aMenuPane->MenuItemExists(
       
  1892                 EPenInputCmdSwitchToVkeyBasedInput, index))
       
  1893             {
       
  1894             TBool disableMenu = ETrue;
       
  1895             if(iPluginInputMode == EPluginInputModeFingerHwr
       
  1896                     && (ELangArabic == iSharedData.InputTextLanguage()))
       
  1897                 {
       
  1898                 disableMenu = EFalse;
       
  1899                 }   
       
  1900             aMenuPane->SetItemDimmed(EPenInputCmdSwitchToVkeyBasedInput,disableMenu);
       
  1901             }        
       
  1902         //For arabic finger hwr writing speed.
       
  1903         index = 0;
       
  1904         if(aMenuPane->MenuItemExists(
       
  1905                 EPenInputCmdWritingSpeed, index))
       
  1906             {
       
  1907             TBool disableMenu = ETrue;
       
  1908             if(iPluginInputMode == EPluginInputModeFingerHwr
       
  1909                     && (ELangArabic == iSharedData.InputTextLanguage()))
       
  1910                 {
       
  1911                 disableMenu = EFalse;
       
  1912                 }   
       
  1913             aMenuPane->SetItemDimmed(EPenInputCmdWritingSpeed,disableMenu);
       
  1914             }        
       
  1915         //For arabic finger hwr guide line.
       
  1916         index = 0;
       
  1917         if(aMenuPane->MenuItemExists(
       
  1918                 EPenInputCmdGuidingLine, index))
       
  1919             {
       
  1920             TBool disableMenu = ETrue;
       
  1921             if(iPluginInputMode == EPluginInputModeFingerHwr
       
  1922                     && (ELangArabic == iSharedData.InputTextLanguage()))
       
  1923                 {
       
  1924                 disableMenu = EFalse;
       
  1925                 }   
       
  1926             aMenuPane->SetItemDimmed(EPenInputCmdGuidingLine,disableMenu);
       
  1927             }        
  1777         
  1928         
  1778         iLangMan.CurrentImePlugin()->DynInitMenuPaneL(aMenuPane);
  1929         iLangMan.CurrentImePlugin()->DynInitMenuPaneL(aMenuPane);
  1779         }
  1930         }
  1780         
  1931         
  1781         
  1932         
  2699     setting->ShowRecognitionWithDictionaryL();
  2850     setting->ShowRecognitionWithDictionaryL();
  2700     CleanupStack::PopAndDestroy(setting); 
  2851     CleanupStack::PopAndDestroy(setting); 
  2701     TInt inputLanguage = iSharedData.InputTextLanguage();
  2852     TInt inputLanguage = iSharedData.InputTextLanguage();
  2702     }  
  2853     }  
  2703 
  2854 
       
  2855 // ---------------------------------------------------------------------------
       
  2856 // CAknFepPluginManager::LaunchPenInputWritingSpeedSelectionL
       
  2857 // (other items were commented in a header)
       
  2858 // ---------------------------------------------------------------------------
       
  2859 //     
       
  2860 void CAknFepPluginManager::LaunchPenInputWritingSpeedSelectionL()
       
  2861     {
       
  2862     //record langauge
       
  2863     CPenInputGSInterface*  setting = CPenInputGSInterface::NewL();
       
  2864     CleanupStack::PushL(setting);
       
  2865     setting->ShowWritingSpeedPageL();
       
  2866     CleanupStack::PopAndDestroy(setting); 
       
  2867     TInt inputLanguage = iSharedData.InputTextLanguage();
       
  2868     }
       
  2869 
       
  2870 // ---------------------------------------------------------------------------
       
  2871 // CAknFepPluginManager::LaunchPenInputGuideLineSelectionL
       
  2872 // (other items were commented in a header)
       
  2873 // ---------------------------------------------------------------------------
       
  2874 //     
       
  2875 void CAknFepPluginManager::LaunchPenInputGuidingLineSelectionL()
       
  2876     {
       
  2877     //record langauge
       
  2878     CPenInputGSInterface*  setting = CPenInputGSInterface::NewL();
       
  2879     CleanupStack::PushL(setting);
       
  2880     setting->ShowGuideLinePageL();
       
  2881     CleanupStack::PopAndDestroy(setting); 
       
  2882     TInt inputLanguage = iSharedData.InputTextLanguage();
       
  2883     }
  2704 // ---------------------------------------------------------------------------
  2884 // ---------------------------------------------------------------------------
  2705 // CAknFepPluginManager::LaunchPenInputSettingL
  2885 // CAknFepPluginManager::LaunchPenInputSettingL
  2706 // (other items were commented in a header)
  2886 // (other items were commented in a header)
  2707 // ---------------------------------------------------------------------------
  2887 // ---------------------------------------------------------------------------
  2708 // 
  2888 // 
  3289 		case EPluginInputModeFingerHwr:
  3469 		case EPluginInputModeFingerHwr:
  3290         case EPluginInputModeFSc:
  3470         case EPluginInputModeFSc:
  3291         case EPluginInputModeHwr:
  3471         case EPluginInputModeHwr:
  3292 			{
  3472 			{
  3293 		    if( iFepMan.IsSupportsSecretText() || 
  3473 		    if( iFepMan.IsSupportsSecretText() || 
  3294 		    	( ( aSuggestMode == EPluginInputModeFSc || 
  3474 		    	(( ( aSuggestMode == EPluginInputModeFSc || 
  3295 		    		aSuggestMode == EPluginInputModeFingerHwr) &&
  3475 		    		aSuggestMode == EPluginInputModeFingerHwr) &&
  3296 		    	    iSharedData.InputTextLanguage() != ELangPrcChinese &&
  3476 		    	  !(iSharedData.InputTextLanguage() == ELangPrcChinese ||
  3297                     iSharedData.InputTextLanguage() != ELangTaiwanChinese &&
  3477 		    	          iSharedData.InputTextLanguage() == ELangTaiwanChinese ||
  3298                     iSharedData.InputTextLanguage() != ELangHongKongChinese ))   
  3478 		    	          iSharedData.InputTextLanguage() == ELangHongKongChinese)) &&
       
  3479 		    	  ((aSuggestMode == EPluginInputModeFingerHwr && 
       
  3480 		    	          iSharedData.InputTextLanguage() != ELangArabic))))   
  3299 				{
  3481 				{
  3300 				aSuggestMode = EPluginInputModeItut;
  3482 				aSuggestMode = EPluginInputModeItut;
  3301 				if ((disableLayouts & aSuggestMode))
  3483 				if ((disableLayouts & aSuggestMode))
  3302 					{
  3484 					{
  3303 					aSuggestMode = EPluginInputModeFSQ;
  3485 					aSuggestMode = EPluginInputModeFSQ;
  3364              break;
  3546              break;
  3365              }
  3547              }
  3366          testMode<<=1;
  3548          testMode<<=1;
  3367          }
  3549          }
  3368          
  3550          
  3369      if ((testMode == EPluginInputModeFSc ||
  3551      if (((testMode == EPluginInputModeFSc ||
  3370           testMode == EPluginInputModeFingerHwr ) && 
  3552            testMode == EPluginInputModeFingerHwr) &&
  3371          iSharedData.InputTextLanguage() != ELangPrcChinese &&
  3553          !(iSharedData.InputTextLanguage() == ELangPrcChinese ||
  3372          iSharedData.InputTextLanguage() != ELangTaiwanChinese &&
  3554            iSharedData.InputTextLanguage() == ELangTaiwanChinese ||
  3373          iSharedData.InputTextLanguage() != ELangHongKongChinese )
  3555            iSharedData.InputTextLanguage() == ELangHongKongChinese)) &&
       
  3556          ((testMode == EPluginInputModeFingerHwr && 
       
  3557            iSharedData.InputTextLanguage() != ELangArabic)))
  3374          {
  3558          {
  3375          return EFalse;   
  3559          return EFalse;   
  3376          }
  3560          }
  3377     
  3561     
  3378     aSuggestMode = TPluginInputMode(testMode);
  3562     aSuggestMode = TPluginInputMode(testMode);
  3615        || PluginInputMode() == EPluginInputModeFSQ
  3799        || PluginInputMode() == EPluginInputModeFSQ
  3616 	   || PluginInputMode() == EPluginInputModeFingerHwr)
  3800 	   || PluginInputMode() == EPluginInputModeFingerHwr)
  3617         {
  3801         {
  3618         iCurrentPluginInputFepUI->HandleCommandL(ECmdPenInputInEditWordQueryDlg, iIsInEditWordQueryDlg);
  3802         iCurrentPluginInputFepUI->HandleCommandL(ECmdPenInputInEditWordQueryDlg, iIsInEditWordQueryDlg);
  3619         }    
  3803         }    
       
  3804     if ( PluginInputMode() == EPluginInputModeFSQ )
       
  3805         {
       
  3806         UpdateFSQIndicator();
       
  3807         }
  3620     }
  3808     }
  3621 
  3809 
  3622     
  3810     
  3623 // ---------------------------------------------------------------------------
  3811 // ---------------------------------------------------------------------------
  3624 // CAknFepPluginManager::IsEnableModeSwitchBtn
  3812 // CAknFepPluginManager::IsEnableModeSwitchBtn
  4118     CleanupStack::PopAndDestroy(); // reader
  4306     CleanupStack::PopAndDestroy(); // reader
  4119 
  4307 
  4120     return ret;  
  4308     return ret;  
  4121     }     
  4309     }     
  4122 
  4310 
  4123 void CAknFepPluginManager::UpdateITUTIndicator()    
  4311 void CAknFepPluginManager::UpdateFSQIndicator()    
  4124     {
  4312     {
  4125     if ( EPluginInputModeItut != PluginInputMode() )
  4313     if ( EPluginInputModeFSQ != PluginInputMode() )
  4126         {
  4314         {
  4127         return;
  4315         return;
  4128         }
  4316         }
  4129         
  4317         
  4130     TInt indicatorImgID;
  4318     TInt indicatorImgID;
  4161         indicator.iIndicatorTextMaskID = textMaskid;
  4349         indicator.iIndicatorTextMaskID = textMaskid;
  4162         TRAP_IGNORE(iCurrentPluginInputFepUI->HandleCommandL(ECmdPenInputFingerMatchIndicator, 
  4350         TRAP_IGNORE(iCurrentPluginInputFepUI->HandleCommandL(ECmdPenInputFingerMatchIndicator, 
  4163             reinterpret_cast<TInt>(&indicator)));    
  4351             reinterpret_cast<TInt>(&indicator)));    
  4164         }
  4352         }
  4165    }
  4353    }
       
  4354 void CAknFepPluginManager::UpdateITUTIndicator()    
       
  4355     {
       
  4356     if ( EPluginInputModeItut != PluginInputMode() )
       
  4357         {
       
  4358         return;
       
  4359         }
       
  4360         
       
  4361     TInt indicatorImgID;
       
  4362     TInt indicatorTextID;
       
  4363     
       
  4364     if (iFepMan.GetIndicatorImgID(indicatorImgID, indicatorTextID))   
       
  4365         {
       
  4366         iIndicatorImgID = indicatorImgID;
       
  4367         iIndicatorTextID = indicatorTextID;
       
  4368         }
       
  4369         TInt indImgid = 0;
       
  4370         TInt indMaskid = 0; 
       
  4371 
       
  4372         TInt textImgid = 0;
       
  4373         TInt textMaskid = 0; 
       
  4374 
       
  4375     if (iIndicatorImgID > 0)
       
  4376         {
       
  4377         GetIndicatorImgID(iIndicatorImgID ,indImgid, indMaskid);
       
  4378         }
       
  4379     
       
  4380     if (iIndicatorTextID > 0)
       
  4381         {
       
  4382         GetIndicatorImgID(iIndicatorTextID ,textImgid, textMaskid);
       
  4383         }
       
  4384         
       
  4385     if (iIndicatorImgID != 0 || iIndicatorTextID != 0)
       
  4386         {
       
  4387         TFepIndicatorInfo indicator;
       
  4388         
       
  4389         indicator.iIndicatorImgID = indImgid;
       
  4390         indicator.iIndicatorMaskID = indMaskid;
       
  4391         indicator.iIndicatorTextImgID = textImgid;
       
  4392         indicator.iIndicatorTextMaskID = textMaskid;
       
  4393         TRAP_IGNORE(iCurrentPluginInputFepUI->HandleCommandL(ECmdPenInputFingerMatchIndicator, 
       
  4394             reinterpret_cast<TInt>(&indicator)));    
       
  4395         }
       
  4396    }
  4166 
  4397 
  4167 void CAknFepPluginManager::SetITUTSpellingStateL(TBool aState)
  4398 void CAknFepPluginManager::SetITUTSpellingStateL(TBool aState)
  4168     {
  4399     {
  4169     if (aState)
  4400     if (aState)
  4170         {
  4401         {
  4247  
  4478  
  4248     delete iSpell;
  4479     delete iSpell;
  4249     iSpell = NULL;
  4480     iSpell = NULL;
  4250     iSpellCba = ESpellCBACancelEmpty;
  4481     iSpellCba = ESpellCBACancelEmpty;
  4251     iSpellOn = ETrue;
  4482     iSpellOn = ETrue;
  4252     iSpell = CAknFepUiSpellContainer::NewL(editorFlag, editorCase, editorSCTResId);
  4483     iSpell = CAknFepUiSpellContainer::NewL(editorFlag, editorCase, editorSCTResId, IsEditorSupportSplitIme());
  4253    
  4484    
  4254     iSpell->SetInputWinObserver(this);
  4485     iSpell->SetInputWinObserver(this);
  4255    
  4486    
  4256     iSpell->InputPane()->SetInputWinTextL(&aInitText);
  4487     iSpell->InputPane()->SetInputWinTextL(&aInitText);
  4257     iSpell->InputPane()->InputWin()->SetSelectionL(aCurSel.iCursorPos, aCurSel.iAnchorPos);
  4488     iSpell->InputPane()->InputWin()->SetSelectionL(aCurSel.iCursorPos, aCurSel.iAnchorPos);
  4534 			}
  4765 			}
  4535 	
  4766 	
  4536 		TRAP_IGNORE(iCurrentPluginInputFepUI->HandleCommandL(ECmdPenInputCaseMode, 
  4767 		TRAP_IGNORE(iCurrentPluginInputFepUI->HandleCommandL(ECmdPenInputCaseMode, 
  4537 		                                                     iCaseMan.CurrentCase()));	
  4768 		                                                     iCaseMan.CurrentCase()));	
  4538 		UpdateITUTIndicator();
  4769 		UpdateITUTIndicator();
       
  4770 	    if ( PluginInputMode() == EPluginInputModeFSQ )
       
  4771 	        {
       
  4772 			UpdateFSQIndicator();
       
  4773 	        }
  4539 		}	
  4774 		}	
  4540 	}
  4775 	}
  4541 
  4776 
  4542 void CAknFepPluginManager::AdjustDataCase( TDes& aData )
  4777 void CAknFepPluginManager::AdjustDataCase( TDes& aData )
  4543 		{
  4778 		{
  4572 void CAknFepPluginManager::DimAllModeAndCase(CAknFepUiInterfaceMenuPane* aMenuPane)
  4807 void CAknFepPluginManager::DimAllModeAndCase(CAknFepUiInterfaceMenuPane* aMenuPane)
  4573     {
  4808     {
  4574     aMenuPane->SetItemDimmed(EChinFepCmdModeStroke, ETrue);    
  4809     aMenuPane->SetItemDimmed(EChinFepCmdModeStroke, ETrue);    
  4575     aMenuPane->SetItemDimmed(EChinFepCmdModeZhuyin, ETrue);    
  4810     aMenuPane->SetItemDimmed(EChinFepCmdModeZhuyin, ETrue);    
  4576     aMenuPane->SetItemDimmed(EChinFepCmdModePinyin, ETrue);    
  4811     aMenuPane->SetItemDimmed(EChinFepCmdModePinyin, ETrue);    
       
  4812     aMenuPane->SetItemDimmed(EChinFepCmdModeStrokePhrase, ETrue);    
       
  4813     aMenuPane->SetItemDimmed(EChinFepCmdModeZhuyinPhrase, ETrue);    
       
  4814     aMenuPane->SetItemDimmed(EChinFepCmdModePinyinPhrase, ETrue);    
  4577     aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue);     
  4815     aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue);     
  4578     aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); 
  4816     aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); 
  4579     aMenuPane->SetItemDimmed(EChinFepCmdModeLatinLower, ETrue);         
  4817     aMenuPane->SetItemDimmed(EChinFepCmdModeLatinLower, ETrue);         
  4580     }
  4818     }
  4581     
  4819     
  5085               || iPluginPrimaryRange == ERangeEnglish
  5323               || iPluginPrimaryRange == ERangeEnglish
  5086               // iPluginPrimaryRange == 0 is the default range, 
  5324               // iPluginPrimaryRange == 0 is the default range, 
  5087               // default range couldn't be accent. 
  5325               // default range couldn't be accent. 
  5088               || !iPluginPrimaryRange )
  5326               || !iPluginPrimaryRange )
  5089          && iFepMan.InputLanguageCapabilities().iSupportsWesternQwertyPredictive
  5327          && iFepMan.InputLanguageCapabilities().iSupportsWesternQwertyPredictive
  5090          && !iSharedData.QwertyInputMode() )
  5328          && !iSharedData.QwertyInputMode()
       
  5329          // No need to support in dialer application.
       
  5330          && RProcess().SecureId().iId != KPhoneSecureId )
  5091         {
  5331         {
  5092         return ETrue;
  5332         return ETrue;
  5093         }        
  5333         }        
  5094 #endif
  5334 #endif
  5095     return EFalse;
  5335     return EFalse;
  5364  
  5604  
  5365 // -----------------------------------------------------------------------------
  5605 // -----------------------------------------------------------------------------
  5366 // Notify app touch input window closed or open.
  5606 // Notify app touch input window closed or open.
  5367 // -----------------------------------------------------------------------------
  5607 // -----------------------------------------------------------------------------
  5368 //
  5608 //
  5369 void CAknFepPluginManager::NotifyAppUiImeTouchWndState( const TBool aTouchState )
  5609 void CAknFepPluginManager::NotifyAppUiImeTouchWndStateL( const TBool aTouchState )
  5370     {
  5610     {
  5371     if ( iLangMan.IsSplitView() )
  5611     if ( iLangMan.IsSplitView() )
  5372         {
  5612         {
  5373         CEikonEnv* eikEnv = CEikonEnv::Static();
  5613         CEikonEnv* eikEnv = CEikonEnv::Static();
  5374         TUint param = aTouchState ? KAknSplitInputEnabled : KAknSplitInputDisabled;
  5614         TUint param = aTouchState ? KAknSplitInputEnabled : KAknSplitInputDisabled;
  5413         return;               
  5653         return;               
  5414         }
  5654         }
  5415     TRAP_IGNORE(iPenInputServer.AddPeninputServerObserverL(this)); //always add the handler            
  5655     TRAP_IGNORE(iPenInputServer.AddPeninputServerObserverL(this)); //always add the handler            
  5416     
  5656     
  5417     iPenInputSvrConnected = ETrue;                     
  5657     iPenInputSvrConnected = ETrue;                     
  5418     ActivatePenInputL();
  5658     TRAP_IGNORE(ActivatePenInputL());
  5419     }
  5659     }
  5420 
  5660 
  5421 CConnectAo::CConnectAo(CAknFepPluginManager* aClient) 
  5661 CConnectAo::CConnectAo(CAknFepPluginManager* aClient) 
  5422                 : CActive(CActive::EPriorityStandard),
  5662                 : CActive(CActive::EPriorityStandard),
  5423                   iClient(aClient)
  5663                   iClient(aClient)