|
1 /* |
|
2 * Copyright (c) 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: |
|
15 * Provides the TAknFepInputStatePredictiveInputQwertyPhrase methods. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 #include "AknFepUiInputStatePredictiveInputQwertyZhuyinPhrase.h" |
|
31 #include "AknFepUICtrlCandidatePane.h" |
|
32 #include "AknFepUiCtrlContainerChinese.h" |
|
33 #include "AknFepUIManagerStateInterface.h" //MAknFepUIManagerStateInterface |
|
34 #include "AknFepManagerUIInterface.h" //MAknFepManagerUIInterface |
|
35 #include "AknFepManager.h" //FepMan flag |
|
36 #include "AknFepManagerUIInterface.h" |
|
37 |
|
38 #include <PtiEngine.h> //CPtiEngine |
|
39 |
|
40 TAknFepInputStatePredictiveInputQwertyZhuyinPhrase:: |
|
41 TAknFepInputStatePredictiveInputQwertyZhuyinPhrase( |
|
42 MAknFepUIManagerStateInterface* aOwner, |
|
43 MAknFepUICtrlContainerChinese* aUIContainer) |
|
44 :TAknFepInputStateCandidateQwertyChinesePhrase(aOwner, aUIContainer) |
|
45 { |
|
46 iState = EPredictiveInput; |
|
47 |
|
48 CPtiEngine* ptiengine = iOwner->PtiEngine(); |
|
49 MAknFepUICtrlContainerChinese* uiContainer = UIContainer(); |
|
50 uiContainer->CandidatePane()->SelectFirstPhrase(); |
|
51 |
|
52 TBool multiplePages = !(uiContainer->CandidatePane()->IsLastPage() && |
|
53 uiContainer->CandidatePane()->IsFirstPage()); |
|
54 TInt bufLength = ptiengine->CandidatePage().Length(); |
|
55 TBool showHorizontalScrollArrows = multiplePages || bufLength>1; |
|
56 |
|
57 uiContainer->ShowVerticalScrollArrows(multiplePages); |
|
58 uiContainer->ShowHorizontalScrollArrows(showHorizontalScrollArrows); |
|
59 uiContainer->CandidatePane()->ShowCandidateOrdinals(ETrue); |
|
60 UpdateIndicator(); |
|
61 } |
|
62 |
|
63 TBool TAknFepInputStatePredictiveInputQwertyZhuyinPhrase::HandleKeyL(TInt aKey, |
|
64 TKeyPressLength aLength) |
|
65 { |
|
66 TBool ret = ETrue; |
|
67 |
|
68 if (iOwner->FepMan()->IsFlagSet(CAknFepManager::EFlagQwertyShiftMode)) |
|
69 { |
|
70 return ret; |
|
71 } |
|
72 |
|
73 if(aKey == EStdKeyBackspace) |
|
74 { |
|
75 iOwner->FepMan()->TryCloseUiL(); |
|
76 } |
|
77 else if(aKey == EStdKeyLeftFunc && aLength == EShortKeyPress && |
|
78 iOwner->FepMan()->IsFlagSet(CAknFepManager::EFlagNoActionDuringChrKeyPress)) |
|
79 { |
|
80 MAknFepManagerUIInterface* fepMan = iOwner->FepMan(); |
|
81 if (fepMan->IsAbleToLaunchSCT()) |
|
82 { |
|
83 fepMan->LaunchSpecialCharacterTableL(); |
|
84 } |
|
85 } |
|
86 else if (iOwner->FepMan()->IsFlagSet(CAknFepManager::EFlagQwertyChrKeyDepressed)) |
|
87 { |
|
88 iOwner->FepMan()->ClearFlag(CAknFepManager::EFlagNoActionDuringChrKeyPress); |
|
89 return ret; |
|
90 } |
|
91 else if(iOwner->IsValidChineseInputKeyQwerty(aKey) && |
|
92 !(aKey >= EPtiKeyQwerty0 && aKey <= EPtiKeyQwerty9)) |
|
93 { |
|
94 ret = ret; //passes to entry state to handle the key |
|
95 } |
|
96 else if (aKey == EStdKeyEnter || aKey == EStdKeySpace) |
|
97 { |
|
98 return ret; |
|
99 } |
|
100 else |
|
101 { |
|
102 ret = TAknFepInputStateCandidateQwertyChinesePhrase::HandleKeyL(aKey, aLength); |
|
103 } |
|
104 return ret; |
|
105 } |
|
106 |
|
107 // End of file |