|
1 /* |
|
2 * Copyright (c) 2002-2006 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 * |
|
16 */ |
|
17 |
|
18 #include <S32MEM.H> |
|
19 #include <centralrepository.h> |
|
20 #include <AknFepGlobalEnums.h> |
|
21 #include <AknFepPeninputEnums.h> |
|
22 #include <AknEdsts.h> |
|
23 |
|
24 #include <PeninputCommonLayoutGlobalEnum.h> |
|
25 |
|
26 #include "PeninputPluginKrDbg.h" |
|
27 #include "PeninputPluginKr.hrh" |
|
28 #include "PluginKrFepManagerBase.h" |
|
29 |
|
30 // --------------------------------------------------------------------------- |
|
31 // Constructors & Destructors |
|
32 // --------------------------------------------------------------------------- |
|
33 // |
|
34 |
|
35 CPluginKrFepManagerBase::CPluginKrFepManagerBase( |
|
36 CPeninputPluginKr& aOwner, |
|
37 RPeninputServer& aPenInputServer) |
|
38 : iOwner(aOwner), |
|
39 iPenInputServer(aPenInputServer), |
|
40 iSuggestedRange(ERangeInvalid), |
|
41 iLastRange(ERangeInvalid) |
|
42 { |
|
43 } |
|
44 |
|
45 void CPluginKrFepManagerBase::ConstructL() |
|
46 { |
|
47 |
|
48 } |
|
49 |
|
50 CPluginKrFepManagerBase::~CPluginKrFepManagerBase() |
|
51 { |
|
52 delete iRepository; |
|
53 } |
|
54 |
|
55 // --------------------------------------------------------------------------- |
|
56 // from MAknFepManagerInterface |
|
57 // --------------------------------------------------------------------------- |
|
58 // |
|
59 |
|
60 void CPluginKrFepManagerBase::SetMode( |
|
61 TInt aMode, |
|
62 TBool aPredictive, |
|
63 TBool aQwertyInputMode, |
|
64 TInt /*aKeyboardType*/ ) |
|
65 { |
|
66 LOG3("FEP.IMEPLG.KR.Base.SetMode %d %d %d",aMode,aPredictive,aQwertyInputMode); |
|
67 iHkbUi->SetMode(aMode, aPredictive, aQwertyInputMode); |
|
68 } |
|
69 |
|
70 void CPluginKrFepManagerBase::SetCase(TCase aCase) |
|
71 { |
|
72 LOG1("FEP.IMEPLG.KR.Base.SetCase %d",aCase); |
|
73 iHkbUi->SetCase(aCase); |
|
74 } |
|
75 |
|
76 void CPluginKrFepManagerBase::SetNumberModeKeyMappingL( |
|
77 TAknEditorNumericKeymap aAknEditorNumericKeymap) |
|
78 { |
|
79 LOG1("FEP.IMEPLG.KR.Base.SetNumberModeKeyMappingL %d",aAknEditorNumericKeymap); |
|
80 SendCommandToServer(ECmdPenInputEditorNumericKeyMap, aAknEditorNumericKeymap); |
|
81 } |
|
82 |
|
83 TBool CPluginKrFepManagerBase::HandleKeyL( |
|
84 TInt aKey, |
|
85 TKeyPressLength aLength, |
|
86 TEventCode /*aEventCode*/ ) |
|
87 { |
|
88 LOG2("FEP.IMEPLG.KR.Base.HandleKeyL %d",aKey,aLength); |
|
89 return iHkbUi->HandleKeyL( aKey, aLength ); |
|
90 } |
|
91 |
|
92 void CPluginKrFepManagerBase::HandleCommandL( |
|
93 TInt aCommandId) |
|
94 { |
|
95 LOG1("FEP.IMEPLG.KR.Base.HandleCommandL %d",aCommandId); |
|
96 SendCommandToServer( aCommandId ); |
|
97 } |
|
98 |
|
99 void CPluginKrFepManagerBase::HandleCommandL( |
|
100 TInt aCommandId, |
|
101 TInt aParam) |
|
102 { |
|
103 switch ( aCommandId ) |
|
104 { |
|
105 case ECmdPenInputRange: |
|
106 { |
|
107 LOG1("FEP.IMEPLG.KR.Base.HandleCommandL ECmdPenInputRange %d",iHkbMode); |
|
108 if (aParam&EPRCFind) LOG("FEP.IMEPLG.KR.Base EPRCFind"); |
|
109 if (aParam&ECangJie) LOG("FEP.IMEPLG.KR.Base ECangJie"); |
|
110 if (aParam&EZhuyinFind) LOG("FEP.IMEPLG.KR.Base EZhuyinFind"); |
|
111 if (aParam&EStrokeFind) LOG("FEP.IMEPLG.KR.Base EStrokeFind"); |
|
112 if (aParam&EPinyin) LOG("FEP.IMEPLG.KR.Base EPinyin"); |
|
113 if (aParam&EZhuyin) LOG("FEP.IMEPLG.KR.Base EZhuyin"); |
|
114 if (aParam&EStroke) LOG("FEP.IMEPLG.KR.Base EStroke"); |
|
115 if (aParam&ELatin) LOG("FEP.IMEPLG.KR.Base ELatin"); |
|
116 if (aParam&ENumber) LOG("FEP.IMEPLG.KR.Base ENumber"); |
|
117 if (aParam&EHiraganaKanji) LOG("FEP.IMEPLG.KR.Base EHiraganaKanji"); |
|
118 if (aParam&EKatakana) LOG("FEP.IMEPLG.KR.Base EKatakana"); |
|
119 if (aParam&EHiragana) LOG("FEP.IMEPLG.KR.Base EHiragana"); |
|
120 if (aParam&EHindi) LOG("FEP.IMEPLG.KR.Base EHindi"); |
|
121 if (aParam&ENativeNumber) LOG("FEP.IMEPLG.KR.Base ENativeNumber"); |
|
122 if (aParam&EHangul) LOG("FEP.IMEPLG.KR.Base EHangul"); |
|
123 if (aParam&ELatinText) LOG("FEP.IMEPLG.KR.Base ELatinText"); |
|
124 if (aParam&ELatinUpper) LOG("FEP.IMEPLG.KR.Base ELatinUpper"); |
|
125 if (aParam&ELatinLower) LOG("FEP.IMEPLG.KR.Base ELatinLower"); |
|
126 if (aParam&ECangJieNormal) LOG("FEP.IMEPLG.KR.Base ECangJieNormal"); |
|
127 if (aParam&ECangJieEasy) LOG("FEP.IMEPLG.KR.Base ECangJieEasy"); |
|
128 if (aParam&ECangJieAdvanced) LOG("FEP.IMEPLG.KR.Base ECangJieAdvanced"); |
|
129 iHkbMode = aParam; |
|
130 } |
|
131 break; |
|
132 case ECmdPenInputPermittedRange: |
|
133 { |
|
134 LOG("FEP.IMEPLG.KR.Base.HandleCommandL ECmdPenInputPermittedRange"); |
|
135 if (aParam&EAknEditorTextInputMode) LOG("FEP.IMEPLG.KR.Base EAknEditorTextInputMode"); |
|
136 if (aParam&EAknEditorNumericInputMode) LOG("FEP.IMEPLG.KR.Base EAknEditorNumericInputMode"); |
|
137 if (aParam&EAknEditorSecretAlphaInputMode) LOG("FEP.IMEPLG.KR.Base EAknEditorSecretAlphaInputMode"); |
|
138 if (aParam&EAknEditorKatakanaInputMode) LOG("FEP.IMEPLG.KR.Base EAknEditorKatakanaInputMode"); |
|
139 if (aParam&EAknEditorFullWidthTextInputMode) LOG("FEP.IMEPLG.KR.Base EAknEditorFullWidthTextInputMode"); |
|
140 if (aParam&EAknEditorFullWidthNumericInputMode) LOG("FEP.IMEPLG.KR.Base EAknEditorFullWidthNumericInputMode"); |
|
141 if (aParam&EAknEditorFullWidthKatakanaInputMode) LOG("FEP.IMEPLG.KR.Base EAknEditorFullWidthKatakanaInputMode"); |
|
142 if (aParam&EAknEditorHiraganaKanjiInputMode) LOG("FEP.IMEPLG.KR.Base EAknEditorHiraganaKanjiInputMode"); |
|
143 if (aParam&EAknEditorHiraganaInputMode) LOG("FEP.IMEPLG.KR.Base EAknEditorHiraganaInputMode"); |
|
144 if (aParam&EAknEditorHalfWidthTextInputMode) LOG("FEP.IMEPLG.KR.Base EAknEditorHalfWidthTextInputMode"); |
|
145 if (aParam&EAknEditorHangulInputMode) LOG("FEP.IMEPLG.KR.Base EAknEditorHangulInputMode"); |
|
146 iLastCase = ECaseInvalide; |
|
147 SetLayoutPermitedRanges( aParam ); |
|
148 } |
|
149 break; |
|
150 case ECmdPenInputEditorState: |
|
151 { |
|
152 LOG("FEP.IMEPLG.KR.Base.HandleCommandL ECmdPenInputEditorState"); |
|
153 SetLayoutRange(reinterpret_cast<CAknEdwinState*>(aParam)); |
|
154 } |
|
155 break; |
|
156 case ECmdPenInputSetWindowPos: |
|
157 { |
|
158 LOG("FEP.IMEPLG.KR.Base.HandleCommandL ECmdPenInputSetWindowPos"); |
|
159 //SetLayoutPosition(*reinterpret_cast<TRect*>(aParam)); |
|
160 } |
|
161 break; |
|
162 case ECmdPenInputCaseMode: |
|
163 LOG1("FEP.IMEPLG.KR.Base.HandleCommandL ECmdPenInputCaseMode %d",aParam); |
|
164 //if( aParam != iLastCase ) |
|
165 { |
|
166 SendCommandToServer( ECmdPenInputCase, aParam ); |
|
167 iLastCase = aParam; |
|
168 } |
|
169 break; |
|
170 case ECmdPenInputEditorCustomNumericKeyMap: |
|
171 { |
|
172 LOG("FEP.IMEPLG.KR.Base.HandleCommandL ECmdPenInputEditorCustomNumericKeyMap"); |
|
173 TDesC* res = (TDesC*)aParam; |
|
174 TPtrC8 param; |
|
175 param.Set((TUint8*)res->Ptr(), res->Size()); |
|
176 SendCommandToServer( aCommandId, param ); |
|
177 SetNumberModeKeyMappingL((TAknEditorNumericKeymap)EKeymapFromResource); |
|
178 } |
|
179 break; |
|
180 case ECmdPenInputSuggestRange: |
|
181 LOG("FEP.IMEPLG.KR.Base.HandleCommandL ECmdPenInputSuggestRange"); |
|
182 iSuggestedRange = aParam; |
|
183 if( iSuggestedRange == ERangeAccent ) |
|
184 { |
|
185 iSuggestedRange = ERangeEnglish; |
|
186 } |
|
187 break; |
|
188 case ECmdPenInputSendEditorTextAndCurPos: |
|
189 { |
|
190 LOG("FEP.IMEPLG.KR.Base.HandleCommandL ECmdPenInputSendEditorTextAndCurPos"); |
|
191 TFepInputContextFieldData* pIcfData = |
|
192 reinterpret_cast<TFepInputContextFieldData*>( aParam ); |
|
193 |
|
194 TInt dataSize = sizeof( TFepInputContextFieldData ); |
|
195 TInt textSize = pIcfData->iText.Size(); |
|
196 |
|
197 HBufC8* buf = HBufC8::NewLC(dataSize + textSize + 2*sizeof(TInt)); |
|
198 TPtr8 bufPtr = buf->Des(); |
|
199 |
|
200 RDesWriteStream writeStream; |
|
201 writeStream.Open(bufPtr); |
|
202 CleanupClosePushL(writeStream); |
|
203 |
|
204 writeStream.WriteInt32L(dataSize); |
|
205 writeStream.WriteInt32L(textSize); |
|
206 |
|
207 const TUint8* pData = reinterpret_cast<const TUint8*>( pIcfData ); |
|
208 writeStream.WriteL( pData, dataSize ); |
|
209 |
|
210 const TUint8* pText = reinterpret_cast<const TUint8*>( pIcfData->iText.Ptr() ); |
|
211 writeStream.WriteL( pText, textSize ); |
|
212 |
|
213 writeStream.CommitL(); |
|
214 |
|
215 SendCommandToServer( aCommandId, bufPtr ); |
|
216 |
|
217 CleanupStack::PopAndDestroy(&writeStream); |
|
218 CleanupStack::PopAndDestroy(buf); |
|
219 } |
|
220 break; |
|
221 case ECmdPenInputSetPromptText: |
|
222 { |
|
223 LOG("FEP.IMEPLG.KR.Base.HandleCommandL ECmdPenInputSetPromptText"); |
|
224 TFepPromptText* pPromptData = |
|
225 reinterpret_cast<TFepPromptText*>( aParam ); |
|
226 |
|
227 TInt dataSize = sizeof( TFepPromptText ); |
|
228 TInt textSize = 0; |
|
229 |
|
230 if (pPromptData->iText.Length()) |
|
231 { |
|
232 textSize = pPromptData->iText.Size(); |
|
233 } |
|
234 |
|
235 HBufC8* buf = HBufC8::NewLC(dataSize + textSize + 2*sizeof(TInt)); |
|
236 TPtr8 bufPtr = buf->Des(); |
|
237 |
|
238 RDesWriteStream writeStream; |
|
239 writeStream.Open(bufPtr); |
|
240 CleanupClosePushL(writeStream); |
|
241 |
|
242 writeStream.WriteInt32L(dataSize); |
|
243 writeStream.WriteInt32L(textSize); |
|
244 |
|
245 const TUint8* pData = reinterpret_cast<const TUint8*>( pPromptData ); |
|
246 writeStream.WriteL( pData, dataSize ); |
|
247 |
|
248 if (textSize != 0) |
|
249 { |
|
250 const TUint16* pText = pPromptData->iText.Ptr(); |
|
251 writeStream.WriteL( pText, textSize/2 ); |
|
252 } |
|
253 |
|
254 writeStream.CommitL(); |
|
255 |
|
256 SendCommandToServer( aCommandId, bufPtr ); |
|
257 |
|
258 CleanupStack::PopAndDestroy(&writeStream); |
|
259 CleanupStack::PopAndDestroy(buf); |
|
260 } |
|
261 break; |
|
262 case ECmdPenInputFingerMatchIndicator: |
|
263 { |
|
264 if (aParam) // ITUT |
|
265 { |
|
266 TFepIndicatorInfo* pIndicatorData = |
|
267 reinterpret_cast<TFepIndicatorInfo*>( aParam ); |
|
268 |
|
269 HBufC8* buf = HBufC8::NewLC(4 * sizeof(TInt)); |
|
270 TPtr8 bufPtr = buf->Des(); |
|
271 |
|
272 RDesWriteStream writeStream; |
|
273 writeStream.Open(bufPtr); |
|
274 CleanupClosePushL(writeStream); |
|
275 |
|
276 writeStream.WriteInt32L(pIndicatorData->iIndicatorImgID); |
|
277 writeStream.WriteInt32L(pIndicatorData->iIndicatorMaskID); |
|
278 writeStream.WriteInt32L(pIndicatorData->iIndicatorTextImgID); |
|
279 writeStream.WriteInt32L(pIndicatorData->iIndicatorTextMaskID); |
|
280 |
|
281 writeStream.CommitL(); |
|
282 |
|
283 SendCommandToServer( aCommandId, bufPtr ); |
|
284 |
|
285 CleanupStack::PopAndDestroy(&writeStream); |
|
286 CleanupStack::PopAndDestroy(buf); |
|
287 } |
|
288 else |
|
289 { |
|
290 SendCommandToServer( aCommandId, 0 ); |
|
291 } |
|
292 } |
|
293 break; |
|
294 default: |
|
295 LOG2("FEP.IMEPLG.KR.Base.HandleCommandL %d 0x%08x",aCommandId,aParam); |
|
296 SendCommandToServer( aCommandId, aParam ); |
|
297 break; |
|
298 } |
|
299 } |
|
300 |
|
301 void CPluginKrFepManagerBase::CloseUI() |
|
302 { |
|
303 LOG("FEP.IMEPLG.KR.Base.CloseUI"); |
|
304 if ( iPenInputServer.IsVisible() ) |
|
305 { |
|
306 iPenInputServer.ActivateLayout( EFalse ); |
|
307 } |
|
308 } |
|
309 |
|
310 void CPluginKrFepManagerBase::ExpireMultitapTimer() |
|
311 { |
|
312 LOG("FEP.IMEPLG.KR.Base.ExpireMultitapTimer"); |
|
313 } |
|
314 |
|
315 TBool CPluginKrFepManagerBase::IsValidNumericLongKeyPress(TInt aKey) const |
|
316 { |
|
317 LOG1("FEP.IMEPLG.KR.Base.IsValidNumericLongKeyPress %d",aKey); |
|
318 return EFalse; |
|
319 } |
|
320 |
|
321 void CPluginKrFepManagerBase::AddTextToUserDictionaryL(const TDesC& aText) |
|
322 { |
|
323 TPtrC ptr(aText); |
|
324 LOG1("FEP.IMEPLG.KR.Base.AddTextToUserDictionaryL %S",&ptr); |
|
325 } |
|
326 |
|
327 void CPluginKrFepManagerBase::GetFormatOfFepInlineText( |
|
328 TCharFormat& /*aFormat*/, |
|
329 TInt& /*aNumberOfCharactersWithSameFormat*/, |
|
330 TInt aPositionOfCharacter) const |
|
331 { |
|
332 LOG1("FEP.IMEPLG.KR.Base.GetFormatOfFepInlineText %S",aPositionOfCharacter); |
|
333 } |
|
334 |
|
335 TInt CPluginKrFepManagerBase::SupportLanguage(TInt aMode) const |
|
336 { |
|
337 LOG2("FEP.IMEPLG.KR.Base.SupportLanguage %d - %d",aMode,iLanguage); |
|
338 return iLanguage; |
|
339 } |
|
340 |
|
341 void CPluginKrFepManagerBase::SetInputLanguageL(TLanguage aLanguage) |
|
342 { |
|
343 LOG1("FEP.IMEPLG.KR.Base.SetInputLanguageL %d",aLanguage); |
|
344 iLanguage = aLanguage; |
|
345 SendCommandToServer(ECmdPenInputLanguage, (TInt)aLanguage); |
|
346 } |
|
347 |
|
348 TBool CPluginKrFepManagerBase::IsValidShiftKeyPress() const |
|
349 { |
|
350 LOG("FEP.IMEPLG.KR.Base.IsValidShiftKeyPress"); |
|
351 return EFalse; |
|
352 } |
|
353 |
|
354 void CPluginKrFepManagerBase::SetEditorContext(TInt aContext) |
|
355 { |
|
356 LOG1("FEP.IMEPLG.KR.Base.SetEditorContext %d",aContext); |
|
357 } |
|
358 |
|
359 void CPluginKrFepManagerBase::ActivateUI() |
|
360 { |
|
361 LOG("FEP.IMEPLG.KR.Base.ActivateUI"); |
|
362 iPenInputServer.ActivateLayout( ETrue ); |
|
363 } |
|
364 |
|
365 void CPluginKrFepManagerBase::SetFepAwareEditorText( |
|
366 const TFepInputContextFieldData& /*aIcfData*/) |
|
367 { |
|
368 LOG("FEP.IMEPLG.KR.Base.SetFepAwareEditorText"); |
|
369 } |
|
370 |
|
371 TInt CPluginKrFepManagerBase::EditorMaxLength() |
|
372 { |
|
373 LOG1("FEP.IMEPLG.KR.Base.EditorMaxLength - %d",iMaxEditorLength); |
|
374 return iMaxEditorLength; |
|
375 } |
|
376 |
|
377 void CPluginKrFepManagerBase::ResourceChanged(TInt aType) |
|
378 { |
|
379 LOG1("FEP.IMEPLG.KR.Base.ResourceChanged - %d",aType); |
|
380 iPenInputServer.ResourceChanged(aType); |
|
381 } |
|
382 |
|
383 void CPluginKrFepManagerBase::SetNextFepUI( |
|
384 MAknFepManagerInterface* aNextUi) |
|
385 { |
|
386 LOG("FEP.IMEPLG.KR.Base.SetNextFepUI"); |
|
387 iHkbUi = aNextUi; |
|
388 } |
|
389 |
|
390 void CPluginKrFepManagerBase::SetStarKeyFlag( TBool aSet ) |
|
391 { |
|
392 LOG1("FEP.IMEPLG.KR.Base.SetStarKeyFlag %d",aSet); |
|
393 } |
|
394 |
|
395 // --------------------------------------------------------------------------- |
|
396 // External Functions |
|
397 // --------------------------------------------------------------------------- |
|
398 // |
|
399 |
|
400 void CPluginKrFepManagerBase::OnInit() |
|
401 { |
|
402 |
|
403 } |
|
404 |
|
405 void CPluginKrFepManagerBase::RetrieveEditorMaxLength() |
|
406 { |
|
407 |
|
408 } |
|
409 |
|
410 void CPluginKrFepManagerBase::UpdateRange( TInt aRange ) |
|
411 { |
|
412 iLastRange=aRange; |
|
413 } |
|
414 |
|
415 void CPluginKrFepManagerBase::UpdateCaseMode( TInt aCaseMode ) |
|
416 { |
|
417 iLastCase = aCaseMode; |
|
418 } |
|
419 |
|
420 // --------------------------------------------------------------------------- |
|
421 // Internal Functions |
|
422 // --------------------------------------------------------------------------- |
|
423 // |
|
424 |
|
425 void CPluginKrFepManagerBase::SendCommandToServer( TInt aCommandId ) |
|
426 { |
|
427 iPenInputServer.HandleCommand( aCommandId ); |
|
428 } |
|
429 |
|
430 void CPluginKrFepManagerBase::SendCommandToServer( TInt aCommandId, TInt aParam ) |
|
431 { |
|
432 TBuf8<sizeof(TInt)> buf; |
|
433 buf.Append( (TUint8*)&aParam, sizeof(TInt) ); |
|
434 SendCommandToServer( aCommandId, buf ); |
|
435 } |
|
436 |
|
437 void CPluginKrFepManagerBase::SendCommandToServer(TInt aCommandId, const TDesC8& aParam) |
|
438 { |
|
439 iPenInputServer.HandleCommand( aCommandId, aParam ); |
|
440 } |
|
441 |
|
442 void CPluginKrFepManagerBase::SetLayoutRange(const CAknEdwinState* aEditorState) |
|
443 { |
|
444 //calculate permitted ranges |
|
445 // TODO: Korean specific permitted range can be added |
|
446 if (aEditorState) |
|
447 { |
|
448 if( aEditorState->Flags() & EAknEditorFlagLatinInputModesOnly ) |
|
449 { |
|
450 iPermittedRange &= ~ERangeNative; |
|
451 iPermittedRange &= ~ERangeNativeNumber; |
|
452 iPermittedRange &= ~ERangeSymbol; |
|
453 } |
|
454 /* |
|
455 if ( iPermittedMode != EAknEditorNumericInputMode |
|
456 && !( aEditorState->Flags() & EAknEditorFlagLatinInputModesOnly ) ) |
|
457 { |
|
458 iPermittedRange &= ~ERangeEnglish; |
|
459 } |
|
460 */ |
|
461 } |
|
462 else // for MFNE editor |
|
463 { |
|
464 if ( iPermittedMode == EAknEditorNumericInputMode ) |
|
465 { |
|
466 iPermittedRange &= ~ERangeSymbol; |
|
467 if( iHkbMode == ENumber ) |
|
468 { |
|
469 iPermittedRange = ERangeNumber; |
|
470 } |
|
471 else if ( iHkbMode == ENativeNumber ) |
|
472 { |
|
473 iPermittedRange = ERangeNativeNumber; |
|
474 } |
|
475 } |
|
476 } |
|
477 |
|
478 |
|
479 SendCommandToServer( ECmdPenInputPermittedRange, iPermittedRange ); |
|
480 |
|
481 TInt priRange; |
|
482 |
|
483 switch( iHkbMode ) |
|
484 { |
|
485 case ECangJie: |
|
486 case EStrokeFind: |
|
487 case EStroke: |
|
488 case EPinyin: |
|
489 case EZhuyin: |
|
490 case EZhuyinFind: |
|
491 case EHindi: |
|
492 case EHangul: |
|
493 { |
|
494 priRange = ERangeNative; |
|
495 } |
|
496 break; |
|
497 case ENumber: |
|
498 { |
|
499 priRange = ERangeNumber; |
|
500 } |
|
501 break; |
|
502 case ENativeNumber: |
|
503 { |
|
504 priRange = ERangeNativeNumber; |
|
505 } |
|
506 break; |
|
507 case EPRCFind: |
|
508 case ELatin: |
|
509 case ELatinText: |
|
510 case ELatinUpper: |
|
511 case ELatinLower: |
|
512 { |
|
513 priRange = ERangeEnglish; |
|
514 } |
|
515 break; |
|
516 default: |
|
517 priRange = iPermittedRange & ERangeNative ? ERangeNative : ERangeEnglish; |
|
518 break; |
|
519 } |
|
520 |
|
521 if( iSuggestedRange != ERangeInvalid && (iSuggestedRange & iPermittedRange) ) |
|
522 { |
|
523 priRange = iSuggestedRange; |
|
524 iSuggestedRange = ERangeInvalid; |
|
525 } |
|
526 |
|
527 if (iLastRange) |
|
528 { |
|
529 priRange=iLastRange; |
|
530 } |
|
531 |
|
532 SendCommandToServer( ECmdPenInputRange, priRange ); |
|
533 } |
|
534 |
|
535 void CPluginKrFepManagerBase::SetLayoutPermitedRanges( TInt aPermittedMode ) |
|
536 { |
|
537 iPermittedMode = aPermittedMode; |
|
538 |
|
539 // Not derived from edwin |
|
540 if ( aPermittedMode == EAknEditorNumericInputMode ) |
|
541 { |
|
542 if ( SupportNativeNumberRange() ) |
|
543 { |
|
544 iPermittedRange = ERangeNativeNumber; |
|
545 } |
|
546 iPermittedRange |= ERangeNumber; |
|
547 } |
|
548 |
|
549 else if ( aPermittedMode & EAknEditorTextInputMode ) |
|
550 { |
|
551 // Derived from edwin and EAknEditorTextInputMode |
|
552 iPermittedRange = ERangeNative | |
|
553 ERangeNumber | |
|
554 ERangeEnglish | |
|
555 ERangeSymbol | |
|
556 ERangeNativeNumber; |
|
557 } |
|
558 else if ( aPermittedMode & EAknEditorSecretAlphaInputMode ) |
|
559 { |
|
560 // Derived from EAknEditorSecretAlphaInputMode |
|
561 iPermittedRange = ERangeNumber | |
|
562 ERangeEnglish | |
|
563 ERangeSymbol; |
|
564 } |
|
565 else |
|
566 { |
|
567 iPermittedRange = ERangeNative | |
|
568 ERangeNumber | |
|
569 ERangeEnglish | |
|
570 ERangeSymbol | |
|
571 ERangeNativeNumber; |
|
572 } |
|
573 } |
|
574 |
|
575 TBool CPluginKrFepManagerBase::SupportNativeNumberRange() |
|
576 { |
|
577 if ( iLanguage == ELangArabic || iLanguage == ELangFarsi || |
|
578 iLanguage == ELangUrdu || iLanguage == ELangHindi || |
|
579 iLanguage == ELangThai ) |
|
580 { |
|
581 return ETrue; |
|
582 } |
|
583 |
|
584 return EFalse; |
|
585 } |
|
586 |
|
587 |