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