fep/aknfep/inc/AknFepUiIndicInputManager.h
changeset 36 a7632c26d895
parent 35 0f326f2e628e
child 42 b3eaa440ab06
equal deleted inserted replaced
35:0f326f2e628e 36:a7632c26d895
     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:            Provides the TAknFepUiIndicInputManager definition.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 #ifndef __AKN_FEP_UI_INDIC_INPUT_MANAGER_H__
       
    29 #define __AKN_FEP_UI_INDIC_INPUT_MANAGER_H__
       
    30 
       
    31 #include "AknFepGlobalEnums.h"
       
    32 #include "AknFepUiIndicEnums.h"
       
    33 
       
    34 #include <e32const.h>
       
    35 #include <PtiEngine.h>
       
    36 #ifdef RD_HINDI_PHONETIC_INPUT	
       
    37 #include <PtiIndicDefs.h>
       
    38 #endif
       
    39 /**
       
    40 *  This class provides Helper methods for Indic Multitap class.
       
    41 *  @lib avkonfep.dll
       
    42 *  @since Series 60 3.1
       
    43 */
       
    44 
       
    45 class TAknFepUiIndicInputManager 
       
    46 	{
       
    47 	public:
       
    48 		
       
    49 		/**
       
    50 	    * This method validates the input key and returns a correct response code.
       
    51 	    * Depending on the code, the character is added. This method applies the rules of 
       
    52 	    * Language to the user Input. 
       
    53 	    *
       
    54 	    * @since 3.1M
       
    55 	    * @return TIndicInputResponse
       
    56 	    */
       
    57 		static	TIndicInputResponse ValidateInput(TInt  aKey, 
       
    58 												  TUint aPrevChar,
       
    59 												  TUint aCurrChar,
       
    60 												  TUint aNextChar, 
       
    61 												  TBool& aIsHalantAllowed,	
       
    62 												  TBool aIsStarKeyPressed, 
       
    63 												  TBool aIsKeyTimerExpired, 
       
    64 												  TPtiTextCase& aNewCase, 
       
    65 												  TKeyPressLength aLength,
       
    66 												  TLanguage aLanguage,
       
    67 												  TBool aIsRakarPresent = EFalse,
       
    68 												  TBool aIsZWSPresent = EFalse
       
    69 #ifdef RD_MARATHI
       
    70 												  , TBool aIsChandraAPresent = EFalse
       
    71 #endif // RD_MARATHI
       
    72 												  );
       
    73 		/**
       
    74 	    * Checks wheather Character is Empty. 
       
    75 	    * @since 3.1M
       
    76 	    * @return ETrue if the  character is not present else EFalse
       
    77 	    */										  
       
    78 		static TBool IsCharEmpty(TUint aChar, TLanguage aLanguage);	
       
    79 		/**
       
    80 	    * Checks wheather Character is Other. Space is not supposed to be Other character.
       
    81 	    * @since 3.1M
       
    82 	    * @return ETrue if the  character is any other character that doesn’t belong to Hindi (like digits) based on the given language else EFalse
       
    83 	    */
       
    84 		static TBool IsCharOther(TUint aChar, TLanguage aLanguage);
       
    85 		/**
       
    86 	    * Checks wheather Character is Base consonant.
       
    87 	    * @since 3.1M
       
    88 	    * @return ETrue if the  character is a base consonant based on 
       
    89 	    * the given language else Efalse
       
    90 	    */
       
    91 		static TBool IsCharBaseConsonant(TUint aChar, TLanguage aLanguage);
       
    92 		/**
       
    93 	    * 
       
    94 	    * Checks wheather Character is Nukta.
       
    95 	    * @since 3.1M
       
    96 	    * @return ETrue if the  character is a Nukta based on the 
       
    97 	    * given language else Efalse
       
    98 	    */
       
    99 		static TBool IsCharNukta(TUint aChar, TLanguage aLanguage);
       
   100 		/**
       
   101 	    * 
       
   102 	    * Checks wheather Character is Matra.
       
   103 	    * @since 3.1M
       
   104 	    * @return ETrue if the  character is a matra based on the 
       
   105 	    * given language else EFalse
       
   106 	    */
       
   107 		static TBool IsCharMatra(TUint aChar,  TLanguage aLanguage);
       
   108 		/**
       
   109 	    * 
       
   110 	    * Checks wheather Character is Vowel.
       
   111 	    * @since 3.1M
       
   112 	    * @return ETrue if the  character is an vowel based on the 
       
   113 	    * given language else EFalse
       
   114 	    */
       
   115 		static TBool IsCharAnVowel(TUint aChar, TLanguage aLanguage);
       
   116 		/**
       
   117 	    * 
       
   118 	    * Checks wheather Character is Modifier.
       
   119 	    * @since 3.1M
       
   120 	    * @return ETrue if the  character is an modifier based on the 
       
   121 	    * given language else EFalse
       
   122 	    */
       
   123 		static TBool IsCharModifier(TUint aChar, TLanguage aLanguage);
       
   124 		/**
       
   125 	    * 
       
   126 	    * Checks wheather Character is Virama.
       
   127 	    * @since 3.1M
       
   128 	    * @return ETrue if Character is virama.
       
   129 	    */
       
   130 		static TBool IsCharVirama(TUint aChar, TLanguage aLanguage);
       
   131 		/**
       
   132 	    * 
       
   133 	    * Checks wheather Character is Space.
       
   134 	    * @since 3.1M
       
   135 	    * @return ETrue if Character is Space.
       
   136 	    */
       
   137 		static TBool IsCharSpace(TUint aChar);
       
   138 		/**
       
   139 	    * 
       
   140 	    * Checks wheather it is possilble to enter Virama (Halant) as per the language rule.
       
   141 	    * @since 3.1M
       
   142 	    * @return
       
   143 	    */
       
   144 		static void SetHalantOrMatraAllowed(TUint aPrevChar,TBool& aViramaAllowed,
       
   145                                         TBool aIsKeyTimerExpired,TLanguage aLanguage);
       
   146 		/**
       
   147 	    * 
       
   148 	    * Returns the virama character depending on the input language.	
       
   149 	    * @since 3.1M
       
   150 	    * @return Virama character for the langiage aLanguage
       
   151 	    */
       
   152 		static TUint Virama(TLanguage aLanguage);
       
   153 		/**
       
   154 	    * 
       
   155 	    * Returns the True if the language is an Indic Language.	
       
   156 	    * @since 3.1M
       
   157 	    * @param aInputLanguage current input language
       
   158 	    *  param aUiLanguage current UI language
       
   159 	    * @return True for Indic language.
       
   160 	    */
       
   161 		static TBool IsIndicLangauge(TLanguage aInputLanguage);
       
   162 		/**
       
   163 	    * 
       
   164 	    * Returns the True if the language supports Indic Digits.	
       
   165 	    * @since 3.1M
       
   166 	    * @param aInputLanguage current input language
       
   167 	    *  param aUiLanguage current UI language
       
   168 	    *
       
   169 	    * @return True for digit support.
       
   170 	    */
       
   171 		static TBool IsIndicDigitsSupported(TLanguage aInputLanguage);
       
   172 
       
   173 	    /**
       
   174 		 * Handles the logic of Indic Repha input. This function first checks
       
   175 		 * the validity of the inputted Repha and then allows it to be entered
       
   176 		 *
       
   177 		 * @since 3.2
       
   178 		 * @param aChar The characer to be checked.
       
   179 		 * @param aLanguage The input language
       
   180 		 * @return ETrue if the character is allowed as governed by the rules 
       
   181 		 * of the language else EFalse.
       
   182 		 */
       
   183 		static TBool IsRephaAllowed( TUint aChar, TLanguage aLanguage );
       
   184 		
       
   185 		/**
       
   186 		 * This function checks whether the character is Repha (U0971).
       
   187 		 *
       
   188 		 * @since 3.2
       
   189 		 * @param aChar The character to be checked.
       
   190 		 * @param aLanguage The input language
       
   191 		 * @return ETrue if the  character is repha else returns EFalse
       
   192 		 */			
       
   193 		static TBool IsCharRepha( TUint aChar, TLanguage aLanguage );		
       
   194 		
       
   195 		/**
       
   196 		 * This function returns the Ra character for the language specified.
       
   197 		 *
       
   198 		 * @since 3.2
       
   199 		 * @param aLanguage The input language
       
   200 		 * @return TUint The ra character.
       
   201 		 */
       
   202 		static TUint RaCharacter( TLanguage aLanguage );
       
   203 		
       
   204 		/**
       
   205 		 * This function populates the Repha character into aRepha parameter.
       
   206 		 *
       
   207 		 * @since 3.2
       
   208 		 * @param aRepha A descriptor in which Repha is stored.
       
   209 		 * @param aLanguage The input language
       
   210 		 * @return void
       
   211 		 */		
       
   212 		static void GetRepha( TDes& aRepha, TLanguage aLanguage );
       
   213 		
       
   214 		/**
       
   215 		 * This function checks whether the character is Rakar (U0972).
       
   216 		 *
       
   217 		 * @since 3.2
       
   218 		 * @param aChar The character to be checked.
       
   219 		 * @param aLanguage The input language
       
   220 		 * @return ETrue if the  character is Rakar else returns EFalse
       
   221 		 */			
       
   222 		static TBool IsCharRakar( TUint aChar, TLanguage aLanguage );
       
   223 		
       
   224 		/**
       
   225 		 * This function populates the Rakar character into aRakar parameter.
       
   226 		 *
       
   227 		 * @since 3.2
       
   228 		 * @param aRakar A descriptor in which Rakar is stored.
       
   229 		 * @param aLanguage The input language
       
   230 		 * @return void
       
   231 		 */
       
   232 		static void GetRakar( TDes& aRakar, TLanguage aLanguage );
       
   233 
       
   234 		/**
       
   235 		 * This function populates the ligature into the buffer 
       
   236 		 * depending on the current input character.
       
   237 		 *
       
   238 		 * @since 3.2
       
   239 		 * @param aLigature A descriptor in which the ligature is stored.
       
   240 		 * @param aCurrChar The current character from the key map.
       
   241 		 * @param aLanguage The input language
       
   242 		 * @return void
       
   243 		 */
       
   244 		static void GetLigature( TDes& aLigature, 
       
   245 								TUint aCurrChar, 
       
   246 								TLanguage aLanguage );
       
   247 
       
   248 		/**
       
   249 		 * This function checks whether the character is a special ligature.
       
   250 		 *
       
   251 		 * @since 3.2
       
   252 		 * @param aChar The character to be checked.
       
   253 		 * @param aLanguage The input language
       
   254 		 * @return ETrue if the  character is a special ligature else EFalse.
       
   255 		 */
       
   256 		static TBool IsCharLigature( TUint aChar, TLanguage aLanguage );
       
   257 
       
   258 		/**
       
   259 		 * This function checks if entry of modifier is allowed.
       
   260 		 *
       
   261 		 * @since 3.2
       
   262 		 * @param aPrevChar The previous character.
       
   263 		 * @param aIsKeyTimerExpired. Indicates if the multitap timer is alive
       
   264 		 * @param aLanguage. The input language.
       
   265 		 * @return void
       
   266 		 */
       
   267 		 static TBool IsModifierAllowed( TUint aPrevChar, 
       
   268 		 								TLanguage aLanguage );
       
   269 
       
   270 	   /**
       
   271 	    * 
       
   272 	    * Checks if the character is the first ligature.
       
   273 	    * @since 3.2M
       
   274 	    * @return ETrue if Character is the first ligature.
       
   275 	    */
       
   276 		static TBool IsCharAtStartOfLigature(TUint aChar, 
       
   277 											TLanguage aLanguage);
       
   278 #ifdef RD_HINDI_PHONETIC_INPUT	
       
   279 		/**
       
   280 	    * 
       
   281 	    * Returns the True if the language is Phonetic Language.	
       
   282 	    * @since 3.1M
       
   283 	    * @param aInputLanguage current input language
       
   284 	    *  param aUiLanguage current UI language
       
   285 	    *
       
   286 	    * @return True if language is Phonetic.
       
   287 	    */
       
   288 		static TBool IsIndicPhoneticLanguage(TLanguage aInputLanguage);
       
   289 	    /** @since 3.1M
       
   290 	    * @param aInputLanguage current input language
       
   291 	    *  param aChar Indic Character
       
   292 	    *
       
   293 	    * @returns Key associated with char.
       
   294 	    */
       
   295 		static TInt MapCharacterToKeys(TUint aChar, TLanguage aLanguage);
       
   296 #endif
       
   297 
       
   298 		/**
       
   299 		 * This function checks whether the script is Devanagari
       
   300 		 *
       
   301 		 * @since 5.0
       
   302 		 * @param aLanguage The input language
       
   303 		 * @return ETrue if the  script is Devanagari,
       
   304 		 * 		   else returns EFalse
       
   305 		 */
       
   306 		static TBool IsScriptDevanagari( TLanguage aInputLanguage );
       
   307 
       
   308         /**
       
   309 		 * This function checks the response code. AknFepManager calls
       
   310 		 * this method with the response code to know if the CommitInlineEditL
       
   311 		 * needs to be invoked.
       
   312 		 *
       
   313 		 * @since 5.0
       
   314 		 * @param aResponse The Current response code.
       
   315 		 * @return ETrue if the inline text is to be committed
       
   316 		 * 		   else returns EFalse
       
   317 		 */
       
   318 		static TBool IsToCommitCharSeq( TIndicInputResponse aResponse );
       
   319 
       
   320 		/**
       
   321 		 * This function checks whether the character is a Nukta Consonant.
       
   322 		 *
       
   323 		 * @since 5.0
       
   324 		 * @param aChar The character to be checked.
       
   325 		 * @param aLanguage The input language
       
   326 		 * @return ETrue if the  character is a Nukta Consonant,
       
   327 		 * 		   else returns EFalse
       
   328 		 */
       
   329 		static TBool IsCharNuktaConsonant( TUint aChar, TLanguage aLanguage );
       
   330     
       
   331 #ifdef RD_MARATHI
       
   332 		/**
       
   333 		 * This function checks whether the character is Eye Lash Ra (U0977).
       
   334 		 *
       
   335 		 * @since 5.0
       
   336 		 * @param aChar The character to be checked.
       
   337 		 * @param aLanguage The input language
       
   338 		 * @return ETrue if the  character is Eye Lash Ra, else returns EFalse
       
   339 		 */
       
   340 		static TBool IsCharEyeLashRa( TUint aChar, TLanguage aLanguage );
       
   341 
       
   342 		/**
       
   343 		 * This function populates the Eye Lash Ra character into 
       
   344 		 * aEyeLashRa parameter. (0x0931+0x094D+0x200D)
       
   345 		 *
       
   346 		 * @since 5.0
       
   347 		 * @param aEyeLashRa A descriptor in which Eye Lash Ra is stored.
       
   348 		 * @param aLanguage The input language
       
   349 		 * @return void
       
   350 		 */
       
   351 		static void GetEyeLashRa( TDes& aEyeLashRa, 
       
   352 									TLanguage aLanguage );
       
   353 
       
   354 		/**
       
   355 		 * This function checks whether the character is a Chandra A (0x0978).
       
   356 		 *
       
   357 		 * @since 5.0
       
   358 		 * @param aChar The character to be checked.
       
   359 		 * @return ETrue if the  character is a Chandra A,
       
   360 		 * 		   else returns EFalse
       
   361 		 */
       
   362 		static TBool IsCharChandraA( TUint aChar );
       
   363 
       
   364 		/**
       
   365 		 * This function populates the Chandra A character into 
       
   366 		 * aChandraA parameter. (0x0905+0x0945)
       
   367 		 *
       
   368 		 * @since 5.0
       
   369 		 * @param aChandraA A descriptor in which Chandra A is stored.
       
   370 		 * @param aIsToGetSingleUnicodeValue. If ETrue, return 0x0978
       
   371 		 * @return void
       
   372 		 */
       
   373 		static void GetChandraA( TDes& aChandraA, 
       
   374 								TBool aIsToGetSingleUnicodeValue = EFalse );
       
   375 #endif // RD_MARATHI
       
   376 #ifndef RD_INTELLIGENT_TEXT_INPUT
       
   377 		/**
       
   378 	    * 
       
   379 	    * Returns True if aChar is a mathra( Dependant vowel), Modifier or Virama.
       
   380 	    * @since 5.0
       
   381 	    */		
       
   382 		static TBool IsIndicDependantCharacter(TUint aChar, TLanguage aLanguage);
       
   383 #endif	// RD_INTELLIGENT_TEXT_INPUT
       
   384 
       
   385 	}; //__AKN_FEP_UI_INDIC_INPUT_MANAGER_H__
       
   386 	
       
   387 #endif	
       
   388 
       
   389 //End of File