fep/aknfep/src/AknFepUiInputStateInitialHiraganaKanji.cpp
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 TAknFepUiInputStateInitialHiraganaKanji methods.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 // INCLUDE FILES
       
    30 #include "AknFepUiInputStateInitialHiraganaKanji.h"
       
    31 #include "AknFepUIManagerStateInterface.h"  // MAknFepUIManagerStateInterface
       
    32 #include "AknFepManagerUIInterface.h"       // MAknFepManagerUIInterface
       
    33 #include "AknFepGlobalEnums.h"
       
    34 
       
    35 #include <PtiDefs.h>                // keys
       
    36 #include <PtiEngine.h>
       
    37 
       
    38 // CONSTANTS
       
    39 
       
    40 /**
       
    41  *  TAknFepUiInputStateInitialHiraganaKanji class.
       
    42  * 
       
    43  */
       
    44 //============================ MEMBER FUNCTIONS ==============================
       
    45 
       
    46 // -----------------------------------------------------------------------------
       
    47 // TAknFepUiInputStateInitialHiraganaKanji::TAknFepUiInputStateInitialHiraganaKanji
       
    48 // C++ default Constructor
       
    49 // -----------------------------------------------------------------------------
       
    50 //
       
    51 TAknFepUiInputStateInitialHiraganaKanji::TAknFepUiInputStateInitialHiraganaKanji(
       
    52                                 MAknFepUIManagerStateInterface* aOwner,
       
    53                                 MAknFepUICtrlContainerJapanese* aUIContainer)
       
    54     :TAknFepUiInputStateInitialJapaneseBase(aOwner, aUIContainer)
       
    55     {
       
    56     }
       
    57 
       
    58 // ---------------------------------------------------------------------------
       
    59 // TAknFepUiInputStateInitialHiraganaKanji::InitializeStateL
       
    60 // Initialize State
       
    61 // ---------------------------------------------------------------------------
       
    62 //
       
    63 void TAknFepUiInputStateInitialHiraganaKanji::InitializeStateL()
       
    64     {
       
    65     TAknFepUiInputStateInitialJapaneseBase::InitializeStateL();
       
    66 
       
    67     // Setup of PtiEngine
       
    68     CPtiEngine* ptiEngine = iOwner->PtiEngine();
       
    69     TPtiEngineInputMode inputmode;
       
    70     if(iOwner->IsPredictive())
       
    71         {
       
    72         inputmode = (iOwner->IsQwerty())? 
       
    73                         EPtiEngineHiraganaKanjiPredictiveQwerty
       
    74                         : EPtiEngineHiraganaKanjiPredictive;
       
    75         }
       
    76     else
       
    77         {
       
    78         inputmode = (iOwner->IsQwerty())? 
       
    79                         EPtiEngineHiraganaKanjiQwerty
       
    80                         : EPtiEngineHiraganaKanji;
       
    81         }
       
    82     ptiEngine->SetInputMode(inputmode);
       
    83     ptiEngine->ClearCurrentWord();
       
    84     }
       
    85 
       
    86 // -----------------------------------------------------------------------------
       
    87 // TAknFepUiInputStateInitialHiraganaKanji::HandleNumericShortKeyL
       
    88 // Handling numeric short keypress event
       
    89 // -----------------------------------------------------------------------------
       
    90 //
       
    91 TBool TAknFepUiInputStateInitialHiraganaKanji::
       
    92     HandleNumericShortKeyL(TInt aKey)
       
    93     {
       
    94     MAknFepManagerUIInterface* fepMan = iOwner->FepMan();
       
    95     TBool ret = EFalse;
       
    96     if (aKey == EPtiKeyStar)
       
    97         { // Handling of launch special character table
       
    98         if (!fepMan->HashKeySelectionInUse())
       
    99             {
       
   100             if (fepMan->EditSubmenuInUse())
       
   101                 {
       
   102                 fepMan->LaunchSelectModeMenuL();
       
   103                 }
       
   104             else if (fepMan->IsAbleToLaunchSCT())
       
   105                 {
       
   106                 fepMan->LaunchSpecialCharacterTableL();
       
   107                 }
       
   108             }
       
   109         ret = ETrue;
       
   110         }
       
   111     else
       
   112         {
       
   113         iOwner->FepMan()->StartInlineEditL();
       
   114 
       
   115         // Clear RetroActive buffer on PtiEngine
       
   116         CPtiEngine* ptiEngine = iOwner->PtiEngine();
       
   117         ptiEngine->HandleCommandL(EPtiCommandUserActionRetroActiveClear);
       
   118 
       
   119         // The numeric key will be handled by HandleNumericKeyL of
       
   120         // EntryState or PredictiveInputState
       
   121         if(iOwner->IsPredictive())
       
   122             {
       
   123             iOwner->ChangeState(EPredictiveInput);
       
   124             }
       
   125         else
       
   126             {
       
   127             iOwner->ChangeState(EEntry);
       
   128             }
       
   129         }
       
   130 
       
   131     return ret;
       
   132     }
       
   133 // End of file