fep/aknfep/src/AknFepUiInputStatePredictiveCandidateStrokePhrase.cpp
changeset 40 2cb9bae34d17
parent 31 f1bdd6b078d1
child 49 37f5d84451bd
equal deleted inserted replaced
31:f1bdd6b078d1 40:2cb9bae34d17
     1 /*
       
     2 * Copyright (c) 2002-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:            Implementation of Stroke phrase predictive candidate state
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 // System includes
       
    30 #include <PtiEngine.h>                      
       
    31 
       
    32 // User includes
       
    33 #include "AknFepUiInputStatePredictiveCandidateStrokePhrase.h"
       
    34 #include "AknFepUIManagerStateInterface.h"  
       
    35 #include "AknFepManagerUIInterface.h"       
       
    36 #include "AknFepUiCtrlContainerChinese.h"
       
    37 #include "AknFepUICtrlCandidatePane.h"
       
    38 
       
    39 // Constant definition
       
    40 const TInt KMinCnadidateCount = 1;
       
    41 
       
    42 // ---------------------------------------------------------------------------
       
    43 // TAknFepInputStatePredictiveCandidateStrokePhrase::
       
    44 // TAknFepInputStatePredictiveCandidateStrokePhrase
       
    45 // (other items were commented in a header).
       
    46 // ---------------------------------------------------------------------------
       
    47 //
       
    48 TAknFepInputStatePredictiveCandidateStrokePhrase::TAknFepInputStatePredictiveCandidateStrokePhrase(
       
    49     MAknFepUIManagerStateInterface* aOwner,
       
    50     MAknFepUICtrlContainerChinese* aUIContainer)
       
    51     :TAknFepInputStatePredictiveCandidateChinesePhrase(aOwner, aUIContainer)
       
    52     {
       
    53     MAknFepUICtrlContainerChinese* uiContainer = UIContainer();
       
    54     CPtiEngine* ptiengine = iOwner->PtiEngine();
       
    55     
       
    56     uiContainer->FocusCandidatePane(ETrue);
       
    57     uiContainer->SetLayout(MAknFepUICtrlContainerChinese::ELayoutCandidate);
       
    58 
       
    59     TBool multiplePages = !(uiContainer->CandidatePane()->IsLastPage() &&
       
    60                             uiContainer->CandidatePane()->IsFirstPage());
       
    61     TInt bufLength = ptiengine->CandidatePage().Length();
       
    62     TBool showHorizontalScrollArrows = multiplePages || bufLength > KMinCnadidateCount;
       
    63             
       
    64     uiContainer->ShowHorizontalScrollArrows(showHorizontalScrollArrows); 
       
    65     uiContainer->ShowVerticalScrollArrows(multiplePages);
       
    66     UpdateIndicator();
       
    67     }
       
    68 
       
    69 // ---------------------------------------------------------------------------
       
    70 // TAknFepInputStatePredictiveCandidateStrokePhrase::HandleKeyL
       
    71 // (other items were commented in a header).
       
    72 // ---------------------------------------------------------------------------
       
    73 //
       
    74 TBool TAknFepInputStatePredictiveCandidateStrokePhrase::HandleKeyL(TInt aKey, 
       
    75                                                                    TKeyPressLength aLength)
       
    76     {
       
    77     if(aKey == EPtiKey0 || aKey == EPtiKey7 ||
       
    78        aKey == EPtiKey8 || aKey == EPtiKey9)
       
    79         {
       
    80         iOwner->FepMan()->TryCloseUiL();
       
    81         return EFalse;
       
    82         }
       
    83 
       
    84     return TAknFepInputStatePredictiveCandidateChinesePhrase::HandleKeyL(aKey, aLength);
       
    85     }
       
    86     
       
    87 // End of file