fep/aknfep/inc/AknFepManager.h
changeset 0 eb1f2e154e89
child 3 f5a1e66df979
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     1 /*
       
     2 * Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0""
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:           
       
    15 *       Provides the CAknFepManager definition.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 
       
    30 #ifndef __AKN_FEP_MANAGER_H__
       
    31 #define __AKN_FEP_MANAGER_H__
       
    32 
       
    33 #include "AknFepGlobalEnums.h"          //TKeyPressLength
       
    34 #include "AknFepManagerUIInterface.h"   //MAknFepManagerUIInterface
       
    35 #include "AknFepLanguageManager.h"      //CAknFepLanguageManager
       
    36 #include <gulicon.h>  
       
    37 #include "aknfepuiinterface.h"
       
    38 #include "aknfepuimenus.h"
       
    39 #include <fepbase.h>                    //CCoeFep
       
    40 #include <coeinput.h>                   //TCoeInputCapabilities
       
    41 #include <fepitfr.h>                    //MFepInlineTextFormatRetriever
       
    42 #include <aknedstsobs.h>                //MAknEdStateObserver
       
    43 #include <uikon.hrh>                    //TAknEditorNumericKeymap
       
    44 #include <aknEditStateIndicator.h>      //TAknEditingState
       
    45 #include <frmtlay.h>
       
    46 #include <biditext.h>
       
    47 #include <PtiDefs.h>
       
    48 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    49 #include <tagmaLayoutAndSource.h>
       
    50 #endif
       
    51 
       
    52 #include <aknextendedinputcapabilities.h>
       
    53 #ifdef RD_SCALABLE_UI_V2
       
    54 #include <peninputclient.h>
       
    55 #endif //#ifdef RD_SCALABLE_UI_V2
       
    56 
       
    57 #include <AknNullService.h>             // CAknNullService
       
    58 #include <AknServerApp.h>               // MAknServerAppExitObserver
       
    59 #include <aknfeppensupportinterface.h>
       
    60 #include "avkon.hrh"
       
    61 #ifdef RD_HINDI_PHONETIC_INPUT	
       
    62 #include <PtiIndicDefs.h>
       
    63 #endif
       
    64 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
    65 // Predictive QWERTY (XT9) changes ---->
       
    66 class MAknFepUiWordPopupContent;
       
    67 #include "AknFepCandidatePopup.h"
       
    68 #include "AknFepCandidatePopupCallback.h"
       
    69 // Predictive QWERTY (XT9) changes <----
       
    70 #endif //RD_INTELLIGENT_TEXT_INPUT
       
    71 class CAknFepPluginManager;
       
    72 class CAknFepKeyCatcherInterface;
       
    73 class MAknFepManagerInterface;
       
    74 class CAknFepIndicator;
       
    75 class CAknEdwinState;
       
    76 class CPeriodic;
       
    77 class MAknEditingStateIndicator;
       
    78 class CAknFepCaseManager;
       
    79 class CAknFepHashKeyManager;
       
    80 class CAknKeySoundSystem;
       
    81 class CPtiEngine;
       
    82 class CAknFepSharedDataInterface;
       
    83 class CApaDocument; // User Dictionary
       
    84 class CAknFepInlineTextDecorator;
       
    85 class CTextView;
       
    86 class MPeninputServerEventHandler;
       
    87 class MAknFepDocumentNavigation;
       
    88 class CAknFepUIInterface;
       
    89 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
    90 class CAknFepFnKeyManager;
       
    91 #endif
       
    92 //phrase creation
       
    93 class CZhuyinKeyHandler;
       
    94 class CAknFepZhuyinAnalyser;
       
    95 class CZhuyinAnalyserDbFeed;
       
    96 //User DB view
       
    97 class CAknFepUserdbDlg;
       
    98 class CAknFepThaiSCTSelector;
       
    99 class CAknNavigationDecorator;
       
   100 // This could be moved inside FepManager class?
       
   101 enum TWesternNaviEvent
       
   102     {
       
   103     ENullNaviEvent,
       
   104     ELeftNaviEvent,
       
   105     ERightNaviEvent,
       
   106     EBackspaceEvent,
       
   107     EUpNaviEvent,
       
   108     EDownNaviEvent
       
   109     };
       
   110 enum TSpecialTextField
       
   111 		{
       
   112  		/**
       
   113  		* Constraints
       
   114  		*/
       
   115     ESplAny,
       
   116     ESplMailAddr,
       
   117     ESplNumeric,
       
   118     ESplPhoneNumber,
       
   119     ESplUrl,
       
   120     ESplDecimal,
       
   121     /**
       
   122      * Modifiers
       
   123      */
       
   124     ESplPassword=0x10000,
       
   125     ESplUneditable=0x20000,
       
   126     ESplSensitive=0x40000,
       
   127     ESplNonPredictive=0x80000,
       
   128     ESPlInitialCapsWord=0x100000,
       
   129     ESplInitialCapsWordSentence=0x200000,
       
   130     ESplConstraintMask=0xFFFF
       
   131  		};    
       
   132 
       
   133 const TInt KChrKeyMultitapTimeout = 1000000;
       
   134 /**
       
   135  * Translates ET9Eng language codes into localised descriptors and command Id's
       
   136  */
       
   137 class TFepLanguageTranslation
       
   138     {
       
   139     public:
       
   140         void ReadFromResource(TResourceReader& aReader);
       
   141     public:
       
   142         TPtrC           iName;
       
   143         TInt            iLanguageId;
       
   144         TInt            iCommandId;
       
   145     };
       
   146 class CChrMultiTapTimer : public CTimer
       
   147     {
       
   148     public:
       
   149         static CChrMultiTapTimer* NewL(TCallBack aCallback);
       
   150         void After(TTimeIntervalMicroSeconds32 aInterval);
       
   151     private:
       
   152         CChrMultiTapTimer(TCallBack aCallback);
       
   153         void ConstructL();
       
   154         // from CActive
       
   155         virtual void RunL();
       
   156     private:
       
   157         TCallBack iCallback;
       
   158     };
       
   159 /**
       
   160  * The CCoeFep derived class of AknFep
       
   161  * Controls mode in the Fep. Handles all interaction with the editor
       
   162  * Creates and owns the UI Manger, the Key Catcher and the edit state indicators
       
   163  */
       
   164 class CAknFepManager :
       
   165     public CCoeFep,
       
   166     public MAknFepManagerUIInterface,
       
   167     public MFepInlineTextFormatRetriever,
       
   168     public MFepPointerEventHandlerDuringInlineEdit,
       
   169     public MAknFepUiInterfaceMenuObserver,
       
   170     public MAknServerAppExitObserver,   //embedding
       
   171     private MAknEdStateObserver,
       
   172 #ifdef RD_SCALABLE_UI_V2  
       
   173     public CAknExtendedInputCapabilities::MAknEventObserver,
       
   174 #endif
       
   175     private MFormCustomDraw
       
   176 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   177     ,public MAknFepCandidatePopupCallback // Predictive QWERTY (XT9) changes
       
   178 #endif //RD_INTELLIGENT_TEXT_INPUT
       
   179     {
       
   180 
       
   181 private:
       
   182     class TTextDirectionalInfo
       
   183         {
       
   184         public:
       
   185 
       
   186             enum TTextDirectionalStatus
       
   187                 {
       
   188                 EUnknown,
       
   189                     ENotInDocument,
       
   190                     ENoDirectionalChunks,
       
   191                     ERightToLeft,
       
   192                     ELeftToRight
       
   193                 };
       
   194 
       
   195             enum TDirectionalBlockEnvironment
       
   196                 {
       
   197                 EUndefined,
       
   198                     EInsideBlock,
       
   199                     EAtRightEndOfLine,
       
   200                     EAtLeftEndOfLine,
       
   201                     EAtRightEndOfBlockFacingOppositeDirectionalBlock,
       
   202                     EAtLeftEndOfBlockFacingOppositeDirectionalBlock,
       
   203                     EAtRightEndOfBlockFacingSameDirectionBlock,
       
   204                     EAtLeftEndOfBlockFacingSameDirectionBlock
       
   205                 };
       
   206         public:
       
   207             // Constructor
       
   208             TTextDirectionalInfo();
       
   209             void SetDirectionFromChunk( const CTmTextLayout::TTmChunkDescription& aChunk);
       
   210         public:
       
   211             TTextDirectionalStatus iDirectionalStatus;
       
   212             TDirectionalBlockEnvironment iBlockEnvironment;
       
   213         };
       
   214 
       
   215 public:
       
   216     /**
       
   217      * values for the flags required to maintain the internal
       
   218      * state of the Fep Manager during operation
       
   219      */
       
   220     enum
       
   221         {
       
   222         EFlagInsideMultitapInlineEditingTransaction     =0x00000001,
       
   223         EFlagLaunchEditMenu                             =0x00000002,
       
   224         EFlagLongShiftKeyPress                          =0x00000004,
       
   225         EFlagNoActionDuringShiftKeyPress                =0x00000008,
       
   226         EFlagShiftKeyDepressed                          =0x00000010,
       
   227         EFlagInsideInlineEditingTransaction             =0x00000020,
       
   228         EFlagPassNextKey                                =0x00000040,
       
   229         EFlagQwertyChrKeyDepressed                      =0x00000080,  // Not used. Qwerty mode is not supported.
       
   230         EFlagLineFeedCharacter                          =0x00000100,
       
   231         EFlagEditorFull                                 =0x00000200,
       
   232         EFlagNewSharedDataInputMode                     =0x00000400,
       
   233         EFlagNoActionDuringChrKeyPress                  =0x00000800,
       
   234 
       
   235         EFlagSupressAutoUpdateAtEditorStart             =0x00001000,
       
   236         EFlagNoMatches                                  =0x00002000,
       
   237         EFlagSuppressInputStateChange                   =0x00004000,
       
   238         EFlagCompoundWord                               =0x00008000,
       
   239         EFlagChangeInputMode                            =0x00010000,
       
   240         EFlagForegroundUIComponentVisible               =0x00020000,
       
   241         EFlagMenuPaneVisible                            =0x00040000,
       
   242         EFlagRemoveMatchesMenuItem                      =0x00080000,
       
   243         EFlagInlineEditInBackground                     =0x00100000,
       
   244         EFlagNewSharedDataInputLanguage                 =0x00200000,
       
   245         EFlagLastCharacterInEditor                      =0x00400000,
       
   246 
       
   247         EFlagSpaceCharacter                             =0x00800000,        // adding for japanese
       
   248         EFlagFullWidthSpaceCharacter                    =0x01000000,        // adding for japanese
       
   249         EFlagBidiCursorIsInitialized                    =0x02000000,
       
   250         EFlagCursorPointsRightToLeft                    =0x04000000,
       
   251         EFlagAtDirectionallyAmbiguousPoint              =0x08000000,
       
   252         EFlagCharacterAdded                             =0x10000000,
       
   253         EFlagNoInlineEditFormatting                     =0x20000000,  // Not really used yet!
       
   254         EFlagQwertyShiftMode                            =0x40000000,  // Not used. Qwerty mode is not supported.
       
   255         EFlagSupressAutoUpdate                          =0x80000000
       
   256         };
       
   257     
       
   258      enum
       
   259      	{
       
   260 		EExtendedFlagShortPressHashKey                    =0x00000001,
       
   261      	EExtendedFlagNoModeChange                         =0x00000002,
       
   262      	EExtendedFlagShiftReleasedOnPopup                 =0x00000004,
       
   263      	EExtendedFlagOkKeyPressOnCandidatePopup           =0x00000008,
       
   264      	/* Flag to take care of graceful exit for FEP launched dialog when the underneath editor is closed */
       
   265         EExtendedFlagEdwinEditorDestroyed                 =0x00000010,
       
   266         /* Flag to set decide when to set multiple observer for FEP. Set this flag whenever a FEP aware dialog is launched */
       
   267         EExtendedFlagFepAwareDialogLaunched               =0x00000020,
       
   268         /* Flag to specify that pointer event type EDrag has happened */ 
       
   269         EExtendedFlagPointerEventTypeEDrag                =0x00000040
       
   270     	};		
       
   271 
       
   272     //public constants
       
   273 
       
   274     enum
       
   275         {
       
   276         ESingleCharacter                            =1,
       
   277         EMaximumFepWordLength                       =63
       
   278         };
       
   279 
       
   280 private:
       
   281     /**
       
   282      * private constants
       
   283      */
       
   284     enum
       
   285         {
       
   286         EShiftKeyRepeatDelay                        =800000, // 0.8s
       
   287         EQueryBufferLength                          =63,
       
   288         EDefaultNumericCharMapResId                 =0,
       
   289         EDefaultSCTResourceId                       =-1,
       
   290         ENoCharacters                               =0,
       
   291         EAknFepUid                                  =0x100056de,
       
   292         EStarKeyUnicodeValue                        =0x2A,
       
   293         EHashKeyUnicodeValue                        =0x23,
       
   294         ELeftSoftkeyIndex                           =CAknFepUIInterface::ELeftSoftkeyIndex,
       
   295         ERightSoftkeyIndex                          =CAknFepUIInterface::ERightSoftkeyIndex,
       
   296         EMiddleSoftkeyIndex                         =CAknFepUIInterface::EMiddleSoftkeyIndex,
       
   297         EWordConcatenationTimeout                   =2000000, // 2.0s
       
   298         ELanguageArrayGranularity                   =20,
       
   299         EChrKeyRepeatDelay                          =1000000, // 1.0s
       
   300         EHalfQwertyChrKeyRepeatDelay                =600000   //0.6 secs from Default actions UI spec
       
   301         };
       
   302 
       
   303     enum TChineseFepCursorType
       
   304         {
       
   305         EActive,
       
   306         EPassive
       
   307         };
       
   308         
       
   309 public:            
       
   310 	enum
       
   311 		{
       
   312 		ECcpuStateNone       = 0,
       
   313 		ECcpuStateStartCopy  = 0x01,
       
   314 		ECcpuStateCopy       = 0x02,	
       
   315 		ECcpuStateStartCut   = 0x04,
       
   316 		ECcpuStateCut        = 0x08,
       
   317 		ECcpuStateButton     = 0x10,
       
   318 		ECcpuStatePosted               = 0x20,
       
   319 		ECcpuStateHashDown             = 0x40,
       
   320 		ECcpuStateSelectionEventPosted = 0x80,
       
   321 		ECcpuStateEdwinInSelectionMode = 0x100,
       
   322 		ECcpuStateIgnoreStarUp          = 0x200,
       
   323 		ECcpuSupressEditMenuFromShiftUp = 0x400,		
       
   324 		ECcpuStateCbaSymbol             = 0x800,
       
   325 		ECcpuStateIgnoreNextFocusChange = 0x1000,
       
   326 		ECcpuStataCommitPredictiveWord  = 0x2000,
       
   327 		ECcpuStateIgnoreNextEdwinSyncEvent = 0x4000,
       
   328 		ECcpuStateLosingFocus			   = 0x8000,	
       
   329 		ECcpuStateUncommitWhenFocused = 0x10000,				
       
   330         ECcpuStateHashKeyDeleteDone = 0x20000,
       
   331         ECcpuStateSupressCursorMoveToEnd = 0x40000,
       
   332         ECcpuStateChangeToPredictionMode = 0x80000,
       
   333 		ECcpuStateNewPredictiveWord = 0x100000,
       
   334 		ECcpuStateShiftkeyWasPressedBeforeLosingFocus = 0x200000,
       
   335 		ECcpuStateCbaShown = 0x400000
       
   336         };
       
   337 
       
   338 	enum TShowSctMode 
       
   339 	    {
       
   340 	    EShowSctFirst=0, 
       
   341 	    EShowPctFirst, 
       
   342 	    EShowSmileyFirst 
       
   343 	    };
       
   344 	
       
   345 private:
       
   346 	 // These are needed to remember editor's ccpu state 
       
   347 	 // for editing options submenu.
       
   348      enum
       
   349      	{
       
   350      	ECcpuStatusFlagCanCopy  = 0x01,
       
   351      	ECcpuStatusFlagCanCut   = 0x02,
       
   352      	ECcpuStatusFlagCanPaste = 0x04,     	
       
   353      	};
       
   354   
       
   355 
       
   356 private:
       
   357     class TLanguageCapabilities
       
   358         {
       
   359         public:
       
   360             TInt iInputLanguageCode;        // Symbian language code.
       
   361             TBool iLocalInputLanguageInUse;
       
   362             TBool iArabicIndicDigitsAllowed;
       
   363             TBool iEasternArabicIndicDigitsAllowed;
       
   364             TBool iIndicDigitsAllowed;	
       
   365             TDigitType iLocalDigitType;
       
   366             TDigitType iNumericEditorDigitType;
       
   367             TBool iSupportsCase;
       
   368             TBool iSupportsWesternPredictive;
       
   369 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   370             // Predictive QWERTY changes ---->
       
   371             TBool iSupportsWesternQwertyPredictive; // predicitve QWERTY
       
   372             // Predictive QWERTY changes <----
       
   373 #endif //RD_INTELLIGENT_TEXT_INPUT
       
   374             TBool iRightToLeftLanguage;
       
   375 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   376 #ifdef __HALF_QWERTY_KEYPAD            
       
   377             TBool iSupportsWesternHalfQwertyPredictive;
       
   378 #endif //__HALF_QWERTY_KEYPAD            
       
   379 #endif //RD_INTELLIGENT_TEXT_INPUT 
       
   380         };
       
   381 
       
   382 public:
       
   383     /**
       
   384      * C++ Constructor
       
   385      */
       
   386     CAknFepManager(CCoeEnv& aConeEnvironment);
       
   387 
       
   388     /**
       
   389      *  Second phase construction
       
   390      */
       
   391     void ConstructL(const CCoeFepParameters& aFepParameters);
       
   392 
       
   393     /**
       
   394      * destructor
       
   395      */
       
   396     virtual ~CAknFepManager();
       
   397 
       
   398 
       
   399 public: //from MAknFepManagerUIInterface
       
   400 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   401      /**
       
   402      Returns the keyboard layout
       
   403      */
       
   404      TPtiKeyboardType KeyboardLayout() const;
       
   405      /**
       
   406      Returns the current keyboard layout in use.
       
   407      */	 
       
   408      CAknFepFnKeyManager::TFnKeyState FnKeyState();
       
   409      void SetFnKeyState(CAknFepFnKeyManager::TFnKeyState aState);
       
   410     /**
       
   411      * Returns the resource ID of the numeric editor in use
       
   412      */
       
   413     
       
   414     TInt GetNumericSCTResID();
       
   415     
       
   416 
       
   417 #ifdef __REVERSE_FN_KEY_SUPPORTED
       
   418      /**
       
   419     Returns if the input is in reverse Fn key input mode.
       
   420     */
       
   421     virtual TBool IsReverseFnkeyInput();
       
   422     
       
   423     void SetReverseFnkeyInputMode(TBool iIsOn);
       
   424     
       
   425     /**
       
   426      * Returns true if the aChar is allowed in the numeric editor
       
   427      */
       
   428     TBool IsValidCharInNumericEditorL( TChar aChar ) const;
       
   429     
       
   430     /**
       
   431      * Filter the char for Fn reverse mode in case of
       
   432      * numeric editor. This function should call
       
   433      * in case of numeric editor reverse mapping.
       
   434      */
       
   435     TBool IsValidCharForNumericInFnReverseL(TInt aKey, TPtiTextCase aCase) ;
       
   436 
       
   437 #endif //__REVERSE_FN_KEY_SUPPORTED
       
   438     virtual void AddOneSpaceOrMoveCursorL();
       
   439 #endif
       
   440 	virtual TBool IsAllowedKeymappingForNumberMode(TChar aChar) const;
       
   441 	/**
       
   442      * closes the UI
       
   443      * commits any character in multitap
       
   444      */
       
   445     virtual TBool TryCloseUiL();
       
   446 
       
   447     /**
       
   448      * Used by the UI manager to inform the Fep Manager that the UI has activated.
       
   449      */
       
   450     virtual void SendUIActivatedNotification();
       
   451 
       
   452     /**
       
   453      * Used by the UI manager to inform the Fep Manger that the UI has not activated.
       
   454      */
       
   455     void SendUIDeActivatedNotification();
       
   456 
       
   457 
       
   458     /**
       
   459      * Plays sound
       
   460      */
       
   461     virtual void PlaySound(TAvkonSystemSID aSound) const;
       
   462     
       
   463     /**
       
   464      * Set current long clear key press
       
   465      */     
       
   466     virtual void SetLongClearAfterCloseUI(TBool aLongClear);
       
   467 
       
   468 	/**
       
   469 	 * Align the Logical and Visual cursor positions.
       
   470 	 *
       
   471      * @since 3.2
       
   472      * @param aType Cursor type.
       
   473      * @param aToLeft ETrue if the position to the left is to be found,
       
   474      *			 	  EFalse if the position to the right is to be found.
       
   475      * @return None
       
   476 	 */
       
   477 	void AlignLogicalAndVisualCursorL( TTmDocPosSpec::TType aType, TBool aToLeft );
       
   478 	
       
   479 	/**
       
   480 	 * This method removes the Repha character. The function goes to the 
       
   481 	 * start of the syllable, checks if repha character is present and 
       
   482 	 * removes it.
       
   483 	 *
       
   484 	 * @since 3.2
       
   485 	 * @param None.
       
   486 	 * @return None.
       
   487 	 */							
       
   488 	void RemoveRephaCharacterL();
       
   489 	
       
   490 	/**
       
   491 	 * Checks if the Repha character has been attached to the syllable
       
   492 	 *
       
   493 	 * @since 3.2
       
   494 	 * @param None.
       
   495 	 * @return ETrue if present else EFalse.
       
   496 	 */	
       
   497 	TBool IsRephaPresent();
       
   498 	
       
   499 	/**
       
   500 	 * Retrieve the Previous to previous character during multitapping.
       
   501 	 *
       
   502 	 * @since 3.2
       
   503 	 * @param aContextSensitive EFalse is the default parameter.
       
   504 	 *						    ETrue is used for requesting the function
       
   505 	 *						    to check for extraction of the character
       
   506 	 *						    two positions before the seleted text.
       
   507 	 *
       
   508 	 * @return The previous to previous character if any.
       
   509 	 */
       
   510 	TText PreviousToPreviousChar( TBool aContextSensitive = EFalse );
       
   511 
       
   512 	 /**
       
   513 	 * This method is called for removing the Rakar character. The function 
       
   514 	 * checks if Rakar (Virama+Ra)  is present.
       
   515 	 *
       
   516 	 * @since 3.2
       
   517 	 * @param None.
       
   518 	 * @return None.
       
   519 	 */
       
   520 	void RemoveRakarCharacterL();
       
   521 
       
   522     /**
       
   523 	 * This method is called for removing the N characters from the 
       
   524 	 * specified position. If the text to be removed is not yet
       
   525 	 * committed, it is updated with NULL descriptor and committed.
       
   526 	 *
       
   527 	 * @since 5.0
       
   528 	 * @param TInt aPos position to start searching from. By default
       
   529 	 *              Searching will start from the cursor position.
       
   530 	 * @param TInt aNumOfCharacters Number of characters to remove.
       
   531 	 * @param TBool Should cursor be positioned at the original location.
       
   532 	 * @return None.
       
   533 	 */
       
   534     void RemoveTextFromEditorL( TInt aNumOfCharacters, TInt aPos = 0, 
       
   535                                 TBool aIsToAlignCursor = ETrue );
       
   536     
       
   537    	/**
       
   538 	 * Align the Logical and Visual cursor positions.
       
   539 	 * Overloaded method which uses FindDocPos
       
   540 	 *
       
   541      * @since 5.0
       
   542      * @param None
       
   543      * @return None
       
   544 	 */
       
   545 	void AlignLogicalAndVisualCursorL();
       
   546 	
       
   547 	CAknFepPluginManager* PluginUIManager();
       
   548     //Phrase creation	
       
   549 	MZhuyinKeyHandler* ZhuyinKeyHandler();
       
   550 	CAknFepZhuyinAnalyser* ZhuyinAnalyser();
       
   551 	void UpdateStickyState();
       
   552 	
       
   553 #ifdef RD_MARATHI
       
   554 	/**
       
   555 	 * This function checks if the previous two characters are
       
   556 	 * the combination of Chandra-A
       
   557 	 *
       
   558 	 * @since 5.0
       
   559 	 * @param None
       
   560 	 * @return TBool.
       
   561 	 */
       
   562 	TBool IsChandraAPresentL();
       
   563 
       
   564 	/**
       
   565 	 * This function checks if the previous Chandra-A is present
       
   566 	 * before the cursor position
       
   567 	 *
       
   568 	 * @since 5.0
       
   569 	 * @param None
       
   570 	 * @return TBool.
       
   571 	 */
       
   572 	TBool IsEyeLashRaPresentL();
       
   573 #endif // RD_MARATHI
       
   574 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   575     /**
       
   576 	 * This function returns the current case.
       
   577 	 * Required for Shift key handling.
       
   578 	 *
       
   579 	 * @since 3.2
       
   580 	 * @param None
       
   581 	 * @return TBool.
       
   582 	 */
       
   583 	TInt GetCurrentCase();
       
   584 	
       
   585 	 /**
       
   586 	 * This function set the flag of chr composition key
       
   587 	 * in mini qwerty
       
   588 	 *
       
   589 	 * @since 3.2
       
   590 	 * @param aFlag ETrue if it is chr composition key.
       
   591 	 * @return None.
       
   592 	 */
       
   593 	void  SetComposChrFlag( TBool aFlag );
       
   594 	
       
   595 	/**
       
   596 	 * This function get the flag of chr composition key
       
   597 	 * in mini qwerty
       
   598 	 *
       
   599 	 * @since 3.2
       
   600 	 * @param None.
       
   601 	 * @return ETrue if it is chr composition key..
       
   602 	 */
       
   603 	TBool GetComposChrFlag();
       
   604 	/**
       
   605 	 * Hides the exact word popup.
       
   606 	 */
       
   607 	void HideExactWordPopUp();
       
   608 	/**
       
   609     * @return   ETrue   If the exact word pop up is shown.
       
   610     */
       
   611 	
       
   612 	TBool IsExactWordPopUpShown();		
       
   613 #endif
       
   614 #ifdef RD_HINDI_PHONETIC_INPUT
       
   615     //hindi_phonetic_fixes
       
   616    	/*
       
   617     * This functions toggles the case from upper to lower
       
   618     * @since 5.0
       
   619     * @param None
       
   620     * @return  void
       
   621     */
       
   622     virtual void HandleIndicCaseL();
       
   623 #endif
       
   624 
       
   625 public: //interface to the key catcher
       
   626     /**
       
   627      * Handles key events passed from the Key Catcher, excluding the shift key event
       
   628      * which is dealt with separately in the HandleShiftKeyEventL function.
       
   629      * State will always be Intital or UIActive.
       
   630      */
       
   631     TKeyResponse HandleKeyEventL(TUint aCode, TKeyPressLength aLength, TEventCode aEventCode = EEventKey);
       
   632 
       
   633     /**
       
   634      *  Shift keys are dealt with in a different way to other keys, the action is on the up
       
   635      *  key event.
       
   636      */
       
   637     TKeyResponse HandleShiftKeyEventL(TEventCode aEventCode);
       
   638 
       
   639     /**
       
   640      *  Thai 0 key is handled differently. If 0 key is up before long keypress, we show SCT.
       
   641      */
       
   642     TKeyResponse HandleThai0KeyEvent(TEventCode aEventCode, TKeyPressLength aLength, 
       
   643                                      TBool& aThai0KeyHandling);
       
   644 
       
   645     /**
       
   646      *  Chr key handling
       
   647      */
       
   648     TBool HandleQwertyChrKeyEventL( TEventCode aEventCode );
       
   649 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   650 #ifdef __HALF_QWERTY_KEYPAD
       
   651 	/**
       
   652 	*	Chr Key handling in half qwerty
       
   653 	*/
       
   654 	TKeyResponse HandleChrKeyForHalfQwertyL( TEventCode aEventCode);
       
   655 #endif //__HALF_QWERTY_KEYPAD
       
   656 #endif //RD_INTELLIGENT_TEXT_INPUT    
       
   657     /**
       
   658     *  Control key handling
       
   659     */
       
   660     TKeyResponse HandleQwertyControlKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aEventCode);
       
   661 
       
   662     /**
       
   663     * Handles key events for qwerty input mode.
       
   664     *
       
   665     * @since 3.0
       
   666     * @param aKeyEvent An event to be handled.
       
   667     * @param aResponse Repsonse (consumed / not consumed) will be stored here.
       
   668     * @return ETrue if evenat was handled by this method.
       
   669     *         EFalse otrherwise.
       
   670     */
       
   671     TBool HandleQwertyKeyEventL(const TKeyEvent& aKeyEvent, TKeyResponse& aResponse);
       
   672     
       
   673   	/**
       
   674     * Returns boolean value indicating whether it is ok to set edwin into "copy/paste"
       
   675     * mode.
       
   676     *    
       
   677     * @since 3.1
       
   678     * @return ETrue if it is ok to editor into selectuion mode.
       
   679     *         EFalse otherwise.
       
   680     */
       
   681 	TBool OkToActivateSelectionMode() const;    
       
   682 	
       
   683     /**                
       
   684     * Returns the status of arabic-indic digit mode setting.
       
   685     *
       
   686     * @since 3.0
       
   687     */
       
   688     TBool ArabicIndicDigitsInUse() const;    	
       
   689 	
       
   690 	/**                
       
   691     * Returns the status of Eastern arabic-indic digit mode setting.
       
   692     *
       
   693     * @since 3.0
       
   694     */
       
   695 	TBool EasternArabicIndicDigitsInUse() const;
       
   696 	void NumberModeChangeGSNotification();
       
   697 	void DimInputmodeMenuItems(CAknFepUiInterfaceMenuPane* aMenuPane);
       
   698 	 
       
   699 	 /**
       
   700      * Dims the item corresponding to the mode aMode, in the edit mode menu
       
   701      *
       
   702      * @param aMenuPane the edit menu pane
       
   703      * @param aMode the mode to be dimmed
       
   704      */
       
   705     void DimMenuItem(CAknFepUiInterfaceMenuPane* aMenuPane, TInt aMode);
       
   706     
       
   707     TInt FepShowVkbPreviewStatus();
       
   708 
       
   709     TInt PluginInputMode() const;
       
   710 private: // from CCoeFep
       
   711     /**
       
   712      * from CCoeFep - not used
       
   713      */
       
   714     virtual void CancelTransaction();
       
   715 
       
   716     /**
       
   717      * from CCoeFep - not used
       
   718      */
       
   719     virtual void IsOnHasChangedState();
       
   720 
       
   721     /**
       
   722      * from CCoeFep - not used
       
   723      */
       
   724     virtual void OfferKeyEventL(TEventResponse& aEventResponse, const TKeyEvent& aKeyEvent, 
       
   725                                 TEventCode aEventCode);
       
   726 
       
   727     /**
       
   728      * from CCoeFep - not used
       
   729      */
       
   730     virtual void OfferPointerEventL(TEventResponse& aEventResponse, 
       
   731                                     const TPointerEvent& aPointerEvent, 
       
   732                                     const CCoeControl* aWindowOwningControl);
       
   733 
       
   734     /**
       
   735      * from CCoeFep - not used
       
   736      */
       
   737     virtual void OfferPointerBufferReadyEventL(TEventResponse& aEventResponse, 
       
   738                                                const CCoeControl* aWindowOwningControl);
       
   739 
       
   740 private:    // from MFepAttributeStorer (via CCoeFep)
       
   741     /**
       
   742      * from MFepAttributeStorer (via CCoeFep) - not used
       
   743      */
       
   744     virtual TInt NumberOfAttributes() const;
       
   745 
       
   746     /**
       
   747      * from MFepAttributeStorer (via CCoeFep) - not used
       
   748      */
       
   749     virtual TUid AttributeAtIndex(TInt aIndex) const;
       
   750 
       
   751     /**
       
   752      * from MFepAttributeStorer (via CCoeFep) - not used
       
   753      */
       
   754     virtual void WriteAttributeDataToStreamL(TUid aAttributeUid, RWriteStream& aStream) const;
       
   755 
       
   756     /**
       
   757      * from MFepAttributeStorer (via CCoeFep) - not used
       
   758      */
       
   759     virtual void ReadAttributeDataFromStreamL(TUid aAttributeUid, RReadStream& aStream);
       
   760 
       
   761 private:    // from MCoeForegroundObserver (via CCoeFep)
       
   762     /**
       
   763      * from MCoeForegroundObserver (via CCoeFep) - not used
       
   764      */
       
   765     virtual void HandleGainingForeground();
       
   766 
       
   767     /**
       
   768      * from MCoeForegroundObserver (via CCoeFep) - not used
       
   769      */
       
   770     virtual void HandleLosingForeground();
       
   771 
       
   772 private:        // from MCoeFocusObserver (via CCoeFep)
       
   773 
       
   774     virtual void HandleChangeInFocus();
       
   775 
       
   776     /**
       
   777      * in queries the editor is destroyed before the call to HandleChangeInFocus
       
   778      * so NULL the iInputCapabilities variables to prevent trying to save to an unreferenced object
       
   779      */
       
   780     virtual void HandleDestructionOfFocusedItem();
       
   781 
       
   782 public: // from MAknEdStateObserver
       
   783     /**
       
   784      * from MAknEdStateObserver - not used
       
   785      */
       
   786     virtual void HandleAknEdwinStateEventL(CAknEdwinState* aAknEdwinState, 
       
   787                                            EAknEdwinStateEvent aEventType);
       
   788 
       
   789 private:    // from MEikCommandObserver (via MAknFepUiInterfaceMenuObserver)
       
   790     /**
       
   791      * from MEikCommandObserver
       
   792      * Processes user commands, in this case only commands from the edit menu
       
   793      */
       
   794     virtual void ProcessCommandL(TInt aCommandId);
       
   795 
       
   796     /**
       
   797      * Constructs the component fully. This method is called when a
       
   798      * fep aware editor is first time focused for text input.
       
   799      */
       
   800     void ConstructFullyL();
       
   801 
       
   802     /**
       
   803      * Deletes the objects constructed with ConstructFullyL() method.
       
   804      */
       
   805     void CommonDestroyFep();
       
   806 
       
   807 private:    // from MAknFepUiInterfaceMenuObserver
       
   808     /*
       
   809      * not used as DynInitMenuPaneL() is now called before SetEmphasis() and HandleChangeInFocus()
       
   810      */
       
   811     virtual void SetEmphasis(CBase* aMenuControl,TBool aEmphasis);
       
   812 
       
   813     /**
       
   814      * removes app menu panes and adds the FEP edit menu pane to the menu bar
       
   815      */
       
   816     virtual void DynInitMenuBarL(TInt aResourceId,CAknFepUiInterfaceMenuBar* aMenuBar);
       
   817 
       
   818     /**
       
   819      * dynamically changes the edit menu depending on fep and editor state
       
   820      */
       
   821     virtual void DynInitMenuPaneL(TInt aResourceId,CAknFepUiInterfaceMenuPane* aMenuPane);
       
   822 
       
   823 private:        //from MFepPointerEventHandlerDuringInlineEdit
       
   824     /**
       
   825      * from MFepPointerEventHandlerDuringInlineEdit - not needed, has to be implemented for MCoeFepAwareTextEditor interface
       
   826      * No pointer in Chinese Series 60
       
   827      */
       
   828     virtual void HandlePointerEventInInlineTextL(TPointerEvent::TType aType, TUint aModifiers, 
       
   829                                                  TInt aPositionInInlineText);
       
   830 
       
   831 private:        //from MFepInlineTextFormatRetriever
       
   832     /**
       
   833      * from MFepInlineTextFormatRetriever - not needed, has to be implemented for MCoeFepAwareTextEditor interface
       
   834      */
       
   835     virtual void GetFormatOfFepInlineText(TCharFormat& aFormat, 
       
   836                                           TInt& aNumberOfCharactersWithSameFormat, 
       
   837                                           TInt aPositionOfCharacter) const;
       
   838 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   839 
       
   840 // Predictive QWERTY changes (XT9) ---->
       
   841 public:         
       
   842 	//from MAknFepCandidatePopupCallback ---->
       
   843     /**
       
   844     * Callback the get the current set of candidates
       
   845     * @param    aArray      An output parameter for the candidate strings
       
   846     * @param    aActiveIdx  An output parameter for the index of the 
       
   847     *                       currently active candidate
       
   848     */
       
   849     virtual void GetCandidatesL( CDesCArray& aArray, TInt& aActiveIdx );
       
   850 	
       
   851 	/**
       
   852 	* Callback get new position for candidate list
       
   853 	* @param aRect  New rect position for candidate list.
       
   854 	*/
       
   855     virtual void GetUpdateCandidatePositionL(TRect& aRect);
       
   856     
       
   857 	//from MAknFepManagerUIInterfaceWestern ---->
       
   858     
       
   859     /**
       
   860      * Function to get the text direction for current language.
       
   861      * @return ETrue if language id RTL, EFalse if it is not
       
   862      */
       
   863     TBool IsRightToLeftLanguage();
       
   864     TBool IsLanguageSupportPrediction();
       
   865 // Predictive QWERTY changes (XT9) <----
       
   866 #endif //RD_INTELLIGENT_TEXT_INPUT
       
   867 
       
   868 public:
       
   869 
       
   870     /**
       
   871      * Launches the mode selection menu
       
   872      */
       
   873     void LaunchSelectModeMenuL();
       
   874     
       
   875     /**
       
   876      * Launches the edit word query in western predictive text mode
       
   877      */
       
   878     void LaunchEditWordQueryL();
       
   879     
       
   880 	/**
       
   881 	* Returns the status of given extended input capability flag.
       
   882 	*/
       
   883     TUint ExtendedInputCapabilities() const;	
       
   884 
       
   885 	/**
       
   886 	* Exit plugin itut spell mode by press ok btn
       
   887 	*/
       
   888     void ExitPluginSpellModeByOk();
       
   889 
       
   890 	/**
       
   891 	* Exit plugin itut spell mode by press cancel btn
       
   892 	*/
       
   893     void ExitPluginSpellModeByCancel();
       
   894     
       
   895     void SynCCPSoftKey();
       
   896     
       
   897      /**
       
   898      * checks that the editor the editor has free space to add another character
       
   899      * An editor of unlimited length will return its maximum size as zero
       
   900      */
       
   901     TBool EditorHasFreeSpace( TInt aNumberOfCharacter = 0 ) const;
       
   902 		TBool IsSpecialNumericEditor();
       
   903 
       
   904 private:
       
   905 
       
   906     /**
       
   907      * Handles notifications that the UI has changed focus
       
   908      * <ul>
       
   909      * <\li>When moving away from a fep aware text editor saves the mode of the old editor
       
   910      * <\li>When moving to fep aware text editor gets the the mode if it has previously been saved
       
   911      * and checks if the editor supports secret text
       
   912      * <\ul>
       
   913      */
       
   914     void HandleChangeInFocusL();
       
   915 
       
   916     /**
       
   917      * cleans up the fep after trapping a leave
       
   918      */
       
   919     void CleanUpFep();
       
   920 
       
   921     /**
       
   922      *
       
   923      * @param aKeyCode the value of the key to simulate
       
   924      */
       
   925     void SimulateKeyEventL(TUint aKeyCode, TBool aActiveObj=EFalse);
       
   926 
       
   927     /**
       
   928      * Tries to Reset the Shift Key Monitor
       
   929      * Cleans up FEP if failed
       
   930      *
       
   931      * @return KErrNone if succeed, KErrDied if failed
       
   932      */
       
   933     static TInt ResetShiftKeyMonitorCallback(TAny* aObj);
       
   934 
       
   935     /**
       
   936      * Cancels the shift monitor
       
   937      * tells the editor to up date its cba
       
   938      * to enable copy/paste support on cba. We simulate via CCoeEnv
       
   939      * to avoid fep SimulateL adding shift modifiers
       
   940      */
       
   941     void ResetShiftKeyMonitorL();
       
   942 
       
   943     /**
       
   944      * Cancels the shift key and concatenation timers if they are active
       
   945      */
       
   946     void CancelAllTimerActivity();
       
   947 
       
   948     /**
       
   949      * checks whether a mode is permitted by the current editor
       
   950      *
       
   951      * @return ETrue is aMode is permitted, EFalse if it is not
       
   952      */
       
   953     TBool IsModePermitted(TInt aMode, TWidthChar aWidth = ENoneWidthChar) const;
       
   954 
       
   955     /**
       
   956      *
       
   957      *
       
   958      * @return
       
   959      */
       
   960     TUint EditorMode(TInt aMode, TWidthChar aWidth) const;
       
   961 
       
   962     /**
       
   963      * Synchronises the states of the Fep Manager and the Key Catcher
       
   964      *
       
   965      * @return System wide error code.
       
   966      */
       
   967     TInt SyncStates(TAknFepManagerState aState);
       
   968 
       
   969     /**
       
   970      * Launches the matches popup list
       
   971      */
       
   972     void LaunchMatchesPopupListL();
       
   973 
       
   974 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   975     // Predictive QWERTY (XT9) changes ---->
       
   976     /**
       
   977      * Launches the compact match candidate list which follows the inline editor.
       
   978      * @param   aFocusedIndex   The index of the word focused by default. 
       
   979      *                          If KErrNotFound is given, the currently active
       
   980      *                          word will be focused.
       
   981      */
       
   982     void LaunchCandidatePopupListL( TInt aFocusedIndex = KErrNotFound );
       
   983     void StartInlineEditingWithSelectedWord(TDesC& aTextToUncommit);
       
   984     /**
       
   985      * Shows the exactly typed word above the inline editor if it differs from the 
       
   986      * best guess word shown inline.
       
   987      */
       
   988     void ShowExactWordPopupIfNecessaryL();
       
   989     
       
   990     /**
       
   991      * Launches the predictive setting dialog.
       
   992      */
       
   993     void LaunchPredictiveSettingDialogL();
       
   994 #ifdef FF_DUAL_LANGUAGE_SUPPORT
       
   995     void  LaunchWritingLanguageSettingDialogL();
       
   996     
       
   997     void  LaunchDualLanguageSettingDialogL();
       
   998 #endif //FF_DUAL_LANGUAGE_SUPPORT
       
   999     
       
  1000     // Predictive QWERTY (XT9) changes <----
       
  1001     
       
  1002     /**
       
  1003      * Handle shift loop in chinese variant for half qwerty
       
  1004      */
       
  1005     
       
  1006     void HandleShiftHalfQwertyChineseL(TEventCode aEventCode);
       
  1007     
       
  1008     /**
       
  1009      * Handle shift key loop in chinese variant for qwerty and mini qwerty
       
  1010      */
       
  1011     void HandleShiftQwertyChineseL(TEventCode aEventCode);
       
  1012 #endif //RD_INTELLIGENT_TEXT_INPUT    
       
  1013     /**
       
  1014      * Launches the insert word query in western predictive text mode
       
  1015      */
       
  1016     void LaunchInsertWordQueryL(const TDesC& aInitialText, TCursorSelection aTextSpanToReplace);
       
  1017 
       
  1018     /**
       
  1019      * Actual query dialog for LaunchInsertWordQueryL and LaunchEditWordQueryL
       
  1020      */
       
  1021     void LaunchFepQueryDialogL(TInt aResourceId, const TDesC& aInitialText, 
       
  1022                                TCursorSelection aTextSpanToReplace);
       
  1023 
       
  1024      /**
       
  1025      * Inserts a text directly into the editor which previously had focus
       
  1026      */
       
  1027     void InsertTextFromDialogL(const TDesC& aTextFromDialog, 
       
  1028                                TCursorSelection aExtentOfTextToReplace);
       
  1029 
       
  1030     /**
       
  1031      * Launch the KutenCodeQuery
       
  1032      */
       
  1033     void LaunchKutenCodeQueryL();
       
  1034 
       
  1035     /**
       
  1036      * Returns the resource ID for the numeric mode special character map
       
  1037      * available in the current editor.
       
  1038      */
       
  1039     TInt NumericModeSCTResourceId() const;
       
  1040 
       
  1041     /**
       
  1042     * Handles the hash key
       
  1043     * <ul>
       
  1044     * <\li>a short hash cycles through the modes
       
  1045     * <\li>a long key press moves to number mode unless the mode is already number, in which case
       
  1046     * it goes to default
       
  1047     * <\ul>
       
  1048     */
       
  1049     TKeyResponse HandleHashKeyL(TKeyPressLength aLength);
       
  1050 
       
  1051     /**
       
  1052     *
       
  1053     * @return Editor's numeric keymap for # and * keys of ITU-T mode.
       
  1054     */
       
  1055     TInt EditorNumericKeymap() const;
       
  1056 
       
  1057     /**
       
  1058      * dims the item on the edit menu corresponding to the current mode
       
  1059      * the user can press cancel to remain in the same mode
       
  1060      *
       
  1061      * @param aMenuPane the edit menu pane
       
  1062      */
       
  1063     void DimEditMenuModeItems(CAknFepUiInterfaceMenuPane* aMenuPane);
       
  1064 
       
  1065     /**
       
  1066      * Launch confirmation note.
       
  1067      *
       
  1068      * @param aResourceId Confirmation note resource Id.
       
  1069      */
       
  1070     void LaunchConfirmationNoteL(TInt aResourceId);
       
  1071 
       
  1072     /**
       
  1073      * Enters a new character into the editing window
       
  1074      * <p> Secret Text Editors do not use the MCoeFepAwareTextEditorInterface,
       
  1075      * they interact with the editor by simlulating key events. When in Multitap, simultating a
       
  1076      * numeric key event causes an extra key to be added to the control stack because the numeric
       
  1077      * keys exist on the Series 60 keypad; the flag EFlagPassNextKey is used to ignore this.
       
  1078      * <p> When secret editing in multitap, a backspace is simulated to replace the last
       
  1079      * character in the editor.
       
  1080      */
       
  1081     void NewCharacterL(const TDesC& aChar);
       
  1082     /**
       
  1083      * Enters a new phrase into the editing window
       
  1084      *
       
  1085      */
       
  1086     void NewTextL(const TDesC& aText);
       
  1087 
       
  1088     /**
       
  1089      * Commits given string in the editing window. This function checks that
       
  1090      * the editor has enough space to insert given string. If it not,
       
  1091      * given string is cut, then it is committed.
       
  1092      */
       
  1093     void CommitInlineEditL(const TDesC& aText, TInt aUncommitedTextChange);
       
  1094 
       
  1095     /**
       
  1096       * Cansel inline input.
       
  1097       */
       
  1098     void CancelInlineEdit();
       
  1099 
       
  1100     /**
       
  1101       * Used by editing window when it draws inline input characters.
       
  1102       */
       
  1103     void GetScreenCoordinatesL(TPoint& aLeftSideOfBaseLine, TInt& aHeight,
       
  1104                                TInt& aAscent, TInt aDocumentOffset);
       
  1105 
       
  1106     /**
       
  1107       * Used by Chinese UI to get cursor baseline position.
       
  1108       */
       
  1109     void GetScreenCoordinatesL(TPoint& aLeftSideOfBaseLine,TInt& aHeight,TInt& aAscent);
       
  1110 
       
  1111 
       
  1112 
       
  1113     /**
       
  1114      * checks that the editor the editor has free space to add another character
       
  1115      * An editor of unlimited length will return its maximum size as zero
       
  1116      */
       
  1117     TBool IsEditorHasFreeSpace()const;
       
  1118 
       
  1119     /**
       
  1120      * Returns the free space left in the Editor.
       
  1121      *
       
  1122      * @param aUnlimit.	Set to EFalse in case of Editors with limited text 
       
  1123 	 *				  	size
       
  1124 	 *		  isToCountUncommittedTextLength. Pass ETrue if the lenght of
       
  1125 	 *					Uncommitted text is to be counted.
       
  1126 	 *
       
  1127 	 * @return TInt. Free space left in the Editor.
       
  1128      */
       
  1129     TInt EditorFreeSpace(TBool& aUnlimit, 
       
  1130     				TBool isToCountUncommittedTextLength = EFalse ) const;
       
  1131 #ifdef RD_INTELLIGENT_TEXT_INPUT    
       
  1132     /**
       
  1133      * Returns the free space left in the Editor. ITI Specific Implementation
       
  1134      *
       
  1135      * @param aUnlimit.	Set to EFalse in case of Editors with limited text 
       
  1136 	 *				  	size
       
  1137 	 *		  isToCountUncommittedTextLength. Pass ETrue if the lenght of
       
  1138 	 *					Uncommitted text is to be counted.
       
  1139 	 *
       
  1140 	 * @return TInt. Free space left in the Editor.
       
  1141      */
       
  1142 	TInt EditorFreeSpaceForAutoWordCompletion(TBool& aUnlimit, 
       
  1143                                             TBool isToCountUncommittedTextLength = EFalse ) const;
       
  1144 #endif    																	
       
  1145   	
       
  1146 #ifdef __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__
       
  1147 #ifdef RD_INTELLIGENT_TEXT_INPUT    
       
  1148     /**
       
  1149     * Gives the amount of characters in the document.
       
  1150     * @return   The number of characters in the active editor.
       
  1151     */
       
  1152     TInt DocumentLength() const;
       
  1153     
       
  1154     /**
       
  1155     * Tells if the given key event will replace the latest character in editor
       
  1156     * because of multitapping or long press handling.
       
  1157     */
       
  1158     TBool KeyEventWillReplaceCharacter( const TKeyEvent& aKeyEvent );
       
  1159 
       
  1160 #endif
       
  1161 #endif    																	
       
  1162 
       
  1163     /**
       
  1164      * Uses TLocale to access the localized decimal separator in the kernel
       
  1165      */
       
  1166     TChar CurrentDecimalSeparator() const;
       
  1167 
       
  1168     /**
       
  1169      * Sets up the FEP state from the Editor State
       
  1170      * Called by HandleChangeInFocusL()
       
  1171      */
       
  1172     void ConfigureFEPFromEditorStateL();
       
  1173 
       
  1174     /**
       
  1175      * Sets up the FEP State(character width) from the Editor Mode
       
  1176      * @return FepMode
       
  1177      */
       
  1178     TInt ConfigureFepModeFromEditorMode(TInt aEditorMode);
       
  1179 
       
  1180     /**
       
  1181      * launch query which contains instructions on how to enter
       
  1182      * chinese text using the FEP
       
  1183      */
       
  1184     void LaunchHelpTextQueryL();
       
  1185 
       
  1186     /**
       
  1187      * ensure that the UI is aware of the current editor context
       
  1188      */
       
  1189     void UpdateEditorContext() const;
       
  1190 
       
  1191     /**
       
  1192      * query whether the text is valid in the current editor
       
  1193      */
       
  1194     TBool TextIsValidInEditor(const TDesC& aText);
       
  1195 
       
  1196 
       
  1197     /**
       
  1198      * Sets the style of the cursor to aType
       
  1199      */
       
  1200     void SetCursorType(TChineseFepCursorType aType);
       
  1201 
       
  1202    /**
       
  1203     * Returns the current editing state indicator
       
  1204     */
       
  1205     MAknEditingStateIndicator* EditingStateIndicator() const;
       
  1206 
       
  1207     /**
       
  1208     * Adds space at the end of the buffer if the feature is enabled.
       
  1209     */
       
  1210     TBool TryHandleArrowRightEventL(TInt aDocumentLength);
       
  1211 
       
  1212     /**
       
  1213     * Remove spaces from the end of the buffer if the cursor
       
  1214     * is in last position. Only in Japanese variant.
       
  1215     * Opposite functionality of TryHandleArrowRightEventL().
       
  1216     */
       
  1217     TBool TryHandleArrowLeftEventL(TInt aDocumentLength);
       
  1218 
       
  1219     /**
       
  1220     * Adds enter to the buffer if the cursor is at the end of the buffer and
       
  1221     * feature KAknFepEnterWithScrollDown is enabled.
       
  1222     *
       
  1223     * @since 2.6
       
  1224     * @param aDocumentLength Editor's document length
       
  1225     * @return Boolean if the down key event was handled.
       
  1226     */
       
  1227     TBool TryHandleArrowDownEventL(TInt aDocumentLength);
       
  1228 
       
  1229     inline void ResetFlags();
       
  1230 
       
  1231     /**
       
  1232      * Handle the Chr Key Monitor
       
  1233      * for Japanese variant only.
       
  1234      *
       
  1235      * @since 3.0
       
  1236      * @return KErrNone if succeed, KErrDied if failed
       
  1237      */
       
  1238     static TInt HandleChrKeyMonitorCallback(TAny* aObj);
       
  1239 
       
  1240 	/**
       
  1241 	 * Enters a new ligature into the editing window.
       
  1242 	 *
       
  1243      * @since 3.2
       
  1244      * @param aText Unicode value of the ligature.
       
  1245      * @return None
       
  1246 	 */
       
  1247 	void NewLigatureL( const TDesC& aText );
       
  1248    /**
       
  1249      * Sets the current state to aState based on the input mode 
       
  1250      * used to show the indicator
       
  1251      * @since 3.2
       
  1252      */
       
  1253     void SetPredictiveIndicatorState(TAknEditingState& aState);
       
  1254     static TInt HandleResourceChangedCallback(TAny* aObj);
       
  1255     
       
  1256     void ResourceChangedTimeroutL();
       
  1257     /**
       
  1258     * Exit plugin itut spell mode by press ok btn
       
  1259     */
       
  1260     void ExitPluginSpellModeByOkL();    
       
  1261 	
       
  1262 #ifdef RD_SCALABLE_UI_V2
       
  1263 	/**
       
  1264      * Unregisters Fep as observer
       
  1265      */
       
  1266     void UnregisterObserver();
       
  1267     
       
  1268     /**
       
  1269      * Unregisters Fep as observer
       
  1270      */
       
  1271     void RegisterObserver();
       
  1272     
       
  1273 #endif // RD_SCALABLE_UI_V2	    
       
  1274 private:
       
  1275     TUint EditorModeFromFepMode(TInt aFepMode);
       
  1276 
       
  1277     // returns sound system
       
  1278     CAknKeySoundSystem* SoundSystem() const;
       
  1279 
       
  1280     void SetHashKeyStyle();
       
  1281     void ReadHashKeyLoopL();
       
  1282 
       
  1283     TBool IsValidInLineCharacter(TChar aCharacter) const;
       
  1284     TBool HandleLoopingInNaviEventL(TWesternNaviEvent aNaviEvent);
       
  1285 
       
  1286     static TInt WordConcatenationTimerTimeoutCallback(TAny* aObj);
       
  1287     void WordConcatenationTimerTimeoutL();
       
  1288     
       
  1289 	void AddInputLanguageItemL(CAknFepUiInterfaceMenuPane* aMenuPane, TInt aIndex);    
       
  1290 	void SetQwertyModeToInputcapbility();
       
  1291 	void SetExtendedInputCapabilities( TUint aCapabilities);
       
  1292 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
  1293 
       
  1294     // Predictive QWERTY (XT9) changes ---->
       
  1295     /**
       
  1296     * Adds the "Input Options" option and its sub menu to the given menu.
       
  1297     * @param    aMenuPane   The menu where the option should be added.
       
  1298     * @param    aIndex      The location in the menu where the option should be added.
       
  1299     */
       
  1300    
       
  1301     void AddPredictiveModeOptionsL(CAknFepUiInterfaceMenuPane* aMenuPane, TInt aIndex) const;
       
  1302     
       
  1303     /**
       
  1304      * Adds the XT9 Edit menu options to the given menu.
       
  1305      * @param    aMenuPane   The menu where the option should be added.
       
  1306      * @param    aIndex      The location in the menu where the option should be added.
       
  1307      */
       
  1308     
       
  1309      void AddPredictiveModeEditMenuL(CAknFepUiInterfaceMenuPane* aMenuPane, TInt aIndex) const;
       
  1310     
       
  1311     // Predictive QWERTY (XT9) changes <----
       
  1312 #endif //RD_INTELLIGENT_TEXT_INPUT
       
  1313     /* Sets default number mode when arabic language is used.
       
  1314     * @param aMode either Latin or Arabic
       
  1315     * @param aNbrModeType number mode type from GSLangPlugin.hrh
       
  1316     */
       
  1317     void SetDefaultNumberMode( TInt aMode, TInt aNbrModeType );
       
  1318 
       
  1319     /**
       
  1320     * Loads an icon from avkon bitmap file.
       
  1321     * @param aIcons The array into which the icon will be added. Icons will be 
       
  1322     *        owned by this array.
       
  1323     * @param aBitmapId ID of the actual bitmap.
       
  1324     * @param aMaskId ID of the mask.
       
  1325     */
       
  1326     void LoadIconL( CArrayPtr<CGulIcon>* aIcons, TInt aBitmapId, TInt aMaskId );
       
  1327 
       
  1328     /**
       
  1329       * Add a menu item for User DB management. 
       
  1330       * phrase creation
       
  1331       * @since S60 5.0 S60_version
       
  1332       * @param aMenuPane The menu into which the mune item will be added. 
       
  1333       * @param aIndex Index of the menu item to insert.
       
  1334       * @return none
       
  1335       */
       
  1336      void AddUserDBDlgItemL( CAknFepUiInterfaceMenuPane* aMenuPane, TInt aIndex );
       
  1337 
       
  1338      /**
       
  1339        * Return wether ipnut mode is change by press shift+space. 
       
  1340        * This is for half-qwerty.
       
  1341        * @return ETure is change by press shift+space, otherwise EFalse.
       
  1342        */
       
  1343      TBool IsChangeModeByShiftAndSpace();
       
  1344      
       
  1345      /**
       
  1346        * Set wether ipnut mode is change by press shift+space. 
       
  1347        * This is for half-qwerty.
       
  1348        * @return none
       
  1349        */
       
  1350      void SetChangeModeByShiftAndSpace( TBool aFlag );
       
  1351 
       
  1352 public:
       
  1353     //Hash Key Manager Interface
       
  1354     TBool IsOnlyNumericPermitted() const;
       
  1355     void TryIncrementModeL(TInt aCurrentMode);
       
  1356     void TryIncrementModeChineseQwertyL(TInt aCurrentMode);
       
  1357     void TryIncrementChineseModeForQwertyL(TInt aCurrentMode);
       
  1358     void TryChangeToSharedDataModeL();
       
  1359     void TryChangeToModeBeforeL();
       
  1360     TBool TryChangeModeL(TInt aMode);
       
  1361     void ChangeInputLanguageL(TInt aInputLanguage);
       
  1362     void RemovePreviousCharacterL();
       
  1363     void  TryChangePredictiveInputModeL(TBool aFlag);
       
  1364     
       
  1365     /**
       
  1366      * To Handle Indic Hash key 
       
  1367      * 
       
  1368      *
       
  1369      * @since 3.2
       
  1370      * @return the language id of the Input Language as in Cenral Repository (General Settings)
       
  1371      */
       
  1372     TLanguage GetInputLanguageFromSharedDataInterface();
       
  1373 
       
  1374     
       
  1375     /**
       
  1376      * To Handle Hash key 
       
  1377      * 
       
  1378      *
       
  1379      * @since 3.2
       
  1380      * @return ETrue if the Last Key press was Hash key.
       
  1381      */
       
  1382     TBool WasLastKeyPressAHashKey();
       
  1383 
       
  1384     /**
       
  1385      * To Handle Hash key 
       
  1386      * To set or Reset the status maintained to know if last key pressed was Hash Key	 
       
  1387      *
       
  1388      * @since 3.2
       
  1389      * @return nothin
       
  1390      */
       
  1391 	void SetLastPressedHashKeyStatus(TBool aStatus);
       
  1392 
       
  1393     //Case Manager Interface
       
  1394     MCoeFepAwareTextEditor* FepAwareTextEditor() const;
       
  1395     
       
  1396     TBool IsFepAwareTextEditor() const;
       
  1397     
       
  1398     TCursorSelection UncommittedText() const;
       
  1399     void SetCase(TCase aCase);
       
  1400 
       
  1401     //made public for western
       
  1402 
       
  1403     /**
       
  1404      * Retreives the State of the current editor
       
  1405      *
       
  1406      * @return the current editors state object
       
  1407      */
       
  1408     CAknEdwinState* EditorState() const;
       
  1409 
       
  1410     /**
       
  1411      * update the edit indicators when moving into a new input mode
       
  1412      */
       
  1413     void UpdateIndicators();
       
  1414 
       
  1415     /**
       
  1416      * Checks if the editor is in a state where a Special Character Table can be launched
       
  1417      */
       
  1418     TBool IsAbleToLaunchSCT() const;
       
  1419     
       
  1420     /**
       
  1421      * Get current editor's SCT resource id
       
  1422      */
       
  1423     TInt GetCurrentEditorSCTResId() const;
       
  1424     
       
  1425     /**
       
  1426      * Launch the Special Character Table
       
  1427      */
       
  1428     void LaunchSpecialCharacterTableL(TInt aResourceId = EDefaultNumericCharMapResId,
       
  1429                                       TBool aLaunchedByTouchWin=EFalse, 
       
  1430                                       TBool aSmileyFirst=EFalse);
       
  1431 
       
  1432     /**
       
  1433      * Checks if the editor is in a state where a Pictograph Character Table can be launched
       
  1434      */
       
  1435     TBool IsAbleToLaunchPCT() const;
       
  1436     
       
  1437     /**
       
  1438      * Checks if the editor is in a state where a Pictograph Character Table can be launched
       
  1439      */
       
  1440     TBool IsAbleToLaunchSmiley() const;
       
  1441 
       
  1442     /**
       
  1443      * Launch the Pictograph Character Table
       
  1444      */
       
  1445     void LaunchPictographCharacterTableL();
       
  1446 
       
  1447     //MAknFepManagerUIInterfaceWestern
       
  1448     virtual void UpdateInlineEditL(const TDesC& aNewInlineText, 
       
  1449                                    TInt aPositionOfInsertionPointInInlineText);
       
  1450     virtual void StartInlineEditL();
       
  1451     virtual void StartInlineEditL(const TDesC& aText);
       
  1452     virtual void StartInlineEditL(TCursorSelection aCursorSelection, 
       
  1453                                   const TDesC& aInitialInlineText, 
       
  1454                                   TInt aPositionOfInsertionPointInInlineText, 
       
  1455                                   TBool aCursorVisibility);
       
  1456 
       
  1457     virtual TBool CloseUiIfWordDeletedL();
       
  1458     virtual TBool TryGetTextToUncommitL(TDes& aText, TInt aCode, TBool& aComsumeKey);
       
  1459 
       
  1460     /**
       
  1461      * Addition for ITI features on FSQ.
       
  1462      * To check which characters will be underlined.
       
  1463      */
       
  1464     TBool TryGetTextToUncommitL(TDes& aText, TBool& aComsumeKey);
       
  1465     
       
  1466     virtual void UpdateCbaL(TInt aResourceId);
       
  1467     virtual TBool TryRemoveNoMatchesIndicatorL();
       
  1468     virtual TBool IsMoreGoodWordsComing(TInt aNewWordLength) const;
       
  1469 #ifndef RD_INTELLIGENT_TEXT_INPUT
       
  1470     virtual TBool IsMoreGoodAutoCompleteWordsComing(TInt aInputMode, TInt aPreviousWordLengh, 
       
  1471                                                     TInt aNewWordLength) const;
       
  1472 #endif //RD_INTELLIGENT_TEXT_INPUT
       
  1473     virtual void TryStartCompoundWord();
       
  1474     virtual void AddCompoundWordToUdbL();
       
  1475 
       
  1476     //MAknFepManagerUIInterfaceWestern made public for western
       
  1477     inline TBool IsFlagSet(TInt aFlag) const;
       
  1478     inline void SetFlag(TInt aFlag);
       
  1479     inline void ClearFlag(TInt aFlag);
       
  1480     
       
  1481     inline TBool IsExtendedFlagSet(TInt aExtendedFlag) const;
       
  1482     inline void SetExtendedFlag(TInt aExtendedFlag);
       
  1483     inline void ClearExtendedFlag(TInt aExtendedFlag);
       
  1484     inline void ResetExtendedFlags();
       
  1485 
       
  1486     inline TCoeInputCapabilities& InputCapabilities();
       
  1487 
       
  1488     void SetWesternPredictive( const TBool aWesternPredictive );
       
  1489     void SetWesternAutoComplete( const TBool aWesternAutoComplete );
       
  1490     void SetJapanesePredictive(const TBool aJapanesePredictive);
       
  1491     void SetQwertyMode(const TBool aQwertyMode); // Empty implementation. Qwerty mode is not supported.
       
  1492 
       
  1493     TBool WesternPredictive(TInt aMode = 0) const;
       
  1494     TBool IsPredictive(TInt aMode = 0) const;
       
  1495     TBool Japanese() const;
       
  1496     TBool IsOnlyFullWidthCharacterPermitted() const;
       
  1497     TBool IsOnlyHalfWidthCharacterPermitted() const;
       
  1498     TBool IsHalfAndFullKatakanaPermitted() const;
       
  1499     TBool IsHalfAndFullLatinPermitted() const;
       
  1500     TBool IsHalfAndFullNumberPermitted() const;
       
  1501     virtual TWidthChar CharacterWidth() const;
       
  1502 
       
  1503     virtual CPtiEngine* PtiEngine() const;
       
  1504     virtual void SetInlineEditingCursorVisibilityL(TBool aCursorVisibility);
       
  1505 
       
  1506     TInt  InputMode() const;
       
  1507     TInt CangJieMode() const;
       
  1508 
       
  1509     TBool InputLanguageSupportsCaseChanges() const;
       
  1510 
       
  1511     /**
       
  1512      * Queries supportting of KAknFepScrollLatinPredictive feature
       
  1513      *
       
  1514      * @since 2.6
       
  1515      * @return ETrue if ScrollLatinPredictive was supported
       
  1516      */
       
  1517     TBool IsAbleScrollLatinPredictive() const;
       
  1518 
       
  1519     /**
       
  1520      * Previous case is returned.
       
  1521      *
       
  1522      * @since 2.6
       
  1523      * @return TInt  EAknEditorTextCase or EAknEditorUpperCase or EAknEditorLowerCase
       
  1524      *               If case cannot be saved, 0 value is returned.
       
  1525      */
       
  1526     inline TInt CaseBefore() const;
       
  1527 
       
  1528     /**
       
  1529     * @return true if current input language is one of Chinese input languages.
       
  1530     */
       
  1531     inline TBool IsChineseInputLanguage() const;
       
  1532     
       
  1533     /**
       
  1534     * @return true if current input language is arabic input languages.
       
  1535     */
       
  1536     inline TBool IsArabicInputLanguage() const;    
       
  1537     
       
  1538     /**
       
  1539     * @return true if current input language is Korean input language.
       
  1540     */
       
  1541     
       
  1542     inline TBool IsKoreanInputLanguage() const;
       
  1543 
       
  1544     /**
       
  1545      * Check Qwerty keypad
       
  1546      *
       
  1547      * @since 3.0
       
  1548      * @return ETrue is Qwerty
       
  1549      */
       
  1550     inline TBool IsQwerty() const;
       
  1551     
       
  1552     
       
  1553     /**
       
  1554     * Returns boolean value indicating whether hash key is in selection mode or
       
  1555     * in traditional mode.
       
  1556     *  
       
  1557     * @since 3.1
       
  1558     * @return  ETrue if hash key is in text selection mode.
       
  1559     *          EFalse otherwise.
       
  1560     */
       
  1561     TBool HashKeySelectionInUse() const;
       
  1562 
       
  1563     /**
       
  1564     * Returns the UI interface implementation used in the current app.
       
  1565     *
       
  1566     * @since 3.2
       
  1567     * @return  The UI interface object used in the current app.
       
  1568     */
       
  1569     CAknFepUIInterface* UiInterface();
       
  1570   
       
  1571     /**
       
  1572     * Returns boolean value indicating whether edit submenu functionality is in use.    
       
  1573     *  
       
  1574     * @since 3.1
       
  1575     * @return  ETrue if edit submenu functionality is in use.
       
  1576     *          EFalse otherwise.
       
  1577     */        
       
  1578     TBool EditSubmenuInUse() const; 
       
  1579     
       
  1580     /**
       
  1581      * Set MultiTap Timer
       
  1582      *
       
  1583      * @since 3.0
       
  1584      * @param aMultiTapTimer value of KAknFepMultiTapTimer setting
       
  1585      */
       
  1586     void SetMultiTapTimer(const TInt aMultiTapTimer);
       
  1587 
       
  1588     /**
       
  1589      * Set Japanese Qwerty Flags
       
  1590      *
       
  1591      * @since 3.0
       
  1592      * @param aJapaneseQwertyFlags value of KAknFepJapaneseSpecialCharFlag setting
       
  1593      */
       
  1594     void SetJapaneseQwertyFlags(const TInt aJapaneseQwertyFlags);
       
  1595 
       
  1596 	/**
       
  1597 	* Calling this method will raise a flag which will cause predictive 
       
  1598 	* word to be commited during next call to TryCloseUiL-method. This
       
  1599 	* is needed because of Japanese ReadingTextL. 
       
  1600 	*
       
  1601 	* @since 3.1
       
  1602 	*/	
       
  1603 	void SetDelayedCommit();
       
  1604 
       
  1605     /**
       
  1606      * from MAknFepManagerUIInterface
       
  1607      * query whether the special char is valid in the current editor
       
  1608      *
       
  1609      * @param aChar Checking a chracter
       
  1610      */
       
  1611     TBool CharIsValidInEditor(TChar aChar);
       
  1612 
       
  1613    /**
       
  1614      * from MAknFepManagerUIInterface
       
  1615     * Returns the status of predictive input.
       
  1616     *
       
  1617     * @since 3.2
       
  1618     * @return ETrue is available predictive input.
       
  1619     */
       
  1620     TBool IsAbleToChangePrediction() const;
       
  1621     
       
  1622     /**
       
  1623      * Commits uncommitted text in the editing window. For secret text editors,
       
  1624      * only inline editing flags are changed
       
  1625      */
       
  1626     void CommitInlineEditL();    
       
  1627     
       
  1628     TBool GetIndicatorImgID(TInt& aIndicatorImgID, TInt& aIndicatorTextID);   
       
  1629 
       
  1630     inline TFepSymbolOfHardwareOne SymbolInfoOfHardKey1();
       
  1631 public:
       
  1632 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
  1633     /*
       
  1634     Sets the keyboard layout.
       
  1635     **/
       
  1636     void SetKeyboardLayout(TPtiKeyboardType aType);
       
  1637 #endif
       
  1638     virtual TText PreviousChar( TBool aContextSensitive = EFalse );
       
  1639     virtual TText NextChar();
       
  1640     virtual TBool IsZWSCharacterPresent( TBool aLigaturePresent = EFalse );
       
  1641     void RemoveZWSCharacterL( TBool aIsViramaInputted, 
       
  1642                               TBool aIsInMultitappingHalant = EFalse, 
       
  1643                               TBool aIsCharModifier = EFalse, 
       
  1644                               TBool aIsLigaturePresent = EFalse );
       
  1645     void NewCharacterSequenceL(const TDesC& aText, TIndicInputResponse aResponse);
       
  1646     TBool IsValidInlineIndicCharacter(TChar aCharacter) const;
       
  1647 #ifdef RD_HINDI_PHONETIC_INPUT	
       
  1648     TBool IsIndicPhoneticInputLanguage() const;
       
  1649     TInt SetPhoneticIndicator(TLanguage aInputLanguage);
       
  1650     void TryChangePhoneticModeL();
       
  1651 #endif
       
  1652     TDigitType LocalDigit();
       
  1653 public:
       
  1654      /**
       
  1655      * Auto word Completion is Enabled
       
  1656      *
       
  1657      * @since 3.2
       
  1658      */    
       
  1659     void SetAutoCompletionState(TInt aValue);
       
  1660 #ifndef RD_INTELLIGENT_TEXT_INPUT
       
  1661     void RemoveSuggestedCompletionL();
       
  1662 #endif	//RD_PRED_AW_COMPLETION
       
  1663 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
  1664     TBool IsFnKeyMappedL(TPtiKeyboardType aKeyboardType = EPtiKeyboardNone);
       
  1665     TBool IsFnKeyMapped();
       
  1666     void SetFnKeyMappingState();
       
  1667     TBool KeyMapsDifferentCharacterWithFn( TPtiKey aKey ) const;
       
  1668      
       
  1669      /**
       
  1670 	 * Setter for the advanced predictive typing correction.
       
  1671 	 * @param    aLevel   The level to be set.
       
  1672 	 */
       
  1673 	 void SetTypingCorrectionLevel(TInt aLevel);
       
  1674 	
       
  1675 	 /**
       
  1676 	 * Resetter for the advanced predictive Number Candidate setting.
       
  1677 	 * @param    aValue   The value to be set.
       
  1678 	 */
       
  1679 	 void SetNumberCandidateState(TInt aValue);
       
  1680 	 
       
  1681 	 /**
       
  1682 	* Setes the primary candidate from GS to the local state
       
  1683 	*/
       
  1684 	 void SetPrimaryCandidate(TInt aValue);
       
  1685 #endif
       
  1686        
       
  1687     void SetStopProcessFocus(TBool aStop, TBool aClose = ETrue);
       
  1688 
       
  1689     TBool StopProcessFocus();
       
  1690     
       
  1691     TBool CloseUiOnFocusChange();
       
  1692     
       
  1693 
       
  1694 public:
       
  1695     void HandleOwnedSimulateKeyL();
       
  1696     
       
  1697     TBool HandleCcpuModeKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aEventCode,
       
  1698                                  TKeyResponse& aRetCode, TBool aLongPressFlag = EFalse);
       
  1699     
       
  1700 	/**
       
  1701  	*  Sets aFlag bitfield in iCcpuFlags
       
  1702  	*/
       
  1703 	inline void SetCcpuFlag(TInt aFlag);
       
  1704 
       
  1705 	/**
       
  1706  	* Clears aFlag bitfield in iCcpuFlags
       
  1707  	*/
       
  1708 	inline void ClearCcpuFlag(TInt aFlag);
       
  1709 
       
  1710 	/**
       
  1711  	* Clears all flags in iCcpuFlags
       
  1712  	*/
       
  1713 	inline void ResetCcpuFlags();
       
  1714 
       
  1715 	/**
       
  1716  	* Returns ETrue if the aFlag bitfield in iCcpuFlags is set, EFalse if it
       
  1717  	* is clear
       
  1718  	*/
       
  1719 	inline TBool IsCcpuFlagSet(TInt aFlag) const;    
       
  1720         /**
       
  1721      * Check if Auto word Completion is Enabled
       
  1722      *
       
  1723      * @since 3.2
       
  1724      * @return ETrue if Auto word Completion is enabled
       
  1725      */
       
  1726     inline TBool IsAutoCompleteOn() const;
       
  1727 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
  1728 
       
  1729     
       
  1730     
       
  1731     /**
       
  1732     * @return	TInt 	Typing correction level.
       
  1733     */
       
  1734     inline TInt AdvancedPredictiveTypingCorrectionLevel() const;
       
  1735     
       
  1736     /**
       
  1737     * @return   ETrue   If the number candidate shown. EFalse otherwise.
       
  1738     */
       
  1739     inline TBool IsAdvancedPredictiveNumberCandidateShown() const;
       
  1740     
       
  1741     /**
       
  1742     * Cuts off the automatically completed tail of the suggested word candidate.
       
  1743     */
       
  1744     virtual void RemoveSuggestedAdvanceCompletionL();
       
  1745     
       
  1746     /**
       
  1747     * @return   ETrue   If the number candidate shown. EFalse otherwise.
       
  1748     */
       
  1749     inline TBool AdvancedPredictivePrimaryCandidate() const;
       
  1750     TBool LongPressNumberEntryOnQwerty() const;
       
  1751     
       
  1752     // Predictive QWERTY (XT9) changs <----
       
  1753 #endif //RD_INTELLIGENT_TEXT_INPUT
       
  1754     /**
       
  1755     * Returns ETrue if Feature manager supports Japanese.
       
  1756     */
       
  1757     inline TBool IsFeatureSupportedJapanese() const;
       
  1758     
       
  1759  	/**
       
  1760     * Cancels shift key timer.
       
  1761     */        
       
  1762 	void CancelShiftKeyTimer();
       
  1763     
       
  1764     /**
       
  1765      * Queries supportting of SecretText
       
  1766      *
       
  1767      * @since 2.6
       
  1768      * @return ETrue if SecretText was supported
       
  1769      */
       
  1770     TBool IsSupportsSecretText() const;
       
  1771     
       
  1772     void SendEventsToPluginManL( TInt aEventType, TInt aEventData = 0 );
       
  1773 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
  1774     /**
       
  1775     Sends the key event received to the Fn key handler and sets the Fn key state.
       
  1776     */
       
  1777     TKeyResponse HandleFnKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aEventCode );
       
  1778 #endif
       
  1779     
       
  1780     MAknFepManagerInterface* FepUI() const;
       
  1781   
       
  1782     TTmDocPosSpec DocPos();
       
  1783     
       
  1784     void HandleCopyCutEventL(TInt aCommandId);
       
  1785     
       
  1786     void LaunchPenSupportMenuL(); 
       
  1787 
       
  1788 private: //navigation
       
  1789     void FindStartOfWord(TInt& aAnchorPos) const;
       
  1790     void FindEndOfWord(TInt& aCursorPos) const;
       
  1791     TBool CursorInsideWord();
       
  1792     void MoveCursorToStartOfWordL();
       
  1793     void MoveCursorToEndOfWordL();
       
  1794     TKeyResponse HandleNaviEventOutsideInlineEditL(TUint aCode, TKeyPressLength aLength);
       
  1795     TKeyResponse HandleWesternPredictiveArrowKeyL(TInt aCode, TKeyPressLength aLength);
       
  1796     TBool TryHandleTextSelectedNaviEventL(TInt aCode, TKeyResponse& aResponse);
       
  1797     TBool TryHandleCommonArrowAndBackspaceFunctionalityL(TInt aCode, TKeyResponse& aResponse);
       
  1798     void TransferFepStateToEditorL(TBool aFnLockSync=ETrue);
       
  1799     inline MAknFepManagerInterface* InternalFepUI();
       
  1800 
       
  1801 
       
  1802     void LaunchLanguagesPopupListL(TBool aLaunchedByTouchWin = EFalse);
       
  1803     void LaunchRecognitionWithDictionaryPopupListL();
       
  1804     TBool IsInputModeAvailable(TInt aMode) const;
       
  1805     TInt NewInputModeAfterLanguageChange() const;
       
  1806 
       
  1807     /**
       
  1808       * Launch User DB dialog
       
  1809       * phrase creation
       
  1810       * @since S60 5.0 S60_version
       
  1811       * @param none
       
  1812       * @return none
       
  1813       */
       
  1814      void LaunchUserDBDlgL();
       
  1815 
       
  1816     /**
       
  1817     * Set current input language and the capabilities of the language to
       
  1818     * the iLanguageCapabilities member variable.
       
  1819     *
       
  1820     * @param aInputLanguage New (current) input language.
       
  1821     */
       
  1822     void SetInputLanguageCapabilities(const TInt aInputLanguage);
       
  1823 
       
  1824     /**
       
  1825     * Returns input language code that corresponds to UI language.
       
  1826     *
       
  1827     * @param aUiLanguage Ui language code.
       
  1828     * @return Input language code that corresponds to the UI language code.
       
  1829     */
       
  1830     TInt SubstituteSublanguageId(const TInt aUiLanguage) const;
       
  1831 
       
  1832     CTextView* TextView() const;
       
  1833     CTextLayout* TextLayout() const;
       
  1834     CPlainText* PlainText() const;
       
  1835 
       
  1836     void DoWesternMenu(CAknFepUiInterfaceMenuPane* aMenuPane);
       
  1837     void DoChineseMenu(CAknFepUiInterfaceMenuPane* aMenuPane);
       
  1838     void DoJapaneseMenu(CAknFepUiInterfaceMenuPane* aMenuPane);
       
  1839     void DoChineseSubMenu(CAknFepUiInterfaceMenuPane* aMenuPane);
       
  1840 
       
  1841     TBool IsRightToLeftParagraph(TTmDocPosSpec aPos) const;
       
  1842     void FindAdjacentChunks(const TTmDocPosSpec& aPos,
       
  1843                             CTmTextLayout::TTmChunkDescription& aLeft, 
       
  1844                             CTmTextLayout::TTmChunkDescription& aRight) const;
       
  1845 
       
  1846     TBool GetNextVisualRightCharacter( TInt& aPosition );
       
  1847     TBool GetNextVisualLeftCharacter( TInt& aPosition );
       
  1848     void FindVisualRightOfWord(TInt& aPosition);
       
  1849     void FindVisualLeftOfWord(TInt& aPosition);
       
  1850 
       
  1851     //
       
  1852     // Remaining methods here are candidates for turning into TextViewUtility methods. Some
       
  1853     // have been made static already in anticipation of this.
       
  1854     //
       
  1855     /**
       
  1856     * Obtains the visual beginning of the document. This may be the left or right the right
       
  1857     * end of the first line, depending on first paragraph's direction. If the beginning of the document
       
  1858     * is currently not formatted, then EFalse is returned
       
  1859     *
       
  1860     * @param    aEndPos     DocPosSpec is returned for the visual beginning of the document.
       
  1861     * @return   ETrue if the value is successfully calculated, that is the first line is formatted
       
  1862     */
       
  1863     TBool GetVisualDocStart( TTmDocPosSpec& aStartPos ) const;
       
  1864 
       
  1865     /**
       
  1866     * Obtains the visual end of the document. This may be the left or right the right
       
  1867     * end of the last line, depending on last paragraphs direction. If the end of the document
       
  1868     * is currently not formatted, then EFalse is returned
       
  1869     *
       
  1870     * @param    aEndPos     DocPosSpec is returned for the visual end of the document.
       
  1871     * @return   ETrue if the value is successfully calculated, that is the last line is formatted
       
  1872     */
       
  1873     TBool GetVisualDocEnd( TTmDocPosSpec& aEndPos ) const;
       
  1874 
       
  1875     /**
       
  1876     * Get the document position of the visual extrem of the line in which the passed position
       
  1877     * is in.
       
  1878     *
       
  1879     * @param aPos       A position within the line you are interested in
       
  1880     * @param aToRight   ETrue if you want the right hand end.
       
  1881     * @param aExtreme   Output value of the doc pos spec for the end of the line
       
  1882     * @return           ETrue if the line was formatted. If False, the value of eExtreme
       
  1883     * cannot be trusted.
       
  1884     */
       
  1885     TBool GetAknFepLineExtreme( const TTmDocPosSpec& aPos, TBool aToRight,
       
  1886         TTmDocPosSpec& aExtreme) const;
       
  1887 
       
  1888     /**
       
  1889     * This is a very general routine for finding the visual extreme (according to
       
  1890     * Avkon rules) of a piece of selected text.
       
  1891     * - Text may in general have many varying directional sections.
       
  1892     * - It may extend from one paragraph to another.
       
  1893     * - If the paragraph directions are different the current input language is
       
  1894     *
       
  1895     * @param aSelection     Logical range for which the visual extreme is required
       
  1896     * @param aEvent         The direction being navigated (Right/Left/Up/Down); eg. ELeftNaviEvent if moving to the left end
       
  1897     * @param aLimitPos      returned position in document
       
  1898     * @param aEffectiveRightOrLeftEvent  Pointer to TWesternNaviEvent, if passed from the client, will
       
  1899     *                       return either ERightNaviEvent or ELeftNaviEvent
       
  1900     */
       
  1901     void GetAvkonDefinedVisualLimitsOfSelection(
       
  1902         const TCursorSelection& aSelection,
       
  1903         TWesternNaviEvent aEvent,
       
  1904         TTmDocPosSpec& aLimitPos,
       
  1905         TWesternNaviEvent* aEffectiveRightOrLeftEvent) const;
       
  1906 
       
  1907     /**
       
  1908     * Returns the position at the visual left extreme end for a logical range
       
  1909     *
       
  1910     * @param    aStartPos   Starting position for the search
       
  1911     * @param    aMinPos     minimum logical position of the logical range
       
  1912     * @param    aMaxPos     maximum logical position of the logical range
       
  1913     * @return   TTmDocPosSpec for the visual left end
       
  1914     */
       
  1915     TTmDocPosSpec LeftVisualExtremePos( const TTmDocPosSpec& aStartPos, 
       
  1916                                         TInt aMinPos, TInt aMaxPos ) const;
       
  1917 
       
  1918     /**
       
  1919     * Returns the position at the visual right extreme end for a logical range. The range may consist
       
  1920     * of many directional chunks.  They are iterated through until the visual end is found.
       
  1921     *
       
  1922     * @param    aStartPos   Starting position for the search
       
  1923     * @param    aMinPos     minimum logical position of the logical range
       
  1924     * @param    aMaxPos     maximum logical position of the logical range
       
  1925     * @return   TTmDocPosSpec for the visual right end
       
  1926     */
       
  1927     TTmDocPosSpec RightVisualExtremePos( const TTmDocPosSpec& aStartPos, 
       
  1928                                          TInt aMinPos, TInt aMaxPos ) const;
       
  1929 
       
  1930     /**
       
  1931     * Gets the visual left-most position in a chunk within a logical range
       
  1932     */
       
  1933     TBool LeftEndOfChunkWithinRange( const CTmTextLayout::TTmChunkDescription& aChunk, 
       
  1934                                      TInt aMinPos, TInt aMaxPos, TTmDocPosSpec& aNewPos) const;
       
  1935 
       
  1936     /**
       
  1937     * Gets the visual right-most position in a chunk within a logical range
       
  1938     */
       
  1939     TBool RightEndOfChunkWithinRange( const CTmTextLayout::TTmChunkDescription& aChunk, 
       
  1940                                       TInt aMinPos, TInt aMaxPos, TTmDocPosSpec& aNewPos) const;
       
  1941 
       
  1942     /**
       
  1943     * Adjust the passed docpos to reflect the avkon principal that after a left navigation
       
  1944     * the cursor should adhere to the bordering directional run on the left of that point.
       
  1945     * This may mean that the logical position and leading/trailing feature of aPos are adjusted
       
  1946     * This method does not perform the navigation, but may be called after a navigation.
       
  1947     */
       
  1948     void AdjustPosSpecForAmbiguityAfterLeftOrRightNavigation( TTmDocPosSpec& aPos, 
       
  1949                                                               TWesternNaviEvent aEvent ) const;
       
  1950 
       
  1951     /**
       
  1952     * Do not move the visual position, but ensure that the docpos passed is adhering to the left
       
  1953     * side of the right chunk passed in.
       
  1954     */
       
  1955     static void AttachToRightChunk( TTmDocPosSpec& aPos, 
       
  1956                                     const CTmTextLayout::TTmChunkDescription& aRightChunk );
       
  1957 
       
  1958     /**
       
  1959     * Do not move the visual position, but ensure that the docpos passed is adhering to the
       
  1960     * right side of the left chunk passed in.
       
  1961     */
       
  1962     static void AttachToLeftChunk( TTmDocPosSpec& aPos, 
       
  1963                                    const CTmTextLayout::TTmChunkDescription& aRightChunk );
       
  1964 
       
  1965     /**
       
  1966     * Modify the cursor position after a jump to the start or end of a document.
       
  1967     * The current input direction is used to modify the position, so as to avoid attaching the
       
  1968     * new cursor position to a block of the opposite input directionality
       
  1969     *
       
  1970     * @param aPos   target position of the jump; may be modified by the routine.
       
  1971     * @param aEvent navigation event that caused the loop.
       
  1972     * @param aLoopToTop ETrue if the looping is from bottom to top; EFalse if from top to bottom
       
  1973     *
       
  1974     */
       
  1975     void AdjustPosSpecForInputLanguageAfterDocumentLoop( TTmDocPosSpec& aPos, 
       
  1976                                                          TWesternNaviEvent aEvent, 
       
  1977                                                          TBool aLoopToTop ) const;
       
  1978 
       
  1979     /**
       
  1980     * Tests a chunk for validity.
       
  1981     *
       
  1982     * @return ETrue if the chunk is valid - is a real chunk.
       
  1983     */
       
  1984     static TBool ChunkIsValid( const CTmTextLayout::TTmChunkDescription& aChunk );
       
  1985 
       
  1986     /**
       
  1987     * Finds the current input direction. This is determined as best as it can using
       
  1988     * - iT9Interface as the preferred source of information
       
  1989     * if that is not active/defined then
       
  1990     * - shared data (via AknTextUtils) if that fails
       
  1991     * - localLanguage overrides may be in place
       
  1992     *
       
  1993     * - when fep is in numeric mode it returns LTR
       
  1994     * - if FEP is in an irelevant mode, then LTR is returned
       
  1995     *
       
  1996     * Note that secret alpha modes return LTR always, as entry is alwas LTR for these
       
  1997     *
       
  1998     * @return TDirectionality::ERightToLeft when in an alpha mode and direction is RTL;
       
  1999     *                           Otherwise returns ELeftToRight
       
  2000     */
       
  2001     TBidiText::TDirectionality CurrentInputDirectionality() const;
       
  2002 
       
  2003     /**
       
  2004     * Access the local language if defined
       
  2005     *
       
  2006     * @param aLanguage - returns the Symbian OS language code for the local language
       
  2007     * @return EFalse iff no local language is in force
       
  2008     */
       
  2009     TBool GetLocalLanguage( TLanguage& aLanguage ) const;
       
  2010 
       
  2011     /**
       
  2012     * Looks through the FEP aware editor's text starting at character aPos, looking for a
       
  2013     * strongly directional character.  Direction of search can be set.
       
  2014     * Search is carried out until a strong character is found or the end (or beginning)
       
  2015     * of the editor text has been reached.
       
  2016     * The value returned in aIsRightToLeft should not be used unless the method returns ETrue
       
  2017     * @param aPos       First character to look at
       
  2018     * @param aForward   If EFalse, then search is backward (decreasing index) in logical buffer
       
  2019     * @param aIsRightToLeft     Set to ETrue on return if first strong character found is RTL
       
  2020     *
       
  2021     * @return           EFalse if no strong character was found.
       
  2022     */
       
  2023     TBool GetExposedDirectionOfText( TInt aPos, TBool aForward, TBool& aIsRightToLeft ) const;
       
  2024 
       
  2025     /**
       
  2026     * Looks through the passed descriptor, looking for a strongly directional character.
       
  2027     * Direction of search can be set. Search starts at the begining if searching forward;
       
  2028     * starts at the end if searching backwards.
       
  2029     *
       
  2030     * Search is carried out until a strong character is found or the end (or beginning)
       
  2031     * of the descriptor has been reached.
       
  2032     * The value returned in aIsRightToLeft should not be used unless the method returns ETrue
       
  2033     *
       
  2034     * @param aText      Descriptor to search.
       
  2035     * @param aForward   If EFalse, then search is backward (decreasing index) in logical buffer
       
  2036     * @param aIsRightToLeft     Set to ETrue on return if first strong character found is RTL
       
  2037     *
       
  2038     * @return           EFalse if no strong character was found.
       
  2039     */
       
  2040     TBool GetExposedDirectionOfTextInDescriptor( const TDesC& aText, TBool aForward, 
       
  2041                                                  TBool& aIsRightToLeft ) const;
       
  2042 
       
  2043     /**
       
  2044     * Access character in editor text at index aPos.
       
  2045     *
       
  2046     * @param    aPos    Index of character to access. Must be a valid index or panic may ensue.
       
  2047     * @return           charater at index aPos; returns TChar(0) if cannot get at the text.
       
  2048     */
       
  2049     TChar CharAt( TInt aPos ) const;
       
  2050 
       
  2051     /**
       
  2052     * Navigate off of selected text using an Up/Down/Right/Left navigation event
       
  2053     *
       
  2054     * The code takes account of the paragraph directionality that the passed selection is
       
  2055     * found in.
       
  2056     *
       
  2057     * The new cursor position is resolved for ambiguity and then set using SetCursorPosition, and
       
  2058     * so it has the same side-effects:
       
  2059     *   iUncommittedText is set to the zero-width "cursor" state with the new cursor position
       
  2060     *   iUncommittedText is set into the FepAwareTextEditor state
       
  2061     *   iCaseManager is updated with a ENullNaviEvent
       
  2062     *   the doc pos is set in TextView object if present
       
  2063     *
       
  2064     * @param    aSelection  currently selected text
       
  2065     * @param    aNaviEvent  navigation event. One of ERight/Left/Down/UpNaviEvent. Others are ignored
       
  2066     * @param    aPos        Ouput, new position of the cursor
       
  2067     * @return   EKeyWasNotConsumed if the key is not consumed
       
  2068     */
       
  2069     TKeyResponse NavigateFromSelectionL(
       
  2070         const TCursorSelection& aSelection,
       
  2071         TWesternNaviEvent aNaviEvent,
       
  2072         TTmDocPosSpec& aPos );
       
  2073 
       
  2074 
       
  2075     /**
       
  2076     * This method is the standard way for the FEP to move the cursor when there is
       
  2077     * no inline edit or selection.
       
  2078     * Side effects:
       
  2079     * iUncommittedText is set to the zero-width "cursor" state with the passed position
       
  2080     * iUncommittedText is set into the FepAwareTextEditor state
       
  2081     * iCaseManager is updated with a ENullNaviEvent
       
  2082     * the doc post is set in TextView object if present
       
  2083     *
       
  2084     * @param aNewCursorPos - defines the position to set the cursor at, including leading/trailing
       
  2085     * @param aDragSelectOn - iff EFalse, do not keep old anchor position (that is, cancel any selection)
       
  2086     * properties.
       
  2087     */
       
  2088     void SetCursorPositionL( const TTmDocPosSpec& aNewCursorPos, TBool aDragSelectOn = EFalse );
       
  2089 
       
  2090     /**
       
  2091     * Returns ETrue if the passed position is formatted and is in the first line
       
  2092     */
       
  2093     TBool InFirstLineAndFormatted( const TTmDocPosSpec& aPos ) const;
       
  2094 
       
  2095     /**
       
  2096     * Returns ETrue if the passed position is formatted and is in the last line
       
  2097     */
       
  2098     TBool InLastLineAndFormatted( const TTmDocPosSpec& aPos ) const;
       
  2099 
       
  2100     /**
       
  2101     * Returns ETrue if the passed position is in the
       
  2102     * @param aCheckFirstLine    if ETrue, check for first line; else check last line
       
  2103     * @return ETrue if the passed position is formatted and is first (or last - depending on switch)
       
  2104     */
       
  2105     TBool DocPosInFirstOrLastLineAndFormatted( const TTmDocPosSpec& aPos, 
       
  2106                                                TBool aCheckFirstLine ) const;
       
  2107 
       
  2108     /**
       
  2109     * Method to determine if the passed position is equivalent visually to the "canonical"
       
  2110     * value determined by the limit algorithms.  The methods allow two visually equivalent,
       
  2111     * but logically different TTmDocPosSpecs to be be checked for equivalence.
       
  2112     * @param aCurrentPos    Position in document as returned by GetDocPos
       
  2113     * @param aLimitPos      Visual start of document as returned by GetVisualDocStart
       
  2114     * @returns              ETrue if the positions are visully equivalent
       
  2115     */
       
  2116     TBool AtVisualStart( const TTmDocPosSpec& aCurrentPos, const TTmDocPosSpec& aLimitPos ) const;
       
  2117 
       
  2118     /**
       
  2119     * Method to determine if the passed position is equivalent visually to the "canonical"
       
  2120     * value determined by the limit algorithms.  The methods allow two visually equivalent,
       
  2121     * but logically different TTmDocPosSpecs to be be checked for equivalence.
       
  2122     * @param aCurrentPos    Position in document as returned by GetDocPos
       
  2123     * @param aLimitPos      The visual end of document as returned by GetVisualDocStart
       
  2124     * @returns              ETrue if the positions are visully equivalent
       
  2125     */
       
  2126     TBool AtVisualEnd( const TTmDocPosSpec& aCurrentPos, const TTmDocPosSpec& aLimitPos, 
       
  2127                        TInt aDocLength ) const;
       
  2128 
       
  2129     void SetCursorType(TBool aIsLeftToRight);
       
  2130     TBool DeviceSupportsRTLLanguageL();
       
  2131 
       
  2132 	/**
       
  2133 	 * Performs calculations of digit mode; 
       
  2134 	 * used in UpdateLocalDigitMode() and in UpdateNumericEditorDigitType()
       
  2135 	 */
       
  2136 	void CalculateEditorDigitType(TDigitType& aDestination);
       
  2137 
       
  2138     void UpdateNumericEditorDigitType();
       
  2139 
       
  2140     /**
       
  2141     * Updates FEP digit mode from global locale settings.
       
  2142     */
       
  2143     void UpdateLocalDigitMode();
       
  2144 
       
  2145     /**
       
  2146     * Checks to see if the cursor position is at an ambiguous point (one where the text blocks
       
  2147     * on either side are of different directionality) and potentially moves the cursor from
       
  2148     * one block to the other, depending on the key identity.
       
  2149     *
       
  2150     * To be called before key event is processed by the FEP in the usual way.
       
  2151     * If the key is acted upon to move the cursor, then the event is "eaten" and it is not
       
  2152     * to be passed on for processing.
       
  2153     *
       
  2154     * @param aCode      Key code from standard TKeyEvent key event structure
       
  2155     * @return           EKeyWasConsumed if a cursor adjustement was made;
       
  2156     *                   else EKeyWasNotConsumed
       
  2157     */
       
  2158     // TKeyResponse AttemptCursorFlipAtAmbiguousPointL( const TKeyEvent& aKeyEvent, TEventCode aEventCode );
       
  2159     TKeyResponse AttemptCursorFlipAtAmbiguousPointL( const TUint aCode );
       
  2160 
       
  2161     /**
       
  2162     * Call back method for the "Post Event Check" mechanism. Called from a CIdle after
       
  2163     * any event that might required a check of the new cursor position or other invariant
       
  2164     */
       
  2165     static TInt PostEventCheckCallback(TAny* aObj);
       
  2166 
       
  2167     /**
       
  2168     * Access method for whether bidirectional cursor is to be used
       
  2169     *
       
  2170     * @return EFalse iff the bidi cursor is not to be used
       
  2171     */
       
  2172     TBool BidiCursorRequired() const;
       
  2173 
       
  2174     /**
       
  2175     * Since FEP does not complete the navigation of an event (editor and form do that), FEP
       
  2176     * has to ensure after all navigation is finished if the cursor is displayed correctly.
       
  2177     *
       
  2178     * <p> This method, called from the post event callback, implements the action to check the
       
  2179     * current cursor directionality against the text directionality at the cursor position,
       
  2180     * and alters the cursor appearance as required.
       
  2181     */
       
  2182     void DoCursorDirectionCheckL();
       
  2183 
       
  2184     /**
       
  2185     * Check the directionality of text in the vicinity of the current document position
       
  2186     * and ensure that the cursor is indicated appropriately.
       
  2187     *
       
  2188     * This routine has no side-effect on the cursor position. It merely changes the
       
  2189     * appearance of the cursor.
       
  2190     */
       
  2191     void AdjustCursorTypeForCurrentPosition();
       
  2192 
       
  2193     /**
       
  2194     * Kicks off the post event check idle event
       
  2195     *
       
  2196     * @param aCode Key event code
       
  2197     */
       
  2198     void SchedulePostEventCheckL(TUint aCode);
       
  2199 
       
  2200     /**
       
  2201     * Check the directionality of text in the vicinity of the supplied document position
       
  2202     * and ensure that the cursor is indicated appropriately.
       
  2203     *
       
  2204     * This routine has no side-effect on the cursor position. It merely changes the
       
  2205     * appearance of the cursor.
       
  2206     *
       
  2207     * @param    aDocPos     document position that is to be analysed and acted on
       
  2208     */
       
  2209     void AdjustCursorTypeForPosition( const TTmDocPosSpec& aDocPos );
       
  2210 
       
  2211     /**
       
  2212     * "Hook" method for managing a bidi cursor according to the text directionality at the cursor
       
  2213     * Only one of this method or SetCursorTypeForInputDirection will be in operation at any
       
  2214     * time.
       
  2215     *
       
  2216     * @param aLeftToRight   Supply ETrue iff cursor required is LTR cursor
       
  2217     */
       
  2218     void SetCursorTypeForTextDirection( TBool aLeftToRight );
       
  2219 
       
  2220     /**
       
  2221     * "Hook" method for managing a bidi cursor according to the current input direction
       
  2222     * Only one of this method or SetCursorTypeForTextDirection will be in operation at any
       
  2223     * time.
       
  2224     *
       
  2225     * @param aLeftToRight   Supply ETrue iff cursor required is LTR cursor
       
  2226     */
       
  2227     void SetCursorTypeForInputDirection( TBool aLeftToRight );
       
  2228 
       
  2229     /**
       
  2230     * Routine to analyse the directionalities surrounding the supplied document position
       
  2231     * and to return the results.
       
  2232     *
       
  2233     * @param    aDocPos     document position that is to be analysed
       
  2234     * @return               Structure containing the results of the analysis
       
  2235     */
       
  2236     TTextDirectionalInfo LocalTextDirectionalStatus( const TTmDocPosSpec& aDocPos ) const;
       
  2237 
       
  2238 
       
  2239     /**
       
  2240     *
       
  2241     * This method is used to add directional markers to protect neutrals that may be
       
  2242     * exposed to the opposite directional formatting to their situation before the deletion
       
  2243     *
       
  2244     * Redecoration is carried out if a neutral is exposed by the deletion to a directionality
       
  2245     * different to that which is was already marked.
       
  2246     *
       
  2247     * An inline edit may be stated and then committed.
       
  2248     *
       
  2249     * iUncommittedText is required to be set to the cursor position that existed after
       
  2250     * the deletion.
       
  2251     *
       
  2252     * iUncommittedText will be updated to the new cursor position.
       
  2253     *
       
  2254     * @param aTextThatWasDeleted Informs the method of what text has just been removed
       
  2255     */
       
  2256     void RedecorateAfterDeletionL( const TDesC& aTextThatWasDeleted );
       
  2257 
       
  2258 
       
  2259     TBool EditorSupportsNeutralProtection();
       
  2260 
       
  2261 
       
  2262     /**
       
  2263     * Wrapper function for the MCoeFepAwareTextEditor commit method.
       
  2264     * This method terminates the inline by accepting the current inline edit into the buffer.
       
  2265     *
       
  2266     * At entry, iUncommittedText is required to have the span of the current inline edit.
       
  2267     * iAnchorPos should be the index of the first character in the inline edit.
       
  2268     * iCursorPos should be the index of the next character after the inline edit.
       
  2269     *
       
  2270     * At exit, iUncommittedText has 0-length and represents the current cursor position.
       
  2271     * That is, iAnchorPos = iCursorPos = index of the character next after the cursor
       
  2272     *
       
  2273     * These indices may be more easily though of as "gap indices" where gap 0 precedes
       
  2274     * character 0, gap 1 follows character 0, gap 2 follows charcacter 1, etc.. until gap
       
  2275     * N follows character (N-1).
       
  2276     *
       
  2277     * This routine does not attempt to consolidate any directional markers that may be
       
  2278     * extraneous in the new buffer.  It is therefore used when it is important to know what
       
  2279     * span after the commit, e.g. to make it reversible.
       
  2280     *
       
  2281     * @param aFepAwareTextEditor    Editor for which there is a current inline edit.
       
  2282     * @param aCursorVisibility      EFalse if the cursor is to be suppressed during the commit.
       
  2283     */
       
  2284     void CommitInlineEditWithoutResolutionL(MCoeFepAwareTextEditor& aFepAwareTextEditor, 
       
  2285                                             TBool aCursorVisibility, TBool aClearPti = ETrue);
       
  2286 
       
  2287 
       
  2288     TKeyResponse HandlePredictiveNaviEventOutsideInlineEditL(TUint aCode, TKeyPressLength aLength);
       
  2289 
       
  2290     static TInt DoSimulateKey(TAny* aThisPtr);
       
  2291 
       
  2292     /**
       
  2293     * This method is that the label of CBA is updated by aTextResId.
       
  2294     * @param aPosition   CBA position, either ELeftSoftkeyIndex or ERightSoftkeyIndex
       
  2295     * @param aCommandId  command id for softkey
       
  2296     * @param aTextResId  resource id to set string on label.
       
  2297     * @return TBool The return value is ETrue in case it is necessary to update CBA.
       
  2298     */
       
  2299     TBool UpdateCBALabelL(TInt aPosition, TInt aCommandId, TInt aTextResId);
       
  2300 
       
  2301     /**
       
  2302     * Launches special character table (SCT) and pictograph character table (PCT).
       
  2303     *
       
  2304     * @param aResourceId   Resource of SCT content. NULL if the default SCT content
       
  2305     *                      is used. At the moment only Thai language sets non-default
       
  2306     *                      content.
       
  2307     * @param aShowSctParam Set the show mode for sct. EShowSctFirst or EShowPctFirst or EShowSmileyFirst
       
  2308     */
       
  2309     void DoLaunchSctAndPctL(TInt aResourceId, TShowSctMode aShowSctMode);
       
  2310 
       
  2311     /**
       
  2312      * Update CangJie mode
       
  2313      *
       
  2314      * @param aNewMode   New CangJie mode
       
  2315      * @since 3.0
       
  2316      */
       
  2317 	void UpdateCangJieState(TInt aNewMode);
       
  2318 
       
  2319     /**
       
  2320      * Launch CangJie setting dialog
       
  2321      *
       
  2322      * @since 3.0
       
  2323      * @return  Selected CangJie level or KErrGeneral if user cancel the selection
       
  2324      */
       
  2325 	TInt LaunchCangJieOptionDlgL();
       
  2326     
       
  2327     
       
  2328 	void AddEditSubmenuL(CAknFepUiInterfaceMenuPane* aMenuPane);
       
  2329 	void DisableEditSubmenuItems(CAknFepUiInterfaceMenuPane* aMenuPane);
       
  2330 	void StartCcpuModeL(TBool aCopyMode);
       
  2331 
       
  2332     /**
       
  2333      * Handle the Chr Key Monitor
       
  2334      * for Japanese variant only.
       
  2335      *
       
  2336      * @since 3.0
       
  2337      */
       
  2338     void HandleChrKeyMonitorL();
       
  2339     
       
  2340     TBool IsCursorAtEndOfWord();  
       
  2341     
       
  2342     /* This method should be called after launching any dialog by FEP */
       
  2343     void PrepareFepAfterDialogExitL(TUid aFepUid);
       
  2344     /* This method should be called before launching any fep aware dialog by FEP */
       
  2345     void PrepareFepForFepAwareDialogLaunch();
       
  2346     /* This method should be called after launching any fep aware dialog by FEP */
       
  2347     void PrepareFepAfterFepAwareDialogExitL(TUid aFepUid);
       
  2348 
       
  2349 public:
       
  2350 
       
  2351     /**
       
  2352      * Handle layout change.
       
  2353      * When screen layout change, Key Catcher calls this method
       
  2354      *
       
  2355      */
       
  2356     void HandleResourceChange(TInt aType);
       
  2357 
       
  2358     TBool IsHybridAplhaEditor() const;
       
  2359     TBool IsHybridAlphaModeChangedtoAplhanumeric() const;
       
  2360 
       
  2361     TBool QueryPredictiveState(const TAknEditingState aState);
       
  2362     TInt EvaluateState(TAknEditingState aState);
       
  2363     TBool QueryPredictiveAutoCompleteState(TAknEditingState aState);
       
  2364 	 CAknExtendedInputCapabilities::TEditorType EditorType() const;
       
  2365 	 TUint MIDPConstraint() const;
       
  2366 	/**
       
  2367 	* Tells if the current editor is phone number editor
       
  2368 	* @return ETrue if the current editor is phone number editor
       
  2369 	*/
       
  2370 	TBool IsPhoneNumberEditor() const;
       
  2371 
       
  2372     
       
  2373 #ifdef RD_SCALABLE_UI_V2
       
  2374 
       
  2375     /**
       
  2376      * Pen input support functions
       
  2377      */
       
  2378 public:
       
  2379 
       
  2380     void HandlePointerEventL(const TPointerEvent &aPointerEvent);
       
  2381     
       
  2382     
       
  2383     /**
       
  2384      * Handle arrow key event when some chars have been selected
       
  2385      *
       
  2386      * @since S60 v3.2
       
  2387      * @param aKeyEvent
       
  2388      * @param aEventCode
       
  2389      * @param aRetCode
       
  2390      */    
       
  2391     TBool HandleSelModeArrowKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aEventCode,
       
  2392                                       TKeyResponse& aRetCode);
       
  2393     
       
  2394     /**
       
  2395      * From CAknExtendedInputCapabilities::MAknEventObserver
       
  2396      * Handle an event
       
  2397      *
       
  2398      * @since S60 v3.2
       
  2399      * @param aEvent An event, see TInputCapabilitiesEvent
       
  2400      * @param aParams Event dependent parameters
       
  2401      */
       
  2402     void HandleInputCapabilitiesEventL( TInt aEvent, TAny* aParams );
       
  2403     
       
  2404     void SubmitInlineTextL( const TDesC& aData );
       
  2405     
       
  2406     inline TInt PermittedModes() const;
       
  2407     
       
  2408     inline void SetNotifyPlugin( TBool aNotifyFlag );
       
  2409             
       
  2410     inline void RemeberEditorState();
       
  2411     
       
  2412     inline TBool IsMfneEditor() const;
       
  2413     
       
  2414     inline TBool IsFindPaneEditor() const;
       
  2415     inline TBool IsSupportedAdaptiveSearch() const;
       
  2416     //for japanese
       
  2417     void NotifyJapaneseSetting();
       
  2418     
       
  2419     
       
  2420     void ProcessEditorMenuCommand(TInt aCommand);
       
  2421     
       
  2422     TInt GetPermittedEditorMenu(TBool aOnlyCount = EFalse);
       
  2423 
       
  2424     void UpdateTouchCaseMode();
       
  2425 
       
  2426 	void DimInputmodeTouchMenuItems(CAknFepUiInterfaceMenuPane* aMenuPane);
       
  2427 	
       
  2428 	inline TLanguageCapabilities InputLanguageCapabilities() const;
       
  2429 
       
  2430     inline TAknFepManagerState& FepManState();
       
  2431     
       
  2432     inline TBool IsSupportNativeNumber() const;
       
  2433 
       
  2434 	void NeedDisableKeySound(const TKeyEvent& aKeyEvent, TEventCode aEventCode);
       
  2435 	
       
  2436 	inline void SetGainForeground( TBool aGainForeground );
       
  2437 	void HandleEndKeyL();
       
  2438 	inline void SetCancelPopupInQwerty( TBool aCancelPopupInQwerty );
       
  2439 		
       
  2440     /**
       
  2441      * Return the chinese input mode used last time
       
  2442      */
       
  2443 	inline TInt LastChineseInputMode() const;
       
  2444 	
       
  2445 private:
       
  2446        
       
  2447     /**
       
  2448     * Checks if the current editor is fully FEP aware.
       
  2449     *
       
  2450     * @since 3.2
       
  2451     *
       
  2452     * @return ETrue if editor if fully FEP aware.
       
  2453     */
       
  2454     TBool FullyFepAwareTextEditor() const;
       
  2455 
       
  2456     /**
       
  2457     * Checks if the current editor is partially FEP aware.
       
  2458     *
       
  2459     * @since 3.2
       
  2460     *
       
  2461     * @param aAtLeast if ETrue then ETrue is returned for also fully FEP aware editors.
       
  2462     *
       
  2463     * @return ETrue if editor is partially FEP aware.
       
  2464     */
       
  2465     TBool SemiFepAwareTextEditor( TBool aAtLeast = EFalse ) const;         
       
  2466         
       
  2467     void DoWesternTouchMenu(CAknFepUiInterfaceMenuPane* aMenuPane);    
       
  2468     void DoChineseTouchMenu(CAknFepUiInterfaceMenuPane* aMenuPane);
       
  2469     
       
  2470     /**
       
  2471     * Checks if the current input mode belongs to chinese input modes.        
       
  2472     *
       
  2473     * @param aMode The current input mode.
       
  2474     *
       
  2475     * @return ETrue if the current input mode belongs to chinese input mode..
       
  2476     */
       
  2477     TBool IsChineseInputMode( TInt aMode );
       
  2478     
       
  2479 #endif //RD_SCALABLE_UI_V2
       
  2480     
       
  2481      /**
       
  2482     * Returns the type of the focused editor.
       
  2483     *
       
  2484     * @since 3.2
       
  2485     *
       
  2486     * @return Editor type.
       
  2487     */
       
  2488     //CAknExtendedInputCapabilities::TEditorType EditorType() const;
       
  2489         
       
  2490     /**
       
  2491      *  Get the MAknFepDocumentNavigation object
       
  2492      *
       
  2493      *  @since 3.2
       
  2494      *  @return pointer to MAknFepDocumentNavigation accessed through
       
  2495      *  the input capabilites object provider.
       
  2496      */
       
  2497 	MAknFepDocumentNavigation* AknFepDocumentNavigation() const;
       
  2498 	
       
  2499 	TInt GetPermittedEditorMenuL(TBool aOnlyCount = EFalse);
       
  2500 		
       
  2501 private:// from MPeninputServerEventHandler
       
  2502 
       
  2503     void UpdateLatinIndicator( TAknEditingState& aNewState );
       
  2504     void UpdateNumberIndicator( TAknEditingState& aNewState );
       
  2505     void UpdateHindiIndicator( TAknEditingState& aNewState );
       
  2506     void HandleCopyCutStateL();
       
  2507  	/**    
       
  2508 	* Returns ETrue if hash key selection is on and hash key mode selection should
       
  2509 	* be blocked.
       
  2510 	*
       
  2511 	* @since 3.1
       
  2512 	*/  
       
  2513     TBool HashKeyModeChangeBlockedInSearchField() const;                                  
       
  2514     /**
       
  2515      * Set editor cursor selection according plugin UI 
       
  2516      * cursor state
       
  2517      *
       
  2518      * @since 3.2
       
  2519      * @param aCurSel Cursor position.
       
  2520      * @param aSyncCursor ETrue if plug in UI need update cursor, EFalse otherwise
       
  2521      * @return None
       
  2522      */
       
  2523     void SetCursorSelectionL(const TCursorSelection& aCurSel, TBool aSyncCursor);
       
  2524 
       
  2525 	/**
       
  2526     * An internal helper method for matches popup list.
       
  2527     * 
       
  2528     * The index of currently selected prediction candidate.
       
  2529     * 
       
  2530     * @since S60 3.2
       
  2531     */ 
       
  2532     TInt ResolveCurrentCandidateListIndex(CDesCArrayFlat* aCandList);
       
  2533 
       
  2534     /**
       
  2535 	*  Removes underlining from predictive word and moves cursor the end of the word.
       
  2536 	*
       
  2537     *  @since 3.2
       
  2538     *  @param aData Key data
       
  2539     *  @return None
       
  2540     */    
       
  2541     void DeactivatePredicitveWordAndMoveCursorL();
       
  2542     
       
  2543  	/**
       
  2544 	*  Returns the Ccpu status of given editor state as a flag combination.
       
  2545 	*
       
  2546     *  @since 3.2
       
  2547     *  @param aEdwinState
       
  2548     *  @return editor ccpu status
       
  2549     */    
       
  2550 	TInt EditorCcpuStatus(CAknEdwinState* aEdwinState);
       
  2551 	
       
  2552 	/**
       
  2553 	*  Cancels editing options copy / paste mode initialted from editing options -submenu.
       
  2554 	*
       
  2555     *  @since 3.2
       
  2556     */    	
       
  2557 	void CancelCcpuMode();
       
  2558 
       
  2559 #ifdef RD_SCALABLE_UI_V2    
       
  2560     /**
       
  2561     *  Launches stylus Ccpu-menu
       
  2562     *
       
  2563     *  @since 5.0
       
  2564     *  @param aClickPoint Point where stylus was clicked.
       
  2565     */
       
  2566     void LaunchStylusCcpuMenuL(TPoint &aClickPoint);
       
  2567     
       
  2568     void DynInitTouchMenuPaneL(CAknFepUiInterfaceMenuPane* aMenuPane);
       
  2569 #endif    
       
  2570 
       
  2571     /**
       
  2572     * Has Japanese prediction input mode in PtiEngine
       
  2573     */
       
  2574     TBool HasJapanesePredictionInputMode() const;
       
  2575     
       
  2576     
       
  2577     void InitPreviewMenuPane(CAknFepUiInterfaceMenuPane* aMenuPane);
       
  2578 
       
  2579 public:
       
  2580     void StopDisplayingMenuBar();
       
  2581 
       
  2582 private:
       
  2583     void ConvertCharToKey(TChar aIn, TUint16& aKey) const;
       
  2584 
       
  2585 private:
       
  2586     // Data owned by this class
       
  2587     CAknFepKeyCatcherInterface* iKeyCatcher;
       
  2588     CAknFepIndicator* iIndicator;
       
  2589     CPeriodic* iShiftKeypressMonitor;
       
  2590     CAknFepLanguageManager* iLangMan;           // own
       
  2591     MAknFepManagerInterface* iCurrentFepUI;     // not own
       
  2592     CAknFepCaseManager* iCaseMan;
       
  2593     CAknFepInlineTextDecorator* iInlineTextDecorator;
       
  2594 
       
  2595     CAknFepHashKeyManager* iHashKeyMan;
       
  2596     CPeriodic* iConcatenationTimer;
       
  2597     //fep delay the resource changed message for getting the updated coordinate from editor.
       
  2598     CAsyncCallBack iAsyncResouceChanged;
       
  2599 
       
  2600     // shared data support
       
  2601     CAknFepSharedDataInterface* iSharedDataInterface;
       
  2602 
       
  2603     MAknEditingStateIndicator*  iPreviousIndicator;
       
  2604     MAknEditingStateIndicator* iEditIndicatorAtLastUpdate;
       
  2605     TAknEditingState iPreviousEditingState;
       
  2606 
       
  2607     TLanguage iUiLanguage;  // Symbian language code for UI language.
       
  2608     TLanguageCapabilities iLanguageCapabilities; // Input language and capabilities of the language.
       
  2609     TUint iFlags;
       
  2610     TUint iExtendedFlags;
       
  2611     TAknFepManagerState iFepManState;
       
  2612     TCoeInputCapabilities iInputCapabilities;
       
  2613     TInt iPermittedInputModes;
       
  2614     TInt iMode;
       
  2615     TInt iModeBefore;
       
  2616     TInt iCaseBefore;
       
  2617     TInt iResId;
       
  2618     TInt iVariantPermittedModes;
       
  2619     TInt iSpaceCharacterCode;               // adding for japanese
       
  2620     TInt iFullWidthSpaceCharacterCode;      // adding for japanese
       
  2621     TAknEditorNumericKeymap iAknEditorNumericKeymap;
       
  2622     TInt iAknEditorFlags;
       
  2623     TCursorSelection iUncommittedText;
       
  2624     RArray<TInt> iHashKeyLoop;
       
  2625     TBool iWesternPredictive;
       
  2626     TKeyPressLength iKeyRepeat;
       
  2627     TBool iIsAutoCompleteOn;				// for Auto Word Completion
       
  2628 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
  2629     TInt iKeyBackSpaceHit;
       
  2630     TInt  iTypingCorrectionLevel;			// for typing correction level
       
  2631     TBool iIsNumberCandidateShown;			// for number candidates
       
  2632     TBool iPrimaryCandidate;    			// for primary candidate
       
  2633     TBool iKeyPressedDuringShift;           
       
  2634     TPtiKeyboardType iKeyboardType; 		// for checking the keyboard layout
       
  2635     TBool iSupressCursorMoveToEndChrKeyPressed; // For supressing cursor movement when SCT launched
       
  2636 #endif //RD_INTELLIGENT_TEXT_INPUT
       
  2637     TBool iJapanesePredictive;
       
  2638     TBool iDeviceSupportsRtlLanguage; // Could be removed
       
  2639     CIdle* iPostEventCheck; // Owned
       
  2640 
       
  2641     TWidthChar iCharWidth;      // adding for japanese
       
  2642     CPtiEngine* iPtiEngine;     // adding for japanese
       
  2643 
       
  2644     TUint iSimulateKey;
       
  2645     CApaDocument* iEmbedded; // User Dictionary
       
  2646     CAknNullService*  iNullService; // User Dictionary
       
  2647     CAsyncCallBack iAsyncOwnSimulateKey;
       
  2648     TInt iFreeSpaceOfEditor;
       
  2649     TBool iQwertyInputMode; // Not used. The value is always EFalse.
       
  2650     TBool iLongThai0Key;
       
  2651     TBool iFepFullyConstructed;
       
  2652     CAknEdwinState* iRememberEditorState; // For "editing options" submenu
       
  2653     TInt iRememberLength;   // For "editing options" submenu.
       
  2654     TInt iEditorCcpuStatus; // For "editing options" submenu.
       
  2655     TInt iCcpuMode;         // For "editing options" submenu    
       
  2656     TInt  iMultiTapTimer;   // for Japanese only: store MultiTap Timer
       
  2657  	CAknFepUiInterfaceMenuBar* iEditMenuBar;   // Remember menu bar instance for closing. 
       
  2658  	HBufC* iSctEditChars;   // Buffer for characters selected in the edit menu
       
  2659  	TPtr iEditCharsPtr;     // Pointer to the buffer that holds all the selected characters.
       
  2660  	TInt iStarScan;         // Remember scan code for star key.
       
  2661     TInt  iJapaneseQwertyFlags;   // for Japanese only: store Japanese Qwerty Flags
       
  2662 
       
  2663     CPeriodic* iChrKeypressMonitor; // for Japanese only: Chr key monitor timer
       
  2664 	TBool iLastKeyPressedWasHashKey;
       
  2665     TBool iStopProcessFocus;
       
  2666     TBool iClosePeninputUi;
       
  2667     /**
       
  2668      * User DB dialog
       
  2669      * Own, but doesn't need delete by myself
       
  2670      */
       
  2671     CAknFepUserdbDlg* iUserdbdlg;
       
  2672     
       
  2673     CAknNavigationDecorator* iTapGroup;
       
  2674 
       
  2675     TInt iEditorCommandList[30];
       
  2676 
       
  2677 	TBool iComposChrFlag;
       
  2678     //User db view(phrase creation)
       
  2679     TInt iIsUserdbdlgActive;
       
  2680     /**
       
  2681      * * Used for handle key event for zhuyin method.(phrase creation)
       
  2682      * 
       
  2683      */
       
  2684     CZhuyinKeyHandler* iZhuyinKeyHandler;
       
  2685     CAknFepZhuyinAnalyser* iZhuyinAnalyser;
       
  2686     CZhuyinAnalyserDbFeed* iZhuyinAnalyserDb;
       
  2687 
       
  2688 #ifdef RD_SCALABLE_UI_V2
       
  2689 
       
  2690     /**
       
  2691      * Used by itut spell mode, initial text in spell mode
       
  2692      */
       
  2693 	HBufC* iSpellInitText;
       
  2694 
       
  2695     /**
       
  2696      * Used by itut spell mode, initial text selection in spell mode, 
       
  2697      * whose position is relative to whole text in original editor
       
  2698      */
       
  2699 	TCursorSelection iSpellInitCurSel;
       
  2700    
       
  2701     CAknFepPluginManager* iFepPluginManager;
       
  2702     
       
  2703     /**
       
  2704      * HKB predictive state before starting plugin IME
       
  2705      */
       
  2706     TBool                    iT9UsedBeforePluginInput;
       
  2707     
       
  2708     
       
  2709     /**
       
  2710     * Stylus ccpu menu
       
  2711     */ 
       
  2712     CAknFepUiInterfaceStylusPopUpMenu*     iStylusCcpuMenu; 
       
  2713     
       
  2714     /**
       
  2715     * Last known clik point, needed for stylus ccpu menu launch.
       
  2716     */   
       
  2717     TPoint                   iClickPoint;
       
  2718     
       
  2719     TBool iGainForeground;
       
  2720     
       
  2721     TBool iLoseForeAndGainFocus;
       
  2722     
       
  2723     TBool iNotifyPlugin;
       
  2724     
       
  2725     TBool iCancelPopupInQwerty;
       
  2726     
       
  2727     TBool iStarKeyPressed;
       
  2728     
       
  2729     TInt iLastChineseInputMode;
       
  2730     
       
  2731     // Indicate Stroke is used in QWERTY, when default input mode is Cangjie
       
  2732     TBool iStrokeUsedInQWERTY;
       
  2733     // Save that which editor use stroke
       
  2734     CAknEdwinState* iEditorStateStrokeUsed;
       
  2735 
       
  2736     // Indicated focus change has done in closing SCT, the call back from framework
       
  2737     // will not lead to another focus change.
       
  2738     TBool iDisalbleFocusChangeForSCT;
       
  2739 #endif //RD_SCALABLE_UI_V2
       
  2740 
       
  2741     /**
       
  2742      * Long press clear key after close UI;
       
  2743      */
       
  2744     TBool                    iLongClearAfterCloseUI;      
       
  2745     
       
  2746     TBool iFeatureSupportedJapanese;    // Save the value of KFeatureIdJapanese
       
  2747 
       
  2748 	// stores a reference to previous editor state for pointer comparision
       
  2749 	CAknEdwinState* iPreviousEditorState; 
       
  2750 	   
       
  2751     CAknFepUIInterface* iUiInterface;
       
  2752 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
  2753     CAknFepFnKeyManager     *iFnKeyManager; // Owned
       
  2754     TBool iIsFnKeyMapped;
       
  2755 #ifdef __REVERSE_FN_KEY_SUPPORTED
       
  2756     TBool iIsReverseFnkeyInput;
       
  2757 #endif //__REVERSE_FN_KEY_SUPPORTED
       
  2758 	
       
  2759 	// Predictive QWERTY (XT9) changes ---->
       
  2760     //! The exact word tooptip shown above the inline editor when the exact word differs from the best guess candidate
       
  2761    // CAknPreviewPopUpController* iExactWordPopup;
       
  2762     
       
  2763     //! The contents of the exact word popup.
       
  2764 	MAknFepUiWordPopupContent* iExactWordPopupContent;
       
  2765 	MAknFepCandidatePopup*	iCandidatePopup;
       
  2766 	TBool iSListLaunchedFromMenu;
       
  2767 	TInt iAutoCmptnTailLength;
       
  2768 	TInt iIsLastResourceEditMenu;
       
  2769 	// Predictive QWERTY (XT9) changes <----
       
  2770 #ifdef    __ITI_VIRTUAL_TOUCH_FIRST_GENERATION_SUPPORT__    
       
  2771     CAknFepUiInterfaceMenuBar* iOptionsMenuBar;
       
  2772 #endif	
       
  2773 #endif //RD_INTELLIGENT_TEXT_INPUT
       
  2774     //phrase creation    
       
  2775     TInt iPhraseCreation;
       
  2776     TInt iPinyinPhraseCreation;
       
  2777     TInt iKeyStar;
       
  2778     TInt iEntryPhrase;
       
  2779     TBool iPenSupportMenu;
       
  2780     TFepSymbolOfHardwareOne iSymbolData;
       
  2781       
       
  2782     /**
       
  2783      * Flag for wether input mode is changed by shift+space
       
  2784      */
       
  2785     TBool iShiftAndSpace;
       
  2786     CAknFepThaiSCTSelector* iAknFepThaiSCTSelector;
       
  2787     
       
  2788 public:
       
  2789 
       
  2790     //the follow 8 functions for phrase creation 
       
  2791     /**
       
  2792      * Set the state to pinyin phrase creation
       
  2793      */
       
  2794     void PinyinPhraseCreation( TBool aPinyinPhraseCreation );
       
  2795     
       
  2796     /**
       
  2797      * Is the state is in pinyin phrase creation
       
  2798      *
       
  2799      * @return if not enabled, return EFalse
       
  2800      */
       
  2801     TBool IsPinyinPhraseCreation() const;
       
  2802     
       
  2803     /**
       
  2804      * Set the state to phrase creation
       
  2805      */
       
  2806     void PhraseCreation( TBool aPhraseCreation );
       
  2807     
       
  2808     /**
       
  2809      * Is the state is in phrase creation
       
  2810      *
       
  2811      * @return if not enabled, return EFalse
       
  2812      */
       
  2813     TBool IsPhraseCreation() const;
       
  2814     
       
  2815     /**
       
  2816      * Set the state to input phrase
       
  2817      */
       
  2818     void EntryPhrase( TBool aEntryPhrase );
       
  2819     
       
  2820     /**
       
  2821      * Is the state is in input phrase
       
  2822      *
       
  2823      * @return if not enabled, return EFalse
       
  2824      */
       
  2825     TBool IsEntryPhrase() const;
       
  2826     
       
  2827     /**
       
  2828      * Set the state to enable star key
       
  2829      */
       
  2830     void EnableKeyStar( TBool aEnable );
       
  2831     
       
  2832     /**
       
  2833      * Is the state is enable star key
       
  2834      *
       
  2835      * @return if not enabled, return EFalse
       
  2836      */
       
  2837     TBool IsEnableKeyStar() const;
       
  2838 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
  2839 public:
       
  2840    /**
       
  2841     * multitaps thru the chars in the SCT.
       
  2842     * @param aCallback, the callback when the timer expires
       
  2843     */
       
  2844     void MultitapThroughSCTCharL(TCallBack aCallBack);       	 
       
  2845 private:        
       
  2846     TBool NumericResourceMultiTapTimerTimeoutL();    
       
  2847     
       
  2848     /**
       
  2849      * CAknFepManager::FindAndRemoveInputOptionsMenuItemL
       
  2850      * Helper method to check if the "Input options" menu item exists and
       
  2851      * if so, remove it from the menu pane.
       
  2852      *  Params - 
       
  2853      *      aMenuPane : pointer to the menu pane to be checked for the resource id
       
  2854      */
       
  2855     void FindAndRemoveInputOptionsMenuItemL( CAknFepUiInterfaceMenuPane* aMenuPane );
       
  2856     
       
  2857     /**
       
  2858       * CAknFepManager::FindAndRemoveEditSubMenuItemL
       
  2859       * Helper method to check if the "Edit Text" menu item exists and
       
  2860       * if so, remove it from the menu pane.
       
  2861       *  Params - 
       
  2862       *      aMenuPane : pointer to the menu pane to be checked for the resource id
       
  2863       */
       
  2864     void FindAndRemoveEditSubMenuItemL( CAknFepUiInterfaceMenuPane* aMenuPane );
       
  2865     
       
  2866     /**
       
  2867      * CAknFepManager::AddInputOptionsMenuItemL
       
  2868      * Helper method to add the "Input options" menu item in appropriate location
       
  2869      * Appropriate location is :
       
  2870      *  - if Avkon Help command exists, then immediately above it
       
  2871      *  - else if Avkon Exit command exists, then immediately above it
       
  2872      *  - else if there are 3 or more items in the Options menu, then 3rd from last
       
  2873      *  - else it is the last item. 
       
  2874      *  Params - 
       
  2875      *      aMenuPane : pointer to the menu pane to be checked for the resource id
       
  2876      */
       
  2877     void AddInputOptionsMenuItemL( CAknFepUiInterfaceMenuPane* aMenuPane );
       
  2878         
       
  2879 private:        
       
  2880     CChrMultiTapTimer* iNumericResourceTimer;
       
  2881     HBufC* iResourceString;
       
  2882     TInt iChrCharIndex;    
       
  2883 #ifdef __HALF_QWERTY_KEYPAD
       
  2884 	TKeyEvent iHalfQwertyLastKeyEvent;
       
  2885 // this variable is set whenever a long key press of chr happens
       
  2886 	TBool iChrLongKeyPress;
       
  2887     TBool iFnCharInsertedForShift;	
       
  2888 #endif //__HALF_QWERTY_KEYPAD
       
  2889     TInt iNumericResourceId;
       
  2890 #endif //RD_INTELLIGENT_TEXT_INPUT
       
  2891     TBool iHybridAplphaChangedToAlphanumeric;
       
  2892     CAknEdwinState* iLastFocusedEditor;
       
  2893     CAknEdwinState* iFepAwareDialogParentEditor;
       
  2894     /**
       
  2895      * Indicate that the focused control is destroyed.     
       
  2896      */  
       
  2897     TBool iFocusedItemDestroy;    
       
  2898     };
       
  2899 
       
  2900 /**
       
  2901  *  Sets aFlag bitfield in iFlags
       
  2902  */
       
  2903 inline void CAknFepManager::SetFlag(TInt aFlag)
       
  2904     {
       
  2905     iFlags|=aFlag;
       
  2906     }
       
  2907 
       
  2908 /**
       
  2909  * Clears aFlag bitfield in iFlags
       
  2910  */
       
  2911 inline void CAknFepManager::ClearFlag(TInt aFlag)
       
  2912     {
       
  2913     iFlags&=~aFlag;
       
  2914     }
       
  2915 
       
  2916 /**
       
  2917  * Clears all flags down
       
  2918  */
       
  2919 inline void CAknFepManager::ResetFlags()
       
  2920     {
       
  2921     iFlags=0;
       
  2922     }
       
  2923 
       
  2924 /**
       
  2925  * Returns ETrue if the aFlag bitfield in iFlags is set, EFalse if it
       
  2926  * is clear
       
  2927  */
       
  2928 inline TBool CAknFepManager::IsFlagSet(TInt aFlag) const
       
  2929     {
       
  2930     return iFlags&aFlag;
       
  2931     }
       
  2932 
       
  2933 /**
       
  2934  *  Sets aExtendedFlag bitfield in iExtendedFlags
       
  2935  */
       
  2936 inline void CAknFepManager::SetExtendedFlag(TInt aExtendedFlag)
       
  2937     {
       
  2938     iExtendedFlags|=aExtendedFlag;
       
  2939     }
       
  2940 
       
  2941 /**
       
  2942  * Clears aExtendedFlag bitfield in iExtendedFlags
       
  2943  */
       
  2944 inline void CAknFepManager::ClearExtendedFlag(TInt aExtendedFlag)
       
  2945     {
       
  2946     iExtendedFlags&=~aExtendedFlag;
       
  2947     }
       
  2948 
       
  2949 /**
       
  2950  * Clears all ExtendedFlags down
       
  2951  */
       
  2952 inline void CAknFepManager::ResetExtendedFlags()
       
  2953     {
       
  2954     iExtendedFlags=0;
       
  2955     }
       
  2956 
       
  2957 /**
       
  2958  * Returns ETrue if the aExtendedFlag bitfield in iExtendedFlags is set, EFalse if it
       
  2959  * is clear
       
  2960  */
       
  2961 inline TBool CAknFepManager::IsExtendedFlagSet(TInt aExtendedFlag) const
       
  2962     {
       
  2963     return iExtendedFlags&aExtendedFlag;
       
  2964     }
       
  2965 
       
  2966 /**
       
  2967  * Returns previous case information
       
  2968  */
       
  2969 inline TInt CAknFepManager::CaseBefore() const
       
  2970     {
       
  2971     return iCaseBefore;
       
  2972     }
       
  2973     
       
  2974 inline TBool CAknFepManager::IsChineseInputLanguage() const
       
  2975     {
       
  2976     return ( iLanguageCapabilities.iInputLanguageCode == ELangPrcChinese ||
       
  2977         iLanguageCapabilities.iInputLanguageCode == ELangHongKongChinese ||
       
  2978         iLanguageCapabilities.iInputLanguageCode == ELangTaiwanChinese);
       
  2979     }
       
  2980 
       
  2981 inline TBool CAknFepManager::IsKoreanInputLanguage() const
       
  2982     {
       
  2983     return iLanguageCapabilities.iInputLanguageCode == ELangKorean;
       
  2984     }
       
  2985 inline TBool CAknFepManager::IsArabicInputLanguage() const
       
  2986     {
       
  2987     return ( iLanguageCapabilities.iInputLanguageCode == ELangArabic);
       
  2988     }
       
  2989 /**
       
  2990  * Returns the valid of Qwerty
       
  2991  */
       
  2992 inline TBool CAknFepManager::IsQwerty() const
       
  2993     {
       
  2994     return iQwertyInputMode;
       
  2995     }
       
  2996 
       
  2997 
       
  2998 /**
       
  2999  *  Sets aFlag bitfield in iCcpuFlags
       
  3000  */
       
  3001 inline void CAknFepManager::SetCcpuFlag(TInt aFlag)
       
  3002     {
       
  3003     iCcpuMode|=aFlag;
       
  3004     }
       
  3005 
       
  3006 /**
       
  3007  * Clears aFlag bitfield in iCcpuFlags
       
  3008  */
       
  3009 inline void CAknFepManager::ClearCcpuFlag(TInt aFlag)
       
  3010     {
       
  3011     iCcpuMode&=~aFlag;
       
  3012     }
       
  3013 
       
  3014 /**
       
  3015  * Clears all flags in iCcpuFlags
       
  3016  */
       
  3017 inline void CAknFepManager::ResetCcpuFlags()
       
  3018     {
       
  3019     iCcpuMode=0;
       
  3020     }
       
  3021 
       
  3022 /**
       
  3023  * Returns ETrue if the aFlag bitfield in iCcpuFlags is set, EFalse if it
       
  3024  * is clear
       
  3025  */
       
  3026 inline TBool CAknFepManager::IsCcpuFlagSet(TInt aFlag) const
       
  3027     {
       
  3028     return iCcpuMode&aFlag;
       
  3029     }
       
  3030      
       
  3031 inline MAknFepManagerInterface* CAknFepManager::InternalFepUI()
       
  3032     {
       
  3033     return iCurrentFepUI;
       
  3034     }
       
  3035 
       
  3036 #ifdef RD_SCALABLE_UI_V2
       
  3037 
       
  3038 inline void CAknFepManager::SetNotifyPlugin( TBool aNotifyFlag )
       
  3039 	{
       
  3040 	iNotifyPlugin = aNotifyFlag;
       
  3041 	}
       
  3042 inline TInt CAknFepManager::PermittedModes() const
       
  3043 	{
       
  3044 	return iPermittedInputModes;
       
  3045 	}    
       
  3046 
       
  3047 inline void CAknFepManager::RemeberEditorState()
       
  3048 	{
       
  3049 	iRememberEditorState = EditorState();
       
  3050 	}  	
       
  3051 
       
  3052 inline TBool CAknFepManager::IsMfneEditor() const
       
  3053     {
       
  3054     return EditorType() == CAknExtendedInputCapabilities::EMFNEBased;
       
  3055     }
       
  3056 
       
  3057 inline TBool CAknFepManager::IsFindPaneEditor() const
       
  3058     {
       
  3059     return iAknEditorFlags & EAknEditorFlagFindPane;
       
  3060     }
       
  3061     
       
  3062 inline CAknFepManager::TLanguageCapabilities CAknFepManager::InputLanguageCapabilities() const
       
  3063     {
       
  3064     return iLanguageCapabilities;
       
  3065     }
       
  3066 
       
  3067 inline TAknFepManagerState& CAknFepManager::FepManState()
       
  3068     {
       
  3069     return iFepManState;
       
  3070     }
       
  3071 
       
  3072 inline void CAknFepManager::SetCancelPopupInQwerty( TBool aCancelPopupInQwerty )
       
  3073     {
       
  3074     iCancelPopupInQwerty = aCancelPopupInQwerty;
       
  3075     }
       
  3076 inline TInt CAknFepManager::LastChineseInputMode() const
       
  3077     {
       
  3078     return iLastChineseInputMode;
       
  3079     };
       
  3080 #endif //RD_SCALABLE_UI_V2
       
  3081 
       
  3082 /**
       
  3083 * Returns ETrue if Feature manager supports Japanese.
       
  3084 */
       
  3085 inline TBool CAknFepManager::IsFeatureSupportedJapanese() const
       
  3086     {
       
  3087     return iFeatureSupportedJapanese;
       
  3088     }
       
  3089 
       
  3090 /**
       
  3091 * Returns ETrue if Auto Word Completion is enabled in the edtior
       
  3092 */    
       
  3093 inline TBool CAknFepManager::IsAutoCompleteOn() const
       
  3094     {
       
  3095     return iIsAutoCompleteOn;
       
  3096     }
       
  3097 #ifndef RD_INTELLIGENT_TEXT_INPUT
       
  3098 /**
       
  3099 * Setes the current state from GS to the local state
       
  3100 */    
       
  3101     
       
  3102 inline void CAknFepManager::SetAutoCompletionState(TInt aValue) 
       
  3103 {
       
  3104 	iIsAutoCompleteOn = aValue;
       
  3105 }
       
  3106 #endif
       
  3107 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
  3108 /**
       
  3109 * @return	TInt 	Typing correction level.
       
  3110 */
       
  3111 inline TInt CAknFepManager::AdvancedPredictiveTypingCorrectionLevel() const
       
  3112 	{
       
  3113 		return iTypingCorrectionLevel;
       
  3114 	}
       
  3115     
       
  3116 /**
       
  3117 * @return   ETrue   If the number candidate shown. EFalse otherwise.
       
  3118 */
       
  3119 inline TBool CAknFepManager::IsAdvancedPredictiveNumberCandidateShown() const
       
  3120 	{
       
  3121 	return iIsNumberCandidateShown;
       
  3122 	}
       
  3123   
       
  3124 /**
       
  3125 * @return   ETrue   If the number candidate shown. EFalse otherwise.
       
  3126 */
       
  3127 inline TBool CAknFepManager::AdvancedPredictivePrimaryCandidate() const
       
  3128 	{
       
  3129 	return iPrimaryCandidate;
       
  3130 	} 
       
  3131 #endif //RD_INTELLIGENT_TEXT_INPUT
       
  3132 
       
  3133 inline TBool CAknFepManager::WasLastKeyPressAHashKey()
       
  3134 	{
       
  3135 	return iLastKeyPressedWasHashKey;
       
  3136 	}
       
  3137     
       
  3138 inline void CAknFepManager::SetLastPressedHashKeyStatus(TBool aStatus)
       
  3139 	{
       
  3140 	iLastKeyPressedWasHashKey = aStatus;
       
  3141 	}
       
  3142 	
       
  3143 inline TCoeInputCapabilities& CAknFepManager::InputCapabilities()
       
  3144     {
       
  3145     return iInputCapabilities;    
       
  3146     }
       
  3147 
       
  3148 inline TFepSymbolOfHardwareOne CAknFepManager::SymbolInfoOfHardKey1()
       
  3149     {
       
  3150     return iSymbolData;
       
  3151     }
       
  3152 inline TBool CAknFepManager::IsSupportNativeNumber() const
       
  3153     {
       
  3154     return ( iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic
       
  3155         || iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic
       
  3156         || iLanguageCapabilities.iLocalDigitType == EDigitTypeDevanagari );
       
  3157 }
       
  3158 
       
  3159 inline TBool CAknFepManager::IsSupportedAdaptiveSearch() const
       
  3160     {
       
  3161     return iAknEditorFlags & EAknEditorFlagAdaptiveSearch;
       
  3162     }
       
  3163     
       
  3164 inline void CAknFepManager::SetGainForeground( TBool aGainForeground )  
       
  3165     {
       
  3166     iGainForeground = aGainForeground;
       
  3167     }
       
  3168 #endif
       
  3169 
       
  3170 // End of file