fep/aknfep/src/AknFepUiInputStateInitialChineseMultitapBase.cpp
changeset 36 a7632c26d895
parent 35 0f326f2e628e
child 42 b3eaa440ab06
equal deleted inserted replaced
35:0f326f2e628e 36:a7632c26d895
     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 TAknFepInputStateInitialChineseMultitapBase methods.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 
       
    30 #include "AknFepUiInputStateInitialChineseMultitapBase.h"
       
    31 #include "AknFepUIManagerStateInterface.h"      //MAknFepUIManagerStateInterface
       
    32 #include "AknFepManagerUIInterface.h"           //MAknFepManagerUIInterface
       
    33 #include "AknFepUiCtrlContainerChinese.h"
       
    34 #include "AknFepCaseManager.h"
       
    35 
       
    36 #include <PtiEngine.h>
       
    37 #include <PtiDefs.h>
       
    38 
       
    39 TAknFepInputStateInitialChineseMultitapBase::TAknFepInputStateInitialChineseMultitapBase(
       
    40                                 MAknFepUIManagerStateInterface* aOwner,
       
    41                                 MAknFepUICtrlContainerChinese* aUIContainer)
       
    42     :TAknFepInputStateChineseBase(aOwner, aUIContainer)
       
    43     {
       
    44     iState = EInitial;
       
    45     CPtiEngine* ptiengine = iOwner->PtiEngine();
       
    46 
       
    47     TPtiTextCase caseMode = ptiengine->Case();
       
    48 
       
    49     ptiengine->ClearCurrentWord();
       
    50     ptiengine->SetInputMode(EPtiEngineMultitapping);
       
    51 
       
    52     ptiengine->SetCase(caseMode);
       
    53     }
       
    54 
       
    55 TBool TAknFepInputStateInitialChineseMultitapBase::HandleKeyL(TInt aKey, TKeyPressLength aLength)
       
    56     {
       
    57     MAknFepManagerUIInterface* fepMan = iOwner->FepMan();
       
    58     CPtiEngine* ptiengine = iOwner->PtiEngine();
       
    59     TBool ret = ETrue;
       
    60 
       
    61     if(iData && (iData != aKey))
       
    62         {
       
    63         fepMan->CommitInlineEditL();
       
    64         ptiengine->ClearCurrentWord();
       
    65         CAknFepCaseManager* caseMan = iOwner->CaseMan(); 
       
    66         caseMan->UpdateCase(ENullNaviEvent); 
       
    67         }
       
    68 
       
    69     iData = aKey;
       
    70     if(aLength == EShortKeyPress)
       
    71         {
       
    72         if (aKey == EPtiKeyStar)
       
    73             {
       
    74             if (fepMan->EditSubmenuInUse())
       
    75         		{
       
    76      		    fepMan->ClearCcpuFlag(CAknFepManager::ECcpuStateIgnoreStarUp);                    
       
    77         		return ret;
       
    78         		}            
       
    79             else if (fepMan->IsAbleToLaunchSCT())
       
    80                 {
       
    81                 fepMan->LaunchSpecialCharacterTableL();
       
    82                 }
       
    83             }
       
    84         else
       
    85             {
       
    86             TPtrC text = ptiengine->AppendKeyPress((TPtiKey)aKey);
       
    87             if (text.Length())
       
    88                 {
       
    89                 fepMan->NewCharacterL(text);
       
    90                 }
       
    91             }
       
    92         }
       
    93     else // long keypress
       
    94         {
       
    95         if (aKey == EPtiKeyStar)
       
    96             {
       
    97             if (fepMan->EditSubmenuInUse())
       
    98             	{
       
    99        			fepMan->LaunchSpecialCharacterTableL();                
       
   100         	    } 
       
   101             }        
       
   102         }
       
   103 
       
   104     return ret;
       
   105     }
       
   106 
       
   107 // Functions from MPtiObserver interface
       
   108 void TAknFepInputStateInitialChineseMultitapBase::KeyTimerExpired()
       
   109     {
       
   110     if (iData)
       
   111         {
       
   112         MAknFepManagerUIInterface* fepMan = iOwner->FepMan();
       
   113         //Changing the below line from "TRAPD(err," to TRAP_IGNORE 
       
   114         //to remove compiler warning
       
   115         TRAP_IGNORE(fepMan->CommitInlineEditL())
       
   116         //do something if error??
       
   117 
       
   118         CPtiEngine* ptiengine = iOwner->PtiEngine();
       
   119         ptiengine->ClearCurrentWord();
       
   120 
       
   121         CAknFepCaseManager* caseMan = iOwner->CaseMan(); 
       
   122         caseMan->UpdateCase(ENullNaviEvent); 
       
   123 
       
   124         iData = 0;
       
   125         }
       
   126     }
       
   127 
       
   128 // End of file