author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:55:58 +0300 | |
branch | RCL_3 |
changeset 56 | 8152b1f1763a |
parent 44 | ecbabf52600f |
permissions | -rw-r--r-- |
44 | 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 |
{ |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
222 |
case ELatin: |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
223 |
{ |
44 | 224 |
iFepUiState = TAknFepInputStateQwertyKorean(this); |
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
225 |
break; |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
226 |
} |
44 | 227 |
default: |
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
228 |
AknFepPanic(EAknFepPanicBadInputState); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
229 |
break; |
44 | 230 |
} |
231 |
break; |
|
232 |
} |
|
233 |
||
234 |
case EPredictiveInput: |
|
235 |
AknFepPanic(EAknFepPanicBadInputState); |
|
236 |
break; |
|
237 |
||
238 |
default: |
|
239 |
AknFepPanic(EAknFepPanicBadInputState); |
|
240 |
break; |
|
241 |
} |
|
242 |
||
243 |
iPtiEngine->SetObserver(&iFepUiState); |
|
244 |
#ifdef _DEBUG |
|
245 |
RDebug::Print(_L("UI Manager: New State: %d"), iFepUiState.State()); |
|
246 |
#endif |
|
247 |
return iStatePtr->State(); |
|
248 |
} |
|
249 |
||
250 |
// --------------------------------------------------------------------------- |
|
251 |
// CAknFepUIManagerKorean::CAknFepUIManagerKorean |
|
252 |
// |
|
253 |
// |
|
254 |
// --------------------------------------------------------------------------- |
|
255 |
// |
|
256 |
CAknFepUIManagerKorean::CAknFepUIManagerKorean(MAknFepManagerUIInterface* aFepMan, CAknFepCaseManager* aCaseMan) |
|
257 |
: CAknFepUIManagerBase(aFepMan, aCaseMan), |
|
258 |
iFepUiState(NULL) |
|
259 |
||
260 |
{ |
|
261 |
} |
|
262 |
||
263 |
// --------------------------------------------------------------------------- |
|
264 |
// CAknFepUIManagerKorean::ConstructL |
|
265 |
// |
|
266 |
// |
|
267 |
// --------------------------------------------------------------------------- |
|
268 |
// |
|
269 |
void CAknFepUIManagerKorean::ConstructL(TLanguage aLanguage) |
|
270 |
{ |
|
271 |
CAknFepUIManagerBase::ConstructL(aLanguage); |
|
272 |
} |
|
273 |
||
274 |
// --------------------------------------------------------------------------- |
|
275 |
// CAknFepUIManagerKorean::FepUIState |
|
276 |
// |
|
277 |
// |
|
278 |
// --------------------------------------------------------------------------- |
|
279 |
// |
|
280 |
TAknFepInputStateBase* CAknFepUIManagerKorean::FepUIState() |
|
281 |
{ |
|
282 |
return &iFepUiState; |
|
283 |
} |
|
284 |
||
285 |
// End of file |