fep/aknfep/src/AknFepPluginManager.cpp
branchRCL_3
changeset 18 c8fb4cf7b3ae
parent 14 e6a39382bb9c
child 19 5e18d8c489d6
equal deleted inserted replaced
14:e6a39382bb9c 18:c8fb4cf7b3ae
    75 #include <apgwgnam.h>
    75 #include <apgwgnam.h>
    76 
    76 
    77 #include <PtiKeyMappings.h>
    77 #include <PtiKeyMappings.h>
    78 #include <AknPriv.hrh>
    78 #include <AknPriv.hrh>
    79 
    79 
       
    80 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS
       
    81 #include <gfxtranseffect/gfxtranseffect.h>
       
    82 #include <akntransitionutils.h>
       
    83 #include <akntranseffect.h>
       
    84 
       
    85 #include <e32property.h>
       
    86 #include <avkondomainpskeys.h>
       
    87 #endif
       
    88 
    80 // Constants
    89 // Constants
    81 const TInt KCursorBlinkPerioid = 10000;//300000; // five tenth of a second * 2
    90 const TInt KCursorBlinkPerioid = 10000;//300000; // five tenth of a second * 2
    82 const TInt KMaxServerDataLength = 50;
    91 const TInt KMaxServerDataLength = 50;
    83 const TUint KVkbParagraphSeparator = 0x2029;
    92 const TUint KVkbParagraphSeparator = 0x2029;
    84 const TUint KVkbTabulator = 0x0009;
    93 const TUint KVkbTabulator = 0x0009;
   245                                           CAknFepSharedDataInterface& aSharedData,
   254                                           CAknFepSharedDataInterface& aSharedData,
   246                                           CAknFepLanguageManager& aLangMan,
   255                                           CAknFepLanguageManager& aLangMan,
   247                                           CAknFepCaseManager& aCaseMan )
   256                                           CAknFepCaseManager& aCaseMan )
   248     : iFepMan( aFepMan ), iLangMan( aLangMan ), iCaseMan( aCaseMan ),
   257     : iFepMan( aFepMan ), iLangMan( aLangMan ), iCaseMan( aCaseMan ),
   249       iSharedData( aSharedData ), iPluginPrimaryRange( ERangeInvalid ), iCandidateIndex(1),
   258       iSharedData( aSharedData ), iPluginPrimaryRange( ERangeInvalid ), iCandidateIndex(1),
   250       iCharStartPostion( KInvalidValue ),
   259       iCharStartPostion( KInvalidValue )	  
   251 	  iInSpellMode( EFalse )
       
   252     {
   260     {
   253     iIndicatorImgID = 0;
   261     iIndicatorImgID = 0;
   254     iIndicatorTextID = 0;
   262     iIndicatorTextID = 0;
   255     iLastDataQueryWin = NULL;
   263     iLastDataQueryWin = NULL;
   256     iDefaultOrientation = -1;
   264     iDefaultOrientation = -1;
   540                     }           
   548                     }           
   541                 LaunchPenInputMenuL(R_AVKON_PENINPUT_OPTION_MENU_BAR);
   549                 LaunchPenInputMenuL(R_AVKON_PENINPUT_OPTION_MENU_BAR);
   542                 }
   550                 }
   543                 break;
   551                 break;
   544             case ESignalLayoutClosed:
   552             case ESignalLayoutClosed:
       
   553                 if(iPluginInputMode == EPluginInputModeItut)
       
   554                 	{
       
   555 					iFepMan.PtiEngine()->CancelTimerActivity();
       
   556                 	}
   545                 ClosePluginInputModeL(ETrue);
   557                 ClosePluginInputModeL(ETrue);
   546                 if(iPenInputSvrConnected ) //lost foreground
   558                 if(iPenInputSvrConnected ) //lost foreground
   547                     {
   559                     {
   548                     iPenInputServer.LoseForeground();
   560                     iPenInputServer.LoseForeground();
   549                     }                
   561                     }                
   875                     iPenInputServer.LoseForeground();
   887                     iPenInputServer.LoseForeground();
   876                     }
   888                     }
   877                 }
   889                 }
   878             else
   890             else
   879                 {
   891                 {
   880                 OnFocusChangedL( aEventData ) ;   
   892                 OnFocusChangedL( aEventData );   
   881                 }
   893                 }
       
   894             iForegroundChange = EFalse;
   882             }
   895             }
   883             break;
   896             break;
   884         case EPluginFocusChanged:
   897         case EPluginFocusChanged:
   885             {
   898             {
   886             OnFocusChangedL( aEventData );
   899             OnFocusChangedL( aEventData );
  1018 // -----------------------------------------------------------------------------
  1031 // -----------------------------------------------------------------------------
  1019 //
  1032 //
  1020 TBool CAknFepPluginManager::TryChangePluginInputModeByModeL
  1033 TBool CAknFepPluginManager::TryChangePluginInputModeByModeL
  1021     (TPluginInputMode aSuggestMode, TInt aOpenMode,TInt aSuggestRange)
  1034     (TPluginInputMode aSuggestMode, TInt aOpenMode,TInt aSuggestRange)
  1022     {
  1035     {
       
  1036     iNeedFetchDimState = ETrue;
  1023     if ( iSharedData.QwertyInputMode() )
  1037     if ( iSharedData.QwertyInputMode() )
  1024         {
  1038         {
  1025         return EFalse;
  1039         return EFalse;
  1026         }
  1040         }
  1027 
  1041 
  1163         iFepMan.SetNotifyPlugin( ETrue );
  1177         iFepMan.SetNotifyPlugin( ETrue );
  1164         iOrientationChanged = EFalse;
  1178         iOrientationChanged = EFalse;
  1165         }
  1179         }
  1166     
  1180     
  1167     TBool isSplit = IsEditorSupportSplitIme();
  1181     TBool isSplit = IsEditorSupportSplitIme();
       
  1182     TInt inputLang = iFepMan.InputLanguageCapabilities().iInputLanguageCode;
  1168     // temp code for Chinese split view
  1183     // temp code for Chinese split view
  1169     if ( iSharedData.PenInputLanguage() == ELangPrcChinese || 
  1184     if ( inputLang == ELangPrcChinese || 
  1170          iSharedData.PenInputLanguage() == ELangTaiwanChinese ||
  1185     	 inputLang == ELangTaiwanChinese ||
  1171          iSharedData.PenInputLanguage() == ELangHongKongChinese )
  1186     	 inputLang == ELangHongKongChinese )
  1172         {
  1187         {
  1173         isSplit = EFalse;
  1188         isSplit = EFalse;
  1174         }    
  1189         }    
  1175     iLangMan.SetSplitView(isSplit);
  1190     iLangMan.SetSplitView(isSplit);
  1176  
  1191  
  1177     TInt inputLang = iFepMan.InputLanguageCapabilities().iInputLanguageCode;
       
  1178     if( ( aSuggestMode == EPluginInputModeFSc || 
       
  1179             aSuggestMode == EPluginInputModeHwr ||
       
  1180             aSuggestMode == EPluginInputModeFingerHwr )
       
  1181             && ( iSharedData.PenInputLanguage() == ELangPrcChinese 
       
  1182                 || iSharedData.PenInputLanguage() == ELangHongKongChinese
       
  1183                 || iSharedData.PenInputLanguage() == ELangTaiwanChinese) )
       
  1184         {
       
  1185         // Solution for HWR can not be in used after switched to latin-only editor.
       
  1186         inputLang = iSharedData.PenInputLanguage();
       
  1187         }
       
  1188     MAknFepManagerInterface* fepUI = iLangMan.GetPluginInputFepUiL(
  1192     MAknFepManagerInterface* fepUI = iLangMan.GetPluginInputFepUiL(
  1189                                                     aSuggestMode, 
  1193                                                     aSuggestMode, 
  1190                                                     inputLang,
  1194                                                     inputLang,
  1191                                                     uiLanguage,
  1195                                                     uiLanguage,
  1192                                                     &iPenInputServer); 
  1196                                                     &iPenInputServer); 
  1193     iCurrentPluginInputFepUI = fepUI;
  1197     iCurrentPluginInputFepUI = fepUI;
  1194     
  1198     
  1195     if ( iCurrentPluginInputFepUI )     
  1199     if ( iCurrentPluginInputFepUI )     
  1196         {
  1200         {
  1197         iPenInputServer.DimUiLayout(EFalse);
  1201         // iPenInputServer.DimUiLayout(EFalse);
  1198         
  1202         
  1199         AddCurrentWinToOpenListL();
  1203         AddCurrentWinToOpenListL();
  1200         if (iPluginInputMode == EPluginInputModeItut)
  1204         if (iPluginInputMode == EPluginInputModeItut)
  1201             {
  1205             {
  1202             iIndicatorImgID = 0;
  1206             iIndicatorImgID = 0;
  1308     if( aRestore && !iSharedData.QwertyInputMode() && iFepMan.InputMode() == ELatin)
  1312     if( aRestore && !iSharedData.QwertyInputMode() && iFepMan.InputMode() == ELatin)
  1309         {
  1313         {
  1310 	    RestorePredictStateL();
  1314 	    RestorePredictStateL();
  1311         
  1315         
  1312         //  comment out the following code
  1316         //  comment out the following code
  1313         //if ( iFepMan.EditorType() == CAknExtendedInputCapabilities::EPhoneNumberEditor )
  1317         if ( iFepMan.EditorType() == CAknExtendedInputCapabilities::EPhoneNumberEditor
  1314         //    {
  1318              && !iOrientationChangedfromUI )
  1315         //    if( AknTextUtils::NumericEditorDigitType() == EDigitTypeEasternArabicIndic || 
  1319             {
  1316         //        AknTextUtils::NumericEditorDigitType() == EDigitTypeDevanagari ||
  1320             if( AknTextUtils::NumericEditorDigitType() == EDigitTypeEasternArabicIndic || 
  1317         //        AknTextUtils::NumericEditorDigitType() == EDigitTypeArabicIndic )
  1321                 AknTextUtils::NumericEditorDigitType() == EDigitTypeDevanagari ||
  1318         //        {
  1322                 AknTextUtils::NumericEditorDigitType() == EDigitTypeArabicIndic )
  1319         //        iFepMan.TryChangeModeL( ENativeNumber );
  1323                 {
  1320         //        }
  1324                 iFepMan.TryChangeModeL( ENativeNumber );
  1321         //    else
  1325                 }
  1322         //        {
  1326             else
  1323         //        iFepMan.TryChangeModeL( ENumber );
  1327                 {
  1324         //        }
  1328                 iFepMan.TryChangeModeL( ENumber );
  1325         //    }
  1329                 }
       
  1330             }
  1326         }
  1331         }
  1327     //iFepMan.UpdateCbaL( NULL ); 
  1332     //iFepMan.UpdateCbaL( NULL ); 
  1328                 
  1333                 
  1329     iFepMan.UiInterface()->TouchPaneSetInputMethodIconActivated(EFalse);
  1334     iFepMan.UiInterface()->TouchPaneSetInputMethodIconActivated(EFalse);
  1330     
  1335     
  2104         if(!bOpen )
  2109         if(!bOpen )
  2105             {
  2110             {
  2106             return;
  2111             return;
  2107             }
  2112             }
  2108 
  2113 
  2109         if( iInMenu && iCurEditor == iFepMan.FepAwareTextEditor() )
  2114         if( iInMenu && 
  2110             {
  2115         	( iCurEditor == iFepMan.FepAwareTextEditor() || iLaunchSCTInSpell ) )
       
  2116             {            
       
  2117             iLaunchSCTInSpell = EFalse;
       
  2118 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS
       
  2119             if ( PluginInputMode() == EPluginInputModeFSQ 
       
  2120                     && iSharedData.ThemeEffectsEnabled())
       
  2121                 {
       
  2122                 User::After(1);//waiting for menu cancel effect
       
  2123                 } 
       
  2124 #endif
  2111             ResetMenuState();            
  2125             ResetMenuState();            
  2112 			// If need to open setting app automatically, 
  2126 			// If need to open setting app automatically, 
  2113 			// do not open Touch window again. 
  2127 			// do not open Touch window again. 
  2114 			TBool langChange = iCurLanguage != iSharedData.InputTextLanguage();
  2128 			TBool langChange = iCurLanguage != iSharedData.InputTextLanguage();
  2115 					
  2129 					
  2850   
  2864   
  2851     NotifyLayoutL( aOpenMode, aSuggestRange, aCleanContent );
  2865     NotifyLayoutL( aOpenMode, aSuggestRange, aCleanContent );
  2852     
  2866     
  2853 //    iPenInputServer.UpdateAppInfo(KNullDesC, EAppIndicatorMsg);  
  2867 //    iPenInputServer.UpdateAppInfo(KNullDesC, EAppIndicatorMsg);  
  2854     
  2868     
  2855     iPluginInputMode =  (TPluginInputMode)iLangMan.CurrentImePlugin()->CurrentMode();   
  2869     iPluginInputMode =  (TPluginInputMode)iLangMan.CurrentImePlugin()->CurrentMode(); 
       
  2870 
       
  2871     iPenInputServer.SetDataQueryPopped(IsDisplayDataQuery());  
  2856 
  2872 
  2857     //adjust VKB window if data query dialog is displaying
  2873     //adjust VKB window if data query dialog is displaying
  2858     if(IsDisplayDataQuery())
  2874     if(IsDisplayDataQuery())
  2859         {
  2875         {
  2860         RDrawableWindow* focusWin = 
  2876         RDrawableWindow* focusWin = 
  3167                 eventUp.SetTip( ETrue );
  3183                 eventUp.SetTip( ETrue );
  3168                 CCoeEnv::Static()->WsSession().SimulateRawEvent( eventUp ); 
  3184                 CCoeEnv::Static()->WsSession().SimulateRawEvent( eventUp ); 
  3169                 }
  3185                 }
  3170             
  3186             
  3171             
  3187             
  3172             else if ( keyEvent.iCode >= EKeyApplication27 
  3188             else if ( keyEvent.iCode >= EKeyApplication27 && !( (iLangMan.InputLanguage() == ELangFarsi) && EnableITIOnFSQ())
  3173                     || (iFepMan.IsFeatureSupportedJapanese()
  3189                     || (iFepMan.IsFeatureSupportedJapanese()
  3174                          && iFepMan.InputMode() == EHiraganaKanji
  3190                          && iFepMan.InputMode() == EHiraganaKanji
  3175                          && edit
  3191                          && edit
  3176                          && (EPtiKey0 <= keyEvent.iCode && keyEvent.iCode <= EPtiKey9)
  3192                          && (EPtiKey0 <= keyEvent.iCode && keyEvent.iCode <= EPtiKey9)
  3177                        )
  3193                        )
  3308                         // commit inline if necessary
  3324                         // commit inline if necessary
  3309                         if ( iFepMan.UncommittedText().Length() > 0 )
  3325                         if ( iFepMan.UncommittedText().Length() > 0 )
  3310                             {                                
  3326                             {                                
  3311                             iFepMan.CommitInlineEditL();
  3327                             iFepMan.CommitInlineEditL();
  3312                             iFepMan.PtiEngine()->CommitCurrentWord();
  3328                             iFepMan.PtiEngine()->CommitCurrentWord();
       
  3329                             iFepMan.TryCloseUiL();
       
  3330                             TKeyEvent keyEventUpdateCase = {EKeyF19, EStdKeyNull, 0, 0};
       
  3331                             env->SimulateKeyEventL(keyEventUpdateCase, EEventKey);
  3313                             }                            
  3332                             }                            
  3314                         // set flag to ensure not to be handled by key catcher.
  3333                         // set flag to ensure not to be handled by key catcher.
  3315                         iFepMan.SetFlag(CAknFepManager::EFlagPassNextKey);
  3334                         iFepMan.SetFlag(CAknFepManager::EFlagPassNextKey);
  3316                         env->SimulateKeyEventL(keyEvent, EEventKey);
  3335                         env->SimulateKeyEventL(keyEvent, EEventKey);
  3317                 		iFepMan.ClearFlag(CAknFepManager::EFlagPassNextKey);
  3336                 		iFepMan.ClearFlag(CAknFepManager::EFlagPassNextKey);
  3828             iCurrentPluginInputFepUI->HandleCommandL(ECmdPenInputFingerSpelling, 0);
  3847             iCurrentPluginInputFepUI->HandleCommandL(ECmdPenInputFingerSpelling, 0);
  3829               SetPromptText( aCleanContent );     
  3848               SetPromptText( aCleanContent );     
  3830               }
  3849               }
  3831         else
  3850         else
  3832             {
  3851             {
  3833             if ( !iInSpellMode )
  3852 			SetITUTSpellingStateL(ETrue);
  3834             	{
       
  3835 				SetITUTSpellingStateL(ETrue);
       
  3836 				iInSpellMode = ETrue;
       
  3837             	}
       
  3838             
       
  3839             iIndicatorImgID = 0;
  3853             iIndicatorImgID = 0;
  3840             iIndicatorTextID = 0;
  3854             iIndicatorTextID = 0;
  3841             }    
  3855             }    
  3842         UpdateITUTIndicator();       
  3856         UpdateITUTIndicator();       
  3843         }
  3857         }
  4593     	{
  4607     	{
  4594         iSpell = CAknFepUiSpellContainer::NewL(editorFlag, editorCase, editorSCTResId, IsEditorSupportSplitIme());
  4608         iSpell = CAknFepUiSpellContainer::NewL(editorFlag, editorCase, editorSCTResId, IsEditorSupportSplitIme());
  4595     	}
  4609     	}
  4596     else
  4610     else
  4597     	{
  4611     	{
       
  4612         iSpell->InputPane()->InputWin()->SetAknEditorCurrentCase(editorCase);
       
  4613         iSpell->InputPane()->InputWin()->SetAknEditorCurrentInputMode(EAknEditorTextInputMode);
  4598         iSpell->MakeVisible( ETrue );
  4614         iSpell->MakeVisible( ETrue );
  4599         iSpell->SetInputWinFocus( ETrue );
  4615         iSpell->SetInputWinFocus( ETrue );
  4600     	}
  4616     	}
  4601    
  4617    
  4602     iSpell->SetInputWinObserver(this);
  4618     iSpell->SetInputWinObserver(this);
  4683             }
  4699             }
  4684         }
  4700         }
  4685         
  4701         
  4686     return resId;
  4702     return resId;
  4687     }
  4703     }
  4688 
       
  4689 void CAknFepPluginManager::SetInSpellModeFlag( TBool aFlag )
       
  4690 	{
       
  4691 	iInSpellMode = aFlag;
       
  4692 	}
       
  4693 
  4704 
  4694 void CAknFepPluginManager::SetPromptText( TBool aCleanContent )
  4705 void CAknFepPluginManager::SetPromptText( TBool aCleanContent )
  4695     {
  4706     {
  4696     if (IsDimed() && !iResourceChange) 
  4707     if (IsDimed() && !iResourceChange) 
  4697         { 
  4708         { 
  5618         {
  5629         {
  5619         HBufC* unCommitedText = HBufC::NewL( unCommitedLen );
  5630         HBufC* unCommitedText = HBufC::NewL( unCommitedLen );
  5620         TPtr unCommitedTextPtr = unCommitedText->Des();        
  5631         TPtr unCommitedTextPtr = unCommitedText->Des();        
  5621         TInt startPos = iFepMan.UncommittedText().LowerPos();
  5632         TInt startPos = iFepMan.UncommittedText().LowerPos();
  5622         MCoeFepAwareTextEditor* edit = iFepMan.FepAwareTextEditor();
  5633         MCoeFepAwareTextEditor* edit = iFepMan.FepAwareTextEditor();
  5623         edit->GetEditorContentForFep( unCommitedTextPtr, 
  5634         if ( edit )
  5624                                       startPos, unCommitedLen ); 		
  5635         	{
       
  5636             edit->GetEditorContentForFep( unCommitedTextPtr, 
       
  5637                                           startPos, unCommitedLen );       
       
  5638         	}
  5625 		iFepMan.PtiEngine()->SetCurrentWord( *unCommitedText );
  5639 		iFepMan.PtiEngine()->SetCurrentWord( *unCommitedText );
  5626 		delete unCommitedText;
  5640 		delete unCommitedText;
  5627 		unCommitedText = NULL;
  5641 		unCommitedText = NULL;
  5628         }
  5642         }
  5629     
  5643     
  5777                    ( caps & CAknExtendedInputCapabilities::EInputEditorPartialScreen );
  5791                    ( caps & CAknExtendedInputCapabilities::EInputEditorPartialScreen );
  5778         }
  5792         }
  5779     
  5793     
  5780     //Normal editors
  5794     //Normal editors
  5781     CAknEdwinState* state = iFepMan.EditorState(); 
  5795     CAknEdwinState* state = iFepMan.EditorState(); 
       
  5796     if (iCurEditor && state == NULL)
       
  5797 		state = static_cast<CAknEdwinState *> (iCurEditor->Extension1()->State(KNullUid));
  5782     if ( state )
  5798     if ( state )
  5783         {
  5799         {
  5784         return EAknEditorFlagEnablePartialScreen == 
  5800         return EAknEditorFlagEnablePartialScreen == 
  5785                    ( state->Flags() & EAknEditorFlagEnablePartialScreen );
  5801                    ( state->Flags() & EAknEditorFlagEnablePartialScreen );
  5786         }
  5802         }