fep/aknfep/src/AknFepUiInputStatePredictiveCandidatePinyinPhrase.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 TAknFepInputStatePredictiveCandidatePinyinPhrase methods.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 
       
    30 #include "AknFepUiInputStatePredictiveCandidatePinyinPhrase.h"
       
    31 #include "AknFepUIManagerStateInterface.h"  //MAknFepUIManagerStateInterface
       
    32 #include "AknFepManagerUIInterface.h"       //MAknFepManagerUIInterface
       
    33 #include "AknFepUiCtrlContainerChinese.h"
       
    34 #include "AknFepUICtrlCandidatePane.h"
       
    35 
       
    36 #include <PtiEngine.h>                      //CPtiEngine
       
    37 
       
    38 TAknFepInputStatePredictiveCandidatePinyinPhrase::TAknFepInputStatePredictiveCandidatePinyinPhrase(
       
    39                                 MAknFepUIManagerStateInterface* aOwner,
       
    40                                 MAknFepUICtrlContainerChinese* aUIContainer)
       
    41     :TAknFepInputStatePredictiveCandidateChinesePhrase(aOwner, aUIContainer)
       
    42     {
       
    43     MAknFepUICtrlContainerChinese* uiContainer = UIContainer();
       
    44     CPtiEngine* ptiengine = iOwner->PtiEngine();
       
    45      
       
    46     uiContainer->FocusCandidatePane(ETrue);
       
    47     uiContainer->SetLayout(MAknFepUICtrlContainerChinese::ELayoutCandidate);
       
    48 
       
    49     TBool multiplePages = !(uiContainer->CandidatePane()->IsLastPage() &&
       
    50                             uiContainer->CandidatePane()->IsFirstPage());
       
    51     TInt bufLength = ptiengine->CandidatePage().Length();
       
    52     TBool showHorizontalScrollArrows = multiplePages || bufLength>1;
       
    53             
       
    54     UIContainer()->ShowHorizontalScrollArrows(showHorizontalScrollArrows); 
       
    55     UIContainer()->ShowVerticalScrollArrows(multiplePages);
       
    56     UpdateIndicator();
       
    57     }
       
    58 
       
    59 TBool TAknFepInputStatePredictiveCandidatePinyinPhrase::HandleKeyL(TInt aKey, 
       
    60                                                                    TKeyPressLength aLength)
       
    61     {
       
    62     if(((aKey == EPtiKey0) || (aKey == EPtiKey1)) && aLength == EShortKeyPress )
       
    63         {
       
    64         iOwner->FepMan()->TryCloseUiL();
       
    65         return EFalse;
       
    66         }
       
    67     else
       
    68         {
       
    69         return TAknFepInputStatePredictiveCandidateChinesePhrase::HandleKeyL(aKey, aLength);
       
    70         }
       
    71     }
       
    72 // End of file