fep/aknfep/inc/AknFepHashKeyManager.h
changeset 36 a7632c26d895
parent 35 0f326f2e628e
child 42 b3eaa440ab06
equal deleted inserted replaced
35:0f326f2e628e 36:a7632c26d895
     1 /*
       
     2 * Copyright (c) 2002 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 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 #ifndef _AKNFEP_HASHKEY_MANAGER_H__
       
    30 #define _AKNFEP_HASHKEY_MANAGER_H__
       
    31 
       
    32 #include <e32base.h>
       
    33 #include <coedef.h>
       
    34 #include <frmtlay.h>
       
    35 
       
    36 #include "AknFepGlobalEnums.h"
       
    37 
       
    38 class CAknFepManager;
       
    39 class CAknFepCaseManager;
       
    40 enum TKeyResponse;
       
    41 enum TKeyPressLength;
       
    42 
       
    43 class CAknFepHashKeyManager : public CBase
       
    44     {
       
    45 public:
       
    46     enum THashKeyStyle
       
    47         {
       
    48         EHashKeyStyleWestern,
       
    49         EHashKeyStyleChineseWithWestern,
       
    50         EHashKeyStyleJapanese,
       
    51         EHashKeyStyleKoreanWithWestern
       
    52         };
       
    53 
       
    54 public:
       
    55     static CAknFepHashKeyManager* NewL(CAknFepManager& aFepMan, CAknFepCaseManager* aCaseMan);
       
    56     ~CAknFepHashKeyManager();
       
    57     TKeyResponse HandleKeyEventL(TKeyPressLength aLength); 
       
    58     void SetMode(TInt aMode, TBool aWesternPredictive);
       
    59 
       
    60     /**
       
    61     * Changes the hash key functionality.
       
    62     */
       
    63     void SetHashKeyStyle(THashKeyStyle aHashKeyStyle);
       
    64 
       
    65     /**
       
    66     * Cancels the hash key timer.
       
    67     */
       
    68     void CancelHashKeyTimer();
       
    69     
       
    70     inline void ClearSelectionModeHashKeyLoop();
       
    71     
       
    72 	void SetPreviousSelectionStyleModeL();        
       
    73 	 /**
       
    74      * To Handle the Indic Hash key Loop State
       
    75      * 
       
    76      * Set the New State or Mode based on the editor after Fep is configured from Editor
       
    77      * @since 3.2
       
    78      * @return nothing
       
    79      */ 	 
       
    80 	void ResetIndicHashKeyStateL();     
       
    81 
       
    82      /**
       
    83      * Reset the flag of previous selection
       
    84      *
       
    85      * @since 3.2
       
    86      * @return nothing
       
    87      */
       
    88     void ResetPreviousSelectionStyleMode();
       
    89 #ifdef RD_HINDI_PHONETIC_INPUT
       
    90    	 /**
       
    91      * To Handle SetIndicStateL method
       
    92      * 
       
    93      * helps in handling case changes
       
    94      * @since 5.0
       
    95      * @return nothing
       
    96      */ 	   
       
    97     void HandleSetIndicStateL();
       
    98 #endif
       
    99 
       
   100 private:
       
   101     CAknFepHashKeyManager(CAknFepManager& aFepMan, CAknFepCaseManager* aCaseMan);
       
   102     void ConstructL();
       
   103     static TInt HashKeyTimerTimeoutCallback(TAny* aObj);
       
   104     void HashKeyTimerTimeout();
       
   105 	TKeyResponse HandleKeyWesternSelectionStyleL(TKeyPressLength aLength);    
       
   106 	void SetSelectionStyleModeL();
       
   107 	 /**
       
   108      * To Handle Indic Hash key Loop
       
   109      * 
       
   110      * Set the New State or Mode based on the existing mode
       
   111      * @since 3.2
       
   112      * @return EKeyWasConsumed
       
   113      */  
       
   114 	TKeyResponse SetIndicStateL();
       
   115 	
       
   116 	 /**
       
   117      * To Handle Indic Hash key Loop
       
   118      * 
       
   119      * Change back to the Previous State or Mode 
       
   120      * @since 3.2
       
   121      * @return EKeyWasConsumed
       
   122      */  
       
   123 	TKeyResponse SetIndicPreviousStateL(); 
       
   124 	
       
   125 	 /**
       
   126      * To Handle Indic Hash key Loop
       
   127      * 
       
   128      * To verify if Indic hash key Loop is required.
       
   129      * @since 3.2
       
   130      * @return ETrue if Shared Interface input Language is Indic and given editor is not Latin-Only
       
   131      */ 
       
   132 	TBool IsIndicHashKeyStyleRequired();
       
   133  
       
   134 
       
   135 	/**
       
   136      * To Handle Indic Hash key Loop
       
   137      * 
       
   138      * Set the Style for the State 
       
   139      * @since 3.2
       
   140      * @return nothing
       
   141      */ 
       
   142 	void SetIndicSelectionStateL();
       
   143 	
       
   144 
       
   145 	/**
       
   146      * To Handle Indic Hash key Loop
       
   147      * 
       
   148      * Update the case information
       
   149      * @since 3.2
       
   150      * @return nothing
       
   151      */ 
       
   152 	void UpdateCaseForIndicHashLoop();
       
   153 
       
   154     /**
       
   155     * Reverts predictive text setting change. This method can be used
       
   156     * if short key press of hash key changed predictive text
       
   157     * setting in non-case supported languages and actually long key press
       
   158     * action was handled. Not used with Chinese languages.
       
   159     */
       
   160     void RevertPredictiveTextSettingChangeL();
       
   161 
       
   162     TKeyResponse HandleKeyWesternL(TKeyPressLength aLength);
       
   163     TKeyResponse HandleKeyWesternWithChineseL(TKeyPressLength aLength);
       
   164     TKeyResponse HandleKeyJapaneseL(TKeyPressLength aLength);
       
   165     TKeyResponse HandleLongKeypressJapaneseL();
       
   166     TKeyResponse HandleSortKeypressJapaneseL();
       
   167     TKeyResponse HandleKeyWesternWithKoreanL(TKeyPressLength aLength);
       
   168 
       
   169 private:
       
   170     THashKeyStyle iHashKeyStyle;
       
   171     TInt iMode;
       
   172     TBool iLastModeNumber;
       
   173 
       
   174     CPeriodic* iHashKeyTimer; //owned
       
   175     
       
   176     CAknFepManager& iFepMan; //not owned
       
   177     CAknFepCaseManager* iCaseMan;
       
   178     TBool iWesternPredictive;
       
   179     
       
   180     TInt iSelectionLoopIndex;
       
   181     TInt iIndicSelectionLoopIndex;
       
   182     TUint8 const * iSelectionLoop;
       
   183     TBool iLanguageChangedOrChangeFromNumberMode;
       
   184     TBool iIndicPredictiveState;
       
   185     TCursorSelection iPreviousIndicCursorPosition;
       
   186     TBool iPreviousSelection;       // used by Japanese
       
   187     };
       
   188 
       
   189 inline void CAknFepHashKeyManager::ClearSelectionModeHashKeyLoop()
       
   190 	{
       
   191 	iSelectionLoop = NULL;
       
   192 	iSelectionLoopIndex	= 0;
       
   193 	}
       
   194 
       
   195 #endif //_AKNFEP_HASHKEY_MANAGER_H__