|
1 /* |
|
2 * Copyright (c) 2002 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 TAknFepInputStateInitialStrokeFind methods. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 #include "AknFepUiInputStateInitialStrokeFind.h" |
|
31 #include "AknFepUIManagerStateInterface.h" |
|
32 #include "AknFepManagerUIInterface.h" |
|
33 |
|
34 #include <e32keys.h> |
|
35 #include <PtiEngine.h> |
|
36 #include <PtiDefs.h> //keys |
|
37 |
|
38 #include "AknFepUiCtrlContainerChinese.h" |
|
39 #include "AknFepUICtrlCandidatePane.h" |
|
40 |
|
41 TAknFepInputStateInitialStrokeFind::TAknFepInputStateInitialStrokeFind( |
|
42 MAknFepUIManagerStateInterface* aOwner, |
|
43 MAknFepUICtrlContainerChinese* aUIContainer) |
|
44 :TAknFepInputStateChineseBase(aOwner, aUIContainer) |
|
45 { |
|
46 iState = EInitial; |
|
47 iOwner->PtiEngine()->SetInputMode(EPtiEngineStroke); |
|
48 } |
|
49 |
|
50 TBool TAknFepInputStateInitialStrokeFind::HandleKeyL(TInt aKey, TKeyPressLength aLength) |
|
51 { |
|
52 MAknFepManagerUIInterface* fepMan = iOwner->FepMan(); |
|
53 CPtiEngine* ptiengine = iOwner->PtiEngine(); |
|
54 TBool ret = ETrue; |
|
55 |
|
56 if (aKey == EKeyBackspace || aKey == EKeyOK) |
|
57 { |
|
58 ret = EFalse; |
|
59 } |
|
60 else if (aLength == EShortKeyPress) |
|
61 { |
|
62 if (aKey == EPtiKeyStar) |
|
63 { |
|
64 if (aLength == EShortKeyPress) |
|
65 { |
|
66 if (fepMan->EditSubmenuInUse()) |
|
67 { |
|
68 fepMan->ClearCcpuFlag(CAknFepManager::ECcpuStateIgnoreStarUp); |
|
69 return ret; |
|
70 } |
|
71 else if (fepMan->IsAbleToLaunchSCT()) |
|
72 { |
|
73 fepMan->LaunchSpecialCharacterTableL(); |
|
74 } |
|
75 } |
|
76 else |
|
77 { |
|
78 if (fepMan->EditSubmenuInUse()) |
|
79 { |
|
80 fepMan->LaunchSpecialCharacterTableL(); |
|
81 } |
|
82 } |
|
83 } |
|
84 else if (iOwner->IsValidChineseInputKey(aKey)) |
|
85 { |
|
86 ptiengine->AppendKeyPress((TPtiKey)aKey); |
|
87 TPtrC text = ptiengine->GetPhoneticSpelling(1); |
|
88 |
|
89 if(text.Length()) |
|
90 { |
|
91 fepMan->NewCharacterL(text); |
|
92 fepMan->CommitInlineEditL(); |
|
93 ptiengine->ClearCurrentWord(); |
|
94 } |
|
95 else |
|
96 { |
|
97 ret = EFalse; |
|
98 } |
|
99 } |
|
100 } |
|
101 else |
|
102 { |
|
103 if (aKey == EPtiKeyStar) |
|
104 { |
|
105 if (fepMan->EditSubmenuInUse()) |
|
106 { |
|
107 fepMan->LaunchSpecialCharacterTableL(); |
|
108 } |
|
109 } |
|
110 } |
|
111 return ret; |
|
112 } |
|
113 |
|
114 // End of file |