|
1 /* |
|
2 * Copyright (c) 2002-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 TAknFepInputStatePredictiveInput methods. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 #include "AknFepUICtrlCandidatePane.h" |
|
31 #include "AknFepUiInputStatePredictiveInput.h" |
|
32 #include "AknFepUiCtrlContainerChinese.h" |
|
33 #include "AknFepUIManagerStateInterface.h" //MAknFepUIManagerStateInterface |
|
34 #include "AknFepManagerUIInterface.h" //MAknFepManagerUIInterface |
|
35 |
|
36 #include <PtiEngine.h> //CPtiEngine |
|
37 |
|
38 TAknFepInputStatePredictiveInput::TAknFepInputStatePredictiveInput( |
|
39 MAknFepUIManagerStateInterface* aOwner, |
|
40 MAknFepUICtrlContainerChinese* aUIContainer) |
|
41 :TAknFepInputStateCandidateBase(aOwner, aUIContainer) |
|
42 { |
|
43 iState = EPredictiveInput; |
|
44 |
|
45 MAknFepUICtrlContainerChinese* uiContainer = UIContainer(); |
|
46 |
|
47 uiContainer->CandidatePane()->SelectFirst(); |
|
48 |
|
49 TBool multiplePages = iOwner->PtiEngine()->MoreCandidatePages(); |
|
50 TInt bufLength = iOwner->PtiEngine()->CandidatePage().Length(); |
|
51 TBool showHorizontalScrollArrows = multiplePages || bufLength>1; |
|
52 |
|
53 uiContainer->ShowHorizontalScrollArrows(showHorizontalScrollArrows); |
|
54 uiContainer->FocusCandidatePane(ETrue); |
|
55 uiContainer->CandidatePane()->ShowCandidateOrdinals(ETrue); |
|
56 } |
|
57 |
|
58 TBool TAknFepInputStatePredictiveInput::HandleKeyL(TInt aKey, TKeyPressLength aLength) |
|
59 { |
|
60 TBool response = ETrue; |
|
61 |
|
62 switch (aKey) |
|
63 { |
|
64 case EKeyOK: //fall through |
|
65 case EPtiKey0: |
|
66 case EPtiKey1: |
|
67 case EPtiKey2: |
|
68 case EPtiKey3: |
|
69 case EPtiKey4: |
|
70 case EPtiKey5: |
|
71 case EPtiKey6: |
|
72 case EPtiKey7: |
|
73 case EPtiKey8: |
|
74 case EPtiKey9: |
|
75 TAknFepInputStateCandidateBase::HandleKeyL(aKey, aLength); |
|
76 break; |
|
77 case EKeyBackspace: //fall through |
|
78 iOwner->FepMan()->TryCloseUiL(); |
|
79 break; |
|
80 default: |
|
81 response = TAknFepInputStateCandidateBase::HandleKeyL(aKey, aLength); |
|
82 break; |
|
83 } |
|
84 return response; |
|
85 } |
|
86 |
|
87 // End of file |