fep/aknfep/src/AknFepUiManagerWestern.cpp
changeset 36 a7632c26d895
parent 35 0f326f2e628e
child 42 b3eaa440ab06
equal deleted inserted replaced
35:0f326f2e628e 36:a7632c26d895
     1 /*
       
     2 * Copyright (c) 2003-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 CAknFepUIManagerWestern methods.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 
       
    30 // INCLUDE FILES
       
    31 #include <e32svr.h> // RDebug stuff...
       
    32 #include <e32keys.h>
       
    33 #include <AknsUtils.h>
       
    34 
       
    35 #include "AknFepGlobalEnums.h"
       
    36 #include "AknFepManagerUIInterface.h"
       
    37 #include "AknFepManagerInterface.h"
       
    38 #include "AknFepUIManagerStateInterface.h"
       
    39 #include "AknFepUiManagerBase.h"
       
    40 #include "AknFepUiManagerWestern.h"
       
    41 
       
    42 // Western input
       
    43 #include "AknFepUiInputStateInitialLatinMultitap.h"
       
    44 #include "AknFepUiInputStateInitialNumber.h"
       
    45 #include "AknFepUiInputStateInitialWesternPredictive.h"
       
    46 #include "AknFepUiInputStateEntryWesternPredictive.h"
       
    47 #include "AknFepUiInputStateInitialHalfQwertyWesternPredictive.h"
       
    48 #include "AknFepUiInputStateEntryHalfQwertyWesternPredictive.h"
       
    49 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
    50 // Predictive QWERTY changes ---->
       
    51 #include "AknFepUiInputStateInitialQwertyWesternPredictive.h"
       
    52 #include "AknFepUiInputStateEntryQwertyWesternPredictive.h"
       
    53 // Predictive QWERTY changes <----
       
    54 #endif //RD_INTELLIGENT_TEXT_INPUT
       
    55 #include "AknFepPluginManager.h"
       
    56 
       
    57 // Arabic & Hebrew input
       
    58 #include "AknFepUiInputStateInitialArabicHebrewMultitap.h"
       
    59 #include "AknFepUiInputStateInitialArabicHebrewPredictive.h"
       
    60 #include "AknFepUiInputStateEntryArabicHebrewPredictive.h"
       
    61 
       
    62 // Thai input
       
    63 #include "AknFepUIInputStateInitialThaiMultitap.h"
       
    64 #include "AknFepUiInputStateInitialThaiPredictive.h"
       
    65 #include "AknFepUiInputStateEntryThaiPredictive.h"
       
    66 
       
    67 #include "AknFepThaiSCTSelector.h"
       
    68 
       
    69 //Hindi Input
       
    70 #include "AknFepUIInputStateInitialIndicMultitap.h"
       
    71 #include "AknFepUiInputStateInitialIndicPredictive.h"
       
    72 #include "AknFepUiInputStateEntryIndicPredictive.h"
       
    73 #include "AknFepUiIndicInputManager.h"
       
    74 
       
    75 // Qwerty input
       
    76 #include "AknFepUiInputStateQwerty.h"
       
    77 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
    78 #include "AknFepUiInputStateHalfQwerty.h"
       
    79 #endif
       
    80 
       
    81 #ifdef RD_HINDI_PHONETIC_INPUT	
       
    82 #include "aknfepuiinputstateinitialindicphoneticmultitap.h"
       
    83 #include "aknfepuiinputstateindicphoneticqwerty.h"
       
    84 #endif
       
    85 // Vietnamese input
       
    86 #include "AknFepUIInputStateInitialVietnameseMultitap.h"
       
    87 #include "AknFepVietnameseToneManager.h"
       
    88 #include "AknFepUiInputStateEntryVietnamesePredictive.h"
       
    89 #include "AknFepCaseManager.h"
       
    90 #include "AknFepPanic.h"
       
    91 
       
    92 // Japanese input
       
    93 #include "AknFepUiInputStateEntryWesternPredictiveJp.h"
       
    94 
       
    95 #include <AknIndicatorContainer.h>  // CAknIndicatorContainer::TIndicatorContext
       
    96 #include <PtiEngine.h> 
       
    97 #include <PtiDefs.h>
       
    98 #include <PtiUserDicEntry.h>
       
    99 #include <aknfep.rsg>
       
   100 // CONSTANTS
       
   101 
       
   102 /**
       
   103  *  CAknFepUIManagerWestern class.
       
   104  * 
       
   105  */
       
   106 
       
   107 //============================ MEMBER FUNCTIONS ==============================
       
   108 
       
   109 
       
   110 // ---------------------------------------------------------------------------
       
   111 // CAknFepUIManagerWestern::NewL
       
   112 // 
       
   113 // 
       
   114 // ---------------------------------------------------------------------------
       
   115 //
       
   116 CAknFepUIManagerWestern* CAknFepUIManagerWestern::NewL(MAknFepManagerUIInterface* aFepMan, 
       
   117                                                        CAknFepCaseManager* aCaseMan, 
       
   118                                                        TLanguage aLanguage)
       
   119     {   
       
   120     CAknFepUIManagerWestern* self = new(ELeave)CAknFepUIManagerWestern(aFepMan, aCaseMan);
       
   121     CleanupStack::PushL(self);
       
   122     self->ConstructL(aLanguage);
       
   123     CleanupStack::Pop();
       
   124     return self;
       
   125     }
       
   126 
       
   127 // ---------------------------------------------------------------------------
       
   128 // CAknFepUIManagerWestern::~CAknFepUIManagerWestern
       
   129 // 
       
   130 // 
       
   131 // ---------------------------------------------------------------------------
       
   132 //
       
   133 CAknFepUIManagerWestern::~CAknFepUIManagerWestern()
       
   134     {
       
   135     delete iAknFepThaiSCTSelector;
       
   136     delete iVietToneMarkMgr;
       
   137     }
       
   138 
       
   139 // ---------------------------------------------------------------------------
       
   140 // CAknFepUIManagerWestern::HandleKeyL
       
   141 // 
       
   142 // 
       
   143 // ---------------------------------------------------------------------------
       
   144 //
       
   145 TBool CAknFepUIManagerWestern::HandleKeyL( TInt aKey, TKeyPressLength aLength, 
       
   146 		                                   TEventCode /*aEventCode*/ )
       
   147     {
       
   148 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   149     // The implementation is anyway identical with the base class, so we can
       
   150     // as well call the base implementation.
       
   151     return CAknFepUIManagerBase::HandleKeyL(aKey, aLength);
       
   152 #else    
       
   153     TUIState currentState = iFepUiState.State();
       
   154     if (aLength == EShortKeyPress)
       
   155         {
       
   156         iInitialFepUIState = currentState;
       
   157         }
       
   158 
       
   159     if(!iStatePtr->HandleKeyL(aKey, aLength))
       
   160         {
       
   161         if(currentState != iStatePtr->State()) //Check to see if we've changed state.
       
   162             {
       
   163             return iStatePtr->HandleKeyL(aKey, aLength);
       
   164             }
       
   165         return EFalse; // we've failed to handle it..
       
   166         }
       
   167     return ETrue; //we're ok.
       
   168 #endif // RD_INTELLIGENT_TEXT_INPUT  
       
   169     }
       
   170 
       
   171 // ---------------------------------------------------------------------------
       
   172 // CAknFepUIManagerWestern::CloseUI
       
   173 // 
       
   174 // 
       
   175 // ---------------------------------------------------------------------------
       
   176 //
       
   177 void CAknFepUIManagerWestern::CloseUI()
       
   178     {
       
   179     ChangeState(EInitial);
       
   180     }
       
   181 
       
   182 
       
   183 // ---------------------------------------------------------------------------
       
   184 // CAknFepUIManagerWestern::AddTextToUserDictionaryL
       
   185 // 
       
   186 // 
       
   187 // ---------------------------------------------------------------------------
       
   188 //
       
   189 void CAknFepUIManagerWestern::AddTextToUserDictionaryL(const TDesC& aText)
       
   190     {
       
   191     HBufC* udbTextBuf = HBufC::NewLC(CAknFepManager::EMaximumFepWordLength); // buffer for text
       
   192     TPtr udbText=udbTextBuf->Des();
       
   193     TChar ch;
       
   194 
       
   195     TInt textLengthToAdd = Min((TInt)CAknFepManager::EMaximumFepWordLength, aText.Length());
       
   196 
       
   197     for (TInt ii=0; ii < textLengthToAdd; ii++)
       
   198         {
       
   199         ch = STATIC_CAST(TChar, aText[ii]);
       
   200         udbText.Append(ch);
       
   201         if (ch.IsSpace() || ii == textLengthToAdd-1)
       
   202             {
       
   203             if (ch.IsSpace())
       
   204                 {
       
   205                 udbText.Delete(udbText.Length()-1, CAknFepManager::ESingleCharacter);
       
   206                 }
       
   207             if (udbText.Length())
       
   208                 {
       
   209                 // add the contents of udbText to the user dictionary.
       
   210                 CPtiEngine* ptiengine = PtiEngine();
       
   211                 TPtiUserDictionaryEntry newUdbEntry(udbText);
       
   212                 TPtiEngineInputMode currentInputMode = ptiengine->InputMode();
       
   213                 // PtiEngine needs to be in predictive mode when the word is added to UDB.
       
   214 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   215                 if(iQwertyInputMode)
       
   216 	                {
       
   217 #ifdef __HALF_QWERTY_KEYPAD	              
       
   218                 	if( EPtiKeyboardHalfQwerty == iFepMan->KeyboardLayout())
       
   219                 		{
       
   220                 		ptiengine->SetInputMode( EPtiEngineHalfQwertyPredictive );
       
   221                 		}
       
   222                 	else	
       
   223 #endif //__HALF_QWERTY_KEYPAD                	
       
   224 						{
       
   225 						ptiengine->SetInputMode(EPtiEngineQwertyPredictive );	
       
   226 						}
       
   227 	                } 	                
       
   228                 else
       
   229 #endif //RD_INTELLIGENT_TEXT_INPUT
       
   230 	                {
       
   231 					ptiengine->SetInputMode(EPtiEnginePredictive);	                	
       
   232 	                }
       
   233                 ptiengine->AddUserDictionaryEntry(newUdbEntry);
       
   234                 ptiengine->SetInputMode(currentInputMode);
       
   235                 }
       
   236             udbText.Zero();
       
   237             }
       
   238         }
       
   239     CleanupStack::PopAndDestroy();  // udbTextBuf
       
   240     }
       
   241 
       
   242 // ---------------------------------------------------------------------------
       
   243 // CAknFepUIManagerWestern::GetFormatOfFepInlineText
       
   244 // 
       
   245 // 
       
   246 // ---------------------------------------------------------------------------
       
   247 //
       
   248 void CAknFepUIManagerWestern::GetFormatOfFepInlineText(TCharFormat& aFormat, 
       
   249                                                        TInt& aNumberOfCharactersWithSameFormat, 
       
   250                                                        TInt aPositionOfCharacter) const
       
   251     {
       
   252     if ( (iPredictive && iFepUiState.State() == EEntry ) 
       
   253 #ifdef RD_HINDI_PHONETIC_INPUT    
       
   254 //adding condition to underline uncommitted text for hindi phonetic
       
   255     	  || TAknFepUiIndicInputManager :: IsIndicPhoneticLanguage( ( TLanguage )iLanguage )
       
   256 #endif
       
   257        )   // EInitial???
       
   258         {
       
   259         aFormat.iFontPresentation.iUnderline = EUnderlineOn;
       
   260         if (iFepMan->IsFlagSet(CAknFepManager::EFlagNoMatches))
       
   261             {
       
   262             aFormat.iFontPresentation.iHighlightStyle = 
       
   263                                              TFontPresentation::EFontHighlightNoMatchesIndicator;
       
   264             }
       
   265         TCursorSelection uncommit = iFepMan->UncommittedText();
       
   266         TInt lengthOfRemainderOfInlineText = uncommit.Length()-aPositionOfCharacter;
       
   267 #ifndef RD_INTELLIGENT_TEXT_INPUT
       
   268         if(iFepMan->IsAutoCompleteOn())
       
   269         	{
       
   270         	// For AutoWord Completion - the suggested completion has to be gray slated
       
   271         	CPtiEngine* ptiengine = PtiEngine();
       
   272         	TInt actualLength = (ptiengine->CurrentInputSequence()).Length();
       
   273         
       
   274 	        if(lengthOfRemainderOfInlineText>0)
       
   275 		        {   
       
   276       		    if(actualLength < lengthOfRemainderOfInlineText)
       
   277 			        {
       
   278 			        if(iLanguage == ELangHindi)
       
   279 			        	{
       
   280 			        	TBuf<CAknFepManager::EMaximumFepWordLength> currentWord(ptiengine->CurrentWord());	//
       
   281 			        // AutoComplete - Fix - Begin
       
   282 			        	if(actualLength < currentWord.Length())
       
   283 			        		{
       
   284 			        		TUint currentchar = TUint(currentWord[actualLength]);
       
   285 			    			while((TAknFepUiIndicInputManager::IsIndicDependantCharacter(currentchar, iLanguage)))
       
   286 				    			{
       
   287 				    			actualLength++;
       
   288 				    			if(!(actualLength < currentWord.Length()))
       
   289 				    			break;
       
   290 				    			currentchar = TUint(currentWord[actualLength]);
       
   291 				    			}
       
   292 	        		// AutoComplete - Fix - Begin			        	
       
   293 				    		}
       
   294 			        	}
       
   295 			        }
       
   296         
       
   297 		        if (aPositionOfCharacter<actualLength && (lengthOfRemainderOfInlineText>0))
       
   298 			        {
       
   299 			        aFormat.iFontPresentation.iUnderline = EUnderlineOn;
       
   300 			        aNumberOfCharactersWithSameFormat = actualLength;
       
   301 			        }
       
   302 				else
       
   303 			        {	
       
   304 			        // Display the autocompleted text in gray colour
       
   305 			        TRgb autoTextColor; 
       
   306 			        MAknsSkinInstance *skin = AknsUtils::SkinInstance();
       
   307 			        TInt err = AknsUtils::GetCachedColor( skin, autoTextColor, KAknsIIDQsnTextColors, 
       
   308                                                     EAknsCIQsnTextColorsCG64 );
       
   309 			        if (!err)
       
   310 			            {
       
   311 			            aFormat.iFontPresentation.iTextColor = autoTextColor;
       
   312 			            }
       
   313 			        else
       
   314 			            {
       
   315 			            // In case of error occurs, display text in hardcoded slate gray color
       
   316 			            aFormat.iFontPresentation.iTextColor = KSLATEGRAY; 			            
       
   317 			            }
       
   318 			            			        
       
   319 			        aNumberOfCharactersWithSameFormat=lengthOfRemainderOfInlineText;
       
   320 			       	}
       
   321 	            }
       
   322 	        }
       
   323         else
       
   324 #endif
       
   325 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   326 // Predictive QWERTY (XT9) changes ---->
       
   327         TInt wordLength = uncommit.Length();
       
   328         if ( lengthOfRemainderOfInlineText > 0 )
       
   329            {
       
   330             TInt tailLength = 0;
       
   331             //TInt err = PtiEngine()->HandleCommandL( EPtiCommandGetAutoCompletionTailLength, &tailLength );
       
   332             TRAP_IGNORE( PtiEngine()->HandleCommandL( 
       
   333             									EPtiCommandGetAutoCompletionTailLength,
       
   334             									&tailLength ));
       
   335 
       
   336             if ( aPositionOfCharacter < wordLength-tailLength )
       
   337     	        {
       
   338     			aFormat.iFontPresentation.iUnderline = EUnderlineOn;
       
   339     			aNumberOfCharactersWithSameFormat = lengthOfRemainderOfInlineText-tailLength;
       
   340                 }
       
   341             else
       
   342                 {
       
   343                 aFormat.iFontPresentation.iUnderline = EUnderlineOff;
       
   344                 aFormat.iFontPresentation.iTextColor = KSLATEGRAY;
       
   345 	            aNumberOfCharactersWithSameFormat=lengthOfRemainderOfInlineText;
       
   346 	            }
       
   347             }
       
   348 #else
       
   349 #ifdef RD_HINDI_PHONETIC_INPUT
       
   350 			//for phonetic, space character needs to be checked explicitly so that it is not underlined
       
   351 			//for predictive when space is entered it gets committed and changes to initial state, hence check is not present
       
   352              if(TAknFepUiIndicInputManager :: IsIndicPhoneticLanguage( ( TLanguage )iLanguage )	)
       
   353              	{
       
   354              		TChar tempChar(0);
       
   355              		iFepUiState.GetPhoneticLatinChar(tempChar);
       
   356              		if(tempChar.IsSpace())
       
   357              		    aFormat.iFontPresentation.iUnderline = EUnderlineOff;
       
   358 	            }	
       
   359 	#else
       
   360         	if (lengthOfRemainderOfInlineText>0)                   
       
   361 	            {
       
   362 	            aFormat.iFontPresentation.iUnderline = EUnderlineOn;
       
   363 	            aNumberOfCharactersWithSameFormat=lengthOfRemainderOfInlineText;
       
   364 		            }	
       
   365 	#endif	            
       
   366 // Predictive QWERTY (XT9) changes <----
       
   367 #endif //RD_INTELLIGENT_TEXT_INPUT
       
   368             }
       
   369         }
       
   370 
       
   371 
       
   372 // ---------------------------------------------------------------------------
       
   373 // CAknFepUIManagerWestern::SupportLanguage
       
   374 // 
       
   375 // 
       
   376 // ---------------------------------------------------------------------------
       
   377 //
       
   378 TInt CAknFepUIManagerWestern::SupportLanguage(TInt aMode) const
       
   379     {
       
   380     TInt lang = iLanguage;
       
   381     switch (aMode)
       
   382         {
       
   383         case ELatin:
       
   384             {
       
   385             if ( iLanguage == ELangTaiwanChinese ||
       
   386                  iLanguage == ELangHongKongChinese ||
       
   387                  iLanguage == ELangPrcChinese ||
       
   388                  iLanguage == ELangJapanese || 
       
   389                  iLanguage == ELangHindi )
       
   390                 {
       
   391                 // Chinese and Japanese languages uses always English as a latin language.
       
   392                 lang = ELangEnglish;
       
   393                 }
       
   394             else
       
   395                 {
       
   396                 lang = iLanguage;
       
   397                 }
       
   398             }
       
   399             break;
       
   400         case ENumber:
       
   401             {
       
   402             if ( iLanguage == ELangJapanese )
       
   403                 {
       
   404                 // Japanese languages uses always English as a number language for qwerty.
       
   405                 lang = ELangEnglish;
       
   406                 }
       
   407             else
       
   408                 {
       
   409                 lang = iLanguage;
       
   410                 }
       
   411             }
       
   412             break;
       
   413         case EHindi:
       
   414         case ENativeNumber:
       
   415             lang = iLanguage;
       
   416             break;
       
   417         
       
   418             
       
   419         default:
       
   420             break;
       
   421         }
       
   422     return lang;
       
   423     }
       
   424 
       
   425 // ---------------------------------------------------------------------------
       
   426 // CAknFepUIManagerWestern::ActivateUI
       
   427 // 
       
   428 // 
       
   429 // ---------------------------------------------------------------------------
       
   430 //
       
   431 void CAknFepUIManagerWestern::ActivateUI()
       
   432     {
       
   433     ChangeState(EEntry);
       
   434     }
       
   435 
       
   436 // ---------------------------------------------------------------------------
       
   437 // CAknFepUIManagerWestern::ChangeState
       
   438 // 
       
   439 // 
       
   440 // ---------------------------------------------------------------------------
       
   441 // MAknFepUIManagerStateInterface
       
   442 TUIState CAknFepUIManagerWestern::ChangeState(TUIState aState)
       
   443     {
       
   444 #ifdef RD_SCALABLE_UI_V2    
       
   445     if (iFepMan->PluginUIManager() &&
       
   446         iFepMan->PluginUIManager()->IsMatchState() && 
       
   447         !iFepMan->PluginUIManager()->IsSpellVisible())
       
   448         {
       
   449         //TRAP_IGNORE(iFepMan->UpdateCbaL(R_AKNFEP_SOFTKEYS_FINGER));
       
   450         iFepMan->PluginUIManager()->SetFingerMatchSelectionState(EFalse);
       
   451         }
       
   452         
       
   453     // For addition of ITI features on FSQ
       
   454     // When candidate list on FSQ is opened, some HW keys may cause state change,
       
   455     // e.g. left/right keys, need to hide candidate list
       
   456     if ( iFepMan->PluginUIManager() 
       
   457          && iFepMan->PluginUIManager()->EnableITIOnFSQ() )
       
   458         {
       
   459         TRAP_IGNORE( iFepMan->PluginUIManager()->HideCandidateListL() );
       
   460         }
       
   461     
       
   462 #endif //RD_SCALABLE_UI_V2
       
   463     switch(aState)
       
   464         {
       
   465         case EInitial:
       
   466             {
       
   467             switch(iMode)
       
   468                 {
       
   469                 case ELatin:
       
   470                     {
       
   471                     if (iPredictive)
       
   472                         {
       
   473 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   474                         // Predictive QWERTY (XT9) changes ---->
       
   475                         if (iQwertyInputMode)
       
   476                             {
       
   477 #ifdef __HALF_QWERTY_KEYPAD
       
   478                             if( EPtiKeyboardHalfQwerty == iFepMan->KeyboardLayout())
       
   479                                 {
       
   480                                 iFepUiState = TAknFepUiInputStateInitialHalfQwertyWesternPredictive( this );
       
   481                                 }
       
   482                             else
       
   483 #endif // Half Qwerty
       
   484                             iFepUiState = TAknFepInputStateInitialQwertyWesternPredictive(this);
       
   485                             } // Predictive QWERTY (XT9) changes <----
       
   486                         else 
       
   487 #endif // RD_INTELLIGENT_TEXT_INPUT
       
   488                         if (  iLanguage == ELangArabic || iLanguage == ELangHebrew 
       
   489                            || iLanguage == ELangFarsi  || iLanguage == ELangUrdu )
       
   490                             {
       
   491                             iFepUiState = TAknFepInputStateInitialArabicHebrewPredictive(this);
       
   492                             }
       
   493                         else if (iLanguage == ELangThai)
       
   494                             {
       
   495                             iFepUiState = TAknFepInputStateInitialThaiPredictive(this);
       
   496                             }
       
   497                         // Indic Script
       
   498                         else
       
   499                             {
       
   500                             iFepUiState = TAknFepInputStateInitialWesternPredictive(this);
       
   501                             }
       
   502                         }
       
   503                     else
       
   504                         {
       
   505                         if (  iLanguage == ELangArabic || iLanguage == ELangHebrew 
       
   506                            || iLanguage == ELangFarsi  || iLanguage == ELangUrdu )
       
   507                             {
       
   508                             iFepUiState = TAknFepInputStateInitialArabicHebrewMultitap(this);
       
   509                             }
       
   510                         else if (iLanguage == ELangThai)
       
   511                             {
       
   512                             iFepUiState = TAknFepInputStateInitialThaiMultitap(this);
       
   513                             }
       
   514                         /* Indic Script */
       
   515 
       
   516 #ifdef RD_HINDI_PHONETIC_INPUT	
       
   517         
       
   518                         else if(TAknFepUiIndicInputManager :: IsIndicPhoneticLanguage( 
       
   519                                                             ( TLanguage )iLanguage ) )
       
   520                         {
       
   521                         iFepUiState = TAknFepInputStateInitialIndicPhoneticMultitap(
       
   522                                                             this, KLangHindiPhonetic);	
       
   523                         }
       
   524 #endif    
       
   525                         else if(iLanguage == ELangVietnamese)
       
   526                             {
       
   527                             iFepUiState = TAknFepInputStateInitialVietnameseMultitap(this);
       
   528                             }
       
   529                         else
       
   530                             {
       
   531                             iFepUiState = TAknFepInputStateInitialLatinMultitap(this);
       
   532                             }
       
   533                         }
       
   534                     }
       
   535                     break;
       
   536                 case EHindi:
       
   537                     iFepUiState = TAknFepInputStateInitialIndicMultitap(this, iLanguage);
       
   538                     break;
       
   539                 case ENumber:
       
   540                 case ENativeNumber:
       
   541                     {
       
   542                     // Map directly to the resources...
       
   543                     iFepUiState = TAknFepInputStateInitialNumber(this);
       
   544                     break;
       
   545                     }
       
   546                 default:
       
   547                     AknFepPanic(EAknFepPanicBadInputState);
       
   548                 }
       
   549             break;
       
   550             }
       
   551         case EEntry:
       
   552             {
       
   553             switch(iMode)
       
   554                 {
       
   555                 case ELatin:
       
   556 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   557                         // Predictive QWERTY (XT9) changes ---->
       
   558                         if (iQwertyInputMode)
       
   559                             {
       
   560 #ifdef __HALF_QWERTY_KEYPAD
       
   561                             if( EPtiKeyboardHalfQwerty == iFepMan->KeyboardLayout())
       
   562                                 {
       
   563                                 iFepUiState = TAknFepUiInputStateEntryHalfQwertyWesternPredictive( this );
       
   564                                 }
       
   565                             else
       
   566 #endif // Half Qwerty
       
   567 	                        iFepUiState = TAknFepInputStateEntryQwertyWesternPredictive(this);
       
   568                             } // Predictive QWERTY (XT9) changes <----
       
   569                         else 
       
   570 #endif // RD_INTELLIGENT_TEXT_INPUT
       
   571                     if (  iLanguage == ELangArabic || iLanguage == ELangHebrew 
       
   572                        || iLanguage == ELangFarsi  || iLanguage == ELangUrdu)
       
   573                         {
       
   574                         iFepUiState = TAknFepInputStateEntryArabicHebrewPredictive(this);
       
   575                         }
       
   576                     else if (iLanguage == ELangThai)
       
   577                         {
       
   578                         iFepUiState = TAknFepInputStateEntryThaiPredictive(this);
       
   579                         }
       
   580 					/* Indic Script */
       
   581                     else if (iLanguage == ELangVietnamese)
       
   582                         {
       
   583                         iFepUiState = TAknFepInputStateEntryVietnamesePredictive(this);
       
   584                         }
       
   585                     else if (iLanguage == ELangJapanese)
       
   586                         {
       
   587                         iFepUiState = TAknFepInputStateEntryWesternPredictiveJp(this);
       
   588                         }
       
   589                     else
       
   590                         {
       
   591                         iFepUiState = TAknFepInputStateEntryWesternPredictive(this);
       
   592                         }
       
   593                     break;
       
   594                 case EHindi:
       
   595                     iFepUiState = TAknFepInputStateEntryIndicPredictive(this, iLanguage);
       
   596                     break;
       
   597                 default:
       
   598                     AknFepPanic(EAknFepPanicBadInputState);
       
   599                     break;
       
   600                 }
       
   601             }
       
   602             break;
       
   603         case EQwerty:
       
   604 #ifdef RD_HINDI_PHONETIC_INPUT	
       
   605         
       
   606         	if(iLanguage == KLangHindiPhonetic)
       
   607         		{
       
   608         		iFepUiState = TAknFepInputStateIndicPhoneticQwerty(this);	
       
   609         		}
       
   610         	else
       
   611         		{
       
   612 #endif
       
   613             iFepUiState = TAknFepInputStateQwerty(this);
       
   614 #ifdef RD_HINDI_PHONETIC_INPUT	
       
   615       
       
   616         		}
       
   617 #endif
       
   618             break;
       
   619 #ifdef RD_INTELLIGENT_TEXT_INPUT            
       
   620         case EHalfQwerty:
       
   621              iFepUiState = TAknFepInputStateHalfQwerty(this);        
       
   622              break;    
       
   623 #endif             
       
   624         case ECandidate:
       
   625             AknFepPanic(EAknFepPanicBadInputState);
       
   626             break;
       
   627         case EPredictiveCandidate:
       
   628             {
       
   629             AknFepPanic(EAknFepPanicBadInputState);
       
   630             }
       
   631             break;
       
   632         case EPredictiveInput:
       
   633             AknFepPanic(EAknFepPanicBadInputState);
       
   634             break;
       
   635         default:
       
   636             AknFepPanic(EAknFepPanicBadInputState);
       
   637         }
       
   638     
       
   639     iPtiEngine->SetObserver(&iFepUiState);
       
   640 #ifdef _DEBUG
       
   641     RDebug::Print(_L("UI Manager: New State: %d"), iFepUiState.State());
       
   642 #endif
       
   643     return iStatePtr->State();
       
   644     }
       
   645 
       
   646 // ---------------------------------------------------------------------------
       
   647 // CAknFepUIManagerWestern::ThaiSCTResourceId
       
   648 // 
       
   649 // 
       
   650 // ---------------------------------------------------------------------------
       
   651 //
       
   652 TInt CAknFepUIManagerWestern::ThaiSCTResourceId(TUint aPrewChar,TInt aKey)
       
   653     {
       
   654     TInt resourceId = 0;
       
   655     if (iAknFepThaiSCTSelector)
       
   656         {
       
   657         resourceId = iAknFepThaiSCTSelector->ThaiSCRResourceId(aPrewChar,aKey);
       
   658         }
       
   659     return resourceId;
       
   660     }
       
   661 
       
   662 // ---------------------------------------------------------------------------
       
   663 // CAknFepUIManagerWestern::VietnameseToneManager
       
   664 // 
       
   665 // 
       
   666 // ---------------------------------------------------------------------------
       
   667 //
       
   668 CAknFepVietnameseToneManager* CAknFepUIManagerWestern::VietnameseToneManager() const
       
   669     {
       
   670     return iVietToneMarkMgr;
       
   671     }
       
   672 
       
   673 // ---------------------------------------------------------------------------
       
   674 // CAknFepUIManagerWestern::CAknFepUIManagerWestern
       
   675 // 
       
   676 // 
       
   677 // ---------------------------------------------------------------------------
       
   678 //
       
   679 CAknFepUIManagerWestern::CAknFepUIManagerWestern(MAknFepManagerUIInterface* aFepMan, 
       
   680                                                  CAknFepCaseManager* aCaseMan)
       
   681     : CAknFepUIManagerBase(aFepMan, aCaseMan),
       
   682       iFepUiState(NULL)
       
   683     {
       
   684     }
       
   685 
       
   686 // ---------------------------------------------------------------------------
       
   687 // CAknFepUIManagerWestern::ConstructL
       
   688 // 
       
   689 // 
       
   690 // ---------------------------------------------------------------------------
       
   691 //
       
   692 void CAknFepUIManagerWestern::ConstructL(TLanguage aLanguage)
       
   693     {   
       
   694     CAknFepUIManagerBase::ConstructL(aLanguage);
       
   695     iAknFepThaiSCTSelector = CAknFepThaiSCTSelector::NewL();
       
   696     iVietToneMarkMgr = CAknFepVietnameseToneManager::NewL();
       
   697     }
       
   698 
       
   699 // ---------------------------------------------------------------------------
       
   700 // CAknFepUIManagerWestern::FepUIState
       
   701 // 
       
   702 // 
       
   703 // ---------------------------------------------------------------------------
       
   704 //
       
   705 TAknFepInputStateBase* CAknFepUIManagerWestern::FepUIState()
       
   706     {
       
   707     return &iFepUiState;
       
   708     }
       
   709 
       
   710 // End of file