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