fep/aknfep/src/AknFepUiInputStateCandidateQwertyZhuyinPhrase.cpp
changeset 40 2cb9bae34d17
parent 31 f1bdd6b078d1
child 49 37f5d84451bd
equal deleted inserted replaced
31:f1bdd6b078d1 40:2cb9bae34d17
     1 /*
       
     2 * Copyright (c) 2005 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 TAknFepInputStateCandidateQwertyZhuyinPhrase methods.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 
       
    30 #include "AknFepUiInputStateCandidateQwertyZhuyinPhrase.h"
       
    31 #include "AknFepUiCtrlContainerChinese.h"
       
    32 #include "AknFepUIManagerStateInterface.h"  //MAknFepUIManagerStateInterface
       
    33 #include "AknFepUICtrlCandidatePane.h"      //MAknFepUICtrlCandidatePane
       
    34 #include <PtiEngine.h>                      //CPtiEngine
       
    35 
       
    36 #include "AknFepManager.h"                  //FepMan flag
       
    37 
       
    38 TAknFepInputStateCandidateQwertyZhuyinPhrase::TAknFepInputStateCandidateQwertyZhuyinPhrase(
       
    39                                MAknFepUIManagerStateInterface* aOwner,
       
    40                                MAknFepUICtrlContainerChinese* aUIContainer)
       
    41     :TAknFepInputStateCandidateQwertyChinesePhrase(aOwner, aUIContainer)
       
    42     {
       
    43     iState = ECandidate;
       
    44     
       
    45     MAknFepUICtrlContainerChinese* uiContainer = UIContainer();
       
    46     uiContainer->CandidatePane()->SelectFirstPhrase();
       
    47 
       
    48     TBool multiplePages = !(uiContainer->CandidatePane()->IsLastPage() &&
       
    49                             uiContainer->CandidatePane()->IsFirstPage());
       
    50     TInt bufLength = iOwner->PtiEngine()->CandidatePage().Length();
       
    51     TBool showHorizontalScrollArrows = multiplePages || bufLength>1;
       
    52 
       
    53     uiContainer->ShowHorizontalScrollArrows(showHorizontalScrollArrows); 
       
    54     uiContainer->ShowVerticalScrollArrows(multiplePages);
       
    55     uiContainer->FocusCandidatePane(ETrue);
       
    56     uiContainer->CandidatePane()->ShowCandidateOrdinals(ETrue);
       
    57     UpdateIndicator();
       
    58     }
       
    59 
       
    60 TBool TAknFepInputStateCandidateQwertyZhuyinPhrase::HandleKeyL(TInt aKey, TKeyPressLength aLength)
       
    61     {
       
    62     if(aKey == EStdKeyBackspace)
       
    63         {
       
    64         iOwner->ChangeState(EEntry);
       
    65         return ETrue;
       
    66         }
       
    67     else if (aKey == EStdKeySpace || aKey == EStdKeyEnter)
       
    68         {
       
    69         return ETrue;
       
    70         }        
       
    71     else
       
    72         {
       
    73         return TAknFepInputStateCandidateQwertyChinesePhrase::HandleKeyL(aKey,aLength);
       
    74         }
       
    75     }
       
    76 
       
    77 // End of file