fep/aknfep/src/AknFepUiInputstateInitialStrokeFind.cpp
branchRCL_3
changeset 21 ecbabf52600f
equal deleted inserted replaced
20:ebd48d2de13c 21:ecbabf52600f
       
     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     else if (aLength == EShortKeyPress) 
       
    61         {
       
    62         if (aKey == EPtiKeyStar)
       
    63             {
       
    64        	    if (fepMan->EditSubmenuInUse())
       
    65         	    {
       
    66 				fepMan->ClearCcpuFlag(CAknFepManager::ECcpuStateIgnoreStarUp);
       
    67         	    return ret;
       
    68         	    }                        
       
    69             else if (fepMan->IsAbleToLaunchSCT())
       
    70                 {
       
    71                 fepMan->LaunchSpecialCharacterTableL();
       
    72                 }    
       
    73             }   
       
    74         else if (iOwner->IsValidChineseInputKey(aKey))
       
    75             {
       
    76             ptiengine->AppendKeyPress((TPtiKey)aKey);
       
    77             TPtrC text = ptiengine->GetPhoneticSpelling(1);
       
    78 
       
    79             if(text.Length()) 
       
    80                 {
       
    81                 fepMan->NewCharacterL(text);
       
    82                 fepMan->CommitInlineEditL();
       
    83                 ptiengine->ClearCurrentWord();
       
    84                 }
       
    85             else
       
    86                 {
       
    87                 ret = EFalse;
       
    88                 }
       
    89             }
       
    90         }
       
    91     else
       
    92         {
       
    93         if (aKey == EPtiKeyStar)
       
    94             {
       
    95             if (fepMan->EditSubmenuInUse())
       
    96             	{
       
    97        			fepMan->LaunchSpecialCharacterTableL();                
       
    98         	    } 
       
    99             }
       
   100         }
       
   101     return ret;
       
   102     }
       
   103 
       
   104 // End of file