fep/aknfep/src/AknFepPluginManager.cpp
branchRCL_3
changeset 12 5e18d8c489d6
parent 11 c8fb4cf7b3ae
child 13 1bbdde98cc2d
equal deleted inserted replaced
11:c8fb4cf7b3ae 12:5e18d8c489d6
    40 #include <aknfeppeninputimeplugin.h>
    40 #include <aknfeppeninputimeplugin.h>
    41 #include <UikonInternalPSKeys.h> // KUikGlobalNotesAllowed
    41 #include <UikonInternalPSKeys.h> // KUikGlobalNotesAllowed
    42 #include <AvkonInternalCRKeys.h>    // KAknQwertyInputModeActive
    42 #include <AvkonInternalCRKeys.h>    // KAknQwertyInputModeActive
    43 #include <hlplch.h>
    43 #include <hlplch.h>
    44 #include <peninputgsinterface.h>
    44 #include <peninputgsinterface.h>
    45 #include <AknFep.rsg>
    45 #include <aknfep.rsg>
    46 #include <avkon.rsg>
    46 #include <avkon.rsg>
    47 #include <AknIndicatorContainer.h>  //CAknIndicatorContainer
    47 #include <AknIndicatorContainer.h>  //CAknIndicatorContainer
    48 #include <StringLoader.h>
    48 #include <StringLoader.h>
    49 #include <peninputgenericitutcustomization.h>
    49 #include <peninputgenericitutcustomization.h>
    50 #include <eikgted.h> 
    50 #include <eikgted.h> 
   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             }
  1017         case EPluginEnableFetchDimState:
  1070         case EPluginEnableFetchDimState:
  1018         	{
  1071         	{
  1019         	iNeedFetchDimState = ETrue;
  1072         	iNeedFetchDimState = ETrue;
  1020         	}
  1073         	}
  1021         	break;
  1074         	break;
       
  1075         case EPluginArabicNumModeChanged:
       
  1076             if(iCurrentPluginInputFepUI)
       
  1077                 {
       
  1078                 iCurrentPluginInputFepUI->HandleCommandL(
       
  1079                         ECmdPeninputArabicNumModeChanged,aEventData);                            
       
  1080                 }
       
  1081             break;
  1022         default:
  1082         default:
  1023             break;
  1083             break;
  1024         }
  1084         }
  1025     }
  1085     }
  1026             
  1086             
  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))
  1126             aSuggestMode = EPluginInputModeItut;
  1210             aSuggestMode = EPluginInputModeItut;
  1127             }
  1211             }
  1128         else
  1212         else
  1129             {
  1213             {
  1130             if ( (!iSharedData.AutoRotateEnabled() 
  1214             if ( (!iSharedData.AutoRotateEnabled() 
  1131                     && aSuggestMode == EPluginInputModeFSQ) || 
  1215                     && aSuggestMode == EPluginInputModeFSQ))
  1132                   (aSuggestMode == EPluginInputModeFingerHwr))
       
  1133                 {
  1216                 {
  1134                 iFepMan.SetNotifyPlugin( EFalse );
  1217                 iFepMan.SetNotifyPlugin( EFalse );
  1135                 iAvkonAppUi->SetOrientationL( CAknAppUiBase::EAppUiOrientationLandscape );
  1218                 iAvkonAppUi->SetOrientationL( CAknAppUiBase::EAppUiOrientationLandscape );
  1136                 iFepMan.SetNotifyPlugin( ETrue );
  1219                 iFepMan.SetNotifyPlugin( ETrue );
  1137                 iOrientationChanged = ETrue;
  1220                 iOrientationChanged = ETrue;
  1185     	 inputLang == ELangTaiwanChinese ||
  1268     	 inputLang == ELangTaiwanChinese ||
  1186     	 inputLang == ELangHongKongChinese )
  1269     	 inputLang == ELangHongKongChinese )
  1187         {
  1270         {
  1188         isSplit = EFalse;
  1271         isSplit = EFalse;
  1189         }    
  1272         }    
       
  1273 
       
  1274     if ( iLangMan.IsSplitView() && !isSplit )
       
  1275         {
       
  1276         NotifyAppUiImeTouchWndStateL( EFalse ); //restore layout
       
  1277         }
       
  1278 
  1190     iLangMan.SetSplitView(isSplit);
  1279     iLangMan.SetSplitView(isSplit);
       
  1280 
  1191  
  1281  
  1192     MAknFepManagerInterface* fepUI = iLangMan.GetPluginInputFepUiL(
  1282     MAknFepManagerInterface* fepUI = iLangMan.GetPluginInputFepUiL(
  1193                                                     aSuggestMode, 
  1283                                                     aSuggestMode, 
  1194                                                     inputLang,
  1284                                                     inputLang,
  1195                                                     uiLanguage,
  1285                                                     uiLanguage,
  1365             {
  1455             {
  1366             //Change for finger support of MFNE editor, it is a requirement for Tube
  1456             //Change for finger support of MFNE editor, it is a requirement for Tube
  1367             InformMfneUiStatusL( EFalse );            
  1457             InformMfneUiStatusL( EFalse );            
  1368             
  1458             
  1369             iPenInputServer.ClearServerEvent();
  1459             iPenInputServer.ClearServerEvent();
  1370             iCurrentPluginInputFepUI->CloseUI();
  1460 			if(iFocuschangedForSpellEditor)
       
  1461 				{
       
  1462 				iFocuschangedForSpellEditor = EFalse;
       
  1463 				//disable the redrawing, it will be redrawn in 
       
  1464 				//iCurrentPluginInputFepUI->HandleCommandL(ECmdPeninputDisableLayoutDrawing,ETrue);
       
  1465 				return; //don't close the UI if this is caused by removing spell editor
       
  1466 				}
       
  1467 			else
       
  1468 				{
       
  1469 				iCurrentPluginInputFepUI->CloseUI();
       
  1470 				}
  1371             if( aResetState )
  1471             if( aResetState )
  1372                 {
  1472                 {
  1373                 iCurrentPluginInputFepUI->HandleCommandL(ECmdPenInputWindowClose);
  1473                 iCurrentPluginInputFepUI->HandleCommandL(ECmdPenInputWindowClose);
  1374                 }
  1474                 }
  1375             
  1475             
  1413          iPluginInputMode == EPluginInputModeNone )
  1513          iPluginInputMode == EPluginInputModeNone )
  1414         {
  1514         {
  1415         return;
  1515         return;
  1416         }
  1516         }
  1417         
  1517         
  1418     if ( iPluginInputMode == EPluginInputModeFSQ && 
  1518     if ( (iPluginInputMode == EPluginInputModeFSQ || (iPluginInputMode == EPluginInputModeFingerHwr 
  1419          !iSharedData.AutoRotateEnabled() || (iPluginInputMode == EPluginInputModeFingerHwr 
       
  1420 	     && iSharedData.InputTextLanguage() == ELangArabic))
  1519 	     && iSharedData.InputTextLanguage() == ELangArabic))
       
  1520 	     && !iSharedData.AutoRotateEnabled() )
  1421         {
  1521         {
  1422         return;
  1522         return;
  1423         }
  1523         }
  1424         
  1524         
  1425     TBool setResChange = EFalse;
  1525     TBool setResChange = EFalse;
  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 //     
  2147                 {
  2274                 {
  2148                 iAvkonRepository->Get( KAknAvkonAdaptiveSearchEnabled, enableAdaptiveSearch );
  2275                 iAvkonRepository->Get( KAknAvkonAdaptiveSearchEnabled, enableAdaptiveSearch );
  2149                 if ( enableAdaptiveSearch )
  2276                 if ( enableAdaptiveSearch )
  2150                     {
  2277                     {
  2151                     if(!(iInMenu && ( iPluginInputMode == EPluginInputModeItut ||
  2278                     if(!(iInMenu && ( iPluginInputMode == EPluginInputModeItut ||
  2152                                     iPluginInputMode == EPluginInputModeFSQ )))
  2279                                     iPluginInputMode == EPluginInputModeFSQ ||
       
  2280                                     iPluginInputMode ==EPluginInputModeFingerHwr)))
  2153                         {
  2281                         {
  2154                         ClosePluginInputModeL(ETrue);
  2282                         ClosePluginInputModeL(ETrue);
  2155                         if(iPenInputSvrConnected ) //lost foreground
  2283                         if(iPenInputSvrConnected ) //lost foreground
  2156                             {
  2284                             {
  2157                             iPenInputServer.LoseForeground();
  2285                             iPenInputServer.LoseForeground();
  2865     NotifyLayoutL( aOpenMode, aSuggestRange, aCleanContent );
  2993     NotifyLayoutL( aOpenMode, aSuggestRange, aCleanContent );
  2866     
  2994     
  2867 //    iPenInputServer.UpdateAppInfo(KNullDesC, EAppIndicatorMsg);  
  2995 //    iPenInputServer.UpdateAppInfo(KNullDesC, EAppIndicatorMsg);  
  2868     
  2996     
  2869     iPluginInputMode =  (TPluginInputMode)iLangMan.CurrentImePlugin()->CurrentMode(); 
  2997     iPluginInputMode =  (TPluginInputMode)iLangMan.CurrentImePlugin()->CurrentMode(); 
  2870 
  2998     
  2871     iPenInputServer.SetDataQueryPopped(IsDisplayDataQuery());  
  2999     // Not only for data query, but also for other pop dialogs contain editor.
       
  3000     //iPenInputServer.SetDataQueryPopped(IsDisplayDataQuery());
       
  3001     iPenInputServer.SetDataQueryPopped(CCoeEnv::Static()->AppUi()->IsDisplayingDialog() &&
       
  3002 											CCoeEnv::Static()->AppUi()->TopFocusedControl());  
  2872 
  3003 
  2873     //adjust VKB window if data query dialog is displaying
  3004     //adjust VKB window if data query dialog is displaying
  2874     if(IsDisplayDataQuery())
  3005     if(IsDisplayDataQuery())
  2875         {
  3006         {
  2876         RDrawableWindow* focusWin = 
  3007         RDrawableWindow* focusWin = 
  2889         RepositionDataQuery(EFalse);
  3020         RepositionDataQuery(EFalse);
  2890         }
  3021         }
  2891 
  3022 
  2892     if ( !NotifyInGlobalNoteEditorL() )
  3023     if ( !NotifyInGlobalNoteEditorL() )
  2893     	{
  3024     	{
       
  3025         iFocuschangedForSpellEditor = EFalse; // restore the flag
  2894     	iCurrentPluginInputFepUI->ActivateUI(); 
  3026     	iCurrentPluginInputFepUI->ActivateUI(); 
       
  3027         iNeedFetchDimState = ETrue;
  2895     	}
  3028     	}
  2896     
  3029     
  2897     iFepMan.UpdateIndicators();
  3030     iFepMan.UpdateIndicators();
  2898     iCurrentPluginInputFepUI->SetNextFepUI(
  3031     iCurrentPluginInputFepUI->SetNextFepUI(
  2899         iLangMan.GetFepUI(iFepMan.InputMode(), ENoneWidthChar, 
  3032         iLangMan.GetFepUI(iFepMan.InputMode(), ENoneWidthChar, 
  4609     	}
  4742     	}
  4610     else
  4743     else
  4611     	{
  4744     	{
  4612         iSpell->InputPane()->InputWin()->SetAknEditorCurrentCase(editorCase);
  4745         iSpell->InputPane()->InputWin()->SetAknEditorCurrentCase(editorCase);
  4613         iSpell->InputPane()->InputWin()->SetAknEditorCurrentInputMode(EAknEditorTextInputMode);
  4746         iSpell->InputPane()->InputWin()->SetAknEditorCurrentInputMode(EAknEditorTextInputMode);
       
  4747         if ( iLangMan.IsSplitView() )
       
  4748          {
       
  4749          iSpell->InputPane()->InputWin()->SetAknEditorFlags( 
       
  4750               iSpell->InputPane()->InputWin()->AknEdwinFlags() | 
       
  4751               aEditorFlag | EAknEditorFlagNoT9 | 
       
  4752               EAknEditorFlagEnablePartialScreen );
       
  4753          }
       
  4754         else
       
  4755          {
       
  4756          iSpell->InputPane()->InputWin()->SetAknEditorFlags( 
       
  4757               iSpell->InputPane()->InputWin()->AknEdwinFlags() | 
       
  4758               aEditorFlag | EAknEditorFlagNoT9 );
       
  4759          }
       
  4760 
  4614         iSpell->MakeVisible( ETrue );
  4761         iSpell->MakeVisible( ETrue );
  4615         iSpell->SetInputWinFocus( ETrue );
  4762         iSpell->SetInputWinFocus( ETrue );
  4616     	}
  4763     	}
  4617    
  4764    
  4618     iSpell->SetInputWinObserver(this);
  4765     iSpell->SetInputWinObserver(this);
  5020 void CAknFepPluginManager::SetMenuState(TBool aUpdateEditor)
  5167 void CAknFepPluginManager::SetMenuState(TBool aUpdateEditor)
  5021     {
  5168     {
  5022     if(!iPenInputSvrConnected ) 
  5169     if(!iPenInputSvrConnected ) 
  5023         {
  5170         {
  5024         return;
  5171         return;
  5025         }    	
  5172         }
  5026 
  5173 
  5027     if (!(PluginInputMode() == EPluginInputModeItut ||
  5174     if (!(PluginInputMode() == EPluginInputModeItut ||
  5028         PluginInputMode() == EPluginInputModeFSQ ||
  5175         PluginInputMode() == EPluginInputModeFSQ ||
  5029         PluginInputMode() == EPluginInputModeFingerHwr))
  5176         PluginInputMode() == EPluginInputModeFingerHwr))
  5030         {
  5177         {
  5033 
  5180 
  5034     //save current Fep aware editor
  5181     //save current Fep aware editor
  5035     if (aUpdateEditor && !iInMenu)
  5182     if (aUpdateEditor && !iInMenu)
  5036         {
  5183         {
  5037         if(iFepMan.FepAwareTextEditor())
  5184         if(iFepMan.FepAwareTextEditor())
  5038             iCurEditor = iFepMan.FepAwareTextEditor();    
  5185             {
       
  5186             iCurMFNECap = iFepMan.IsMfneEditor() ? iFepMan.ExtendedInputCapabilities() : 0;
       
  5187             iCurEditor = iFepMan.FepAwareTextEditor();
       
  5188             }
  5039         else
  5189         else
  5040             iCurEditor = NULL;            
  5190             {
       
  5191             iCurMFNECap = 0;
       
  5192             iCurEditor = NULL; 
       
  5193             }
  5041         }
  5194         }
  5042         
  5195         
  5043     iInMenu = ETrue;
  5196     iInMenu = ETrue;
  5044 
  5197 
  5045     TUid curApp = GetCurAppUid();
  5198     TUid curApp = GetCurAppUid();
  5054 void CAknFepPluginManager::ResetMenuState(TBool aUnDim)    
  5207 void CAknFepPluginManager::ResetMenuState(TBool aUnDim)    
  5055     {
  5208     {
  5056     if(!iPenInputSvrConnected ) 
  5209     if(!iPenInputSvrConnected ) 
  5057         {
  5210         {
  5058         return;
  5211         return;
  5059         }    	
  5212         }
  5060     	
  5213         
  5061     iInMenu = EFalse;
  5214     iInMenu = EFalse;
       
  5215     iCurMFNECap = 0;
  5062     iCurEditor = NULL;
  5216     iCurEditor = NULL;
  5063     if (aUnDim)
  5217     if (aUnDim)
  5064         {
  5218         {
  5065         iPenInputServer.SetInternalPopUp(EFalse);
  5219         iPenInputServer.SetInternalPopUp(EFalse);
  5066         iPenInputServer.DimUiLayout(EFalse);       
  5220         iPenInputServer.DimUiLayout(EFalse);       
  5136     }
  5290     }
  5137 #endif // RD_SCALABLE_UI_V2
  5291 #endif // RD_SCALABLE_UI_V2
  5138 
  5292 
  5139 void CAknFepPluginManager::InformMfneUiStatusL( TBool aOpened )
  5293 void CAknFepPluginManager::InformMfneUiStatusL( TBool aOpened )
  5140     {
  5294     {
  5141     if ( iMfne && iMfneChanged )
  5295     if ( iMfne && ( iMfneChanged || !aOpened ))
  5142         {
  5296         {
  5143         //make the selection longer than maximum length of current 
  5297         //make the selection longer than maximum length of current 
  5144         //text, so it won't change the behavior of MFNE editor which 
  5298         //text, so it won't change the behavior of MFNE editor which 
  5145         //doesn't support finger touch.
  5299         //doesn't support finger touch.
  5146         TInt cursor( iMfne->DocumentLengthForFep() + 1 );
  5300         TInt cursor( iMfne->DocumentLengthForFep() + 1 );
  5195 		    ECmdPenInputEnableSettingBtn, !iInGlobleNoteEditor);
  5349 		    ECmdPenInputEnableSettingBtn, !iInGlobleNoteEditor);
  5196 		}
  5350 		}
  5197 		
  5351 		
  5198     //if it's in global notes, show it.
  5352     //if it's in global notes, show it.
  5199     if(EPluginInputModeItut == PluginInputMode() ||
  5353     if(EPluginInputModeItut == PluginInputMode() ||
  5200        EPluginInputModeFSQ == PluginInputMode() )      
  5354        EPluginInputModeFSQ == PluginInputMode() ||
       
  5355        EPluginInputModeFingerHwr == PluginInputMode())      
  5201 		{
  5356 		{
  5202 		if(iInGlobleNoteEditor && iPenInputSvrConnected)
  5357 		if(iInGlobleNoteEditor && iPenInputSvrConnected)
  5203 			{
  5358 			{
  5204 			iPenInputServer.ActivatePeninputInNotesL();
  5359 			iPenInputServer.ActivatePeninputInNotesL();
  5205 	        return ETrue;	
  5360 	        return ETrue;	
  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.   
  5792         }
  5956         }
  5793     
  5957     
  5794     //Normal editors
  5958     //Normal editors
  5795     CAknEdwinState* state = iFepMan.EditorState(); 
  5959     CAknEdwinState* state = iFepMan.EditorState(); 
  5796     if (iCurEditor && state == NULL)
  5960     if (iCurEditor && state == NULL)
  5797 		state = static_cast<CAknEdwinState *> (iCurEditor->Extension1()->State(KNullUid));
  5961         {
       
  5962         if( iCurMFNECap )
       
  5963             {
       
  5964             return CAknExtendedInputCapabilities::EInputEditorPartialScreen == 
       
  5965                  ( iCurMFNECap & CAknExtendedInputCapabilities::EInputEditorPartialScreen );
       
  5966             }
       
  5967         else
       
  5968             {
       
  5969             MCoeFepAwareTextEditor_Extension1* extension = iCurEditor->Extension1(); 
       
  5970             if( extension )
       
  5971                 {
       
  5972                 state = static_cast<CAknEdwinState *>( extension->State(KNullUid) );
       
  5973                 }
       
  5974             }
       
  5975         }
  5798     if ( state )
  5976     if ( state )
  5799         {
  5977         {
  5800         return EAknEditorFlagEnablePartialScreen == 
  5978         return EAknEditorFlagEnablePartialScreen == 
  5801                    ( state->Flags() & EAknEditorFlagEnablePartialScreen );
  5979                    ( state->Flags() & EAknEditorFlagEnablePartialScreen );
  5802         }
  5980         }