fep/aknfep/src/AknFepUiInputStatePredictiveInputChinesePhrase.cpp
changeset 36 a7632c26d895
parent 35 0f326f2e628e
child 42 b3eaa440ab06
equal deleted inserted replaced
35:0f326f2e628e 36:a7632c26d895
     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 predictive input phrase state
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 #include "AknFepUICtrlCandidatePane.h"
       
    30 #include "AknFepUiInputStatePredictiveInputChinesePhrase.h"
       
    31 #include "AknFepUiCtrlContainerChinese.h"
       
    32 #include "AknFepUIManagerStateInterface.h"  //MAknFepUIManagerStateInterface
       
    33 #include "AknFepManagerUIInterface.h"       //MAknFepManagerUIInterface
       
    34 
       
    35 #include <PtiEngine.h>                      //CPtiEngine
       
    36 
       
    37 TAknFepInputStatePredictiveInputChinesePhrase::TAknFepInputStatePredictiveInputChinesePhrase(
       
    38                                 MAknFepUIManagerStateInterface* aOwner,
       
    39                                 MAknFepUICtrlContainerChinese* aUIContainer)
       
    40     :TAknFepInputStateCandidateBaseChinesePhrase(aOwner, aUIContainer)
       
    41     {
       
    42     iState = EPredictiveInput;
       
    43 
       
    44     MAknFepUICtrlContainerChinese* uiContainer = UIContainer();
       
    45     MAknFepUICtrlCandidatePane* candidatePane = uiContainer->CandidatePane();
       
    46 
       
    47     candidatePane->SelectFirstPhrase(); 
       
    48 
       
    49     TBool multiplePages = !(uiContainer->CandidatePane()->IsLastPage() &&
       
    50                             uiContainer->CandidatePane()->IsFirstPage());
       
    51     TInt bufLength = iOwner->PtiEngine()->CandidatePage().Length();
       
    52     TBool showHorizontalScrollArrows = multiplePages || bufLength>1;
       
    53 
       
    54     UIContainer()->ShowHorizontalScrollArrows(showHorizontalScrollArrows); 
       
    55     UIContainer()->ShowVerticalScrollArrows(multiplePages);
       
    56     uiContainer->FocusCandidatePane(ETrue);
       
    57     candidatePane->ShowCandidateOrdinals(ETrue);
       
    58     UpdateIndicator();
       
    59     }
       
    60 
       
    61 TBool TAknFepInputStatePredictiveInputChinesePhrase::HandleKeyL(TInt aKey, TKeyPressLength aLength)
       
    62     {
       
    63     TBool response = ETrue;
       
    64      
       
    65     switch (aKey)
       
    66         {
       
    67     case EKeyOK:        //fall through
       
    68     case EPtiKey0:
       
    69     case EPtiKey1:
       
    70     case EPtiKey2:
       
    71     case EPtiKey3:
       
    72     case EPtiKey4:
       
    73     case EPtiKey5:
       
    74     case EPtiKey6:
       
    75     case EPtiKey7:
       
    76     case EPtiKey8:
       
    77     case EPtiKey9:
       
    78         TAknFepInputStateCandidateBaseChinesePhrase::HandleKeyL(aKey, aLength);
       
    79         break;
       
    80     case EKeyBackspace: //fall through
       
    81         iOwner->FepMan()->TryCloseUiL();
       
    82         break;
       
    83     default:
       
    84         response = TAknFepInputStateCandidateBaseChinesePhrase::HandleKeyL(aKey, aLength);
       
    85         break;
       
    86         }
       
    87     return response;
       
    88     }
       
    89 
       
    90 // End of file