fep/aknfep/src/AknFepUiInputStateInitialLatinJapanese.cpp
changeset 40 2cb9bae34d17
parent 31 f1bdd6b078d1
child 49 37f5d84451bd
equal deleted inserted replaced
31:f1bdd6b078d1 40:2cb9bae34d17
     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 TAknFepUiInputStateInitialLatinJapanese methods.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 // INCLUDE FILES
       
    30 #include "AknFepUiInputStateInitialLatinJapanese.h"
       
    31 #include "AknFepUIManagerStateInterface.h"   // MAknFepUIManagerStateInterface
       
    32 #include "AknFepManagerUIInterface.h"        // MAknFepManagerUIInterface
       
    33 #include "AknFepCaseManager.h"               // CAknFepCaseManager
       
    34 #include "AknFepManager.h"
       
    35 
       
    36 #include <PtiDefs.h>                //keys
       
    37 #include <PtiEngine.h>
       
    38 
       
    39 // CONSTANTS
       
    40 
       
    41 /**
       
    42  *  TAknFepUiInputStateInitialLatinJapanese class.
       
    43  * 
       
    44  */
       
    45 //============================ MEMBER FUNCTIONS ==============================
       
    46 
       
    47 // ---------------------------------------------------------------------------
       
    48 // TAknFepUiInputStateInitialLatinJapanese::TAknFepUiInputStateInitialLatinJapanese
       
    49 // Default constructor
       
    50 // ---------------------------------------------------------------------------
       
    51 //
       
    52 TAknFepUiInputStateInitialLatinJapanese::TAknFepUiInputStateInitialLatinJapanese(
       
    53                                 MAknFepUIManagerStateInterface* aOwner,
       
    54                                 MAknFepUICtrlContainerJapanese* aUIContainer)
       
    55     :TAknFepUiInputStateInitialJapaneseBase(aOwner, aUIContainer)
       
    56     {
       
    57     }
       
    58 
       
    59 // ---------------------------------------------------------------------------
       
    60 // TAknFepUiInputStateInitialLatinJapanese::InitializeStateL
       
    61 // Initialize State
       
    62 // ---------------------------------------------------------------------------
       
    63 //
       
    64 void TAknFepUiInputStateInitialLatinJapanese::InitializeStateL()
       
    65     {
       
    66     TAknFepUiInputStateInitialJapaneseBase::InitializeStateL();
       
    67     
       
    68     // Setup PtiEngine
       
    69     CPtiEngine* ptiEngine = iOwner->PtiEngine();
       
    70     TPtiEngineInputMode ptiInputMode = (iOwner->IsQwerty())? 
       
    71                                         EPtiEngineQwerty
       
    72                                         : EPtiEngineMultitapping;
       
    73     if (iOwner->FepMan()->CharacterWidth() == EFullWidthChar)
       
    74         {
       
    75         ptiInputMode = (iOwner->IsQwerty())? 
       
    76                             EPtiEngineFullWidthAlphabetQwerty
       
    77                             : EPtiEngineFullWidthAlphabet;
       
    78         }
       
    79     ptiEngine->SetInputMode(ptiInputMode);
       
    80     ptiEngine->ClearCurrentWord();
       
    81 
       
    82     // Setup Case
       
    83     CAknFepCaseManager* caseMan = iOwner->CaseMan();
       
    84     TInt currentCase = caseMan->CurrentCase();
       
    85     TPtiTextCase ptiCase = EPtiCaseUpper;
       
    86     if (currentCase == EAknEditorLowerCase)
       
    87         {
       
    88         ptiCase = EPtiCaseLower;
       
    89         }
       
    90     ptiEngine->SetCase(ptiCase);
       
    91     }
       
    92 
       
    93 // ---------------------------------------------------------------------------
       
    94 // TAknFepUiInputStateInitialLatinJapanese::HandleNumericShortKeyL
       
    95 // Handling numeric short keypress event
       
    96 // ---------------------------------------------------------------------------
       
    97 //
       
    98 TBool TAknFepUiInputStateInitialLatinJapanese::
       
    99 HandleNumericShortKeyL(TInt aKey)
       
   100     {
       
   101     TBool ret = EFalse;
       
   102     MAknFepManagerUIInterface* fepMan = iOwner->FepMan();
       
   103     if(aKey == EPtiKeyStar)
       
   104         { // Handling of launch special character table
       
   105         if (!fepMan->HashKeySelectionInUse())
       
   106             {
       
   107             if (fepMan->EditSubmenuInUse())
       
   108                 {
       
   109                 fepMan->LaunchSelectModeMenuL();
       
   110                 }
       
   111             else if (fepMan->IsAbleToLaunchSCT())
       
   112                 {
       
   113                 fepMan->LaunchSpecialCharacterTableL();
       
   114                 }
       
   115             }
       
   116         ret = ETrue;
       
   117         }
       
   118     else
       
   119         {
       
   120         fepMan->StartInlineEditL();
       
   121         iOwner->ChangeState(EEntry);
       
   122         }
       
   123     // Setup Case without Qwerty
       
   124 	if (!iOwner->IsQwerty())
       
   125 		{
       
   126 	    CPtiEngine* ptiEngine = iOwner->PtiEngine();
       
   127 	    CAknFepCaseManager* caseMan = iOwner->CaseMan();
       
   128 	    TInt currentCase = caseMan->CurrentCase();
       
   129 	    TPtiTextCase ptiCase = EPtiCaseUpper;
       
   130 	    if (currentCase == EAknEditorLowerCase)
       
   131 	        {
       
   132 	        ptiCase = EPtiCaseLower;
       
   133 	        }
       
   134 	    ptiEngine->SetCase(ptiCase);
       
   135 		}
       
   136 
       
   137     return ret;
       
   138     }
       
   139 
       
   140 // ---------------------------------------------------------------------------
       
   141 // TAknFepUiInputStateInitialJapaneseBase::HandleAuxKeyL
       
   142 // Handling OK and Backspace keypress event
       
   143 // ---------------------------------------------------------------------------
       
   144 //
       
   145 TBool TAknFepUiInputStateInitialLatinJapanese::
       
   146     HandleAuxKeyL(TInt aKey,TKeyPressLength /*aLength*/)
       
   147     {
       
   148     TBool ret = EFalse;
       
   149 
       
   150     if (iOwner->IsQwerty())
       
   151         {
       
   152         switch (aKey)
       
   153             {
       
   154             case EStdKeyEnter:          /* 0x03 */
       
   155             case EStdKeyNkpEnter:       /* 0x88 */
       
   156                 {
       
   157                 // PtiEngine does not have mapping for the enter key.
       
   158                 MAknFepManagerUIInterface* fepMan = iOwner->FepMan();
       
   159                 const TText KAknFEPLineFeedSymbol = 0x21B2;
       
   160                 TBuf<1> lineFeed;
       
   161                 lineFeed.Zero();
       
   162                 lineFeed.Append(KAknFEPLineFeedSymbol);
       
   163                 fepMan->NewCharacterL(lineFeed);
       
   164                 // Commit the character if chr key is not pressed.
       
   165                 fepMan->CommitInlineEditL();
       
   166 
       
   167                 ret = ETrue;
       
   168                 }
       
   169                 break;
       
   170             default:
       
   171                 break;
       
   172             }
       
   173         }
       
   174     return ret;
       
   175     }
       
   176 
       
   177 // End of file