fep/aknfep/src/AknFepUiInputStateInitialThaiPredictive.cpp
changeset 40 2cb9bae34d17
parent 31 f1bdd6b078d1
child 49 37f5d84451bd
equal deleted inserted replaced
31:f1bdd6b078d1 40:2cb9bae34d17
     1 /*
       
     2 * Copyright (c) 2002-2007 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 TAknFepInputStateInitialThaiPredictive methods.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 
       
    30 #include "AknFepUiInputStateInitialThaiPredictive.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 
       
    39 TAknFepInputStateInitialThaiPredictive::
       
    40 TAknFepInputStateInitialThaiPredictive(MAknFepUIManagerStateInterface* aOwner)
       
    41     :TAknFepInputStateInitialMultitapBase(aOwner)
       
    42     {
       
    43     }
       
    44 
       
    45 TBool TAknFepInputStateInitialThaiPredictive::HandleKeyL(TInt aKey, TKeyPressLength aLength)
       
    46     {
       
    47     MAknFepManagerUIInterface* fepMan = iOwner->FepMan();
       
    48     TBool ret = ETrue;
       
    49 
       
    50     if (aKey == EPtiKeyStar )
       
    51         {
       
    52         if (aLength == EShortKeyPress)
       
    53             {
       
    54             if (!fepMan->EditSubmenuInUse())
       
    55                 {
       
    56                 if (fepMan->IsAbleToLaunchSCT())
       
    57                     {
       
    58                     fepMan->LaunchSpecialCharacterTableL(iOwner->ThaiSCTResourceId(0x0020,aKey));
       
    59                     return (ETrue);
       
    60                     }
       
    61                 }
       
    62             else
       
    63                 {
       
    64                 fepMan->ClearCcpuFlag(CAknFepManager::ECcpuStateIgnoreStarUp);
       
    65                 }
       
    66             }
       
    67         else                
       
    68             {
       
    69             if (fepMan->EditSubmenuInUse())
       
    70                 {                                       
       
    71                 fepMan->LaunchSpecialCharacterTableL(iOwner->ThaiSCTResourceId(0x0020,aKey));
       
    72                 return (ETrue); 
       
    73                 }
       
    74             }
       
    75         }                        
       
    76     else 
       
    77         {
       
    78         if (fepMan->IsFlagSet(CAknFepManager::EFlagSuppressInputStateChange))
       
    79             {
       
    80             // Long keypress of numeric keypress, we want to simply return EFalse
       
    81             // to enter a number into the editor, rather than move back to 
       
    82             // entry state, so just clear the flag
       
    83             fepMan->ClearFlag(CAknFepManager::EFlagSuppressInputStateChange);
       
    84             }
       
    85         else
       
    86             {
       
    87             fepMan->TryCloseUiL(); //expires the multitap timer
       
    88             iOwner->ChangeState(EEntry);
       
    89             fepMan->SendUIActivatedNotification();
       
    90             }
       
    91         ret = EFalse;
       
    92         }
       
    93     return ret;
       
    94     }
       
    95 
       
    96 void TAknFepInputStateInitialThaiPredictive::HandleCommandL(TInt aCommandId)
       
    97     {
       
    98     if (aCommandId == EAknCmdEditInsertSymbol)
       
    99         {
       
   100         MAknFepManagerUIInterface* fepMan = iOwner->FepMan();
       
   101         fepMan->LaunchSpecialCharacterTableL(
       
   102                            iOwner->ThaiSCTResourceId(fepMan->PreviousChar(),EPtiKeyStar));
       
   103         }
       
   104     }
       
   105 
       
   106 // End of file