fep/aknfep/src/AknFepManager.cpp
branchRCL_3
changeset 56 8152b1f1763a
parent 50 5a1685599b76
equal deleted inserted replaced
50:5a1685599b76 56:8152b1f1763a
   236     ENbrModeTypeEasternArabic //for Urdu & Farsi languages
   236     ENbrModeTypeEasternArabic //for Urdu & Farsi languages
   237     };
   237     };
   238     
   238     
   239 // The passwd timeout is same as defined on CEikSecretEditor.
   239 // The passwd timeout is same as defined on CEikSecretEditor.
   240 const TInt KSyncPasswdTimeout = 1000000;
   240 const TInt KSyncPasswdTimeout = 1000000;
       
   241 
       
   242 // The offset to show underline
       
   243 const TInt KUnderlineHeight = 4;
   241 
   244 
   242 #ifdef RD_SCALABLE_UI_V2
   245 #ifdef RD_SCALABLE_UI_V2
   243 TUid AppUidFromWndGroupId(TInt aWndGrpId);
   246 TUid AppUidFromWndGroupId(TInt aWndGrpId);
   244 extern TUid GetCurAppUid();
   247 extern TUid GetCurAppUid();
   245 extern TBool IsGlobalNotesApp(TUid& aUid);
   248 extern TBool IsGlobalNotesApp(TUid& aUid);
  1690                     // in inline state is replaced with a digit.
  1693                     // in inline state is replaced with a digit.
  1691                     /*Hindi*/
  1694                     /*Hindi*/
  1692                     //This condition is added for Hindi language in case of multitapping of EKey1 to get 
  1695                     //This condition is added for Hindi language in case of multitapping of EKey1 to get 
  1693                     //a numeral value "1" because of a clasical case of Halant and ZWS getting added 
  1696                     //a numeral value "1" because of a clasical case of Halant and ZWS getting added 
  1694                     //before numeral 1 which may affect incase of limited space in editor   
  1697                     //before numeral 1 which may affect incase of limited space in editor   
  1695                     
  1698                         
  1696 
  1699                     if (( EditorHasFreeSpace()
  1697 
  1700                         || (!WesternPredictive() && !EditorHasFreeSpace() && 
  1698 
  1701                            (TAknFepUiIndicInputManager::IsIndicLangauge(
  1699 
  1702                             TLanguage(iLanguageCapabilities.iInputLanguageCode)))) 
  1700                     // Is the language Indic?
  1703                         || IsFlagSet(EFlagInsideMultitapInlineEditingTransaction)
  1701                     TBool isIndicLanguage = TAknFepUiIndicInputManager::IsIndicLangauge(
  1704                         || (IsFlagSet(EFlagInsideInlineEditingTransaction) && aLength == ELongKeyPress)))
  1702                                                TLanguage(iLanguageCapabilities.iInputLanguageCode)); 
       
  1703 
       
  1704                     // Is the state in Multitap of the Inline Text   
       
  1705                     TBool  isFlagInsideMultitapInlineEditingTransaction = 
       
  1706                                                  IsFlagSet(EFlagInsideMultitapInlineEditingTransaction);
       
  1707 
       
  1708                     // Is the state of the text inline when long pressing key event occurs
       
  1709                     TBool  isInlineEditorTransactionLongKeyPress = IsFlagSet(EFlagInsideInlineEditingTransaction)
       
  1710                                                                && ( aLength == ELongKeyPress );
       
  1711 
       
  1712                     // Is the state of the text inline when current mode is Koeran.
       
  1713                     TBool isInlineEditorTranscationKoreanMode = IsFlagSet(EFlagInsideInlineEditingTransaction)
       
  1714                                                                 && ( iMode == EHangul ); 
       
  1715 
       
  1716                     // Don't check the free space of the editor 
       
  1717                     // when current mode is Hangul and current editor state is inline state.
       
  1718                     if ( EditorHasFreeSpace()
       
  1719                         || (!WesternPredictive() && !EditorHasFreeSpace() && isIndicLanguage )
       
  1720                         || isFlagInsideMultitapInlineEditingTransaction
       
  1721                         || isInlineEditorTransactionLongKeyPress  
       
  1722                         || isInlineEditorTranscationKoreanMode )
       
  1723                         {
  1705                         {
  1724                         ClearFlag(EFlagEditorFull);
  1706                         ClearFlag(EFlagEditorFull);
  1725 
  1707 
  1726                         if (aLength == ELongKeyPress && 
  1708                         if (aLength == ELongKeyPress && 
  1727                            (iMode != ELatin && iMode != ENumber && iMode != ENativeNumber && iMode != EStrokeFind && iMode != EHangul) &&
  1709                            (iMode != ELatin && iMode != ENumber && iMode != ENativeNumber && iMode != EStrokeFind && iMode != EHangul) &&
  3148 
  3130 
  3149 /*    if (EPtiKeyboardQwerty4x10 == KeyboardLayout())
  3131 /*    if (EPtiKeyboardQwerty4x10 == KeyboardLayout())
  3150     	{
  3132     	{
  3151     	FepUI()->HandleKeyL(EKeyLeftCtrl, EShortKeyPress);    
  3133     	FepUI()->HandleKeyL(EKeyLeftCtrl, EShortKeyPress);    
  3152    	}*/
  3134    	}*/
  3153 
  3135     
  3154     //The default value of response is EKeyWasConsumed. So in some case, fep don¡¯t 
  3136     //The default value of response is EKeyWasConsumed. So in some case, fep don¡¯t 
  3155     //do anything, but it return Consumed.
  3137     //do anything, but it return Consumed.
  3156     //This make app miss the event EEventKeyUp. 
  3138     //This make app miss the event EEventKeyUp. 
  3157     //As per the logic of the function, the combine about ctrl key including:
  3139     //As per the logic of the function, the combine about ctrl key including:
  3158     //       Ctrl key + C; Ctrl key + V; Ctrl + X
  3140     //       Ctrl key + C; Ctrl key + V; Ctrl + X
  3559 void CAknFepManager::HandleChangeInFocusForSettingFep()
  3541 void CAknFepManager::HandleChangeInFocusForSettingFep()
  3560 	{
  3542 	{
  3561 	HandleChangeInFocus();
  3543 	HandleChangeInFocus();
  3562 	}
  3544 	}
  3563 
  3545 
       
  3546 // -----------------------------------------------------------------------------
       
  3547 // CAknFepManager::InitRectForSplitCandL
       
  3548 // Returns initial rectangle used for the top-left point of split candidate.
       
  3549 // -----------------------------------------------------------------------------
       
  3550 //
       
  3551 TRect CAknFepManager::InitRectForSplitCandL()
       
  3552     {
       
  3553     //  Popup Position was not right for RTL
       
  3554     TInt documentOffset = iLanguageCapabilities.iRightToLeftLanguage ?
       
  3555                             0 : iPtiEngine->CurrentWord().Length();
       
  3556     
       
  3557     // Determine the place where to spawn the candidate popup.
       
  3558     TPoint  inlineEditorTl;
       
  3559     TPoint  inlineEditorBr;
       
  3560     TInt    height;
       
  3561     TInt    ascent;
       
  3562     GetScreenCoordinatesL( inlineEditorTl, height, ascent, documentOffset );
       
  3563     GetScreenCoordinatesL( inlineEditorBr, height, ascent );
       
  3564         
       
  3565     // move 4 pixeles down to show underline when pops up candidate.
       
  3566     inlineEditorTl.iY += KUnderlineHeight;
       
  3567     inlineEditorBr.iY += KUnderlineHeight;
       
  3568     
       
  3569     return TRect( inlineEditorTl, inlineEditorBr );
       
  3570     }
       
  3571 
  3564 void CAknFepManager::HandleDestructionOfFocusedItem()
  3572 void CAknFepManager::HandleDestructionOfFocusedItem()
  3565     {
  3573     {
  3566     if (iInputCapabilities.FepAwareTextEditor())
  3574     if (iInputCapabilities.FepAwareTextEditor())
  3567         {
  3575         {
  3568         iFocusedItemDestroy = ETrue;
  3576         iFocusedItemDestroy = ETrue;
  3916 #endif // RD_TACTILE_FEEDBACK
  3924 #endif // RD_TACTILE_FEEDBACK
  3917 */
  3925 */
  3918             if( IsFlagSet( EFlagInsideInlineEditingTransaction ) )
  3926             if( IsFlagSet( EFlagInsideInlineEditingTransaction ) )
  3919                 {
  3927                 {
  3920                 if (IsFeatureSupportedJapanese())
  3928                 if (IsFeatureSupportedJapanese())
  3921 			        {
  3929                     {
  3922 			        TryCloseUiL();
  3930                     TryCloseUiL();
  3923 			        }
  3931                     }
  3924 			    else
  3932                 else
  3925 			        {
  3933                     {
  3926 #ifdef RD_INTELLIGENT_TEXT_INPUT			        
  3934 #ifdef RD_INTELLIGENT_TEXT_INPUT                    
  3927 			        iPtiEngine->CommitCurrentWord();
  3935                     iPtiEngine->CommitCurrentWord();
  3928 					CommitInlineEditL();
  3936                     CommitInlineEditL();
  3929 			        TryCloseUiL();
  3937                     TryCloseUiL();
  3930 
  3938 
  3931 #else
  3939 #else
  3932 					CommitInlineEditL();
  3940                     CommitInlineEditL();
  3933 #endif			        
  3941 #endif                    
  3934 			        }
  3942                     }
  3935                 }
  3943                 }
       
  3944             
       
  3945             // The flag should be removed when touch input is not launched. 
       
  3946             if ( IsExtendedFlagSet( EExtendedFlagPointInNoMatchEditor ) )
       
  3947             	{
       
  3948                 ClearExtendedFlag( EExtendedFlagPointInNoMatchEditor );
       
  3949             	}
  3936             break;      
  3950             break;      
  3937         case CAknExtendedInputCapabilities::MAknEventObserver::EControlContentUpdatedInternally:
  3951         case CAknExtendedInputCapabilities::MAknEventObserver::EControlContentUpdatedInternally:
  3938             SendEventsToPluginManL( EPluginSyncFepAwareText, EPluginSyncAll );
  3952             SendEventsToPluginManL( EPluginSyncFepAwareText, EPluginSyncAll );
  3939             break;
  3953             break;
  3940         case CAknExtendedInputCapabilities::MAknEventObserver::EOpenStylusMenuCcpu:
  3954         case CAknExtendedInputCapabilities::MAknEventObserver::EOpenStylusMenuCcpu:
  3941             // User has highlighted text and editor requests stylus ccpu popup menu
  3955             // User has highlighted text and editor requests stylus ccpu popup menu
  3942             // to be displayed.        
  3956             // to be displayed.        
  3943             LaunchStylusCcpuMenuL(iClickPoint);
  3957             LaunchStylusCcpuMenuL(iClickPoint);
       
  3958             break;
       
  3959         default:
  3944             break;
  3960             break;
  3945         }    
  3961         }    
  3946     }
  3962     }
  3947     
  3963     
  3948 void CAknFepManager::SubmitInlineTextL( const TDesC& aData )
  3964 void CAknFepManager::SubmitInlineTextL( const TDesC& aData )
  4270     switch (aCommandId)
  4286     switch (aCommandId)
  4271         {
  4287         {
  4272         // Edit mode menu commands
  4288         // Edit mode menu commands
  4273         //The soft CBA event from touch screen. 
  4289         //The soft CBA event from touch screen. 
  4274         case EAknSoftkeyCancel:
  4290         case EAknSoftkeyCancel:
  4275       //  case (TUint16)EAknSoftkeyCancel:
       
  4276         case EAknSoftkeySelect:
  4291         case EAknSoftkeySelect:
  4277      //   case (TUint16)EAknSoftkeySelect:
       
  4278         currentFepUI = FepUI();
  4292         currentFepUI = FepUI();
  4279         if (currentFepUI)
  4293         if (currentFepUI)
  4280             currentFepUI->HandleCommandL( aCommandId );
  4294             currentFepUI->HandleCommandL( aCommandId );
  4281             break;
  4295             break;
  4282         // --- commands for Japanese ---
  4296         // --- commands for Japanese ---
  5597     else
  5611     else
  5598         {
  5612         {
  5599         AddInputLanguageItemL(aMenuPane, posToInsertItem);
  5613         AddInputLanguageItemL(aMenuPane, posToInsertItem);
  5600         }
  5614         }
  5601     }
  5615     }
  5602 
       
  5603 // -----------------------------------------------------------------------------
       
  5604 // To check if the menu with the CascadeId exist in menupane
       
  5605 // -----------------------------------------------------------------------------
       
  5606 TBool CAknFepManager::MenuItemExistL( CAknFepUiInterfaceMenuPane* aMenuPane, 
       
  5607 									 TInt aCascadeId, TInt &aPosition )
       
  5608     {
       
  5609     TInt numOfMenuItems = aMenuPane->NumberOfItemsInPane();
       
  5610     CEikMenuPane* menuPane = aMenuPane->GetMenuPane();
       
  5611 
       
  5612     TInt index;
       
  5613     for( index = 0; index < numOfMenuItems ; ++index )
       
  5614         {
       
  5615         CEikMenuPaneItem::SData& itemData = menuPane->ItemDataByIndexL( index );
       
  5616         if( itemData.iCascadeId == aCascadeId )
       
  5617             {
       
  5618             aPosition = index;
       
  5619             return ETrue;
       
  5620             }
       
  5621         }
       
  5622     return EFalse;
       
  5623     }
       
  5624 
       
  5625 #endif // RD_INTELLIGENT_TEXT_INPUT
  5616 #endif // RD_INTELLIGENT_TEXT_INPUT
  5626 
  5617 
  5627 
  5618 
  5628 void CAknFepManager::AddEditSubmenuL(CAknFepUiInterfaceMenuPane* aMenuPane)
  5619 void CAknFepManager::AddEditSubmenuL(CAknFepUiInterfaceMenuPane* aMenuPane)
  5629     {
  5620     {
  5656     iRememberLength = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep();      
  5647     iRememberLength = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep();      
  5657     
  5648     
  5658     if (iRememberLength > 0 || (iEditorCcpuStatus & ECcpuStatusFlagCanPaste))
  5649     if (iRememberLength > 0 || (iEditorCcpuStatus & ECcpuStatusFlagCanPaste))
  5659         {
  5650         {
  5660 		if (aMenuPane->MenuItemExists(EAknCmdEditItemPlaceHolder, index) ||
  5651 		if (aMenuPane->MenuItemExists(EAknCmdEditItemPlaceHolder, index) ||
  5661 #ifdef RD_INTELLIGENT_TEXT_INPUT
  5652 				aMenuPane->MenuItemExists(EAknCmdInputLanguage, index) ||
  5662             MenuItemExistL( aMenuPane, R_AKNFEP_PRED_INPUT_OPTIONS_SUBMENU, index ) ||
       
  5663 #endif //RD_INTELLIGENT_TEXT_INPUT 
       
  5664             aMenuPane->MenuItemExists(EAknCmdInputLanguage, index) ||
       
  5665 		    aMenuPane->MenuItemExists(EAknCmdHelp, index) || 
  5653 		    aMenuPane->MenuItemExists(EAknCmdHelp, index) || 
  5666             aMenuPane->MenuItemExists(EAknCmdExit, index))  
  5654             aMenuPane->MenuItemExists(EAknCmdExit, index))  
  5667             {
  5655             {
  5668             TBuf<KMaxFileName> titleStr;
  5656             TBuf<KMaxFileName> titleStr;
  5669             StringLoader::Load(titleStr, R_AKNFEP_OPTIONS_EDIT_SUBMENU_TITLE);          
  5657             StringLoader::Load(titleStr, R_AKNFEP_OPTIONS_EDIT_SUBMENU_TITLE);          
  6471         {
  6459         {
  6472         aMenuPane->SetItemDimmed(EAknCmdEditModeAlpha, EFalse); 
  6460         aMenuPane->SetItemDimmed(EAknCmdEditModeAlpha, EFalse); 
  6473         aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue);
  6461         aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue);
  6474         aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue);
  6462         aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue);
  6475         aMenuPane->SetItemDimmed(EChinFepCmdModeLatinLower, ETrue);
  6463         aMenuPane->SetItemDimmed(EChinFepCmdModeLatinLower, ETrue);
       
  6464         if( iMode == EHangul || inputLanguage == ELangKorean)
       
  6465             {
       
  6466             TInt index;
       
  6467             if ( aMenuPane->MenuItemExists( EAknCmdEditModeKorean, index ) )
       
  6468                 {
       
  6469                 aMenuPane->SetItemDimmed(EAknCmdEditModeKorean, EFalse);
       
  6470                 }
       
  6471             }
  6476         }
  6472         }
  6477 
  6473 
  6478     if ( IsModePermitted(ENumber) )
  6474     if ( IsModePermitted(ENumber) )
  6479         {
  6475         {
  6480         if (( iMode != ENumber ||
  6476         if (( iMode != ENumber ||
  7079         }
  7075         }
  7080     }
  7076     }
  7081 
  7077 
  7082 void CAknFepManager::HandlePointerEventInInlineTextL(TPointerEvent::TType /*aType*/, TUint /*aModifiers*/, TInt /*aPositionInInlineText*/)
  7078 void CAknFepManager::HandlePointerEventInInlineTextL(TPointerEvent::TType /*aType*/, TUint /*aModifiers*/, TInt /*aPositionInInlineText*/)
  7083     {
  7079     {
       
  7080     if( iFepPluginManager && iLangMan && iLangMan->IsSplitView() )
       
  7081         {
       
  7082         switch ( iFepPluginManager->PluginInputMode() )
       
  7083             {
       
  7084             case EPluginInputModeFSQ:
       
  7085             //case EPluginInputModePortraitFSQ:
       
  7086                 {
       
  7087                 if ( iExactWordPopupContent )
       
  7088                 	{
       
  7089                     iExactWordPopupContent->HidePopUp();
       
  7090                 	}
       
  7091                 
       
  7092                 iFepPluginManager->HandleServerEventL( ESignalShowCandidate );
       
  7093                 }
       
  7094                 break;
       
  7095             case EPluginInputModeItut:
       
  7096                 {
       
  7097                 if( IsExtendedFlagSet( EExtendedFlagPointInNoMatchEditor ) )
       
  7098                     {
       
  7099                     ClearExtendedFlag( EExtendedFlagPointInNoMatchEditor );
       
  7100                     iFepPluginManager->HandleServerEventL( ESignalEnterSpellMode );
       
  7101                     }
       
  7102                 else
       
  7103                     {
       
  7104                     iFepPluginManager->EnterMatchSelectionState();
       
  7105                     }
       
  7106                 }
       
  7107                 break;
       
  7108             default:
       
  7109                 break;
       
  7110             }
       
  7111         }
  7084     }
  7112     }
  7085 
  7113 
  7086 void CAknFepManager::GetFormatOfFepInlineText(TCharFormat& aFormat, 
  7114 void CAknFepManager::GetFormatOfFepInlineText(TCharFormat& aFormat, 
  7087                                               TInt& aNumberOfCharactersWithSameFormat, 
  7115                                               TInt& aNumberOfCharactersWithSameFormat, 
  7088                                               TInt aPositionOfCharacter) const
  7116                                               TInt aPositionOfCharacter) const
 10050 	                {
 10078 	                {
 10051 	                showCursor = EFalse;
 10079 	                showCursor = EFalse;
 10052 	                }
 10080 	                }
 10053                 else
 10081                 else
 10054                     {
 10082                     {
 10055                     if(IsKoreanInputLanguage( ) && !IsQwerty() &&
 10083                     if(IsKoreanInputLanguage( ) && IsFlagSet(CAknFepManager::EFlagInsideInlineEditingTransaction))
 10056                     		IsFlagSet(CAknFepManager::EFlagInsideInlineEditingTransaction))
       
 10057                         {
 10084                         {
 10058                         showCursor = EFalse;
 10085                         showCursor = EFalse;
 10059                         }
 10086                         }
 10060                     }
 10087                     }
 10061 
 10088 
 10725             | EAknEditorSecretAlphaInputMode)))
 10752             | EAknEditorSecretAlphaInputMode)))
 10726             {
 10753             {
 10727             // Any latin input mode is not permitted by the editor.
 10754             // Any latin input mode is not permitted by the editor.
 10728             // For compatibility permitted japanese input modes are checked and
 10755             // For compatibility permitted japanese input modes are checked and
 10729             // corresponding latin input modes are allowed.
 10756             // corresponding latin input modes are allowed.
 10730             if ( iPermittedInputModes & ( EAknEditorKatakanaInputMode |
 10757             if ( iPermittedInputModes & (EAknEditorKatakanaInputMode |
 10731                                     EAknEditorHalfWidthTextInputMode |
 10758                                     EAknEditorHalfWidthTextInputMode |
 10732                                     EAknEditorFullWidthTextInputMode |
 10759                                     EAknEditorFullWidthTextInputMode |
 10733                                     EAknEditorFullWidthKatakanaInputMode |
 10760                                     EAknEditorFullWidthKatakanaInputMode |
 10734                                     EAknEditorHiraganaKanjiInputMode |
 10761                                     EAknEditorHiraganaKanjiInputMode |
 10735                                     EAknEditorHiraganaInputMode
 10762                                     EAknEditorHiraganaInputMode))
 10736                                     | EAknEditorHangulInputMode ) )
       
 10737                 {
 10763                 {
 10738                 iPermittedInputModes |= EAknEditorTextInputMode;
 10764                 iPermittedInputModes |= EAknEditorTextInputMode;
 10739                 }
 10765                 }
 10740             if ( iPermittedInputModes & EAknEditorFullWidthNumericInputMode )
 10766             if ( iPermittedInputModes & EAknEditorFullWidthNumericInputMode )
 10741                 {
 10767                 {
 10742                 iPermittedInputModes |= EAknEditorNumericInputMode;
 10768                 iPermittedInputModes |= EAknEditorNumericInputMode;
 10743                 }
 10769                 }
 10744 
 10770 
 10745             if ( !(defaultInputMode & (EAknEditorTextInputMode | EAknEditorNumericInputMode)))
 10771             if ( !(defaultInputMode & (EAknEditorTextInputMode | EAknEditorNumericInputMode)))
 10746                 {
 10772                 {
 10747                 if ( defaultInputMode & ( EAknEditorKatakanaInputMode |
 10773                 if (defaultInputMode & (EAknEditorKatakanaInputMode |
 10748                                     EAknEditorHalfWidthTextInputMode|
 10774                                     EAknEditorHalfWidthTextInputMode|
 10749                                     EAknEditorFullWidthTextInputMode |
 10775                                     EAknEditorFullWidthTextInputMode |
 10750                                     EAknEditorFullWidthKatakanaInputMode |
 10776                                     EAknEditorFullWidthKatakanaInputMode |
 10751                                     EAknEditorHiraganaKanjiInputMode |
 10777                                     EAknEditorHiraganaKanjiInputMode |
 10752                                     EAknEditorHiraganaInputMode
 10778                                     EAknEditorHiraganaInputMode))
 10753                                     | EAknEditorHangulInputMode ) )
       
 10754                     {
 10779                     {
 10755                     defaultInputMode = EAknEditorTextInputMode;
 10780                     defaultInputMode = EAknEditorTextInputMode;
 10756                     }
 10781                     }
 10757                 else if (defaultInputMode & EAknEditorFullWidthNumericInputMode)
 10782                 else if (defaultInputMode & EAknEditorFullWidthNumericInputMode)
 10758                     {
 10783                     {
 10836             }
 10861             }
 10837         else if (editorMode == EAknEditorTextInputMode)
 10862         else if (editorMode == EAknEditorTextInputMode)
 10838             {        
 10863             {        
 10839             if (IsKoreanInputLanguage())
 10864             if (IsKoreanInputLanguage())
 10840             	{
 10865             	{
 10841                 if( iMode == EAknEditorNullInputMode )
 10866                 if(iMode == EHangul || iMode == ENumber || iMode == EAknEditorNullInputMode )
 10842             		{
 10867             		{
 10843             		SetWesternPredictive(EFalse);
 10868             		SetWesternPredictive(EFalse);
 10844          			TryChangeModeL(EHangul);
 10869          			TryChangeModeL(EHangul);
 10845             		}
 10870             		}
 10846             	else
 10871             	else
 10852             	{
 10877             	{
 10853             	//this is safe default as it is currently allowed in all FEPs
 10878             	//this is safe default as it is currently allowed in all FEPs
 10854             	TryChangeModeL(ELatin); 
 10879             	TryChangeModeL(ELatin); 
 10855             	}
 10880             	}
 10856             }
 10881             }
 10857         else if ( editorMode == EAknEditorHangulInputMode )
       
 10858         	{
       
 10859             // Choose EHangul as the current fep mode 
       
 10860             // if the editor mode stored in editor state is EAknEditorHangulInputMode. 
       
 10861             TryChangeModeL(EHangul);        
       
 10862         	}        
       
 10863         else if (!iStrokeUsedInQWERTY)
 10882         else if (!iStrokeUsedInQWERTY)
 10864         	{
 10883         	{
 10865         	if (editorMode == EStroke && sharedDataMode == ECangJie)
 10884         	if (editorMode == EStroke && sharedDataMode == ECangJie)
 10866         		{
 10885         		{
 10867         		TryChangeModeL(sharedDataMode);
 10886         		TryChangeModeL(sharedDataMode);
 11468                 {
 11487                 {
 11469                 editorMode = EAknEditorFullWidthNumericInputMode;
 11488                 editorMode = EAknEditorFullWidthNumericInputMode;
 11470                 }
 11489                 }
 11471             break;
 11490             break;
 11472     	case EHangul: 
 11491     	case EHangul: 
 11473        		editorMode = EAknEditorHangulInputMode;       	
 11492        		editorMode = EAknEditorTextInputMode;       	
 11474        		break;
 11493        		break;
 11475         default:
 11494         default:
 11476             if (IsFeatureSupportedJapanese())
 11495             if (IsFeatureSupportedJapanese())
 11477                 {
 11496                 {
 11478                 editorMode = EditorMode(aFepMode, iCharWidth);
 11497                 editorMode = EditorMode(aFepMode, iCharWidth);
 12341 	                }
 12360 	                }
 12342 	            }
 12361 	            }
 12343 	        }
 12362 	        }
 12344   
 12363   
 12345         if (!iLanguageCapabilities.iLocalInputLanguageInUse)
 12364         if (!iLanguageCapabilities.iLocalInputLanguageInUse)
 12346             {
 12365         	{
 12347             switch (iSharedDataInterface->InputTextLanguage())
 12366         	switch (iSharedDataInterface->InputTextLanguage())
 12348                 {
 12367             	{
 12349                 case ELangPrcChinese:
 12368             	case ELangPrcChinese:
 12350                     {
 12369             		{
 12351                     iSharedDataInterface->SetInputMode(EPinyin);
 12370             		iSharedDataInterface->SetInputMode(EPinyin);
 12352                     SetFlag(EFlagNewSharedDataInputMode);
 12371             		SetFlag(EFlagNewSharedDataInputMode);
 12353                     break;
 12372             		break;            		
 12354                     }
 12373             		}
 12355             	case ELangTaiwanChinese:
 12374             	case ELangTaiwanChinese:
 12356                     {
 12375             		{
 12357                     iSharedDataInterface->SetInputMode(EZhuyin);
 12376             	    iSharedDataInterface->SetInputMode(EZhuyin);
 12358                     SetFlag(EFlagNewSharedDataInputMode);
 12377             	    SetFlag(EFlagNewSharedDataInputMode);
 12359                     break;
 12378             	    break;
 12360                     }
 12379             		}
 12361                 case ELangHongKongChinese:
 12380             	case ELangHongKongChinese:
 12362                     {
 12381             		{
 12363                     iSharedDataInterface->SetInputMode(EStroke);
 12382             	    iSharedDataInterface->SetInputMode(EStroke);
 12364                     SetFlag(EFlagNewSharedDataInputMode);
 12383             	    iSharedDataInterface->SetCangJieMode(ECangJieNormal);
 12365                     break;
 12384             	    SetFlag(EFlagNewSharedDataInputMode);
 12366                     }
 12385             	    break;
 12367                 default:
 12386             		}
 12368                     break;
 12387             	default:
 12369                 }
 12388             		break;
       
 12389             	}
 12370             }
 12390             }
 12371 
 12391 
 12372     	SetHashKeyStyle();
 12392     	SetHashKeyStyle();
 12373     	UpdateEditorContext();
 12393     	UpdateEditorContext();
 12374   		}
 12394   		}
 13909             	{
 13929             	{
 13910             	currentEditorSCTResId = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_CHINESE;
 13930             	currentEditorSCTResId = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_CHINESE;
 13911         	    }        
 13931         	    }        
 13912             }
 13932             }
 13913         }
 13933         }
 13914 
       
 13915     if ( FeatureManager::FeatureSupported(KFeatureIdKorean) )
       
 13916         {
       
 13917         // Use the special sct resource file for Korean variant.
       
 13918         if (currentEditorSCTResId == R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG)
       
 13919             {
       
 13920             currentEditorSCTResId = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_KOREAN;
       
 13921             }
       
 13922         }
       
 13923     
       
 13924     if (currentEditorSCTResId == EDefaultSCTResourceId) // -1 forces the default in SCT resource definition
 13934     if (currentEditorSCTResId == EDefaultSCTResourceId) // -1 forces the default in SCT resource definition
 13925         {
 13935         {
 13926         if (iAknEditorFlags & EAknEditorFlagLatinInputModesOnly)
 13936         if (iAknEditorFlags & EAknEditorFlagLatinInputModesOnly)
 13927             {
 13937             {
 13928             currentEditorSCTResId = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_LATIN_ONLY;
 13938             currentEditorSCTResId = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_LATIN_ONLY;
 13953             else
 13963             else
 13954                 {
 13964                 {
 13955                 if ( FeatureManager::FeatureSupported(KFeatureIdChinese) )
 13965                 if ( FeatureManager::FeatureSupported(KFeatureIdChinese) )
 13956                     {    
 13966                     {    
 13957                     currentEditorSCTResId = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_CHINESE;
 13967                     currentEditorSCTResId = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_CHINESE;
 13958                     }                
 13968                     }
 13959                 else if( FeatureManager::FeatureSupported(KFeatureIdKorean) )
       
 13960                     {    
       
 13961                     // Use the special sct resource file for Korean variant.
       
 13962                     currentEditorSCTResId = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_KOREAN;
       
 13963                     }               
       
 13964                 else
 13969                 else
 13965                     {                    
 13970                     {                    
 13966                     currentEditorSCTResId = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG;
 13971                     currentEditorSCTResId = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG;
 13967                     }
 13972                     }
 13968                 }
 13973                 }
 15273     
 15278     
 15274     if (TryHandleCommonArrowAndBackspaceFunctionalityL(aCode, response))
 15279     if (TryHandleCommonArrowAndBackspaceFunctionalityL(aCode, response))
 15275         {
 15280         {
 15276         return response;
 15281         return response;
 15277         }
 15282         }
 15278     
       
 15279     // You will not understand the flowing lines, 
       
 15280     // for it is just a "hole stem" than normal logic.
       
 15281     //
       
 15282     // Let me explain: 
       
 15283     // In HWR, 4x12 keyboard is used, and predictive should be disabled for it.
       
 15284     // unfortunately, the existed codes enable predictive in some special case.
       
 15285     // when you switch from FSQ to HWR, with ITI on, you will get that.
       
 15286     // then if you press arrow key, 
       
 15287     // the code blow of "HandlePredictiveNaviEventOutsideInlineEditL" will be called.
       
 15288     // which is writen for FSQ, not HWR, that finally cause navi-event being consumed.
       
 15289     // No navigation action being performed.
       
 15290     //
       
 15291     // It is not a complete fix, just for simplicity. 
       
 15292     if (iFepPluginManager && 
       
 15293         iFepPluginManager->PluginInputMode() == EPluginInputModeFingerHwr)
       
 15294         {
       
 15295         return EKeyWasNotConsumed;
       
 15296         }
       
 15297 
       
 15298     if (WesternPredictive())
 15283     if (WesternPredictive())
 15299         {
 15284         {
 15300         response = HandlePredictiveNaviEventOutsideInlineEditL(aCode, aLength);
 15285         response = HandlePredictiveNaviEventOutsideInlineEditL(aCode, aLength);
 15301         }
 15286         }
 15302 
 15287 
 15646         if (currentEditorSelection.Length())
 15631         if (currentEditorSelection.Length())
 15647             {
 15632             {
 15648             // we have text selected - set cursor to start/end of current selection
 15633             // we have text selected - set cursor to start/end of current selection
 15649             TTmDocPosSpec newPos;
 15634             TTmDocPosSpec newPos;
 15650             aResponse = NavigateFromSelectionL( currentEditorSelection, naviEvent, newPos );
 15635             aResponse = NavigateFromSelectionL( currentEditorSelection, naviEvent, newPos );
 15651             
 15636             if ( aCode != EKeyBackspace && WesternPredictive() )
 15652             // You will not understand the following lines, 
       
 15653             // for it is just a "hole stem" than normal logic.
       
 15654             //
       
 15655             // Let me explain: 
       
 15656             // In HWR, 4x12 keyboard is used, and predictive should be disabled for it.
       
 15657             // unfortunately, the existing codes enable predictive in some special case.
       
 15658             // when you switch from FSQ to HWR, with ITI on, you will get that.
       
 15659             // then if you select some words and press arrow key, 
       
 15660             // the if bratch of the code blow will be excuted.
       
 15661             // which is writen for FSQ, not HWR, 
       
 15662             // MoveCursorToEndOfWordL or MoveCursorToStartOfWordL is called unexpected
       
 15663             //
       
 15664             // It is not a complete fix, just for simplicity.
       
 15665             TBool isFingerHwr = ( iFepPluginManager != NULL ) && 
       
 15666 								( iFepPluginManager->PluginInputMode() == EPluginInputModeFingerHwr );
       
 15667 
       
 15668             if ( aCode != EKeyBackspace && !isFingerHwr && WesternPredictive() )
       
 15669                 {
 15637                 {
 15670                 if (CursorInsideWord())
 15638                 if (CursorInsideWord())
 15671                     {
 15639                     {
 15672                     TBool rightToleftParagraph = IsRightToLeftParagraph(newPos);
 15640                     TBool rightToleftParagraph = IsRightToLeftParagraph(newPos);
 15673                     if ( (rightToleftParagraph && naviEvent == ELeftNaviEvent) ||
 15641                     if ( (rightToleftParagraph && naviEvent == ELeftNaviEvent) ||
 18435         if (charMap == R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG)
 18403         if (charMap == R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG)
 18436             {
 18404             {
 18437             charMap = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_CHINESE;
 18405             charMap = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_CHINESE;
 18438             }
 18406             }
 18439         }
 18407         }
 18440     else if ( FeatureManager::FeatureSupported(KFeatureIdKorean) )
       
 18441         {     
       
 18442         // Use the special sct resource file for Korean variant.
       
 18443         if (charMap == R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG)
       
 18444             {
       
 18445             charMap = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_KOREAN;
       
 18446             }
       
 18447         }
       
 18448     if (!charMap)
 18408     if (!charMap)
 18449         {
 18409         {
 18450         // override numeric keymap if necessary. flag is for non standard charmaps
 18410         // override numeric keymap if necessary. flag is for non standard charmaps
 18451         TInt standardNumericCharMap = EDefaultNumericCharMapResId;
 18411         TInt standardNumericCharMap = EDefaultNumericCharMapResId;
 18452         if ((iMode == ENumber || iMode == ENativeNumber) &&
 18412         if ((iMode == ENumber || iMode == ENativeNumber) &&
 18462         
 18422         
 18463     if ( charMap == ENoCharacters && !IsAbleToLaunchSCT())
 18423     if ( charMap == ENoCharacters && !IsAbleToLaunchSCT())
 18464         {
 18424         {
 18465     	currentEditorSCTResId = charMap;
 18425     	currentEditorSCTResId = charMap;
 18466         }
 18426         }
 18467     if(R_AKNFEP_SCT_NUMERIC_MODE_CHARS_PLAIN == charMap)
 18427     if(R_AKNFEP_SCT_NUMERIC_MODE_CHARS_PLAIN == charMap && 
       
 18428        ( R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_LATIN_ONLY == currentEditorSCTResId || 
       
 18429          R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG == currentEditorSCTResId || 
       
 18430          R_AVKON_URL_SPECIAL_CHARACTER_TABLE_DIALOG == currentEditorSCTResId) )
 18468         {
 18431         {
 18469         TBool isEmpty = ETrue;
 18432         TBool isEmpty = ETrue;
 18470         TRAP_IGNORE(isEmpty = GetSctLengthL(charMap));
 18433         TRAP_IGNORE(isEmpty = GetSctLengthL(charMap));
 18471         if(isEmpty)
 18434         if(isEmpty)
 18472            {
 18435            {
 18576                  iFepPluginManager->PluginInputMode() == EPluginInputModePortraitFSQ )
 18539                  iFepPluginManager->PluginInputMode() == EPluginInputModePortraitFSQ )
 18577 
 18540 
 18578                 {
 18541                 {
 18579                 SetStopProcessFocus(ETrue, EFalse);
 18542                 SetStopProcessFocus(ETrue, EFalse);
 18580                 iFepPluginManager->SetMenuState();            
 18543                 iFepPluginManager->SetMenuState();            
 18581                 }                      
 18544                 }            
 18582              else if (!iFepPluginManager->IsGlobleNotes())
 18545              else if (!iFepPluginManager->IsGlobleNotes())
 18583                 {
 18546                 {
 18584                 iFepPluginManager->ClosePluginInputUiL( ETrue );
 18547                 iFepPluginManager->ClosePluginInputUiL( ETrue );
 18585                 }
 18548                 }
 18586             }
 18549             }
 18634                 {
 18597                 {
 18635                  if (iFepPluginManager->PluginInputMode() == EPluginInputModeItut ||
 18598                  if (iFepPluginManager->PluginInputMode() == EPluginInputModeItut ||
 18636                      iFepPluginManager->PluginInputMode() == EPluginInputModeFSQ ||
 18599                      iFepPluginManager->PluginInputMode() == EPluginInputModeFSQ ||
 18637                      iFepPluginManager->PluginInputMode() == EPluginInputModeFingerHwr ||
 18600                      iFepPluginManager->PluginInputMode() == EPluginInputModeFingerHwr ||
 18638                      iFepPluginManager->PluginInputMode() == EPluginInputModePortraitFSQ )
 18601                      iFepPluginManager->PluginInputMode() == EPluginInputModePortraitFSQ )
       
 18602 
 18639                     {
 18603                     {
 18640                     SetStopProcessFocus(EFalse);
 18604                     SetStopProcessFocus(EFalse);
 18641                     }                      
 18605                     }            
 18642                  else
 18606                  else
 18643                     {
 18607                     {
 18644                     HandleChangeInFocus();
 18608                     HandleChangeInFocus();
 18645                     }
 18609                     }
 18646                 }
 18610                 }
 19014 #endif		
 18978 #endif		
 19015     TRAP_IGNORE(SendEventsToPluginManL( EPluginResourceChanged, aType ));
 18979     TRAP_IGNORE(SendEventsToPluginManL( EPluginResourceChanged, aType ));
 19016     }   
 18980     }   
 19017 void CAknFepManager::HandlePointerEventL(const TPointerEvent& aPointerEvent)
 18981 void CAknFepManager::HandlePointerEventL(const TPointerEvent& aPointerEvent)
 19018     {
 18982     {
 19019     if (IsFlagSet(CAknFepManager::EFlagNoMatches))
 18983     if ( IsFlagSet( CAknFepManager::EFlagNoMatches ) )
 19020         {
 18984         {
 19021         ClearFlag(CAknFepManager::EFlagNoMatches); 
 18985 	    // Set this flag to launch spell mode on split itut 
       
 18986         SetExtendedFlag( EExtendedFlagPointInNoMatchEditor );
       
 18987 		ClearFlag(CAknFepManager::EFlagNoMatches); 
 19022         }
 18988         }
 19023    
 18989    
 19024     if(aPointerEvent.iType == TPointerEvent::EDrag)
 18990     if(aPointerEvent.iType == TPointerEvent::EDrag)
 19025     	{
 18991     	{
 19026     	SetExtendedFlag(EExtendedFlagPointerEventTypeEDrag);
 18992     	SetExtendedFlag(EExtendedFlagPointerEventTypeEDrag);
 20868 	        return ETrue;
 20834 	        return ETrue;
 20869 	        } 
 20835 	        } 
 20870     	}       
 20836     	}       
 20871     return EFalse;    
 20837     return EFalse;    
 20872     }    
 20838     }    
 20873 void CAknFepManager::ChangeMfneAmPmL()
 20839 void CAknFepManager::ChangeMfneAmPm()
 20874     {
 20840     {
 20875 	//trigger when touch at "AM" or "PM" in ICF
 20841 	//trigger when touch at "AM" or "PM" in ICF
 20876     if (iInputCapabilities.FepAwareTextEditor() && IsMfneEditor() )
 20842     if (iInputCapabilities.FepAwareTextEditor() && IsMfneEditor() )
 20877         {
 20843         {
 20878         MObjectProvider* mop = iInputCapabilities.ObjectProvider();
 20844         MObjectProvider* mop = iInputCapabilities.ObjectProvider();
 21039 void CAknFepManager::HideExactWordPopUp()
 21005 void CAknFepManager::HideExactWordPopUp()
 21040 	{
 21006 	{
 21041 	iExactWordPopupContent->HidePopUp();
 21007 	iExactWordPopupContent->HidePopUp();
 21042 	TRAP_IGNORE( SendEventsToPluginManL( EPluginHideTooltip ));
 21008 	TRAP_IGNORE( SendEventsToPluginManL( EPluginHideTooltip ));
 21043 	}
 21009 	}
 21044 
       
 21045 //========================================================================
       
 21046 //
       
 21047 // This function judge whether the texts inputted exceed 
       
 21048 // the max length of the editor. 
       
 21049 // 
       
 21050 //========================================================================
       
 21051 TBool CAknFepManager::IsTextExceedLeghthEditor( TInt aNewInlineTextLenght )
       
 21052 	{
       
 21053     
       
 21054     // Get the length of the newest text that contains uncommitted texts 
       
 21055 	TInt curPos = iUncommittedText.iAnchorPos + aNewInlineTextLenght;
       
 21056     
       
 21057     // Get the length of the text that is newly increased in uncommitted texts.
       
 21058 	TInt deltaCur = curPos - iUncommittedText.iCursorPos;
       
 21059 	
       
 21060     // Get the max length of the editor
       
 21061 	TInt maxEdSize = iInputCapabilities.FepAwareTextEditor()->DocumentMaximumLengthForFep();
       
 21062 
       
 21063     // Get the length of current the texts in the editor. The texts contain committed and uncomitted.    
       
 21064 	TInt docLength = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep();
       
 21065 	
       
 21066       // DeltaCur is greater than zero.
       
 21067       if((maxEdSize > 0) && ( deltaCur > 0 ) 
       
 21068 							&& (( docLength + deltaCur) > maxEdSize ) )
       
 21069          {
       
 21070          return ETrue;
       
 21071          }
       
 21072       // DeltaCur is negative. For example uncommitted texts contain candidate words.
       
 21073       else if ( (maxEdSize > 0) && (curPos > maxEdSize) )
       
 21074           {
       
 21075           return ETrue;
       
 21076           }
       
 21077         else
       
 21078           {
       
 21079 
       
 21080           // Not exceeding the max length of editor
       
 21081           return EFalse;
       
 21082           }
       
 21083 	}
       
 21084 
       
 21085 
 21010 
 21086 TBool CAknFepManager::IsExactWordPopUpShown()
 21011 TBool CAknFepManager::IsExactWordPopUpShown()
 21087 	{
 21012 	{
 21088 #ifdef RD_SCALABLE_UI_V2 
 21013 #ifdef RD_SCALABLE_UI_V2 
 21089 	return iExactWordPopupContent->IsPopUpVisible()
 21014 	return iExactWordPopupContent->IsPopUpVisible()
 21349 // CAknFepManager::HandleFnKeyPressMonitor
 21274 // CAknFepManager::HandleFnKeyPressMonitor
 21350 // Handle fnkey press monitor callback
 21275 // Handle fnkey press monitor callback
 21351 // ---------------------------------------------------------------------------
 21276 // ---------------------------------------------------------------------------
 21352 //
 21277 //
 21353 void CAknFepManager::HandleFnKeyPressMonitor()
 21278 void CAknFepManager::HandleFnKeyPressMonitor()
 21354 	{	
 21279 	{
 21355 	 DeactivateFnkeyPressMonitor();
 21280 	 DeactivateFnkeyPressMonitor();
 21356 	 if (IsExtendedFlagSet ( EExtendedFlagFnKeyNeedLockMode ) )
 21281 	 if (IsExtendedFlagSet ( EExtendedFlagFnKeyNeedLockMode ) )
 21357 		 {
 21282 		 {
 21358 	      iFnKeyManager->SetFnKeyState(CAknFepFnKeyManager::EFnKeyLock);
 21283 	      iFnKeyManager->SetFnKeyState(CAknFepFnKeyManager::EFnKeyLock);
 21359 		 }
 21284 		}
 21360 	}
 21285 	}
 21361 
 21286 
 21362 // ---------------------------------------------------------------------------
 21287 // ---------------------------------------------------------------------------
 21363 // CAknFepManager::ActivateFnkeyPressMonitor
 21288 // CAknFepManager::ActivateFnkeyPressMonitor
 21364 // Activate Fnkey press Monitor
 21289 // Activate Fnkey press Monitor
 21369 	 if( iFnKeypressMonitor )
 21294 	 if( iFnKeypressMonitor )
 21370 		 {	      
 21295 		 {	      
 21371 	      if ( iFnKeypressMonitor->IsActive() )
 21296 	      if ( iFnKeypressMonitor->IsActive() )
 21372 	    	  {
 21297 	    	  {
 21373 	           iFnKeypressMonitor->Cancel();
 21298 	           iFnKeypressMonitor->Cancel();
 21374 	    	  }
 21299 	    	  }	      
 21375 	      
       
 21376 		  iFnKeypressMonitor->Start(KFnKeyLongPressTimeout, KFnKeyLongPressTimeout, 
 21300 		  iFnKeypressMonitor->Start(KFnKeyLongPressTimeout, KFnKeyLongPressTimeout, 
 21377 							   TCallBack(HandleFnKeyPressMonitorCallback, this));
 21301 							   TCallBack(HandleFnKeyPressMonitorCallback, this));
 21378 		 }
 21302 		 }
 21379 	}
 21303 	}
 21380 
 21304