|
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: Provides the CAknFepUIManagerKorean Methods. |
|
15 * |
|
16 */ |
|
17 |
|
18 // INCLUDE FILES |
|
19 #include <e32svr.h> // RDebug stuff... |
|
20 #include <e32keys.h> |
|
21 |
|
22 #include "AknFepGlobalEnums.h" |
|
23 #include "AknFepManagerUIInterface.h" |
|
24 #include "AknFepManagerInterface.h" |
|
25 #include "AknFepUIManagerStateInterface.h" |
|
26 #include "AknFepUiManagerBase.h" |
|
27 #include "AknFepUiManagerKorean.h" |
|
28 |
|
29 // Western input |
|
30 #include "AknFepUiInputStateInitialLatinMultitap.h" |
|
31 #include "AknFepUiInputStateInitialNumber.h" |
|
32 |
|
33 //Korean input |
|
34 #include "AknFepUiInputStateInitialKoreanMultitap.h" |
|
35 #include "AknFepUiInputStateQwertyKorean.h" |
|
36 #include "AknFepPanic.h" |
|
37 |
|
38 #include <AknIndicatorContainer.h> // CAknIndicatorContainer::TIndicatorContext |
|
39 #include <PtiEngine.h> |
|
40 #include <PtiDefs.h> |
|
41 |
|
42 // CONSTANTS |
|
43 |
|
44 /** |
|
45 * CAknFepUIManagerKorean class. |
|
46 * |
|
47 */ |
|
48 |
|
49 //============================ MEMBER FUNCTIONS ============================== |
|
50 |
|
51 |
|
52 // --------------------------------------------------------------------------- |
|
53 // CAknFepUIManagerKorean::NewL |
|
54 // |
|
55 // |
|
56 // --------------------------------------------------------------------------- |
|
57 // |
|
58 CAknFepUIManagerKorean* CAknFepUIManagerKorean::NewL(MAknFepManagerUIInterface* aFepMan, CAknFepCaseManager* aCaseMan, TLanguage aLanguage) |
|
59 { |
|
60 CAknFepUIManagerKorean* self = new(ELeave)CAknFepUIManagerKorean(aFepMan, aCaseMan); |
|
61 CleanupStack::PushL(self); |
|
62 self->ConstructL(aLanguage); |
|
63 CleanupStack::Pop(); |
|
64 return self; |
|
65 } |
|
66 |
|
67 // --------------------------------------------------------------------------- |
|
68 // CAknFepUIManagerKorean::~CAknFepUIManagerKorean |
|
69 // |
|
70 // |
|
71 // --------------------------------------------------------------------------- |
|
72 // |
|
73 CAknFepUIManagerKorean::~CAknFepUIManagerKorean() |
|
74 { |
|
75 } |
|
76 |
|
77 // --------------------------------------------------------------------------- |
|
78 // CAknFepUIManagerKorean::HandleKeyL |
|
79 // |
|
80 // |
|
81 // --------------------------------------------------------------------------- |
|
82 // |
|
83 TBool CAknFepUIManagerKorean::HandleKeyL( TInt aKey, TKeyPressLength aLength, |
|
84 TEventCode /*aEventCode*/ ) |
|
85 { |
|
86 TUIState currentState = iFepUiState.State(); |
|
87 if (aLength == EShortKeyPress) |
|
88 { |
|
89 iInitialFepUIState = currentState; |
|
90 } |
|
91 |
|
92 if(!iStatePtr->HandleKeyL(aKey, aLength)) |
|
93 { |
|
94 if(currentState != iStatePtr->State()) //Check to see if we've changed state. |
|
95 { |
|
96 return iStatePtr->HandleKeyL(aKey, aLength); |
|
97 } |
|
98 return EFalse; // we've failed to handle it.. |
|
99 } |
|
100 return ETrue; //we're ok. |
|
101 } |
|
102 |
|
103 // --------------------------------------------------------------------------- |
|
104 // CAknFepUIManagerKorean::CloseUI |
|
105 // |
|
106 // |
|
107 // --------------------------------------------------------------------------- |
|
108 // |
|
109 void CAknFepUIManagerKorean::CloseUI() |
|
110 { |
|
111 ChangeState(EInitial); |
|
112 } |
|
113 |
|
114 // --------------------------------------------------------------------------- |
|
115 // CAknFepUIManagerKorean::SupportLanguage |
|
116 // |
|
117 // |
|
118 // --------------------------------------------------------------------------- |
|
119 // |
|
120 TInt CAknFepUIManagerKorean::SupportLanguage(TInt aMode) const |
|
121 { |
|
122 TInt lang = iLanguage; |
|
123 switch (aMode) |
|
124 { |
|
125 case ELatin: |
|
126 { |
|
127 lang = ELangEnglish; |
|
128 } |
|
129 break; |
|
130 case EHangul: |
|
131 case ENumeric: |
|
132 default: |
|
133 break; |
|
134 } |
|
135 return lang; |
|
136 } |
|
137 |
|
138 // --------------------------------------------------------------------------- |
|
139 // CAknFepUIManagerKorean::ActivateUI |
|
140 // |
|
141 // |
|
142 // --------------------------------------------------------------------------- |
|
143 // |
|
144 void CAknFepUIManagerKorean::ActivateUI() |
|
145 { |
|
146 ChangeState(EEntry); |
|
147 } |
|
148 |
|
149 // --------------------------------------------------------------------------- |
|
150 // CAknFepUIManagerKorean::ChangeState |
|
151 // |
|
152 // |
|
153 // --------------------------------------------------------------------------- |
|
154 // MAknFepUIManagerStateInterface |
|
155 TUIState CAknFepUIManagerKorean::ChangeState(TUIState aState) |
|
156 { |
|
157 switch(aState) |
|
158 { |
|
159 case EInitial: |
|
160 { |
|
161 switch(iMode) |
|
162 { |
|
163 case ELatin: |
|
164 { |
|
165 iFepUiState = TAknFepInputStateInitialLatinMultitap(this); |
|
166 break; |
|
167 } |
|
168 case EHangul: |
|
169 { |
|
170 iFepUiState = TAknFepInputStateInitialKoreanMultitap(this); |
|
171 break; |
|
172 } |
|
173 case ENumber: |
|
174 case ENativeNumber: |
|
175 { |
|
176 //Map directly to the resources... |
|
177 iFepUiState = TAknFepInputStateInitialNumber(this); |
|
178 break; |
|
179 } |
|
180 default: |
|
181 AknFepPanic(EAknFepPanicBadInputState); |
|
182 break; |
|
183 } |
|
184 break; |
|
185 } |
|
186 case EEntry: |
|
187 { |
|
188 switch(iMode) |
|
189 { |
|
190 default: |
|
191 AknFepPanic(EAknFepPanicBadInputState); |
|
192 break; |
|
193 } |
|
194 break; |
|
195 } |
|
196 case ECandidate: |
|
197 { |
|
198 switch(iMode) |
|
199 { |
|
200 default: |
|
201 AknFepPanic(EAknFepPanicBadInputState); |
|
202 break; |
|
203 } |
|
204 break; |
|
205 } |
|
206 |
|
207 case EPredictiveCandidate: |
|
208 { |
|
209 switch(iMode) |
|
210 { |
|
211 default: |
|
212 AknFepPanic(EAknFepPanicBadInputState); |
|
213 break; |
|
214 } |
|
215 break; |
|
216 } |
|
217 |
|
218 case EQwerty: |
|
219 { |
|
220 switch(iMode) |
|
221 { |
|
222 case EHangul: |
|
223 iFepUiState = TAknFepInputStateQwertyKorean(this); |
|
224 break; |
|
225 case ELatin: |
|
226 case ENumber: |
|
227 case ENativeNumber: |
|
228 iFepUiState = TAknFepInputStateQwerty(this); |
|
229 break; |
|
230 default: |
|
231 AknFepPanic(EAknFepPanicBadInputState); |
|
232 break; |
|
233 } |
|
234 break; |
|
235 } |
|
236 |
|
237 case EPredictiveInput: |
|
238 AknFepPanic(EAknFepPanicBadInputState); |
|
239 break; |
|
240 |
|
241 default: |
|
242 AknFepPanic(EAknFepPanicBadInputState); |
|
243 break; |
|
244 } |
|
245 |
|
246 iPtiEngine->SetObserver(&iFepUiState); |
|
247 #ifdef _DEBUG |
|
248 RDebug::Print(_L("UI Manager: New State: %d"), iFepUiState.State()); |
|
249 #endif |
|
250 return iStatePtr->State(); |
|
251 } |
|
252 |
|
253 // --------------------------------------------------------------------------- |
|
254 // CAknFepUIManagerKorean::CAknFepUIManagerKorean |
|
255 // |
|
256 // |
|
257 // --------------------------------------------------------------------------- |
|
258 // |
|
259 CAknFepUIManagerKorean::CAknFepUIManagerKorean(MAknFepManagerUIInterface* aFepMan, CAknFepCaseManager* aCaseMan) |
|
260 : CAknFepUIManagerBase(aFepMan, aCaseMan), |
|
261 iFepUiState(NULL) |
|
262 |
|
263 { |
|
264 } |
|
265 |
|
266 // --------------------------------------------------------------------------- |
|
267 // CAknFepUIManagerKorean::ConstructL |
|
268 // |
|
269 // |
|
270 // --------------------------------------------------------------------------- |
|
271 // |
|
272 void CAknFepUIManagerKorean::ConstructL(TLanguage aLanguage) |
|
273 { |
|
274 CAknFepUIManagerBase::ConstructL(aLanguage); |
|
275 } |
|
276 |
|
277 // --------------------------------------------------------------------------- |
|
278 // CAknFepUIManagerKorean::FepUIState |
|
279 // |
|
280 // |
|
281 // --------------------------------------------------------------------------- |
|
282 // |
|
283 TAknFepInputStateBase* CAknFepUIManagerKorean::FepUIState() |
|
284 { |
|
285 return &iFepUiState; |
|
286 } |
|
287 |
|
288 // End of file |