fep/aknfep/src/AknFepUiInputStatePredictiveInputChinese.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 ITUT preditive input state
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 // System includes
       
    30 #include <PtiEngine.h>                      //CPtiEngine
       
    31 
       
    32 // User includes
       
    33 #include "AknFepUiCtrlContainerChinese.h"
       
    34 #include "AknFepUIManagerStateInterface.h"  //MAknFepUIManagerStateInterface
       
    35 #include "AknFepManagerUIInterface.h"       //MAknFepManagerUIInterface
       
    36 #include "AknFepUICtrlCandidatePane.h"
       
    37 #include "AknFepUiInputStatePredictiveInputChinese.h"
       
    38 
       
    39 // ---------------------------------------------------------------------------
       
    40 // TAknFepInputStatePredictiveInputChinese::
       
    41 // TAknFepInputStatePredictiveInputChinese
       
    42 // (other items were commented in a header).
       
    43 // ---------------------------------------------------------------------------
       
    44 //
       
    45 TAknFepInputStatePredictiveInputChinese::TAknFepInputStatePredictiveInputChinese(
       
    46                                 MAknFepUIManagerStateInterface* aOwner,
       
    47                                 MAknFepUICtrlContainerChinese* aUIContainer)
       
    48     :TAknFepInputStateCandidateChinese(aOwner, aUIContainer)
       
    49     {
       
    50     iState = EPredictiveInput;
       
    51 
       
    52     MAknFepUICtrlContainerChinese* uiContainer = UIContainer();
       
    53     uiContainer->CandidatePane()->SelectFirst(); 
       
    54 
       
    55     TBool multiplePages = iOwner->PtiEngine()->MoreCandidatePages();
       
    56     TInt bufLength = iOwner->PtiEngine()->CandidatePage().Length();
       
    57     TBool showHorizontalScrollArrows = multiplePages || bufLength > 1;
       
    58 
       
    59     uiContainer->ShowHorizontalScrollArrows(showHorizontalScrollArrows); 
       
    60     uiContainer->FocusCandidatePane(ETrue);
       
    61     uiContainer->CandidatePane()->ShowCandidateOrdinals(ETrue);
       
    62     }
       
    63     
       
    64 // ---------------------------------------------------------------------------
       
    65 // TAknFepInputStatePredictiveInputChinese::
       
    66 // HandleKeyL
       
    67 // (other items were commented in a header).
       
    68 // ---------------------------------------------------------------------------
       
    69 //
       
    70 TBool TAknFepInputStatePredictiveInputChinese::HandleKeyL(TInt aKey, TKeyPressLength aLength)
       
    71     {
       
    72     TBool response = ETrue;
       
    73      
       
    74     switch (aKey)
       
    75         {
       
    76         case EKeyOK:        //fall through
       
    77         case EPtiKey0:
       
    78         case EPtiKey1:
       
    79         case EPtiKey2:
       
    80         case EPtiKey3:
       
    81         case EPtiKey4:
       
    82         case EPtiKey5:
       
    83         case EPtiKey6:
       
    84         case EPtiKey7:
       
    85         case EPtiKey8:
       
    86         case EPtiKey9:
       
    87             TAknFepInputStateCandidateChinese::HandleKeyL(aKey, aLength);
       
    88             break;
       
    89         case EKeyBackspace: //fall through
       
    90             iOwner->FepMan()->TryCloseUiL();
       
    91         break;
       
    92         default:
       
    93             response = TAknFepInputStateCandidateChinese::HandleKeyL(aKey, aLength);
       
    94         break;
       
    95         }
       
    96         
       
    97     return response;
       
    98     }
       
    99 
       
   100 // End of file