fep/aknfep/src/AknFepUiInputstateInitialStrokeFind.cpp
changeset 40 2cb9bae34d17
parent 31 f1bdd6b078d1
child 49 37f5d84451bd
equal deleted inserted replaced
31:f1bdd6b078d1 40:2cb9bae34d17
     1 /*
       
     2 * Copyright (c) 2002 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 TAknFepInputStateInitialStrokeFind methods.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 
       
    30 #include "AknFepUiInputStateInitialStrokeFind.h"
       
    31 #include "AknFepUIManagerStateInterface.h"
       
    32 #include "AknFepManagerUIInterface.h"
       
    33 
       
    34 #include <e32keys.h>
       
    35 #include <PtiEngine.h>
       
    36 #include <PtiDefs.h>                //keys
       
    37 
       
    38 #include "AknFepUiCtrlContainerChinese.h"
       
    39 #include "AknFepUICtrlCandidatePane.h"
       
    40 
       
    41 TAknFepInputStateInitialStrokeFind::TAknFepInputStateInitialStrokeFind(
       
    42                                 MAknFepUIManagerStateInterface* aOwner,
       
    43                                 MAknFepUICtrlContainerChinese* aUIContainer)
       
    44     :TAknFepInputStateChineseBase(aOwner, aUIContainer)
       
    45     {
       
    46     iState = EInitial;
       
    47     iOwner->PtiEngine()->SetInputMode(EPtiEngineStroke);
       
    48     }
       
    49 
       
    50 TBool TAknFepInputStateInitialStrokeFind::HandleKeyL(TInt aKey, TKeyPressLength aLength)
       
    51     {
       
    52     MAknFepManagerUIInterface* fepMan = iOwner->FepMan();
       
    53     CPtiEngine* ptiengine = iOwner->PtiEngine();
       
    54     TBool ret = ETrue;
       
    55     
       
    56     if (aKey == EKeyBackspace || aKey == EKeyOK)
       
    57         {
       
    58         ret = EFalse;
       
    59         }
       
    60     
       
    61     else if (aLength == EShortKeyPress) 
       
    62         {
       
    63         if (aKey == EPtiKeyStar)
       
    64             {
       
    65        	    if (fepMan->EditSubmenuInUse())
       
    66         	    {
       
    67 				fepMan->ClearCcpuFlag(CAknFepManager::ECcpuStateIgnoreStarUp);
       
    68         	    return ret;
       
    69         	    }                        
       
    70             else if (fepMan->IsAbleToLaunchSCT())
       
    71                 {
       
    72                 fepMan->LaunchSpecialCharacterTableL();
       
    73                 }    
       
    74             }   
       
    75         else if (iOwner->IsValidChineseInputKey(aKey))
       
    76             {
       
    77             ptiengine->AppendKeyPress((TPtiKey)aKey);
       
    78             TPtrC text = ptiengine->GetPhoneticSpelling(1);
       
    79 
       
    80             if(text.Length()) 
       
    81                 {
       
    82                 fepMan->NewCharacterL(text);
       
    83                 fepMan->CommitInlineEditL();
       
    84                 ptiengine->ClearCurrentWord();
       
    85                 }
       
    86             else
       
    87                 {
       
    88                 ret = EFalse;
       
    89                 }
       
    90             }
       
    91         }
       
    92     else
       
    93         {
       
    94         if (aKey == EPtiKeyStar)
       
    95             {
       
    96             if (fepMan->EditSubmenuInUse())
       
    97             	{
       
    98        			fepMan->LaunchSpecialCharacterTableL();                
       
    99         	    } 
       
   100             }
       
   101         }
       
   102     return ret;
       
   103     }
       
   104 
       
   105 // End of file