fep/aknfep/src/AknFepUiInputStateInitialArabicHebrewPredictive.cpp
changeset 40 2cb9bae34d17
parent 31 f1bdd6b078d1
child 49 37f5d84451bd
equal deleted inserted replaced
31:f1bdd6b078d1 40:2cb9bae34d17
     1 /*
       
     2 * Copyright (c) 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 TAknFepInputStateInitialArabicHebrewPredictive methods.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 
       
    30 #include "AknFepUiInputStateInitialArabicHebrewPredictive.h"
       
    31 #include "AknFepUIManagerStateInterface.h"      //MAknFepUIManagerStateInterface
       
    32 #include "AknFepManagerUIInterface.h"           //MAknFepManagerUIInterface
       
    33 #include "AknFepManager.h"
       
    34 #include "AknFepCaseManager.h"                  //CAknFepCaseManager
       
    35 
       
    36 #include <PtiDefs.h>
       
    37 
       
    38 TAknFepInputStateInitialArabicHebrewPredictive::
       
    39 TAknFepInputStateInitialArabicHebrewPredictive(MAknFepUIManagerStateInterface* aOwner)
       
    40     :TAknFepInputStateInitialWesternPredictive(aOwner)
       
    41     {
       
    42     }
       
    43 
       
    44 TBool TAknFepInputStateInitialArabicHebrewPredictive::HandleKeyL(TInt aKey, 
       
    45                                                                  TKeyPressLength aLength)
       
    46     {
       
    47     MAknFepManagerUIInterface* fepMan = iOwner->FepMan();
       
    48     TBool ret = ETrue;
       
    49 
       
    50     if (aKey == EPtiKey0)
       
    51         {
       
    52         TAknFepInputStateInitialWesternPredictive::HandleKeyL(aKey, aLength);
       
    53         }
       
    54     else if (aKey == EPtiKeyStar)
       
    55         {
       
    56   		if (aLength == EShortKeyPress)
       
    57 			{	
       
    58 		    if (fepMan->IsFlagSet(CAknFepManager::EFlagLineFeedCharacter) && 
       
    59 			    fepMan->IsFlagSet(CAknFepManager::EFlagInsideMultitapInlineEditingTransaction))
       
    60 			    {
       
    61 			    // User is interrupting multitap timer with star key, but there
       
    62 			    // is line feed event waiting. Make sure that it is handled first.
       
    63 			    fepMan->CommitInlineEditL();
       
    64 			    }			
       
    65 							        
       
    66         	if (!fepMan->EditSubmenuInUse())
       
    67         		{
       
    68         		if (fepMan->IsAbleToLaunchSCT())
       
    69         			{
       
    70 	        		fepMan->LaunchSpecialCharacterTableL();        			
       
    71         			}
       
    72         		}
       
    73 			else
       
    74 				{
       
    75 				fepMan->ClearCcpuFlag(CAknFepManager::ECcpuStateIgnoreStarUp);				
       
    76 				}        		               	        		
       
    77         	}        	
       
    78 		else	        	
       
    79 			{
       
    80 			if (fepMan->EditSubmenuInUse())
       
    81 				{										
       
    82 				fepMan->LaunchSpecialCharacterTableL();           			
       
    83 				}
       
    84 			}               
       
    85         }   
       
    86     else 
       
    87         {
       
    88         if (fepMan->IsFlagSet(CAknFepManager::EFlagSuppressInputStateChange))
       
    89             {
       
    90             // Long keypress of numeric keypress, we want to simply return EFalse
       
    91             // to enter a number into the editor, rather than move back to 
       
    92             // entry state, so just clear the flag
       
    93             fepMan->ClearFlag(CAknFepManager::EFlagSuppressInputStateChange);
       
    94             // Asyncronous case update is not needed in Arabic and Hebrew.
       
    95             // Arabic indic digits are handled in FepManager.
       
    96             }
       
    97         else
       
    98             {
       
    99             fepMan->TryCloseUiL(); //expires the multitap timer
       
   100             iOwner->ChangeState(EEntry);
       
   101             fepMan->SendUIActivatedNotification();
       
   102             }
       
   103         ret = EFalse;
       
   104         }
       
   105     return ret;
       
   106     }
       
   107 
       
   108 // End of file