|
1 /* |
|
2 * Copyright (c) 2002-2008 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 CAknFepManager methods. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
30 #include <uikon/eikdefmacros.h> |
|
31 #endif |
|
32 #include "AknFepManager.h" |
|
33 #include "AknFepManagerInterface.h" // MAknFepManagerInterface |
|
34 #include "aknfepindicator.h" |
|
35 #include "AknFepPanic.h" |
|
36 #include "AknFepKeyCatcher.h" |
|
37 #include "AknFepGlobalEnums.h" |
|
38 #include "AknFepCaseManager.h" |
|
39 #include "AknFepHashKeyManager.h" |
|
40 #include "AknFepSharedDataInterface.h" |
|
41 #include "AknFepInlineTextDecorator.h" |
|
42 #include "AknFepUiManagerBase.h" |
|
43 #include "AknFepUiManagerChinese.h" |
|
44 #include "AknFepUiManagerWestern.h" |
|
45 |
|
46 #include "AknFepPluginManager.h" |
|
47 #include "AknFepUiIndicInputManager.h" |
|
48 #include "AknFepUiIndicEnums.h" |
|
49 #include <AknFepUIStylusPopupMenu.h> |
|
50 #include "aknfepuispellinputpane.h" |
|
51 |
|
52 #include <bautils.h> |
|
53 #include <coeaui.h> //CCoeAppUi |
|
54 #include <aknedsts.h> //CAknEdwinState |
|
55 #include <uikon.hrh> //keys |
|
56 #include <aknenv.h> //CAknEnv |
|
57 #include <PtiEngine.h> //CPtiEngine |
|
58 #include <AknJapaneseReading.h> //CAknJapaneseReading |
|
59 #include <featmgr.h> //FeatureManager |
|
60 #include <e32base.h> //CPeriodic |
|
61 #include <PtiDefs.h> //keys |
|
62 #include <fepipext.h> //MCoeFepSpecificExtensions |
|
63 |
|
64 #include <aknsoundsystem.h> |
|
65 #include <avkon.rsg> |
|
66 #include <avkon.hrh> |
|
67 |
|
68 #include <tagma.h> |
|
69 #include <frmtview.h> |
|
70 #include <aknedformaccessor.h> |
|
71 |
|
72 #include <AknFep.rsg> |
|
73 #include <avkon.mbg> |
|
74 |
|
75 #include "aknconsts.h" |
|
76 #include <aknfeppeninputenums.h> |
|
77 #include <eikproc.h> // User Dictionary |
|
78 #include <eikapp.h> // User Dictionary |
|
79 |
|
80 #include <StringLoader.h> |
|
81 |
|
82 #include <centralrepository.h> |
|
83 #include <AknFepInternalCRKeys.h> |
|
84 #include <settingsinternalcrkeys.h> |
|
85 #include <AknUtils.h> |
|
86 #include <AknCustomCursorSupport.h> |
|
87 #include <PtiKeyMappings.h> |
|
88 #include <aknfeppeninputimeplugin.h> |
|
89 #include <peninputcmd.h> |
|
90 |
|
91 #include <AknSettingCache.h> |
|
92 #include <peninputgsinterface.h> |
|
93 #include <aknextendedinputcapabilities.h> |
|
94 #include <AvkonInternalCRKeys.h> |
|
95 #include <hlplch.h> |
|
96 #include <aknfepdocumentnavigation.h> |
|
97 |
|
98 #include <eikcolib.h> |
|
99 #include <akntoolbar.h> |
|
100 |
|
101 #include <eikfrlbd.h> |
|
102 #include <eikccpu.h> |
|
103 #include <aknappui.h> |
|
104 #include <apgwgnam.h> |
|
105 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
106 #include "AknFepUiWordPopupContent.h" |
|
107 #include "AknFepFnKeyManager.h" |
|
108 #include <csxhelp/cp.hlp.hrh> |
|
109 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
110 |
|
111 #ifdef RD_TACTILE_FEEDBACK |
|
112 #include <touchfeedback.h> |
|
113 #endif //RD_TACTILE_FEEDBACK |
|
114 #include "AknFepThaiSCTSelector.h" |
|
115 |
|
116 //the follow 10 filse include for phrase creation |
|
117 #include <bamdesca.h> |
|
118 #include <eikspane.h> //CEikStatusPane |
|
119 #include <akntitle.h> //CAknTitlePane |
|
120 #include <akntoolbar.h> //CAknToolBar |
|
121 #include <aknappui.h> |
|
122 #include "AknFep.hrh" |
|
123 #include "aknfepuserdbdlg.h" |
|
124 #include "aknfepzhuyinkeyhandler.h" |
|
125 #include "AknFepZhuyinAnalyser.h" |
|
126 #include "AknFepZhuyinAnalyserDb.h" |
|
127 |
|
128 #include <aknnavi.h> |
|
129 #include <aknnavide.h> |
|
130 |
|
131 #include <eikedwin.h> |
|
132 #include <aknCharMap.h> |
|
133 |
|
134 const TInt KSelectItemSize(10); |
|
135 _LIT(KAknFepResourceFileName, "z:\\resource\\fep\\aknfep.rsc"); |
|
136 |
|
137 #define text_to_field_mode_hash_key ';' |
|
138 #define iAvkonAppUi ((CAknAppUi*)CEikonEnv::Static()->EikAppUi()) |
|
139 #define __SHIFT_KEY_LOOP |
|
140 |
|
141 // EAknEditorNativeKeysNumberModeKeymap is used for example in MFNE editors. |
|
142 #define EAknEditorNativeKeysNumberModeKeymap EAknEditorReservedInternalUseKeymap |
|
143 |
|
144 // UID of user dictionary application |
|
145 const TUid KUidUserDictApp = {0x101F8645}; |
|
146 |
|
147 const TText KAknFEPLineFeedSymbol = 0x21B2; |
|
148 const TText KAknFEPMirroredLineFeedSymbol = 0x21B3; |
|
149 const TText KAknFEPZeroKey = 0x30; |
|
150 |
|
151 // inline text decoration potentially adds 2 directional markers for every "real" character. Buffer needs to be 3 x predictive engine bufsize |
|
152 const TInt KMaxInlineEditSize( 3 * CAknFepManager::EMaximumFepWordLength ); |
|
153 |
|
154 // Maximum number of chunks to navigate throught attempting to get to the visual end of a selection. |
|
155 // Since chunks are arranged only within a line, this should be more than the number of chunks likely in |
|
156 // a single line of text |
|
157 const TInt KMaxChunkWalkIterations(20); |
|
158 |
|
159 // This command is is used for setting empty CBA. |
|
160 const TInt KNullCommandId = 0; |
|
161 |
|
162 _LIT_SECURE_ID(KPhoneSecureId, 0x100058b3); |
|
163 |
|
164 #ifdef RD_HINDI_PHONETIC_INPUT |
|
165 |
|
166 const TUint KQuestionMark = 0x003F; |
|
167 |
|
168 #endif |
|
169 |
|
170 // Ccpu key events. |
|
171 /*As part of build warnings commenting this perticular code it might require when touch is enabled. |
|
172 const TKeyEvent KEditorCopyEvent = {3, 67, 161, 0}; // Ctrl + C |
|
173 const TKeyEvent KEditorCutEvent = {24, 88, 161, 0}; // Ctrl + X |
|
174 */ |
|
175 |
|
176 const TInt KTouchInputPreviewOn = 1; |
|
177 const TInt KTouchInputPreviewOff = 0; |
|
178 |
|
179 #ifdef RD_SCALABLE_UI_V2 |
|
180 const TKeyEvent KAknCcpuCopyEvent = {EKeyF18, EEikCmdEditCopy, EModifierCtrl, 1}; // Copy event for AknCcpuSupport |
|
181 const TKeyEvent KAknCcpuCutEvent = {EKeyF18, EEikCmdEditCut, EModifierCtrl, 1}; // Cut event for AknCcpuSupport |
|
182 |
|
183 const TInt KMaxMenuSize = 25; |
|
184 const TInt KEditorMenuPermitedSend[KMaxMenuSize] = |
|
185 { |
|
186 EJapanFepCmdModeHiragana, |
|
187 EJapanFepCmdModeKatakana, |
|
188 EJapanFepCmdEditModeAlpha, |
|
189 EJapanFepCmdEditModeNumber, |
|
190 EJapanFepCmdModeFullWidth, |
|
191 EJapanFepCmdModeHalfWidth, |
|
192 EChinFepCmdModePinyin, |
|
193 EChinFepCmdModeZhuyin, |
|
194 EChinFepCmdModeStroke, |
|
195 EAknCmdT9PredictiveT9Off, |
|
196 EAknCmdMultitapPredictiveT9On, |
|
197 EJapanFepCmdMultitapPredictiveT9On, |
|
198 EChinFepCmdModeZhuyinFind, |
|
199 EChinFepCmdModeStrokeFind, |
|
200 EAknCmdEditModeAlpha, |
|
201 EAknCmdEditModeLatinText, |
|
202 EChinFepCmdModeLatinUpper, |
|
203 EChinFepCmdModeLatinLower, |
|
204 EAknCmdEditModeNumber, |
|
205 EChinFepCmdModeNumber, |
|
206 EAknCmdEditModeArabicIndicNumber, |
|
207 EAknCmdEditModeEasternArabicIndicNumber, |
|
208 EAknCmdEditModeIndicNumber, |
|
209 EAknCmdEditModeKorean, |
|
210 EAknCmdEditModeEnglish |
|
211 }; |
|
212 |
|
213 #endif // RD_SCALABLE_UI_V2 |
|
214 |
|
215 |
|
216 // Number modes used by Arabic or Hindi. |
|
217 enum TNonLatinNumberModes |
|
218 { |
|
219 ENbrModeLatin, |
|
220 ENbrModeArabic = 1, |
|
221 ENbrModeIndic = 1 |
|
222 }; |
|
223 |
|
224 // Number mode type |
|
225 enum TNonLatinNumberModeType |
|
226 { |
|
227 ENbrModeTypeArabic, |
|
228 ENbrModeTypeIndic, |
|
229 ENbrModeTypeEasternArabic //for Urdu & Farsi languages |
|
230 }; |
|
231 |
|
232 // The passwd timeout is same as defined on CEikSecretEditor. |
|
233 const TInt KSyncPasswdTimeout = 1000000; |
|
234 |
|
235 #ifdef RD_SCALABLE_UI_V2 |
|
236 TUid AppUidFromWndGroupId(TInt aWndGrpId); |
|
237 extern TUid GetCurAppUid(); |
|
238 extern TBool IsGlobalNotesApp(TUid& aUid); |
|
239 TInt GetForegroundTaskAppWgId(); |
|
240 #endif |
|
241 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
242 const TInt KWordToFocusInCandidateList = 1; |
|
243 #endif |
|
244 |
|
245 LOCAL_C TInt RemapVietnameseAccentedCharacter(TUint16 aChr); |
|
246 |
|
247 // |
|
248 // Class TTextDirectionalInfo |
|
249 // |
|
250 /** |
|
251 * The implementation inializes with well-defined "null" state |
|
252 */ |
|
253 CAknFepManager::TTextDirectionalInfo::TTextDirectionalInfo() : |
|
254 iDirectionalStatus(EUnknown), iBlockEnvironment(EUndefined) |
|
255 {} |
|
256 |
|
257 void CAknFepManager::TTextDirectionalInfo::SetDirectionFromChunk( |
|
258 const CTmTextLayout::TTmChunkDescription& aChunk ) |
|
259 { |
|
260 if ( aChunk.iStart >= 0 ) // Condition for valid block. Does nothing otherwise |
|
261 iDirectionalStatus = aChunk.iRightToLeft ? ERightToLeft : ELeftToRight; |
|
262 } |
|
263 |
|
264 |
|
265 void TFepLanguageTranslation::ReadFromResource(TResourceReader& aReader) |
|
266 { |
|
267 iName.Set(aReader.ReadTPtrC()); |
|
268 iLanguageId = aReader.ReadInt16(); |
|
269 iCommandId = aReader.ReadInt16(); |
|
270 } |
|
271 |
|
272 |
|
273 CAknFepManager::CAknFepManager(CCoeEnv& aConeEnvironment) |
|
274 :CCoeFep(aConeEnvironment), |
|
275 iAsyncResouceChanged(EActivePriorityDefault), |
|
276 iPreviousEditingState(EStateNone), |
|
277 iInputCapabilities(TCoeInputCapabilities::ENone), |
|
278 iModeBefore(ELatin), |
|
279 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
280 iKeyPressedDuringShift(EFalse), |
|
281 #endif |
|
282 iCharWidth(EHalfWidthChar), |
|
283 iAsyncOwnSimulateKey(EActivePriorityDefault), |
|
284 iLongThai0Key(EFalse), |
|
285 iEditCharsPtr(0,0), |
|
286 iComposChrFlag(0), |
|
287 iIsUserdbdlgActive(0), |
|
288 iLongClearAfterCloseUI(EFalse), |
|
289 // phrase creation |
|
290 iPhraseCreation(0), |
|
291 iPinyinPhraseCreation(0), |
|
292 iEntryPhrase(0) |
|
293 |
|
294 |
|
295 { |
|
296 } |
|
297 |
|
298 void CAknFepManager::ConstructL(const CCoeFepParameters& aFepParameters) |
|
299 { |
|
300 BaseConstructL(aFepParameters); |
|
301 iUiInterface = CAknFepUIInterface::NewL(); |
|
302 iIndicator = iUiInterface->NewIndicatorL(); |
|
303 iPreviousIndicator = CAknEnv::Static()->SwapEditingStateIndicator(iIndicator); |
|
304 |
|
305 // Set up resources |
|
306 TFileName resourceName(KAknFepResourceFileName); |
|
307 CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
308 BaflUtils::NearestLanguageFile(coeEnv->FsSession(), resourceName); |
|
309 iResId = coeEnv->AddResourceFileL(resourceName); |
|
310 |
|
311 // Save Japanese Feature support to a member variable |
|
312 iFeatureSupportedJapanese = FeatureManager::FeatureSupported(KFeatureIdJapanese); |
|
313 |
|
314 iUiLanguage = User::Language(); |
|
315 |
|
316 // Shared Data |
|
317 iSharedDataInterface = CAknFepSharedDataInterface::NewL(this); |
|
318 |
|
319 TInt previUiLanguage = iSharedDataInterface->PluginUILanguage(); |
|
320 |
|
321 if (iUiLanguage != previUiLanguage) |
|
322 { |
|
323 |
|
324 // if UI language has changed we need to set text input language according to UI language |
|
325 iSharedDataInterface->SetPluginUILanguage(iUiLanguage); |
|
326 iSharedDataInterface->SetInputTextLanguage(0); // signals that it needs to be updated |
|
327 } |
|
328 |
|
329 if (!iSharedDataInterface->InputMode()) //not initialised yet - first time device is switched on |
|
330 { |
|
331 switch (iUiLanguage) |
|
332 { |
|
333 case ELangPrcChinese: |
|
334 iSharedDataInterface->SetInputMode(EPinyin); |
|
335 break; |
|
336 case ELangTaiwanChinese: |
|
337 iSharedDataInterface->SetInputMode(EZhuyin); |
|
338 break; |
|
339 case ELangHongKongChinese: |
|
340 iSharedDataInterface->SetInputMode(EStroke); |
|
341 iSharedDataInterface->SetCangJieMode(ECangJieNormal); |
|
342 break; |
|
343 case ELangJapanese: |
|
344 iSharedDataInterface->SetInputMode(EHiraganaKanji); |
|
345 break; |
|
346 case ELangKorean: |
|
347 iSharedDataInterface->SetInputMode(EHangul); |
|
348 break; |
|
349 case ELangHindi: |
|
350 iSharedDataInterface->SetInputMode(EHindi); |
|
351 break; |
|
352 default: |
|
353 iSharedDataInterface->SetInputMode(ELatin); |
|
354 break; |
|
355 } |
|
356 } |
|
357 |
|
358 iUiInterface->SetFepMenuObserver(this); |
|
359 |
|
360 TInt inputLanguage = iSharedDataInterface->InputTextLanguage(); |
|
361 |
|
362 // A process instantiating Fep may miss ECapabilityWriteDeviceData capability, |
|
363 // which is needed for updating locale repository. |
|
364 // A workaround is to delay change up to a process that has the capability |
|
365 TSecurityInfo info; |
|
366 info.Set(RProcess()); |
|
367 |
|
368 TBool hasCapability = info.iCaps.HasCapability(ECapabilityWriteDeviceData); |
|
369 |
|
370 if (!inputLanguage && hasCapability) |
|
371 { |
|
372 // set correct input language |
|
373 inputLanguage = SubstituteSublanguageId(iUiLanguage); |
|
374 |
|
375 // If Ptiengine is not initialize, initialize it |
|
376 if (!iPtiEngine) |
|
377 { |
|
378 iPtiEngine = CPtiEngine::NewL(ETrue); |
|
379 } |
|
380 // If still not found, default to english. |
|
381 if (!iPtiEngine->GetLanguage(inputLanguage)) |
|
382 { |
|
383 inputLanguage = ELangEnglish; |
|
384 } |
|
385 |
|
386 // Set the current input language |
|
387 iSharedDataInterface->SetInputTextLanguage(inputLanguage); |
|
388 |
|
389 // update numeric input |
|
390 if ( iUiLanguage == ELangArabic ) |
|
391 { |
|
392 SetDefaultNumberMode( ENbrModeArabic, |
|
393 ENbrModeTypeArabic ); |
|
394 } |
|
395 else if ( ( iUiLanguage == ELangUrdu ) || |
|
396 ( iUiLanguage == ELangFarsi ) ) |
|
397 { |
|
398 SetDefaultNumberMode( ENbrModeArabic, |
|
399 ENbrModeTypeEasternArabic ); |
|
400 } |
|
401 else if ( TAknFepUiIndicInputManager::IsScriptDevanagari( iUiLanguage ) ) |
|
402 { |
|
403 SetDefaultNumberMode( ENbrModeLatin, |
|
404 ENbrModeTypeIndic ); |
|
405 } |
|
406 else |
|
407 { |
|
408 SetDefaultNumberMode( ENbrModeLatin, ENbrModeTypeArabic ); |
|
409 } |
|
410 } |
|
411 |
|
412 iSctEditChars = HBufC::NewL( 10 ); |
|
413 |
|
414 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
415 // Predictive QWERTY (XT9) changes ----> |
|
416 if(CCoeEnv::Static()->AppUi()) |
|
417 iExactWordPopupContent = iUiInterface->CreateWordPopupContentL(); |
|
418 // Predictive QWERTY (XT9) changes <---- |
|
419 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
420 // If the following line is uncommented, the FEP is fully constructed |
|
421 // for all applications at application startup. |
|
422 // ConstructFullyL(); |
|
423 iShiftKeypressMonitor = CPeriodic::NewL(CActive::EPriorityStandard); |
|
424 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
425 iFnKeyManager = CAknFepFnKeyManager::NewL( *this,iSharedDataInterface ); |
|
426 #endif |
|
427 TRAPD(result,iKeyCatcher = CAknFepKeyCatcher::NewL(*this)); |
|
428 if(result == KErrNone) |
|
429 { |
|
430 iKeyCatcher->ActivateL(); |
|
431 } |
|
432 // the follow 3 objects for phrase creation |
|
433 iZhuyinKeyHandler = CZhuyinKeyHandler::NewL(); |
|
434 iZhuyinAnalyserDb = CZhuyinAnalyserDbFeed::NewL(EPinyinAnalyserTypeZhuyin); |
|
435 iZhuyinAnalyser = CAknFepZhuyinAnalyser::NewL(iZhuyinAnalyserDb); |
|
436 iAknFepThaiSCTSelector = CAknFepThaiSCTSelector::NewL(); |
|
437 iHybridAplphaChangedToAlphanumeric = EFalse; |
|
438 iLastFocusedEditor = NULL; |
|
439 iFepAwareDialogParentEditor = NULL; |
|
440 } |
|
441 |
|
442 void CAknFepManager::ConstructFullyL() |
|
443 { |
|
444 if (!iPtiEngine) |
|
445 { |
|
446 iPtiEngine = CPtiEngine::NewL(ETrue); |
|
447 } |
|
448 |
|
449 if ( !(iPtiEngine->GetLanguage(iSharedDataInterface->InputTextLanguage())) ) |
|
450 { |
|
451 // If input language cenrep value is set to language unknown to PtiEngine, |
|
452 // try to reset based on UI-language. |
|
453 TInt inputLang = SubstituteSublanguageId(iUiLanguage); |
|
454 |
|
455 // If still not found, default to english. |
|
456 if (!iPtiEngine->GetLanguage(inputLang)) |
|
457 { |
|
458 inputLang = ELangEnglish; |
|
459 } |
|
460 iSharedDataInterface->SetInputTextLanguage(inputLang); |
|
461 } |
|
462 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
463 #ifdef FF_DUAL_LANGUAGE_SUPPORT |
|
464 if (iPtiEngine->GetLanguage(iSharedDataInterface->InputTextLanguageSecondary()) == NULL) |
|
465 { |
|
466 // If secondary input language is unknown to PtiEngine, set it to none |
|
467 iSharedDataInterface->SetInputTextLanguageSecondary(0); |
|
468 } |
|
469 #endif //FF_DUAL_LANGUAGE_SUPPORT |
|
470 #endif |
|
471 |
|
472 if(NULL == iKeyCatcher) |
|
473 { |
|
474 iKeyCatcher = CAknFepKeyCatcher::NewL(*this); |
|
475 iKeyCatcher->ActivateL(); |
|
476 } |
|
477 |
|
478 iConcatenationTimer=CPeriodic::NewL(CActive::EPriorityStandard); |
|
479 iPostEventCheck=CIdle::NewL(CActive::EPriorityStandard); |
|
480 iChrKeypressMonitor = CPeriodic::NewL(CActive::EPriorityStandard); |
|
481 |
|
482 CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
483 TInt inputLanguage = iSharedDataInterface->InputTextLanguage(); |
|
484 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
485 #ifdef FF_DUAL_LANGUAGE_SUPPORT |
|
486 TInt inputLanguageSecondary = iSharedDataInterface->InputTextLanguageSecondary(); |
|
487 #endif //FF_DUAL_LANGUAGE_SUPPORT |
|
488 #endif |
|
489 SetWesternPredictive(iSharedDataInterface->PredictiveTextOn()); |
|
490 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
491 iIsAutoCompleteOn = iSharedDataInterface->PredictiveTextAutoCompleteOn(); // AutoCompletion disabled by Default |
|
492 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
493 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
494 iIsAutoCompleteOn = iSharedDataInterface->PredictiveTextAutoCompleteOn(); // AutoCompletion disabled by Default |
|
495 iTypingCorrectionLevel = iSharedDataInterface->PredictiveTextTypingCorrectionLevel(); |
|
496 iIsNumberCandidateShown = iSharedDataInterface->PredictiveTextNumberCandidateShown(); |
|
497 TInt primaryCandidateValue = iSharedDataInterface->PredictiveTextPrimaryCandidate(); |
|
498 if( primaryCandidateValue == 0) |
|
499 iPrimaryCandidate = ETrue; |
|
500 else if(primaryCandidateValue == 1) |
|
501 iPrimaryCandidate = EFalse; |
|
502 #endif // RD_INTELLIGENT_TEXT_INPUT |
|
503 iJapanesePredictive = iSharedDataInterface->PredictiveTextJapaneseOn(); |
|
504 iQwertyInputMode = iSharedDataInterface->QwertyInputMode(); |
|
505 iMultiTapTimer = iSharedDataInterface->MultiTapTimer(); |
|
506 iJapaneseQwertyFlags = iSharedDataInterface->JapaneseQwertyFlags(); |
|
507 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
508 if(!iFnKeyManager) |
|
509 { |
|
510 iFnKeyManager = CAknFepFnKeyManager::NewL( *this,iSharedDataInterface ); |
|
511 } |
|
512 #endif |
|
513 iCaseMan = CAknFepCaseManager::NewL(*this); |
|
514 iLangMan = CAknFepLanguageManager::NewL(this, iCaseMan); |
|
515 iPtiEngine->ActivateLanguageL(inputLanguage); |
|
516 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
517 #ifdef FF_DUAL_LANGUAGE_SUPPORT |
|
518 iPtiEngine->SetSecondaryInputL(inputLanguageSecondary); |
|
519 #endif //FF_DUAL_LANGUAGE_SUPPORT |
|
520 #endif |
|
521 iLangMan->SetInputLanguageL(inputLanguage); |
|
522 SetInputLanguageCapabilities(inputLanguage); |
|
523 iCurrentFepUI = iLangMan->GetFepUI(ELatin, iCharWidth, IsPredictive(ELatin)); |
|
524 |
|
525 iLastKeyPressedWasHashKey = EFalse; |
|
526 iDeviceSupportsRtlLanguage = DeviceSupportsRTLLanguageL(); |
|
527 |
|
528 TResourceReader reader; |
|
529 // get character from resource to represent an 'enter' character |
|
530 coeEnv->CreateResourceReaderLC(reader, R_AVKON_SCT_SPACE_SYMBOL); |
|
531 iSpaceCharacterCode = reader.ReadUint16(); |
|
532 coeEnv->CreateResourceReaderLC(reader, R_AVKON_SCT_FULLWIDTHSPACE_SYMBOL); |
|
533 iFullWidthSpaceCharacterCode = reader.ReadUint16(); |
|
534 CleanupStack::PopAndDestroy(2); //reader |
|
535 |
|
536 //initialise states |
|
537 iMode = EAknEditorNullInputMode; //Force a sync of mode... |
|
538 SyncStates(EAknFepStateNull); |
|
539 ResetFlags(); |
|
540 ResetExtendedFlags(); |
|
541 |
|
542 ReadHashKeyLoopL(); |
|
543 iHashKeyMan = CAknFepHashKeyManager::NewL(*this, iCaseMan); |
|
544 SetHashKeyStyle(); |
|
545 iInlineTextDecorator = new (ELeave) CAknFepInlineTextDecorator; |
|
546 if (IsFeatureSupportedJapanese()) |
|
547 { |
|
548 CAknJapaneseReading::CreateL(iPtiEngine); |
|
549 } |
|
550 // setting call back |
|
551 TCallBack callback(DoSimulateKey, this); |
|
552 iAsyncOwnSimulateKey.Set(callback); |
|
553 |
|
554 TCallBack resourcechangedcallback(HandleResourceChangedCallback,this); |
|
555 iAsyncResouceChanged.Set(resourcechangedcallback); |
|
556 #ifdef RD_SCALABLE_UI_V2 |
|
557 iFepPluginManager = CAknFepPluginManager::NewL |
|
558 ( *this, *iSharedDataInterface, *iLangMan, *iCaseMan); |
|
559 iNotifyPlugin = ETrue; |
|
560 #endif //RD_SCALABLE_UI_V2 |
|
561 |
|
562 iFepFullyConstructed = ETrue; |
|
563 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
564 iIsFnKeyMapped = IsFnKeyMappedL(); |
|
565 iKeyboardType = (TPtiKeyboardType)iSharedDataInterface->KeyboardLayout(); |
|
566 #endif |
|
567 } |
|
568 |
|
569 CAknFepManager::~CAknFepManager() |
|
570 { |
|
571 #ifdef RD_PF_SEC_APPARC |
|
572 delete iNullService; |
|
573 #else |
|
574 //Embedding - removing created document |
|
575 if ( iEmbedded ) |
|
576 { |
|
577 CEikonEnv::Static()->Process()->DestroyDocument(iEmbedded); // User dictionary |
|
578 iEmbedded = NULL; |
|
579 } |
|
580 #endif |
|
581 if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
582 { |
|
583 SetFlag(CAknFepManager::EFlagSupressAutoUpdate); |
|
584 TRAPD(err, CommitInlineEditL()) |
|
585 if (err) |
|
586 { |
|
587 CleanUpFep(); |
|
588 } |
|
589 } |
|
590 |
|
591 if ( EditorState() ) |
|
592 { |
|
593 EditorState()->SetObserver(NULL); |
|
594 } |
|
595 if (iLastFocusedEditor) |
|
596 { |
|
597 iLastFocusedEditor->SetObserver(NULL); |
|
598 iLastFocusedEditor = NULL; |
|
599 } |
|
600 if (iFepAwareDialogParentEditor) |
|
601 { |
|
602 iFepAwareDialogParentEditor->SetObserver(NULL); |
|
603 iFepAwareDialogParentEditor = NULL; |
|
604 } |
|
605 |
|
606 delete iSharedDataInterface; |
|
607 MAknEditingStateIndicator* indicator = CAknEnv::Static()->EditingStateIndicator(); |
|
608 if (indicator == iIndicator) |
|
609 { |
|
610 CAknEnv::Static()->SwapEditingStateIndicator(NULL); |
|
611 } |
|
612 |
|
613 |
|
614 delete iIndicator; |
|
615 iIndicator = NULL; |
|
616 CCoeEnv::Static()->DeleteResourceFile(iResId); |
|
617 |
|
618 // Everything that is constructed in ConstructFullyL() method |
|
619 // needs to be deleted in CommonDestroyFep() method. |
|
620 CommonDestroyFep(); |
|
621 |
|
622 if (iUiInterface) |
|
623 iUiInterface->SetFepMenuObserver(NULL); |
|
624 |
|
625 delete iPtiEngine; |
|
626 delete iSctEditChars; |
|
627 |
|
628 #ifdef RD_SCALABLE_UI_V2 |
|
629 if ( FepAwareTextEditor() ) |
|
630 { |
|
631 UnregisterObserver(); |
|
632 } |
|
633 delete iFepPluginManager; |
|
634 delete iStylusCcpuMenu; |
|
635 |
|
636 delete iSpellInitText; |
|
637 #endif // RD_SCALABLE_UI_V2 |
|
638 delete iUiInterface; |
|
639 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
640 // Predictive QWERTY (XT9) changes ----> |
|
641 delete iExactWordPopupContent; |
|
642 iExactWordPopupContent = 0; |
|
643 delete iCandidatePopup; |
|
644 iCandidatePopup = 0; |
|
645 delete iResourceString; |
|
646 iResourceString = 0; |
|
647 // Predictive QWERTY (XT9) changes <---- |
|
648 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
649 // the follow objects for phrase creation |
|
650 delete iZhuyinKeyHandler; |
|
651 delete iZhuyinAnalyser; |
|
652 delete iAknFepThaiSCTSelector; |
|
653 } |
|
654 |
|
655 void CAknFepManager::CommonDestroyFep() |
|
656 { |
|
657 iFepFullyConstructed = EFalse; |
|
658 |
|
659 // This method is called both from destructor and CleanUpFep methods. |
|
660 iAsyncOwnSimulateKey.Cancel(); |
|
661 iAsyncResouceChanged.Cancel(); |
|
662 delete iShiftKeypressMonitor; |
|
663 iShiftKeypressMonitor = NULL; |
|
664 delete iConcatenationTimer; |
|
665 iConcatenationTimer = NULL; |
|
666 delete iChrKeypressMonitor; |
|
667 iChrKeypressMonitor = NULL; |
|
668 delete iLangMan; |
|
669 iLangMan = NULL; |
|
670 iCurrentFepUI = NULL; |
|
671 delete iKeyCatcher; |
|
672 iKeyCatcher = NULL; |
|
673 |
|
674 delete iPostEventCheck; |
|
675 iPostEventCheck = NULL; |
|
676 delete iHashKeyMan; |
|
677 iHashKeyMan = NULL; |
|
678 delete iCaseMan; |
|
679 iCaseMan = NULL; |
|
680 delete iInlineTextDecorator; |
|
681 iInlineTextDecorator = NULL; |
|
682 iHashKeyLoop.Close(); |
|
683 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
684 if(iFnKeyManager) |
|
685 { |
|
686 delete iFnKeyManager; |
|
687 iFnKeyManager = NULL; |
|
688 } |
|
689 if( iNumericResourceTimer ) |
|
690 { |
|
691 delete iNumericResourceTimer; |
|
692 iNumericResourceTimer = NULL; |
|
693 } |
|
694 #endif |
|
695 } |
|
696 |
|
697 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
698 void CAknFepManager::SetKeyboardLayout(TPtiKeyboardType aType) |
|
699 { |
|
700 |
|
701 if(iQwertyInputMode && iFnKeyManager |
|
702 && (iFnKeyManager->FnKeyState()== CAknFepFnKeyManager::EFnKeyLock |
|
703 ||iFnKeyManager->FnKeyState()== CAknFepFnKeyManager::EFnKeyNext)) |
|
704 { |
|
705 iMode = ENumber; |
|
706 } |
|
707 |
|
708 if(iFnKeyManager) |
|
709 { |
|
710 iFnKeyManager->ClearFnKeyState(); |
|
711 } |
|
712 |
|
713 if(iPtiEngine) |
|
714 { |
|
715 iPtiEngine->SetKeyboardType(aType); |
|
716 } |
|
717 iKeyboardType = aType; |
|
718 } |
|
719 |
|
720 TPtiKeyboardType CAknFepManager::KeyboardLayout() const |
|
721 { |
|
722 return iKeyboardType; |
|
723 } |
|
724 #endif |
|
725 TBool CAknFepManager::TryCloseUiL() |
|
726 { |
|
727 #ifdef RD_HINDI_PHONETIC_INPUT |
|
728 if ((iSharedDataInterface->InputTextLanguage() == KLangHindiPhonetic) && |
|
729 IsFlagSet(CAknFepManager::EFlagNoMatches)) |
|
730 { |
|
731 ClearFlag(CAknFepManager::EFlagNoMatches); |
|
732 if (PreviousChar() == KQuestionMark) |
|
733 RemovePreviousCharacterL(); |
|
734 } |
|
735 #endif |
|
736 if (iFepManState == EAknFepStateUIActive) |
|
737 { |
|
738 // In Japanese input, |
|
739 // commit inline editing at only the western predictive mode. |
|
740 if (!IsFeatureSupportedJapanese() || WesternPredictive()) |
|
741 { |
|
742 if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
743 { |
|
744 TryRemoveNoMatchesIndicatorL(); |
|
745 UpdateCbaL(NULL); |
|
746 } |
|
747 |
|
748 |
|
749 |
|
750 //#ifdef __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__ |
|
751 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
752 if ( iFepPluginManager && |
|
753 (iFepPluginManager->PluginInputMode() == EPluginInputModeNone)) |
|
754 { |
|
755 RemoveSuggestedAdvanceCompletionL(); |
|
756 } |
|
757 #endif // RD_INTELLIGENT_TEXT_INPUT |
|
758 //#endif // __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__ |
|
759 |
|
760 #ifdef RD_SCALABLE_UI_V2 |
|
761 |
|
762 if (iFepPluginManager->BeforeSpell()) |
|
763 { |
|
764 iFepPluginManager->SetBeforeSpell(EFalse); |
|
765 } |
|
766 else |
|
767 #endif |
|
768 |
|
769 { |
|
770 CommitInlineEditL(); |
|
771 } |
|
772 } |
|
773 if (IsCcpuFlagSet(ECcpuStataCommitPredictiveWord)) |
|
774 { |
|
775 // Word commiting must be done after CommitInlineEditL call (because |
|
776 // of Japanese ReadingTextL funtionality), hence the delayed commit here. |
|
777 iPtiEngine->CommitCurrentWord(); |
|
778 ClearCcpuFlag(ECcpuStataCommitPredictiveWord); |
|
779 } |
|
780 InternalFepUI()->CloseUI(); |
|
781 SyncStates(EAknFepStateInitial); |
|
782 if (iMode == EPinyin || iMode == EZhuyin || iMode == EStroke || iMode == ECangJie) |
|
783 { |
|
784 SetCursorType(EActive); |
|
785 if ( EditorState() ) |
|
786 { |
|
787 EditorState()->SetFlags( EditorState()->Flags() & ~EAknEditorFlagChinesePopup ); |
|
788 } |
|
789 } |
|
790 |
|
791 // EFalse in case of latin input in Japanese variant |
|
792 if (IsFeatureSupportedJapanese() |
|
793 && iMode == ELatin && !WesternPredictive()) |
|
794 { |
|
795 return EFalse; |
|
796 } |
|
797 |
|
798 return ETrue; |
|
799 } |
|
800 else |
|
801 { |
|
802 if (IsKoreanInputLanguage()) |
|
803 { |
|
804 if (IsFlagSet(CAknFepManager::EFlagInsideInlineEditingTransaction)) |
|
805 { |
|
806 CommitInlineEditL(); |
|
807 PtiEngine()->ClearCurrentWord(); |
|
808 } |
|
809 } |
|
810 |
|
811 //in initial state characters should either: |
|
812 //1. not be consumed by the FEP. |
|
813 //2. be committed immediately by the Input State. |
|
814 //3. be multitap chars, in which case they may need to be committed |
|
815 // here. It is best to let the engine deal with this. |
|
816 if ( IsFlagSet( EFlagInsideInlineEditingTransaction ) ) |
|
817 { |
|
818 InternalFepUI()->ExpireMultitapTimer(); |
|
819 } |
|
820 return EFalse; |
|
821 } |
|
822 } |
|
823 |
|
824 void CAknFepManager::SendUIActivatedNotification() |
|
825 { |
|
826 SyncStates(EAknFepStateUIActive); |
|
827 } |
|
828 |
|
829 void CAknFepManager::SendUIDeActivatedNotification() |
|
830 { |
|
831 SyncStates(EAknFepStateInitial); |
|
832 } |
|
833 |
|
834 void CAknFepManager::PlaySound(TAvkonSystemSID aSound) const |
|
835 { |
|
836 if (SoundSystem()) |
|
837 { |
|
838 SoundSystem()->PlaySound(aSound); |
|
839 } |
|
840 } |
|
841 |
|
842 void CAknFepManager::SetLongClearAfterCloseUI(TBool aLongClear) |
|
843 { |
|
844 iLongClearAfterCloseUI = aLongClear; |
|
845 } |
|
846 |
|
847 TKeyResponse CAknFepManager::HandleKeyEventL(TUint aCode, TKeyPressLength aLength,TEventCode aEventCode) |
|
848 { |
|
849 TKeyResponse response = EKeyWasNotConsumed; |
|
850 |
|
851 TInt documentLength = -1; |
|
852 if (iInputCapabilities.FepAwareTextEditor()) |
|
853 { |
|
854 documentLength = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
855 } |
|
856 |
|
857 if (iFepFullyConstructed && iConcatenationTimer->IsActive()) |
|
858 { |
|
859 if (!( aCode == EKeyRightArrow || |
|
860 aCode == EKeyLeftArrow || |
|
861 aCode == EKeyUpArrow || |
|
862 aCode == EKeyDownArrow )) |
|
863 { |
|
864 iConcatenationTimer->Cancel(); |
|
865 } |
|
866 } |
|
867 |
|
868 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
869 |
|
870 if(iKeyBackSpaceHit && aCode != EKeyBackspace) |
|
871 iKeyBackSpaceHit = 0; |
|
872 |
|
873 if (aCode != EPtiKeyStar && iNumericResourceTimer) |
|
874 { |
|
875 // return with EKeyWasConsumed if any of the arrow keys are pressed with |
|
876 // iNumericResourceTimer is active |
|
877 if(NumericResourceMultiTapTimerTimeoutL()&& |
|
878 (aCode == EKeyRightArrow || aCode == EKeyLeftArrow || aCode == EKeyUpArrow || aCode ==EKeyDownArrow)) |
|
879 return EKeyWasConsumed; |
|
880 } |
|
881 #endif |
|
882 |
|
883 |
|
884 |
|
885 // This method is implemented independent of all modes, so it can be called by anyone, anywhere |
|
886 if ( BidiCursorRequired() ) |
|
887 { |
|
888 response = AttemptCursorFlipAtAmbiguousPointL( aCode ); |
|
889 if ( response == EKeyWasConsumed ) |
|
890 { |
|
891 return response; |
|
892 } |
|
893 } |
|
894 |
|
895 if ( aCode != EPtiKeyHash |
|
896 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
897 #ifdef __HALF_QWERTY_KEYPAD |
|
898 #ifdef __SHIFT_KEY_LOOP |
|
899 && ( aCode != EPtiKeyQwertyLeftShift |
|
900 || EPtiKeyboardHalfQwerty != KeyboardLayout() ) |
|
901 #endif //__SHIFT_KEY_LOOP |
|
902 #endif //__HALF_QWERTY_KEYPAD |
|
903 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
904 ) |
|
905 |
|
906 { |
|
907 |
|
908 SetLastPressedHashKeyStatus(EFalse); |
|
909 |
|
910 if(iHashKeyMan) |
|
911 { |
|
912 iHashKeyMan->CancelHashKeyTimer(); |
|
913 if (aCode != EKeyOK) |
|
914 { |
|
915 iHashKeyMan->ClearSelectionModeHashKeyLoop(); |
|
916 } |
|
917 } |
|
918 } |
|
919 // Always commit the text before handling arrow keys |
|
920 if (iMode == EHangul && IsFlagSet(CAknFepManager::EFlagInsideInlineEditingTransaction)) |
|
921 { |
|
922 if ( aCode == EKeyRightArrow || |
|
923 aCode == EKeyLeftArrow || |
|
924 aCode == EKeyUpArrow || |
|
925 aCode == EKeyDownArrow ) |
|
926 { |
|
927 CommitInlineEditL(); |
|
928 iPtiEngine->ClearCurrentWord(); |
|
929 } |
|
930 } |
|
931 TBool isPassNext = IsFlagSet(EFlagPassNextKey); |
|
932 |
|
933 switch (aCode) |
|
934 { |
|
935 case EKeyEscape: |
|
936 |
|
937 #ifdef RD_SCALABLE_UI_V2 |
|
938 if( iFepFullyConstructed && iFepPluginManager) |
|
939 { |
|
940 iFepPluginManager->ResetMenuState(EFalse); |
|
941 } |
|
942 #endif |
|
943 if (TryCloseUiL()) |
|
944 { |
|
945 response = EKeyWasConsumed; |
|
946 // phrase creation |
|
947 PhraseCreation(EFalse); |
|
948 // phrase creation |
|
949 PinyinPhraseCreation(EFalse); |
|
950 } |
|
951 break; |
|
952 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
953 #ifdef __HALF_QWERTY_KEYPAD |
|
954 #ifdef __SHIFT_KEY_LOOP |
|
955 case EPtiKeyQwertyLeftShift: |
|
956 if( EPtiKeyboardHalfQwerty == KeyboardLayout() ) |
|
957 { |
|
958 response = HandleHashKeyL(aLength); |
|
959 (aLength == ELongKeyPress)? SetLastPressedHashKeyStatus(EFalse):SetLastPressedHashKeyStatus(ETrue); |
|
960 } |
|
961 break; |
|
962 #endif //__SHIFT_KEY_LOOP |
|
963 #endif //__HALF_QWERTY_KEYPAD |
|
964 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
965 case EPtiKeyHash: |
|
966 if(InputMode() == EHangul) |
|
967 { |
|
968 if (aLength == EShortKeyPress) |
|
969 { |
|
970 FepUI()->HandleKeyL(aCode, aLength); |
|
971 response = EKeyWasConsumed; |
|
972 } |
|
973 else |
|
974 { |
|
975 //PhraseCreation(EFalse); |
|
976 response = HandleHashKeyL(aLength); |
|
977 (aLength == ELongKeyPress)? SetLastPressedHashKeyStatus(EFalse): |
|
978 SetLastPressedHashKeyStatus(ETrue); |
|
979 } |
|
980 } |
|
981 else if (InputMode()!= EZhuyin) |
|
982 { |
|
983 if (IsPinyinPhraseCreation() ) |
|
984 { |
|
985 ClearCcpuFlag( ECcpuStateHashDown ); |
|
986 response = EKeyWasConsumed; |
|
987 } |
|
988 else |
|
989 { |
|
990 response = HandleHashKeyL(aLength); |
|
991 (aLength == ELongKeyPress) |
|
992 ? SetLastPressedHashKeyStatus(EFalse) |
|
993 : SetLastPressedHashKeyStatus(ETrue); |
|
994 } |
|
995 } |
|
996 else |
|
997 { |
|
998 PhraseCreation(EFalse); |
|
999 response = HandleHashKeyL(aLength); |
|
1000 (aLength == ELongKeyPress) |
|
1001 ? SetLastPressedHashKeyStatus(EFalse) |
|
1002 : SetLastPressedHashKeyStatus(ETrue); |
|
1003 } |
|
1004 break; |
|
1005 case EKeyCBA1: |
|
1006 if(Japanese()) |
|
1007 { |
|
1008 if (FepUI()->HandleKeyL(aCode, aLength)) |
|
1009 { |
|
1010 response = EKeyWasConsumed; |
|
1011 } |
|
1012 break; |
|
1013 } |
|
1014 // phrase creation the key CBA2 need to solve. |
|
1015 if ( IsEntryPhrase() ) |
|
1016 { |
|
1017 if ( FepUI()->HandleKeyL( aCode, aLength ) ) |
|
1018 { |
|
1019 response = EKeyWasConsumed; |
|
1020 break; |
|
1021 } |
|
1022 } |
|
1023 |
|
1024 if (!WesternPredictive()) |
|
1025 { |
|
1026 if (TryCloseUiL()) |
|
1027 { |
|
1028 response = EKeyWasConsumed; |
|
1029 } |
|
1030 } |
|
1031 break; |
|
1032 case EKeyCBA2: |
|
1033 if(Japanese()) |
|
1034 { |
|
1035 if (FepUI()->HandleKeyL(aCode, aLength)) |
|
1036 { |
|
1037 response = EKeyWasConsumed; |
|
1038 } |
|
1039 break; |
|
1040 } |
|
1041 if (!WesternPredictive()) |
|
1042 { |
|
1043 if (TryCloseUiL()) |
|
1044 { |
|
1045 // phrase creation the key CBA2 need to solve. |
|
1046 PhraseCreation( EFalse ); |
|
1047 response = EKeyWasConsumed; |
|
1048 } |
|
1049 } |
|
1050 else |
|
1051 { |
|
1052 if ( IsFlagSet( EFlagInsideInlineEditingTransaction ) ) |
|
1053 { |
|
1054 InternalFepUI()->ExpireMultitapTimer(); |
|
1055 } |
|
1056 } |
|
1057 // phrase creation the key CBA2 need to solve. |
|
1058 EntryPhrase( EFalse ); |
|
1059 break; |
|
1060 case EPtiKeyStar: |
|
1061 if (IsFlagSet(EFlagPassNextKey)) |
|
1062 { |
|
1063 ClearFlag(EFlagPassNextKey); |
|
1064 } |
|
1065 else if ( !IsFepAwareTextEditor() ) |
|
1066 { |
|
1067 // The editor is MFNE or other non FEP aware text editor. |
|
1068 // Pass the key to the editor to handle. |
|
1069 response = EKeyWasNotConsumed; |
|
1070 } |
|
1071 else if (IsFlagSet(EFlagShiftKeyDepressed)) |
|
1072 { |
|
1073 response = EKeyWasConsumed; |
|
1074 } |
|
1075 else |
|
1076 { |
|
1077 #ifdef RD_SCALABLE_UI_V2 |
|
1078 iStarKeyPressed = ETrue; |
|
1079 #endif // RD_SCALABLE_UI_V2 |
|
1080 if (FepUI()->HandleKeyL(aCode, aLength, aEventCode)) |
|
1081 { |
|
1082 response = EKeyWasConsumed; |
|
1083 } |
|
1084 #ifdef RD_SCALABLE_UI_V2 |
|
1085 iStarKeyPressed = EFalse; |
|
1086 #endif // RD_SCALABLE_UI_V2 |
|
1087 } |
|
1088 break; |
|
1089 case EKeyRightArrow: |
|
1090 if (TryHandleArrowRightEventL(documentLength)) |
|
1091 { |
|
1092 response = EKeyWasConsumed; |
|
1093 break; |
|
1094 } |
|
1095 // fall through |
|
1096 case EKeyLeftArrow: |
|
1097 if (aCode == EKeyLeftArrow && TryHandleArrowLeftEventL(documentLength)) |
|
1098 { |
|
1099 response = EKeyWasConsumed; |
|
1100 break; |
|
1101 } |
|
1102 |
|
1103 if (IsCcpuFlagSet(ECcpuStateCopy | ECcpuStateCut)) |
|
1104 { |
|
1105 response = EKeyWasNotConsumed; |
|
1106 break; |
|
1107 } |
|
1108 else if (IsCcpuFlagSet(ECcpuStateStartCopy | ECcpuStateStartCut)) |
|
1109 { |
|
1110 TryHandleCommonArrowAndBackspaceFunctionalityL(aCode, response); |
|
1111 break; |
|
1112 } |
|
1113 |
|
1114 if (iLanguageCapabilities.iInputLanguageCode == ELangJapanese && iMode != ELatin) |
|
1115 { |
|
1116 if(FepUI()->HandleKeyL(aCode, aLength)) |
|
1117 { |
|
1118 response = EKeyWasConsumed; |
|
1119 } |
|
1120 } |
|
1121 else |
|
1122 { |
|
1123 if (WesternPredictive()) |
|
1124 { |
|
1125 response = HandleWesternPredictiveArrowKeyL(aCode, aLength); |
|
1126 } |
|
1127 else |
|
1128 { |
|
1129 if (iFepManState == EAknFepStateUIActive) |
|
1130 { |
|
1131 FepUI()->HandleKeyL(aCode, aLength); |
|
1132 response = EKeyWasConsumed; |
|
1133 } |
|
1134 else |
|
1135 { |
|
1136 /* |
|
1137 TCursorSelection currentEditorSelection(0,0); |
|
1138 if(iInputCapabilities.FepAwareTextEditor()) |
|
1139 { |
|
1140 iInputCapabilities.FepAwareTextEditor()-> |
|
1141 GetCursorSelectionForFep(currentEditorSelection); |
|
1142 } |
|
1143 |
|
1144 if(!IsMfneEditor() && |
|
1145 (PluginInputMode() == EPluginInputModeItut || |
|
1146 PluginInputMode() == EPluginInputModeFSQ) && |
|
1147 currentEditorSelection.Length() != 0) |
|
1148 { |
|
1149 response = EKeyWasConsumed; |
|
1150 break; |
|
1151 } |
|
1152 */ |
|
1153 |
|
1154 response = HandleNaviEventOutsideInlineEditL(aCode, aLength); |
|
1155 if (response == EKeyWasConsumed) |
|
1156 { |
|
1157 iCaseMan->UpdateCase(ENullNaviEvent); |
|
1158 } |
|
1159 else if (aCode == EKeyLeftArrow && !IsFlagSet(EFlagShiftKeyDepressed)) |
|
1160 { |
|
1161 iCaseMan->UpdateCase(ELeftNaviEvent); |
|
1162 } |
|
1163 else if (!IsFlagSet(EFlagShiftKeyDepressed)) |
|
1164 { |
|
1165 iCaseMan->UpdateCase(ERightNaviEvent); |
|
1166 } |
|
1167 } |
|
1168 } |
|
1169 } |
|
1170 break; |
|
1171 case EKeyDownArrow: |
|
1172 if( iWesternPredictive && IsFlagSet(EFlagInsideInlineEditingTransaction) && |
|
1173 ( EPtiKeyboard12Key == KeyboardLayout() ) && ( IsFlagSet(EFlagShiftKeyDepressed) || |
|
1174 HashKeySelectionInUse()&& IsCcpuFlagSet(ECcpuStateHashDown) ) ) |
|
1175 { |
|
1176 iPtiEngine->CommitCurrentWord(); |
|
1177 CommitInlineEditL(); |
|
1178 response = EKeyWasConsumed; |
|
1179 break; |
|
1180 } |
|
1181 |
|
1182 if (TryHandleArrowDownEventL(documentLength) || IsFlagSet(EFlagNoMatches)) |
|
1183 { |
|
1184 response = EKeyWasConsumed; |
|
1185 break; |
|
1186 } |
|
1187 |
|
1188 case EKeyUpArrow: |
|
1189 if (iLanguageCapabilities.iInputLanguageCode == ELangJapanese && iMode != ELatin) |
|
1190 { |
|
1191 if ( (iAknEditorFlags & EAknEditorFlagNoLRNavigation) && |
|
1192 IsFlagSet(EFlagShiftKeyDepressed) ) |
|
1193 { |
|
1194 // Up or down key is pressed during shift key press. |
|
1195 ClearFlag(EFlagNoActionDuringShiftKeyPress); |
|
1196 return EKeyWasNotConsumed; |
|
1197 } |
|
1198 |
|
1199 if(FepUI()->HandleKeyL(aCode, aLength)) |
|
1200 { |
|
1201 response = EKeyWasConsumed; |
|
1202 } |
|
1203 else |
|
1204 { |
|
1205 TryHandleCommonArrowAndBackspaceFunctionalityL(aCode, response); |
|
1206 } |
|
1207 } |
|
1208 else |
|
1209 { |
|
1210 if (iLanguageCapabilities.iInputLanguageCode == ELangThai && |
|
1211 iFepManState == EAknFepStateUIActive && |
|
1212 WesternPredictive() ) |
|
1213 { |
|
1214 if (FepUI()->HandleKeyL(aCode, aLength)) |
|
1215 { |
|
1216 ClearFlag(EFlagChangeInputMode); |
|
1217 response = EKeyWasConsumed; |
|
1218 } |
|
1219 break; |
|
1220 } |
|
1221 else if ( (iAknEditorFlags & EAknEditorFlagNoLRNavigation) && |
|
1222 IsFlagSet(EFlagShiftKeyDepressed) ) |
|
1223 { |
|
1224 // Up or down key is pressed during shift key press. |
|
1225 ClearFlag(EFlagNoActionDuringShiftKeyPress); |
|
1226 return EKeyWasNotConsumed; |
|
1227 } |
|
1228 if (WesternPredictive()) |
|
1229 { |
|
1230 // For customizabal of Down/Up scroll keypress action. |
|
1231 // If it need to custom it, the function of HandleKeyL returns EFalse. |
|
1232 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
1233 // Predictive QWERTY (XT9) changes ----> |
|
1234 if ( IsFlagSet(CAknFepManager::EFlagInsideInlineEditingTransaction) ) |
|
1235 { |
|
1236 TInt wordIndexToSelect = 0; |
|
1237 |
|
1238 if(iQwertyInputMode && EPtiKeyboardHalfQwerty != KeyboardLayout()) |
|
1239 { |
|
1240 if(!iPrimaryCandidate) |
|
1241 iPtiEngine->HandleCommandL( EPtiCommandUserActionGetIndexOfSecondaryCandidate, |
|
1242 &wordIndexToSelect ); |
|
1243 |
|
1244 if( iQwertyInputMode |
|
1245 && ( iExactWordPopupContent->IsPopUpVisible() |
|
1246 || ( iFepPluginManager && iFepPluginManager->IsTooltipOpenOnFSQ() ) ) |
|
1247 && aCode == EKeyUpArrow ) |
|
1248 { |
|
1249 iExactWordPopupContent->HidePopUp(); |
|
1250 |
|
1251 // When press up, if FSQ is opened, |
|
1252 // also need to check and close tooltip on it. |
|
1253 SendEventsToPluginManL( EPluginHideTooltip ); |
|
1254 |
|
1255 iPtiEngine->HandleCommandL( |
|
1256 EPtiCommandUserActionSetCurrentIndexOfCandidates, |
|
1257 &wordIndexToSelect ); |
|
1258 iPtiEngine->HandleCommandL( EPtiCommandLockCurrentCandidate ); |
|
1259 /* Update the Candidate List in case of Exact Typing as best predicted word is |
|
1260 selected from the tooltip to the editor */ |
|
1261 if(!iPrimaryCandidate) |
|
1262 iPtiEngine->HandleCommandL(EPtiCommandSetFlagToUpdateCandidates); |
|
1263 |
|
1264 TPtrC selectedWord = iPtiEngine->CurrentWord(); |
|
1265 UpdateInlineEditL( selectedWord, selectedWord.Length() ); |
|
1266 response = EKeyWasConsumed; |
|
1267 |
|
1268 } |
|
1269 else |
|
1270 { |
|
1271 LaunchCandidatePopupListL( wordIndexToSelect ); |
|
1272 response = EKeyWasConsumed; |
|
1273 } |
|
1274 } |
|
1275 else |
|
1276 { |
|
1277 if (!IsFlagSet(EFlagInsideMultitapInlineEditingTransaction)) |
|
1278 { |
|
1279 TInt lastCandidateIndex = iPtiEngine->NumberOfCandidates() -1; |
|
1280 if( EPtiKeyboard12Key == KeyboardLayout() && ( IsFlagSet(EFlagShiftKeyDepressed) || |
|
1281 HashKeySelectionInUse()&& IsCcpuFlagSet(ECcpuStateHashDown) ) ) |
|
1282 { |
|
1283 if (response != EKeyWasConsumed) |
|
1284 { |
|
1285 response = HandleWesternPredictiveArrowKeyL(aCode, aLength); |
|
1286 } |
|
1287 } |
|
1288 else if(aCode == EKeyUpArrow && lastCandidateIndex >= 0) |
|
1289 { |
|
1290 // Get last word on list |
|
1291 LaunchCandidatePopupListL( lastCandidateIndex ); |
|
1292 response = EKeyWasConsumed; |
|
1293 } |
|
1294 else |
|
1295 { |
|
1296 // Get next word on list (wrap around if at end) |
|
1297 iPtiEngine->HandleCommandL( EPtiCommandUserActionGetCurrentIndexOfCandidates, |
|
1298 &wordIndexToSelect ); |
|
1299 wordIndexToSelect < lastCandidateIndex ? wordIndexToSelect++ : wordIndexToSelect = 0; |
|
1300 LaunchCandidatePopupListL( wordIndexToSelect ); |
|
1301 response = EKeyWasConsumed; |
|
1302 } |
|
1303 } |
|
1304 else |
|
1305 response = EKeyWasConsumed; |
|
1306 } |
|
1307 } |
|
1308 else |
|
1309 { |
|
1310 // Predictive QWERTY (XT9) changes <---- |
|
1311 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
1312 if(iFepManState == EAknFepStateUIActive && |
|
1313 FepUI()->HandleKeyL(aCode, aLength)) |
|
1314 { |
|
1315 response = EKeyWasConsumed; |
|
1316 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
1317 |
|
1318 // When press up, if FSQ is opened, |
|
1319 // also need to check and close tooltip on it. |
|
1320 SendEventsToPluginManL( EPluginHideTooltip ); |
|
1321 |
|
1322 // Predictive QWERTY (XT9) changes ----> |
|
1323 // Exact word popup is hidden when the exact word is selected |
|
1324 iExactWordPopupContent->HidePopUp(); |
|
1325 // Predictive QWERTY (XT9) changes <---- |
|
1326 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
1327 } |
|
1328 // normal operation of Down/Up scroll keypress action. |
|
1329 if (response != EKeyWasConsumed) |
|
1330 { |
|
1331 response = HandleWesternPredictiveArrowKeyL(aCode, aLength); |
|
1332 } |
|
1333 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
1334 } // Predictive QWERTY (XT9) changes |
|
1335 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
1336 } |
|
1337 else |
|
1338 { |
|
1339 if (iFepManState == EAknFepStateUIActive) |
|
1340 { |
|
1341 FepUI()->HandleKeyL(aCode, aLength); |
|
1342 response = EKeyWasConsumed; |
|
1343 } |
|
1344 else |
|
1345 { |
|
1346 TryHandleCommonArrowAndBackspaceFunctionalityL(aCode, response); |
|
1347 } |
|
1348 } |
|
1349 } |
|
1350 break; |
|
1351 case EKeyBackspace: |
|
1352 if (iLanguageCapabilities.iInputLanguageCode == ELangJapanese && |
|
1353 !(iMode == ELatin || iMode == ENumber)) |
|
1354 { |
|
1355 if (FepUI()->HandleKeyL(aCode, aLength)) |
|
1356 { |
|
1357 response = EKeyWasConsumed; |
|
1358 } |
|
1359 } |
|
1360 else if (iLanguageCapabilities.iInputLanguageCode == ELangVietnamese) |
|
1361 { |
|
1362 TCursorSelection cursorSelection; |
|
1363 if ( !IsFepAwareTextEditor() ) |
|
1364 { |
|
1365 response = EKeyWasNotConsumed; |
|
1366 } |
|
1367 else |
|
1368 { |
|
1369 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(cursorSelection); |
|
1370 if (cursorSelection.Length() != 0) |
|
1371 { |
|
1372 response = EKeyWasNotConsumed; |
|
1373 } |
|
1374 #ifdef RD_SCALABLE_UI_V2 |
|
1375 else if ( !documentLength |
|
1376 && ( iFepPluginManager->PluginInputMode() == EPluginInputModeItut |
|
1377 || iFepPluginManager->PluginInputMode() == EPluginInputModeVkb ) ) |
|
1378 { |
|
1379 response = EKeyWasConsumed; |
|
1380 } |
|
1381 #endif |
|
1382 else |
|
1383 { |
|
1384 if (FepUI()->HandleKeyL(aCode, aLength)) |
|
1385 { |
|
1386 response = EKeyWasConsumed; |
|
1387 } |
|
1388 else |
|
1389 { |
|
1390 if( WesternPredictive() ) |
|
1391 { |
|
1392 // We need to start the autoconcatination timer |
|
1393 SimulateKeyEventL(EKeyF24); |
|
1394 } |
|
1395 } |
|
1396 } |
|
1397 } |
|
1398 |
|
1399 } |
|
1400 else if (IsKoreanInputLanguage() && iMode == EHangul) |
|
1401 { |
|
1402 if (FepUI()->HandleKeyL(aCode, aLength)) |
|
1403 { |
|
1404 response = EKeyWasConsumed; |
|
1405 } |
|
1406 } |
|
1407 else |
|
1408 { |
|
1409 if (iFepManState == EAknFepStateInitial) |
|
1410 { |
|
1411 #ifdef RD_SCALABLE_UI_V2 |
|
1412 if ( iFepPluginManager->PluginInputMode() == EPluginInputModeItut ) |
|
1413 { |
|
1414 if ( iFepPluginManager->CurrentFepInputUI() && |
|
1415 FepUI()->HandleKeyL(aCode, aLength)) |
|
1416 { |
|
1417 response = EKeyWasConsumed; |
|
1418 break; |
|
1419 } |
|
1420 } |
|
1421 if ( !documentLength |
|
1422 && ( iFepPluginManager->PluginInputMode() == EPluginInputModeItut |
|
1423 || iFepPluginManager->PluginInputMode() == EPluginInputModeVkb ) ) |
|
1424 { |
|
1425 response = EKeyWasConsumed; |
|
1426 break; |
|
1427 |
|
1428 } |
|
1429 #endif |
|
1430 if (IsFlagSet(EFlagLineFeedCharacter)) |
|
1431 { |
|
1432 // restore cursor visibility |
|
1433 if (IsFlagSet(EFlagInsideMultitapInlineEditingTransaction)) |
|
1434 { |
|
1435 iInputCapabilities.FepAwareTextEditor()->SetInlineEditingCursorVisibilityL(ETrue); |
|
1436 } |
|
1437 |
|
1438 iInputCapabilities.FepAwareTextEditor()->CancelFepInlineEdit(); |
|
1439 ClearFlag(EFlagInsideMultitapInlineEditingTransaction | |
|
1440 EFlagInsideInlineEditingTransaction | |
|
1441 EFlagLineFeedCharacter); |
|
1442 response = EKeyWasConsumed; |
|
1443 } |
|
1444 else |
|
1445 { |
|
1446 response = HandleNaviEventOutsideInlineEditL(aCode, aLength); |
|
1447 if (WesternPredictive() && response == EKeyWasNotConsumed) |
|
1448 { |
|
1449 // if we're passing a backspace to the editor simulate any old keypress |
|
1450 // to catch and check the state of play after the deletion |
|
1451 SimulateKeyEventL(EKeyF24); |
|
1452 } |
|
1453 if (response == EKeyWasNotConsumed) |
|
1454 { |
|
1455 if(iMode == EZhuyinFind) |
|
1456 { |
|
1457 SetFlag(EFlagSupressAutoUpdate); |
|
1458 } |
|
1459 if (iLongClearAfterCloseUI && |
|
1460 aLength == ELongKeyPress) |
|
1461 { |
|
1462 response = EKeyWasConsumed; |
|
1463 } |
|
1464 |
|
1465 iCaseMan->UpdateCase(EBackspaceEvent); |
|
1466 } |
|
1467 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
1468 if(IsAutoCompleteOn()) |
|
1469 { |
|
1470 TInt tailLength = 0; |
|
1471 iPtiEngine->HandleCommandL( EPtiCommandGetAutoCompletionTailLength, |
|
1472 &tailLength ); |
|
1473 if(tailLength > 0) |
|
1474 { |
|
1475 RemoveSuggestedAdvanceCompletionL(); |
|
1476 } |
|
1477 } |
|
1478 #endif |
|
1479 } |
|
1480 |
|
1481 // Clear the star key flag. |
|
1482 if( FepUI() ) |
|
1483 { |
|
1484 FepUI()->SetStarKeyFlag( EFalse ); |
|
1485 } |
|
1486 } |
|
1487 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
1488 else if (IsAutoCompleteOn()) |
|
1489 { |
|
1490 TInt tailLength = 0; |
|
1491 iPtiEngine->HandleCommandL( EPtiCommandGetAutoCompletionTailLength, |
|
1492 &tailLength ); |
|
1493 if(tailLength > 0) |
|
1494 { |
|
1495 TryRemoveNoMatchesIndicatorL(); |
|
1496 RemoveSuggestedAdvanceCompletionL(); |
|
1497 SimulateKeyEventL(EKeyF19); |
|
1498 UpdateCbaL(NULL); |
|
1499 response=EKeyWasConsumed; |
|
1500 } |
|
1501 else if(FepUI()->HandleKeyL(aCode, aLength)) |
|
1502 { |
|
1503 if( EPtiKeyboardHalfQwerty == KeyboardLayout() |
|
1504 && iWesternPredictive |
|
1505 && iCaseMan->CurrentCase() != EAknEditorUpperCase ) |
|
1506 { |
|
1507 ClearFlag(CAknFepManager::EFlagChangeInputMode); |
|
1508 } |
|
1509 iPtiEngine->HandleCommandL( EPtiCommandGetAutoCompletionTailLength, &tailLength ); |
|
1510 if(tailLength > 0) |
|
1511 { |
|
1512 RemoveSuggestedAdvanceCompletionL(); |
|
1513 } |
|
1514 response = EKeyWasConsumed; |
|
1515 } |
|
1516 } |
|
1517 else if(FepUI()->HandleKeyL(aCode, aLength)) |
|
1518 { |
|
1519 response = EKeyWasConsumed; |
|
1520 } |
|
1521 SendEventsToPluginManL( EPluginHideTooltip ); |
|
1522 if(iExactWordPopupContent && iExactWordPopupContent->IsPopUpVisible()) |
|
1523 { |
|
1524 iExactWordPopupContent->HidePopUp(); |
|
1525 } |
|
1526 #else |
|
1527 else if (FepUI()->HandleKeyL(aCode, aLength)) |
|
1528 { |
|
1529 response = EKeyWasConsumed; |
|
1530 } |
|
1531 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
1532 } |
|
1533 break; |
|
1534 case EKeyDelete: |
|
1535 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
1536 if(IsAutoCompleteOn()) |
|
1537 { |
|
1538 TInt tailLength = 0; |
|
1539 iPtiEngine->HandleCommandL( EPtiCommandGetAutoCompletionTailLength, |
|
1540 &tailLength ); |
|
1541 if(tailLength > 0) |
|
1542 { |
|
1543 RemoveSuggestedAdvanceCompletionL(); |
|
1544 } |
|
1545 } |
|
1546 |
|
1547 // When press delete key, if FSQ is opened, |
|
1548 // also need to check and close tooltip on it. |
|
1549 SendEventsToPluginManL( EPluginHideTooltip ); |
|
1550 |
|
1551 if(iExactWordPopupContent && iExactWordPopupContent->IsPopUpVisible()) |
|
1552 { |
|
1553 iExactWordPopupContent->HidePopUp(); |
|
1554 } |
|
1555 if ( IsFlagSet( EFlagInsideInlineEditingTransaction ) ) |
|
1556 { |
|
1557 TryRemoveNoMatchesIndicatorL(); |
|
1558 UpdateCbaL(NULL); |
|
1559 CommitInlineEditL(); |
|
1560 } |
|
1561 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
1562 break; |
|
1563 case EKeyF19: // Fep simulated event to asynchronously update the case. |
|
1564 iCaseMan->UpdateCase(ENullNaviEvent); |
|
1565 response=EKeyWasConsumed; |
|
1566 ClearExtendedFlag(EExtendedFlagOkKeyPressOnCandidatePopup ); |
|
1567 break; |
|
1568 case EKeyF22: |
|
1569 if (WesternPredictive()) |
|
1570 { |
|
1571 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
1572 if (CursorInsideWord()) |
|
1573 { |
|
1574 MoveCursorToEndOfWordL(); |
|
1575 } |
|
1576 if (iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep()) |
|
1577 { |
|
1578 iCaseMan->UpdateCase(ENullNaviEvent); |
|
1579 } |
|
1580 } |
|
1581 else if (iMode == ELatin) |
|
1582 { |
|
1583 iCaseMan->UpdateCase(ENullNaviEvent); |
|
1584 } |
|
1585 ClearCcpuFlag(ECcpuStateIgnoreStarUp); |
|
1586 response=EKeyWasConsumed; |
|
1587 break; |
|
1588 case EKeyF23: |
|
1589 if (WesternPredictive()) |
|
1590 { |
|
1591 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
1592 if (CursorInsideWord()) |
|
1593 { |
|
1594 MoveCursorToStartOfWordL(); |
|
1595 } |
|
1596 if (iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep()) |
|
1597 { |
|
1598 iCaseMan->UpdateCase(ENullNaviEvent); |
|
1599 } |
|
1600 } |
|
1601 else if (iMode == ELatin) |
|
1602 { |
|
1603 iCaseMan->UpdateCase(ENullNaviEvent); |
|
1604 } |
|
1605 ClearCcpuFlag(ECcpuStateIgnoreStarUp); |
|
1606 response=EKeyWasConsumed; |
|
1607 break; |
|
1608 case EKeyF24: |
|
1609 if (WesternPredictive() && CursorInsideWord()) |
|
1610 { |
|
1611 // word concatenation - start the timer; add concatenated word |
|
1612 // to UDB on timer expiry |
|
1613 iConcatenationTimer->Start(EWordConcatenationTimeout, EWordConcatenationTimeout, |
|
1614 TCallBack(WordConcatenationTimerTimeoutCallback, this)); |
|
1615 } |
|
1616 response=EKeyWasConsumed; |
|
1617 break; |
|
1618 case EPtiKey0: //fall through |
|
1619 case EPtiKey1: |
|
1620 case EPtiKey2: |
|
1621 case EPtiKey3: |
|
1622 case EPtiKey4: |
|
1623 case EPtiKey5: |
|
1624 case EPtiKey6: |
|
1625 case EPtiKey7: |
|
1626 case EPtiKey8: |
|
1627 case EPtiKey9: |
|
1628 #ifdef RD_SCALABLE_UI_V2 |
|
1629 if ( aLength == ELongKeyPress && !isPassNext && (aCode == EPtiKey0) ) |
|
1630 { |
|
1631 if( !IsQwerty() && |
|
1632 !IsFlagSet(CAknFepManager::EFlagPassNextKey)&& |
|
1633 iFepPluginManager->PluginInputMode() != EPluginInputModeItut ) |
|
1634 { |
|
1635 iFepPluginManager->ClosePluginInputModeL( ETrue ); |
|
1636 } |
|
1637 } |
|
1638 #endif |
|
1639 if (IsFlagSet(EFlagLineFeedCharacter) && aCode != EPtiKey0) |
|
1640 { |
|
1641 // There is line feed character waiting. Pospone this event and handle |
|
1642 // line feed first. |
|
1643 CancelInlineEdit(); |
|
1644 if (!(iAknEditorFlags & EAknEditorFlagFindPane) || iQwertyInputMode) |
|
1645 { |
|
1646 SimulateKeyEventL(EKeyEnter); |
|
1647 SimulateKeyEventL(EKeyF19); // Asyncronous case update |
|
1648 } |
|
1649 SimulateKeyEventL((TPtiKey)aCode); |
|
1650 ClearFlag(EFlagLineFeedCharacter); |
|
1651 return EKeyWasConsumed; |
|
1652 } |
|
1653 if (iLanguageCapabilities.iInputLanguageCode == ELangJapanese && iMode != ELatin) |
|
1654 { |
|
1655 if (EditorHasFreeSpace() || iFepManState == EAknFepStateUIActive) |
|
1656 { |
|
1657 if (FepUI()->HandleKeyL(aCode, aLength)) |
|
1658 { |
|
1659 ClearFlag(EFlagChangeInputMode); |
|
1660 response = EKeyWasConsumed; |
|
1661 } |
|
1662 // response is EKeyWasNotConsumed |
|
1663 } |
|
1664 } |
|
1665 else |
|
1666 { |
|
1667 //pass extra key received when doing secret text edit |
|
1668 if (IsFlagSet(EFlagPassNextKey)) |
|
1669 { |
|
1670 ClearFlag(EFlagPassNextKey); |
|
1671 } |
|
1672 else if (IsFlagSet(EFlagShiftKeyDepressed) || IsCcpuFlagSet(ECcpuStateHashDown)) |
|
1673 { |
|
1674 response = EKeyWasConsumed; |
|
1675 } |
|
1676 |
|
1677 // The key event is passed to the editor to handle in case of |
|
1678 // MFNE and other non FEP aware editors (response = EKeyWasNotConsumed). |
|
1679 else if ( IsFepAwareTextEditor() ) |
|
1680 { |
|
1681 if ( ( iMode != ENumber && iMode != ENativeNumber ) || |
|
1682 ( ( iMode == ENumber || iMode == ENativeNumber ) && aLength == ELongKeyPress)) |
|
1683 { |
|
1684 // Be default the key event is handled by FEP for FEP aware editors. |
|
1685 response = EKeyWasConsumed; |
|
1686 } |
|
1687 |
|
1688 // New character can be entered to the editor if there is |
|
1689 // space left in the editor. Editor can be modified also |
|
1690 // is the last character is multitapped or last character |
|
1691 // in inline state is replaced with a digit. |
|
1692 /*Hindi*/ |
|
1693 //This condition is added for Hindi language in case of multitapping of EKey1 to get |
|
1694 //a numeral value "1" because of a clasical case of Halant and ZWS getting added |
|
1695 //before numeral 1 which may affect incase of limited space in editor |
|
1696 |
|
1697 if (( EditorHasFreeSpace() |
|
1698 || (!WesternPredictive() && !EditorHasFreeSpace() && |
|
1699 (TAknFepUiIndicInputManager::IsIndicLangauge( |
|
1700 TLanguage(iLanguageCapabilities.iInputLanguageCode)))) |
|
1701 || IsFlagSet(EFlagInsideMultitapInlineEditingTransaction) |
|
1702 || (IsFlagSet(EFlagInsideInlineEditingTransaction) && aLength == ELongKeyPress))) |
|
1703 { |
|
1704 ClearFlag(EFlagEditorFull); |
|
1705 |
|
1706 if (aLength == ELongKeyPress && |
|
1707 (iMode != ELatin && iMode != ENumber && iMode != ENativeNumber && iMode != EStrokeFind && iMode != EHangul) && |
|
1708 FepUI()->IsValidNumericLongKeyPress(aCode)) |
|
1709 { |
|
1710 if (iFepManState == EAknFepStateInitial) // Multitapping |
|
1711 { |
|
1712 #ifdef RD_SCALABLE_UI_V2 |
|
1713 if (iFepFullyConstructed && |
|
1714 iFepPluginManager->CurrentFepInputUI() ) |
|
1715 { |
|
1716 if (iFepPluginManager->CurrentFepInputUI()->HandleKeyL(aCode, |
|
1717 aLength)) |
|
1718 { |
|
1719 response = EKeyWasConsumed; |
|
1720 break; |
|
1721 } |
|
1722 } |
|
1723 #endif |
|
1724 // Current multitabbed character is replaced with a number. |
|
1725 TChar ch(aCode); |
|
1726 TBuf<1> buf; |
|
1727 buf.Append(ch); |
|
1728 NewCharacterL(buf); |
|
1729 CommitInlineEditL(); |
|
1730 iPtiEngine->ClearCurrentWord(); |
|
1731 } |
|
1732 else |
|
1733 { |
|
1734 // Long number key press is given to the editor. |
|
1735 TryCloseUiL(); |
|
1736 response = EKeyWasNotConsumed; |
|
1737 } |
|
1738 } |
|
1739 else if (FepUI()->HandleKeyL(aCode, aLength)) |
|
1740 { |
|
1741 if ( (iMode == EPinyin || iMode == EZhuyin || iMode == EStroke || iMode == ECangJie) |
|
1742 && iFepManState == EAknFepStateUIActive ) |
|
1743 { |
|
1744 if ( EditorState() ) |
|
1745 { |
|
1746 EditorState()->SetFlags( EditorState()->Flags() | EAknEditorFlagChinesePopup ); |
|
1747 } |
|
1748 } |
|
1749 ClearFlag(EFlagChangeInputMode); |
|
1750 // for japanese variant |
|
1751 if (IsFeatureSupportedJapanese() |
|
1752 && iMode == ENumber) |
|
1753 { |
|
1754 response = EKeyWasConsumed; |
|
1755 } |
|
1756 } |
|
1757 else |
|
1758 { |
|
1759 //By default, pass long keypress to an editor for inserting number. |
|
1760 response = EKeyWasNotConsumed; |
|
1761 //No need to handle long key press in dialer |
|
1762 if ( RProcess().SecureId().iId != KPhoneSecureId ) |
|
1763 { |
|
1764 |
|
1765 if ( iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic ) |
|
1766 { |
|
1767 SimulateKeyEventL( aCode + KLatinToArabicIndicDigitsDelta ); |
|
1768 response = EKeyWasConsumed; |
|
1769 } |
|
1770 else if( iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic ) |
|
1771 { |
|
1772 SimulateKeyEventL( aCode + KLatinToEasternArabicIndicDigitsDelta ); |
|
1773 response = EKeyWasConsumed; |
|
1774 } |
|
1775 /*Hindi*/ |
|
1776 else if ( iLanguageCapabilities.iLocalDigitType == EDigitTypeDevanagari |
|
1777 || iPreviousEditingState == EDevanagariIndicNumeric ) |
|
1778 { |
|
1779 |
|
1780 SimulateKeyEventL( aCode + KLatinToDevanagariDigitsDelta ); |
|
1781 |
|
1782 response = EKeyWasConsumed; |
|
1783 } |
|
1784 } |
|
1785 } |
|
1786 } |
|
1787 } |
|
1788 } |
|
1789 break; |
|
1790 case EKeyOK: |
|
1791 { |
|
1792 if (iUiInterface->SoftkeysExist() && EditSubmenuInUse()) |
|
1793 { |
|
1794 if (iUiInterface->SoftkeyCommandId(ELeftSoftkeyIndex) == EAknFepSoftkeyStartCopy) |
|
1795 { |
|
1796 ProcessCommandL(EAknFepSoftkeyStartCopy); |
|
1797 response = EKeyWasConsumed; |
|
1798 break; |
|
1799 } |
|
1800 else if (iUiInterface->SoftkeyCommandId(ELeftSoftkeyIndex) == EAknFepSoftkeyStartCut) |
|
1801 { |
|
1802 ProcessCommandL(EAknFepSoftkeyStartCut); |
|
1803 response = EKeyWasConsumed; |
|
1804 break; |
|
1805 } |
|
1806 else if (iUiInterface->SoftkeyCommandId(ELeftSoftkeyIndex) == EEikCmdEditCopy) |
|
1807 { |
|
1808 ProcessCommandL(EEikCmdEditCopy); |
|
1809 response = EKeyWasConsumed; |
|
1810 break; |
|
1811 } |
|
1812 else if (iUiInterface->SoftkeyCommandId(ELeftSoftkeyIndex) == EEikCmdEditCut) |
|
1813 { |
|
1814 ProcessCommandL(EEikCmdEditCut); |
|
1815 response = EKeyWasConsumed; |
|
1816 break; |
|
1817 } |
|
1818 } |
|
1819 |
|
1820 if ( (iAknEditorFlags & EAknEditorFlagNoLRNavigation) && |
|
1821 IsFlagSet(EFlagShiftKeyDepressed) ) |
|
1822 { |
|
1823 // Selection key is pressed during shift key press. |
|
1824 ClearFlag(EFlagNoActionDuringShiftKeyPress); |
|
1825 return EKeyWasNotConsumed; |
|
1826 } |
|
1827 if (iLanguageCapabilities.iInputLanguageCode == ELangJapanese && iMode != ELatin) |
|
1828 { |
|
1829 if (FepUI()->HandleKeyL(aCode, aLength)) |
|
1830 { |
|
1831 response = EKeyWasConsumed; |
|
1832 } |
|
1833 } |
|
1834 else |
|
1835 { |
|
1836 if (IsFlagSet(EFlagShiftKeyDepressed) && |
|
1837 !(iAknEditorFlags & EAknEditorFlagSupressShiftMenu)) |
|
1838 { |
|
1839 response = EKeyWasConsumed; |
|
1840 } |
|
1841 else if (iFepManState == EAknFepStateUIActive) |
|
1842 { |
|
1843 if (FepUI()->HandleKeyL(aCode, aLength)) |
|
1844 { |
|
1845 response = EKeyWasConsumed; |
|
1846 } |
|
1847 } |
|
1848 else if (iMode == ELatin && !WesternPredictive() && |
|
1849 IsFlagSet(EFlagInsideMultitapInlineEditingTransaction)) |
|
1850 { |
|
1851 CommitInlineEditL(); |
|
1852 } |
|
1853 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
1854 // Predictive QWERTY (XT9) changes ----> |
|
1855 // Accept current candidate (including possible auto-completed part) and insert space after the word |
|
1856 // if selection key pressed while inline editing (on Qwerty only!) |
|
1857 // this is not the expected behavior for half qwerty |
|
1858 |
|
1859 TBool isQwertyMode = iQwertyInputMode && |
|
1860 !( EPtiKeyboardHalfQwerty == KeyboardLayout() ); |
|
1861 if ( response == EKeyWasNotConsumed && iWesternPredictive && isQwertyMode && |
|
1862 IsFlagSet(EFlagInsideInlineEditingTransaction) |
|
1863 // For addition of ITI features on FSQ. |
|
1864 // If FSQ is opened with ITI features activated, don't commit as HW's action |
|
1865 && !( iFepPluginManager && iFepPluginManager->EnableITIOnFSQ() ) ) |
|
1866 { |
|
1867 |
|
1868 // If the primary candidate setting is exact typing, The tooltip/bubble always shows the best prediction. |
|
1869 // Word on the typing line is accepted into editor on selection key event.. |
|
1870 |
|
1871 iPtiEngine->CommitCurrentWord(); |
|
1872 CommitInlineEditL(); |
|
1873 TryCloseUiL(); |
|
1874 if(!static_cast<TChar>(NextChar()).IsSpace()) |
|
1875 { |
|
1876 SimulateKeyEventL(EKeySpace); |
|
1877 } |
|
1878 else |
|
1879 { |
|
1880 TCursorSelection sel; |
|
1881 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(sel); |
|
1882 sel.iCursorPos++; |
|
1883 sel.iAnchorPos++; |
|
1884 iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(sel); |
|
1885 } |
|
1886 SimulateKeyEventL(EKeyF19); // asynchronous case update |
|
1887 |
|
1888 response = EKeyWasConsumed; |
|
1889 } |
|
1890 // Predictive QWERTY (XT9) changes <---- |
|
1891 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
1892 } |
|
1893 } |
|
1894 break; |
|
1895 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
1896 case EKeyPhoneEnd: |
|
1897 { |
|
1898 // Suggested word should get committed in exact typing |
|
1899 if ( iWesternPredictive && |
|
1900 IsFlagSet(EFlagInsideInlineEditingTransaction) ) |
|
1901 { |
|
1902 |
|
1903 // If the primary candidate setting is exact typing, The tooltip/bubble always shows the best prediction. |
|
1904 // Word on the typing line is accepted into editor on end key event.. |
|
1905 |
|
1906 iPtiEngine->CommitCurrentWord(); |
|
1907 CommitInlineEditL(); |
|
1908 TryCloseUiL(); |
|
1909 ClearFlag(CAknFepManager::EFlagNoMatches); |
|
1910 SimulateKeyEventL(EKeyF19); // asynchronous case update |
|
1911 } |
|
1912 } |
|
1913 break; |
|
1914 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
1915 default: |
|
1916 break; |
|
1917 } |
|
1918 SchedulePostEventCheckL(aCode); |
|
1919 |
|
1920 #ifdef RD_SCALABLE_UI_V2 |
|
1921 if ( !isPassNext ) |
|
1922 { |
|
1923 SendEventsToPluginManL( EPluginKeyEvent, aCode ); |
|
1924 } |
|
1925 #endif |
|
1926 |
|
1927 return response; |
|
1928 } |
|
1929 |
|
1930 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
1931 void CAknFepManager::HandleShiftHalfQwertyChineseL(TEventCode aEventCode) |
|
1932 { |
|
1933 if (aEventCode == EEventKeyDown) |
|
1934 { |
|
1935 ClearCcpuFlag(ECcpuStateCbaShown); |
|
1936 SetFlag(EFlagShiftKeyDepressed | EFlagNoActionDuringShiftKeyPress); |
|
1937 ClearFlag(EFlagNoActionDuringChrKeyPress); |
|
1938 SetFlag(EFlagQwertyShiftMode); |
|
1939 // Long press of shift key timer is activated. |
|
1940 iShiftKeypressMonitor->Start(EShiftKeyRepeatDelay, |
|
1941 EShiftKeyRepeatDelay, TCallBack(ResetShiftKeyMonitorCallback, |
|
1942 this) ); |
|
1943 } |
|
1944 else if (aEventCode == EEventKeyUp) |
|
1945 { |
|
1946 ClearFlag(EFlagShiftKeyDepressed |
|
1947 |EFlagNoActionDuringShiftKeyPress); |
|
1948 ClearFlag(EFlagQwertyShiftMode); |
|
1949 iShiftKeypressMonitor->Cancel(); |
|
1950 |
|
1951 if ( (iKeyPressedDuringShift)|| IsFlagSet(EFlagLongShiftKeyPress) ) |
|
1952 { |
|
1953 iKeyPressedDuringShift = EFalse; |
|
1954 ClearFlag( EFlagLongShiftKeyPress ); |
|
1955 if ( iFnKeyManager->FnKeyState() ) |
|
1956 { |
|
1957 iFnKeyManager->SetFnKeyState( CAknFepFnKeyManager::EFnKeyNone ); |
|
1958 } |
|
1959 UpdateIndicators(); |
|
1960 } |
|
1961 else |
|
1962 { |
|
1963 CAknEdwinState* editorState = EditorState(); |
|
1964 TInt permittedCases = editorState->PermittedCases(); |
|
1965 permittedCases = permittedCases == 0 ? |
|
1966 EAknEditorLowerCase | EAknEditorUpperCase : permittedCases; |
|
1967 |
|
1968 if (iMode == ELatin && (permittedCases & EAknEditorTextCase)) |
|
1969 { |
|
1970 // Latin case update is changed back to automatic if latin |
|
1971 // text case is allowed and the case is changed manually from #-key. |
|
1972 ClearFlag(CAknFepManager::EFlagSupressAutoUpdate); |
|
1973 } |
|
1974 TInt currentCase = iCaseMan->CurrentCase(); |
|
1975 |
|
1976 // Is current latin case last available case. |
|
1977 TBool lastCase = ( ( !(permittedCases & EAknEditorTextCase) |
|
1978 && ((currentCase == EAknEditorLowerCase) |
|
1979 || (currentCase == EAknEditorUpperCase |
|
1980 && !(permittedCases |
|
1981 & EAknEditorLowerCase)) ) |
|
1982 || (editorState->Flags() & EAknEditorFlagFixedCase) ) |
|
1983 || (editorState->Flags() |
|
1984 & EAknEditorFlagForceTransparentFepModes) ); |
|
1985 |
|
1986 if (iMode == ELatin |
|
1987 && !IsFlagSet(CAknFepManager::EFlagChangeInputMode) |
|
1988 && !lastCase) |
|
1989 { |
|
1990 if (iWesternPredictive) |
|
1991 { |
|
1992 // Input mode is still Latin. Only case is updated. |
|
1993 if (permittedCases & EAknEditorTextCase) |
|
1994 { |
|
1995 iCaseMan->ManualCaseUpdate(); |
|
1996 } |
|
1997 else |
|
1998 { |
|
1999 iCaseMan->SetCurrentCase(EAknEditorLowerCase); |
|
2000 } |
|
2001 } |
|
2002 else |
|
2003 { |
|
2004 if(iCaseMan->CurrentCase() == EAknEditorUpperCase) |
|
2005 { |
|
2006 iCaseMan->SetCurrentCase(EAknEditorLowerCase); |
|
2007 } |
|
2008 else |
|
2009 { |
|
2010 iCaseMan->SetCurrentCase(EAknEditorUpperCase); |
|
2011 } |
|
2012 } |
|
2013 |
|
2014 // Next time input mode is changed if any text is not entered before. |
|
2015 SetFlag(CAknFepManager::EFlagChangeInputMode); |
|
2016 } |
|
2017 else |
|
2018 { |
|
2019 // Input mode is incremented. |
|
2020 SetChangeModeByShiftAndSpace( EFalse ); |
|
2021 TryIncrementChineseModeForQwertyL(iMode); |
|
2022 |
|
2023 ClearFlag(CAknFepManager::EFlagChangeInputMode); |
|
2024 |
|
2025 if ( iMode == ELatin && iWesternPredictive ) // New mode after Increment. |
|
2026 |
|
2027 { |
|
2028 if (editorState->Flags() & EAknEditorFlagFixedCase) |
|
2029 { |
|
2030 // Only one fixed case is available. Use it. |
|
2031 iCaseMan->ConfigureCaseStateFromEditorState(); |
|
2032 SetFlag(CAknFepManager::EFlagChangeInputMode); |
|
2033 } |
|
2034 else if (editorState->Flags() |
|
2035 & EAknEditorFlagForceTransparentFepModes) |
|
2036 { |
|
2037 // Only lower case is used with find pane. |
|
2038 iCaseMan->SetCurrentCase(EAknEditorLowerCase); |
|
2039 SetFlag(CAknFepManager::EFlagSupressAutoUpdate); |
|
2040 SetFlag(CAknFepManager::EFlagChangeInputMode); |
|
2041 } |
|
2042 else if (permittedCases & EAknEditorTextCase) |
|
2043 { |
|
2044 iCaseMan->SetCurrentCase(EAknEditorTextCase); |
|
2045 iCaseMan->UpdateCase(ENullNaviEvent); |
|
2046 } |
|
2047 else |
|
2048 { |
|
2049 if (permittedCases & EAknEditorUpperCase) |
|
2050 { |
|
2051 iCaseMan->SetCurrentCase(EAknEditorUpperCase); |
|
2052 if ( !(permittedCases |
|
2053 & EAknEditorLowerCase)) |
|
2054 { |
|
2055 // We need to move to next input mode since only upper case |
|
2056 // is permitted in Latin input mode. |
|
2057 SetFlag(CAknFepManager::EFlagChangeInputMode); |
|
2058 } |
|
2059 } |
|
2060 else |
|
2061 { |
|
2062 iCaseMan->SetCurrentCase(EAknEditorLowerCase); |
|
2063 SetFlag(CAknFepManager::EFlagChangeInputMode); |
|
2064 } |
|
2065 } |
|
2066 } |
|
2067 } |
|
2068 } |
|
2069 } |
|
2070 } |
|
2071 |
|
2072 void CAknFepManager::HandleShiftQwertyChineseL(TEventCode aEventCode) |
|
2073 { |
|
2074 if ( IsFlagSet( EFlagQwertyChrKeyDepressed ) && |
|
2075 !IsFeatureSupportedJapanese() && |
|
2076 iCurrentFepUI->IsValidShiftKeyPress()) |
|
2077 { |
|
2078 ClearFlag(EFlagQwertyChrKeyDepressed | EFlagNoActionDuringChrKeyPress); |
|
2079 LaunchLanguagesPopupListL(); |
|
2080 return; |
|
2081 } |
|
2082 |
|
2083 TInt language = iSharedDataInterface->InputTextLanguage(); |
|
2084 |
|
2085 if (aEventCode == EEventKeyUp) |
|
2086 { |
|
2087 ClearCcpuFlag(ECcpuStateCbaShown); |
|
2088 if (FepUI()) |
|
2089 { |
|
2090 FepUI()->HandleKeyL(EKeyLeftShift, EShortKeyPress); |
|
2091 } |
|
2092 TBool validShift = iCurrentFepUI->IsValidShiftKeyPress(); |
|
2093 |
|
2094 if (IsFlagSet(EFlagLongShiftKeyPress) ||iKeyPressedDuringShift) |
|
2095 { |
|
2096 if (iKeyPressedDuringShift || IsFlagSet(EFlagQwertyShiftMode)) |
|
2097 { |
|
2098 iShiftKeypressMonitor->Cancel(); |
|
2099 iKeyPressedDuringShift = EFalse; |
|
2100 ClearFlag(EFlagQwertyShiftMode); |
|
2101 } |
|
2102 } |
|
2103 else |
|
2104 if (IsFlagSet(EFlagQwertyShiftMode)) |
|
2105 { |
|
2106 if ( iMode != ELatin && validShift ) |
|
2107 { |
|
2108 iModeBefore = iMode; |
|
2109 TryChangeModeL(ELatin); |
|
2110 ClearFlag( EFlagQwertyShiftMode ); |
|
2111 } |
|
2112 } |
|
2113 else |
|
2114 { |
|
2115 if (iMode == ELatin) |
|
2116 { |
|
2117 TBool isWsPr= EFalse; |
|
2118 if (WesternPredictive()) |
|
2119 { |
|
2120 SetWesternPredictive(EFalse); |
|
2121 isWsPr = ETrue; |
|
2122 } |
|
2123 TInt Modetemp = iModeBefore; |
|
2124 TInt sharedDataMode = iSharedDataInterface->InputMode(); |
|
2125 if (Modetemp == EStroke && |
|
2126 iQwertyInputMode && |
|
2127 sharedDataMode == ECangJie) |
|
2128 { |
|
2129 Modetemp = ECangJie; |
|
2130 } |
|
2131 |
|
2132 TryChangeModeL(Modetemp); |
|
2133 if (isWsPr) |
|
2134 { |
|
2135 SetWesternPredictive(ETrue); |
|
2136 } |
|
2137 } |
|
2138 } |
|
2139 |
|
2140 ClearFlag(EFlagShiftKeyDepressed); |
|
2141 |
|
2142 if (IsFlagSet(EFlagLongShiftKeyPress) |
|
2143 && iMode == ELatin |
|
2144 && IsFlagSet(EFlagQwertyShiftMode))//latin shift ->abc |
|
2145 { |
|
2146 ClearFlag(EFlagQwertyShiftMode); |
|
2147 } |
|
2148 |
|
2149 if (IsFlagSet(EFlagLongShiftKeyPress)) //long keypress up |
|
2150 { |
|
2151 ClearFlag(EFlagLongShiftKeyPress |
|
2152 |EFlagNoActionDuringShiftKeyPress); |
|
2153 } |
|
2154 else // short keypress up |
|
2155 { |
|
2156 iShiftKeypressMonitor->Cancel(); |
|
2157 } |
|
2158 |
|
2159 ClearFlag(EFlagNoActionDuringChrKeyPress); |
|
2160 ClearFlag(EFlagNoActionDuringShiftKeyPress); |
|
2161 if ( validShift ) |
|
2162 { |
|
2163 UpdateIndicators(); |
|
2164 } |
|
2165 else |
|
2166 { |
|
2167 ClearFlag(EFlagQwertyShiftMode); |
|
2168 } |
|
2169 } |
|
2170 else |
|
2171 if (aEventCode == EEventKeyDown) |
|
2172 { |
|
2173 |
|
2174 SetFlag(EFlagShiftKeyDepressed | EFlagNoActionDuringShiftKeyPress); |
|
2175 ClearFlag(EFlagNoActionDuringChrKeyPress); |
|
2176 |
|
2177 if (IsFlagSet(EFlagQwertyShiftMode)) |
|
2178 { |
|
2179 ClearFlag(EFlagQwertyShiftMode); |
|
2180 } |
|
2181 else |
|
2182 { |
|
2183 SetFlag(EFlagQwertyShiftMode); |
|
2184 if ( iCurrentFepUI->IsValidShiftKeyPress() |
|
2185 || iMode == ELatin ) |
|
2186 { |
|
2187 UpdateIndicators(); |
|
2188 } |
|
2189 // If the iShiftKeypressMonitor is actived now, cancel it first. |
|
2190 iShiftKeypressMonitor->Cancel(); |
|
2191 // Long press of shift key timer is activated. |
|
2192 iShiftKeypressMonitor->Start(EShiftKeyRepeatDelay, |
|
2193 EShiftKeyRepeatDelay, TCallBack( |
|
2194 ResetShiftKeyMonitorCallback, this)); |
|
2195 } |
|
2196 } |
|
2197 } |
|
2198 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
2199 TKeyResponse CAknFepManager::HandleShiftKeyEventL(TEventCode aEventCode) |
|
2200 { |
|
2201 TKeyResponse response = EKeyWasNotConsumed; |
|
2202 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2203 // GQF clarification |
|
2204 // In case irrespective Fn/shift key Text case should not be changed. |
|
2205 // Like Shift +Fn + Shift should not toggle the text case of the editor. |
|
2206 // Only Consecutive press of shift key should change the text case |
|
2207 if( iQwertyInputMode && (EEventKeyDown== aEventCode) && EPtiKeyboardHalfQwerty != KeyboardLayout()) |
|
2208 { |
|
2209 if( (iFnKeyManager->FnKeyState() == CAknFepFnKeyManager::EFnKeyNext) && |
|
2210 IsFlagSet(EFlagQwertyShiftMode)) |
|
2211 { |
|
2212 iFnKeyManager->ClearFnKeyState(); |
|
2213 iPtiEngine->SetCase((TPtiTextCase)EPtiCaseLower); |
|
2214 ClearFlag(EFlagQwertyShiftMode); |
|
2215 } |
|
2216 } |
|
2217 TInt language = iSharedDataInterface->InputTextLanguage(); |
|
2218 #endif |
|
2219 |
|
2220 if (iQwertyInputMode) |
|
2221 { |
|
2222 if ( !iInputCapabilities.FepAwareTextEditor() ) |
|
2223 { |
|
2224 response = EKeyWasNotConsumed; |
|
2225 } |
|
2226 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2227 else if (language == ELangTaiwanChinese|| |
|
2228 language == ELangHongKongChinese || |
|
2229 language == ELangPrcChinese) |
|
2230 { |
|
2231 if ( ( EPtiKeyboardHalfQwerty == KeyboardLayout() && FepUI() ) && |
|
2232 iPtiEngine && |
|
2233 ( EPtiCaseFnUpper == iPtiEngine->Case() || EPtiCaseFnLower == iPtiEngine->Case() ) && |
|
2234 ( aEventCode == EEventKeyDown || aEventCode == EEventKeyUp ) ) |
|
2235 { |
|
2236 // Ignore the KeyUp event |
|
2237 if( aEventCode == EEventKeyDown ) |
|
2238 { |
|
2239 FepUI()->HandleKeyL( EPtiKeyQwertyLeftShift, |
|
2240 EShortKeyPress ); |
|
2241 } |
|
2242 if( aEventCode == EEventKeyUp ) |
|
2243 { |
|
2244 ClearCcpuFlag(ECcpuStateCbaShown); |
|
2245 } |
|
2246 } |
|
2247 else |
|
2248 { |
|
2249 if ((iAknEditorFlags & EAknEditorFlagFindPane)&& (CAknFepFnKeyManager::EFnKeyNone ==FnKeyState())) |
|
2250 { |
|
2251 if (aEventCode == EEventKeyUp) |
|
2252 { |
|
2253 ClearCcpuFlag(ECcpuStateCbaShown); |
|
2254 if ( iKeyPressedDuringShift ) |
|
2255 { |
|
2256 iKeyPressedDuringShift = EFalse; |
|
2257 } |
|
2258 else |
|
2259 { |
|
2260 TryIncrementModeChineseQwertyL( iMode ); |
|
2261 } |
|
2262 ClearFlag( EFlagShiftKeyDepressed | EFlagNoActionDuringShiftKeyPress ); |
|
2263 } |
|
2264 else if(aEventCode == EEventKeyDown) |
|
2265 { |
|
2266 SetFlag(EFlagShiftKeyDepressed | EFlagNoActionDuringShiftKeyPress); |
|
2267 ClearFlag(EFlagNoActionDuringChrKeyPress); |
|
2268 } |
|
2269 return EKeyWasConsumed; |
|
2270 } |
|
2271 if (EPtiKeyboardHalfQwerty == KeyboardLayout()) |
|
2272 { |
|
2273 HandleShiftHalfQwertyChineseL(aEventCode); |
|
2274 } |
|
2275 else |
|
2276 { |
|
2277 HandleShiftQwertyChineseL(aEventCode); |
|
2278 } |
|
2279 } |
|
2280 } |
|
2281 #endif // ITI flag |
|
2282 else if (aEventCode == EEventKeyDown) |
|
2283 { |
|
2284 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2285 #ifdef __HALF_QWERTY_KEYPAD |
|
2286 if( ( EPtiKeyboardHalfQwerty == KeyboardLayout() && FepUI() ) && |
|
2287 iPtiEngine && EditorHasFreeSpace()) |
|
2288 { |
|
2289 if (IsFlagSet(CAknFepManager::EFlagInsideMultitapInlineEditingTransaction)) |
|
2290 { |
|
2291 iPtiEngine->CancelTimerActivity(); |
|
2292 } |
|
2293 if( EPtiCaseFnUpper == iPtiEngine->Case() || EPtiCaseFnLower == iPtiEngine->Case() ) |
|
2294 { |
|
2295 FepUI()->HandleKeyL( EPtiKeyQwertyLeftShift, |
|
2296 EShortKeyPress ); |
|
2297 iFnCharInsertedForShift = ETrue; |
|
2298 } |
|
2299 } |
|
2300 #endif // Half Qwerty flag |
|
2301 #endif // ITI flag |
|
2302 |
|
2303 // Shift key is pressed down. |
|
2304 SetFlag(EFlagShiftKeyDepressed | EFlagNoActionDuringShiftKeyPress); |
|
2305 ClearFlag(EFlagNoActionDuringChrKeyPress); |
|
2306 if ( IsFlagSet(EFlagQwertyShiftMode) && IsFlagSet(EFlagNoActionDuringShiftKeyPress) ) |
|
2307 { |
|
2308 ClearFlag(EFlagQwertyShiftMode | EFlagNoActionDuringShiftKeyPress); |
|
2309 // If long shift key press flag is set, then do not do manual case update. |
|
2310 if (!IsFlagSet(EFlagLongShiftKeyPress)) |
|
2311 { |
|
2312 iCaseMan->ManualCaseUpdate(); |
|
2313 } |
|
2314 } |
|
2315 else |
|
2316 { |
|
2317 if (!(iCurrentFepUI->IsValidShiftKeyPress())) |
|
2318 { |
|
2319 return EKeyWasConsumed; |
|
2320 } |
|
2321 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2322 #ifdef __HALF_QWERTY_KEYPAD |
|
2323 if(!iFnCharInsertedForShift) |
|
2324 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
2325 #endif //__HALF_QWERTY_KEYPAD |
|
2326 { |
|
2327 SetFlag(EFlagQwertyShiftMode); |
|
2328 } |
|
2329 |
|
2330 if(iShiftKeypressMonitor->IsActive()) |
|
2331 iShiftKeypressMonitor->Cancel(); |
|
2332 // Long press of shift key timer is activated. |
|
2333 iShiftKeypressMonitor->Start(EShiftKeyRepeatDelay, EShiftKeyRepeatDelay, |
|
2334 TCallBack(ResetShiftKeyMonitorCallback, this)); |
|
2335 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2336 // Shift kkey hack for GQF implementation. Need to check |
|
2337 // if it has any side effect. |
|
2338 if((iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyLock) |
|
2339 && (iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyForced) |
|
2340 && (iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyDown) |
|
2341 && (iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyNext)) |
|
2342 #endif |
|
2343 UpdateIndicators(); |
|
2344 } |
|
2345 } |
|
2346 else if (aEventCode == EEventKeyUp) |
|
2347 { |
|
2348 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2349 #ifdef __HALF_QWERTY_KEYPAD |
|
2350 if( ( EPtiKeyboardHalfQwerty == KeyboardLayout() && FepUI() ) && |
|
2351 iPtiEngine ) |
|
2352 { |
|
2353 ClearCcpuFlag(ECcpuStateHashDown |
|
2354 | ECcpuStateHashKeyDeleteDone |
|
2355 | ECcpuStateChangeToPredictionMode); |
|
2356 if (IsCcpuFlagSet(ECcpuStateEdwinInSelectionMode)) |
|
2357 { |
|
2358 SetCcpuFlag(ECcpuStateSelectionEventPosted); |
|
2359 ClearCcpuFlag(ECcpuStateEdwinInSelectionMode); |
|
2360 SetFlag(EFlagLongShiftKeyPress); |
|
2361 |
|
2362 TKeyEvent ccpuStart = {0, EStdKeyLeftShift, 0, 0}; |
|
2363 CCoeEnv::Static()->SimulateKeyEventL(ccpuStart, aEventCode); |
|
2364 } |
|
2365 if( CAknFepFnKeyManager::EFnKeyNone != FnKeyState()) |
|
2366 { |
|
2367 ClearFlag(EFlagQwertyShiftMode); |
|
2368 } |
|
2369 // iFnCharInsertedForShift = EFalse; |
|
2370 } |
|
2371 |
|
2372 #endif // Half Qwerty flag |
|
2373 #endif // ITI flag |
|
2374 |
|
2375 ClearFlag(EFlagShiftKeyDepressed); |
|
2376 ClearCcpuFlag(ECcpuStateCbaShown); |
|
2377 if ( !IsFlagSet(EFlagNoActionDuringShiftKeyPress) || |
|
2378 (IsFlagSet(EFlagNoActionDuringShiftKeyPress) && IsFlagSet(EFlagLongShiftKeyPress)) ) |
|
2379 { |
|
2380 ClearFlag(EFlagQwertyShiftMode); |
|
2381 } |
|
2382 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2383 #ifdef __HALF_QWERTY_KEYPAD |
|
2384 if( IsFlagSet(EFlagQwertyChrKeyDepressed) && IsFlagSet(EFlagNoActionDuringShiftKeyPress)) |
|
2385 { |
|
2386 #ifdef FF_DUAL_LANGUAGE_SUPPORT |
|
2387 // Currently dual language feature would work correctly for ITUT and Half Qwerty products |
|
2388 // Hence the dual language settings should also be displayed only for ITUT and Halfqwerty products |
|
2389 if(iKeyboardType == EPtiKeyboardHalfQwerty ) |
|
2390 LaunchDualLanguageSettingDialogL(); |
|
2391 else |
|
2392 #endif //FF_DUAL_LANGUAGE_SUPPORT |
|
2393 LaunchLanguagesPopupListL(); |
|
2394 ClearFlag(EFlagQwertyChrKeyDepressed|EFlagNoActionDuringChrKeyPress|EFlagNoActionDuringShiftKeyPress); |
|
2395 } |
|
2396 |
|
2397 #ifdef __SHIFT_KEY_LOOP |
|
2398 if( KeyboardLayout() == EPtiKeyboardHalfQwerty && |
|
2399 // looping does not happen for long key press |
|
2400 !IsFlagSet(EFlagLongShiftKeyPress) && |
|
2401 // looping does not happen in functionized state |
|
2402 iFnKeyManager->FnKeyState() == CAknFepFnKeyManager::EFnKeyNone && |
|
2403 // looping happens only when no action |
|
2404 // has happened when the shift key has been pressed |
|
2405 IsFlagSet(EFlagNoActionDuringShiftKeyPress) && !iFnCharInsertedForShift ) |
|
2406 { |
|
2407 HandleKeyEventL( EStdKeyLeftShift, EShortKeyPress ); |
|
2408 ClearFlag(EFlagQwertyShiftMode); |
|
2409 } |
|
2410 iFnCharInsertedForShift = EFalse; |
|
2411 #endif //__SHIFT_KEY_LOOP |
|
2412 #endif //__HALF_QWERTY_KEYPAD |
|
2413 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
2414 if (IsFlagSet(EFlagLongShiftKeyPress)) //long keypress up |
|
2415 { |
|
2416 ClearFlag(EFlagLongShiftKeyPress); |
|
2417 } |
|
2418 else // short keypress up |
|
2419 { |
|
2420 iShiftKeypressMonitor->Cancel(); |
|
2421 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2422 #ifdef __HALF_QWERTY_KEYPAD |
|
2423 #ifdef __SHIFT_KEY_LOOP |
|
2424 // Cancel multitap timer |
|
2425 iPtiEngine->CancelTimerActivity(); |
|
2426 #endif //__SHIFT_KEY_LOOP |
|
2427 #endif //__HALF_QWERTY_KEYPAD |
|
2428 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
2429 } |
|
2430 ClearFlag( EFlagNoActionDuringShiftKeyPress ); |
|
2431 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2432 // Shift kkey hack for GQF implementation. Need to check |
|
2433 // if it has any side effect. |
|
2434 if((iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyLock) |
|
2435 && (iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyForced) |
|
2436 && (iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyDown) |
|
2437 &&(iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyNext)) |
|
2438 #endif |
|
2439 UpdateIndicators(); |
|
2440 } |
|
2441 } |
|
2442 else |
|
2443 { |
|
2444 if ( !iInputCapabilities.FepAwareTextEditor() && (!iCandidatePopup)) |
|
2445 { |
|
2446 response = EKeyWasNotConsumed; |
|
2447 } |
|
2448 else if (aEventCode == EEventKeyDown) |
|
2449 { |
|
2450 if (Japanese() && iInputCapabilities.FepAwareTextEditor()) |
|
2451 { |
|
2452 if (!(iCurrentFepUI->IsValidShiftKeyPress())) |
|
2453 { |
|
2454 return EKeyWasConsumed; |
|
2455 } |
|
2456 TryCloseUiL(); |
|
2457 } |
|
2458 |
|
2459 // Shift key is pressed down but no any other key is pressed. |
|
2460 ClearCcpuFlag(ECcpuSupressEditMenuFromShiftUp); |
|
2461 SetFlag(EFlagShiftKeyDepressed | EFlagNoActionDuringShiftKeyPress); |
|
2462 if ( !(iAknEditorFlags & EAknEditorFlagNoLRNavigation)) |
|
2463 { |
|
2464 // Cancel the timer first if active. |
|
2465 // EEventKeyUp is not sent always for shift key during debugging on emulator. |
|
2466 iShiftKeypressMonitor->Cancel(); |
|
2467 // Long press of shift key timer is activated. |
|
2468 iShiftKeypressMonitor->Start(EShiftKeyRepeatDelay, EShiftKeyRepeatDelay, |
|
2469 TCallBack(ResetShiftKeyMonitorCallback, this)); |
|
2470 } |
|
2471 if ( IsFlagSet(EFlagInsideInlineEditingTransaction) && |
|
2472 WesternPredictive() && iFepManState == EAknFepStateUIActive ) |
|
2473 { |
|
2474 TryRemoveNoMatchesIndicatorL(); |
|
2475 UpdateCbaL(NULL); |
|
2476 } |
|
2477 } |
|
2478 else if (aEventCode == EEventKeyUp) |
|
2479 { |
|
2480 ClearFlag(EFlagShiftKeyDepressed); |
|
2481 ClearCcpuFlag(ECcpuStateCbaShown); |
|
2482 if (IsFlagSet(EFlagLongShiftKeyPress)) //long keypress up |
|
2483 { |
|
2484 ClearFlag(EFlagLongShiftKeyPress | EFlagNoActionDuringShiftKeyPress); |
|
2485 // Shift long key press timer started, in between release of |
|
2486 // Shift key should cancel active long shift key timer. |
|
2487 iShiftKeypressMonitor->Cancel(); |
|
2488 if (!iInputCapabilities.FepAwareTextEditor()) |
|
2489 { |
|
2490 TKeyEvent ccpuStart = {0, EStdKeyLeftShift, 0, 0}; |
|
2491 CCoeEnv::Static()->SimulateKeyEventL(ccpuStart, EEventKeyUp); |
|
2492 } |
|
2493 } |
|
2494 else // short keypress up |
|
2495 { |
|
2496 iShiftKeypressMonitor->Cancel(); |
|
2497 if (!(iAknEditorFlags & EAknEditorFlagSupressShiftMenu) && |
|
2498 IsFlagSet(EFlagNoActionDuringShiftKeyPress) && //iCurrentFepUI->IsValidShiftKeyPress() && |
|
2499 !IsCcpuFlagSet(ECcpuSupressEditMenuFromShiftUp)) |
|
2500 { |
|
2501 // Shift key is released before any other key is pressed. |
|
2502 // Edit menu is launched if it is allowed. |
|
2503 ClearFlag(EFlagNoActionDuringShiftKeyPress); |
|
2504 //Check if pointer event drag is not there before launch of edit menu. |
|
2505 if( !IsExtendedFlagSet(EExtendedFlagPointerEventTypeEDrag)) |
|
2506 { |
|
2507 LaunchSelectModeMenuL(); |
|
2508 } |
|
2509 |
|
2510 if (iInputCapabilities.FepAwareTextEditor()) |
|
2511 { |
|
2512 response = EKeyWasConsumed; |
|
2513 } |
|
2514 } |
|
2515 } |
|
2516 } |
|
2517 } |
|
2518 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2519 if (aEventCode == EEventKeyUp && |
|
2520 EPtiKeyboardQwerty4x10 == KeyboardLayout() && FepUI()) |
|
2521 { |
|
2522 FepUI()->HandleKeyL(EKeyLeftShift, EShortKeyPress); |
|
2523 } |
|
2524 #endif |
|
2525 return response; |
|
2526 } |
|
2527 |
|
2528 TKeyResponse CAknFepManager::HandleThai0KeyEvent(TEventCode aEventCode, TKeyPressLength aLength, |
|
2529 TBool& aThai0KeyHandling) |
|
2530 { |
|
2531 TKeyResponse response = EKeyWasNotConsumed; |
|
2532 aThai0KeyHandling = EFalse; |
|
2533 if(iQwertyInputMode) |
|
2534 { |
|
2535 return response; |
|
2536 } |
|
2537 |
|
2538 if ( iLanguageCapabilities.iInputLanguageCode == ELangThai && |
|
2539 iMode != ENumber && iMode != ENativeNumber ) |
|
2540 { |
|
2541 if (!IsPredictive()) |
|
2542 { |
|
2543 if (aEventCode != EEventKeyUp) |
|
2544 { |
|
2545 response = EKeyWasConsumed; |
|
2546 if ( aLength == ELongKeyPress) |
|
2547 { |
|
2548 if (!iLongThai0Key) |
|
2549 { |
|
2550 iLongThai0Key = ETrue; |
|
2551 response = EKeyWasNotConsumed; // 0 to editor |
|
2552 aThai0KeyHandling = ETrue; |
|
2553 } |
|
2554 } |
|
2555 } |
|
2556 |
|
2557 else if (aEventCode == EEventKeyUp) |
|
2558 { |
|
2559 if (iLongThai0Key) |
|
2560 { |
|
2561 iLongThai0Key = EFalse; |
|
2562 response = EKeyWasConsumed; |
|
2563 } |
|
2564 else |
|
2565 { |
|
2566 response = EKeyWasNotConsumed; // Show Thai 0 key SCT |
|
2567 aThai0KeyHandling = ETrue; |
|
2568 } |
|
2569 } |
|
2570 } |
|
2571 } |
|
2572 return response; |
|
2573 } |
|
2574 |
|
2575 TBool CAknFepManager::HandleQwertyChrKeyEventL(TEventCode aEventCode) |
|
2576 { |
|
2577 TBool response = EFalse; |
|
2578 if ( !iQwertyInputMode || !iInputCapabilities.FepAwareTextEditor() ) |
|
2579 { |
|
2580 return response; |
|
2581 } |
|
2582 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2583 if(IsFlagSet(EFlagShiftKeyDepressed)) |
|
2584 { |
|
2585 iKeyPressedDuringShift = ETrue; |
|
2586 } |
|
2587 #ifdef __HALF_QWERTY_KEYPAD |
|
2588 |
|
2589 if( (aEventCode == EEventKeyUp) ) |
|
2590 { |
|
2591 ClearFlag(EFlagQwertyChrKeyDepressed); |
|
2592 } |
|
2593 // Handle shift for Half Qwerty seperately |
|
2594 if( ( EPtiKeyboardHalfQwerty == KeyboardLayout() && FepUI() ) && |
|
2595 iPtiEngine /*&& |
|
2596 ( aEventCode == EEventKeyDown || aEventCode == EEventKeyUp ) */ && !IsFlagSet(EFlagShiftKeyDepressed)) |
|
2597 { |
|
2598 |
|
2599 if( HandleChrKeyForHalfQwertyL(aEventCode) ) |
|
2600 { |
|
2601 return ETrue; |
|
2602 } |
|
2603 } |
|
2604 #endif // Half Qwerty flag |
|
2605 // This part of code for error fixing. |
|
2606 // whenever fep is Fnupper state, press of "CHR" key |
|
2607 // always launch SCT table. |
|
2608 if( (iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyNone)&& |
|
2609 (IsFlagSet(EFlagQwertyShiftMode) || IsFlagSet(EFlagLongShiftKeyPress))) |
|
2610 { |
|
2611 ClearFlag(EFlagNoActionDuringShiftKeyPress | EFlagLongShiftKeyPress | EFlagShiftKeyDepressed | EFlagQwertyShiftMode); |
|
2612 iShiftKeypressMonitor->Cancel(); |
|
2613 SetFlag(EFlagQwertyChrKeyDepressed | EFlagNoActionDuringChrKeyPress); |
|
2614 return response; |
|
2615 } |
|
2616 |
|
2617 |
|
2618 #endif // ITI flag |
|
2619 if (aEventCode == EEventKeyDown) |
|
2620 { |
|
2621 SetFlag(EFlagQwertyChrKeyDepressed | EFlagNoActionDuringChrKeyPress); |
|
2622 response = EFalse; |
|
2623 |
|
2624 if (IsFeatureSupportedJapanese() || |
|
2625 ( IsChineseInputLanguage() |
|
2626 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2627 && KeyboardLayout() == EPtiKeyboardHalfQwerty |
|
2628 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
2629 ) ) |
|
2630 { |
|
2631 // start timer for Chr key long pressing |
|
2632 iChrKeypressMonitor->Start(EChrKeyRepeatDelay, EChrKeyRepeatDelay, |
|
2633 TCallBack(HandleChrKeyMonitorCallback, this)); |
|
2634 } |
|
2635 } |
|
2636 else if (aEventCode == EEventKeyUp) |
|
2637 { |
|
2638 if (iChrKeypressMonitor->IsActive()) |
|
2639 { |
|
2640 iChrKeypressMonitor->Cancel(); |
|
2641 } |
|
2642 |
|
2643 if (IsFlagSet(EFlagShiftKeyDepressed) && IsFlagSet(EFlagNoActionDuringChrKeyPress) |
|
2644 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2645 || |
|
2646 IsFlagSet(EFlagQwertyShiftMode) |
|
2647 #endif |
|
2648 ) |
|
2649 { |
|
2650 ClearFlag(EFlagNoActionDuringShiftKeyPress | EFlagLongShiftKeyPress | |
|
2651 EFlagShiftKeyDepressed | EFlagQwertyShiftMode |EFlagQwertyChrKeyDepressed); |
|
2652 iShiftKeypressMonitor->Cancel(); |
|
2653 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2654 iKeyPressedDuringShift = EFalse; |
|
2655 #endif |
|
2656 UpdateIndicators(); |
|
2657 // In Japanese variant, the selecting input language is unnecessary. |
|
2658 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2659 if (EPtiKeyboardQwerty4x10 == KeyboardLayout() || EPtiKeyboardHalfQwerty == KeyboardLayout()) |
|
2660 { |
|
2661 if (!IsFeatureSupportedJapanese() && iCurrentFepUI->IsValidShiftKeyPress()) |
|
2662 { |
|
2663 #ifdef FF_DUAL_LANGUAGE_SUPPORT |
|
2664 // Currently dual language feature would work correctly for ITUT and Half Qwerty products |
|
2665 // Hence the dual language settings should also be displayed only for ITUT and Halfqwerty products |
|
2666 if(iKeyboardType == EPtiKeyboard12Key || iKeyboardType == EPtiKeyboardHalfQwerty ) |
|
2667 LaunchDualLanguageSettingDialogL(); |
|
2668 else |
|
2669 #endif //FF_DUAL_LANGUAGE_SUPPORT |
|
2670 LaunchLanguagesPopupListL(); |
|
2671 } |
|
2672 } |
|
2673 else |
|
2674 { |
|
2675 #endif |
|
2676 if (!IsFeatureSupportedJapanese() && iCurrentFepUI->IsValidShiftKeyPress()) |
|
2677 { |
|
2678 LaunchLanguagesPopupListL(); |
|
2679 } |
|
2680 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2681 } |
|
2682 #endif |
|
2683 } |
|
2684 else if (IsFlagSet(EFlagNoActionDuringChrKeyPress)) |
|
2685 { |
|
2686 // pass key to Chinese UI manager in Chinese qwerty input for sct table |
|
2687 if(IsChineseInputLanguage() && iMode != ELatin) |
|
2688 { |
|
2689 FepUI()->HandleKeyL(EStdKeyLeftFunc, EShortKeyPress); |
|
2690 ClearFlag( EFlagQwertyChrKeyDepressed | EFlagNoActionDuringChrKeyPress ); |
|
2691 } |
|
2692 else if (Japanese()) |
|
2693 { |
|
2694 if (iMode != EHiragana) |
|
2695 { |
|
2696 // Commit characters |
|
2697 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2698 // Set the iSupressCursorMoveToEndChrKeyPressed when cursor is in |
|
2699 // between two words and SCT is launched |
|
2700 iSupressCursorMoveToEndChrKeyPressed = ETrue; |
|
2701 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
2702 HandleChangeInFocus(); |
|
2703 LaunchSpecialCharacterTableL(); |
|
2704 } |
|
2705 } |
|
2706 else if ( IsAbleToLaunchSCT() ) |
|
2707 { |
|
2708 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2709 // Set the iSupressCursorMoveToEndChrKeyPressed when cursor is in |
|
2710 // between two words and SCT is launched |
|
2711 iSupressCursorMoveToEndChrKeyPressed = ETrue; |
|
2712 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
2713 HandleChangeInFocus(); |
|
2714 LaunchSpecialCharacterTableL(); |
|
2715 } |
|
2716 else if(IsFlagSet(EFlagQwertyChrKeyDepressed)) |
|
2717 { |
|
2718 ClearFlag(EFlagQwertyChrKeyDepressed); |
|
2719 } |
|
2720 } |
|
2721 else |
|
2722 { |
|
2723 FepUI()->ExpireMultitapTimer(); |
|
2724 ClearFlag(EFlagQwertyChrKeyDepressed | EFlagNoActionDuringChrKeyPress); |
|
2725 |
|
2726 response = ETrue; |
|
2727 } |
|
2728 } |
|
2729 return response; |
|
2730 } |
|
2731 |
|
2732 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2733 #ifdef __HALF_QWERTY_KEYPAD |
|
2734 TKeyResponse CAknFepManager::HandleChrKeyForHalfQwertyL( TEventCode aEventCode) |
|
2735 { |
|
2736 if ((IsFlagSet(CAknFepManager::EFlagInsideMultitapInlineEditingTransaction)) && !(EPtiCaseFnUpper == iPtiEngine->Case() || EPtiCaseFnLower == iPtiEngine->Case())) |
|
2737 { |
|
2738 iPtiEngine->CancelTimerActivity(); |
|
2739 } |
|
2740 // in functionized mode the chr key is mapped to specific chars |
|
2741 // and should therefore be handled by the states |
|
2742 if ( EPtiCaseFnUpper == iPtiEngine->Case() || EPtiCaseFnLower == iPtiEngine->Case() || IsReverseFnkeyInput()) |
|
2743 { |
|
2744 if( aEventCode == EEventKeyDown && ( EditorHasFreeSpace() || |
|
2745 IsFlagSet( EFlagInsideMultitapInlineEditingTransaction ))) |
|
2746 { |
|
2747 FepUI()->HandleKeyL( EStdKeyLeftFunc, |
|
2748 EShortKeyPress ); |
|
2749 } |
|
2750 return EKeyWasConsumed; |
|
2751 } |
|
2752 // in non-functionized predictive mode, |
|
2753 // a long key press of the chr key should produce the SCT |
|
2754 // a short key press should produce the candidate list |
|
2755 if ( ( iWesternPredictive || IsChineseInputLanguage() ) /*&& |
|
2756 ( iMode != EPinyin && iMode != EStroke && iMode != EZhuyin )*/ ) |
|
2757 { |
|
2758 |
|
2759 if(!iChrKeypressMonitor->IsActive()) |
|
2760 { |
|
2761 // this monitors long key presses of chr key |
|
2762 // the framework does not give us the iRepeats info |
|
2763 // for chr key for some reason |
|
2764 iChrKeypressMonitor->Start(EHalfQwertyChrKeyRepeatDelay, EHalfQwertyChrKeyRepeatDelay, |
|
2765 TCallBack(HandleChrKeyMonitorCallback, this)); |
|
2766 } |
|
2767 |
|
2768 if( aEventCode != EEventKeyUp ) |
|
2769 { |
|
2770 SetFlag( EFlagQwertyChrKeyDepressed | EFlagNoActionDuringChrKeyPress); |
|
2771 return EKeyWasConsumed; |
|
2772 } |
|
2773 |
|
2774 if ( aEventCode == EEventKeyUp && IsFlagSet(EFlagNoActionDuringChrKeyPress) ) |
|
2775 { |
|
2776 if(!iChrLongKeyPress ) |
|
2777 { |
|
2778 // if we have come here it's a short press |
|
2779 // the flag EFlagNoActionDuringChrKeyPress is cleared in the timer callback |
|
2780 if(!IsFlagSet(CAknFepManager::EFlagInsideInlineEditingTransaction) || IsFlagSet(CAknFepManager::EFlagInsideMultitapInlineEditingTransaction)) |
|
2781 { |
|
2782 // when not in inline editing mode, |
|
2783 // chr key should produce the SCT |
|
2784 if ( !IsChineseInputLanguage() ) |
|
2785 { |
|
2786 LaunchSpecialCharacterTableL(); |
|
2787 } |
|
2788 else |
|
2789 { |
|
2790 FepUI()->HandleKeyL( EStdKeyLeftFunc, |
|
2791 EShortKeyPress ); |
|
2792 } |
|
2793 } |
|
2794 ClearFlag( EFlagQwertyChrKeyDepressed | EFlagNoActionDuringChrKeyPress); |
|
2795 |
|
2796 iChrKeypressMonitor->Cancel(); |
|
2797 |
|
2798 TInt wordToFocus = KWordToFocusInCandidateList; |
|
2799 TInt numberOfCandidates = iPtiEngine->NumberOfCandidates(); |
|
2800 if (numberOfCandidates > 1) |
|
2801 { |
|
2802 wordToFocus = KWordToFocusInCandidateList; |
|
2803 } |
|
2804 LaunchCandidatePopupListL(wordToFocus); |
|
2805 |
|
2806 return EKeyWasConsumed; |
|
2807 } |
|
2808 else |
|
2809 { |
|
2810 |
|
2811 |
|
2812 // Cancel the timer |
|
2813 iChrKeypressMonitor->Cancel(); |
|
2814 |
|
2815 // commit the characters |
|
2816 HandleChangeInFocus(); |
|
2817 |
|
2818 // Clear the chr key depressed flag |
|
2819 ClearFlag( EFlagQwertyChrKeyDepressed | EFlagNoActionDuringChrKeyPress); |
|
2820 // launch the special character table |
|
2821 iChrLongKeyPress = EFalse; |
|
2822 |
|
2823 if ( IsAbleToLaunchSCT() ) |
|
2824 { |
|
2825 LaunchSpecialCharacterTableL(); |
|
2826 } |
|
2827 |
|
2828 return EKeyWasConsumed; |
|
2829 } |
|
2830 } |
|
2831 else |
|
2832 { |
|
2833 return EKeyWasNotConsumed; |
|
2834 } |
|
2835 } |
|
2836 return EKeyWasNotConsumed; |
|
2837 } |
|
2838 #endif //__HALF_QWERTY_KEYPAD |
|
2839 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
2840 |
|
2841 TKeyResponse CAknFepManager::HandleQwertyControlKeyEventL(const TKeyEvent& aKeyEvent, |
|
2842 TEventCode aEventCode) |
|
2843 { |
|
2844 TKeyResponse response = EKeyWasConsumed; |
|
2845 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2846 if (EPtiKeyboardQwerty4x10 == KeyboardLayout()) |
|
2847 { |
|
2848 if( iCurrentFepUI && !iCurrentFepUI->IsValidShiftKeyPress() && aEventCode == EEventKeyUp ) |
|
2849 { |
|
2850 FepUI()->HandleKeyL(EKeyLeftCtrl, EShortKeyPress); |
|
2851 return EKeyWasConsumed; |
|
2852 } |
|
2853 } |
|
2854 #endif |
|
2855 |
|
2856 // need to ignore [Ctrl] + the following simbol keys |
|
2857 // because FEP doesn't consume [Ctrl] combination keys. |
|
2858 if (Japanese() && aEventCode == EEventKey) |
|
2859 { |
|
2860 TBool comsume = EFalse; |
|
2861 switch (aKeyEvent.iScanCode) |
|
2862 { |
|
2863 case EStdKeyNkpPlus: |
|
2864 case EPtiKeyQwertyPlus: |
|
2865 case EPtiKeyQwertyMinus: |
|
2866 case EPtiKeyQwertyComma: |
|
2867 case EPtiKeyQwertySemicolon: |
|
2868 case EPtiKeyQwertyFullstop: |
|
2869 case EPtiKeyQwertyHash: |
|
2870 case EPtiKeyQwertySlash: |
|
2871 case EPtiKeyQwertyApostrophe: |
|
2872 case EPtiKeyQwertySpace: |
|
2873 comsume = ETrue; |
|
2874 break; |
|
2875 default: |
|
2876 break; |
|
2877 } |
|
2878 if (comsume) |
|
2879 { |
|
2880 return EKeyWasConsumed; |
|
2881 } |
|
2882 } |
|
2883 |
|
2884 #ifdef RD_SCALABLE_UI_V2 |
|
2885 if (aKeyEvent.iModifiers & EModifierCtrl |
|
2886 && (aKeyEvent.iScanCode == EPtiKeyQwertyC || aKeyEvent.iScanCode == EPtiKeyQwertyV || |
|
2887 aKeyEvent.iScanCode == EPtiKeyQwertyX)) |
|
2888 { |
|
2889 SendEventsToPluginManL( EPluginSyncFepAwareText ); |
|
2890 // Let copy / cut / paste events to flow through. |
|
2891 response = EKeyWasNotConsumed; |
|
2892 } |
|
2893 #endif |
|
2894 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2895 // Predictive QWERTY (XT9) changes ----> |
|
2896 // Ctrl combinations which affect the editor state, must commit the current inline edit. |
|
2897 // Otherwise the currently active inline word might be lost. |
|
2898 if ( iWesternPredictive && iQwertyInputMode && IsFlagSet(EFlagInsideInlineEditingTransaction) ) |
|
2899 { |
|
2900 switch (aKeyEvent.iScanCode) |
|
2901 { |
|
2902 case EStdKeyUpArrow: |
|
2903 case EStdKeyDownArrow: |
|
2904 case EStdKeyLeftArrow: |
|
2905 case EStdKeyRightArrow: |
|
2906 case EPtiKeyQwertyC: |
|
2907 case EPtiKeyQwertyV: |
|
2908 case EPtiKeyQwertyX: |
|
2909 case EPtiKeyQwertyA: |
|
2910 iPtiEngine->CommitCurrentWord(); |
|
2911 TryCloseUiL(); |
|
2912 break; |
|
2913 default: |
|
2914 break; |
|
2915 } |
|
2916 } |
|
2917 // Predictive QWERTY (XT9) changes <---- |
|
2918 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
2919 |
|
2920 if (aEventCode != EEventKeyUp) |
|
2921 { |
|
2922 return EKeyWasNotConsumed; |
|
2923 } |
|
2924 |
|
2925 if(iQwertyInputMode) |
|
2926 { |
|
2927 |
|
2928 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2929 // Query ptiEngine to know if the scancode maps to EPtiKeyQwertyC, |
|
2930 // EPtiKeyQwertyV or EPtiKeyQwertyX. |
|
2931 // we should not always rely on scancode as products may change it, while |
|
2932 // still having the 'C', 'V' and 'X' mappings |
|
2933 |
|
2934 TBuf<32> mapData; |
|
2935 iPtiEngine->MappingDataForKey((TPtiKey)aKeyEvent.iScanCode, mapData, EPtiCaseUpper); |
|
2936 |
|
2937 if( mapData.Length() > 0 ) |
|
2938 { |
|
2939 if( mapData[0] == EPtiKeyQwertyC || mapData[0] == EPtiKeyQwertyV || |
|
2940 mapData[0] == EPtiKeyQwertyX ) |
|
2941 { |
|
2942 // Let copy / cut / paste events to flow through. |
|
2943 response = EKeyWasNotConsumed; |
|
2944 } |
|
2945 } |
|
2946 #else |
|
2947 if (aKeyEvent.iScanCode == EPtiKeyQwertyC || aKeyEvent.iScanCode == EPtiKeyQwertyV || |
|
2948 aKeyEvent.iScanCode == EPtiKeyQwertyX) |
|
2949 { |
|
2950 // Let copy / cut / paste events to flow through. |
|
2951 response = EKeyWasNotConsumed; |
|
2952 } |
|
2953 #endif |
|
2954 |
|
2955 |
|
2956 if (aKeyEvent.iScanCode == EStdKeyRightShift || aKeyEvent.iScanCode == EStdKeyLeftShift |
|
2957 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2958 || |
|
2959 IsFlagSet(EFlagQwertyShiftMode) |
|
2960 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
2961 ) |
|
2962 { |
|
2963 if(!iInputCapabilities.FepAwareTextEditor()) |
|
2964 { |
|
2965 response = EKeyWasNotConsumed; |
|
2966 } |
|
2967 else |
|
2968 { |
|
2969 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
2970 if ( iMode != ENumber && iMode!= ENativeNumber ) |
|
2971 { |
|
2972 iModeBefore = iMode; |
|
2973 } |
|
2974 #ifdef RD_HINDI_PHONETIC_INPUT |
|
2975 |
|
2976 if(iSharedDataInterface->InputTextLanguage() == KLangHindiPhonetic) |
|
2977 { |
|
2978 TryChangePhoneticModeL(); |
|
2979 } |
|
2980 else |
|
2981 { |
|
2982 #endif |
|
2983 if((!(IsOnlyNumericPermitted() || |
|
2984 (iAknEditorFlags & EAknEditorFlagLatinInputModesOnly))) && |
|
2985 TAknFepUiIndicInputManager::IsIndicLangauge( |
|
2986 (TLanguage)iSharedDataInterface->InputTextLanguage())) |
|
2987 { |
|
2988 if(iLanguageCapabilities.iInputLanguageCode == ELangEnglish) |
|
2989 { |
|
2990 ChangeInputLanguageL(iSharedDataInterface->InputTextLanguage()); |
|
2991 } |
|
2992 else |
|
2993 { |
|
2994 ChangeInputLanguageL(ELangEnglish); |
|
2995 } |
|
2996 } |
|
2997 else |
|
2998 { |
|
2999 TryIncrementModeChineseQwertyL(iMode); |
|
3000 } |
|
3001 #ifdef RD_HINDI_PHONETIC_INPUT |
|
3002 } |
|
3003 #endif |
|
3004 } |
|
3005 ClearFlag(EFlagShiftKeyDepressed); |
|
3006 if ( !IsFlagSet(EFlagNoActionDuringShiftKeyPress) || |
|
3007 (IsFlagSet(EFlagNoActionDuringShiftKeyPress) && IsFlagSet(EFlagLongShiftKeyPress)) ) |
|
3008 { |
|
3009 ClearFlag(EFlagQwertyShiftMode); |
|
3010 } |
|
3011 if (IsFlagSet(EFlagLongShiftKeyPress)) //long keypress up |
|
3012 { |
|
3013 ClearFlag(EFlagLongShiftKeyPress); |
|
3014 } |
|
3015 else // short keypress up |
|
3016 { |
|
3017 iShiftKeypressMonitor->Cancel(); |
|
3018 } |
|
3019 ClearFlag( EFlagNoActionDuringShiftKeyPress ); |
|
3020 UpdateIndicators(); |
|
3021 } |
|
3022 else if(aKeyEvent.iScanCode == EStdKeySpace) // switch between last used Chinese input mode and English |
|
3023 { |
|
3024 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3025 // Predictive QWERTY (XT9) changes ----> |
|
3026 // Toggle the predictive mode with ctrl+space |
|
3027 if ( (iPermittedInputModes & EAknEditorTextInputMode) && |
|
3028 !(iAknEditorFlags & EAknEditorFlagNoT9) && |
|
3029 iMode == ELatin && |
|
3030 iLanguageCapabilities.iSupportsWesternQwertyPredictive ) |
|
3031 { |
|
3032 if (iWesternPredictive) |
|
3033 { |
|
3034 //ProcessCommandL(EAknCmdT9PredictiveT9Off); |
|
3035 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
3036 //HandleChangeInFocus(); |
|
3037 if (iMode != ELatin) |
|
3038 { |
|
3039 TryChangeModeL(ELatin); |
|
3040 } |
|
3041 else |
|
3042 { |
|
3043 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3044 RemoveSuggestedAdvanceCompletionL(); |
|
3045 #endif // RD_INTELLIGENT_TEXT_INPUT |
|
3046 CommitInlineEditL(); |
|
3047 } |
|
3048 SetCcpuFlag(ECcpuStataCommitPredictiveWord); |
|
3049 SetWesternPredictive(EFalse); |
|
3050 HandleChangeInFocus(); |
|
3051 } |
|
3052 else |
|
3053 { |
|
3054 //ProcessCommandL(EAknCmdMultitapPredictiveT9On); |
|
3055 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
3056 //HandleChangeInFocus(); |
|
3057 SetWesternPredictive(ETrue); |
|
3058 TryCloseUiL(); |
|
3059 TryChangeModeL(ELatin); |
|
3060 } |
|
3061 // Reset the function key state,if predictive mode is cahnged. |
|
3062 if (iFnKeyManager) |
|
3063 { |
|
3064 iFnKeyManager->ClearFnKeyState(); |
|
3065 } |
|
3066 } |
|
3067 else // Predictive QWERTY (XT9) changes <---- |
|
3068 { |
|
3069 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
3070 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
3071 if(iMode != iModeBefore && iMode != ENumber && iMode != ENativeNumber ) |
|
3072 { |
|
3073 TInt mode = iMode; |
|
3074 if(iMode != ELatin && iModeBefore != ELatin) // more than one Chinese input modes |
|
3075 { |
|
3076 TryChangeModeL(ELatin); |
|
3077 } |
|
3078 else |
|
3079 { |
|
3080 TryChangeToModeBeforeL(); |
|
3081 } |
|
3082 iModeBefore = mode; // deposit previous input mode |
|
3083 } |
|
3084 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3085 } |
|
3086 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
3087 } |
|
3088 #ifdef RD_INTELLIGENT_TEXT_INPUT //// Predictive QWERTY (XT9) changes: open the edit menu with Fn+space ----> |
|
3089 else if (aKeyEvent.iScanCode == EStdKeyLeftFunc) |
|
3090 { |
|
3091 LaunchSelectModeMenuL(); |
|
3092 } // Predictive QWERTY (XT9) changes <---- |
|
3093 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
3094 } |
|
3095 |
|
3096 if (IsCcpuFlagSet(ECcpuStatePosted)) |
|
3097 { |
|
3098 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3099 // Query ptiEngine to know if the scancode maps to EPtiKeyQwertyC, |
|
3100 // EPtiKeyQwertyV or EPtiKeyQwertyX. |
|
3101 // we should not always rely on scancode as products may change it, while |
|
3102 // still having the 'C', 'V' and 'X' mappings |
|
3103 |
|
3104 TBuf<32> mapData; |
|
3105 iPtiEngine->MappingDataForKey((TPtiKey)aKeyEvent.iScanCode, mapData, EPtiCaseUpper); |
|
3106 |
|
3107 if( mapData.Length() > 0 ) |
|
3108 { |
|
3109 if( mapData[0] == EPtiKeyQwertyC || mapData[0] == EPtiKeyQwertyX ) |
|
3110 { |
|
3111 // Let copy / cut events to flow through. |
|
3112 response = EKeyWasNotConsumed; |
|
3113 } |
|
3114 } |
|
3115 #else |
|
3116 if (aKeyEvent.iScanCode == EPtiKeyQwertyC || aKeyEvent.iScanCode == EPtiKeyQwertyX) |
|
3117 { |
|
3118 // Let copy / cut events to flow through. |
|
3119 response = EKeyWasNotConsumed; |
|
3120 } |
|
3121 #endif |
|
3122 ResetCcpuFlags(); |
|
3123 } |
|
3124 |
|
3125 |
|
3126 //Removed as part of the fix STAA-7FXCTK |
|
3127 |
|
3128 /* if (EPtiKeyboardQwerty4x10 == KeyboardLayout()) |
|
3129 { |
|
3130 FepUI()->HandleKeyL(EKeyLeftCtrl, EShortKeyPress); |
|
3131 }*/ |
|
3132 |
|
3133 |
|
3134 return response; |
|
3135 } |
|
3136 |
|
3137 TBool CAknFepManager::HandleQwertyKeyEventL(const TKeyEvent& aKeyEvent, TKeyResponse& aResponse) |
|
3138 { |
|
3139 TBool keyHandled = EFalse; |
|
3140 aResponse = EKeyWasNotConsumed; |
|
3141 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3142 if(iKeyBackSpaceHit && (EKeyBackspace != aKeyEvent.iCode || EStdKeyBackspace != aKeyEvent.iScanCode)) |
|
3143 iKeyBackSpaceHit = 0; |
|
3144 |
|
3145 if(IsMfneEditor()) |
|
3146 { |
|
3147 // multi-field editors need the key event to be sent to them directly |
|
3148 // therefore not consuming it here |
|
3149 return EFalse; |
|
3150 } |
|
3151 |
|
3152 if(IsFlagSet(EFlagShiftKeyDepressed)) |
|
3153 { |
|
3154 iKeyPressedDuringShift = ETrue; |
|
3155 } |
|
3156 // This part of code for error fixing |
|
3157 // After short pressing of Fn/shift, if user press enter key, delete key |
|
3158 // it will reset the shift key and Fn key state. |
|
3159 if( EKeyEnter == aKeyEvent.iCode || EStdKeyEnter == aKeyEvent.iScanCode|| |
|
3160 EKeyBackspace == aKeyEvent.iCode || EStdKeyBackspace == aKeyEvent.iScanCode) |
|
3161 { |
|
3162 // if the shift key is still depressed, |
|
3163 // don't clear the qwerty shift mode |
|
3164 if(!IsFlagSet(EFlagShiftKeyDepressed)) |
|
3165 ClearFlag(EFlagQwertyShiftMode); |
|
3166 if( iFnKeyManager->FnKeyState() == CAknFepFnKeyManager::EFnKeyNext ) |
|
3167 { |
|
3168 iFnKeyManager->ClearFnKeyState(); |
|
3169 } |
|
3170 } |
|
3171 #endif |
|
3172 |
|
3173 if ( iQwertyInputMode && |
|
3174 ( EditorHasFreeSpace() || |
|
3175 #ifdef __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__ |
|
3176 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3177 KeyEventWillReplaceCharacter( aKeyEvent ) || |
|
3178 #endif // RD_INTELLIGENT_TEXT_INPUT |
|
3179 #endif // __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__ |
|
3180 ( Japanese() && iFepManState == EAknFepStateUIActive ) ) ) |
|
3181 { |
|
3182 if (IsFlagSet(EFlagPassNextKey)) |
|
3183 { |
|
3184 #ifdef __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__ |
|
3185 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3186 // Don't clear the pass next flag yet on the simulated "rollback key" |
|
3187 // used with secret editors, the actual key code to be entered to the |
|
3188 // editor will follow next. |
|
3189 if ( aKeyEvent.iCode != EKeyF20 ) |
|
3190 #endif // RD_INTELLIGENT_TEXT_INPUT |
|
3191 #endif // __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__ |
|
3192 ClearFlag(EFlagPassNextKey); |
|
3193 return ETrue; |
|
3194 } |
|
3195 |
|
3196 TInt keyScanCode = aKeyEvent.iScanCode; |
|
3197 #if defined(__WINS__) |
|
3198 if ( keyScanCode == EStdKeyNkpPlus ) |
|
3199 { |
|
3200 // Workaround solution for the qwerty '+' key in emulator environment. |
|
3201 // I did not find a way how to to configure epoc_352x416_Qwerty.ini to send '+' keyevent. |
|
3202 keyScanCode = 0x2b; // '+' key. |
|
3203 } |
|
3204 #endif |
|
3205 TBool phoneIdle = (EditorType() == CAknExtendedInputCapabilities::EPhoneNumberEditor); |
|
3206 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3207 TInt keyLayout =iSharedDataInterface->KeyboardLayout(); |
|
3208 if (IsOnlyNumericPermitted() && phoneIdle && |
|
3209 #ifdef __REVERSE_FN_KEY_SUPPORTED |
|
3210 !iIsReverseFnkeyInput && |
|
3211 #endif |
|
3212 (keyLayout != EPtiKeyboardHalfQwerty )) |
|
3213 #else |
|
3214 if (IsOnlyNumericPermitted() && phoneIdle) |
|
3215 #endif |
|
3216 { |
|
3217 return ETrue; |
|
3218 } |
|
3219 //if this SpecialNumeric editor, do not consume event. |
|
3220 if (IsOnlyNumericPermitted() && IsSpecialNumericEditor()) |
|
3221 { |
|
3222 return EFalse; |
|
3223 } |
|
3224 |
|
3225 |
|
3226 #ifdef FF_HOME_SCREEN_EASY_DIALING |
|
3227 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3228 |
|
3229 // This piece of code part of error fixing |
|
3230 // The Fep will insert the char, if Phone application launch the |
|
3231 // Phone number acquire editor in idle mode |
|
3232 // Specially Fep does not maintain Fn key state for non Fepware editor. |
|
3233 // So, Intermediate state of FnKey like FnNext will not work |
|
3234 // Hold on Fn key modify the modifier of of key event. |
|
3235 const TBool fnDown = (aKeyEvent.iModifiers & EModifierRightFunc); |
|
3236 if( phoneIdle && fnDown && iFnKeyManager ) |
|
3237 { |
|
3238 iFnKeyManager->SetFnKeyState(CAknFepFnKeyManager::EFnKeyDown); |
|
3239 SetCase((TCase)EFnKeyLowerCase); |
|
3240 } |
|
3241 #endif // RD_INTELLIGENT_TEXT_INPUT |
|
3242 #endif // FF_HOME_SCREEN_EASY_DIALING |
|
3243 |
|
3244 |
|
3245 const TBool shifted = (aKeyEvent.iModifiers & (EModifierLeftShift | |
|
3246 EModifierRightShift | EModifierShift)); |
|
3247 |
|
3248 // This is needed for forcing shif state if this is the first key press in |
|
3249 // phone idle. |
|
3250 if (shifted && phoneIdle) |
|
3251 { |
|
3252 SetFlag(EFlagQwertyShiftMode); |
|
3253 } |
|
3254 |
|
3255 |
|
3256 if (aKeyEvent.iRepeats == 1) |
|
3257 { |
|
3258 iKeyRepeat = ELongKeyPress; |
|
3259 } |
|
3260 else |
|
3261 { |
|
3262 iKeyRepeat = EShortKeyPress; |
|
3263 } |
|
3264 |
|
3265 if ( IsFlagSet(EFlagShiftKeyDepressed) && |
|
3266 IsChineseInputLanguage() && |
|
3267 keyScanCode == EPtiKeyQwertySpace) |
|
3268 { |
|
3269 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
3270 ClearFlag(EFlagQwertyShiftMode); |
|
3271 ClearFlag(EFlagLongShiftKeyPress); |
|
3272 SetChangeModeByShiftAndSpace( ETrue ); |
|
3273 TryIncrementChineseModeForQwertyL(iMode); |
|
3274 keyHandled = ETrue; |
|
3275 } |
|
3276 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3277 else |
|
3278 { |
|
3279 if(iKeyRepeat == ELongKeyPress && iPtiEngine->CurrentWord().Length() == EMaximumFepWordLength) |
|
3280 { |
|
3281 keyHandled = ETrue; |
|
3282 } |
|
3283 else |
|
3284 { |
|
3285 keyHandled = FepUI()->HandleKeyL(keyScanCode, iKeyRepeat); |
|
3286 if( EPtiKeyboardHalfQwerty == KeyboardLayout() |
|
3287 && iWesternPredictive |
|
3288 && iCaseMan->CurrentCase() != EAknEditorUpperCase ) |
|
3289 { |
|
3290 ClearFlag(CAknFepManager::EFlagChangeInputMode); |
|
3291 } |
|
3292 if ( keyHandled && iFepManState == EAknFepStateUIActive |
|
3293 && (iMode == EPinyin || iMode == EZhuyin || iMode == EStroke || iMode == ECangJie) ) |
|
3294 { |
|
3295 if ( EditorState() ) |
|
3296 { |
|
3297 EditorState()->SetFlags( EditorState()->Flags() | EAknEditorFlagChinesePopup ); |
|
3298 } |
|
3299 } |
|
3300 } |
|
3301 } |
|
3302 #else |
|
3303 if (IsChineseInputLanguage() && keyScanCode == EStdKeyBackspace) |
|
3304 { |
|
3305 keyHandled = FepUI()->HandleKeyL(keyScanCode, iKeyRepeat); |
|
3306 } |
|
3307 else |
|
3308 { |
|
3309 keyHandled = FepUI()->HandleKeyL(keyScanCode, EShortKeyPress); |
|
3310 } |
|
3311 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
3312 |
|
3313 if (keyHandled) |
|
3314 { |
|
3315 aResponse = EKeyWasConsumed; |
|
3316 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3317 // Predictive QWERTY changes ----> |
|
3318 ShowExactWordPopupIfNecessaryL(); |
|
3319 // Predictive QWERTY changes <---- |
|
3320 } |
|
3321 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
3322 |
|
3323 // The indicators should be updated only if the key was handled. Otherwise |
|
3324 // the shift-copy-pasting will mess up the indicators. |
|
3325 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3326 TInt language = iSharedDataInterface->InputTextLanguage(); |
|
3327 TBool IsChineseInput = language == ELangTaiwanChinese|| |
|
3328 language == ELangHongKongChinese || |
|
3329 language == ELangPrcChinese; |
|
3330 #endif |
|
3331 if ( !shifted ) |
|
3332 { |
|
3333 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3334 if(IsChineseInput && (iKeyboardType!= EPtiKeyboardHalfQwerty)) |
|
3335 { |
|
3336 ClearFlag(EFlagQwertyShiftMode); |
|
3337 UpdateIndicators(); |
|
3338 } |
|
3339 else if( keyHandled ) |
|
3340 { |
|
3341 #endif |
|
3342 ClearFlag(EFlagQwertyShiftMode); |
|
3343 UpdateIndicators(); |
|
3344 |
|
3345 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3346 } |
|
3347 #endif |
|
3348 } |
|
3349 |
|
3350 #ifdef RD_SCALABLE_UI_V2 |
|
3351 if ( ( (keyScanCode >= EPtiKeyQwertyA && keyScanCode <= EPtiKeyQwertyZ) || |
|
3352 (keyScanCode >= EPtiKeyQwerty0 && keyScanCode <= EPtiKeyQwerty9) || |
|
3353 (keyScanCode == EStdKeyEnter) || |
|
3354 (keyScanCode == EPtiKeyQwertyPlus) || |
|
3355 (keyScanCode == EPtiKeyQwertyMinus) || |
|
3356 (keyScanCode == EPtiKeyQwertyComma) || |
|
3357 (keyScanCode == EPtiKeyQwertySemicolon) || |
|
3358 (keyScanCode == EPtiKeyQwertyFullstop) || |
|
3359 (keyScanCode == EPtiKeyQwertyHash) || |
|
3360 (keyScanCode == EPtiKeyQwertySlash) || |
|
3361 (keyScanCode == EPtiKeyQwertyApostrophe) ) |
|
3362 && !( iFepPluginManager && iFepPluginManager->EnableITIOnFSQ() ) ) |
|
3363 { |
|
3364 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
3365 //iFepPluginManager->ClosePluginInputModeL(ETrue); |
|
3366 } |
|
3367 else if( keyHandled ) |
|
3368 { |
|
3369 //for QWERTY, number only, the number is send to editor |
|
3370 //bypass FEP |
|
3371 SendEventsToPluginManL( EPluginSyncFepAwareText ); |
|
3372 //iFepPluginManager->SyncFepAwareText(); |
|
3373 } |
|
3374 #endif |
|
3375 } |
|
3376 |
|
3377 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3378 |
|
3379 TInt lang = iSharedDataInterface->InputTextLanguage(); |
|
3380 |
|
3381 if(lang == ELangTaiwanChinese|| |
|
3382 lang == ELangHongKongChinese || |
|
3383 lang == ELangPrcChinese) |
|
3384 { |
|
3385 if( iPtiEngine->CurrentLanguage()->LanguageCode()== ELangEnglish |
|
3386 && IsFlagSet(EFlagQwertyShiftMode) |
|
3387 && !IsFlagSet(EFlagLongShiftKeyPress)) |
|
3388 { |
|
3389 ClearFlag(EFlagQwertyShiftMode); |
|
3390 UpdateIndicators(); |
|
3391 } |
|
3392 } |
|
3393 #endif // RD_INTELLIGENT_TEXT_INPUT |
|
3394 iKeyRepeat = EShortKeyPress; |
|
3395 return keyHandled; |
|
3396 } |
|
3397 |
|
3398 |
|
3399 |
|
3400 void CAknFepManager::CancelTransaction() |
|
3401 { |
|
3402 if (iInputCapabilities.FepAwareTextEditor() && IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
3403 { |
|
3404 CancelInlineEdit(); |
|
3405 } |
|
3406 } |
|
3407 |
|
3408 void CAknFepManager::IsOnHasChangedState() |
|
3409 { |
|
3410 } |
|
3411 |
|
3412 void CAknFepManager::OfferKeyEventL(TEventResponse& /*aEventResponse*/, |
|
3413 const TKeyEvent& /*aKeyEvent*/, |
|
3414 TEventCode /*aEventCode*/) |
|
3415 { |
|
3416 } |
|
3417 |
|
3418 void CAknFepManager::OfferPointerEventL(TEventResponse& /*aEventResponse*/, |
|
3419 const TPointerEvent& /*aPointerEvent*/, |
|
3420 const CCoeControl* /*aWindowOwningControl*/) |
|
3421 { |
|
3422 } |
|
3423 |
|
3424 void CAknFepManager::OfferPointerBufferReadyEventL(TEventResponse& /*aEventResponse*/, |
|
3425 const CCoeControl* /*aWindowOwningControl*/) |
|
3426 { |
|
3427 } |
|
3428 |
|
3429 TInt CAknFepManager::NumberOfAttributes() const |
|
3430 { |
|
3431 return 0; |
|
3432 } |
|
3433 |
|
3434 TUid CAknFepManager::AttributeAtIndex(TInt /*aIndex*/) const |
|
3435 { |
|
3436 return KNullUid; |
|
3437 } |
|
3438 |
|
3439 void CAknFepManager::WriteAttributeDataToStreamL(TUid /*aAttributeUid*/, RWriteStream& /*aStream*/) const |
|
3440 { |
|
3441 } |
|
3442 |
|
3443 void CAknFepManager::ReadAttributeDataFromStreamL(TUid /*aAttributeUid*/, RReadStream& /*aStream*/) |
|
3444 { |
|
3445 } |
|
3446 |
|
3447 void CAknFepManager::HandleGainingForeground() |
|
3448 { |
|
3449 if (iFepFullyConstructed) |
|
3450 { |
|
3451 ClearFlag(EFlagRemoveMatchesMenuItem); |
|
3452 ClearCcpuFlag(ECcpuStateHashDown | ECcpuStateSelectionEventPosted | |
|
3453 ECcpuStateEdwinInSelectionMode); |
|
3454 TRAPD(err, iPtiEngine->HandleCommandL(EPtiCommandReloadLearningInfo)); |
|
3455 if (err != KErrNone) |
|
3456 { |
|
3457 CleanUpFep(); |
|
3458 } |
|
3459 } |
|
3460 |
|
3461 #ifdef RD_SCALABLE_UI_V2 |
|
3462 CCoeControl* focusCtrl = static_cast<const CCoeAppUi*>(CCoeEnv::Static()->AppUi())->TopFocusedControl(); |
|
3463 iGainForeground = ETrue; |
|
3464 /*if( iLoseForeAndGainFocus ) |
|
3465 { |
|
3466 SendEventsToPluginManL( EPluginFocusChanged, iGainForeground ); |
|
3467 }*/ |
|
3468 if(focusCtrl && focusCtrl->IsFocused()) |
|
3469 { |
|
3470 if(GetForegroundTaskAppWgId() == CCoeEnv::Static()->RootWin().Identifier()) |
|
3471 //SendEventsToPluginManL( EPluginFocusChanged, iGainForeground ); |
|
3472 TRAP_IGNORE(SendEventsToPluginManL( EPluginForegroundChanged, ETrue)); |
|
3473 } |
|
3474 else |
|
3475 { |
|
3476 if (iFepPluginManager) |
|
3477 { |
|
3478 iFepPluginManager->HandleiDimGainForeground(ETrue); |
|
3479 } |
|
3480 } |
|
3481 #endif // RD_SCALABLE_UI_V2 |
|
3482 } |
|
3483 |
|
3484 void CAknFepManager::HandleLosingForeground() |
|
3485 { |
|
3486 if (iFepFullyConstructed) |
|
3487 { |
|
3488 // Forget the shift state on FEP switch (i.e. when application goes to background) |
|
3489 ClearFlag(EFlagQwertyShiftMode | EFlagShiftKeyDepressed | |
|
3490 EFlagLongShiftKeyPress | EFlagNoActionDuringShiftKeyPress); |
|
3491 } |
|
3492 if (Japanese()) |
|
3493 { |
|
3494 TRAP_IGNORE(TryCloseUiL()); |
|
3495 } |
|
3496 if (IsChineseInputLanguage()) |
|
3497 { |
|
3498 TRAP_IGNORE(TryCloseUiL()); |
|
3499 } |
|
3500 |
|
3501 #ifdef RD_SCALABLE_UI_V2 |
|
3502 iGainForeground = EFalse; |
|
3503 //SendEventsToPluginManL( EPluginFocusChanged, iGainForeground ); |
|
3504 TRAP_IGNORE(SendEventsToPluginManL( EPluginForegroundChanged, EFalse)); |
|
3505 #endif // RD_SCALABLE_UI_V2 |
|
3506 } |
|
3507 |
|
3508 void CAknFepManager::HandleChangeInFocus() |
|
3509 { |
|
3510 TRAPD(err, HandleChangeInFocusL()); |
|
3511 if (err != KErrNone) |
|
3512 { |
|
3513 CleanUpFep(); |
|
3514 } |
|
3515 } |
|
3516 |
|
3517 void CAknFepManager::HandleDestructionOfFocusedItem() |
|
3518 { |
|
3519 if (iInputCapabilities.FepAwareTextEditor()) |
|
3520 { |
|
3521 iFocusedItemDestroy = ETrue; |
|
3522 if ( iFepManState == EAknFepStateUIActive ) |
|
3523 { |
|
3524 TRAP_IGNORE(SendEventsToPluginManL( EPluginFocusItemDestroy )); |
|
3525 if (Japanese() && iAknEditorFlags & EAknEditorFlagFindPane) |
|
3526 { |
|
3527 // In case of Find pane while inputting japanese characters, |
|
3528 // No update or commit characters. |
|
3529 iPtiEngine->ClearCurrentWord(); |
|
3530 } |
|
3531 |
|
3532 #ifdef RD_SCALABLE_UI_V2 |
|
3533 // For addition of ITI features on FSQ, |
|
3534 // need to restore some values stored before opening FSQ |
|
3535 // When go into this section, |
|
3536 // touch ui won't be closed by ClosePluginInputUiL, |
|
3537 // but need to restore fep state here |
|
3538 if ( iFepPluginManager ) |
|
3539 { |
|
3540 iFepPluginManager->ResetItiStateL(); |
|
3541 } |
|
3542 #endif |
|
3543 // Close UI |
|
3544 FepUI()->CloseUI(); |
|
3545 } |
|
3546 else |
|
3547 { |
|
3548 TRAP_IGNORE(SendEventsToPluginManL( EPluginFocusItemDestroy, ETrue )); |
|
3549 } |
|
3550 iFocusedItemDestroy = EFalse; |
|
3551 } |
|
3552 |
|
3553 if ( !(IsFlagSet(EFlagForegroundUIComponentVisible) || |
|
3554 IsFlagSet(EFlagMenuPaneVisible)) ) |
|
3555 { |
|
3556 iLanguageCapabilities.iNumericEditorDigitType = EDigitTypeUnknown; |
|
3557 //UpdateLocalDigitMode(); |
|
3558 } |
|
3559 if(IsFlagSet(EFlagForegroundUIComponentVisible)) |
|
3560 { |
|
3561 ClearFlag(EFlagForegroundUIComponentVisible); |
|
3562 } |
|
3563 |
|
3564 ClearFlag( EFlagInsideInlineEditingTransaction | |
|
3565 EFlagInsideMultitapInlineEditingTransaction | |
|
3566 EFlagLineFeedCharacter | EFlagNoMatches ); |
|
3567 |
|
3568 iInputCapabilities = NULL; |
|
3569 } |
|
3570 |
|
3571 void CAknFepManager::HandleAknEdwinStateEventL(CAknEdwinState* aAknEdwinState, |
|
3572 EAknEdwinStateEvent aEventType) |
|
3573 { |
|
3574 if(aEventType == EAknEdwinDestroy) |
|
3575 { |
|
3576 // Reset the last focus editor when destroy it. |
|
3577 if ( aAknEdwinState == iLastFocusedEditor ) |
|
3578 { |
|
3579 iLastFocusedEditor->SetObserver( NULL ); |
|
3580 iLastFocusedEditor = NULL; |
|
3581 } |
|
3582 |
|
3583 // Whenever the editor is destroyed, we destroy all the UI components we launched |
|
3584 if(iFepAwareDialogParentEditor == NULL || |
|
3585 iFepAwareDialogParentEditor == aAknEdwinState) |
|
3586 { |
|
3587 // EExtendedFlagEdwinEditorDestroyed flag is used to leave once the dialog is closed. |
|
3588 SetExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
3589 // Delete any candidate popup is launched |
|
3590 if(iCandidatePopup) |
|
3591 { |
|
3592 delete iCandidatePopup; |
|
3593 iCandidatePopup = NULL; |
|
3594 } |
|
3595 // Delete anu UI components launched by Fep. |
|
3596 iUiInterface->DeleteDialogs(); |
|
3597 } |
|
3598 } |
|
3599 if ( IsFepAwareTextEditor() ) |
|
3600 { |
|
3601 CAknEdwinState* editorState = EditorState(); |
|
3602 if ( editorState != aAknEdwinState || !iFepFullyConstructed ) |
|
3603 { |
|
3604 // FEP state update is not needed because editor state of non-focused |
|
3605 // editor was changed. |
|
3606 return; |
|
3607 } |
|
3608 |
|
3609 switch (aEventType) |
|
3610 { |
|
3611 case EAknEdwinStateInputModeUpdate: |
|
3612 { |
|
3613 TUint currentInputMode = editorState->CurrentInputMode(); |
|
3614 if ( EditorModeFromFepMode(iMode) != currentInputMode ) |
|
3615 { |
|
3616 if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
3617 { |
|
3618 TryRemoveNoMatchesIndicatorL(); |
|
3619 } |
|
3620 UpdateCbaL(NULL); |
|
3621 TryCloseUiL(); |
|
3622 ConfigureFEPFromEditorStateL(); |
|
3623 } |
|
3624 } |
|
3625 break; |
|
3626 case EAknEdwinStateCaseModeUpdate: |
|
3627 { |
|
3628 TInt currentCaseMode = editorState->CurrentCase(); |
|
3629 if ( currentCaseMode != iCaseMan->CurrentCase() ) |
|
3630 { |
|
3631 iCaseMan->SetCurrentCase(currentCaseMode); |
|
3632 } |
|
3633 } |
|
3634 break; |
|
3635 case EAknEdwinStateLocalLanguageUpdate: |
|
3636 { |
|
3637 TLanguage localLanguage = ELangTest; |
|
3638 if (GetLocalLanguage( localLanguage ) ) |
|
3639 { |
|
3640 iLanguageCapabilities.iLocalInputLanguageInUse = ETrue; |
|
3641 if ( localLanguage != iLanguageCapabilities.iInputLanguageCode ) |
|
3642 { |
|
3643 ChangeInputLanguageL(localLanguage); |
|
3644 } |
|
3645 } |
|
3646 } |
|
3647 break; |
|
3648 case EAknEdwinStateFlagsUpdate: |
|
3649 { |
|
3650 TInt oldEditorFlags = iAknEditorFlags; |
|
3651 if(iAknEditorFlags != editorState->Flags()) |
|
3652 { |
|
3653 iAknEditorFlags = editorState->Flags(); |
|
3654 UpdateLocalDigitMode(); |
|
3655 } |
|
3656 if ( iAknEditorFlags != oldEditorFlags ) |
|
3657 { |
|
3658 if ( (iAknEditorFlags & EAknEditorFlagNoT9) != |
|
3659 (oldEditorFlags & EAknEditorFlagNoT9)) |
|
3660 { |
|
3661 if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
3662 { |
|
3663 TryRemoveNoMatchesIndicatorL(); |
|
3664 } |
|
3665 UpdateCbaL(NULL); |
|
3666 TryCloseUiL(); |
|
3667 ConfigureFEPFromEditorStateL(); |
|
3668 } |
|
3669 |
|
3670 if ( (iAknEditorFlags & EAknEditorFlagNoEditIndicators) != |
|
3671 (oldEditorFlags & EAknEditorFlagNoEditIndicators)) |
|
3672 { |
|
3673 // We only need to update indicators when EAknEditorFlagNoEditIndicators was modified. |
|
3674 // Current Fep state is not lost. |
|
3675 UpdateIndicators(); |
|
3676 } |
|
3677 |
|
3678 if ( (iAknEditorFlags & EAknEditorFlagFixedCase) != |
|
3679 (oldEditorFlags & EAknEditorFlagFixedCase)) |
|
3680 { |
|
3681 // We only need to update EFlagSupressAutoUpdate flag when the |
|
3682 // EAknEditorFlagFixedCase was modified. |
|
3683 // Current Fep state is not lost. |
|
3684 if (iAknEditorFlags & EAknEditorFlagFixedCase) |
|
3685 { |
|
3686 SetFlag(EFlagSupressAutoUpdate); |
|
3687 } |
|
3688 else |
|
3689 { |
|
3690 ClearFlag(EFlagSupressAutoUpdate); |
|
3691 } |
|
3692 } |
|
3693 } |
|
3694 } |
|
3695 break; |
|
3696 case EAknEdwinStateEventStateUpdate: |
|
3697 { |
|
3698 // Feps state is reseted and new state is fetched completelly from editor state. |
|
3699 if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
3700 { |
|
3701 TryRemoveNoMatchesIndicatorL(); |
|
3702 } |
|
3703 UpdateCbaL(NULL); |
|
3704 TryCloseUiL(); |
|
3705 ConfigureFEPFromEditorStateL(); |
|
3706 } |
|
3707 break; |
|
3708 case EAknSyncEdwinState: |
|
3709 #ifdef RD_SCALABLE_UI_V2 |
|
3710 if ( !IsCcpuFlagSet(ECcpuStateIgnoreNextEdwinSyncEvent) && iFepPluginManager && |
|
3711 iFepPluginManager->PluginInputMode() == EPluginInputModeNone ) |
|
3712 #else |
|
3713 if ( !IsCcpuFlagSet(ECcpuStateIgnoreNextEdwinSyncEvent) ) |
|
3714 #endif |
|
3715 { |
|
3716 HandleChangeInFocusL(); |
|
3717 } |
|
3718 else |
|
3719 { |
|
3720 ClearCcpuFlag(ECcpuStateIgnoreNextEdwinSyncEvent); |
|
3721 } |
|
3722 break; |
|
3723 |
|
3724 #ifdef RD_SCALABLE_UI_V2 |
|
3725 case EAknActivatePenInputRequest: |
|
3726 SendEventsToPluginManL( EPluginEditorActivate ); |
|
3727 break; |
|
3728 case EAknClosePenInputRequest: |
|
3729 if ( iFepPluginManager ) |
|
3730 { |
|
3731 iFepPluginManager->ClosePluginInputModeL( EFalse ); |
|
3732 } |
|
3733 break; |
|
3734 case EAknEdwinStatePromptUpdate: |
|
3735 SendEventsToPluginManL( EPluginPromptChanged ); |
|
3736 break; |
|
3737 #endif // RD_SCALABLE_UI_V2 |
|
3738 case EAknCursorPositionChanged: |
|
3739 #ifdef RD_SCALABLE_UI_V2 |
|
3740 SendEventsToPluginManL( EPluginSyncFepAwareText ); |
|
3741 HandleCopyCutStateL(); |
|
3742 #endif |
|
3743 // whenever focus cahnged happen, internally |
|
3744 // editor treat cursorposition change. |
|
3745 // In between, if editor context not in inline edit state. |
|
3746 // Try to update the case editor gets the focus, and editor |
|
3747 // context come in inline state. |
|
3748 //iCaseMan->UpdateCase(ENullNaviEvent); |
|
3749 break; |
|
3750 |
|
3751 default: |
|
3752 break; |
|
3753 } |
|
3754 } |
|
3755 } |
|
3756 |
|
3757 |
|
3758 CAknExtendedInputCapabilities::TEditorType CAknFepManager::EditorType() const |
|
3759 { |
|
3760 MObjectProvider* mop = iInputCapabilities.ObjectProvider(); |
|
3761 |
|
3762 if ( mop ) |
|
3763 { |
|
3764 CAknExtendedInputCapabilities* extendedInputCapabilities = |
|
3765 mop->MopGetObject( extendedInputCapabilities ); |
|
3766 |
|
3767 if ( extendedInputCapabilities && iInputCapabilities.FepAwareTextEditor() ) |
|
3768 { |
|
3769 TInt type = extendedInputCapabilities->EditorType(); |
|
3770 return static_cast<CAknExtendedInputCapabilities::TEditorType>( type ); |
|
3771 } |
|
3772 } |
|
3773 |
|
3774 return CAknExtendedInputCapabilities::EUndefined; |
|
3775 } |
|
3776 |
|
3777 TUint CAknFepManager::MIDPConstraint() const |
|
3778 { |
|
3779 TUint ConstraintValue=0xFFFFFFFF; |
|
3780 MObjectProvider* mop = iInputCapabilities.ObjectProvider(); |
|
3781 |
|
3782 if ( mop ) |
|
3783 { |
|
3784 CAknExtendedInputCapabilities* extendedInputCapabilities = |
|
3785 mop->MopGetObject( extendedInputCapabilities ); |
|
3786 if ( extendedInputCapabilities && iInputCapabilities.FepAwareTextEditor() ) |
|
3787 { |
|
3788 ConstraintValue = extendedInputCapabilities->MIDPConstrainst(); |
|
3789 } |
|
3790 } |
|
3791 return ConstraintValue; |
|
3792 } |
|
3793 |
|
3794 TBool CAknFepManager::IsSpecialNumericEditor() |
|
3795 { |
|
3796 TBool JavaNumericEditor = EFalse; |
|
3797 TUint ConstraintValue = MIDPConstraint(); |
|
3798 if((ConstraintValue & ESplConstraintMask) == ESplNumeric || |
|
3799 (ConstraintValue & ESplConstraintMask) == ESplDecimal) |
|
3800 JavaNumericEditor = ETrue; |
|
3801 |
|
3802 return JavaNumericEditor; |
|
3803 |
|
3804 } |
|
3805 #ifdef RD_SCALABLE_UI_V2 |
|
3806 void CAknFepManager::HandleInputCapabilitiesEventL( TInt aEvent, TAny* /*aParams*/ ) |
|
3807 { |
|
3808 switch (aEvent) |
|
3809 { |
|
3810 case CAknExtendedInputCapabilities::MAknEventObserver::EActivatePenInputRequest: |
|
3811 SendEventsToPluginManL( EPluginEditorActivate ); |
|
3812 break; |
|
3813 case CAknExtendedInputCapabilities::MAknEventObserver::EPointerEventReceived: |
|
3814 |
|
3815 /* |
|
3816 #ifdef RD_TACTILE_FEEDBACK |
|
3817 CAknExtendedInputCapabilities:: |
|
3818 MAknEventObserver::TPointerEventReceivedParams* params = |
|
3819 static_cast<CAknExtendedInputCapabilities:: |
|
3820 MAknEventObserver::TPointerEventReceivedParams*>(aParams); |
|
3821 if (params->iPointerEvent.iType == TPointerEvent::EButton1Down) |
|
3822 { |
|
3823 |
|
3824 MTouchFeedback* feedback = MTouchFeedback::Instance(); |
|
3825 if (feedback && iFepPluginManager && !iFepPluginManager->VKBIsOpened()) |
|
3826 { |
|
3827 feedback->InstantFeedback( ETouchFeedbackBasic ); |
|
3828 } |
|
3829 } |
|
3830 #endif // RD_TACTILE_FEEDBACK |
|
3831 */ |
|
3832 if( IsFlagSet( EFlagInsideInlineEditingTransaction ) ) |
|
3833 { |
|
3834 if (IsFeatureSupportedJapanese()) |
|
3835 { |
|
3836 TryCloseUiL(); |
|
3837 } |
|
3838 else |
|
3839 { |
|
3840 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3841 iPtiEngine->CommitCurrentWord(); |
|
3842 CommitInlineEditL(); |
|
3843 TryCloseUiL(); |
|
3844 |
|
3845 #else |
|
3846 CommitInlineEditL(); |
|
3847 #endif |
|
3848 } |
|
3849 } |
|
3850 break; |
|
3851 case CAknExtendedInputCapabilities::MAknEventObserver::EControlContentUpdatedInternally: |
|
3852 SendEventsToPluginManL( EPluginSyncFepAwareText, EPluginSyncAll ); |
|
3853 break; |
|
3854 case CAknExtendedInputCapabilities::MAknEventObserver::EOpenStylusMenuCcpu: |
|
3855 // User has highlighted text and editor requests stylus ccpu popup menu |
|
3856 // to be displayed. |
|
3857 LaunchStylusCcpuMenuL(iClickPoint); |
|
3858 break; |
|
3859 } |
|
3860 } |
|
3861 |
|
3862 void CAknFepManager::SubmitInlineTextL( const TDesC& aData ) |
|
3863 { |
|
3864 if(TextIsValidInEditor(aData)) |
|
3865 { |
|
3866 StartInlineEditL(aData); |
|
3867 CommitInlineEditL(); |
|
3868 } |
|
3869 } |
|
3870 |
|
3871 // for japanese |
|
3872 void CAknFepManager::NotifyJapaneseSetting() |
|
3873 { |
|
3874 TInt param = 0; |
|
3875 // Deleting direction ON(right side) / OFF(left side) |
|
3876 if (iSharedDataInterface->ClearDirection() == EClearDirectionRight) |
|
3877 { |
|
3878 param |= EPenInputJapaneseSettingDeletingDirection; |
|
3879 } |
|
3880 // Japanese predictive ON(predictive on) / OFF(predictive off) |
|
3881 if (iJapanesePredictive) |
|
3882 { |
|
3883 param |= EPenInputJapaneseSettingPredictive; |
|
3884 } |
|
3885 // Japanese HWR conversion ON / OFF |
|
3886 if (iSharedDataInterface->JapaneseHwrConversion() == EJapaneseConversionOn) |
|
3887 { |
|
3888 param |= EPenInputJapaneseSettingConversion; |
|
3889 } |
|
3890 // Japanese HWR conversion ON / OFF |
|
3891 if (iCharWidth == EFullWidthChar) |
|
3892 { |
|
3893 param |= EPenInputJapaneseSettingCharacterWidth; |
|
3894 } |
|
3895 // Japanese qwerty setting flag |
|
3896 TInt qwertflag = iSharedDataInterface->JapaneseQwertyFlags(); |
|
3897 // Qwerty Comma |
|
3898 if (qwertflag & EJapQwertySettingComma) |
|
3899 { |
|
3900 param |= EPenInputJapaneseSettingQwertyComma; |
|
3901 } |
|
3902 // Qwerty Period |
|
3903 if (qwertflag & EJapQwertySettingPeriod) |
|
3904 { |
|
3905 param |= EPenInputJapaneseSettingQwertyPeriod; |
|
3906 } |
|
3907 // Qwerty Width Of Space |
|
3908 if (qwertflag & EJapQwertySettingSpaceFullWidth) |
|
3909 { |
|
3910 param |= EPenInputJapaneseSettingQwertyWidthOfSpace; |
|
3911 } |
|
3912 // Lunch SCT |
|
3913 if (IsAbleToLaunchSCT()) |
|
3914 { |
|
3915 param |= EPenInputJapaneseSettingLunchSCT; |
|
3916 } |
|
3917 #ifdef RD_SCALABLE_UI_V2 |
|
3918 // Set Japanese setting |
|
3919 if(iFepPluginManager->CurrentPluginInputFepUI()) |
|
3920 { |
|
3921 TRAP_IGNORE(iFepPluginManager->CurrentPluginInputFepUI()->HandleCommandL( |
|
3922 ECmdPenInputJapaneseSetting, param)); |
|
3923 } |
|
3924 #endif //RD_SCALABLE_UI_V2 |
|
3925 } |
|
3926 |
|
3927 TBool CAknFepManager::FullyFepAwareTextEditor() const |
|
3928 { |
|
3929 if ( iInputCapabilities.FepAwareTextEditor() ) |
|
3930 { |
|
3931 if ( EditorType() != CAknExtendedInputCapabilities::EMFNEBased ) |
|
3932 { |
|
3933 return ETrue; |
|
3934 } |
|
3935 } |
|
3936 |
|
3937 return EFalse; |
|
3938 } |
|
3939 |
|
3940 TBool CAknFepManager::SemiFepAwareTextEditor( TBool aAtLeast ) const |
|
3941 { |
|
3942 if ( aAtLeast ) |
|
3943 { |
|
3944 switch ( EditorType() ) |
|
3945 { |
|
3946 case CAknExtendedInputCapabilities::EEdwinBased: |
|
3947 case CAknExtendedInputCapabilities::EMFNEBased: |
|
3948 return ETrue; |
|
3949 |
|
3950 default: |
|
3951 return EFalse; |
|
3952 } |
|
3953 } |
|
3954 else |
|
3955 { |
|
3956 return EditorType() == CAknExtendedInputCapabilities::EMFNEBased; |
|
3957 } |
|
3958 } |
|
3959 |
|
3960 void CAknFepManager::ProcessEditorMenuCommand(TInt aCommand) |
|
3961 { |
|
3962 TRAP_IGNORE(ProcessCommandL(aCommand)); |
|
3963 } |
|
3964 |
|
3965 TInt CAknFepManager::GetPermittedEditorMenu(TBool aOnlyCount) |
|
3966 { |
|
3967 TInt count = 0; |
|
3968 TRAP_IGNORE(count = GetPermittedEditorMenuL(aOnlyCount)); |
|
3969 return count; |
|
3970 } |
|
3971 |
|
3972 TInt CAknFepManager::GetPermittedEditorMenuL(TBool aOnlyCount) |
|
3973 { |
|
3974 |
|
3975 CAknEdwinState* editorState = NULL; |
|
3976 if (iInputCapabilities.FepAwareTextEditor()) |
|
3977 { |
|
3978 editorState = EditorState(); |
|
3979 } |
|
3980 |
|
3981 CAknFepUiInterfaceMenuBar* menuBar = NULL; |
|
3982 |
|
3983 RPointerArray<CEikMenuPaneItem> editorMenuItemList; |
|
3984 |
|
3985 CEikMenuPane* editorMenuPane = new (ELeave) CEikMenuPane((MEikMenuObserver*)(this)); |
|
3986 editorMenuPane->SetItemArrayOwnedExternally(EFalse); |
|
3987 TResourceReader reader; |
|
3988 CCoeEnv::Static()->CreateResourceReaderLC(reader, R_AVKON_TOUCH_INDICATOR_EDIT_MODE_MENU);// |
|
3989 |
|
3990 const TInt menuCount=reader.ReadInt16(); |
|
3991 for ( TInt ii=0; ii<menuCount; ++ii ) |
|
3992 { |
|
3993 CEikMenuPaneItem* item = new(ELeave) CEikMenuPaneItem(); |
|
3994 CleanupStack::PushL( item ); |
|
3995 item->iData.iCommandId = reader.ReadInt32(); |
|
3996 item->iData.iCascadeId = reader.ReadInt32(); |
|
3997 item->iData.iFlags = reader.ReadInt32(); |
|
3998 TPtrC txtptr = reader.ReadTPtrC(); |
|
3999 item->SetScaleableTextL( txtptr ); |
|
4000 TPtrC extratxtptr = reader.ReadTPtrC(); |
|
4001 item->iData.iExtraText = extratxtptr; |
|
4002 TPtrC bitmapFile = reader.ReadTPtrC(); |
|
4003 TInt bitmapId = reader.ReadInt16(); |
|
4004 TInt bitmapMaskId = reader.ReadInt16(); |
|
4005 CleanupStack::Pop(); // pop first, since additem pushes again |
|
4006 editorMenuPane->AddMenuItemL( item->iData ); |
|
4007 editorMenuItemList.Append(item); |
|
4008 reader.ReadInt32(); // extension link |
|
4009 } |
|
4010 |
|
4011 CleanupStack::PopAndDestroy(); //reader |
|
4012 |
|
4013 |
|
4014 if (editorState) |
|
4015 { |
|
4016 menuBar = iUiInterface->EditorStateMenuBar(editorState); |
|
4017 } |
|
4018 |
|
4019 TInt count = 0; |
|
4020 |
|
4021 if ( menuBar ) |
|
4022 { |
|
4023 CAknFepUiInterfaceMenuPane* menuPane = menuBar->MenuPane(); |
|
4024 |
|
4025 CEikMenuPane* oldMenuPane = menuPane->GetMenuPane(); |
|
4026 |
|
4027 menuPane->SetMenuPane(editorMenuPane); |
|
4028 |
|
4029 DynInitTouchMenuPaneL(menuPane); |
|
4030 |
|
4031 menuPane->SetMenuPane(oldMenuPane); |
|
4032 |
|
4033 |
|
4034 for (TInt ii = 0; ii < KMaxMenuSize; ii++) |
|
4035 { |
|
4036 CEikMenuPaneItem::SData& itemdata = |
|
4037 editorMenuPane->ItemData(KEditorMenuPermitedSend[ii]); |
|
4038 if ( !(itemdata.iFlags & EEikMenuItemDimmed ) ) |
|
4039 { |
|
4040 count = count + 1; |
|
4041 iEditorCommandList[count] = itemdata.iCommandId; |
|
4042 } |
|
4043 } |
|
4044 iEditorCommandList[0] = count; |
|
4045 if (!aOnlyCount && iFepPluginManager->CurrentPluginInputFepUI()) |
|
4046 { |
|
4047 iFepPluginManager->CurrentPluginInputFepUI()->HandleCommandL( |
|
4048 ECmdPenInputSendEditMenuData, reinterpret_cast<TInt>(iEditorCommandList)); |
|
4049 } |
|
4050 |
|
4051 editorMenuItemList.ResetAndDestroy(); |
|
4052 delete editorMenuPane; |
|
4053 editorMenuPane = NULL; |
|
4054 } |
|
4055 |
|
4056 return count; |
|
4057 } |
|
4058 #endif // RD_SCALABLE_UI_V2 |
|
4059 |
|
4060 void CAknFepManager::ExitPluginSpellModeByOk() |
|
4061 { |
|
4062 TRAP_IGNORE(ExitPluginSpellModeByOkL()); |
|
4063 } |
|
4064 |
|
4065 void CAknFepManager::ExitPluginSpellModeByOkL() |
|
4066 { |
|
4067 #ifdef RD_SCALABLE_UI_V2 |
|
4068 if (iFepPluginManager->IsSpellVisible()) |
|
4069 { |
|
4070 HBufC* spell = iFepPluginManager->SpellTextInput(); |
|
4071 |
|
4072 iFepPluginManager->SetITUTSpellingStateL(EFalse); |
|
4073 iFepPluginManager->DestroySpellEditor(); |
|
4074 |
|
4075 if (spell) |
|
4076 { |
|
4077 CleanupStack::PushL(spell); |
|
4078 TPtr text = spell->Des(); |
|
4079 FepUI()->AddTextToUserDictionaryL(text); |
|
4080 InsertTextFromDialogL(text, iFepPluginManager->CursorSelection()); |
|
4081 CleanupStack::PopAndDestroy(spell); |
|
4082 } |
|
4083 |
|
4084 UpdateCbaL(NULL); |
|
4085 if (iFepPluginManager->CaseUpdatesSupressed()) |
|
4086 { |
|
4087 SetFlag(EFlagSupressAutoUpdate); |
|
4088 } |
|
4089 else |
|
4090 { |
|
4091 ClearFlag(EFlagSupressAutoUpdate); |
|
4092 } |
|
4093 ClearFlag(EFlagSupressAutoUpdateAtEditorStart); |
|
4094 } |
|
4095 #endif |
|
4096 } |
|
4097 |
|
4098 void CAknFepManager::ExitPluginSpellModeByCancel() |
|
4099 { |
|
4100 /* |
|
4101 #ifdef RD_SCALABLE_UI_V2 |
|
4102 if (iFepPluginManager->IsSpellVisible()) |
|
4103 { |
|
4104 iFepPluginManager->SetITUTSpellingStateL(EFalse); |
|
4105 iFepPluginManager->DestroySpellEditor(); |
|
4106 UpdateCbaL(NULL); |
|
4107 HandleChangeInFocus(); |
|
4108 if (iFepPluginManager->CursorSelection().Length()) |
|
4109 { |
|
4110 EditorState()->SetInlineEditSpan(iFepPluginManager->CursorSelection()); |
|
4111 ConfigureFEPFromEditorStateL(); |
|
4112 } |
|
4113 TransferFepStateToEditorL(); |
|
4114 |
|
4115 if (iFepPluginManager->CaseUpdatesSupressed()) |
|
4116 { |
|
4117 SetFlag(EFlagSupressAutoUpdate); |
|
4118 } |
|
4119 else |
|
4120 { |
|
4121 ClearFlag(EFlagSupressAutoUpdate); |
|
4122 } |
|
4123 ClearFlag(EFlagSupressAutoUpdateAtEditorStart); |
|
4124 iFepPluginManager->SetBeforeSpell(ETrue); |
|
4125 } |
|
4126 #endif |
|
4127 */ |
|
4128 #ifdef RD_SCALABLE_UI_V2 |
|
4129 if (iFepPluginManager->IsSpellVisible()) |
|
4130 { |
|
4131 TRAP_IGNORE(iFepPluginManager->SetITUTSpellingStateL(EFalse)); |
|
4132 iFepPluginManager->DestroySpellEditor(); |
|
4133 |
|
4134 TRAP_IGNORE(UpdateCbaL(NULL)); |
|
4135 if (iFepPluginManager->CaseUpdatesSupressed()) |
|
4136 { |
|
4137 SetFlag(EFlagSupressAutoUpdate); |
|
4138 } |
|
4139 else |
|
4140 { |
|
4141 ClearFlag(EFlagSupressAutoUpdate); |
|
4142 } |
|
4143 ClearFlag(EFlagSupressAutoUpdateAtEditorStart); |
|
4144 } |
|
4145 #endif |
|
4146 } |
|
4147 |
|
4148 void CAknFepManager::ProcessCommandL(TInt aCommandId) |
|
4149 { |
|
4150 //ProcessCommandL() is called before HandleChangeInFocus() for the editor to insert the |
|
4151 //number into, so have to force a call |
|
4152 |
|
4153 //Process pen input menu if avaliable |
|
4154 #ifdef RD_SCALABLE_UI_V2 |
|
4155 |
|
4156 if (iFepPluginManager && |
|
4157 (iFepPluginManager->PluginInputMode() == EPluginInputModeItut)) |
|
4158 { |
|
4159 switch(aCommandId) |
|
4160 { |
|
4161 case EAknSoftkeyOptions: |
|
4162 { |
|
4163 LaunchSelectModeMenuL(); |
|
4164 } |
|
4165 return; |
|
4166 case EAknSoftkeyOk: |
|
4167 { |
|
4168 iFepPluginManager->ClosePluginInputModeL(ETrue); |
|
4169 } |
|
4170 return; |
|
4171 default: |
|
4172 { |
|
4173 break; |
|
4174 } |
|
4175 } |
|
4176 } |
|
4177 |
|
4178 SendEventsToPluginManL( EPluginMenuCmd, aCommandId ); |
|
4179 |
|
4180 #endif //RD_SCALABLE_UI_V2 |
|
4181 MAknFepManagerInterface* currentFepUI=NULL; |
|
4182 switch (aCommandId) |
|
4183 { |
|
4184 // Edit mode menu commands |
|
4185 //The soft CBA event from touch screen. |
|
4186 case EAknSoftkeyCancel: |
|
4187 // case (TUint16)EAknSoftkeyCancel: |
|
4188 case EAknSoftkeySelect: |
|
4189 // case (TUint16)EAknSoftkeySelect: |
|
4190 currentFepUI = FepUI(); |
|
4191 if (currentFepUI) |
|
4192 currentFepUI->HandleCommandL( aCommandId ); |
|
4193 break; |
|
4194 // --- commands for Japanese --- |
|
4195 case EJapanFepCmdModeHiragana: |
|
4196 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4197 HandleChangeInFocus(); |
|
4198 TryChangeModeL(EHiraganaKanji); |
|
4199 break; |
|
4200 case EJapanFepCmdModeKatakana: |
|
4201 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4202 HandleChangeInFocus(); |
|
4203 TryChangeModeL(EKatakana); |
|
4204 break; |
|
4205 case EAknCmdEditInsertPictograph: |
|
4206 SetStopProcessFocus(ETrue); |
|
4207 HandleChangeInFocus(); |
|
4208 LaunchPictographCharacterTableL(); |
|
4209 SetStopProcessFocus(EFalse); |
|
4210 break; |
|
4211 case EJapanFepCmdModeFullWidth: |
|
4212 case EPenInputJpCmdFullWidth: |
|
4213 case EJapanFepCmdModeHalfWidth: |
|
4214 case EPenInputJpCmdHalfWidth: |
|
4215 { |
|
4216 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4217 HandleChangeInFocus(); |
|
4218 if (aCommandId == EJapanFepCmdModeFullWidth |
|
4219 || aCommandId == EPenInputJpCmdFullWidth) |
|
4220 { |
|
4221 iCharWidth = EFullWidthChar; |
|
4222 } |
|
4223 else |
|
4224 { |
|
4225 iCharWidth = EHalfWidthChar; |
|
4226 } |
|
4227 UpdateIndicators(); |
|
4228 TryChangeModeL(iMode); |
|
4229 #ifdef RD_SCALABLE_UI_V2 |
|
4230 if (aCommandId == EPenInputJpCmdFullWidth |
|
4231 || aCommandId == EPenInputJpCmdHalfWidth) |
|
4232 { |
|
4233 // Re-open pen input window |
|
4234 SendEventsToPluginManL( EPluginActivate ); |
|
4235 } |
|
4236 #endif //RD_SCALABLE_UI_V2 |
|
4237 } |
|
4238 break; |
|
4239 case EJapanFepCmdModeUserDic: |
|
4240 case EPenInputJpCmdSaveWord: |
|
4241 { |
|
4242 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4243 // User dictionary |
|
4244 #ifdef RD_PF_SEC_APPARC |
|
4245 // Launch settings app |
|
4246 if ( iNullService ) |
|
4247 { |
|
4248 delete iNullService; |
|
4249 iNullService = NULL; |
|
4250 } |
|
4251 iNullService = CAknNullService::NewL( KUidUserDictApp, this ); |
|
4252 #else |
|
4253 CEikProcess* process = CEikonEnv::Static()->Process(); |
|
4254 if (iEmbedded) |
|
4255 { |
|
4256 process->DestroyDocument(iEmbedded); |
|
4257 } |
|
4258 #if (defined(SYMBIAN_SUPPORT_UI_FRAMEWORKS_V1) || defined(__SERIES60_27__) || defined(__SERIES60_28__)) |
|
4259 iEmbedded = process->AddNewDocumentL(_L("User Dictionary"), KUidUserDictApp); |
|
4260 #else |
|
4261 iEmbedded = process->AddNewDocumentL(KUidUserDictApp); |
|
4262 #endif |
|
4263 iEmbedded->NewDocumentL(); |
|
4264 iEmbedded->EditL(NULL); |
|
4265 #endif //RD_PF_SEC_APPARC |
|
4266 } |
|
4267 break; |
|
4268 case EPenInputJpCmdKutenCode: |
|
4269 case EJapanFepCmdModeKutenCodeInput: |
|
4270 { |
|
4271 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4272 LaunchKutenCodeQueryL(); |
|
4273 #ifdef RD_SCALABLE_UI_V2 |
|
4274 if (aCommandId == EPenInputJpCmdKutenCode) |
|
4275 { |
|
4276 // Re-open pen input window |
|
4277 SendEventsToPluginManL( EPluginActivate ); |
|
4278 } |
|
4279 #endif //RD_SCALABLE_UI_V2 |
|
4280 } |
|
4281 break; |
|
4282 case EAknCmdEditClearDirectionLeft: |
|
4283 case EAknCmdEditClearDirectionRight: |
|
4284 { |
|
4285 TInt value = EClearDirectionLeft; |
|
4286 if (aCommandId == EAknCmdEditClearDirectionRight) |
|
4287 { |
|
4288 value = EClearDirectionRight; |
|
4289 } |
|
4290 iSharedDataInterface->SetClearDirection(value); |
|
4291 } |
|
4292 break; |
|
4293 case EAknFepSoftkeyCloseWindow: |
|
4294 if(IsChineseInputLanguage()) |
|
4295 { |
|
4296 TryCloseUiL(); |
|
4297 } |
|
4298 if (iCcpuMode != ECcpuStateNone) |
|
4299 { |
|
4300 ResetCcpuFlags(); |
|
4301 |
|
4302 // reset select mode indicators |
|
4303 iIndicator->SetCopyMode(EFalse); |
|
4304 // update view |
|
4305 iPreviousEditingState = EStateNone; |
|
4306 UpdateIndicators(); |
|
4307 |
|
4308 iUiInterface->DeleteSoftkeys(); |
|
4309 break; |
|
4310 } |
|
4311 case EAknFepSoftkeyCommit: |
|
4312 case EAknFepSoftkeySelectCandidate: |
|
4313 case EAknFepSoftkeyConvert: |
|
4314 case EAknFepSoftkeyOtherModes: |
|
4315 case EAknFepSoftkeyRetroActiveHalf: |
|
4316 case EAknFepSoftkeyRetroActiveFull: |
|
4317 { |
|
4318 FepUI()->HandleCommandL(aCommandId); |
|
4319 } |
|
4320 break; |
|
4321 case EAknFepSoftkeyPredictiveOn: |
|
4322 { |
|
4323 iJapanesePredictive = ETrue; |
|
4324 iSharedDataInterface->SetJapanesePredictiveTextOn(); |
|
4325 iHashKeyMan->SetMode(iMode, ETrue); |
|
4326 UpdateIndicators(); |
|
4327 FepUI()->HandleCommandL(aCommandId); |
|
4328 } |
|
4329 break; |
|
4330 case EJapanFepCmdModePredictiveOn: |
|
4331 { |
|
4332 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4333 HandleChangeInFocus(); |
|
4334 if (!iJapanesePredictive) |
|
4335 { |
|
4336 LaunchConfirmationNoteL(R_AVKON_JAPANESE_PREDICTIVE_ACTIVATED_NOTE); |
|
4337 } |
|
4338 iJapanesePredictive = ETrue; |
|
4339 TryChangeModeL(EHiraganaKanji); |
|
4340 iSharedDataInterface->SetJapanesePredictiveTextOn(); |
|
4341 } |
|
4342 break; |
|
4343 case EJapanFepCmdModePredictiveOff: |
|
4344 { |
|
4345 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4346 HandleChangeInFocus(); |
|
4347 if (iJapanesePredictive) |
|
4348 { |
|
4349 LaunchConfirmationNoteL(R_AVKON_JAPANESE_PREDICTIVE_DEACTIVATED_NOTE); |
|
4350 } |
|
4351 iJapanesePredictive = EFalse; |
|
4352 TryChangeModeL(EHiraganaKanji); |
|
4353 iSharedDataInterface->ResetJapanesePredictiveTextOn(); |
|
4354 } |
|
4355 break; |
|
4356 #ifdef RD_SCALABLE_UI_V2 |
|
4357 case EPenInputJpCmdPredictiveOn: |
|
4358 { |
|
4359 iJapanesePredictive = ETrue; |
|
4360 iSharedDataInterface->SetJapanesePredictiveTextOn(); |
|
4361 if (iFepPluginManager->PluginInputMode() == EPluginInputModeHwr) |
|
4362 { |
|
4363 iSharedDataInterface->SetJapaneseHwrConversion(EJapaneseConversionOn); |
|
4364 } |
|
4365 } |
|
4366 break; |
|
4367 case EPenInputJpCmdPredictiveOff: |
|
4368 { |
|
4369 iJapanesePredictive = EFalse; |
|
4370 iSharedDataInterface->ResetJapanesePredictiveTextOn(); |
|
4371 } |
|
4372 break; |
|
4373 case EPenInputJpCmdConversionOn: |
|
4374 { |
|
4375 iSharedDataInterface->SetJapaneseHwrConversion(EJapaneseConversionOn); |
|
4376 } |
|
4377 break; |
|
4378 case EPenInputJpCmdConversionOff: |
|
4379 { |
|
4380 iSharedDataInterface->SetJapaneseHwrConversion(EJapaneseConversionOff); |
|
4381 } |
|
4382 break; |
|
4383 #endif //RD_SCALABLE_UI_V2 |
|
4384 |
|
4385 // --- commands for Chinese --- |
|
4386 case EChinFepCmdModePinyin: |
|
4387 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4388 HandleChangeInFocus(); |
|
4389 TryChangeModeL(EPinyin); |
|
4390 break; |
|
4391 case EChinFepCmdModeZhuyin: |
|
4392 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4393 HandleChangeInFocus(); |
|
4394 TryChangeModeL(EZhuyin); |
|
4395 break; |
|
4396 case EChinFepCmdModeStroke: |
|
4397 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4398 HandleChangeInFocus(); |
|
4399 TryChangeModeL(EStroke); |
|
4400 break; |
|
4401 case EChinFepCmdModeCangJie: |
|
4402 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4403 HandleChangeInFocus(); |
|
4404 TryChangeModeL(ECangJie); |
|
4405 break; |
|
4406 case EChinFepCmdModeCangJieOption: |
|
4407 // Launch CangJie option dialog |
|
4408 { |
|
4409 SetStopProcessFocus(ETrue); |
|
4410 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4411 TInt newMode = LaunchCangJieOptionDlgL(); |
|
4412 SetStopProcessFocus(EFalse); |
|
4413 UpdateCangJieState( newMode ); |
|
4414 } |
|
4415 break; |
|
4416 case EChinFepCmdModeLatinUpper: |
|
4417 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4418 HandleChangeInFocus(); |
|
4419 TryChangeModeL(ELatinUpper); |
|
4420 // delete it for support auto update to text-case |
|
4421 //SetFlag(EFlagSupressAutoUpdate); |
|
4422 iCaseMan->SetCurrentCase(EAknEditorUpperCase); |
|
4423 break; |
|
4424 case EAknCmdEditModeKorean: |
|
4425 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4426 HandleChangeInFocus(); |
|
4427 TryChangeModeL(EHangul); |
|
4428 // delete it for support auto update to text-case |
|
4429 //SetFlag(EFlagSupressAutoUpdate); |
|
4430 iCaseMan->SetCurrentCase(EAknEditorUpperCase); |
|
4431 break; |
|
4432 case EChinFepCmdModeLatinLower: |
|
4433 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4434 HandleChangeInFocus(); |
|
4435 TryChangeModeL(ELatinLower); |
|
4436 // delete it for support auto update to text-case |
|
4437 //SetFlag(EFlagSupressAutoUpdate); |
|
4438 iCaseMan->SetCurrentCase(EAknEditorLowerCase); |
|
4439 break; |
|
4440 case EAknCmdEditModeNumber: |
|
4441 case EJapanFepCmdEditModeNumber: |
|
4442 case EChinFepCmdModeNumber: |
|
4443 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4444 HandleChangeInFocus(); |
|
4445 if ( iLanguageCapabilities.iArabicIndicDigitsAllowed |
|
4446 || iLanguageCapabilities.iEasternArabicIndicDigitsAllowed |
|
4447 || iLanguageCapabilities.iIndicDigitsAllowed ) |
|
4448 { |
|
4449 iLanguageCapabilities.iLocalDigitType = EDigitTypeWestern; |
|
4450 } |
|
4451 TryChangeModeL(ENumber); |
|
4452 break; |
|
4453 case EAknCmdEditModeArabicIndicNumber: |
|
4454 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4455 HandleChangeInFocus(); |
|
4456 iLanguageCapabilities.iLocalDigitType = EDigitTypeArabicIndic; |
|
4457 TryChangeModeL(ENativeNumber); |
|
4458 break; |
|
4459 /*For Eastern Arabic Numeric*/ |
|
4460 case EAknCmdEditModeEasternArabicIndicNumber: |
|
4461 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4462 HandleChangeInFocus(); |
|
4463 iLanguageCapabilities.iLocalDigitType = EDigitTypeEasternArabicIndic; |
|
4464 TryChangeModeL(ENativeNumber); |
|
4465 break; |
|
4466 /*for Hindi*/ |
|
4467 case EAknCmdEditModeIndicNumber: |
|
4468 HandleChangeInFocus(); |
|
4469 iLanguageCapabilities.iLocalDigitType = EDigitTypeDevanagari; |
|
4470 TryChangeModeL(ENativeNumber); |
|
4471 break; |
|
4472 case EChinFepCmdInstructions: |
|
4473 SetStopProcessFocus(ETrue); |
|
4474 HandleChangeInFocus(); |
|
4475 LaunchHelpTextQueryL(); |
|
4476 SetStopProcessFocus(EFalse); |
|
4477 break; |
|
4478 case EChinFepCmdModeZhuyinFind: |
|
4479 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4480 HandleChangeInFocus(); |
|
4481 TryChangeModeL(EZhuyinFind); |
|
4482 break; |
|
4483 case EChinFepCmdModeStrokeFind: |
|
4484 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4485 HandleChangeInFocus(); |
|
4486 TryChangeModeL(EStrokeFind); |
|
4487 break; |
|
4488 |
|
4489 // commands for western or common |
|
4490 case EJapanFepCmdMultitapPredictiveT9On: |
|
4491 case EAknCmdMultitapPredictiveT9On: |
|
4492 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
4493 case EAknFepCmdPredActivate: |
|
4494 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
4495 SetStopProcessFocus(ETrue, EFalse); |
|
4496 HandleChangeInFocus(); |
|
4497 #ifdef RD_SCALABLE_UI_V2 |
|
4498 if( iFepFullyConstructed && iFepPluginManager) |
|
4499 { |
|
4500 iFepPluginManager->SetMenuState(); |
|
4501 } |
|
4502 #endif |
|
4503 if ( !iWesternPredictive ) |
|
4504 { |
|
4505 LaunchConfirmationNoteL(R_AVKON_T9_ACTIVATED_NOTE); |
|
4506 } |
|
4507 SetWesternPredictive(ETrue); |
|
4508 SetStopProcessFocus(EFalse); |
|
4509 TryChangeModeL(ELatin); |
|
4510 break; |
|
4511 case EAknCmdT9PredictiveT9Off: |
|
4512 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
4513 case EAknFepCmdPredDeactivate: |
|
4514 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
4515 SetStopProcessFocus(ETrue, EFalse); |
|
4516 HandleChangeInFocus(); |
|
4517 #ifdef RD_SCALABLE_UI_V2 |
|
4518 if( iFepFullyConstructed && iFepPluginManager) |
|
4519 { |
|
4520 iFepPluginManager->SetMenuState(); |
|
4521 } |
|
4522 #endif |
|
4523 if (iMode != ELatin) |
|
4524 { |
|
4525 TryChangeModeL(ELatin); |
|
4526 } |
|
4527 else |
|
4528 { |
|
4529 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
4530 RemoveSuggestedAdvanceCompletionL(); |
|
4531 #endif // RD_INTELLIGENT_TEXT_INPUT |
|
4532 CommitInlineEditL(); |
|
4533 } |
|
4534 if ( iWesternPredictive ) |
|
4535 { |
|
4536 LaunchConfirmationNoteL(R_AVKON_T9_DEACTIVATED_NOTE); |
|
4537 } |
|
4538 SetWesternPredictive(EFalse); |
|
4539 SetStopProcessFocus(EFalse); |
|
4540 break; |
|
4541 case EAknCmdEditModeEnglish: |
|
4542 case EAknCmdEditModeAlpha: |
|
4543 case EJapanFepCmdEditModeAlpha: |
|
4544 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4545 HandleChangeInFocus(); |
|
4546 TryChangeModeL(ELatin); |
|
4547 iCaseMan->UpdateCase( ENullNaviEvent ); |
|
4548 ClearFlag(EFlagSupressAutoUpdate); |
|
4549 break; |
|
4550 case EAknCmdEditModeLatinText: |
|
4551 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4552 HandleChangeInFocus(); |
|
4553 TryChangeModeL(ELatinText); |
|
4554 ClearFlag(EFlagSupressAutoUpdate); |
|
4555 iCaseMan->SetCurrentCase(EAknEditorTextCase); |
|
4556 break; |
|
4557 case EAknCmdEditInsertSymbol: |
|
4558 case EAknCmdEditInsertSymbolJp: |
|
4559 case EAknFepSoftkeySymbol: |
|
4560 case EAknCmdEditInsertSmiley: |
|
4561 SetCcpuFlag(ECcpuStateSupressCursorMoveToEnd); |
|
4562 #ifdef RD_SCALABLE_UI_V2 |
|
4563 if (iFepPluginManager && |
|
4564 (iFepPluginManager->PluginInputMode() == EPluginInputModeItut || |
|
4565 iFepPluginManager->PluginInputMode() == EPluginInputModeFSQ || |
|
4566 iFepPluginManager->PluginInputMode() == EPluginInputModeFingerHwr)) |
|
4567 { |
|
4568 iFepPluginManager->SetMenuState(); |
|
4569 } |
|
4570 |
|
4571 #endif //RD_SCALABLE_UI_V2 |
|
4572 SetStopProcessFocus(ETrue, EFalse); |
|
4573 HandleChangeInFocus(); |
|
4574 if (aCommandId == EAknFepSoftkeySymbol) |
|
4575 { |
|
4576 SetCcpuFlag(ECcpuStateCbaSymbol); |
|
4577 } |
|
4578 // Show Thai specific SCT with Thai vowels and tonemarks |
|
4579 if ( (iLanguageCapabilities.iInputLanguageCode == ELangThai ) && |
|
4580 (iMode!=ENumber && iMode != ENativeNumber ) ) |
|
4581 { |
|
4582 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
4583 // if itut call Thai multitap HandleCommandL to Launch SCT |
|
4584 if(!iQwertyInputMode) |
|
4585 { |
|
4586 #endif |
|
4587 TInt resourceId = 0; |
|
4588 if (iAknFepThaiSCTSelector) |
|
4589 { |
|
4590 resourceId = iAknFepThaiSCTSelector->ThaiSCRResourceId(PreviousChar(),EPtiKeyStar); |
|
4591 } |
|
4592 LaunchSpecialCharacterTableL(resourceId, |
|
4593 aCommandId==EAknCmdEditInsertSymbol, |
|
4594 aCommandId==EAknCmdEditInsertSmiley); |
|
4595 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
4596 } |
|
4597 else |
|
4598 { |
|
4599 CAknFepUIManagerWestern* westernUIManager = static_cast<CAknFepUIManagerWestern*>(FepUI()); |
|
4600 LaunchSpecialCharacterTableL(westernUIManager->ThaiSCTResourceId(static_cast<TChar>(PreviousChar()),EPtiKeyStar), |
|
4601 aCommandId==EAknCmdEditInsertSymbol, |
|
4602 aCommandId==EAknCmdEditInsertSmiley); |
|
4603 } |
|
4604 #endif |
|
4605 } |
|
4606 else |
|
4607 { |
|
4608 LaunchSpecialCharacterTableL(0, |
|
4609 aCommandId==EAknCmdEditInsertSymbol, |
|
4610 aCommandId==EAknCmdEditInsertSmiley); |
|
4611 } |
|
4612 SetStopProcessFocus(EFalse); |
|
4613 ClearCcpuFlag(ECcpuStateCbaSymbol); |
|
4614 break; |
|
4615 case EAknFepSoftkeyPrevious: |
|
4616 FepUI()->HandleCommandL(aCommandId); |
|
4617 break; |
|
4618 case EAknFepSoftkeySpell: |
|
4619 LaunchEditWordQueryL(); |
|
4620 break; |
|
4621 case EAknCmdT9PredictiveInsertWord: |
|
4622 SetStopProcessFocus(ETrue); |
|
4623 HandleChangeInFocus(); |
|
4624 LaunchInsertWordQueryL(KNullDesC, TCursorSelection(0,0)); |
|
4625 SetStopProcessFocus(EFalse); |
|
4626 #ifdef RD_SCALABLE_UI_V2 |
|
4627 if( iFepFullyConstructed && iFepPluginManager) |
|
4628 { |
|
4629 iFepPluginManager->ResetMenuState(); |
|
4630 } |
|
4631 #endif |
|
4632 break; |
|
4633 case EAknCmdT9PredictiveEditWord: |
|
4634 SetStopProcessFocus(ETrue); |
|
4635 HandleChangeInFocus(); |
|
4636 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
4637 RemoveSuggestedAdvanceCompletionL(); |
|
4638 #endif // RD_INTELLIGENT_TEXT_INPUT |
|
4639 LaunchEditWordQueryL(); |
|
4640 SetStopProcessFocus(EFalse); |
|
4641 #ifdef RD_SCALABLE_UI_V2 |
|
4642 if( iFepFullyConstructed && iFepPluginManager ) |
|
4643 { |
|
4644 iFepPluginManager->ResetMenuState(); |
|
4645 } |
|
4646 #endif |
|
4647 break; |
|
4648 case EAknCmdT9PredictiveMatches: |
|
4649 SetStopProcessFocus(ETrue,EFalse); |
|
4650 LaunchMatchesPopupListL(); |
|
4651 SetStopProcessFocus(EFalse); |
|
4652 break; |
|
4653 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
4654 case EAknCmdPredictiveAutoWord: |
|
4655 if ( !iIsAutoCompleteOn ) |
|
4656 { |
|
4657 SetStopProcessFocus(ETrue); |
|
4658 LaunchConfirmationNoteL(R_AVKON_PREDICTIVE_AUTOCOMPLETION_ACTIVATED_NOTE); |
|
4659 SetStopProcessFocus(EFalse); |
|
4660 } |
|
4661 iIsAutoCompleteOn = ETrue; |
|
4662 iSharedDataInterface->SetPredictiveTextAutoCompleteOn(); |
|
4663 #ifdef RD_SCALABLE_UI_V2 |
|
4664 if(iFepPluginManager->PluginInputMode() == EPluginInputModeItut) |
|
4665 { |
|
4666 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4667 HandleChangeInFocus(); |
|
4668 } |
|
4669 #endif |
|
4670 UpdateIndicators(); |
|
4671 break; |
|
4672 case EAknCmdPredictiveNormal: |
|
4673 if ( iIsAutoCompleteOn ) |
|
4674 { |
|
4675 SetStopProcessFocus(ETrue); |
|
4676 LaunchConfirmationNoteL(R_AVKON_PREDICTIVE_AUTOCOMPLETION_DEACTIVATED_NOTE); |
|
4677 SetStopProcessFocus(EFalse); |
|
4678 } |
|
4679 iIsAutoCompleteOn = EFalse; |
|
4680 iSharedDataInterface->ResetPredictiveTextAutoCompleteOn(); |
|
4681 UpdateIndicators(); |
|
4682 break; |
|
4683 #endif |
|
4684 case EAknCmdInputLanguage: |
|
4685 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
4686 case EAknFepCmdPredInputLanguage: |
|
4687 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
4688 SetStopProcessFocus(ETrue, EFalse); |
|
4689 HandleChangeInFocus(); |
|
4690 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
4691 #ifdef FF_DUAL_LANGUAGE_SUPPORT |
|
4692 // Currently dual language feature would work correctly for ITUT and Half Qwerty products |
|
4693 // Hence the dual language settings should also be displayed only for ITUT and Halfqwerty products |
|
4694 if(iKeyboardType == EPtiKeyboard12Key || iKeyboardType == EPtiKeyboardHalfQwerty ) |
|
4695 LaunchDualLanguageSettingDialogL(); |
|
4696 else |
|
4697 { |
|
4698 LaunchLanguagesPopupListL(aCommandId == EAknCmdInputLanguage); |
|
4699 iStopProcessFocus = EFalse; |
|
4700 } |
|
4701 #else // FF_DUAL_LANGUAGE_SUPPORT |
|
4702 LaunchLanguagesPopupListL(aCommandId == EAknCmdInputLanguage); |
|
4703 //HandleChangeInFocus(); |
|
4704 iStopProcessFocus = EFalse; |
|
4705 #endif // FF_DUAL_LANGUAGE_SUPPORT |
|
4706 #else |
|
4707 LaunchLanguagesPopupListL(aCommandId == EAknCmdInputLanguage); |
|
4708 HandleChangeInFocus(); |
|
4709 iStopProcessFocus = EFalse; |
|
4710 #endif |
|
4711 break; |
|
4712 case EAknEditMenuCmdCutText: |
|
4713 StartCcpuModeL(EFalse); |
|
4714 if (WesternPredictive()) |
|
4715 { |
|
4716 // Remove underlining from predicted word when focus is re-gained. |
|
4717 SetCcpuFlag(ECcpuStateUncommitWhenFocused); |
|
4718 } |
|
4719 SetCcpuFlag(ECcpuStateIgnoreNextFocusChange); |
|
4720 SetCcpuFlag(ECcpuStateEdwinInSelectionMode); |
|
4721 break; |
|
4722 case EAknEditMenuCmdCopyText: |
|
4723 StartCcpuModeL(ETrue); |
|
4724 if (WesternPredictive()) |
|
4725 { |
|
4726 // Remove underlining from predicted word when focus is re-gained. |
|
4727 SetCcpuFlag(ECcpuStateUncommitWhenFocused); |
|
4728 } |
|
4729 SetCcpuFlag(ECcpuStateIgnoreNextFocusChange); |
|
4730 SetCcpuFlag(ECcpuStateEdwinInSelectionMode); |
|
4731 break; |
|
4732 case EAknFepSoftkeyStartCopy: |
|
4733 case EAknFepSoftkeyStartCut: |
|
4734 { |
|
4735 ResetCcpuFlags(); |
|
4736 if (aCommandId == EAknFepSoftkeyStartCopy) |
|
4737 { |
|
4738 SetCcpuFlag(ECcpuStateCopy); |
|
4739 } |
|
4740 else |
|
4741 { |
|
4742 SetCcpuFlag(ECcpuStateCut); |
|
4743 } |
|
4744 |
|
4745 __ASSERT_DEBUG(iUiInterface->SoftkeysExist(), |
|
4746 AknFepPanic(EAknFepPanicNoHandleToFepAwareTextEditor)); |
|
4747 |
|
4748 TBool update = UpdateCBALabelL(ELeftSoftkeyIndex, KNullCommandId, R_TEXT_SOFTKEY_EMPTY); |
|
4749 update |= UpdateCBALabelL(ERightSoftkeyIndex, EAknFepSoftkeyCloseWindow, |
|
4750 R_AKNFEP_SOFTKEY_CCPU_CANCEL); |
|
4751 update |= UpdateCBALabelL( EMiddleSoftkeyIndex, KNullCommandId, R_TEXT_SOFTKEY_EMPTY ); |
|
4752 if (update) |
|
4753 { |
|
4754 iUiInterface->DrawSoftkeysNow(); |
|
4755 } |
|
4756 } |
|
4757 break; |
|
4758 case EEikCmdEditCopy: |
|
4759 case EEikCmdEditCut: |
|
4760 { |
|
4761 #ifdef RD_SCALABLE_UI_V2 |
|
4762 if (iFepPluginManager && |
|
4763 (iFepPluginManager->PluginInputMode() == EPluginInputModeItut || |
|
4764 iFepPluginManager->PluginInputMode() == EPluginInputModeFSQ || |
|
4765 iFepPluginManager->PluginInputMode() == EPluginInputModeFingerHwr)) |
|
4766 { |
|
4767 iFepPluginManager->SetMenuState(EFalse); |
|
4768 } |
|
4769 |
|
4770 #endif //RD_SCALABLE_UI_V2 |
|
4771 SetStopProcessFocus(ETrue, EFalse); |
|
4772 HandleCopyCutEventL(aCommandId); |
|
4773 SetStopProcessFocus(EFalse); |
|
4774 } |
|
4775 break; |
|
4776 case EEikCmdEditPaste: |
|
4777 { |
|
4778 // We have a hindi character in clipboard which can form ligature with the existing text |
|
4779 // if pasted. While the input language is English, the cursor aligmment check would not happen. |
|
4780 // When selecting Options->Paste, the Fep context at this point is for the menu. |
|
4781 // iInputCapabilities for editor context is retrived from CCoeEnv and is restored back |
|
4782 // after doing the operation, else FepAwareTextEditor will be true in menu context. |
|
4783 if ( (!BidiCursorRequired()) && (!WesternPredictive()) ) |
|
4784 { |
|
4785 TCoeInputCapabilities origInputCapabilities = iInputCapabilities; |
|
4786 |
|
4787 CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
4788 iInputCapabilities = static_cast<const CCoeAppUi*>(coeEnv->AppUi())->InputCapabilities(); |
|
4789 |
|
4790 if( !(iInputCapabilities.SupportsSecretText()) ) |
|
4791 { |
|
4792 DoCursorDirectionCheckL(); |
|
4793 } |
|
4794 iInputCapabilities = origInputCapabilities; |
|
4795 } |
|
4796 } |
|
4797 break; |
|
4798 |
|
4799 case EAknCmdEditMenuSctSelected: |
|
4800 { |
|
4801 SetCcpuFlag(ECcpuStateSupressCursorMoveToEnd); |
|
4802 HandleChangeInFocus(); // to re-establish contact with editor |
|
4803 |
|
4804 TBuf<ESingleCharacter> charAsDesc(ESingleCharacter); |
|
4805 for ( TInt ii = 0; ii < iSctEditChars->Length(); ii++) |
|
4806 { |
|
4807 charAsDesc[0]=(TText) (*iSctEditChars)[ii]; |
|
4808 if (charAsDesc[0] == TText(0x000A) // 0x000A is line feed |
|
4809 || charAsDesc[0] == CEditableText::EParagraphDelimiter) |
|
4810 { |
|
4811 // This is line feed character. Post it to editor and let it decide |
|
4812 // if it is valid. |
|
4813 if (!(iAknEditorFlags & EAknEditorFlagFindPane) && iSctEditChars->Length() == 1) |
|
4814 { |
|
4815 SimulateKeyEventL(EKeyEnter); |
|
4816 SimulateKeyEventL(EKeyF19); // Asyncronous case update |
|
4817 } |
|
4818 } |
|
4819 else |
|
4820 { |
|
4821 if (CharIsValidInEditor(charAsDesc[0])) |
|
4822 { |
|
4823 TCursorSelection cursorSelection(0,0); |
|
4824 if ((iAknEditorFlags & EAknEditorFlagMTAutoOverwrite) && |
|
4825 iMode == ELatin && !WesternPredictive()) |
|
4826 { |
|
4827 TInt edSize = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
4828 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
4829 if (iUncommittedText.iCursorPos < edSize && iUncommittedText.Length() == 0) |
|
4830 { |
|
4831 cursorSelection = TCursorSelection(iUncommittedText.iCursorPos + 1, |
|
4832 iUncommittedText.iAnchorPos); |
|
4833 } |
|
4834 } |
|
4835 |
|
4836 if (EditorHasFreeSpace()) |
|
4837 { |
|
4838 InsertTextFromDialogL(charAsDesc, cursorSelection); |
|
4839 } |
|
4840 |
|
4841 } |
|
4842 } |
|
4843 |
|
4844 } |
|
4845 } |
|
4846 break; |
|
4847 case EAknCmdTaskSwapper: |
|
4848 SendEventsToPluginManL( EPluginFaseSwap, ETrue ); |
|
4849 break; |
|
4850 |
|
4851 case EAknCmdEditMenuClose: |
|
4852 { |
|
4853 // Handle destruction of menu |
|
4854 StopDisplayingMenuBar(); |
|
4855 } |
|
4856 break; |
|
4857 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
4858 // Predictive QWERTY (XT9) changes ----> |
|
4859 case EAknFepCmdPredMatches: |
|
4860 { |
|
4861 HandleChangeInFocus(); // to re-establish contact with editor |
|
4862 // Focus current active word in list ----> |
|
4863 TInt wordToFocus; |
|
4864 iPtiEngine->HandleCommandL( EPtiCommandUserActionGetCurrentIndexOfCandidates, &wordToFocus ); |
|
4865 iSListLaunchedFromMenu = ETrue; |
|
4866 TKeyEvent candLaunch = {EKeyDownArrow, EStdKeyDownArrow, 0, 0}; |
|
4867 CEikonEnv::Static()->WsSession().SimulateKeyEvent(candLaunch); |
|
4868 //LaunchCandidatePopupListL( wordToFocus ); |
|
4869 } |
|
4870 break; |
|
4871 case EAknFepCmdPredSettings: |
|
4872 LaunchPredictiveSettingDialogL(); |
|
4873 break; |
|
4874 /* |
|
4875 This code is the part of fixing TSW Error ID: BSAN-7G58DB : Edit Menu : |
|
4876 "Matches" and "insert word" options are not available under Edit Menu. |
|
4877 This is For Insert Word Functionality*/ |
|
4878 case EAknEditMenuCmdInsertWord: |
|
4879 HandleChangeInFocus(); |
|
4880 LaunchInsertWordQueryL(KNullDesC, TCursorSelection(0,0)); |
|
4881 break; |
|
4882 #ifdef __USER_DICTIONARY_EDITING__ |
|
4883 case EAknFepCmdPredEditUserDictionary: |
|
4884 if ( IsAutoCompleteOn() ) |
|
4885 { |
|
4886 HandleChangeInFocus(); |
|
4887 RemoveSuggestedAdvanceCompletionL(); |
|
4888 } |
|
4889 UiInterface()->LaunchUserDictEditDialogL(); |
|
4890 break; |
|
4891 #endif //__USER_DICTIONARY_EDITING__ |
|
4892 |
|
4893 case EAknFepCmdPredHelp: |
|
4894 // Help ID:PREDINPUT_HLP_INPUT |
|
4895 { |
|
4896 const TInt KArrayGranularity = 3; |
|
4897 CArrayFix<TCoeHelpContext>* contexts = |
|
4898 new (ELeave) CArrayFixFlat<TCoeHelpContext>( KArrayGranularity ); |
|
4899 CleanupStack::PushL ( contexts ); |
|
4900 TUid appuid = { 0x100058EC }; |
|
4901 contexts->AppendL( TCoeHelpContext( appuid, KPREDINPUT_HLP_INPUT ) ); |
|
4902 CleanupStack::Pop( contexts ); |
|
4903 HlpLauncher::LaunchHelpApplicationL( CEikonEnv::Static()->WsSession(), contexts ); |
|
4904 } |
|
4905 break; |
|
4906 // Predictive QWERTY (XT9) changes <---- |
|
4907 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
4908 // add for phrase creation user db view. |
|
4909 case EAknCmdUserDBDlg: |
|
4910 { |
|
4911 HandleChangeInFocus(); |
|
4912 LaunchUserDBDlgL(); |
|
4913 } |
|
4914 break; |
|
4915 case EPenInputCmdPreviewOn: |
|
4916 { |
|
4917 iSharedDataInterface->SetFepShowVkbPreviewStatus(KTouchInputPreviewOn); |
|
4918 SendEventsToPluginManL(EPluginPreview, KTouchInputPreviewOn); |
|
4919 } |
|
4920 break; |
|
4921 case EPenInputCmdPreviewOff: |
|
4922 { |
|
4923 iSharedDataInterface->SetFepShowVkbPreviewStatus(KTouchInputPreviewOff); |
|
4924 SendEventsToPluginManL(EPluginPreview, KTouchInputPreviewOff); |
|
4925 } |
|
4926 break; |
|
4927 case EPenInputCmdRecognitionWithDictionary: |
|
4928 { |
|
4929 SetStopProcessFocus(ETrue); |
|
4930 HandleChangeInFocus(); |
|
4931 LaunchRecognitionWithDictionaryPopupListL(); |
|
4932 HandleChangeInFocus(); |
|
4933 iStopProcessFocus = EFalse; |
|
4934 } |
|
4935 break; |
|
4936 default: |
|
4937 break; |
|
4938 } |
|
4939 |
|
4940 |
|
4941 StopDisplayingMenuBar(); |
|
4942 } |
|
4943 |
|
4944 void CAknFepManager::SetEmphasis(CBase* /*aMenuControl*/,TBool aEmphasis) |
|
4945 { |
|
4946 if (aEmphasis) |
|
4947 { // opening main menu pane |
|
4948 SetFlag(EFlagMenuPaneVisible); |
|
4949 if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
4950 { |
|
4951 SetFlag(EFlagInlineEditInBackground); |
|
4952 } |
|
4953 } |
|
4954 else |
|
4955 { |
|
4956 // The pointer to be cleared when the callback is received on leaving the focus from the menu pane. |
|
4957 #ifdef __ITI_VIRTUAL_TOUCH_FIRST_GENERATION_SUPPORT__ |
|
4958 iOptionsMenuBar = NULL; |
|
4959 #endif |
|
4960 ClearFlag(EFlagMenuPaneVisible | EFlagRemoveMatchesMenuItem | EFlagInlineEditInBackground); |
|
4961 } |
|
4962 } |
|
4963 |
|
4964 void CAknFepManager::DynInitMenuBarL(TInt aResourceId, CAknFepUiInterfaceMenuBar* aMenuBar) |
|
4965 { |
|
4966 if (iFepFullyConstructed && IsFlagSet(EFlagLaunchEditMenu)) |
|
4967 { |
|
4968 aMenuBar->ReplaceAllMenuPanes(R_AVKON_EDIT_MODE_MENU); |
|
4969 } |
|
4970 |
|
4971 #ifdef RD_SCALABLE_UI_V2 |
|
4972 if (iFepFullyConstructed && |
|
4973 aResourceId == R_AVKON_PENINPUT_OPTION_MENU_BAR) |
|
4974 { |
|
4975 aMenuBar->ReplaceAllMenuPanes(R_AVKON_TOUCH_TOUCHINPUT_MENU); |
|
4976 } |
|
4977 #endif //RD_SCALABLE_UI_V2 |
|
4978 |
|
4979 } |
|
4980 |
|
4981 #ifdef RD_SCALABLE_UI_V2 |
|
4982 void CAknFepManager::DynInitTouchMenuPaneL(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
4983 { |
|
4984 if ( !iFepFullyConstructed ) |
|
4985 { |
|
4986 return; |
|
4987 } |
|
4988 |
|
4989 |
|
4990 if (iFepManState != EAknFepStateNull && |
|
4991 iInputCapabilities.FepAwareTextEditor() && |
|
4992 !(iAknEditorFlags & EAknEditorFlagFindPane)) |
|
4993 { |
|
4994 // 'Input language' menu item on option menu isn't supported in Japanese variant. |
|
4995 if (!IsFeatureSupportedJapanese()) |
|
4996 { |
|
4997 // Insert 'Input language' item to incoming menu if editor is active on screen and |
|
4998 // menu contains 'Help' or 'Exit' item. |
|
4999 if (!IsOnlyNumericPermitted()) |
|
5000 { |
|
5001 TInt helpIndex; |
|
5002 if (aMenuPane->MenuItemExists(EAknCmdHelp, helpIndex) || |
|
5003 aMenuPane->MenuItemExists(EAknCmdExit, helpIndex)) |
|
5004 { |
|
5005 AddInputLanguageItemL(aMenuPane, helpIndex); |
|
5006 } |
|
5007 } |
|
5008 } |
|
5009 } |
|
5010 |
|
5011 TInt index; |
|
5012 if(aMenuPane->MenuItemExists(EAknCmdEditItemPlaceHolder, index)) |
|
5013 { |
|
5014 aMenuPane->DeleteMenuItem(EAknCmdEditItemPlaceHolder); |
|
5015 } |
|
5016 |
|
5017 ClearFlag(EFlagLaunchEditMenu); |
|
5018 |
|
5019 DimInputmodeTouchMenuItems(aMenuPane); |
|
5020 } |
|
5021 #endif //RD_SCALABLE_UI_V2 |
|
5022 void CAknFepManager::DynInitMenuPaneL(TInt aResourceId, CAknFepUiInterfaceMenuPane* aMenuPane) |
|
5023 { |
|
5024 if ( !iFepFullyConstructed ) |
|
5025 { |
|
5026 return; |
|
5027 } |
|
5028 |
|
5029 #ifdef __ITI_VIRTUAL_TOUCH_FIRST_GENERATION_SUPPORT__ |
|
5030 CAknEdwinState* editorState = NULL; |
|
5031 if (iInputCapabilities.FepAwareTextEditor()) |
|
5032 { |
|
5033 editorState = EditorState(); |
|
5034 } |
|
5035 |
|
5036 if (editorState) |
|
5037 { |
|
5038 iOptionsMenuBar = iUiInterface->EditorStateMenuBar(editorState); |
|
5039 } |
|
5040 #endif |
|
5041 |
|
5042 SetCcpuFlag(ECcpuStateIgnoreNextEdwinSyncEvent); |
|
5043 |
|
5044 if (iFepManState != EAknFepStateNull && |
|
5045 iInputCapabilities.FepAwareTextEditor() && |
|
5046 !(iAknEditorFlags & EAknEditorFlagFindPane)) |
|
5047 { |
|
5048 // 'Input language' menu item on option menu isn't supported in Japanese variant. |
|
5049 if (!IsFeatureSupportedJapanese()) |
|
5050 { |
|
5051 // Insert 'Input language' item to incoming menu if editor is active on screen and |
|
5052 // menu contains 'Help' or 'Exit' item. |
|
5053 //Also, no need for writing language/ITI options in telephony's dialer |
|
5054 if ( (RProcess().SecureId().iId != KPhoneSecureId) && !IsOnlyNumericPermitted() ) |
|
5055 { |
|
5056 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
5057 //This method gets called multiple times - first before the help and exit |
|
5058 //commands are populated and finally after these items are added. |
|
5059 //So if we have already added the input options menu and/or writing language menu, |
|
5060 //remove it. It will get added again to the correct place with the below code. |
|
5061 //No need to handle following menu types here. |
|
5062 if ( !( R_AVKON_EDIT_MODE_MENU == aResourceId || |
|
5063 R_AKNFEP_PRED_INPUT_OPTIONS_SUBMENU == aResourceId || |
|
5064 R_AVKON_PREDICTIVE_TEXT_MENU_T9 == aResourceId || |
|
5065 R_AVKON_INPUT_MODE_SUB_MENU == aResourceId || |
|
5066 R_AKNFEP_EDIT_SUBMENU == aResourceId || |
|
5067 R_AVKON_TOUCH_TOUCHINPUT_MENU == aResourceId ) |
|
5068 // Add this condition for adding "input options" into the option menu of FSQ. |
|
5069 || ( R_AVKON_TOUCH_TOUCHINPUT_MENU == aResourceId |
|
5070 && iFepPluginManager |
|
5071 && iFepPluginManager->IsSupportITIOnFSQ() ) |
|
5072 ) |
|
5073 { |
|
5074 FindAndRemoveInputOptionsMenuItemL( aMenuPane ); |
|
5075 FindAndRemoveEditSubMenuItemL (aMenuPane); |
|
5076 AddInputOptionsMenuItemL( aMenuPane ); |
|
5077 } |
|
5078 #else |
|
5079 TInt helpIndex; |
|
5080 if ( aMenuPane->MenuItemExists(EAknCmdHelp, helpIndex) || |
|
5081 aMenuPane->MenuItemExists(EAknCmdExit, helpIndex) ) |
|
5082 { |
|
5083 AddInputLanguageItemL(aMenuPane, helpIndex); |
|
5084 } |
|
5085 |
|
5086 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
5087 } |
|
5088 } |
|
5089 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
5090 if ( IsChineseInputLanguage() && |
|
5091 ( iKeyboardType == EPtiKeyboardQwerty4x10 || |
|
5092 iKeyboardType == EPtiKeyboardQwerty3x11 ) ) |
|
5093 { |
|
5094 // the follow added for phrase creation |
|
5095 TInt iptlanguage; |
|
5096 if ( !iIsUserdbdlgActive ) |
|
5097 { |
|
5098 aMenuPane->MenuItemExists( EAknCmdInputLanguage, iptlanguage ); |
|
5099 AddUserDBDlgItemL( aMenuPane, iptlanguage ); |
|
5100 } |
|
5101 } |
|
5102 #endif |
|
5103 |
|
5104 if (!(aResourceId == R_AVKON_EDIT_MODE_MENU || |
|
5105 aResourceId == R_AVKON_TOUCH_TOUCHINPUT_MENU || |
|
5106 aResourceId == R_AVKON_TOUCH_INDICATOR_EDIT_MODE_MENU)) |
|
5107 { |
|
5108 AddEditSubmenuL(aMenuPane); |
|
5109 } |
|
5110 } |
|
5111 |
|
5112 //HWR Hindi, Training application is not available, |
|
5113 //Disable Menu option |
|
5114 if(aResourceId == R_AVKON_TOUCH_TOUCHINPUT_MENU && |
|
5115 iLanguageCapabilities.iInputLanguageCode == ELangHindi) |
|
5116 { |
|
5117 aMenuPane->SetItemDimmed(EPenInputCmdHwrTraining, ETrue); |
|
5118 } |
|
5119 TInt index; |
|
5120 if(aMenuPane->MenuItemExists(EAknCmdEditItemPlaceHolder, index)) |
|
5121 { |
|
5122 aMenuPane->DeleteMenuItem(EAknCmdEditItemPlaceHolder); |
|
5123 } |
|
5124 #ifdef RD_SCALABLE_UI_V2 |
|
5125 TInt oldPermitModes = -1; |
|
5126 if (R_AVKON_TOUCH_TOUCHINPUT_MENU == aResourceId ) |
|
5127 { |
|
5128 oldPermitModes = iPermittedInputModes; |
|
5129 iPermittedInputModes = iFepPluginManager->PreviousPermitMode(); |
|
5130 } |
|
5131 |
|
5132 iFepPluginManager->InitMenuPaneL( iRememberEditorState, aMenuPane, aResourceId ); |
|
5133 if (oldPermitModes != -1) |
|
5134 { |
|
5135 iPermittedInputModes = oldPermitModes; |
|
5136 } |
|
5137 #endif // RD_SCALABLE_UI_V2 |
|
5138 switch (aResourceId) |
|
5139 { |
|
5140 case R_AVKON_TOUCHINPUT_PREVIEW: |
|
5141 { |
|
5142 InitPreviewMenuPane(aMenuPane); |
|
5143 } |
|
5144 break; |
|
5145 case R_AVKON_EDIT_MODE_MENU: |
|
5146 case R_AVKON_TOUCH_INDICATOR_EDIT_MODE_MENU: |
|
5147 { |
|
5148 ClearFlag(EFlagLaunchEditMenu); |
|
5149 |
|
5150 //call comes here when edit key or '*' is pressed and displays avkon edit menu |
|
5151 //moving only the essential condition checks in EditSubmenuInUse() here |
|
5152 //no need of checking iSharedDataInterface->EditSubmenuInUse() because for devices with edit key |
|
5153 //this would return 0 and would not populate CUT and COPY option |
|
5154 |
|
5155 TBool tempFlag = ETrue; |
|
5156 if ( ( ( RProcess().SecureId().iId == KPhoneSecureId ) && (iQwertyInputMode) ) || |
|
5157 ( ExtendedInputCapabilities() & |
|
5158 CAknExtendedInputCapabilities::EForceEditSubmenuStatusFlagOff) |
|
5159 |
|
5160 ) |
|
5161 { |
|
5162 tempFlag = EFalse; |
|
5163 } |
|
5164 |
|
5165 if (tempFlag) |
|
5166 { |
|
5167 TInt posit(0); |
|
5168 |
|
5169 if (!(iAknEditorFlags & EAknEditorFlagFindPane) && |
|
5170 iInputCapabilities.FepAwareTextEditor() && |
|
5171 aMenuPane->MenuItemExists(EEikCmdEditCut, posit) && |
|
5172 !IsOnlyNumericPermitted() |
|
5173 ) |
|
5174 { |
|
5175 if (iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep() > 0 ) |
|
5176 { |
|
5177 if (iRememberEditorState && iRememberEditorState->CcpuState() && |
|
5178 !iRememberEditorState->CcpuState()->CcpuCanCopy()&& |
|
5179 PluginInputMode() != EPluginInputModeItut ) |
|
5180 { |
|
5181 TBuf<KMaxFileName> titleStr; |
|
5182 StringLoader::Load(titleStr, R_AKNFEP_OPTIONS_EDIT_MENU_CUT_TEXT); |
|
5183 |
|
5184 CAknFepUiInterfaceMenuPane::SItemData itemData; |
|
5185 |
|
5186 itemData.iCommandId = EAknEditMenuCmdCutText; |
|
5187 itemData.iCascadeId = 0; |
|
5188 if (titleStr.Length()) |
|
5189 { |
|
5190 itemData.iText.Copy(titleStr.Mid(1, titleStr.Length() - 1)); |
|
5191 } |
|
5192 itemData.iFlags = 0; |
|
5193 aMenuPane->InsertMenuItemL(itemData, posit); |
|
5194 |
|
5195 titleStr.Zero(); |
|
5196 itemData.iText.Zero(); |
|
5197 StringLoader::Load(titleStr, R_AKNFEP_OPTIONS_EDIT_MENU_COPY_TEXT); |
|
5198 |
|
5199 itemData.iCommandId = EAknEditMenuCmdCopyText; |
|
5200 if (titleStr.Length()) |
|
5201 { |
|
5202 itemData.iText.Copy(titleStr.Mid(1, titleStr.Length() - 1)); |
|
5203 } |
|
5204 aMenuPane->InsertMenuItemL(itemData, posit); |
|
5205 } |
|
5206 else //Hack for browser in case there are some text already selected |
|
5207 { |
|
5208 if (iRememberEditorState && iRememberEditorState->CcpuState() ) |
|
5209 { |
|
5210 if(iRememberEditorState->CcpuState()->CcpuCanPaste()) |
|
5211 aMenuPane->SetItemDimmed(EEikCmdEditPaste,EFalse); |
|
5212 if(iRememberEditorState->CcpuState()->CcpuCanCopy()) |
|
5213 aMenuPane->SetItemDimmed(EEikCmdEditCopy,EFalse); |
|
5214 if(iRememberEditorState->CcpuState()->CcpuCanCut()) |
|
5215 aMenuPane->SetItemDimmed(EEikCmdEditCut,EFalse); |
|
5216 } |
|
5217 } |
|
5218 } |
|
5219 //if the document size is 0 and there are items in clipboard then dislay Paste item |
|
5220 if ( iRememberEditorState && iRememberEditorState->CcpuState() && |
|
5221 iRememberEditorState->CcpuState()->CcpuCanPaste()) |
|
5222 aMenuPane->SetItemDimmed(EEikCmdEditPaste,EFalse); |
|
5223 |
|
5224 } |
|
5225 |
|
5226 } |
|
5227 |
|
5228 DimInputmodeMenuItems(aMenuPane); |
|
5229 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
5230 //Is this an edit menu launched for a western language? |
|
5231 if ( R_AVKON_EDIT_MODE_MENU == aResourceId && !IsChineseInputLanguage() |
|
5232 && ELangJapanese != iLanguageCapabilities.iInputLanguageCode ) |
|
5233 { |
|
5234 //If this is edit menu (launched from '*' or edit key) and predictive input is allowed, |
|
5235 //we need to remove "Input language" and add "Input options" menu item. |
|
5236 if (!IsOnlyNumericPermitted() && IsLanguageSupportPrediction() && !(iAknEditorFlags & EAknEditorFlagNoT9)) |
|
5237 { |
|
5238 TInt menuitemPos(0); |
|
5239 if(aMenuPane->MenuItemExists(EAknCmdEditInsertSmiley,menuitemPos)) // insert after smiley if exist |
|
5240 { |
|
5241 AddPredictiveModeEditMenuL(aMenuPane,menuitemPos+1); |
|
5242 } |
|
5243 else if(aMenuPane->MenuItemExists(EAknCmdEditInsertSymbol,menuitemPos)) // insert after smybol if exist |
|
5244 { |
|
5245 AddPredictiveModeEditMenuL(aMenuPane,menuitemPos+1); |
|
5246 } |
|
5247 } |
|
5248 } |
|
5249 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
5250 |
|
5251 } |
|
5252 break; |
|
5253 |
|
5254 case R_AVKON_PREDICTIVE_TEXT_MENU_T9: |
|
5255 { |
|
5256 if (iMode != ELatin) |
|
5257 { |
|
5258 aMenuPane->SetItemDimmed(EAknCmdT9PredictiveInsertWord, ETrue); |
|
5259 } |
|
5260 if (!IsFlagSet(EFlagInlineEditInBackground)) |
|
5261 { |
|
5262 aMenuPane->SetItemDimmed(EAknCmdT9PredictiveMatches, ETrue); |
|
5263 aMenuPane->SetItemDimmed(EAknCmdT9PredictiveEditWord, ETrue); |
|
5264 } |
|
5265 else if (IsFlagSet(EFlagRemoveMatchesMenuItem)) |
|
5266 { |
|
5267 aMenuPane->SetItemDimmed(EAknCmdT9PredictiveMatches, ETrue); |
|
5268 } |
|
5269 break; |
|
5270 } |
|
5271 case R_AVKON_INPUT_MODE_SUB_MENU: |
|
5272 { |
|
5273 if (IsChineseInputLanguage()) |
|
5274 { |
|
5275 DoChineseSubMenu(aMenuPane); |
|
5276 } |
|
5277 break; |
|
5278 case R_AKNFEP_EDIT_SUBMENU: |
|
5279 DisableEditSubmenuItems(aMenuPane); |
|
5280 break; |
|
5281 } |
|
5282 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
5283 // Predictive QWERTY (XT9) changes ----> |
|
5284 case R_AKNFEP_PRED_INPUT_OPTIONS_SUBMENU: |
|
5285 { |
|
5286 // This part of code fixing TSW Errors :STAA-7GZE5W |
|
5287 // :STAA-7GZEBX |
|
5288 // "Edit word" option is not available under edit menu in ITU-T mode. |
|
5289 // "Insert word" Should not be available QWERTY mode. |
|
5290 //TSW: AKSS-7P87XG |
|
5291 //TSW: AKSS-7P88Wf |
|
5292 if (IsKoreanInputLanguage() || |
|
5293 iPtiEngine->CurrentLanguage()->LanguageCode() == ELangPrcChinese || |
|
5294 iPtiEngine->CurrentLanguage()->LanguageCode() == ELangTaiwanChinese || |
|
5295 iPtiEngine->CurrentLanguage()->LanguageCode() == ELangHongKongChinese ) |
|
5296 { |
|
5297 // No text prediction for korean. |
|
5298 aMenuPane->SetItemDimmed(EAknFepCmdPredActivate, ETrue ); |
|
5299 aMenuPane->SetItemDimmed(EAknFepCmdPredDeactivate,ETrue ); |
|
5300 aMenuPane->SetItemDimmed( EAknFepCmdPredSettings, ETrue ); |
|
5301 } |
|
5302 else |
|
5303 { |
|
5304 aMenuPane->SetItemDimmed( EAknFepCmdPredSettings, EFalse ); |
|
5305 if(iSharedDataInterface->PredictiveTextOn()) |
|
5306 { |
|
5307 aMenuPane->SetItemDimmed( EAknFepCmdPredActivate, ETrue ); |
|
5308 } |
|
5309 else |
|
5310 { |
|
5311 aMenuPane->SetItemDimmed(EAknFepCmdPredDeactivate,ETrue ); |
|
5312 } |
|
5313 } |
|
5314 } |
|
5315 break; |
|
5316 |
|
5317 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
5318 default: |
|
5319 break; |
|
5320 } |
|
5321 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
5322 /* |
|
5323 This code is the part of fixing TSW Error ID: BSAN-7G58DB : Edit Menu : |
|
5324 "Matches" and "insert word" options are not available under Edit Menu. |
|
5325 This is To make visible/invisible the Insert Word in Optios menu & Edit Menu*/ |
|
5326 iIsLastResourceEditMenu = aResourceId; |
|
5327 #endif |
|
5328 } |
|
5329 |
|
5330 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
5331 void CAknFepManager::FindAndRemoveInputOptionsMenuItemL( CAknFepUiInterfaceMenuPane* aMenuPane ) |
|
5332 { |
|
5333 //Logic : |
|
5334 //Loop through each item in menu pane and check if the data |
|
5335 //CEikMenuPaneItem::SData::iCascadeId == R_AKNFEP_PRED_INPUT_OPTIONS_SUBMENU |
|
5336 //or if CEikMenuPaneItem::SData::iCommandId == EAknCmdInputLanguage |
|
5337 //If so, delete that item. |
|
5338 TInt numOfMenuItems = aMenuPane->NumberOfItemsInPane(); |
|
5339 CEikMenuPane* menuPane = aMenuPane->GetMenuPane(); |
|
5340 for (TInt index(0); index < numOfMenuItems ; ++index ) |
|
5341 { |
|
5342 CEikMenuPaneItem::SData itemData = menuPane->ItemDataByIndexL( index ); |
|
5343 if ( itemData.iCascadeId == R_AKNFEP_PRED_INPUT_OPTIONS_SUBMENU || |
|
5344 itemData.iCommandId == EAknCmdInputLanguage || |
|
5345 itemData.iCascadeId == R_AVKON_INPUT_MODE_SUB_MENU || |
|
5346 ( IsChineseInputLanguage() && iSharedDataInterface->QwertyInputMode() && |
|
5347 itemData.iCommandId == EChinFepCmdModeCangJieOption ) ) |
|
5348 { |
|
5349 menuPane->DeleteBetweenMenuItems( index, index ); |
|
5350 //Assumption - there can only be one such item in the menu pane |
|
5351 //Hence we can return without going through the remaining items |
|
5352 numOfMenuItems = aMenuPane->NumberOfItemsInPane(); |
|
5353 index--; |
|
5354 } |
|
5355 } |
|
5356 } |
|
5357 |
|
5358 void CAknFepManager::FindAndRemoveEditSubMenuItemL( CAknFepUiInterfaceMenuPane* aMenuPane ) |
|
5359 { |
|
5360 //Logic : |
|
5361 //Loop through each item in menu pane and check if the data |
|
5362 //CEikMenuPaneItem::SData::iCascadeId == R_AKNFEP_EDIT_SUBMENU |
|
5363 //If so, delete that item. |
|
5364 TInt numOfMenuItems = aMenuPane->NumberOfItemsInPane(); |
|
5365 CEikMenuPane* menuPane = aMenuPane->GetMenuPane(); |
|
5366 for (TInt index(0); index < numOfMenuItems ; ++index ) |
|
5367 { |
|
5368 CEikMenuPaneItem::SData itemData = menuPane->ItemDataByIndexL( index ); |
|
5369 if ( itemData.iCascadeId == R_AKNFEP_EDIT_SUBMENU ) |
|
5370 { |
|
5371 menuPane->DeleteBetweenMenuItems( index, index ); |
|
5372 //Assumption - there can only be one such item in the menu pane |
|
5373 //Hence we can return without going through the remaining items |
|
5374 return; |
|
5375 } |
|
5376 } |
|
5377 } |
|
5378 |
|
5379 void CAknFepManager::AddInputOptionsMenuItemL( CAknFepUiInterfaceMenuPane* aMenuPane ) |
|
5380 { |
|
5381 //Logic: |
|
5382 //Appropriate location is : |
|
5383 // if Avkon Help command exists, then immediately above it |
|
5384 // else if Avkon Exit command exists, then immediately above it |
|
5385 // else if there are 3 or more items in the Options menu, then 3rd from last |
|
5386 // else it is the last item. |
|
5387 TInt posToInsertItem( 0 ); |
|
5388 //MenuItemExists() will return the index of the item in 2nd parameter |
|
5389 //But if item is not found, it is returning the total number of items. |
|
5390 if ( ( aMenuPane->MenuItemExists(EAknCmdHelp, posToInsertItem) ) || |
|
5391 ( aMenuPane->MenuItemExists(EAknCmdExit, posToInsertItem) ) ) |
|
5392 { |
|
5393 //do nothing - we already have posToInsertItem with required value |
|
5394 } |
|
5395 else |
|
5396 { |
|
5397 TInt numOfMenuItems = aMenuPane->NumberOfItemsInPane(); |
|
5398 if ( numOfMenuItems > 2 ) |
|
5399 { |
|
5400 //We should add the new item as third from last, after ignoring |
|
5401 //any dimmed items in the menu pane |
|
5402 TInt numOfUnDimmedItems(0); |
|
5403 //loop from bottom for better performance |
|
5404 for (TInt index(numOfMenuItems-1); index >= 0 ; --index ) |
|
5405 { |
|
5406 CEikMenuPaneItem::SData itemData = aMenuPane->GetMenuPane()->ItemDataByIndexL( index ); |
|
5407 if ( !(itemData.iFlags & EEikMenuItemDimmed) ) |
|
5408 { |
|
5409 ++numOfUnDimmedItems; |
|
5410 } |
|
5411 if ( numOfUnDimmedItems == 2 ) |
|
5412 { |
|
5413 //We have our position - save it and break from this loop |
|
5414 if ( index > 1 ) |
|
5415 { |
|
5416 posToInsertItem = index; |
|
5417 } |
|
5418 else |
|
5419 { |
|
5420 //There are two or less items on this menu that will be displayed |
|
5421 //Hence, push ITI options to the end of the list: |
|
5422 posToInsertItem = numOfMenuItems; |
|
5423 } |
|
5424 break; |
|
5425 } |
|
5426 } |
|
5427 } |
|
5428 else |
|
5429 { |
|
5430 posToInsertItem = numOfMenuItems; |
|
5431 } |
|
5432 } |
|
5433 //Now we have the position at which we need to insert the menu item. |
|
5434 if ( |
|
5435 #ifdef __ITI_VIRTUAL_TOUCH_FIRST_GENERATION_SUPPORT__ |
|
5436 iQwertyInputMode && |
|
5437 #endif |
|
5438 IsLanguageSupportPrediction() && !(iAknEditorFlags & EAknEditorFlagNoT9)) |
|
5439 { |
|
5440 AddPredictiveModeOptionsL(aMenuPane, posToInsertItem); |
|
5441 } |
|
5442 else |
|
5443 { |
|
5444 AddInputLanguageItemL(aMenuPane, posToInsertItem); |
|
5445 } |
|
5446 } |
|
5447 #endif // RD_INTELLIGENT_TEXT_INPUT |
|
5448 |
|
5449 |
|
5450 void CAknFepManager::AddEditSubmenuL(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
5451 { |
|
5452 // Adds edit-submenu to options menu when required contidions are met. |
|
5453 // Edit-submenu is added if: |
|
5454 // 1. There is active editor on screen |
|
5455 // 2. Editor contains text or there is text in clipboard. |
|
5456 // 3. Editor is not in Find Pane. |
|
5457 // |
|
5458 // Since menu will have focus, we also need to remeber certain values |
|
5459 // to be able to access undelying editor attributes. |
|
5460 |
|
5461 CAknEdwinState* editorState = EditorState(); |
|
5462 iEditorCcpuStatus = 0; |
|
5463 if (editorState && editorState->CcpuState()) |
|
5464 { |
|
5465 iEditorCcpuStatus = EditorCcpuStatus(editorState); |
|
5466 } |
|
5467 else |
|
5468 { |
|
5469 // The editor doesn't have ccpu-capability, doen't display the menu. |
|
5470 return; |
|
5471 } |
|
5472 TInt index; |
|
5473 if (aMenuPane->MenuItemExists(EAknCmdEditTextMenu, index)) |
|
5474 { |
|
5475 return; |
|
5476 } |
|
5477 |
|
5478 iRememberLength = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
5479 |
|
5480 if (iRememberLength > 0 || (iEditorCcpuStatus & ECcpuStatusFlagCanPaste)) |
|
5481 { |
|
5482 if (aMenuPane->MenuItemExists(EAknCmdEditItemPlaceHolder, index) || |
|
5483 aMenuPane->MenuItemExists(EAknCmdInputLanguage, index) || |
|
5484 aMenuPane->MenuItemExists(EAknCmdHelp, index) || |
|
5485 aMenuPane->MenuItemExists(EAknCmdExit, index)) |
|
5486 { |
|
5487 TBuf<KMaxFileName> titleStr; |
|
5488 StringLoader::Load(titleStr, R_AKNFEP_OPTIONS_EDIT_SUBMENU_TITLE); |
|
5489 |
|
5490 CAknFepUiInterfaceMenuPane::SItemData mData; |
|
5491 |
|
5492 mData.iCommandId = EAknCmdEditTextMenu; |
|
5493 mData.iCascadeId = R_AKNFEP_EDIT_SUBMENU; |
|
5494 mData.iFlags = 0; |
|
5495 mData.iText.Copy(titleStr.Mid(1, titleStr.Length() - 1).Left( |
|
5496 CAknFepUiInterfaceMenuPane::SItemData::ENominalTextLength)); |
|
5497 |
|
5498 aMenuPane->InsertMenuItemL(mData, index); |
|
5499 |
|
5500 if(aMenuPane->MenuItemExists(EAknCmdEditItemPlaceHolder, index)) |
|
5501 { |
|
5502 aMenuPane->DeleteMenuItem(EAknCmdEditItemPlaceHolder); |
|
5503 |
|
5504 } |
|
5505 // Remember editor state, because there is no access to it while |
|
5506 // menu is on screen. |
|
5507 iRememberEditorState = editorState; |
|
5508 } |
|
5509 } |
|
5510 } |
|
5511 |
|
5512 |
|
5513 void CAknFepManager::DisableEditSubmenuItems(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
5514 { |
|
5515 aMenuPane->SetItemDimmed(EAknEditMenuCmdCopyText, ETrue); |
|
5516 aMenuPane->SetItemDimmed(EEikCmdEditCopy, ETrue); |
|
5517 aMenuPane->SetItemDimmed(EAknEditMenuCmdCutText, ETrue); |
|
5518 aMenuPane->SetItemDimmed(EEikCmdEditCut, ETrue); |
|
5519 aMenuPane->SetItemDimmed(EEikCmdEditPaste, ETrue); |
|
5520 |
|
5521 if (iRememberLength > 0) |
|
5522 { |
|
5523 if (iEditorCcpuStatus & ECcpuStatusFlagCanCopy) |
|
5524 { |
|
5525 aMenuPane->SetItemDimmed(EEikCmdEditCopy, EFalse); |
|
5526 } |
|
5527 else |
|
5528 { |
|
5529 aMenuPane->SetItemDimmed(EAknEditMenuCmdCopyText, EFalse); |
|
5530 } |
|
5531 |
|
5532 if (iEditorCcpuStatus & ECcpuStatusFlagCanCut) |
|
5533 { |
|
5534 aMenuPane->SetItemDimmed(EEikCmdEditCut, EFalse); |
|
5535 } |
|
5536 else |
|
5537 { |
|
5538 aMenuPane->SetItemDimmed(EAknEditMenuCmdCutText, EFalse); |
|
5539 } |
|
5540 } |
|
5541 |
|
5542 if (iEditorCcpuStatus & ECcpuStatusFlagCanPaste) |
|
5543 { |
|
5544 aMenuPane->SetItemDimmed(EEikCmdEditPaste, EFalse); |
|
5545 } |
|
5546 } |
|
5547 |
|
5548 |
|
5549 void CAknFepManager::StartCcpuModeL(TBool aCopyMode) |
|
5550 { |
|
5551 ResetCcpuFlags(); |
|
5552 if (!iUiInterface->SoftkeysExist()) |
|
5553 { |
|
5554 iUiInterface->CreateSoftkeys(R_AVKON_SOFTKEYS_EMPTY, this); |
|
5555 } |
|
5556 |
|
5557 TBool update = EFalse; |
|
5558 if (aCopyMode) |
|
5559 { |
|
5560 SetCcpuFlag(ECcpuStateStartCopy); |
|
5561 update = UpdateCBALabelL(ELeftSoftkeyIndex, EAknFepSoftkeyStartCopy, |
|
5562 R_AKNFEP_SOFTKEY_CCPU_START); |
|
5563 update |= UpdateCBALabelL( EMiddleSoftkeyIndex, EAknFepSoftkeyStartCopy, |
|
5564 R_AVKON_SOFTKEY_SELECT_TEXT ); |
|
5565 } |
|
5566 else |
|
5567 { |
|
5568 SetCcpuFlag(ECcpuStateStartCut); |
|
5569 update = UpdateCBALabelL(ELeftSoftkeyIndex, EAknFepSoftkeyStartCut, |
|
5570 R_AKNFEP_SOFTKEY_CCPU_START); |
|
5571 update |= UpdateCBALabelL( EMiddleSoftkeyIndex, EAknFepSoftkeyStartCut, |
|
5572 R_AVKON_SOFTKEY_SELECT_TEXT ); |
|
5573 } |
|
5574 |
|
5575 update |= UpdateCBALabelL(ERightSoftkeyIndex, EAknFepSoftkeyCloseWindow, |
|
5576 R_AKNFEP_SOFTKEY_CCPU_CANCEL); |
|
5577 |
|
5578 if (update) |
|
5579 { |
|
5580 iUiInterface->DrawSoftkeysNow(); |
|
5581 } |
|
5582 |
|
5583 iIndicator->SetCopyMode(ETrue); |
|
5584 UpdateIndicators(); // updates status of indicators |
|
5585 } |
|
5586 |
|
5587 |
|
5588 TBool CAknFepManager::OkToActivateSelectionMode() const |
|
5589 { |
|
5590 if (iFepManState != EAknFepStateNull && |
|
5591 iInputCapabilities.FepAwareTextEditor() && |
|
5592 !(iAknEditorFlags & EAknEditorFlagFindPane)) |
|
5593 { |
|
5594 return ETrue; |
|
5595 } |
|
5596 |
|
5597 return EFalse; |
|
5598 } |
|
5599 |
|
5600 |
|
5601 TBool CAknFepManager::HandleCcpuModeKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aEventCode, |
|
5602 TKeyResponse& aRetCode, TBool aLongPressFlag) |
|
5603 { |
|
5604 TKeyPressLength length = aKeyEvent.iRepeats ? ELongKeyPress : EShortKeyPress; |
|
5605 TBool indicLang = TAknFepUiIndicInputManager :: IsIndicLangauge(TLanguage( |
|
5606 iLanguageCapabilities.iInputLanguageCode)) |
|
5607 #ifdef RD_HINDI_PHONETIC_INPUT |
|
5608 || TAknFepUiIndicInputManager :: IsIndicPhoneticLanguage(TLanguage( |
|
5609 iLanguageCapabilities.iInputLanguageCode)) |
|
5610 #endif |
|
5611 ; |
|
5612 if(aKeyEvent.iCode == EKeyEscape) |
|
5613 return EFalse; |
|
5614 if (aEventCode == EEventKey && aKeyEvent.iCode == '*') |
|
5615 { |
|
5616 iStarScan = aKeyEvent.iScanCode; |
|
5617 } |
|
5618 |
|
5619 if ((aKeyEvent.iScanCode == EStdKeyDevice0) |
|
5620 || (aKeyEvent.iScanCode == EStdKeyDevice1)) |
|
5621 { |
|
5622 if (HashKeySelectionInUse() |
|
5623 && IsCcpuFlagSet(ECcpuStateHashDown)) |
|
5624 { |
|
5625 if (IsCcpuFlagSet(ECcpuStateChangeToPredictionMode)) |
|
5626 { |
|
5627 ClearCcpuFlag(ECcpuStateChangeToPredictionMode); |
|
5628 if (iModeBefore == ELatin |
|
5629 || iModeBefore == EHiraganaKanji) |
|
5630 { |
|
5631 TBool preFlag = IsPredictive(); |
|
5632 TryChangePredictiveInputModeL(!preFlag); |
|
5633 } |
|
5634 else |
|
5635 { |
|
5636 TryChangeToModeBeforeL(); |
|
5637 } |
|
5638 } |
|
5639 } |
|
5640 // Always let sofkeys fall through. |
|
5641 return EFalse; |
|
5642 } |
|
5643 |
|
5644 if (IsCcpuFlagSet(ECcpuStateSelectionEventPosted)) |
|
5645 { |
|
5646 ClearCcpuFlag(ECcpuStateSelectionEventPosted); |
|
5647 return EFalse; |
|
5648 } |
|
5649 |
|
5650 if (HashKeySelectionInUse()) |
|
5651 { |
|
5652 if (aKeyEvent.iScanCode == EStdKeyHash && aEventCode == EEventKeyDown |
|
5653 && iInputCapabilities.FepAwareTextEditor()) |
|
5654 { |
|
5655 SetCcpuFlag(ECcpuStateHashDown); |
|
5656 iHashKeyMan->ResetPreviousSelectionStyleMode(); |
|
5657 return EFalse; |
|
5658 } |
|
5659 |
|
5660 if (!IsOnlyNumericPermitted()) |
|
5661 { |
|
5662 if (IsFeatureSupportedJapanese()) |
|
5663 { |
|
5664 if (FepUI()->IsValidShiftKeyPress() |
|
5665 && aKeyEvent.iScanCode == iStarScan |
|
5666 && !iQwertyInputMode |
|
5667 && !(iMode == EKatakana && iFepManState == EAknFepStateUIActive)) |
|
5668 { |
|
5669 if ( aEventCode == EEventKeyUp && !aLongPressFlag |
|
5670 && !(iMode == ELatin && WesternPredictive() |
|
5671 && iFepManState == EAknFepStateUIActive)) |
|
5672 { |
|
5673 if (!IsCcpuFlagSet(ECcpuStateIgnoreStarUp)) |
|
5674 { |
|
5675 LaunchSpecialCharacterTableL(); |
|
5676 } |
|
5677 return EFalse; |
|
5678 } |
|
5679 else if ( aEventCode == EEventKey |
|
5680 && !aLongPressFlag |
|
5681 && length == ELongKeyPress ) |
|
5682 { |
|
5683 LaunchSelectModeMenuL(); |
|
5684 aRetCode = EKeyWasConsumed; |
|
5685 return ETrue; |
|
5686 } |
|
5687 } |
|
5688 } |
|
5689 else |
|
5690 { |
|
5691 if ((aKeyEvent.iScanCode == iStarScan && aEventCode == EEventKeyUp && |
|
5692 !aLongPressFlag && !iQwertyInputMode) && |
|
5693 (!indicLang || WesternPredictive() || (iMode == ENumber || iMode == ENativeNumber) )) |
|
5694 { |
|
5695 // Disables *-key on korean multitapping mode |
|
5696 if(IsKoreanInputLanguage() && iMode == EHangul) |
|
5697 { |
|
5698 SetCcpuFlag(ECcpuStateIgnoreStarUp); |
|
5699 } |
|
5700 |
|
5701 if (!IsCcpuFlagSet(ECcpuStateIgnoreStarUp)) |
|
5702 { |
|
5703 #ifdef RD_SCALABLE_UI_V2 |
|
5704 if (iFepPluginManager->CurrentFepInputUI()) |
|
5705 { |
|
5706 if (iFepPluginManager->CurrentFepInputUI()->HandleKeyL(EStdKeyNull, EShortKeyPress)) |
|
5707 { |
|
5708 return EFalse; |
|
5709 } |
|
5710 } |
|
5711 #endif |
|
5712 LaunchSelectModeMenuL(); |
|
5713 aRetCode = EKeyWasConsumed; |
|
5714 return ETrue; |
|
5715 } |
|
5716 return EFalse; |
|
5717 } |
|
5718 else if((aKeyEvent.iScanCode == iStarScan && aEventCode == EEventKey |
|
5719 && !aLongPressFlag && !iQwertyInputMode) |
|
5720 && (indicLang) |
|
5721 && (! WesternPredictive()) |
|
5722 && (length == ELongKeyPress) |
|
5723 && (iMode != ENumber && iMode != ENativeNumber )) |
|
5724 { |
|
5725 LaunchSelectModeMenuL(); |
|
5726 return EFalse; |
|
5727 } |
|
5728 } |
|
5729 } |
|
5730 } |
|
5731 |
|
5732 if (IsCcpuFlagSet(ECcpuStateHashDown)) |
|
5733 { |
|
5734 if (aEventCode == EEventKey) |
|
5735 { |
|
5736 if (aKeyEvent.iScanCode == EStdKeyDownArrow |
|
5737 || aKeyEvent.iScanCode == EStdKeyRightArrow |
|
5738 || aKeyEvent.iScanCode == EStdKeyLeftArrow |
|
5739 || aKeyEvent.iScanCode == EStdKeyUpArrow) |
|
5740 { |
|
5741 if (IsFlagSet(EFlagInsideInlineEditingTransaction) && iMode == EHangul) |
|
5742 { |
|
5743 CommitInlineEditL(); |
|
5744 iPtiEngine->ClearCurrentWord(); |
|
5745 } |
|
5746 |
|
5747 if ((IsCcpuFlagSet(ECcpuStateStartCopy)) || |
|
5748 (IsCcpuFlagSet(ECcpuStateStartCut))) |
|
5749 { |
|
5750 aRetCode = EKeyWasConsumed; |
|
5751 return ETrue; |
|
5752 } |
|
5753 |
|
5754 if (!IsCcpuFlagSet(ECcpuStateEdwinInSelectionMode)) |
|
5755 { |
|
5756 // User wants to select and not to change mode, so cancel the mode change |
|
5757 // caused by initial hash key press. |
|
5758 if(!(iAknEditorFlags & EAknEditorFlagFindPane)) |
|
5759 { |
|
5760 iHashKeyMan->SetPreviousSelectionStyleModeL(); |
|
5761 SetCcpuFlag(ECcpuStateEdwinInSelectionMode); |
|
5762 TKeyEvent ccpuStart = {EKeyF21, EStdKeyF21, 0, 0}; |
|
5763 // to enable copy/paste support on cba. We simulate via CCoeEnv |
|
5764 // to avoid fep SimulateKeyEventL adding shift modifiers |
|
5765 CCoeEnv::Static()->SimulateKeyEventL(ccpuStart, EEventKey); |
|
5766 } |
|
5767 } |
|
5768 |
|
5769 // If prediction is changed while pressing hash-key, |
|
5770 // it go back previous prediction state. |
|
5771 if (IsCcpuFlagSet(ECcpuStateChangeToPredictionMode)) |
|
5772 { |
|
5773 ClearCcpuFlag(ECcpuStateChangeToPredictionMode); |
|
5774 if (iModeBefore == ELatin |
|
5775 || iModeBefore == EHiraganaKanji) |
|
5776 { |
|
5777 TBool preFlag = IsPredictive(); |
|
5778 TryChangePredictiveInputModeL(!preFlag); |
|
5779 } |
|
5780 else |
|
5781 { |
|
5782 TryChangeToModeBeforeL(); |
|
5783 } |
|
5784 } |
|
5785 |
|
5786 if (WesternPredictive() && IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
5787 { |
|
5788 // This will commit inline edit if it is active for predictive mode. |
|
5789 return EFalse; |
|
5790 } |
|
5791 |
|
5792 aRetCode = EKeyWasNotConsumed; |
|
5793 return ETrue; |
|
5794 } |
|
5795 else if (aKeyEvent.iScanCode == EStdKeyBackspace) |
|
5796 { |
|
5797 if (!(aKeyEvent.iModifiers & EStdKeyLeftShift)) |
|
5798 { |
|
5799 // Simulate edit key + clear key functionality via hash key in no-edit-key device. |
|
5800 TKeyEvent ccpuStart = {127, EStdKeyBackspace, EStdKeyLeftShift, 0}; |
|
5801 CCoeEnv::Static()->SimulateKeyEventL(ccpuStart, aEventCode); |
|
5802 |
|
5803 aRetCode = EKeyWasConsumed; |
|
5804 return ETrue; |
|
5805 } |
|
5806 else if (!IsCcpuFlagSet(ECcpuStateHashKeyDeleteDone)) |
|
5807 { |
|
5808 // Hash key + clear key was pressed, but hash key was released before |
|
5809 // changing to selection mode. Need to return to previous mode, because |
|
5810 // user didn't want to change input mode. |
|
5811 iHashKeyMan->SetPreviousSelectionStyleModeL(); |
|
5812 SetCcpuFlag(ECcpuStateHashKeyDeleteDone); |
|
5813 } |
|
5814 |
|
5815 // If prediction is changed while pressing hash-key, |
|
5816 // it go back previous prediction state. |
|
5817 if (IsCcpuFlagSet(ECcpuStateChangeToPredictionMode)) |
|
5818 { |
|
5819 ClearCcpuFlag(ECcpuStateChangeToPredictionMode); |
|
5820 if (iModeBefore == ELatin |
|
5821 || iModeBefore == EHiraganaKanji) |
|
5822 { |
|
5823 TBool preFlag = IsPredictive(); |
|
5824 TryChangePredictiveInputModeL(!preFlag); |
|
5825 } |
|
5826 else |
|
5827 { |
|
5828 TryChangeToModeBeforeL(); |
|
5829 } |
|
5830 } |
|
5831 |
|
5832 } |
|
5833 } |
|
5834 else if (aKeyEvent.iScanCode == EStdKeyHash && aEventCode == EEventKeyUp) |
|
5835 { |
|
5836 ClearCcpuFlag(ECcpuStateHashDown |
|
5837 | ECcpuStateHashKeyDeleteDone |
|
5838 | ECcpuStateChangeToPredictionMode); |
|
5839 if (IsCcpuFlagSet(ECcpuStateEdwinInSelectionMode)) |
|
5840 { |
|
5841 SetCcpuFlag(ECcpuStateSelectionEventPosted); |
|
5842 ClearCcpuFlag(ECcpuStateEdwinInSelectionMode); |
|
5843 SetFlag(EFlagLongShiftKeyPress); |
|
5844 |
|
5845 TKeyEvent ccpuStart = {0, EStdKeyLeftShift, 0, 0}; |
|
5846 CCoeEnv::Static()->SimulateKeyEventL(ccpuStart, aEventCode); |
|
5847 } |
|
5848 |
|
5849 return EFalse; |
|
5850 } |
|
5851 } |
|
5852 |
|
5853 if (IsCcpuFlagSet(ECcpuStateStartCopy | ECcpuStateStartCut)) |
|
5854 { |
|
5855 if (aKeyEvent.iScanCode == EStdKeyDevice3 && aEventCode == EEventKey) |
|
5856 { |
|
5857 aRetCode = EKeyWasConsumed; |
|
5858 if (IsCcpuFlagSet(ECcpuStateStartCopy)) |
|
5859 { |
|
5860 ProcessCommandL(EAknFepSoftkeyStartCopy); |
|
5861 } |
|
5862 else |
|
5863 { |
|
5864 ProcessCommandL(EAknFepSoftkeyStartCut); |
|
5865 } |
|
5866 return ETrue; |
|
5867 } |
|
5868 else if (aKeyEvent.iScanCode < EStdKeyLeftArrow || |
|
5869 aKeyEvent.iScanCode > EStdKeyDownArrow) |
|
5870 { |
|
5871 aRetCode = EKeyWasConsumed; |
|
5872 return ETrue; |
|
5873 } |
|
5874 } |
|
5875 else if (IsCcpuFlagSet(ECcpuStateCopy | ECcpuStateCut)) |
|
5876 { |
|
5877 if ((aKeyEvent.iScanCode >= EStdKeyLeftArrow) && (aKeyEvent.iScanCode <= EStdKeyDownArrow)) |
|
5878 { |
|
5879 if (!(aKeyEvent.iModifiers & EModifierShift)) |
|
5880 { |
|
5881 TKeyEvent ccpuStart = aKeyEvent; |
|
5882 ccpuStart.iModifiers |= EModifierShift; |
|
5883 ccpuStart.iModifiers |= EModifierRightShift; |
|
5884 CCoeEnv::Static()->SimulateKeyEventL(ccpuStart, aEventCode); |
|
5885 |
|
5886 aRetCode = EKeyWasConsumed; |
|
5887 return ETrue; |
|
5888 } |
|
5889 else |
|
5890 { |
|
5891 aRetCode = EKeyWasNotConsumed; |
|
5892 return ETrue; |
|
5893 } |
|
5894 } |
|
5895 |
|
5896 TCursorSelection cursorSelection; |
|
5897 if( iInputCapabilities.FepAwareTextEditor() ) |
|
5898 { |
|
5899 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(cursorSelection); |
|
5900 if( (aEventCode == EEventKeyUp) && (cursorSelection.Length() == 0) |
|
5901 && ((aKeyEvent.iScanCode == EStdKeyBackspace) || (aKeyEvent.iCode == EKeyBackspace) |
|
5902 || (aKeyEvent.iScanCode == EStdKeyDelete) || (aKeyEvent.iCode == EKeyDelete))) |
|
5903 { |
|
5904 ClearCcpuFlag(ECcpuStateButton); |
|
5905 } |
|
5906 } |
|
5907 if (aKeyEvent.iScanCode != EStdKeyBackspace && aKeyEvent.iCode != EKeyOK) |
|
5908 { |
|
5909 aRetCode = EKeyWasConsumed; |
|
5910 return ETrue; |
|
5911 } |
|
5912 else |
|
5913 { |
|
5914 if (iInputCapabilities.FepAwareTextEditor()) |
|
5915 { |
|
5916 TCursorSelection cursorSelection; |
|
5917 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(cursorSelection); |
|
5918 if (cursorSelection.Length() == 0) |
|
5919 { |
|
5920 aRetCode = EKeyWasConsumed; |
|
5921 return ETrue; |
|
5922 } |
|
5923 else if (aKeyEvent.iScanCode == EStdKeyBackspace) |
|
5924 { |
|
5925 // Selection will be removed, handle cba button state accordingly |
|
5926 if (iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep() == |
|
5927 cursorSelection.Length()) |
|
5928 { |
|
5929 // Whole text was selected and will be removed. Cancel the ccpu mode. |
|
5930 ProcessCommandL(EAknFepSoftkeyCloseWindow); |
|
5931 } |
|
5932 else |
|
5933 { |
|
5934 // Part of the text will be removed. Set Cba-buttons to initial ccpu-mode status. |
|
5935 __ASSERT_DEBUG(iUiInterface->SoftkeysExist(), |
|
5936 AknFepPanic(EAknFepPanicNoHandleToFepAwareTextEditor)); |
|
5937 |
|
5938 TBool update = UpdateCBALabelL(ELeftSoftkeyIndex, KNullCommandId, R_TEXT_SOFTKEY_EMPTY); |
|
5939 update |= UpdateCBALabelL(ERightSoftkeyIndex, EAknFepSoftkeyCloseWindow, R_AKNFEP_SOFTKEY_CCPU_CANCEL); |
|
5940 update |= UpdateCBALabelL( EMiddleSoftkeyIndex, KNullCommandId, R_TEXT_SOFTKEY_EMPTY ); |
|
5941 if (update) |
|
5942 { |
|
5943 iUiInterface->DrawSoftkeysNow(); |
|
5944 } |
|
5945 } |
|
5946 } |
|
5947 } |
|
5948 } |
|
5949 } |
|
5950 |
|
5951 return EFalse; |
|
5952 } |
|
5953 |
|
5954 |
|
5955 |
|
5956 void CAknFepManager::AddInputLanguageItemL(CAknFepUiInterfaceMenuPane* aMenuPane, TInt aIndex) |
|
5957 { |
|
5958 CAknFepUiInterfaceMenuPane::SItemData mData; |
|
5959 |
|
5960 TBuf<KMaxFileName> langStr; |
|
5961 TInt Inputlangindex; |
|
5962 if(!aMenuPane->MenuItemExists(EAknCmdInputLanguage, Inputlangindex)) |
|
5963 { |
|
5964 StringLoader::Load(langStr, R_AKNFEP_OPTIONS_INPUT_LANGUAGE); |
|
5965 |
|
5966 mData.iCommandId = EAknCmdInputLanguage; |
|
5967 mData.iCascadeId = 0; |
|
5968 mData.iFlags = 0; |
|
5969 mData.iText.Copy(langStr.Mid(1, langStr.Length() - 1).Left(CAknFepUiInterfaceMenuPane::SItemData::ENominalTextLength)); |
|
5970 |
|
5971 aMenuPane->InsertMenuItemL(mData, aIndex); |
|
5972 } |
|
5973 |
|
5974 // Chinese input mode switching from the option menu |
|
5975 if (IsChineseInputLanguage() && iSharedDataInterface->QwertyInputMode()) |
|
5976 { |
|
5977 // Add Chinese language items |
|
5978 langStr.Zero(); |
|
5979 |
|
5980 StringLoader::Load(langStr, R_AKNFEP_OPTIONS_INPUT_MODE_CHI); |
|
5981 |
|
5982 mData.iCommandId = EAknCmdInputMethod; |
|
5983 mData.iCascadeId = R_AVKON_INPUT_MODE_SUB_MENU; |
|
5984 mData.iFlags = 0; |
|
5985 mData.iText.Copy(langStr.Mid(1, langStr.Length() - 1).Left(CAknFepUiInterfaceMenuPane::SItemData::ENominalTextLength)); |
|
5986 |
|
5987 aMenuPane->InsertMenuItemL(mData, ++aIndex); |
|
5988 |
|
5989 // Check if the current engine has CangJie feature or not, if not |
|
5990 // then CangJie mode becomes invisible, similar impl in IsInputModeAvailable |
|
5991 // and DoChineseSubMenu |
|
5992 TBool isCangJieSupported = EFalse; |
|
5993 MPtiCoreInfo* ptiCoreInfo = iPtiEngine->CoreInfo(EPtiEngineNormalCangjieQwerty); |
|
5994 if ( ptiCoreInfo ) |
|
5995 { |
|
5996 isCangJieSupported = ptiCoreInfo->CapsBits() & ESupportCangjieInput; |
|
5997 } |
|
5998 |
|
5999 // Add Hong Kong CangJie option, option available only in HK variant and qwerty mode |
|
6000 if ( iLanguageCapabilities.iInputLanguageCode == |
|
6001 ELangHongKongChinese && isCangJieSupported ) |
|
6002 { |
|
6003 langStr.Zero(); |
|
6004 |
|
6005 StringLoader::Load(langStr, R_AKNFEP_OPTIONS_CANGJIE_MODE); |
|
6006 |
|
6007 mData.iCommandId = EChinFepCmdModeCangJieOption; |
|
6008 mData.iCascadeId = 0; |
|
6009 mData.iFlags = 0; |
|
6010 mData.iText.Copy(langStr.Mid(1, langStr.Length() - 1).Left(CAknFepUiInterfaceMenuPane::SItemData::ENominalTextLength)); |
|
6011 |
|
6012 aMenuPane->InsertMenuItemL(mData, ++aIndex); |
|
6013 } |
|
6014 } |
|
6015 } |
|
6016 |
|
6017 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
6018 // Predictive QWERTY (XT9) changes ----> |
|
6019 void CAknFepManager::AddPredictiveModeOptionsL(CAknFepUiInterfaceMenuPane* aMenuPane, |
|
6020 TInt aIndex ) const |
|
6021 { |
|
6022 CAknFepUiInterfaceMenuPane::SItemData mData; |
|
6023 |
|
6024 HBufC* inputMenuStr = StringLoader::LoadLC(R_AKNFEP_PRED_OPTIONS_INPUT_OPTIONS); |
|
6025 |
|
6026 mData.iCommandId = 0; |
|
6027 mData.iCascadeId = R_AKNFEP_PRED_INPUT_OPTIONS_SUBMENU; |
|
6028 mData.iFlags = 0; |
|
6029 mData.iText.Copy(inputMenuStr->Left(CAknFepUiInterfaceMenuPane::SItemData::ENominalTextLength)); |
|
6030 |
|
6031 CleanupStack::PopAndDestroy(inputMenuStr); |
|
6032 |
|
6033 aMenuPane->InsertMenuItemL(mData, aIndex); |
|
6034 |
|
6035 // Chinese input mode switching from the option menu |
|
6036 if (IsChineseInputLanguage() && iSharedDataInterface->QwertyInputMode()) |
|
6037 { |
|
6038 // Add Chinese language items |
|
6039 TBuf<KMaxFileName> langStr; |
|
6040 |
|
6041 langStr.Zero(); |
|
6042 |
|
6043 StringLoader::Load(langStr, R_AKNFEP_OPTIONS_INPUT_MODE_CHI); |
|
6044 |
|
6045 mData.iCommandId = EAknCmdInputMethod; |
|
6046 mData.iCascadeId = R_AVKON_INPUT_MODE_SUB_MENU; |
|
6047 mData.iFlags = 0; |
|
6048 mData.iText.Copy(langStr.Mid(1, langStr.Length() - 1).Left(CAknFepUiInterfaceMenuPane::SItemData::ENominalTextLength)); |
|
6049 |
|
6050 aMenuPane->InsertMenuItemL(mData, ++aIndex); |
|
6051 |
|
6052 // Check if the current engine has CangJie feature or not, if not |
|
6053 // then CangJie mode becomes invisible, similar impl in IsInputModeAvailable |
|
6054 // and DoChineseSubMenu |
|
6055 TBool isCangJieSupported = EFalse; |
|
6056 MPtiCoreInfo* ptiCoreInfo = iPtiEngine->CoreInfo(EPtiEngineNormalCangjieQwerty); |
|
6057 if ( ptiCoreInfo != NULL) |
|
6058 { |
|
6059 isCangJieSupported = ptiCoreInfo->CapsBits() & ESupportCangjieInput; |
|
6060 } |
|
6061 #ifdef __HALF_QWERTY_KEYPAD |
|
6062 isCangJieSupported = isCangJieSupported && (iKeyboardType != EPtiKeyboardHalfQwerty); |
|
6063 #endif //__HALF_QWERTY_KEYPAD |
|
6064 |
|
6065 // Add Hong Kong CangJie option, option available only in HK variant and qwerty mode |
|
6066 if ( iLanguageCapabilities.iInputLanguageCode == ELangHongKongChinese && isCangJieSupported ) |
|
6067 { |
|
6068 langStr.Zero(); |
|
6069 |
|
6070 StringLoader::Load(langStr, R_AKNFEP_OPTIONS_CANGJIE_MODE); |
|
6071 |
|
6072 mData.iCommandId = EChinFepCmdModeCangJieOption; |
|
6073 mData.iCascadeId = 0; |
|
6074 mData.iFlags = 0; |
|
6075 mData.iText.Copy(langStr.Mid(1, langStr.Length() - 1).Left(CAknFepUiInterfaceMenuPane::SItemData::ENominalTextLength)); |
|
6076 |
|
6077 aMenuPane->InsertMenuItemL(mData, ++aIndex); |
|
6078 } |
|
6079 } |
|
6080 } |
|
6081 |
|
6082 void CAknFepManager::AddPredictiveModeEditMenuL(CAknFepUiInterfaceMenuPane* aMenuPane, |
|
6083 TInt aIndex ) const |
|
6084 { |
|
6085 // Remove Predictive Edit menu option if XT9 options are there ---> |
|
6086 aMenuPane->SetItemDimmed(EAknCmdPredictiveTextCascade, ETrue); |
|
6087 aMenuPane->SetItemDimmed(EAknCmdMultitapPredictiveT9On, ETrue); |
|
6088 // Remove Predictive Edit menu option if XT9 options are there <--- |
|
6089 //if current writing language supports prediction then display input options settings --> |
|
6090 //if current writing language does not supports prediction then display only input language |
|
6091 //option to modify the writing language, when user wants to modify when edit query is launched. <-- |
|
6092 TBool isLanguagugeSupportsPrediction = EFalse; |
|
6093 switch(iKeyboardType) |
|
6094 { |
|
6095 case EPtiKeyboardHalfQwerty: |
|
6096 #ifdef __HALF_QWERTY_KEYPAD |
|
6097 isLanguagugeSupportsPrediction = (iQwertyInputMode) & (iLanguageCapabilities.iSupportsWesternHalfQwertyPredictive); |
|
6098 #endif //__HALF_QWERTY_KEYPAD |
|
6099 break; |
|
6100 case EPtiKeyboardQwerty4x12: |
|
6101 case EPtiKeyboardQwerty4x10: |
|
6102 case EPtiKeyboardQwerty3x11: |
|
6103 case EPtiKeyboardCustomQwerty: |
|
6104 isLanguagugeSupportsPrediction = (iQwertyInputMode) & (iLanguageCapabilities.iSupportsWesternQwertyPredictive); |
|
6105 break; |
|
6106 case EPtiKeyboardNone: |
|
6107 case EPtiKeyboard12Key: |
|
6108 isLanguagugeSupportsPrediction = (!iQwertyInputMode) & (iLanguageCapabilities.iSupportsWesternPredictive); |
|
6109 break; |
|
6110 default: |
|
6111 isLanguagugeSupportsPrediction = (!iQwertyInputMode) & (iLanguageCapabilities.iSupportsWesternPredictive); |
|
6112 break; |
|
6113 } |
|
6114 if (isLanguagugeSupportsPrediction && !(iAknEditorFlags & EAknEditorFlagNoT9)) |
|
6115 { |
|
6116 aMenuPane->SetItemDimmed(EAknCmdInputLanguage, ETrue); |
|
6117 AddPredictiveModeOptionsL(aMenuPane, aIndex); |
|
6118 } |
|
6119 } |
|
6120 // Predictive QWERTY (XT9) changes <---- |
|
6121 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
6122 void CAknFepManager::DoChineseSubMenu(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
6123 { |
|
6124 // ZhuyinFind & StrokeFind ONLY available for FindEditors |
|
6125 if (iAknEditorFlags & EAknEditorFlagForceTransparentFepModes) |
|
6126 { |
|
6127 if (iMode == EZhuyinFind) |
|
6128 { |
|
6129 aMenuPane->SetItemDimmed(EChinFepCmdModeZhuyinFind, ETrue); |
|
6130 } |
|
6131 |
|
6132 if (iMode == EStrokeFind) |
|
6133 { |
|
6134 aMenuPane->SetItemDimmed(EChinFepCmdModeStrokeFind, ETrue); |
|
6135 } |
|
6136 } |
|
6137 else |
|
6138 { |
|
6139 aMenuPane->SetItemDimmed(EChinFepCmdModeZhuyinFind, ETrue); |
|
6140 aMenuPane->SetItemDimmed(EChinFepCmdModeStrokeFind, ETrue); |
|
6141 } |
|
6142 |
|
6143 // Customize menu item for Chinese mainland |
|
6144 if (iLanguageCapabilities.iInputLanguageCode == ELangPrcChinese) |
|
6145 { |
|
6146 aMenuPane->SetItemDimmed(EChinFepCmdModeCangJie, ETrue); |
|
6147 aMenuPane->SetItemDimmed(EChinFepCmdModeZhuyin, ETrue); |
|
6148 aMenuPane->SetItemDimmed(EChinFepCmdModeZhuyinFind, ETrue); |
|
6149 |
|
6150 if (iMode == EPinyin) |
|
6151 { |
|
6152 aMenuPane->SetItemDimmed(EChinFepCmdModePinyin, ETrue); |
|
6153 } |
|
6154 else if (iMode == EStroke) |
|
6155 { |
|
6156 aMenuPane->SetItemDimmed(EChinFepCmdModeStroke, ETrue); |
|
6157 } |
|
6158 else if (iMode == ELatin) |
|
6159 { |
|
6160 aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6161 } |
|
6162 else |
|
6163 return; |
|
6164 } |
|
6165 // Customize menu item for HongKong |
|
6166 else if (iLanguageCapabilities.iInputLanguageCode == ELangHongKongChinese) |
|
6167 { |
|
6168 aMenuPane->SetItemDimmed(EChinFepCmdModePinyin, ETrue); |
|
6169 aMenuPane->SetItemDimmed(EChinFepCmdModeZhuyin, ETrue); |
|
6170 aMenuPane->SetItemDimmed(EChinFepCmdModeZhuyinFind, ETrue); |
|
6171 |
|
6172 TBool isCangJieSupported = EFalse; |
|
6173 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
6174 if ( EPtiKeyboardQwerty3x11 == KeyboardLayout() ) |
|
6175 { |
|
6176 isCangJieSupported = ETrue; |
|
6177 } |
|
6178 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
6179 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
6180 #ifdef __HALF_QWERTY_KEYPAD |
|
6181 isCangJieSupported = isCangJieSupported && (iKeyboardType != EPtiKeyboardHalfQwerty); |
|
6182 #endif //__HALF_QWERTY_KEYPAD |
|
6183 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
6184 |
|
6185 // CangJie is only for qwerty mode |
|
6186 if ( !iSharedDataInterface->QwertyInputMode() || !isCangJieSupported ) |
|
6187 aMenuPane->SetItemDimmed(EChinFepCmdModeCangJie, ETrue); |
|
6188 |
|
6189 if (iMode == EStroke) |
|
6190 { |
|
6191 aMenuPane->SetItemDimmed(EChinFepCmdModeStroke, ETrue); |
|
6192 } |
|
6193 else if (iMode == ECangJie) |
|
6194 { |
|
6195 aMenuPane->SetItemDimmed(EChinFepCmdModeCangJie, ETrue); |
|
6196 } |
|
6197 else if (iMode == ELatin) |
|
6198 { |
|
6199 aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6200 } |
|
6201 else |
|
6202 return; |
|
6203 } |
|
6204 // Customize menu item for TaiWan |
|
6205 else if (iLanguageCapabilities.iInputLanguageCode == ELangTaiwanChinese) |
|
6206 { |
|
6207 aMenuPane->SetItemDimmed(EChinFepCmdModePinyin, ETrue); |
|
6208 aMenuPane->SetItemDimmed(EChinFepCmdModeCangJie, ETrue); |
|
6209 |
|
6210 if (iMode == EStroke) |
|
6211 { |
|
6212 aMenuPane->SetItemDimmed(EChinFepCmdModeStroke, ETrue); |
|
6213 } |
|
6214 else if (iMode == EZhuyin) |
|
6215 { |
|
6216 aMenuPane->SetItemDimmed(EChinFepCmdModeZhuyin, ETrue); |
|
6217 } |
|
6218 else if (iMode == ELatin) |
|
6219 { |
|
6220 aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6221 } |
|
6222 else |
|
6223 return; |
|
6224 } |
|
6225 else |
|
6226 return; |
|
6227 } |
|
6228 #ifdef RD_SCALABLE_UI_V2 |
|
6229 |
|
6230 void CAknFepManager::DoWesternTouchMenu(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
6231 { |
|
6232 const TInt inputLanguage = iLanguageCapabilities.iInputLanguageCode; |
|
6233 // if mode is already hangul or language is not korean dim korean mode menu item |
|
6234 TInt index; |
|
6235 |
|
6236 if( iMode == EHangul || inputLanguage != ELangKorean || !(IsModePermitted(EHangul))) |
|
6237 { |
|
6238 if ( aMenuPane->MenuItemExists( EAknCmdEditModeKorean, index) ) |
|
6239 { |
|
6240 aMenuPane->SetItemDimmed(EAknCmdEditModeKorean, ETrue); |
|
6241 } |
|
6242 } |
|
6243 else |
|
6244 { |
|
6245 if ( aMenuPane->MenuItemExists( EAknCmdEditModeKorean, index ) ) |
|
6246 { |
|
6247 aMenuPane->SetItemDimmed(EAknCmdEditModeKorean, EFalse); |
|
6248 } |
|
6249 } |
|
6250 // remove Chinese specific items from menu |
|
6251 aMenuPane->SetItemDimmed(EAknCmdEditModeAlpha, ETrue); |
|
6252 |
|
6253 if (aMenuPane->MenuItemExists(EJapanFepCmdModeUserDic, index)) |
|
6254 { |
|
6255 aMenuPane->SetItemDimmed(EJapanFepCmdModeUserDic, ETrue); |
|
6256 } |
|
6257 |
|
6258 // T9 stuff |
|
6259 if (WesternPredictive()) |
|
6260 { |
|
6261 aMenuPane->SetItemDimmed(EAknCmdPredictiveTextCascade, EFalse); |
|
6262 if(iPtiEngine->CurrentLanguage()->HasInputMode(EPtiEngineWordCompletion)) |
|
6263 { |
|
6264 // Disable Autoword Completion feature for Touch Input |
|
6265 #ifndef RD_SCALABLE_UI_V2 |
|
6266 aMenuPane->SetItemDimmed(EAknCmdPredictiveModeCascade, EFalse); |
|
6267 #endif // RD_SCALABLE_UI_V2 |
|
6268 } |
|
6269 |
|
6270 if (aMenuPane->MenuItemExists(EAknCmdT9PredictiveT9Off, index)) |
|
6271 { |
|
6272 aMenuPane->SetItemDimmed(EAknCmdT9PredictiveT9Off, EFalse); |
|
6273 } |
|
6274 } |
|
6275 else |
|
6276 { |
|
6277 if ( (iPermittedInputModes & EAknEditorTextInputMode) && |
|
6278 !(iAknEditorFlags & EAknEditorFlagNoT9) && |
|
6279 iMode == ELatin && |
|
6280 !IsKoreanInputLanguage() && |
|
6281 iLanguageCapabilities.iSupportsWesternPredictive) |
|
6282 { |
|
6283 aMenuPane->SetItemDimmed(EAknCmdMultitapPredictiveT9On, EFalse); |
|
6284 } |
|
6285 } |
|
6286 |
|
6287 if ( ( iMode == ENumber || iMode == ENativeNumber ) && |
|
6288 (iPermittedInputModes & (EAknEditorTextInputMode | EAknEditorSecretAlphaInputMode)) ) |
|
6289 { |
|
6290 aMenuPane->SetItemDimmed(EAknCmdEditModeAlpha, EFalse); |
|
6291 aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6292 aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); |
|
6293 aMenuPane->SetItemDimmed(EChinFepCmdModeLatinLower, ETrue); |
|
6294 if( iMode == EHangul || inputLanguage == ELangKorean) |
|
6295 { |
|
6296 TInt index; |
|
6297 if ( aMenuPane->MenuItemExists( EAknCmdEditModeKorean, index ) ) |
|
6298 { |
|
6299 aMenuPane->SetItemDimmed(EAknCmdEditModeKorean, EFalse); |
|
6300 } |
|
6301 } |
|
6302 } |
|
6303 |
|
6304 if ( IsModePermitted(ENumber) ) |
|
6305 { |
|
6306 if (( iMode != ENumber || |
|
6307 iMode == ENumber && iLanguageCapabilities.iArabicIndicDigitsAllowed && |
|
6308 !(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) && |
|
6309 (iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic)) |
|
6310 || ( iMode != ENumber || |
|
6311 iMode == ENumber && iLanguageCapabilities.iEasternArabicIndicDigitsAllowed && |
|
6312 !(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) && |
|
6313 (iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic)) |
|
6314 ||( iMode != ENumber || |
|
6315 iMode == ENumber && iLanguageCapabilities.iIndicDigitsAllowed && |
|
6316 !(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) && |
|
6317 (iLanguageCapabilities.iLocalDigitType == EDigitTypeDevanagari)) && |
|
6318 (!(iPermittedInputModes==EAknEditorNumericInputMode))) // hide the menu if number editor |
|
6319 |
|
6320 { |
|
6321 aMenuPane->SetItemDimmed(EAknCmdEditModeNumber, EFalse); |
|
6322 } |
|
6323 } |
|
6324 //modified by zhangfeiyan, fix bug SKIN-7LABJ3 |
|
6325 if ( IsModePermitted( ENativeNumber ) ) |
|
6326 { |
|
6327 if ( iLanguageCapabilities.iArabicIndicDigitsAllowed && |
|
6328 !(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) && |
|
6329 iMode != ENativeNumber ) |
|
6330 { |
|
6331 aMenuPane->SetItemDimmed(EAknCmdEditModeArabicIndicNumber, EFalse); |
|
6332 } |
|
6333 else if ( iLanguageCapabilities.iEasternArabicIndicDigitsAllowed && |
|
6334 !(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) && |
|
6335 iMode != ENativeNumber ) |
|
6336 { |
|
6337 aMenuPane->SetItemDimmed(EAknCmdEditModeEasternArabicIndicNumber, EFalse); |
|
6338 } |
|
6339 else if( iLanguageCapabilities.iIndicDigitsAllowed && |
|
6340 !( iAknEditorFlags & EAknEditorFlagLatinInputModesOnly ) && |
|
6341 |
|
6342 iMode != ENativeNumber ) |
|
6343 { |
|
6344 aMenuPane->SetItemDimmed(EAknCmdEditModeIndicNumber, EFalse); |
|
6345 } |
|
6346 } |
|
6347 |
|
6348 if (IsAbleToLaunchSCT()) |
|
6349 { |
|
6350 if (aMenuPane->MenuItemExists(EAknCmdEditInsertSymbol, index)) |
|
6351 { |
|
6352 aMenuPane->SetItemDimmed(EAknCmdEditInsertSymbol, EFalse); |
|
6353 } |
|
6354 } |
|
6355 |
|
6356 if ( iMode != ENumber && iMode != ENativeNumber && |
|
6357 iPtiEngine->NumberOfLanguages() > 1 && |
|
6358 !(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly)) |
|
6359 { |
|
6360 aMenuPane->SetItemDimmed(EAknCmdInputLanguage, EFalse); |
|
6361 } |
|
6362 |
|
6363 if (iPermittedInputModes == EAknEditorNumericInputMode) |
|
6364 { |
|
6365 aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6366 aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); |
|
6367 aMenuPane->SetItemDimmed(EChinFepCmdModeLatinLower, ETrue); |
|
6368 } |
|
6369 else if ( (iMode == ELatin || iMode == ENumber || iMode == ENativeNumber ) && |
|
6370 (iPermittedInputModes & EAknEditorSecretAlphaInputMode) && |
|
6371 !(iPermittedInputModes & EAknEditorTextInputMode)) |
|
6372 { |
|
6373 // Text case mode is not available in secret editors. |
|
6374 aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6375 } |
|
6376 |
|
6377 if (iAknEditorFlags & EAknEditorFlagForceTransparentFepModes) |
|
6378 { |
|
6379 aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6380 aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); |
|
6381 } |
|
6382 |
|
6383 if (iCaseMan->CurrentCase() == EAknEditorUpperCase) |
|
6384 { |
|
6385 aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); |
|
6386 } |
|
6387 else if (iCaseMan->CurrentCase() == EAknEditorLowerCase) |
|
6388 { |
|
6389 aMenuPane->SetItemDimmed(EChinFepCmdModeLatinLower, ETrue); |
|
6390 } |
|
6391 |
|
6392 aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6393 |
|
6394 if (!(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) |
|
6395 && iFepPluginManager->IsNonLatinLanguage(TLanguage(iSharedDataInterface->InputTextLanguage()))) |
|
6396 { |
|
6397 aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6398 aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); |
|
6399 aMenuPane->SetItemDimmed(EChinFepCmdModeLatinLower, ETrue); |
|
6400 } |
|
6401 if( iMode == EHangul ) |
|
6402 { |
|
6403 //aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, EFalse); |
|
6404 //aMenuPane->SetItemDimmed(EAknCmdEditModeAlpha, EFalse); |
|
6405 |
|
6406 aMenuPane->SetItemDimmed(EAknCmdEditModeEnglish, EFalse); |
|
6407 aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); |
|
6408 aMenuPane->SetItemDimmed(EChinFepCmdModeLatinLower, ETrue); |
|
6409 |
|
6410 } |
|
6411 else |
|
6412 { |
|
6413 aMenuPane->SetItemDimmed(EAknCmdEditModeEnglish, ETrue); |
|
6414 } |
|
6415 } |
|
6416 |
|
6417 void CAknFepManager::DoChineseTouchMenu(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
6418 { |
|
6419 TInt index; |
|
6420 if (aMenuPane->MenuItemExists(EAknCmdEditInsertSymbol, index) |
|
6421 && aMenuPane->MenuItemExists(EJapanFepCmdModeUserDic, index)) |
|
6422 { |
|
6423 aMenuPane->SetItemDimmed(EJapanFepCmdModeUserDic, ETrue); |
|
6424 } |
|
6425 |
|
6426 if (WesternPredictive()) |
|
6427 { |
|
6428 aMenuPane->SetItemDimmed(EAknCmdPredictiveTextCascade, EFalse); |
|
6429 if(iPtiEngine->CurrentLanguage()->HasInputMode(EPtiEngineWordCompletion)) |
|
6430 { |
|
6431 // Disable Autoword Completion feature for Touch Input |
|
6432 #ifndef RD_SCALABLE_UI_V2 |
|
6433 aMenuPane->SetItemDimmed(EAknCmdPredictiveModeCascade, EFalse); |
|
6434 #endif // RD_SCALABLE_UI_V2 |
|
6435 } |
|
6436 |
|
6437 if (aMenuPane->MenuItemExists(EAknCmdT9PredictiveT9Off, index)) |
|
6438 { |
|
6439 aMenuPane->SetItemDimmed(EAknCmdT9PredictiveT9Off, EFalse); |
|
6440 } |
|
6441 } |
|
6442 else |
|
6443 { |
|
6444 if ( (iPermittedInputModes & EAknEditorTextInputMode) && |
|
6445 !(iAknEditorFlags & EAknEditorFlagNoT9) && |
|
6446 iMode == ELatin) |
|
6447 { |
|
6448 aMenuPane->SetItemDimmed(EAknCmdMultitapPredictiveT9On, EFalse); |
|
6449 } |
|
6450 } |
|
6451 if (IsAbleToLaunchSCT() && |
|
6452 aMenuPane->MenuItemExists(EAknCmdEditInsertSymbol, index)) |
|
6453 { |
|
6454 aMenuPane->SetItemDimmed(EAknCmdEditInsertSymbol, EFalse); |
|
6455 } |
|
6456 if( (iFepPluginManager && (iFepPluginManager->PluginInputMode() != EPluginInputModeItut ) ) |
|
6457 && aMenuPane->MenuItemExists(EChinFepCmdInstructions, index) ) |
|
6458 { |
|
6459 aMenuPane->SetItemDimmed(EChinFepCmdInstructions, ETrue); |
|
6460 } |
|
6461 else if ( !(iPermittedInputModes == EAknEditorNumericInputMode || |
|
6462 iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) ) |
|
6463 { |
|
6464 if (aMenuPane->MenuItemExists(EAknCmdEditInsertSymbol, index)) |
|
6465 { |
|
6466 aMenuPane->SetItemDimmed(EChinFepCmdInstructions, EFalse); |
|
6467 } |
|
6468 } |
|
6469 |
|
6470 if ( iMode != ENumber && iPtiEngine->NumberOfLanguages() > 1 && |
|
6471 !(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly)) |
|
6472 { |
|
6473 aMenuPane->SetItemDimmed(EAknCmdInputLanguage, EFalse); |
|
6474 } |
|
6475 |
|
6476 if (iPermittedInputModes == EAknEditorNumericInputMode) |
|
6477 { |
|
6478 aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6479 aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); |
|
6480 aMenuPane->SetItemDimmed(EChinFepCmdModeLatinLower, ETrue); |
|
6481 } |
|
6482 else if ( (iMode == ELatin || iMode == ENumber) && |
|
6483 (iPermittedInputModes & EAknEditorSecretAlphaInputMode) && |
|
6484 !(iPermittedInputModes & EAknEditorTextInputMode)) |
|
6485 { |
|
6486 // Text case mode is not available in secret editors. |
|
6487 aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6488 } |
|
6489 if (iAknEditorFlags & EAknEditorFlagForceTransparentFepModes) |
|
6490 { |
|
6491 aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6492 aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); |
|
6493 } |
|
6494 |
|
6495 if ( IsModePermitted(ENumber) && iMode != ENumber ) |
|
6496 { |
|
6497 //aMenuPane->SetItemDimmed(EChinFepCmdModeNumber, EFalse); // original statement |
|
6498 aMenuPane->SetItemDimmed(EAknCmdEditModeNumber, EFalse); |
|
6499 // end modifying |
|
6500 } |
|
6501 } |
|
6502 TBool CAknFepManager::IsChineseInputMode( TInt aMode ) |
|
6503 { |
|
6504 return aMode == EPRCFind || aMode == ECangJie || aMode == EZhuyinFind |
|
6505 || aMode == EStrokeFind || aMode == EPinyin || aMode == EZhuyin |
|
6506 || aMode == EStroke; |
|
6507 } |
|
6508 |
|
6509 #endif //RD_SCALABLE_UI_V2 |
|
6510 void CAknFepManager::DoWesternMenu(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
6511 { |
|
6512 // remove Chinese specific items from menu |
|
6513 aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); |
|
6514 aMenuPane->SetItemDimmed(EChinFepCmdModeLatinLower, ETrue); |
|
6515 aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6516 const TInt inputLanguage = iLanguageCapabilities.iInputLanguageCode; |
|
6517 |
|
6518 |
|
6519 TInt pos=-1; |
|
6520 |
|
6521 if( aMenuPane->MenuItemExists( EAknCmdEditModeKorean, pos ) ) |
|
6522 { |
|
6523 // if mode is already hangul or language is not korean dim korean mode menu item |
|
6524 if( iMode == EHangul || inputLanguage != ELangKorean || !(IsModePermitted(EHangul))) |
|
6525 { |
|
6526 |
|
6527 aMenuPane->SetItemDimmed(EAknCmdEditModeKorean, ETrue); |
|
6528 } |
|
6529 else |
|
6530 { |
|
6531 aMenuPane->SetItemDimmed(EAknCmdEditModeKorean, EFalse); |
|
6532 } |
|
6533 } |
|
6534 |
|
6535 TInt index; |
|
6536 |
|
6537 if (aMenuPane->MenuItemExists(EJapanFepCmdModeUserDic, index)) |
|
6538 { |
|
6539 aMenuPane->SetItemDimmed(EJapanFepCmdModeUserDic, ETrue); |
|
6540 } |
|
6541 |
|
6542 // T9 stuff |
|
6543 if (WesternPredictive()) |
|
6544 { |
|
6545 aMenuPane->SetItemDimmed(EAknCmdPredictiveTextCascade, EFalse); |
|
6546 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
6547 if(iPtiEngine->CurrentLanguage()->HasInputMode(EPtiEngineWordCompletion)) |
|
6548 { |
|
6549 // Disable Autoword Completion feature for Touch Input |
|
6550 #ifndef RD_SCALABLE_UI_V2 |
|
6551 aMenuPane->SetItemDimmed(EAknCmdPredictiveModeCascade, EFalse); |
|
6552 #endif // RD_SCALABLE_UI_V2 |
|
6553 } |
|
6554 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
6555 } |
|
6556 else |
|
6557 { |
|
6558 if ( (iPermittedInputModes & EAknEditorTextInputMode) && |
|
6559 !(iAknEditorFlags & EAknEditorFlagNoT9) && |
|
6560 iMode == ELatin && |
|
6561 !IsKoreanInputLanguage() && |
|
6562 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
6563 // Predictive QWERTY (XT9) changes ----> |
|
6564 (( |
|
6565 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
6566 iLanguageCapabilities.iSupportsWesternPredictive && !IsKoreanInputLanguage() |
|
6567 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
6568 && !iQwertyInputMode) || |
|
6569 (iLanguageCapabilities.iSupportsWesternQwertyPredictive && iQwertyInputMode) |
|
6570 ) |
|
6571 // Predictive QWERTY (XT9) changes <---- |
|
6572 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
6573 ) |
|
6574 { |
|
6575 aMenuPane->SetItemDimmed(EAknCmdMultitapPredictiveT9On, EFalse); |
|
6576 } |
|
6577 } |
|
6578 |
|
6579 if ( ( iMode == ENumber || iMode == ENativeNumber ) && |
|
6580 (iPermittedInputModes & (EAknEditorTextInputMode | EAknEditorSecretAlphaInputMode)) ) |
|
6581 { |
|
6582 aMenuPane->SetItemDimmed(EAknCmdEditModeAlpha, EFalse); |
|
6583 } |
|
6584 |
|
6585 if ( IsModePermitted(ENumber) ) |
|
6586 { |
|
6587 if ( iMode != ENumber ) // hide the menu if number editor |
|
6588 { |
|
6589 aMenuPane->SetItemDimmed(EAknCmdEditModeNumber, EFalse); |
|
6590 } |
|
6591 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
6592 // Predictive QWERTY (XT9) changes ----> |
|
6593 // There's no need for numeric mode when full qwerty keyboard is in use (like in MAXI) |
|
6594 if (iQwertyInputMode) |
|
6595 { |
|
6596 aMenuPane->SetItemDimmed(EAknCmdEditModeNumber, ETrue); |
|
6597 } |
|
6598 // Predictive QWERTY (XT9) changes <---- |
|
6599 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
6600 } |
|
6601 |
|
6602 if ( IsModePermitted(ENativeNumber) && iMode != ENativeNumber) |
|
6603 { |
|
6604 if ( iLanguageCapabilities.iArabicIndicDigitsAllowed ) // hide the menu if number editor) |
|
6605 { |
|
6606 aMenuPane->SetItemDimmed(EAknCmdEditModeArabicIndicNumber, EFalse); |
|
6607 } |
|
6608 else if ( iLanguageCapabilities.iEasternArabicIndicDigitsAllowed ) // hide the menu if number editor) |
|
6609 { |
|
6610 aMenuPane->SetItemDimmed(EAknCmdEditModeEasternArabicIndicNumber, EFalse); |
|
6611 } |
|
6612 else if( iLanguageCapabilities.iIndicDigitsAllowed ) // hide the menu if number editor) |
|
6613 { |
|
6614 aMenuPane->SetItemDimmed(EAknCmdEditModeIndicNumber, EFalse); |
|
6615 } |
|
6616 } |
|
6617 |
|
6618 if (IsAbleToLaunchSCT()) |
|
6619 { |
|
6620 if (aMenuPane->MenuItemExists(EAknCmdEditInsertSymbol, index)) |
|
6621 { |
|
6622 aMenuPane->SetItemDimmed(EAknCmdEditInsertSymbol, EFalse); |
|
6623 } |
|
6624 } |
|
6625 TInt writtingLanguage = 0; |
|
6626 if ( iMode != ENumber && iMode != ENativeNumber && iPtiEngine->NumberOfLanguages() > 1 && |
|
6627 !(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) |
|
6628 && aMenuPane->MenuItemExists( EAknCmdInputLanguage, writtingLanguage ) ) |
|
6629 { |
|
6630 aMenuPane->SetItemDimmed(EAknCmdInputLanguage, EFalse); |
|
6631 } |
|
6632 } |
|
6633 |
|
6634 void CAknFepManager::DoChineseMenu(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
6635 { |
|
6636 TInt index; |
|
6637 if (aMenuPane->MenuItemExists(EAknCmdEditInsertSymbol, index) |
|
6638 && aMenuPane->MenuItemExists(EJapanFepCmdModeUserDic, index)) |
|
6639 { |
|
6640 aMenuPane->SetItemDimmed(EJapanFepCmdModeUserDic, ETrue); |
|
6641 } |
|
6642 |
|
6643 if (WesternPredictive()) |
|
6644 { |
|
6645 aMenuPane->SetItemDimmed(EAknCmdPredictiveTextCascade, EFalse); |
|
6646 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
6647 if(iPtiEngine->CurrentLanguage()->HasInputMode(EPtiEngineWordCompletion)) |
|
6648 { |
|
6649 // Disable Autoword Completion feature for Touch Input |
|
6650 #ifndef RD_SCALABLE_UI_V2 |
|
6651 aMenuPane->SetItemDimmed(EAknCmdPredictiveModeCascade, EFalse); |
|
6652 #endif // RD_SCALABLE_UI_V2 |
|
6653 } |
|
6654 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
6655 } |
|
6656 else |
|
6657 { |
|
6658 if ( (iPermittedInputModes & EAknEditorTextInputMode) && |
|
6659 !(iAknEditorFlags & EAknEditorFlagNoT9) && |
|
6660 iMode == ELatin) |
|
6661 { |
|
6662 aMenuPane->SetItemDimmed(EAknCmdMultitapPredictiveT9On, EFalse); |
|
6663 } |
|
6664 } |
|
6665 if (IsAbleToLaunchSCT() && |
|
6666 aMenuPane->MenuItemExists(EAknCmdEditInsertSymbol, index)) |
|
6667 { |
|
6668 aMenuPane->SetItemDimmed(EAknCmdEditInsertSymbol, EFalse); |
|
6669 } |
|
6670 if( iQwertyInputMode && aMenuPane->MenuItemExists(EChinFepCmdInstructions, index) ) |
|
6671 { |
|
6672 aMenuPane->SetItemDimmed(EChinFepCmdInstructions, ETrue); |
|
6673 } |
|
6674 else if ( !(iPermittedInputModes == EAknEditorNumericInputMode || |
|
6675 iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) ) |
|
6676 { |
|
6677 if (aMenuPane->MenuItemExists(EAknCmdEditInsertSymbol, index) |
|
6678 && aMenuPane->MenuItemExists(EChinFepCmdInstructions, index)) |
|
6679 { |
|
6680 aMenuPane->SetItemDimmed(EChinFepCmdInstructions, EFalse); |
|
6681 } |
|
6682 } |
|
6683 |
|
6684 if ( (!IsOnlyNumericPermitted()) && iPtiEngine->NumberOfLanguages() > 1 && |
|
6685 !(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly)) |
|
6686 { |
|
6687 aMenuPane->SetItemDimmed(EAknCmdInputLanguage, EFalse); |
|
6688 // the follow added for phrase creation |
|
6689 TInt iptlanguage; |
|
6690 if ( !iIsUserdbdlgActive |
|
6691 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
6692 && EPtiKeyboardHalfQwerty != KeyboardLayout() |
|
6693 #endif |
|
6694 && IsChineseInputLanguage() ) |
|
6695 { |
|
6696 aMenuPane->MenuItemExists( EAknCmdInputLanguage, iptlanguage ); |
|
6697 MPtiLanguage* ptilang = iPtiEngine->CurrentLanguage(); |
|
6698 TInt inputLanguage = (ptilang)? ptilang->LanguageCode() : 0; |
|
6699 if (iQwertyInputMode && (inputLanguage == ELangPrcChinese || |
|
6700 inputLanguage == ELangHongKongChinese || |
|
6701 inputLanguage == ELangTaiwanChinese)) |
|
6702 { |
|
6703 TRAP_IGNORE(AddUserDBDlgItemL( aMenuPane, iptlanguage )); |
|
6704 } |
|
6705 } |
|
6706 } |
|
6707 |
|
6708 if (iPermittedInputModes == EAknEditorNumericInputMode) |
|
6709 { |
|
6710 aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6711 aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); |
|
6712 aMenuPane->SetItemDimmed(EChinFepCmdModeLatinLower, ETrue); |
|
6713 } |
|
6714 else if ( (iMode == ELatin || iMode == ENumber) && |
|
6715 (iPermittedInputModes & EAknEditorSecretAlphaInputMode) && |
|
6716 !(iPermittedInputModes & EAknEditorTextInputMode)) |
|
6717 { |
|
6718 // Text case mode is not available in secret editors. |
|
6719 aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6720 } |
|
6721 if (iAknEditorFlags & EAknEditorFlagForceTransparentFepModes) |
|
6722 { |
|
6723 aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6724 aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); |
|
6725 } |
|
6726 |
|
6727 if ( IsModePermitted(ENumber) && iMode != ENumber ) |
|
6728 { |
|
6729 //aMenuPane->SetItemDimmed(EChinFepCmdModeNumber, EFalse); // original statement |
|
6730 aMenuPane->SetItemDimmed(EAknCmdEditModeNumber, EFalse); |
|
6731 // end modifying |
|
6732 } |
|
6733 } |
|
6734 |
|
6735 void CAknFepManager::DoJapaneseMenu(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
6736 { |
|
6737 // remove Chinese specific items from menu |
|
6738 TInt index; |
|
6739 if (aMenuPane->MenuItemExists(EAknCmdEditInsertSymbol, index)) |
|
6740 { |
|
6741 aMenuPane->SetItemDimmed(EAknCmdEditInsertSymbol, ETrue); |
|
6742 } |
|
6743 |
|
6744 aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); |
|
6745 aMenuPane->SetItemDimmed(EChinFepCmdModeLatinLower, ETrue); |
|
6746 aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6747 |
|
6748 if (IsAbleToLaunchSCT() |
|
6749 && !iSharedDataInterface->QwertyInputMode()) |
|
6750 { |
|
6751 aMenuPane->SetItemDimmed(EAknCmdEditInsertSymbolJp, EFalse); |
|
6752 } |
|
6753 |
|
6754 if (IsAbleToLaunchPCT() |
|
6755 && !iSharedDataInterface->QwertyInputMode()) |
|
6756 { |
|
6757 aMenuPane->SetItemDimmed(EAknCmdEditInsertPictograph, EFalse); |
|
6758 } |
|
6759 |
|
6760 if (!(iPermittedInputModes & EAknEditorHiraganaKanjiInputMode) && |
|
6761 aMenuPane->MenuItemExists(EJapanFepCmdModeUserDic, index) |
|
6762 ) |
|
6763 { |
|
6764 aMenuPane->SetItemDimmed(EJapanFepCmdModeUserDic, ETrue); |
|
6765 } |
|
6766 |
|
6767 if (iPermittedInputModes == (EAknEditorSecretAlphaInputMode | EAknEditorNumericInputMode)) |
|
6768 { |
|
6769 if (iMode == ELatin) |
|
6770 { |
|
6771 aMenuPane->SetItemDimmed(EJapanFepCmdEditModeNumber, EFalse); |
|
6772 } |
|
6773 else if (iMode == ENumber) |
|
6774 { |
|
6775 aMenuPane->SetItemDimmed(EJapanFepCmdEditModeAlpha, EFalse); |
|
6776 } |
|
6777 } |
|
6778 else |
|
6779 { |
|
6780 // If the fep is running on the Janapnse User Dictionary Application, |
|
6781 // "User Dictionary" in editting options menu is hidden. |
|
6782 if (CEikonEnv::Static()->EikAppUi()->Application()) |
|
6783 { |
|
6784 if (CEikonEnv::Static()->EikAppUi()->Application()->AppDllUid() == KUidUserDictApp) |
|
6785 { |
|
6786 aMenuPane->SetItemDimmed(EJapanFepCmdModeUserDic, ETrue); |
|
6787 } |
|
6788 } |
|
6789 |
|
6790 if (iPermittedInputModes & EAknEditorHiraganaKanjiInputMode) |
|
6791 { |
|
6792 aMenuPane->SetItemDimmed(EJapanFepCmdModeKutenCodeInput, EFalse); |
|
6793 } |
|
6794 |
|
6795 TInt value = iSharedDataInterface->ClearDirection(); |
|
6796 if (value == EClearDirectionRight) |
|
6797 { |
|
6798 aMenuPane->SetItemDimmed(EAknCmdEditClearDirectionLeft, EFalse); |
|
6799 } |
|
6800 else |
|
6801 { |
|
6802 aMenuPane->SetItemDimmed(EAknCmdEditClearDirectionRight, EFalse); |
|
6803 } |
|
6804 |
|
6805 if (!iSharedDataInterface->QwertyInputMode()) |
|
6806 { |
|
6807 if (IsPredictive(ELatin)) |
|
6808 { |
|
6809 aMenuPane->SetItemDimmed(EJapanFepCmdPredictiveTextCascade, EFalse); |
|
6810 } |
|
6811 else if ((iPermittedInputModes & EAknEditorHalfWidthTextInputMode) |
|
6812 && !(iAknEditorFlags & EAknEditorFlagNoT9)) |
|
6813 { |
|
6814 aMenuPane->SetItemDimmed(EJapanFepCmdMultitapPredictiveT9On, EFalse); |
|
6815 } |
|
6816 } |
|
6817 |
|
6818 if (IsPredictive(EHiraganaKanji)) |
|
6819 { |
|
6820 aMenuPane->SetItemDimmed(EJapanFepCmdModePredictiveOff, EFalse); |
|
6821 } |
|
6822 else if((iPermittedInputModes & EAknEditorHiraganaKanjiInputMode) |
|
6823 && !(iAknEditorFlags & EAknEditorFlagNoT9)) |
|
6824 { |
|
6825 aMenuPane->SetItemDimmed(EJapanFepCmdModePredictiveOn, EFalse); |
|
6826 } |
|
6827 |
|
6828 if (iMode != EHiraganaKanji && iPermittedInputModes & EAknEditorHiraganaKanjiInputMode) |
|
6829 { |
|
6830 aMenuPane->SetItemDimmed(EJapanFepCmdModeHiragana, EFalse); |
|
6831 } |
|
6832 |
|
6833 if (iCharWidth == EHalfWidthChar) |
|
6834 { |
|
6835 if (iPermittedInputModes & EAknEditorKatakanaInputMode && iMode != EKatakana) |
|
6836 { |
|
6837 aMenuPane->SetItemDimmed(EJapanFepCmdModeKatakana, EFalse); |
|
6838 } |
|
6839 |
|
6840 if (iMode != ELatin && (iPermittedInputModes & EAknEditorHalfWidthTextInputMode |
|
6841 || iPermittedInputModes & EAknEditorSecretAlphaInputMode)) |
|
6842 { |
|
6843 aMenuPane->SetItemDimmed(EJapanFepCmdEditModeAlpha, EFalse); |
|
6844 } |
|
6845 |
|
6846 if (iMode != ENumber |
|
6847 && iPermittedInputModes & EAknEditorNumericInputMode |
|
6848 && !iSharedDataInterface->QwertyInputMode()) |
|
6849 { |
|
6850 aMenuPane->SetItemDimmed(EJapanFepCmdEditModeNumber, EFalse); |
|
6851 } |
|
6852 |
|
6853 if (iMode == EKatakana && iPermittedInputModes & EAknEditorFullWidthKatakanaInputMode) |
|
6854 { |
|
6855 aMenuPane->SetItemDimmed(EJapanFepCmdModeFullWidth, EFalse); |
|
6856 } |
|
6857 |
|
6858 if (iMode == ELatin && !iWesternPredictive |
|
6859 && iPermittedInputModes & EAknEditorFullWidthTextInputMode) |
|
6860 { |
|
6861 aMenuPane->SetItemDimmed(EJapanFepCmdModeFullWidth, EFalse); |
|
6862 } |
|
6863 |
|
6864 if (iMode == ENumber |
|
6865 && iPermittedInputModes & EAknEditorFullWidthNumericInputMode) |
|
6866 { |
|
6867 aMenuPane->SetItemDimmed(EJapanFepCmdModeFullWidth, EFalse); |
|
6868 } |
|
6869 } |
|
6870 else // Full width Character |
|
6871 { |
|
6872 if (iMode != EKatakana && iPermittedInputModes & EAknEditorFullWidthKatakanaInputMode) |
|
6873 { |
|
6874 aMenuPane->SetItemDimmed(EJapanFepCmdModeKatakana, EFalse); |
|
6875 } |
|
6876 |
|
6877 if (iMode != ELatin && iPermittedInputModes & EAknEditorFullWidthTextInputMode) |
|
6878 { |
|
6879 aMenuPane->SetItemDimmed(EJapanFepCmdEditModeAlpha, EFalse); |
|
6880 } |
|
6881 |
|
6882 if (iMode != ENumber |
|
6883 && iPermittedInputModes & EAknEditorFullWidthNumericInputMode |
|
6884 && !iSharedDataInterface->QwertyInputMode()) |
|
6885 { |
|
6886 aMenuPane->SetItemDimmed(EJapanFepCmdEditModeNumber, EFalse); |
|
6887 } |
|
6888 |
|
6889 if (iMode == EKatakana && iPermittedInputModes & EAknEditorKatakanaInputMode) |
|
6890 { |
|
6891 aMenuPane->SetItemDimmed(EJapanFepCmdModeHalfWidth, EFalse); |
|
6892 } |
|
6893 |
|
6894 if (iMode == ELatin && iPermittedInputModes & EAknEditorFullWidthTextInputMode) |
|
6895 { |
|
6896 aMenuPane->SetItemDimmed(EJapanFepCmdModeHalfWidth, EFalse); |
|
6897 } |
|
6898 |
|
6899 if (iMode == ENumber |
|
6900 && iPermittedInputModes & EAknEditorFullWidthNumericInputMode) |
|
6901 { |
|
6902 aMenuPane->SetItemDimmed(EJapanFepCmdModeHalfWidth, EFalse); |
|
6903 } |
|
6904 } |
|
6905 } |
|
6906 } |
|
6907 |
|
6908 void CAknFepManager::HandlePointerEventInInlineTextL(TPointerEvent::TType /*aType*/, TUint /*aModifiers*/, TInt /*aPositionInInlineText*/) |
|
6909 { |
|
6910 } |
|
6911 |
|
6912 void CAknFepManager::GetFormatOfFepInlineText(TCharFormat& aFormat, |
|
6913 TInt& aNumberOfCharactersWithSameFormat, |
|
6914 TInt aPositionOfCharacter) const |
|
6915 { |
|
6916 if ( FepUI() ) |
|
6917 { |
|
6918 FepUI()->GetFormatOfFepInlineText(aFormat, aNumberOfCharactersWithSameFormat, |
|
6919 aPositionOfCharacter); |
|
6920 } |
|
6921 } |
|
6922 |
|
6923 void CAknFepManager::NumberModeChangeGSNotification() |
|
6924 { |
|
6925 iLanguageCapabilities.iNumericEditorDigitType = EDigitTypeUnknown; |
|
6926 UpdateNumericEditorDigitType(); |
|
6927 UpdateLocalDigitMode(); |
|
6928 } |
|
6929 |
|
6930 void CAknFepManager::HandleChangeInFocusL() |
|
6931 { |
|
6932 // Closing SCT has done focus change, so here just reset the flag. |
|
6933 #ifdef RD_SCALABLE_UI_V2 |
|
6934 if(iDisalbleFocusChangeForSCT) |
|
6935 { |
|
6936 iDisalbleFocusChangeForSCT = EFalse; |
|
6937 return; |
|
6938 } |
|
6939 #endif |
|
6940 |
|
6941 //The CCPU flag ECcpuStateShiftkeyWasPressedBeforeLosingFocus suggests that the candidate list was closed |
|
6942 //with a long key press of shift key. If so then, FEP needs to set the EFlagShiftKeyDepressed for the CCPU mode to work |
|
6943 //correctly. The state of the shift state is copied to local variable isToSetShiftKeyStateDown because as a function of change |
|
6944 //of focus the FEP clears all the CCPU flags which would reset ECcpuStateShiftkeyWasPressedBeforeLosingFocus also. |
|
6945 TBool isToSetShiftKeyStateDown = IsCcpuFlagSet(ECcpuStateShiftkeyWasPressedBeforeLosingFocus); |
|
6946 if (!Japanese() || iFepManState != EAknFepStateUIActive) |
|
6947 { |
|
6948 if (IsCcpuFlagSet(ECcpuStateIgnoreNextFocusChange)) |
|
6949 { |
|
6950 // The focus event was caused by menu selection, don't clear all ccpu flags. |
|
6951 ClearCcpuFlag(ECcpuStateIgnoreNextFocusChange); |
|
6952 } |
|
6953 else |
|
6954 { |
|
6955 if((HashKeySelectionInUse() && IsCcpuFlagSet(ECcpuStateHashDown) |
|
6956 && IsCcpuFlagSet(ECcpuStateEdwinInSelectionMode))) |
|
6957 { |
|
6958 ClearCcpuFlag(ECcpuStateHashDown); |
|
6959 SetCcpuFlag(ECcpuStateSelectionEventPosted); |
|
6960 ClearCcpuFlag(ECcpuStateEdwinInSelectionMode); |
|
6961 SetFlag(EFlagLongShiftKeyPress); |
|
6962 TKeyEvent ccpuStart = {0, EStdKeyLeftShift, 0, 0}; |
|
6963 CCoeEnv::Static()->SimulateKeyEventL(ccpuStart, EEventKeyUp); |
|
6964 } |
|
6965 else |
|
6966 { |
|
6967 TBool isToSupressCursorMove = IsCcpuFlagSet(ECcpuStateSupressCursorMoveToEnd); |
|
6968 TBool isCommitPredictiveWord = IsCcpuFlagSet(ECcpuStataCommitPredictiveWord); |
|
6969 CancelCcpuMode(); |
|
6970 if(isToSupressCursorMove) |
|
6971 SetCcpuFlag(ECcpuStateSupressCursorMoveToEnd); |
|
6972 if(isCommitPredictiveWord) |
|
6973 SetCcpuFlag(ECcpuStataCommitPredictiveWord); |
|
6974 } |
|
6975 |
|
6976 } |
|
6977 SetCcpuFlag(ECcpuSupressEditMenuFromShiftUp); |
|
6978 iPreviousEditingState = EStateNone; |
|
6979 iEditIndicatorAtLastUpdate = NULL; |
|
6980 ClearFlag( EFlagBidiCursorIsInitialized ); |
|
6981 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
6982 // removing the no match indicator is not necessary for ITI |
|
6983 if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
6984 { |
|
6985 TryRemoveNoMatchesIndicatorL(); |
|
6986 } |
|
6987 #endif |
|
6988 UpdateCbaL(NULL); |
|
6989 |
|
6990 if (iFepFullyConstructed) |
|
6991 { |
|
6992 SetCcpuFlag(ECcpuStateLosingFocus); // CommitInlineEditL needs to now we're losing focus (for cursor handling): |
|
6993 CancelAllTimerActivity(); |
|
6994 FepUI()->ExpireMultitapTimer(); |
|
6995 ClearCcpuFlag(ECcpuStateLosingFocus); // Cleared right away to make sure nothing else is affected. |
|
6996 } |
|
6997 // Forget shift key and chr key press if application or UI component is |
|
6998 // changed during shiftkey press. |
|
6999 ClearFlag(EFlagQwertyChrKeyDepressed); |
|
7000 //If candidate list was closed by long keypress of shift key, set the flag EFlagShiftKeyDepressed for CCPU mode |
|
7001 //to work correctly once it re-focuses on the editor. |
|
7002 if(isToSetShiftKeyStateDown) |
|
7003 { |
|
7004 SetFlag(EFlagShiftKeyDepressed); |
|
7005 ClearCcpuFlag(ECcpuStateShiftkeyWasPressedBeforeLosingFocus); |
|
7006 } |
|
7007 else |
|
7008 { |
|
7009 ClearFlag(EFlagShiftKeyDepressed); |
|
7010 } |
|
7011 if ( iFepFullyConstructed && IsFepAwareTextEditor() ) |
|
7012 { |
|
7013 //save state of old item |
|
7014 TransferFepStateToEditorL(); |
|
7015 |
|
7016 if ( WesternPredictive() ) |
|
7017 { |
|
7018 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
7019 // To rip off suggested word completion when there is a change in focus |
|
7020 if(IsAutoCompleteOn()) |
|
7021 { |
|
7022 RemoveSuggestedCompletionL(); |
|
7023 |
|
7024 } |
|
7025 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
7026 SetCcpuFlag(ECcpuStateLosingFocus); // CommitInlineEditL needs to now we're losing focus (for cursor handling): |
|
7027 CommitInlineEditL(); |
|
7028 ClearCcpuFlag(ECcpuStateLosingFocus); // Cleared right away to make sure nothing else is affected. |
|
7029 } |
|
7030 else |
|
7031 { |
|
7032 TryCloseUiL(); |
|
7033 } |
|
7034 |
|
7035 iRememberLength = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
7036 if (iLastFocusedEditor && !IsExtendedFlagSet(EExtendedFlagFepAwareDialogLaunched)) |
|
7037 { |
|
7038 iLastFocusedEditor->SetObserver(NULL); |
|
7039 iLastFocusedEditor = NULL; |
|
7040 } |
|
7041 // When editor launches a non-fep aware dialog, then we |
|
7042 // should not set the observer to Null. Because if the dialog is |
|
7043 // destroyed we will not know and the dialog will remain orphaned. |
|
7044 // Also we need to know the fep editor pointer. |
|
7045 iLastFocusedEditor = EditorState(); |
|
7046 iEditorCcpuStatus = EditorCcpuStatus(iLastFocusedEditor); |
|
7047 //iLastFocusedEditor->SetObserver(NULL); |
|
7048 #ifdef RD_SCALABLE_UI_V2 |
|
7049 UnregisterObserver(); |
|
7050 #endif // RD_SCALABLE_UI_V2 |
|
7051 } |
|
7052 |
|
7053 if (iPermittedInputModes & EAknEditorSecretAlphaInputMode && |
|
7054 !(iPermittedInputModes & EAknEditorTextInputMode)) |
|
7055 { |
|
7056 // For password editors. |
|
7057 ClearFlag(EFlagSupressAutoUpdate); |
|
7058 } |
|
7059 |
|
7060 // Losing focus is over, from this point on we are gaining focus. |
|
7061 ClearCcpuFlag(ECcpuStateLosingFocus); |
|
7062 |
|
7063 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
7064 if(iFnKeyManager) |
|
7065 iFnKeyManager->ClearFnKeyState(); |
|
7066 |
|
7067 if(iResourceString) |
|
7068 { |
|
7069 delete iResourceString; |
|
7070 iResourceString = NULL; |
|
7071 } |
|
7072 #endif // RD_INTELLIGENT_TEXT_INPUT |
|
7073 |
|
7074 // get input capabilities from newly focused item |
|
7075 CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
7076 iInputCapabilities = static_cast<const CCoeAppUi*>(coeEnv->AppUi())->InputCapabilities(); |
|
7077 SetQwertyModeToInputcapbility(); |
|
7078 if ( IsFepAwareTextEditor() ) |
|
7079 { |
|
7080 // Now at the launch of non-fep aware dialogs we do not set the editor observer to NULL, |
|
7081 // and retain the editor pointer in iLastFocusedEditor. |
|
7082 // So in case the editor is back in focus, we set iLastFocusedEditor to NULL |
|
7083 // and set the editor observer again. |
|
7084 |
|
7085 // At launch of fep aware dialog on a fep aware editor say spell query launched on messaging editor, |
|
7086 // we have the flag EExtendedFlagFepAwareDialogLaunched set. |
|
7087 // So in this scenario we retain the observer for both the editor as we need to close the spell query |
|
7088 // on close of messaging editor. |
|
7089 // Specific scenario is explained, the same is applicable for all general scenarios, for any |
|
7090 // fep aware dialog launched on any other fep aware editor. |
|
7091 if (iLastFocusedEditor && !IsExtendedFlagSet(EExtendedFlagFepAwareDialogLaunched)) |
|
7092 { |
|
7093 iLastFocusedEditor->SetObserver(NULL); |
|
7094 iLastFocusedEditor = NULL; |
|
7095 } |
|
7096 if( EditorState() ) |
|
7097 { |
|
7098 EditorState()->SetObserver(this); |
|
7099 } |
|
7100 ConfigureFEPFromEditorStateL(); |
|
7101 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
7102 if( PtiEngine() ) |
|
7103 { |
|
7104 if(!IsAutoCompleteOn()) |
|
7105 { |
|
7106 TInt tailLength = 0; |
|
7107 TRAP_IGNORE( PtiEngine()->HandleCommandL( |
|
7108 EPtiCommandGetAutoCompletionTailLength, |
|
7109 &tailLength )); |
|
7110 if(tailLength) |
|
7111 { |
|
7112 RemoveSuggestedAdvanceCompletionL(); |
|
7113 } |
|
7114 } |
|
7115 } |
|
7116 #endif |
|
7117 if (!iWesternPredictive && iMode == ELatin) |
|
7118 { |
|
7119 // It is possible to cause situation (by ill-acting client |
|
7120 // app) where focus handling goes out of sync and there actually |
|
7121 // is uncomitted inline edit operation going on in to-be-focused |
|
7122 // editor. Multitapping mode doesn't like that, so we make sure here |
|
7123 // that it won't happen. |
|
7124 CancelInlineEdit(); |
|
7125 } |
|
7126 AdjustCursorTypeForCurrentPosition(); |
|
7127 |
|
7128 if (IsCcpuFlagSet(ECcpuStateUncommitWhenFocused)) |
|
7129 { |
|
7130 // One of the ccpu editing options mode was started from |
|
7131 // options menu. If there is active predictive word it |
|
7132 // needs to be deactivated. |
|
7133 ClearCcpuFlag(ECcpuStateUncommitWhenFocused); |
|
7134 DeactivatePredicitveWordAndMoveCursorL(); |
|
7135 } |
|
7136 #ifdef RD_SCALABLE_UI_V2 |
|
7137 RegisterObserver(); |
|
7138 #endif // RD_SCALABLE_UI_V2 |
|
7139 } |
|
7140 else // no FepAwareTextEditor |
|
7141 { |
|
7142 #ifdef RD_SCALABLE_UI_V2 |
|
7143 // register to receive TInputCapabilitiesEvent events |
|
7144 if ( SemiFepAwareTextEditor() ) |
|
7145 { |
|
7146 RegisterObserver(); |
|
7147 TLanguage localLanguage = ELangTest; |
|
7148 if (GetLocalLanguage( localLanguage ) ) |
|
7149 { |
|
7150 iLanguageCapabilities.iLocalInputLanguageInUse = ETrue; |
|
7151 if ( localLanguage != iLanguageCapabilities.iInputLanguageCode ) |
|
7152 { |
|
7153 ChangeInputLanguageL(localLanguage); |
|
7154 } |
|
7155 } |
|
7156 else if (iLanguageCapabilities.iLocalInputLanguageInUse) |
|
7157 { |
|
7158 iLanguageCapabilities.iLocalInputLanguageInUse = EFalse; |
|
7159 ChangeInputLanguageL(iSharedDataInterface->InputTextLanguage()); |
|
7160 } |
|
7161 |
|
7162 if (IsFlagSet(EFlagNewSharedDataInputLanguage) ) |
|
7163 { |
|
7164 //Global mode or input language has been changed in general settings |
|
7165 if ( !iLanguageCapabilities.iLocalInputLanguageInUse) |
|
7166 { |
|
7167 ChangeInputLanguageL(iSharedDataInterface->InputTextLanguage()); |
|
7168 } |
|
7169 ClearFlag(EFlagNewSharedDataInputLanguage); |
|
7170 } |
|
7171 } |
|
7172 #endif // RD_SCALABLE_UI_V2 |
|
7173 // Check for non Edwin derived editors (eg mfne, tel no editor etc) |
|
7174 if (iInputCapabilities.SupportsWesternNumericIntegerPositive() || |
|
7175 iInputCapabilities.SupportsWesternNumericIntegerNegative() || |
|
7176 iInputCapabilities.SupportsWesternNumericReal() ) |
|
7177 { |
|
7178 SyncStates(EAknFepStateInitial); |
|
7179 iPermittedInputModes = EAknEditorNumericInputMode; |
|
7180 iAknEditorNumericKeymap = EAknEditorNativeKeysNumberModeKeymap; |
|
7181 iAknEditorFlags = 0; |
|
7182 iCharWidth = EHalfWidthChar; |
|
7183 UpdateNumericEditorDigitType(); |
|
7184 |
|
7185 if ( IsMfneEditor() ) |
|
7186 { |
|
7187 UpdateLocalDigitMode(); |
|
7188 } |
|
7189 |
|
7190 if( IsInputModeAvailable(ENativeNumber) && |
|
7191 ( iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic || |
|
7192 iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic || |
|
7193 iLanguageCapabilities.iLocalDigitType == EDigitTypeDevanagari ) ) |
|
7194 { |
|
7195 TryChangeModeL( ENativeNumber ); |
|
7196 } |
|
7197 else |
|
7198 { |
|
7199 TryChangeModeL( ENumber ); |
|
7200 } |
|
7201 } |
|
7202 else //we don't have a valid editor |
|
7203 { |
|
7204 SyncStates(EAknFepStateNull); |
|
7205 |
|
7206 // Reset the qwerty shift case mode when we do not have a valis editor. |
|
7207 ClearFlag(IsFlagSet( EFlagQwertyShiftMode )); |
|
7208 if (!IsFlagSet(EFlagForegroundUIComponentVisible | EFlagMenuPaneVisible) && |
|
7209 iIndicator) |
|
7210 { |
|
7211 iIndicator->SetState(EStateNone); |
|
7212 iHybridAplphaChangedToAlphanumeric = EFalse; |
|
7213 } |
|
7214 ClearFlag(EFlagForegroundUIComponentVisible); |
|
7215 iPermittedInputModes = EAknEditorNullInputMode; |
|
7216 |
|
7217 #ifdef RD_SCALABLE_UI_V2 |
|
7218 RegisterObserver(); |
|
7219 #endif // RD_SCALABLE_UI_V2 |
|
7220 } |
|
7221 } |
|
7222 } |
|
7223 else if (Japanese() && iFepManState == EAknFepStateUIActive) |
|
7224 { |
|
7225 if (iInputCapabilities.FepAwareTextEditor()) |
|
7226 { |
|
7227 TryCloseUiL(); |
|
7228 } |
|
7229 } |
|
7230 |
|
7231 #ifdef RD_SCALABLE_UI_V2 |
|
7232 { |
|
7233 /* |
|
7234 if( iGainForeground ) |
|
7235 { |
|
7236 iLoseForeAndGainFocus = EFalse; |
|
7237 } |
|
7238 else |
|
7239 { |
|
7240 iLoseForeAndGainFocus = ETrue; |
|
7241 } |
|
7242 SendEventsToPluginManL( EPluginFocusChanged, iGainForeground ); |
|
7243 */ |
|
7244 CCoeControl* focusCtrl = static_cast<const CCoeAppUi*>(CCoeEnv::Static()->AppUi())->TopFocusedControl(); |
|
7245 CAknAppUi* aui = static_cast<CAknAppUi*>(CEikonEnv::Static()->AppUi()); |
|
7246 TBool bForeGround = aui->IsForeground(); |
|
7247 if(iGainForeground && ! bForeGround) |
|
7248 { |
|
7249 iGainForeground = EFalse; |
|
7250 } |
|
7251 |
|
7252 if(iGainForeground && iNotifyPlugin) |
|
7253 { |
|
7254 SendEventsToPluginManL( EPluginFocusChanged, |
|
7255 iGainForeground && focusCtrl!=0 && focusCtrl->IsFocused()); |
|
7256 } |
|
7257 } |
|
7258 #endif // RD_SCALABLE_UI_V2 |
|
7259 if( PtiEngine() && FepAwareTextEditor() ) |
|
7260 { |
|
7261 if( FepAwareTextEditor()->DocumentLengthForFep() == 0 && |
|
7262 IsFlagSet(EFlagInsideInlineEditingTransaction)&& |
|
7263 iFepManState == EAknFepStateUIActive ) |
|
7264 { |
|
7265 PtiEngine()->ClearCurrentWord(); |
|
7266 TryCloseUiL(); |
|
7267 } |
|
7268 } |
|
7269 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
7270 // Predictive QWERTY (XT9) changes ----> |
|
7271 ShowExactWordPopupIfNecessaryL(); |
|
7272 // Predictive QWERTY (XT9) changes <---- |
|
7273 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
7274 } |
|
7275 |
|
7276 void CAknFepManager::CleanUpFep() |
|
7277 { |
|
7278 if (iFepFullyConstructed) |
|
7279 { |
|
7280 CancelAllTimerActivity(); |
|
7281 iInputCapabilities.FepAwareTextEditor()->CancelFepInlineEdit(); |
|
7282 } |
|
7283 else |
|
7284 { |
|
7285 CommonDestroyFep(); |
|
7286 } |
|
7287 } |
|
7288 |
|
7289 #ifdef RD_SCALABLE_UI_V2 |
|
7290 void CAknFepManager::UnregisterObserver() |
|
7291 { |
|
7292 |
|
7293 MObjectProvider* mop = iInputCapabilities.ObjectProvider(); |
|
7294 |
|
7295 if ( mop ) |
|
7296 { |
|
7297 CAknExtendedInputCapabilities* extendedInputCapabilities = |
|
7298 mop->MopGetObject( extendedInputCapabilities ); |
|
7299 |
|
7300 if ( extendedInputCapabilities ) |
|
7301 { |
|
7302 extendedInputCapabilities->UnregisterObserver( this ); |
|
7303 } |
|
7304 } |
|
7305 } |
|
7306 |
|
7307 void CAknFepManager::RegisterObserver() |
|
7308 { |
|
7309 |
|
7310 MObjectProvider* mop = iInputCapabilities.ObjectProvider(); |
|
7311 |
|
7312 if ( mop ) |
|
7313 { |
|
7314 CAknExtendedInputCapabilities* extendedInputCapabilities = |
|
7315 mop->MopGetObject( extendedInputCapabilities ); |
|
7316 |
|
7317 if ( extendedInputCapabilities ) |
|
7318 { |
|
7319 extendedInputCapabilities->RegisterObserver( this ); |
|
7320 } |
|
7321 } |
|
7322 } |
|
7323 |
|
7324 #endif // RD_SCALABLE_UI_V2 |
|
7325 |
|
7326 void CAknFepManager::SimulateKeyEventL(TUint aKeyCode, TBool aActiveObj) |
|
7327 { |
|
7328 if (aActiveObj) |
|
7329 { |
|
7330 iSimulateKey = aKeyCode; |
|
7331 iAsyncOwnSimulateKey.CallBack(); |
|
7332 } |
|
7333 else |
|
7334 { |
|
7335 CArrayFix<TUint>* simCharArray = new(ELeave) CArrayFixFlat<TUint>(1); |
|
7336 CleanupStack::PushL(simCharArray); |
|
7337 simCharArray->AppendL(aKeyCode); |
|
7338 SimulateKeyEventsL(simCharArray->Array()); |
|
7339 CleanupStack::PopAndDestroy(); // simCharArray |
|
7340 } |
|
7341 } |
|
7342 |
|
7343 TInt CAknFepManager::ResetShiftKeyMonitorCallback(TAny* aObj) |
|
7344 { |
|
7345 TRAPD(err, static_cast<CAknFepManager*>(aObj)->ResetShiftKeyMonitorL()); |
|
7346 if (err) |
|
7347 { |
|
7348 static_cast<CAknFepManager*>(aObj)->CleanUpFep(); |
|
7349 return KErrDied; |
|
7350 } |
|
7351 return KErrNone; |
|
7352 } |
|
7353 |
|
7354 void CAknFepManager::ResetShiftKeyMonitorL() |
|
7355 { |
|
7356 TBool phoneIdle = (EditorType() == CAknExtendedInputCapabilities::EPhoneNumberEditor); |
|
7357 if(phoneIdle) |
|
7358 { |
|
7359 iShiftKeypressMonitor->Cancel(); |
|
7360 return; |
|
7361 } |
|
7362 |
|
7363 SetFlag(EFlagLongShiftKeyPress); |
|
7364 #ifdef __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__ |
|
7365 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
7366 // Copy-paste with shift+SKs is always available on ITU-T. On QWERTY, |
|
7367 // it's available if activated in the Central Repository. |
|
7368 if ( (!iQwertyInputMode || iSharedDataInterface->ShiftCopyPastingOnQwerty()) && |
|
7369 !(iAknEditorFlags & EAknEditorFlagFindPane) ) |
|
7370 #endif // RD_INTELLIGENT_TEXT_INPUT |
|
7371 #else |
|
7372 if (!iQwertyInputMode && !(iAknEditorFlags & EAknEditorFlagFindPane)) |
|
7373 #endif // __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__ |
|
7374 { |
|
7375 if (HashKeySelectionInUse() && IsCcpuFlagSet(ECcpuStateHashDown)) |
|
7376 { |
|
7377 SetCcpuFlag(ECcpuStateEdwinInSelectionMode); |
|
7378 iHashKeyMan->SetPreviousSelectionStyleModeL(); |
|
7379 } |
|
7380 if(iCandidatePopup) |
|
7381 { // if candidate list is launched and then a long key press of shift key is done, destroy the candidate list first |
|
7382 iCandidatePopup->AttemptExitL(EFalse); |
|
7383 HandleChangeInFocusL(); |
|
7384 } |
|
7385 if(!IsCcpuFlagSet(ECcpuStateCbaShown)) |
|
7386 { |
|
7387 TKeyEvent ccpuStart = {EKeyF21, EStdKeyF21, 0, 0}; |
|
7388 // to enable copy/paste support on cba. We simulate via CCoeEnv |
|
7389 // to avoid fep SimulateKeyEventL adding shift modifiers |
|
7390 CCoeEnv::Static()->SimulateKeyEventL(ccpuStart, EEventKey); |
|
7391 SetCcpuFlag(ECcpuStateCbaShown); |
|
7392 } |
|
7393 } |
|
7394 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
7395 #ifdef __HALF_QWERTY_KEYPAD |
|
7396 // we should not enter the copy-paste mode in find pane editors |
|
7397 if( EPtiKeyboardHalfQwerty == KeyboardLayout() && !(iAknEditorFlags & EAknEditorFlagFindPane)) |
|
7398 { |
|
7399 CAknFepFnKeyManager::TFnKeyState fnState = FnKeyState(); |
|
7400 |
|
7401 if( CAknFepFnKeyManager::EFnKeyNone != fnState |
|
7402 || iFnCharInsertedForShift ) |
|
7403 { |
|
7404 TText prevCh = PreviousChar(); |
|
7405 if (prevCh == '#' || prevCh == '/') |
|
7406 { |
|
7407 RemovePreviousCharacterL(); |
|
7408 } |
|
7409 // reset the fn state if it is FnNext |
|
7410 if( fnState == CAknFepFnKeyManager::EFnKeyNext ) |
|
7411 { |
|
7412 SetFnKeyState( CAknFepFnKeyManager::EFnKeyNone ); |
|
7413 } |
|
7414 } |
|
7415 SetCcpuFlag( CAknFepManager::ECcpuStateEdwinInSelectionMode ); |
|
7416 if(!IsCcpuFlagSet(ECcpuStateCbaShown)) |
|
7417 { |
|
7418 TKeyEvent ccpuStart = {EKeyF21, EStdKeyF21, 0, 0}; |
|
7419 |
|
7420 // to enable copy/paste support on cba. We simulate via CCoeEnv |
|
7421 // to avoid fep SimulateKeyEventL adding shift modifiers |
|
7422 CCoeEnv::Static()->SimulateKeyEventL(ccpuStart, EEventKey); |
|
7423 SetCcpuFlag(ECcpuStateCbaShown); |
|
7424 } |
|
7425 } |
|
7426 #endif //__HALF_QWERTY_KEYPAD |
|
7427 |
|
7428 #endif//RD_INTELLIGENT_TEXT_INPUT |
|
7429 iShiftKeypressMonitor->Cancel(); |
|
7430 } |
|
7431 |
|
7432 void CAknFepManager::CancelAllTimerActivity() |
|
7433 { |
|
7434 if (iShiftKeypressMonitor->IsActive()) |
|
7435 { |
|
7436 iShiftKeypressMonitor->Cancel(); |
|
7437 } |
|
7438 if (iConcatenationTimer->IsActive()) |
|
7439 { |
|
7440 iConcatenationTimer->Cancel(); |
|
7441 } |
|
7442 if (iChrKeypressMonitor->IsActive()) |
|
7443 { |
|
7444 iChrKeypressMonitor->Cancel(); |
|
7445 } |
|
7446 if (iPostEventCheck->IsActive()) |
|
7447 { |
|
7448 iPostEventCheck->Cancel(); |
|
7449 } |
|
7450 if ( iHashKeyMan ) |
|
7451 { |
|
7452 iHashKeyMan->CancelHashKeyTimer(); |
|
7453 } |
|
7454 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
7455 if( iNumericResourceTimer ) |
|
7456 { |
|
7457 TRAP_IGNORE( NumericResourceMultiTapTimerTimeoutL()); |
|
7458 } |
|
7459 #endif |
|
7460 } |
|
7461 |
|
7462 TBool CAknFepManager::IsModePermitted(TInt aMode, TWidthChar aWidth) const |
|
7463 { |
|
7464 if (aWidth == ENoneWidthChar) |
|
7465 { |
|
7466 aWidth = iCharWidth; |
|
7467 } |
|
7468 |
|
7469 TBool isModePermitted = ETrue; |
|
7470 const TInt inputLanguage = iLanguageCapabilities.iInputLanguageCode; |
|
7471 |
|
7472 if ( aMode == ENativeNumber && !IsInputModeAvailable( aMode ) ) |
|
7473 { |
|
7474 if ( inputLanguage == ELangThai && iFepPluginManager && |
|
7475 iFepPluginManager->PluginInputMode() != EPluginInputModeItut && |
|
7476 !iQwertyInputMode) |
|
7477 { |
|
7478 return ETrue; |
|
7479 } |
|
7480 return EFalse; |
|
7481 } |
|
7482 |
|
7483 TUint editorMode = EditorMode(aMode, aWidth); |
|
7484 |
|
7485 //Support Boxcn default Chinese inputmode when defaul inputmode is Cangjie Hongkong |
|
7486 //only if Chinese input is permitted in the editor |
|
7487 if (!( (iVariantPermittedModes | ELatinText | ELatinUpper | ELatinLower | EHiragana) & aMode) ) |
|
7488 { |
|
7489 //the mode is never valid in this variant |
|
7490 isModePermitted = EFalse; |
|
7491 } |
|
7492 else if( aMode == ECangJie && !(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly)) |
|
7493 { |
|
7494 if (iQwertyInputMode || iFepPluginManager->PluginInputMode() == EPluginInputModeVkb |
|
7495 || iFepPluginManager->PluginInputMode() == EPluginInputModeFSQ) |
|
7496 { |
|
7497 isModePermitted = ETrue; |
|
7498 } |
|
7499 else |
|
7500 { |
|
7501 isModePermitted = EFalse; |
|
7502 } |
|
7503 } |
|
7504 else if (!(iPermittedInputModes & editorMode)) |
|
7505 { |
|
7506 isModePermitted = EFalse; |
|
7507 } |
|
7508 else if (((aMode == EPinyin) || (aMode == EZhuyin) || (aMode == EStroke) || (aMode == ECangJie) |
|
7509 || (aMode == EHiraganaKanji) || (aMode == EKatakana) |
|
7510 || (((aMode == ELatin) || (aMode == ENumber) || iMode == ENativeNumber ) && (iCharWidth == EFullWidthChar))) |
|
7511 && (iAknEditorFlags & EAknEditorFlagLatinInputModesOnly)) |
|
7512 { |
|
7513 //the editor does not allow Chinese modes |
|
7514 isModePermitted = EFalse; |
|
7515 } |
|
7516 else if (((aMode == EStrokeFind) || (aMode == EZhuyinFind)) |
|
7517 && (!(iAknEditorFlags & EAknEditorFlagForceTransparentFepModes))) |
|
7518 { |
|
7519 //StrokeFind and ZhuyinFind modes are only valid in a chinese find pane |
|
7520 isModePermitted = EFalse; |
|
7521 } |
|
7522 else |
|
7523 { |
|
7524 TUint editorsWhichAllowThisMode; |
|
7525 if (aMode == ENumber || aMode == ENativeNumber ) |
|
7526 { |
|
7527 //The FEP's ENumber mode has a direct mapping to EAknEditorNumericInputMode |
|
7528 // or EAknEditorFullWidthNumericInputMode |
|
7529 editorsWhichAllowThisMode = EAknEditorNumericInputMode; |
|
7530 if (aWidth == EFullWidthChar) |
|
7531 { |
|
7532 editorsWhichAllowThisMode = EAknEditorFullWidthNumericInputMode; |
|
7533 } |
|
7534 } |
|
7535 else if (aMode == EHiragana) |
|
7536 { |
|
7537 editorsWhichAllowThisMode = EAknEditorHiraganaInputMode; |
|
7538 } |
|
7539 else if (aMode == EKatakana || (aMode == ELatin && aWidth == EFullWidthChar)) |
|
7540 { |
|
7541 editorsWhichAllowThisMode = EditorMode(aMode, aWidth); |
|
7542 } |
|
7543 else if (aMode == EHiraganaKanji) |
|
7544 { |
|
7545 // HiraganaKanji mode allows all input mode. |
|
7546 editorsWhichAllowThisMode = EAknEditorAllInputModes; |
|
7547 } |
|
7548 else if (aMode == EHangul) |
|
7549 { |
|
7550 editorsWhichAllowThisMode =(EAknEditorTextInputMode | EAknEditorSecretAlphaInputMode | EAknEditorHalfWidthTextInputMode); |
|
7551 } |
|
7552 else |
|
7553 { |
|
7554 //if the editor allows Text Input or Secret Alpha Mode, |
|
7555 //we infer that Chinese Modes are valid |
|
7556 editorsWhichAllowThisMode =(EAknEditorTextInputMode | |
|
7557 EAknEditorSecretAlphaInputMode | |
|
7558 EAknEditorHalfWidthTextInputMode); |
|
7559 } |
|
7560 isModePermitted = iPermittedInputModes & editorsWhichAllowThisMode; |
|
7561 } |
|
7562 |
|
7563 return isModePermitted; |
|
7564 } |
|
7565 |
|
7566 TInt CAknFepManager::SyncStates(TAknFepManagerState aState) |
|
7567 { |
|
7568 TInt ret = KErrNone; |
|
7569 |
|
7570 if (!iFepFullyConstructed) |
|
7571 { |
|
7572 if (aState == EAknFepStateNull) |
|
7573 { |
|
7574 return KErrNone; |
|
7575 } |
|
7576 |
|
7577 TRAP(ret, ConstructFullyL()); |
|
7578 } |
|
7579 if (iFepFullyConstructed) |
|
7580 { |
|
7581 iFepManState = aState; |
|
7582 iKeyCatcher->SetState(aState); |
|
7583 } |
|
7584 |
|
7585 return ret; |
|
7586 } |
|
7587 |
|
7588 TUint CAknFepManager::EditorMode(TInt aMode, TWidthChar aWidth) const |
|
7589 { |
|
7590 TInt editorMode = 0; |
|
7591 switch(aMode) |
|
7592 { |
|
7593 case EPinyin: |
|
7594 case EZhuyin: |
|
7595 case EStroke: |
|
7596 case ECangJie: |
|
7597 case EPRCFind: |
|
7598 case EZhuyinFind: |
|
7599 case EStrokeFind: |
|
7600 case EHangul: |
|
7601 { |
|
7602 editorMode = EAknEditorTextInputMode; |
|
7603 } |
|
7604 break; |
|
7605 case EHindi: |
|
7606 case ELatin: |
|
7607 case ELatinText: |
|
7608 case ELatinUpper: |
|
7609 case ELatinLower: |
|
7610 { |
|
7611 if (iPermittedInputModes & EAknEditorTextInputMode) |
|
7612 { |
|
7613 editorMode = EAknEditorTextInputMode; |
|
7614 } |
|
7615 else if (iPermittedInputModes & EAknEditorHalfWidthTextInputMode) |
|
7616 { |
|
7617 if (IsFeatureSupportedJapanese()) |
|
7618 { |
|
7619 editorMode = EAknEditorHalfWidthTextInputMode; |
|
7620 } |
|
7621 else |
|
7622 { |
|
7623 editorMode = EAknEditorTextInputMode; |
|
7624 } |
|
7625 } |
|
7626 else |
|
7627 { |
|
7628 editorMode = EAknEditorSecretAlphaInputMode; |
|
7629 } |
|
7630 if (aWidth == EFullWidthChar) |
|
7631 { |
|
7632 editorMode = EAknEditorFullWidthTextInputMode; |
|
7633 } |
|
7634 } |
|
7635 break; |
|
7636 case EHiragana: |
|
7637 { |
|
7638 editorMode = EAknEditorHiraganaInputMode; |
|
7639 } |
|
7640 break; |
|
7641 case EHiraganaKanji: |
|
7642 { |
|
7643 editorMode = EAknEditorHiraganaKanjiInputMode; |
|
7644 } |
|
7645 break; |
|
7646 case EKatakana: |
|
7647 { |
|
7648 editorMode = EAknEditorKatakanaInputMode; |
|
7649 if (aWidth == EFullWidthChar) |
|
7650 { |
|
7651 editorMode = EAknEditorFullWidthKatakanaInputMode; |
|
7652 } |
|
7653 } |
|
7654 break; |
|
7655 case ENumber: |
|
7656 case ENativeNumber: |
|
7657 { |
|
7658 editorMode = EAknEditorNumericInputMode; |
|
7659 if (aWidth == EFullWidthChar) |
|
7660 { |
|
7661 editorMode = EAknEditorFullWidthNumericInputMode; |
|
7662 } |
|
7663 } |
|
7664 break; |
|
7665 default: |
|
7666 break; |
|
7667 } |
|
7668 |
|
7669 return editorMode; |
|
7670 } |
|
7671 |
|
7672 void CAknFepManager::LaunchPenSupportMenuL() |
|
7673 { |
|
7674 if (HashKeySelectionInUse() && IsCcpuFlagSet(ECcpuStateHashDown)) |
|
7675 { |
|
7676 return; |
|
7677 } |
|
7678 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
7679 if(iCandidatePopup) |
|
7680 { |
|
7681 iCandidatePopup->AttemptExitL(EFalse); |
|
7682 HandleChangeInFocusL(); |
|
7683 } |
|
7684 #endif |
|
7685 |
|
7686 if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
7687 { |
|
7688 TryRemoveNoMatchesIndicatorL(); |
|
7689 /* |
|
7690 This code is the part of fixing TSW Error ID: BSAN-7G58DB : Edit Menu : |
|
7691 "Matches" and "insert word" options are not available under Edit Menu. |
|
7692 When we launch Edit Menu.the word which in Inline Editing in the BackGorund |
|
7693 Should not Commit*/ |
|
7694 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
7695 CommitInlineEditL(); |
|
7696 #endif |
|
7697 /* |
|
7698 This code is the part of fixing TSW Error ID: BSAN-7G58DB : Edit Menu : |
|
7699 "Matches" and "insert word" options are not available under Edit Menu. |
|
7700 This Flag is useful for deciding whether "Matches" Menu Item can Visible |
|
7701 or not*/ |
|
7702 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
7703 SetFlag(EFlagInlineEditInBackground); |
|
7704 #endif |
|
7705 /* |
|
7706 This code is the part of fixing TSW Error ID: BSAN-7G58DB : Edit Menu : |
|
7707 "Matches" and "insert word" options are not available under Edit Menu.*/ |
|
7708 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
7709 ClearFlag(EFlagInsideInlineEditingTransaction); |
|
7710 #endif |
|
7711 } |
|
7712 |
|
7713 CAknEdwinState* editorState = NULL; |
|
7714 if (iInputCapabilities.FepAwareTextEditor()) |
|
7715 { |
|
7716 editorState = EditorState(); |
|
7717 } |
|
7718 |
|
7719 iEditMenuBar = NULL; |
|
7720 if (editorState) |
|
7721 { |
|
7722 iEditMenuBar = iUiInterface->EditorStateMenuBar(editorState); |
|
7723 } |
|
7724 |
|
7725 if (iEditMenuBar && |
|
7726 !iEditMenuBar->IsDisplayed()) |
|
7727 { |
|
7728 |
|
7729 iPenSupportMenu = ETrue; |
|
7730 // SetFlag(EFlagLaunchEditMenu); |
|
7731 CAknFepUiInterfaceMenuPane* menuPane = iEditMenuBar->MenuPane(); |
|
7732 |
|
7733 CEikMenuPane* oldMenuPane = menuPane->GetMenuPane(); |
|
7734 if (!oldMenuPane) |
|
7735 { |
|
7736 menuPane = NULL; |
|
7737 } |
|
7738 |
|
7739 iRememberEditorState = EditorState(); |
|
7740 |
|
7741 iEditMenuBar->SetMenuType(CAknFepUiInterfaceMenuBar::EMenuEdit); |
|
7742 // It is unnecessary to add ROW SCT in Editting option menu. |
|
7743 iEditMenuBar->TryDisplayMenuBarL(); |
|
7744 if (menuPane && menuPane->NumberOfItemsInPane() == 0) |
|
7745 { |
|
7746 // Edit menu do not contain any items. |
|
7747 iEditMenuBar->StopDisplayingMenuBar(); |
|
7748 } |
|
7749 else |
|
7750 { |
|
7751 //adjust menu position to the front of dialog to |
|
7752 //avoid input capability is wrongly got |
|
7753 CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
7754 CCoeAppUi* appUi = (CCoeAppUi*)(coeEnv->AppUi()); |
|
7755 if( appUi->IsDisplayingDialog() ) |
|
7756 { |
|
7757 iEditMenuBar->RemoveFromStack(); |
|
7758 iEditMenuBar->AddToStackL(ECoeStackPriorityDialog + 1, ECoeStackFlagStandard); |
|
7759 } |
|
7760 } |
|
7761 |
|
7762 iEditMenuBar->SetMenuType(CAknFepUiInterfaceMenuBar::EMenuOptions); |
|
7763 } |
|
7764 iPenSupportMenu = EFalse; |
|
7765 } |
|
7766 |
|
7767 void CAknFepManager::LaunchSelectModeMenuL() |
|
7768 { |
|
7769 if (HashKeySelectionInUse() && IsCcpuFlagSet(ECcpuStateHashDown)) |
|
7770 { |
|
7771 return; |
|
7772 } |
|
7773 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
7774 if(iCandidatePopup) |
|
7775 { |
|
7776 iCandidatePopup->AttemptExitL(EFalse); |
|
7777 HandleChangeInFocusL(); |
|
7778 } |
|
7779 #endif |
|
7780 |
|
7781 if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
7782 { |
|
7783 TryRemoveNoMatchesIndicatorL(); |
|
7784 /* |
|
7785 This code is the part of fixing TSW Error ID: BSAN-7G58DB : Edit Menu : |
|
7786 "Matches" and "insert word" options are not available under Edit Menu. |
|
7787 When we launch Edit Menu.the word which in Inline Editing in the BackGorund |
|
7788 Should not Commit*/ |
|
7789 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
7790 CommitInlineEditL(); |
|
7791 #endif |
|
7792 /* |
|
7793 This code is the part of fixing TSW Error ID: BSAN-7G58DB : Edit Menu : |
|
7794 "Matches" and "insert word" options are not available under Edit Menu. |
|
7795 This Flag is useful for deciding whether "Matches" Menu Item can Visible |
|
7796 or not*/ |
|
7797 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
7798 SetFlag(EFlagInlineEditInBackground); |
|
7799 #endif |
|
7800 /* |
|
7801 This code is the part of fixing TSW Error ID: BSAN-7G58DB : Edit Menu : |
|
7802 "Matches" and "insert word" options are not available under Edit Menu.*/ |
|
7803 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
7804 ClearFlag(EFlagInsideInlineEditingTransaction); |
|
7805 #endif |
|
7806 } |
|
7807 |
|
7808 CAknEdwinState* editorState = NULL; |
|
7809 if (iInputCapabilities.FepAwareTextEditor()) |
|
7810 { |
|
7811 editorState = EditorState(); |
|
7812 } |
|
7813 |
|
7814 iEditMenuBar = NULL; |
|
7815 if (editorState) |
|
7816 { |
|
7817 iEditMenuBar = iUiInterface->EditorStateMenuBar(editorState); |
|
7818 } |
|
7819 |
|
7820 if (iEditMenuBar && |
|
7821 !iEditMenuBar->IsDisplayed()) |
|
7822 { |
|
7823 // SetFlag(EFlagLaunchEditMenu); |
|
7824 CAknFepUiInterfaceMenuPane* menuPane = iEditMenuBar->MenuPane(); |
|
7825 CEikMenuPane* oldMenuPane = menuPane->GetMenuPane(); |
|
7826 if (!oldMenuPane) |
|
7827 { |
|
7828 menuPane = NULL; |
|
7829 } |
|
7830 if(menuPane) |
|
7831 SetFlag(EFlagLaunchEditMenu); |
|
7832 |
|
7833 iRememberEditorState = EditorState(); |
|
7834 |
|
7835 // It is unnecessary to add ROW SCT in Editting option menu. |
|
7836 if (!IsFeatureSupportedJapanese()) |
|
7837 { |
|
7838 iEditCharsPtr.Copy(KNullDesC); |
|
7839 iEditCharsPtr.Set( iSctEditChars->Des() ); |
|
7840 |
|
7841 // get the SCT resource id from editor default settings |
|
7842 TInt currentEditorSCTResId = GetCurrentEditorSCTResId(); |
|
7843 TInt charResourceId = ENoCharacters; |
|
7844 if ( currentEditorSCTResId == EDefaultNumericCharMapResId) |
|
7845 { |
|
7846 charResourceId = NumericModeSCTResourceId(); |
|
7847 if ( charResourceId != ENoCharacters && IsAbleToLaunchSCT()&& |
|
7848 EditorType() != CAknExtendedInputCapabilities::EEikSecretEditorBased) |
|
7849 { |
|
7850 menuPane->ConstructMenuSctRowL( iEditCharsPtr, charResourceId ); |
|
7851 } |
|
7852 else |
|
7853 { |
|
7854 currentEditorSCTResId = charResourceId; |
|
7855 } |
|
7856 } |
|
7857 else |
|
7858 { |
|
7859 TInt sctChars = EAknSCTChiChineseInputModes; |
|
7860 if (iCharWidth == EFullWidthChar) |
|
7861 { |
|
7862 sctChars = EAknSCTFullCase; |
|
7863 } |
|
7864 else |
|
7865 { |
|
7866 if (iMode == ELatin) |
|
7867 { |
|
7868 if ( FeatureManager::FeatureSupported(KFeatureIdChinese) ) |
|
7869 { |
|
7870 sctChars = EAknSCTChiLatinInputModes; |
|
7871 } |
|
7872 else |
|
7873 { |
|
7874 if (iQwertyInputMode) |
|
7875 { |
|
7876 sctChars = EAknSCTQwerty; |
|
7877 } |
|
7878 else |
|
7879 { |
|
7880 sctChars = EAknSCTUpperCase; |
|
7881 if (iCaseMan->CurrentCase() == EAknEditorLowerCase) |
|
7882 { |
|
7883 sctChars = EAknSCTLowerCase; |
|
7884 } |
|
7885 } |
|
7886 } |
|
7887 } |
|
7888 else if (iMode == ENumber || iMode == ENativeNumber) |
|
7889 { |
|
7890 sctChars = EAknSCTNumeric; |
|
7891 if ( ((iAknEditorFlags & EAknEditorFlagUseSCTNumericCharmap) || |
|
7892 (iAknEditorNumericKeymap == EAknEditorAlphanumericNumberModeKeymap)) && |
|
7893 !IsOnlyHalfWidthCharacterPermitted() ) |
|
7894 { |
|
7895 sctChars = EAknSCTLowerCase; |
|
7896 } |
|
7897 } |
|
7898 //delete for phrase creation |
|
7899 // else if (iMode == EStroke && iFepManState == EAknFepStateUIActive) |
|
7900 // { |
|
7901 // return; |
|
7902 // } |
|
7903 else if (iMode == EHiraganaKanji) |
|
7904 { |
|
7905 sctChars = EAknSCTFullCase; |
|
7906 } |
|
7907 else if(iMode == EKatakana) |
|
7908 { |
|
7909 sctChars = EAknSCTHalfCase; |
|
7910 } |
|
7911 } |
|
7912 |
|
7913 if (!(ExtendedInputCapabilities() & CAknExtendedInputCapabilities::EDisableSCT)) |
|
7914 { |
|
7915 if( menuPane && (EditorType() != CAknExtendedInputCapabilities::EEikSecretEditorBased)) |
|
7916 { |
|
7917 if(IsAbleToLaunchSmiley()) |
|
7918 { |
|
7919 sctChars |= EAknCharMapEmotionUse; |
|
7920 } |
|
7921 |
|
7922 menuPane->ConstructMenuSctRowFromDialogL( sctChars, iEditCharsPtr, |
|
7923 currentEditorSCTResId ); |
|
7924 } |
|
7925 } |
|
7926 } |
|
7927 } |
|
7928 iEditMenuBar->SetMenuType(CAknFepUiInterfaceMenuBar::EMenuEdit); |
|
7929 iFepPluginManager->SetMenuState( ETrue ); |
|
7930 iEditMenuBar->TryDisplayMenuBarL(); |
|
7931 if (menuPane && menuPane->NumberOfItemsInPane() == 0) |
|
7932 { |
|
7933 // Edit menu do not contain any items. |
|
7934 iEditMenuBar->StopDisplayingMenuBar(); |
|
7935 iFepPluginManager->ResetMenuState( ETrue ); |
|
7936 } |
|
7937 else |
|
7938 { |
|
7939 //adjust menu position to the front of dialog to |
|
7940 //avoid input capability is wrongly got |
|
7941 CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
7942 CCoeAppUi* appUi = (CCoeAppUi*)(coeEnv->AppUi()); |
|
7943 if( appUi->IsDisplayingDialog() ) |
|
7944 { |
|
7945 iEditMenuBar->RemoveFromStack(); |
|
7946 // Set the MenuBar not focused, the later add to stack operation could unfocus other control correctly |
|
7947 iEditMenuBar->SetFocus(EFalse); |
|
7948 iEditMenuBar->AddToStackL(ECoeStackPriorityDialog + 1, ECoeStackFlagStandard); |
|
7949 } |
|
7950 } |
|
7951 |
|
7952 iEditMenuBar->SetMenuType(CAknFepUiInterfaceMenuBar::EMenuOptions); |
|
7953 } |
|
7954 } |
|
7955 |
|
7956 void CAknFepManager::LaunchMatchesPopupListL() |
|
7957 { |
|
7958 TInt noOfMatches = iPtiEngine->NumberOfCandidates(); |
|
7959 if (noOfMatches > 1) // 1 => only current match available, 0 => not in inline edit |
|
7960 { |
|
7961 // Create a list to pass to the dialog |
|
7962 CDesCArrayFlat* matchesList=new(ELeave)CDesCArrayFlat(1); |
|
7963 CleanupStack::PushL(matchesList); |
|
7964 iPtiEngine->GetCandidateListL(*matchesList); |
|
7965 TBuf<EMaximumFepWordLength> matchListDesc; |
|
7966 TInt matchListItemCount = matchesList->MdcaCount(); |
|
7967 TInt currentIndex = ResolveCurrentCandidateListIndex(matchesList); |
|
7968 for ( TInt ii=0; ii < matchListItemCount ; ii++) |
|
7969 { |
|
7970 matchListDesc = matchesList->MdcaPoint(ii); |
|
7971 TChar tempChar = matchListDesc[0]; |
|
7972 if(tempChar.IsDigit()) |
|
7973 { |
|
7974 AknTextUtils::ConvertDigitsTo(matchListDesc,iLanguageCapabilities.iLocalDigitType); |
|
7975 matchesList->Delete(ii); |
|
7976 matchesList->InsertL(ii,matchListDesc); |
|
7977 } |
|
7978 } |
|
7979 |
|
7980 // add 'Spell' to the bottom of the list |
|
7981 TResourceReader reader; |
|
7982 CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
7983 coeEnv->CreateResourceReaderLC(reader, R_AVKON_T9_MATCHES_QUERY_SPELL_ITEM); |
|
7984 matchesList->AppendL(reader.ReadTPtrC()); |
|
7985 CleanupStack::PopAndDestroy(); // reader |
|
7986 |
|
7987 TInt index = 0; |
|
7988 SetFlag(EFlagForegroundUIComponentVisible); |
|
7989 |
|
7990 TUid fepUid = CCoeEnv::Static()->FepUid(); |
|
7991 ClearExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
7992 // Fire up the dialog |
|
7993 TInt returnValue = iUiInterface->LaunchListPopupL(R_AVKON_T9_MATCHES_QUERY, index, |
|
7994 currentIndex, matchesList, NULL); |
|
7995 PrepareFepAfterDialogExitL(fepUid); |
|
7996 if(returnValue == EAknSoftkeyOk) |
|
7997 {// Selected item 'index' from the matches array |
|
7998 HandleChangeInFocusL(); |
|
7999 TBuf<EMaximumFepWordLength> newText; |
|
8000 // Get current match from editor and show it as a default text in 'insert word' query. |
|
8001 iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(newText, |
|
8002 iUncommittedText.iAnchorPos, iUncommittedText.Length()); |
|
8003 |
|
8004 if (index==noOfMatches) // => 'spell' item at the bottom of the list |
|
8005 { |
|
8006 LaunchInsertWordQueryL(newText, iUncommittedText); |
|
8007 #ifdef RD_SCALABLE_UI_V2 |
|
8008 if( iFepFullyConstructed && iFepPluginManager ) |
|
8009 { |
|
8010 iFepPluginManager->ResetMenuState(); |
|
8011 } |
|
8012 #endif |
|
8013 } |
|
8014 else |
|
8015 { // insert word at index into text |
|
8016 TBuf<EMaximumFepWordLength> modifiedMatch; |
|
8017 modifiedMatch.Copy(matchesList->MdcaPoint(index)); |
|
8018 TChar first(newText[0]); |
|
8019 if (first.IsUpper()) |
|
8020 { |
|
8021 TChar converted(modifiedMatch[0]); |
|
8022 converted.UpperCase(); |
|
8023 modifiedMatch[0] = converted; |
|
8024 } |
|
8025 InsertTextFromDialogL(modifiedMatch, iUncommittedText); |
|
8026 } |
|
8027 } |
|
8028 CleanupStack::PopAndDestroy(); // matchesList |
|
8029 } |
|
8030 } |
|
8031 |
|
8032 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
8033 // Predictive QWERTY (XT9) changes ----> |
|
8034 void CAknFepManager::LaunchCandidatePopupListL( TInt aFocusedIndex ) |
|
8035 { |
|
8036 iKeyBackSpaceHit = 1; |
|
8037 //CPtiEngine* ptiEngine = iPtiEngine; |
|
8038 |
|
8039 // Addition for ITI features on FSQ. |
|
8040 // Before open candidate list, if FSQ is opened, |
|
8041 // also need to check and close tooltip on it. |
|
8042 SendEventsToPluginManL( EPluginHideTooltip ); |
|
8043 |
|
8044 // Before open candidate list, if touch ui is opened, |
|
8045 // also need to close touch ui firstly. |
|
8046 if ( iFepPluginManager->PluginInputMode() != EPluginInputModeNone ) |
|
8047 { |
|
8048 iFepPluginManager->ClosePluginInputUiL( ETrue ); |
|
8049 } |
|
8050 |
|
8051 iExactWordPopupContent->HidePopUp(); |
|
8052 |
|
8053 TBool isShiftKeyDepressedAfterCandidateListLaunched = EFalse; |
|
8054 // Retrieve active index for QWERTY keypad when Best Prediction is Set |
|
8055 TInt activeIndex = KErrNotFound; |
|
8056 |
|
8057 if(iPrimaryCandidate && IsQwerty() && ( KeyboardLayout() != EPtiKeyboardHalfQwerty)) |
|
8058 { |
|
8059 iPtiEngine->HandleCommandL( EPtiCommandUserActionGetCurrentIndexOfCandidates, &activeIndex ); |
|
8060 } |
|
8061 |
|
8062 TInt noOfMatches = iPtiEngine->NumberOfCandidates(); |
|
8063 if (noOfMatches > 0) |
|
8064 { |
|
8065 //! The compact candidate popup that opens with when arrow down pressed while inline editing |
|
8066 //MAknFepCandidatePopup *candidatePopup; |
|
8067 |
|
8068 //Predictive QWERTY (XT9) changes for new Architecture ----> |
|
8069 iCandidatePopup = UiInterface()->NewCandidatePopupL(*this); |
|
8070 //Predictive QWERTY (XT9) changes for new Architecture <---- |
|
8071 |
|
8072 // Determine the place where to spawn the candidate popup. |
|
8073 TPoint inlineEditorTl; |
|
8074 TPoint inlineEditorBr; |
|
8075 TInt height; |
|
8076 TInt ascent; |
|
8077 TInt documentOffset = iPtiEngine->CurrentWord().Length(); |
|
8078 |
|
8079 // Popup Position was not right for RTL ----> |
|
8080 if(iLanguageCapabilities.iRightToLeftLanguage) |
|
8081 documentOffset = 0; |
|
8082 // Popup Position was not right for RTL <---- |
|
8083 GetScreenCoordinatesL(inlineEditorTl, height, ascent, documentOffset); |
|
8084 |
|
8085 inlineEditorTl.iY -= height; |
|
8086 GetScreenCoordinatesL(inlineEditorBr, height, ascent); |
|
8087 |
|
8088 // Focus next word in list ----> |
|
8089 // To fix the bug STAA-7GYDB6, Candidate list opens with the highlight on 3rd candidate when Exact typing is use. |
|
8090 // Show the popup. |
|
8091 TInt selectedIdx = aFocusedIndex; |
|
8092 TKeyEvent lastKeyEvent; |
|
8093 |
|
8094 if(selectedIdx == KErrNotFound) |
|
8095 { |
|
8096 if (noOfMatches > 1) |
|
8097 { |
|
8098 selectedIdx = KWordToFocusInCandidateList; |
|
8099 } |
|
8100 // Focus next word in list <---- |
|
8101 if(iSListLaunchedFromMenu) |
|
8102 { |
|
8103 iPtiEngine->HandleCommandL( EPtiCommandUserActionGetCurrentIndexOfCandidates, &selectedIdx ); |
|
8104 iSListLaunchedFromMenu = EFalse; |
|
8105 } |
|
8106 } |
|
8107 TUid fepUid = CCoeEnv::Static()->FepUid(); |
|
8108 ClearExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
8109 TInt popupCmd = iCandidatePopup->ExecutePopupL( TRect(inlineEditorTl, inlineEditorBr), |
|
8110 selectedIdx, lastKeyEvent, iLanguageCapabilities.iRightToLeftLanguage, |
|
8111 (TInt)KeyboardLayout() ); |
|
8112 PrepareFepAfterDialogExitL(fepUid); |
|
8113 |
|
8114 if((lastKeyEvent.iScanCode == EStdKeyDevice3 ) || |
|
8115 ((lastKeyEvent.iScanCode == KAknFEPZeroKey)&& ((KeyboardLayout()== EPtiKeyboard12Key)||(KeyboardLayout()==EPtiKeyboardHalfQwerty))) |
|
8116 || lastKeyEvent.iCode == EKeySpace ) |
|
8117 { |
|
8118 SetExtendedFlag(EExtendedFlagOkKeyPressOnCandidatePopup); |
|
8119 } |
|
8120 |
|
8121 |
|
8122 TBool needToExecute(EFalse); |
|
8123 //The candidate list was closed by long key press of shift key |
|
8124 isShiftKeyDepressedAfterCandidateListLaunched = IsFlagSet(EFlagShiftKeyDepressed) && (KeyboardLayout()== EPtiKeyboard12Key); |
|
8125 if (popupCmd != EAknSoftkeyCancel) |
|
8126 { |
|
8127 HandleChangeInFocusL(); |
|
8128 |
|
8129 if (popupCmd == EAknFepSoftkeySpell) |
|
8130 { |
|
8131 // For QWERTY Input Mode |
|
8132 if (iQwertyInputMode && EPtiKeyboardHalfQwerty != iKeyboardType) |
|
8133 { |
|
8134 TInt activeIdx = KErrNotFound; |
|
8135 TInt secondaryIdx = KErrNotFound; |
|
8136 |
|
8137 iPtiEngine->HandleCommandL( EPtiCommandUserActionGetCurrentIndexOfCandidates, |
|
8138 &activeIdx ); |
|
8139 iPtiEngine->HandleCommandL( EPtiCommandUserActionGetIndexOfSecondaryCandidate, |
|
8140 &secondaryIdx ); |
|
8141 |
|
8142 if(activeIdx != secondaryIdx) |
|
8143 { |
|
8144 iPtiEngine->HandleCommandL( |
|
8145 EPtiCommandUserActionSetCurrentIndexOfCandidates, &secondaryIdx ); |
|
8146 } |
|
8147 else |
|
8148 { |
|
8149 secondaryIdx = 0; |
|
8150 iPtiEngine->HandleCommandL( |
|
8151 EPtiCommandUserActionSetCurrentIndexOfCandidates, &secondaryIdx ); |
|
8152 } |
|
8153 TPtrC selectedWord = iPtiEngine->CurrentWord(); |
|
8154 if(!IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
8155 { |
|
8156 StartInlineEditingWithSelectedWord(selectedWord); |
|
8157 } |
|
8158 UpdateInlineEditL( selectedWord, selectedWord.Length() ); |
|
8159 |
|
8160 } |
|
8161 // For ITUT Keypad, remove autocompletion part before launching Query Dialog |
|
8162 else |
|
8163 { |
|
8164 RemoveSuggestedAdvanceCompletionL(); |
|
8165 } |
|
8166 |
|
8167 // delete the candidate popup before launching the edit word dialog |
|
8168 // as the candidate list has already been closed. |
|
8169 if(iCandidatePopup) |
|
8170 { |
|
8171 delete iCandidatePopup; |
|
8172 iCandidatePopup = NULL; |
|
8173 } |
|
8174 |
|
8175 LaunchEditWordQueryL(); |
|
8176 } |
|
8177 |
|
8178 // Close with space or selection key: Commit and add space or move cursor ahead one |
|
8179 // character if next character already is space |
|
8180 else if ( ( lastKeyEvent.iScanCode == EStdKeyDevice3 || lastKeyEvent.iScanCode == KAknFEPZeroKey ) |
|
8181 && ( KeyboardLayout() == EPtiKeyboard12Key || KeyboardLayout() == EPtiKeyboardHalfQwerty ) ) |
|
8182 { |
|
8183 iPtiEngine->HandleCommandL( EPtiCommandUserActionSetCurrentIndexOfCandidates, |
|
8184 &selectedIdx ); |
|
8185 TPtrC selectedWord = iPtiEngine->CurrentWord(); |
|
8186 if(!IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
8187 { |
|
8188 StartInlineEditingWithSelectedWord(selectedWord); |
|
8189 } |
|
8190 UpdateInlineEditL( selectedWord, selectedWord.Length() ); |
|
8191 iPtiEngine->CommitCurrentWord(); |
|
8192 CommitInlineEditL(); |
|
8193 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
8194 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
8195 #endif |
|
8196 |
|
8197 AddOneSpaceOrMoveCursorL(); |
|
8198 } |
|
8199 // Close with right arrow commits the word, does not add space |
|
8200 else if ( lastKeyEvent.iScanCode == EStdKeyRightArrow ) |
|
8201 { |
|
8202 // Change of UI Spec |
|
8203 /* |
|
8204 * The following codde change is a part of bug fix for improper |
|
8205 * behavior of right arrow key when the candidate list is open. The |
|
8206 * right arrow key according to the UI specs should not the selected |
|
8207 * candicdate and cursor should be end of the word. |
|
8208 */ |
|
8209 iPtiEngine->HandleCommandL( EPtiCommandUserActionSetCurrentIndexOfCandidates, |
|
8210 &selectedIdx ); |
|
8211 TPtrC selectedWord = iPtiEngine->CurrentWord(); |
|
8212 if(!IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
8213 { |
|
8214 StartInlineEditingWithSelectedWord(selectedWord); |
|
8215 } |
|
8216 UpdateInlineEditL( selectedWord, selectedWord.Length() ); //selection.iAnchorPosition |
|
8217 iPtiEngine->CommitCurrentWord(); |
|
8218 CommitInlineEditL(); |
|
8219 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
8220 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
8221 #endif |
|
8222 |
|
8223 SimulateKeyEventL(EKeyF19); |
|
8224 } |
|
8225 else if(popupCmd == EAknSoftkeyOk) |
|
8226 { |
|
8227 iPtiEngine->HandleCommandL( EPtiCommandUserActionSetCurrentIndexOfCandidates, |
|
8228 &selectedIdx ); |
|
8229 TPtrC selectedWord = iPtiEngine->CurrentWord(); |
|
8230 if(!IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
8231 { |
|
8232 StartInlineEditingWithSelectedWord(selectedWord); |
|
8233 } |
|
8234 UpdateInlineEditL( selectedWord, selectedWord.Length() ); |
|
8235 iPtiEngine->CommitCurrentWord(); |
|
8236 CommitInlineEditL(); |
|
8237 AddOneSpaceOrMoveCursorL(); |
|
8238 } |
|
8239 else |
|
8240 { |
|
8241 iPtiEngine->HandleCommandL( EPtiCommandUserActionSetCurrentIndexOfCandidates, |
|
8242 &selectedIdx ); |
|
8243 TPtrC selectedWord = iPtiEngine->CurrentWord(); |
|
8244 if(!IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
8245 { |
|
8246 StartInlineEditingWithSelectedWord(selectedWord); |
|
8247 } |
|
8248 UpdateInlineEditL( selectedWord, selectedWord.Length() ); |
|
8249 needToExecute = ETrue; |
|
8250 } |
|
8251 } |
|
8252 else if (popupCmd == EAknSoftkeyCancel && iPrimaryCandidate && IsQwerty() |
|
8253 && ( KeyboardLayout() != EPtiKeyboardHalfQwerty ) ) |
|
8254 { |
|
8255 iPtiEngine->HandleCommandL( EPtiCommandUserActionSetIndexOfActiveCandidate, &activeIndex ); |
|
8256 iKeyBackSpaceHit = 0; |
|
8257 } |
|
8258 else if(lastKeyEvent.iCode == EKeyPhoneEnd ) |
|
8259 { |
|
8260 HandleChangeInFocusL(); |
|
8261 CCoeEnv::Static()->SimulateKeyEventL( lastKeyEvent, EEventKey ); |
|
8262 } |
|
8263 else if (popupCmd == EAknSoftkeyCancel && IsQwerty() && ( KeyboardLayout() != EPtiKeyboardHalfQwerty ) ) |
|
8264 iKeyBackSpaceHit = 0; |
|
8265 |
|
8266 // If the dialog is not closed by pressing softkeys, escape, or right arrow |
|
8267 // then the pressed key is handled also by Fep. This way the user can keep typing when the popup is open. |
|
8268 |
|
8269 //=============== Error fixing and simplify the condition ========================================== |
|
8270 // The following piece of code should be excuted, if focus word |
|
8271 // in the candidate list is accept, otherwise word sholud remain as it is. |
|
8272 // If user does not accept the word,popupCmd always be EAknSoftkeyCancel. |
|
8273 // Insetead of earlier lengthy condition, makes it simple. |
|
8274 |
|
8275 if( needToExecute ) |
|
8276 { |
|
8277 const TBool shifted = (lastKeyEvent.iModifiers & (EModifierLeftShift | |
|
8278 EModifierRightShift | EModifierShift)); |
|
8279 const TBool chrDown = (lastKeyEvent.iModifiers & (EModifierLeftFunc)); |
|
8280 |
|
8281 const TBool fnDown = (lastKeyEvent.iModifiers & (EModifierRightFunc)); |
|
8282 if(fnDown ) |
|
8283 iFnKeyManager->SetFnKeyState(CAknFepFnKeyManager::EFnKeyDown) ; |
|
8284 |
|
8285 if (shifted) |
|
8286 { |
|
8287 SetFlag(EFlagQwertyShiftMode|EFlagNoActionDuringShiftKeyPress); |
|
8288 } |
|
8289 else |
|
8290 { |
|
8291 ClearFlag(EFlagQwertyShiftMode|EFlagNoActionDuringShiftKeyPress); |
|
8292 } |
|
8293 |
|
8294 if (chrDown) |
|
8295 { |
|
8296 SetFlag(EFlagQwertyChrKeyDepressed|EFlagNoActionDuringChrKeyPress); |
|
8297 } |
|
8298 else |
|
8299 { |
|
8300 ClearFlag(EFlagQwertyChrKeyDepressed|EFlagNoActionDuringChrKeyPress); |
|
8301 } |
|
8302 if ( lastKeyEvent.iScanCode == EStdKeyDevice3 ) |
|
8303 { |
|
8304 CCoeEnv::Static()->SimulateKeyEventL( lastKeyEvent, EEventKey ); |
|
8305 } |
|
8306 if (! ( lastKeyEvent.iScanCode == EStdKeyDevice3 || |
|
8307 lastKeyEvent.iScanCode == EStdKeyRightArrow ) ) |
|
8308 { |
|
8309 /* |
|
8310 * The following code change is a part of bug fix for improper |
|
8311 * behavior of any keypress when the candidate list is open. The |
|
8312 * keypress according to the UI specs should lock the selected |
|
8313 * candidate to editor and the inserted letter is appended to it. |
|
8314 */ |
|
8315 iPtiEngine->HandleCommandL( EPtiCommandLockCurrentCandidate); |
|
8316 TPtrC selectedWord = iPtiEngine->CurrentWord(); |
|
8317 if(!IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
8318 { |
|
8319 StartInlineEditingWithSelectedWord(selectedWord); |
|
8320 } |
|
8321 UpdateInlineEditL( selectedWord, selectedWord.Length() ); //selection.iAnchorPosition |
|
8322 // For QWERTY input mode, scanCode is used |
|
8323 #ifdef __HALF_QWERTY_KEYPAD |
|
8324 if( KeyboardLayout() == EPtiKeyboardHalfQwerty) |
|
8325 { |
|
8326 iHalfQwertyLastKeyEvent = lastKeyEvent; |
|
8327 iAsyncOwnSimulateKey.CallBack(); |
|
8328 } |
|
8329 else |
|
8330 #endif //__HALF_QWERTY_KEYPAD |
|
8331 if (iQwertyInputMode) |
|
8332 { |
|
8333 CCoeEnv::Static()->SimulateKeyEventL( lastKeyEvent, EEventKey ); |
|
8334 } |
|
8335 // For ITUT input Mode, keyCode is used |
|
8336 else |
|
8337 { |
|
8338 SimulateKeyEventL( lastKeyEvent.iCode); |
|
8339 } |
|
8340 } |
|
8341 } |
|
8342 |
|
8343 ShowExactWordPopupIfNecessaryL(); |
|
8344 if(iCandidatePopup) |
|
8345 { |
|
8346 delete iCandidatePopup; |
|
8347 iCandidatePopup = NULL; |
|
8348 } |
|
8349 } |
|
8350 //The flag ECcpuStateShiftkeyWasPressedBeforeLosingFocus suggests that the candidate list was closed with a |
|
8351 //long key press of edit key (shift key). There are multiple calls to HandleChangedInFocusL() one manually and the other through |
|
8352 //CONE focus change notifier. We want the flag to be set for CONE's focus handler. |
|
8353 if(isShiftKeyDepressedAfterCandidateListLaunched) |
|
8354 { |
|
8355 SetCcpuFlag(ECcpuStateShiftkeyWasPressedBeforeLosingFocus); |
|
8356 } |
|
8357 } |
|
8358 void CAknFepManager::StartInlineEditingWithSelectedWord(TDesC& aTextToUncommit) |
|
8359 { |
|
8360 if(iConcatenationTimer->IsActive()) |
|
8361 iConcatenationTimer->Cancel(); |
|
8362 |
|
8363 TInt docLenFep=iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
8364 if (iUncommittedText.iCursorPos>docLenFep) |
|
8365 iUncommittedText.iCursorPos=docLenFep; |
|
8366 if (iUncommittedText.iAnchorPos>docLenFep) |
|
8367 iUncommittedText.iAnchorPos=docLenFep; |
|
8368 // Activates western predictive UI to an inline editing state. |
|
8369 FepUI()->ActivateUI(); |
|
8370 SyncStates(EAknFepStateUIActive); |
|
8371 // Predictive QWERTY (XT9) changes <---- |
|
8372 TRAP_IGNORE(StartInlineEditL(iUncommittedText, aTextToUncommit, |
|
8373 aTextToUncommit.Length(), EFalse)); |
|
8374 |
|
8375 } |
|
8376 void CAknFepManager::ShowExactWordPopupIfNecessaryL() |
|
8377 { |
|
8378 iExactWordPopupContent->HidePopUp(); |
|
8379 |
|
8380 // Before open tooltip, |
|
8381 // also need to check and close tooltip on it. |
|
8382 SendEventsToPluginManL( EPluginHideTooltip ); |
|
8383 |
|
8384 if ( iWesternPredictive && iQwertyInputMode |
|
8385 && IsFlagSet( EFlagInsideInlineEditingTransaction ) |
|
8386 && (EPtiKeyboardHalfQwerty != KeyboardLayout())) |
|
8387 { |
|
8388 // In the proactive mode this popup is used to show the exact input if it differs from the |
|
8389 // default candidate shown inline. |
|
8390 // In the reactive mode it is used to show the best guess candidate if it differs from the |
|
8391 // exact word shown inline. |
|
8392 |
|
8393 TInt activeIdx = KErrNotFound; |
|
8394 TInt secondaryIdx = KErrNotFound; |
|
8395 |
|
8396 iPtiEngine->HandleCommandL( EPtiCommandUserActionGetCurrentIndexOfCandidates, &activeIdx ); |
|
8397 iPtiEngine->HandleCommandL( EPtiCommandUserActionGetIndexOfSecondaryCandidate, |
|
8398 &secondaryIdx ); |
|
8399 |
|
8400 TBool popupBelowInline = EFalse; // ETrue -> popup is above inline editor |
|
8401 |
|
8402 if(iKeyBackSpaceHit) |
|
8403 secondaryIdx = activeIdx; |
|
8404 |
|
8405 if ( activeIdx != secondaryIdx ) |
|
8406 { |
|
8407 popupBelowInline = EFalse; |
|
8408 |
|
8409 CDesCArray* candidates = new (ELeave) CDesCArrayFlat(16); |
|
8410 CleanupStack::PushL(candidates); |
|
8411 GetCandidatesL(*candidates, activeIdx); |
|
8412 |
|
8413 // There is a possibility that the secondary index of the candidate changes |
|
8414 iPtiEngine->HandleCommandL( EPtiCommandUserActionGetIndexOfSecondaryCandidate, |
|
8415 &secondaryIdx ); |
|
8416 // In case the active index and the secondary index is same, then we do not need to display the |
|
8417 // popup |
|
8418 if ( activeIdx == secondaryIdx ) |
|
8419 { |
|
8420 CleanupStack::PopAndDestroy(candidates); |
|
8421 return; |
|
8422 } |
|
8423 |
|
8424 TPtrC secondaryWord = (*candidates)[secondaryIdx]; |
|
8425 iExactWordPopupContent->SetTextL( secondaryWord ); |
|
8426 iExactWordPopupContent->SetArrowDirection( MAknFepUiWordPopupContent::EUpwards ); |
|
8427 CleanupStack::PopAndDestroy(candidates); |
|
8428 |
|
8429 // Open FSQ tooltip if FSQ is opened |
|
8430 SendEventsToPluginManL( EPluginShowTooltip, secondaryIdx ); |
|
8431 |
|
8432 |
|
8433 // For addtion of ITI features on FSQ. |
|
8434 // Showing tooltip on avkon editor and FSQ ICF editor at same time probably |
|
8435 // cause flicker problem. Add this condition to ensure not to show tooltip on |
|
8436 // avkon editor when it is being displayed on FSQ. |
|
8437 if ( iFepPluginManager && !( iFepPluginManager->IsTooltipOpenOnFSQ() ) ) |
|
8438 { |
|
8439 TPoint popupTopRight; |
|
8440 TInt height; |
|
8441 TInt ascent; |
|
8442 TInt documentOffset = iPtiEngine->CurrentWord().Length(); |
|
8443 |
|
8444 GetScreenCoordinatesL(popupTopRight, height, ascent, documentOffset); |
|
8445 |
|
8446 iExactWordPopupContent->UpdateContentSize(); |
|
8447 |
|
8448 TBool rightToLeftLang = IsRightToLeftParagraph( DocPos() ); |
|
8449 if ( !rightToLeftLang ) |
|
8450 { |
|
8451 popupTopRight.iX += iExactWordPopupContent->Size().iWidth; |
|
8452 } |
|
8453 |
|
8454 if ( popupBelowInline ) |
|
8455 { |
|
8456 popupTopRight.iY += ascent / 2; |
|
8457 } |
|
8458 else |
|
8459 { |
|
8460 popupTopRight.iY -= height + iExactWordPopupContent->Size().iHeight; |
|
8461 } |
|
8462 |
|
8463 iExactWordPopupContent->SetPosition( popupTopRight ); |
|
8464 iExactWordPopupContent->ShowPopUp(); |
|
8465 } |
|
8466 } |
|
8467 } |
|
8468 else if(iWesternPredictive |
|
8469 && IsFlagSet( EFlagInsideInlineEditingTransaction ) |
|
8470 && IsFlagSet(CAknFepManager::EFlagNoMatches)) |
|
8471 { |
|
8472 UpdateCbaL(R_AKNFEP_SOFTKEYS_SPELL_EMPTY); |
|
8473 } |
|
8474 } |
|
8475 |
|
8476 void CAknFepManager::LaunchPredictiveSettingDialogL() |
|
8477 { |
|
8478 #ifdef RD_SCALABLE_UI_V2 |
|
8479 // Addtion of ITI features on FSQ. |
|
8480 if ( iFepPluginManager |
|
8481 && iFepPluginManager->IsSupportITIOnFSQ() ) |
|
8482 { |
|
8483 // Hide touch input ui firstly, |
|
8484 // otherwise, touch ui can hide status pane. |
|
8485 // Let CAknFepPluginManager know this setting dialog will be opened. |
|
8486 iFepPluginManager->ITISettingDialogOpen( ETrue ); |
|
8487 iFepPluginManager->ClosePluginInputUiL( ETrue ); |
|
8488 SendEventsToPluginManL( ELostForeground ); |
|
8489 } |
|
8490 #endif // RD_SCALABLE_UI_V2 |
|
8491 |
|
8492 // Hide fixed toolbar just before launching predictive settings dialog |
|
8493 CEikAppUiFactory * appUiFactory = NULL; |
|
8494 appUiFactory = static_cast<CEikAppUiFactory*>(CEikonEnv::Static()->AppUiFactory()); |
|
8495 |
|
8496 CAknToolbar * fixedToolbar = NULL; |
|
8497 if(appUiFactory) |
|
8498 fixedToolbar = appUiFactory->CurrentFixedToolbar(); |
|
8499 |
|
8500 // If fixedtoolbar is not there in the current editor, we don't need to hide it before launching settings dialog |
|
8501 // and unhide it after settings dialog is done. |
|
8502 if( fixedToolbar && !( fixedToolbar->IsShown() && fixedToolbar->CountComponentControls()>0 ) ) |
|
8503 fixedToolbar = NULL; |
|
8504 |
|
8505 if(fixedToolbar) |
|
8506 { |
|
8507 fixedToolbar->SetDimmed(ETrue); |
|
8508 fixedToolbar->DrawDeferred(); |
|
8509 } |
|
8510 TUid fepUid = CCoeEnv::Static()->FepUid(); |
|
8511 ClearExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
8512 UiInterface()->LaunchPredictiveSettingDialogL(R_PREDICTIVESETTING_DIALOG, |
|
8513 R_PREDICTIVESETTINGDIALOG_MENUBAR, |
|
8514 R_PREDICTIVETEXTOFF_CONFIRMATION_QUERY, |
|
8515 R_AKNFEP_PRED_INPUT_SETTINGS_TITLE); |
|
8516 PrepareFepAfterDialogExitL(fepUid); |
|
8517 #ifdef RD_SCALABLE_UI_V2 |
|
8518 // // Addtion of ITI features on FSQ. |
|
8519 if ( iFepPluginManager |
|
8520 && iFepPluginManager->IsSupportITIOnFSQ() ) |
|
8521 { |
|
8522 // Let CAknFepPluginManager know this setting dialog will be opened. |
|
8523 iFepPluginManager->ITISettingDialogOpen( EFalse ); |
|
8524 } |
|
8525 #endif // RD_SCALABLE_UI_V2 |
|
8526 |
|
8527 // Enables fixed toolbar after predictive settings dialog is closed |
|
8528 if(fixedToolbar) |
|
8529 { |
|
8530 fixedToolbar->SetDimmed(EFalse); |
|
8531 fixedToolbar->DrawDeferred(); |
|
8532 } |
|
8533 } |
|
8534 #ifdef FF_DUAL_LANGUAGE_SUPPORT |
|
8535 void CAknFepManager::LaunchWritingLanguageSettingDialogL() |
|
8536 { |
|
8537 TUid fepUid = CCoeEnv::Static()->FepUid(); |
|
8538 ClearExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
8539 UiInterface()->LaunchWritingLanguageSettingDialogL(R_INPUTLANGUAGE_DIALOG, R_PREDICTIVESETTINGDIALOG_MENUBAR, R_INPUT_LANGUAGE_SETTINGS_TITLE); |
|
8540 PrepareFepAfterDialogExitL(fepUid); |
|
8541 } |
|
8542 |
|
8543 void CAknFepManager:: LaunchDualLanguageSettingDialogL() |
|
8544 { |
|
8545 /* In Chinese language variant,if there are more than one languages supporting dual language feature, |
|
8546 display writing language setting view in which Primary and Secondary Languages can be selected from the list. |
|
8547 |
|
8548 In Chinese language variant,if there is only one language supporting dual language feature, |
|
8549 no need to display the Writing language view which contains Primary and Secondary Language. |
|
8550 Instead we can display the Writing language list directly to the user;from which the user can select the writing language*/ |
|
8551 |
|
8552 if( FeatureManager::FeatureSupported( KFeatureIdChinese ) || FeatureManager::FeatureSupported( KFeatureIdJapanese )) |
|
8553 { |
|
8554 CArrayFixFlat<TInt>* languages = new( ELeave )CArrayFixFlat<TInt>( ELanguageArrayGranularity ); |
|
8555 CleanupStack::PushL( languages ); |
|
8556 iPtiEngine->GetAvailableLanguagesL( languages ); |
|
8557 |
|
8558 TInt count = languages->Count(); |
|
8559 TInt noLangSupportWesternPred = count; |
|
8560 for (TInt index = 0; index < count; index++) |
|
8561 { |
|
8562 TInt langCode = languages->At(index); |
|
8563 |
|
8564 if (langCode == ELangTaiwanChinese || |
|
8565 langCode == ELangHongKongChinese || |
|
8566 langCode == ELangPrcChinese || |
|
8567 langCode == ELangJapanese || |
|
8568 langCode == ELangKorean ) |
|
8569 { |
|
8570 noLangSupportWesternPred--; |
|
8571 } |
|
8572 } |
|
8573 CleanupStack::PopAndDestroy(languages); |
|
8574 |
|
8575 if( noLangSupportWesternPred > 1 ) |
|
8576 { |
|
8577 SetFlag(CAknFepManager::EFlagNewSharedDataInputMode); |
|
8578 LaunchWritingLanguageSettingDialogL(); |
|
8579 if(IsFlagSet(CAknFepManager::EFlagNewSharedDataInputLanguage)) |
|
8580 { |
|
8581 ClearFlag(CAknFepManager::EFlagNewSharedDataInputLanguage); |
|
8582 HandleChangeInFocusL(); |
|
8583 ChangeInputLanguageL(iSharedDataInterface->InputTextLanguage()); |
|
8584 } |
|
8585 } |
|
8586 else |
|
8587 LaunchLanguagesPopupListL(); |
|
8588 } |
|
8589 else |
|
8590 { |
|
8591 LaunchWritingLanguageSettingDialogL(); |
|
8592 if(IsFlagSet(CAknFepManager::EFlagNewSharedDataInputLanguage)) |
|
8593 { |
|
8594 ClearFlag(CAknFepManager::EFlagNewSharedDataInputLanguage); |
|
8595 HandleChangeInFocusL(); |
|
8596 ChangeInputLanguageL(iSharedDataInterface->InputTextLanguage()); |
|
8597 } |
|
8598 } |
|
8599 |
|
8600 } |
|
8601 #endif //FF_DUAL_LANGUAGE_SUPPORT |
|
8602 // Predictive QWERTY (XT9) changes <---- |
|
8603 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
8604 void CAknFepManager::LaunchInsertWordQueryL(const TDesC& aInitialText, |
|
8605 TCursorSelection aTextSpanToReplace) |
|
8606 { |
|
8607 TInt recourceId; |
|
8608 if(EditorState()->Flags() & EAknEditorFlagEnablePartialScreen) |
|
8609 { |
|
8610 recourceId = R_AVKON_INSERT_WORD_FS_QUERY; |
|
8611 } |
|
8612 else |
|
8613 { |
|
8614 recourceId = R_AVKON_INSERT_WORD_QUERY; |
|
8615 } |
|
8616 LaunchFepQueryDialogL(recourceId, aInitialText, aTextSpanToReplace); |
|
8617 } |
|
8618 |
|
8619 void CAknFepManager::LaunchEditWordQueryL() |
|
8620 { |
|
8621 |
|
8622 TBuf<EMaximumFepWordLength> newText; |
|
8623 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
8624 if(IsAutoCompleteOn()) |
|
8625 { |
|
8626 RemoveSuggestedCompletionL(); |
|
8627 } |
|
8628 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
8629 iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(newText, |
|
8630 iUncommittedText.iAnchorPos, |
|
8631 iUncommittedText.Length()); |
|
8632 |
|
8633 TInt recourceId; |
|
8634 if(EditorState()->Flags() & EAknEditorFlagEnablePartialScreen) |
|
8635 { |
|
8636 recourceId = R_AVKON_INSERT_WORD_FS_QUERY; |
|
8637 } |
|
8638 else |
|
8639 { |
|
8640 recourceId = R_AVKON_INSERT_WORD_QUERY; |
|
8641 } |
|
8642 LaunchFepQueryDialogL(recourceId, newText, iUncommittedText); |
|
8643 } |
|
8644 |
|
8645 void CAknFepManager::LaunchFepQueryDialogL(TInt aResourceId, const TDesC& aInitialText, |
|
8646 TCursorSelection aTextSpanToReplace) |
|
8647 { |
|
8648 HBufC* textBuf = HBufC::NewLC(EQueryBufferLength); // buffer for inserted text |
|
8649 TPtr text = textBuf->Des(); |
|
8650 |
|
8651 if (aInitialText.Length() <= EQueryBufferLength) |
|
8652 text.Copy(aInitialText); |
|
8653 else // truncate the incoming text to EQueryBufferLength before copying |
|
8654 { |
|
8655 TPtrC truncatedText = aInitialText.Left(EQueryBufferLength); |
|
8656 text.Copy(truncatedText); |
|
8657 } |
|
8658 |
|
8659 if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
8660 { |
|
8661 TryRemoveNoMatchesIndicatorL(); |
|
8662 CommitInlineEditL(); |
|
8663 } |
|
8664 UpdateCbaL(NULL); |
|
8665 |
|
8666 TInt underlyingCase = iCaseMan->CurrentCase(); |
|
8667 TBool isCaseUpdatesSupressed = IsFlagSet(EFlagSupressAutoUpdateAtEditorStart); |
|
8668 |
|
8669 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
8670 if (aInitialText.Length()) |
|
8671 { |
|
8672 iCaseMan->SetCurrentCase(EAknEditorLowerCase); |
|
8673 if (aInitialText.Length() == 1) |
|
8674 { |
|
8675 if (STATIC_CAST(TChar, aInitialText[0]).IsUpper()) |
|
8676 iCaseMan->SetCurrentCase(EAknEditorTextCase); |
|
8677 } |
|
8678 else // length of initial text > 1 |
|
8679 { |
|
8680 if (STATIC_CAST(TChar, aInitialText[0]).IsUpper()) |
|
8681 { |
|
8682 if (STATIC_CAST(TChar, aInitialText[1]).IsLower()) |
|
8683 iCaseMan->SetCurrentCase(EAknEditorTextCase); |
|
8684 else // 2nd character is upper case |
|
8685 iCaseMan->SetCurrentCase(EAknEditorUpperCase); |
|
8686 } |
|
8687 } |
|
8688 } |
|
8689 #endif // RD_INTELLIGENT_TEXT_INPUT |
|
8690 |
|
8691 if (iCaseMan->CurrentCase() == EAknEditorLowerCase |
|
8692 || iCaseMan->CurrentCase() == EAknEditorUpperCase) |
|
8693 { |
|
8694 SetFlag(EFlagSupressAutoUpdateAtEditorStart); |
|
8695 } |
|
8696 |
|
8697 TransferFepStateToEditorL(); |
|
8698 |
|
8699 SetFlag(EFlagForegroundUIComponentVisible); |
|
8700 |
|
8701 TInt textQueryEditorFlag = 0; |
|
8702 if ((aResourceId == R_AVKON_INSERT_WORD_QUERY || |
|
8703 aResourceId == R_AVKON_EDIT_WORD_QUERY ) && |
|
8704 IsChineseInputLanguage()) |
|
8705 { |
|
8706 textQueryEditorFlag = EAknEditorFlagLatinInputModesOnly; |
|
8707 } |
|
8708 #ifdef RD_SCALABLE_UI_V2 |
|
8709 if (iFepFullyConstructed && |
|
8710 iFepPluginManager->PluginInputMode() == EPluginInputModeItut && |
|
8711 !(EditorState()->Flags() & EAknEditorFlagEnablePartialScreen)) |
|
8712 { |
|
8713 iFepPluginManager->SpellText(textBuf); |
|
8714 iFepPluginManager->DisplaySpellEditor(textQueryEditorFlag, aInitialText, |
|
8715 TCursorSelection(aInitialText.Length(), 0)); |
|
8716 |
|
8717 delete iSpellInitText; |
|
8718 iSpellInitText = NULL; |
|
8719 iSpellInitText = aInitialText.AllocL(); |
|
8720 iSpellInitCurSel = aTextSpanToReplace; |
|
8721 |
|
8722 iFepPluginManager->SetCaseUpdatesSupressed(isCaseUpdatesSupressed); |
|
8723 iFepPluginManager->SetITUTSpellingStateL(ETrue); |
|
8724 iFepPluginManager->SetCursorSelection(aTextSpanToReplace); |
|
8725 CleanupStack::PopAndDestroy(); |
|
8726 |
|
8727 return; |
|
8728 } |
|
8729 #endif |
|
8730 |
|
8731 if(iFepPluginManager) |
|
8732 { |
|
8733 iFepPluginManager->SetInEditWordQueryFlag(ETrue); |
|
8734 } |
|
8735 |
|
8736 PrepareFepForFepAwareDialogLaunch(); |
|
8737 TUid fepUid = CCoeEnv::Static()->FepUid(); |
|
8738 ClearExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
8739 TInt id = iUiInterface->TextQueryDialogL(text, *EditorState(), |
|
8740 textQueryEditorFlag, aResourceId); |
|
8741 PrepareFepAfterFepAwareDialogExitL(fepUid); |
|
8742 PrepareFepAfterDialogExitL(fepUid); |
|
8743 |
|
8744 if(iFepPluginManager) |
|
8745 { |
|
8746 iFepPluginManager->SetInEditWordQueryFlag(EFalse); |
|
8747 } |
|
8748 if (id == EAknSoftkeyOk) |
|
8749 { |
|
8750 // Insert the character into the edwin. |
|
8751 InsertTextFromDialogL(text, aTextSpanToReplace); |
|
8752 // Add the word to the user dictionary (except for single character) after it has been added to the editor. |
|
8753 // FepUI of the main editor is used. Different FepUI is used in multitap |
|
8754 // query and predictive mode 'main' editor at least in Japanese variant. |
|
8755 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
8756 if(text.Length() > 1) |
|
8757 FepUI()->AddTextToUserDictionaryL(text); |
|
8758 #else |
|
8759 FepUI()->AddTextToUserDictionaryL(text); |
|
8760 #endif // RD_INTELLIGENT_TEXT_INPUT |
|
8761 |
|
8762 } |
|
8763 else // restore original case and inline text |
|
8764 { |
|
8765 HandleChangeInFocus(); |
|
8766 if (aTextSpanToReplace.Length()) |
|
8767 { |
|
8768 EditorState()->SetInlineEditSpan(aTextSpanToReplace); |
|
8769 ConfigureFEPFromEditorStateL(); |
|
8770 } |
|
8771 iCaseMan->SetCurrentCase(underlyingCase); |
|
8772 TransferFepStateToEditorL(); |
|
8773 } |
|
8774 |
|
8775 if (isCaseUpdatesSupressed) |
|
8776 { |
|
8777 SetFlag(EFlagSupressAutoUpdate); |
|
8778 } |
|
8779 else |
|
8780 { |
|
8781 ClearFlag(EFlagSupressAutoUpdate); |
|
8782 } |
|
8783 ClearFlag(EFlagSupressAutoUpdateAtEditorStart); |
|
8784 CleanupStack::PopAndDestroy(); // text |
|
8785 } |
|
8786 |
|
8787 void CAknFepManager::InsertTextFromDialogL(const TDesC& aTextFromDialog, |
|
8788 TCursorSelection aExtentOfTextToReplace) |
|
8789 { |
|
8790 SetCcpuFlag(ECcpuStateSupressCursorMoveToEnd); |
|
8791 // ensure we're back on the correct editor |
|
8792 |
|
8793 #ifdef RD_SCALABLE_UI_V2 |
|
8794 iNotifyPlugin = EFalse; // not really focus change |
|
8795 HandleChangeInFocus(); |
|
8796 iNotifyPlugin = ETrue; |
|
8797 #else |
|
8798 HandleChangeInFocus(); |
|
8799 #endif |
|
8800 // need to commit if the editor was previously performing an inline edit |
|
8801 if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
8802 CommitInlineEditL(); |
|
8803 |
|
8804 TInt addedTextLength=0; |
|
8805 |
|
8806 TCursorSelection currentSelection; |
|
8807 // In case input capabilities goes null leaving with an error code and allowing application to handle.. |
|
8808 if (NULL == iInputCapabilities.FepAwareTextEditor()) |
|
8809 User::Leave(KErrCorrupt); |
|
8810 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(currentSelection); |
|
8811 // Prepare for the edit |
|
8812 TInt docLength = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
8813 TInt maxLength = iInputCapabilities.FepAwareTextEditor()->DocumentMaximumLengthForFep(); |
|
8814 |
|
8815 if (aExtentOfTextToReplace.Length()) |
|
8816 { |
|
8817 if (currentSelection.Length()) |
|
8818 // Want to 'cancel' the selection so move cursor & anchor to the end of |
|
8819 // the selection and then to the end of the current word |
|
8820 { |
|
8821 TInt endOfSelection=currentSelection.HigherPos(); |
|
8822 iUncommittedText.SetSelection(endOfSelection, endOfSelection); |
|
8823 if (CursorInsideWord()) |
|
8824 MoveCursorToEndOfWordL(); |
|
8825 } |
|
8826 iUncommittedText = aExtentOfTextToReplace; |
|
8827 iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(iUncommittedText); |
|
8828 addedTextLength = aTextFromDialog.Length(); |
|
8829 if (maxLength != 0) |
|
8830 { |
|
8831 addedTextLength = Min(addedTextLength, |
|
8832 (maxLength - docLength + iUncommittedText.Length())); |
|
8833 } |
|
8834 } |
|
8835 else |
|
8836 { |
|
8837 addedTextLength = aTextFromDialog.Length(); |
|
8838 |
|
8839 //maxLength of 0 means the editor has no limit |
|
8840 if (maxLength != 0) |
|
8841 { |
|
8842 addedTextLength = Min(addedTextLength, |
|
8843 (maxLength - docLength + currentSelection.Length())); |
|
8844 } |
|
8845 if (currentSelection.Length()) |
|
8846 { |
|
8847 iUncommittedText.SetSelection(currentSelection.HigherPos(), |
|
8848 currentSelection.LowerPos()); |
|
8849 iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(iUncommittedText); |
|
8850 } |
|
8851 else // do this in order for editor to get the correct number of chars to format from GetFormatOfFepInlineText() |
|
8852 iUncommittedText.iCursorPos+=addedTextLength; |
|
8853 } |
|
8854 // if necessary trim text to fit into available space in the editor & perform the edit |
|
8855 TPtrC textToEditor = aTextFromDialog.Left(addedTextLength); |
|
8856 |
|
8857 StartInlineEditL(textToEditor); |
|
8858 CommitInlineEditL(); |
|
8859 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
8860 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
8861 #endif |
|
8862 |
|
8863 EditorState()->SetInlineEditSpan(iUncommittedText); |
|
8864 } |
|
8865 |
|
8866 void CAknFepManager::LaunchKutenCodeQueryL() |
|
8867 { |
|
8868 TInt code; |
|
8869 TUid fepUid = CCoeEnv::Static()->FepUid(); |
|
8870 ClearExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
8871 UiInterface()->JapaneseKutenQueryDialogL(R_AKNFEPUICTRLJAPANESEKUTEN_QUERY, code, 0); |
|
8872 |
|
8873 PrepareFepAfterDialogExitL(fepUid); |
|
8874 |
|
8875 HandleChangeInFocus(); // to re-establish contact with editor under KutenCode Query |
|
8876 |
|
8877 if (code > 0 && EditorHasFreeSpace()) |
|
8878 { |
|
8879 TBuf<ESingleCharacter> text; |
|
8880 text.Append((TText)code); |
|
8881 SetFlag(EFlagInsideInlineEditingTransaction); |
|
8882 iInputCapabilities.FepAwareTextEditor()->StartFepInlineEditL(text, ESingleCharacter, |
|
8883 ETrue, NULL, *this, *this); |
|
8884 CommitInlineEditL(); |
|
8885 } |
|
8886 } |
|
8887 |
|
8888 TInt CAknFepManager::NumericModeSCTResourceId() const |
|
8889 { |
|
8890 TInt charMapResId = EDefaultNumericCharMapResId; |
|
8891 TBool phoneIdle = (EditorType() == CAknExtendedInputCapabilities::EPhoneNumberEditor); |
|
8892 |
|
8893 if( phoneIdle ) |
|
8894 { |
|
8895 charMapResId=R_AKNFEP_SCT_NUMERIC_MODE_CHARS_STANDARD; |
|
8896 return charMapResId; |
|
8897 } |
|
8898 |
|
8899 switch (iAknEditorNumericKeymap) |
|
8900 { |
|
8901 case EAknEditorStandardNumberModeKeymap: |
|
8902 charMapResId = R_AKNFEP_SCT_NUMERIC_MODE_CHARS_STANDARD; |
|
8903 break; |
|
8904 case EAknEditorCalculatorNumberModeKeymap: |
|
8905 charMapResId = R_AKNFEP_SCT_NUMERIC_MODE_CHARS_CALCULATOR; |
|
8906 break; |
|
8907 case EAknEditorConverterNumberModeKeymap: |
|
8908 charMapResId = R_AKNFEP_SCT_NUMERIC_MODE_CHARS_CONVERTER; |
|
8909 break; |
|
8910 case EAknEditorFixedDiallingNumberModeKeymap: |
|
8911 charMapResId = R_AKNFEP_SCT_NUMERIC_MODE_CHARS_FIXED_DIALLING; |
|
8912 break; |
|
8913 case EAknEditorSATNumberModeKeymap: |
|
8914 charMapResId = R_AKNFEP_SCT_NUMERIC_MODE_CHARS_SAT; |
|
8915 break; |
|
8916 case EAknEditorToFieldNumberModeKeymap: |
|
8917 charMapResId = R_AKNFEP_SCT_NUMERIC_MODE_CHARS_TO_FIELD; |
|
8918 break; |
|
8919 case EAknEditorPlainNumberModeKeymap: |
|
8920 charMapResId = R_AKNFEP_SCT_NUMERIC_MODE_CHARS_PLAIN; |
|
8921 break; |
|
8922 case EAknEditorNativeKeysNumberModeKeymap: |
|
8923 //currently this is not in use |
|
8924 break; |
|
8925 case EAknEditorSATHiddenNumberModeKeymap: |
|
8926 charMapResId = R_AKNFEP_SCT_NUMERIC_MODE_CHARS_SAT_HIDDEN; |
|
8927 break; |
|
8928 default: |
|
8929 //We reach here because there is no valid SCT resource ID set |
|
8930 //by the current editor. So best we can do now is set the |
|
8931 //default mode for numeric editors. |
|
8932 charMapResId = R_AKNFEP_SCT_NUMERIC_MODE_CHARS_STANDARD; |
|
8933 break; |
|
8934 } |
|
8935 if(IsHybridAplhaEditor() && !IsHybridAlphaModeChangedtoAplhanumeric()) |
|
8936 { |
|
8937 charMapResId = R_AKNFEP_SCT_NUMERIC_MODE_CHARS_STANDARD; |
|
8938 } |
|
8939 return charMapResId; |
|
8940 } |
|
8941 |
|
8942 |
|
8943 TBool CAknFepManager::HashKeyModeChangeBlockedInSearchField() const |
|
8944 { |
|
8945 if ((iAknEditorFlags & EAknEditorFlagFindPane) && |
|
8946 iSharedDataInterface->HashKeySelectionInUse() && |
|
8947 !IsChineseInputLanguage() && |
|
8948 !IsKoreanInputLanguage() && |
|
8949 iLanguageCapabilities.iInputLanguageCode != ELangVietnamese && |
|
8950 !FeatureManager::FeatureSupported(KFeatureIdJapanese)) |
|
8951 { |
|
8952 if (iMode == ELatin || iMode == ENumber || iMode == ENativeNumber ) |
|
8953 { |
|
8954 return ETrue; |
|
8955 } |
|
8956 } |
|
8957 |
|
8958 return EFalse; |
|
8959 } |
|
8960 |
|
8961 |
|
8962 TKeyResponse CAknFepManager::HandleHashKeyL(TKeyPressLength aLength) |
|
8963 { |
|
8964 TKeyResponse response = EKeyWasNotConsumed; |
|
8965 if (IsFlagSet(EFlagPassNextKey)) |
|
8966 { |
|
8967 ClearFlag(EFlagPassNextKey); |
|
8968 } |
|
8969 else if (IsFlagSet(EFlagShiftKeyDepressed)) |
|
8970 { |
|
8971 response = EKeyWasConsumed; |
|
8972 } |
|
8973 else if (HashKeyModeChangeBlockedInSearchField()) |
|
8974 { |
|
8975 // Do not allow case changes for latin languages in search field |
|
8976 // if hash key selection is active. |
|
8977 response = EKeyWasConsumed; |
|
8978 } |
|
8979 else |
|
8980 { |
|
8981 if ( IsFlagSet(EFlagInsideMultitapInlineEditingTransaction) ) |
|
8982 { |
|
8983 #ifdef RD_HINDI_PHONETIC_INPUT |
|
8984 if(iSharedDataInterface->InputTextLanguage() != KLangHindiPhonetic) |
|
8985 #endif |
|
8986 FepUI()->ExpireMultitapTimer(); |
|
8987 // For Japanese, send backspace key event in case hash key |
|
8988 // is pressed while secret text input. |
|
8989 if (IsFeatureSupportedJapanese()) |
|
8990 { |
|
8991 if (iInputCapabilities.SupportsSecretText()) |
|
8992 { |
|
8993 SimulateKeyEventL(EKeyF20); //backspace |
|
8994 } |
|
8995 } |
|
8996 #ifdef RD_HINDI_PHONETIC_INPUT |
|
8997 if(iSharedDataInterface->InputTextLanguage() != KLangHindiPhonetic) |
|
8998 #endif |
|
8999 ClearFlag(EFlagInsideMultitapInlineEditingTransaction); |
|
9000 iCaseMan->UpdateCase(ENullNaviEvent); |
|
9001 } |
|
9002 if (aLength == EShortKeyPress) |
|
9003 { |
|
9004 if ( iMode != ENumber && iMode != ENativeNumber ) |
|
9005 { |
|
9006 iModeBefore = iMode; |
|
9007 if (iModeBefore == ELatin) |
|
9008 { |
|
9009 iCaseBefore = iCaseMan->CurrentCase(); |
|
9010 } |
|
9011 } |
|
9012 } |
|
9013 |
|
9014 // always keep previous input mode for Japanese input |
|
9015 if (IsFeatureSupportedJapanese()) |
|
9016 { |
|
9017 iModeBefore = iMode; |
|
9018 if (iModeBefore == ELatin) |
|
9019 { |
|
9020 iCaseBefore = iCaseMan->CurrentCase(); |
|
9021 } |
|
9022 } |
|
9023 if (iMode == EHangul && aLength == ELongKeyPress) |
|
9024 { |
|
9025 if (IsFlagSet(CAknFepManager::EFlagInsideInlineEditingTransaction)) |
|
9026 { |
|
9027 TPtrC text = iPtiEngine->CurrentWord(); |
|
9028 if (text.Length() > 0) |
|
9029 { |
|
9030 CancelInlineEdit(); |
|
9031 StartInlineEditL(); |
|
9032 UpdateInlineEditL(iPtiEngine->PreviousCandidate(), iPtiEngine->PreviousCandidate().Length()); |
|
9033 CommitInlineEditL(); |
|
9034 } |
|
9035 else |
|
9036 { |
|
9037 CancelInlineEdit(); |
|
9038 } |
|
9039 iPtiEngine->ClearCurrentWord(); |
|
9040 } |
|
9041 } |
|
9042 |
|
9043 response = iHashKeyMan->HandleKeyEventL(aLength); |
|
9044 if (response == EKeyWasNotConsumed) |
|
9045 { |
|
9046 switch (iAknEditorNumericKeymap) |
|
9047 { |
|
9048 case EAknEditorStandardNumberModeKeymap: //fall through |
|
9049 case EAknEditorFixedDiallingNumberModeKeymap: |
|
9050 case EAknEditorSATNumberModeKeymap: |
|
9051 case EAknEditorSATHiddenNumberModeKeymap: |
|
9052 case EAknEditorAlphanumericNumberModeKeymap: |
|
9053 if (!EditorHasFreeSpace()) |
|
9054 { |
|
9055 response=EKeyWasConsumed; |
|
9056 } |
|
9057 break; |
|
9058 case EAknEditorCalculatorNumberModeKeymap: //fall through |
|
9059 case EAknEditorConverterNumberModeKeymap: |
|
9060 SimulateKeyEventL(CurrentDecimalSeparator()); |
|
9061 if (EditorHasFreeSpace()) |
|
9062 { |
|
9063 SetFlag(EFlagCharacterAdded); |
|
9064 } |
|
9065 response=EKeyWasConsumed; |
|
9066 break; |
|
9067 case EAknEditorToFieldNumberModeKeymap: |
|
9068 SimulateKeyEventL(text_to_field_mode_hash_key); |
|
9069 if (EditorHasFreeSpace()) |
|
9070 { |
|
9071 SetFlag(EFlagCharacterAdded); |
|
9072 } |
|
9073 response=EKeyWasConsumed; |
|
9074 break; |
|
9075 case EAknEditorPlainNumberModeKeymap: |
|
9076 response=EKeyWasConsumed; |
|
9077 break; |
|
9078 case EAknEditorNativeKeysNumberModeKeymap: |
|
9079 break; |
|
9080 default: |
|
9081 break; |
|
9082 } |
|
9083 } |
|
9084 } |
|
9085 return response; |
|
9086 } |
|
9087 |
|
9088 TInt CAknFepManager::EditorNumericKeymap() const |
|
9089 { |
|
9090 return iAknEditorNumericKeymap; |
|
9091 } |
|
9092 |
|
9093 |
|
9094 TBool CAknFepManager::HashKeySelectionInUse() const |
|
9095 { |
|
9096 if (ExtendedInputCapabilities() |
|
9097 & CAknExtendedInputCapabilities::EForceHashKeySelectionStatusFlagOff) |
|
9098 { |
|
9099 return EFalse; |
|
9100 } |
|
9101 |
|
9102 return iSharedDataInterface->HashKeySelectionInUse(); |
|
9103 } |
|
9104 |
|
9105 |
|
9106 TBool CAknFepManager::EditSubmenuInUse() const |
|
9107 { |
|
9108 if (RProcess().SecureId().iId == KPhoneSecureId) |
|
9109 { |
|
9110 if (iQwertyInputMode) |
|
9111 { |
|
9112 return EFalse; |
|
9113 } |
|
9114 } |
|
9115 |
|
9116 if (ExtendedInputCapabilities() & CAknExtendedInputCapabilities::EForceEditSubmenuStatusFlagOff) |
|
9117 { |
|
9118 return EFalse; |
|
9119 } |
|
9120 |
|
9121 return iSharedDataInterface->EditSubmenuInUse(); |
|
9122 } |
|
9123 |
|
9124 |
|
9125 void CAknFepManager::DimEditMenuModeItems(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
9126 { |
|
9127 // current item |
|
9128 DimMenuItem(aMenuPane, iMode); |
|
9129 |
|
9130 // dim menu items for Chinese input modes that aren't valid in the current editor |
|
9131 // or the device subvariant |
|
9132 for (TInt mode = KFirstMode; mode <= KLastMode; mode = mode << 1) |
|
9133 { |
|
9134 if (!IsModePermitted(mode)) |
|
9135 { |
|
9136 DimMenuItem(aMenuPane, mode); |
|
9137 } |
|
9138 } |
|
9139 |
|
9140 if (IsAbleToLaunchSmiley()) |
|
9141 { |
|
9142 TInt index; |
|
9143 if (aMenuPane->MenuItemExists(EAknCmdEditInsertSmiley, index)) |
|
9144 { |
|
9145 aMenuPane->SetItemDimmed(EAknCmdEditInsertSmiley, EFalse); |
|
9146 } |
|
9147 } |
|
9148 } |
|
9149 |
|
9150 void CAknFepManager::DimMenuItem(CAknFepUiInterfaceMenuPane* aMenuPane, TInt aMode) |
|
9151 { |
|
9152 TInt dimmedMenuItem = 0; |
|
9153 switch (aMode) |
|
9154 { |
|
9155 case EPinyin: |
|
9156 dimmedMenuItem = EChinFepCmdModePinyin; |
|
9157 break; |
|
9158 case EZhuyin: |
|
9159 dimmedMenuItem = EChinFepCmdModeZhuyin; |
|
9160 break; |
|
9161 case EStroke: |
|
9162 dimmedMenuItem = EChinFepCmdModeStroke; |
|
9163 break; |
|
9164 case ECangJie: |
|
9165 dimmedMenuItem = EChinFepCmdModeCangJie; |
|
9166 break; |
|
9167 case EZhuyinFind: |
|
9168 dimmedMenuItem = EChinFepCmdModeZhuyinFind; |
|
9169 break; |
|
9170 case EStrokeFind: |
|
9171 dimmedMenuItem = EChinFepCmdModeStrokeFind; |
|
9172 break; |
|
9173 case ELatin: |
|
9174 if ( iLanguageCapabilities.iInputLanguageCode != ELangJapanese) |
|
9175 { |
|
9176 // According Katja's info, dim the current case item in the |
|
9177 // indicator menu. |
|
9178 if ( iCaseMan->CurrentCase() == EAknEditorUpperCase ) |
|
9179 { |
|
9180 dimmedMenuItem = EChinFepCmdModeLatinUpper; |
|
9181 } |
|
9182 else if(iCaseMan->CurrentCase() == EAknEditorLowerCase) |
|
9183 { |
|
9184 dimmedMenuItem = EChinFepCmdModeLatinLower; |
|
9185 } |
|
9186 else if(iCaseMan->CurrentCase() == EAknEditorTextCase) |
|
9187 { |
|
9188 dimmedMenuItem = EAknCmdEditModeLatinText; |
|
9189 } |
|
9190 } |
|
9191 break; |
|
9192 case ENativeNumber: |
|
9193 { |
|
9194 aMenuPane->SetItemDimmed(EAknCmdEditModeArabicIndicNumber, ETrue); |
|
9195 aMenuPane->SetItemDimmed(EAknCmdEditModeEasternArabicIndicNumber, ETrue); |
|
9196 aMenuPane->SetItemDimmed(EAknCmdEditModeIndicNumber, ETrue); |
|
9197 } |
|
9198 break; |
|
9199 default: |
|
9200 break; |
|
9201 } |
|
9202 TInt index; |
|
9203 if (dimmedMenuItem && aMenuPane->MenuItemExists(dimmedMenuItem, index)) |
|
9204 { |
|
9205 aMenuPane->SetItemDimmed(dimmedMenuItem, ETrue); |
|
9206 } |
|
9207 } |
|
9208 |
|
9209 void CAknFepManager::LaunchConfirmationNoteL(TInt aResourceId) |
|
9210 { |
|
9211 SetFlag(EFlagForegroundUIComponentVisible); |
|
9212 iUiInterface->LaunchConfirmationNoteL(aResourceId); |
|
9213 } |
|
9214 |
|
9215 void CAknFepManager::NewCharacterL(const TDesC& aChar) |
|
9216 { |
|
9217 if ( aChar.Length() == 0 ) |
|
9218 { |
|
9219 return; |
|
9220 } |
|
9221 TChar ch = aChar[0]; |
|
9222 |
|
9223 TBool validNewCandidate = CharIsValidInEditor(ch); |
|
9224 // Check if the character is valid for the editor. |
|
9225 if ( !validNewCandidate ) |
|
9226 { |
|
9227 TChar firstNewCandidate = ch; |
|
9228 TBool goneThroughAllCandidates(EFalse); |
|
9229 TPtrC8 sequence = iPtiEngine->CurrentInputSequence(); |
|
9230 |
|
9231 if ( sequence.Length() ) |
|
9232 { |
|
9233 TPtiKey key = (TPtiKey)sequence[0]; |
|
9234 |
|
9235 TBuf<20> mapData; |
|
9236 iPtiEngine->MappingDataForKey(key, mapData, iPtiEngine->Case()); |
|
9237 // If the character was not coming from ptiengine mappings, fail instantly. |
|
9238 if (mapData.Locate(firstNewCandidate) != KErrNotFound) |
|
9239 { |
|
9240 // If there is an ivalid character in chr-loop, try to jump to next valid one. |
|
9241 for (TInt jj = 0; jj < mapData.Length(); jj++) |
|
9242 { |
|
9243 TPtrC text = iPtiEngine->AppendKeyPress(key); |
|
9244 if ( text.Length() == 0 ) |
|
9245 { |
|
9246 continue; |
|
9247 } |
|
9248 ch = text[0]; |
|
9249 goneThroughAllCandidates = (ch == firstNewCandidate); |
|
9250 validNewCandidate = CharIsValidInEditor(ch); |
|
9251 if (validNewCandidate || goneThroughAllCandidates) |
|
9252 { |
|
9253 break; |
|
9254 } |
|
9255 } |
|
9256 } |
|
9257 } |
|
9258 } |
|
9259 if (!validNewCandidate) |
|
9260 { |
|
9261 // No valid characters at all. |
|
9262 CancelInlineEdit(); |
|
9263 return; |
|
9264 } |
|
9265 |
|
9266 if ( (ch == KAknFEPLineFeedSymbol || |
|
9267 ch == KAknFEPMirroredLineFeedSymbol) && |
|
9268 (EditorHasFreeSpace() || IsFlagSet(EFlagLastCharacterInEditor))) |
|
9269 { |
|
9270 SetFlag(EFlagLineFeedCharacter); |
|
9271 } |
|
9272 else |
|
9273 { |
|
9274 ClearFlag(EFlagLineFeedCharacter); |
|
9275 } |
|
9276 |
|
9277 if ( (ch == EKeySpace) && |
|
9278 (EditorHasFreeSpace() || IsFlagSet(EFlagLastCharacterInEditor))) |
|
9279 { |
|
9280 SetFlag(EFlagSpaceCharacter); |
|
9281 } |
|
9282 else |
|
9283 { |
|
9284 ClearFlag(EFlagSpaceCharacter); |
|
9285 } |
|
9286 |
|
9287 |
|
9288 if (iInputCapabilities.SupportsSecretText()) |
|
9289 { |
|
9290 if (IsFlagSet(EFlagInsideMultitapInlineEditingTransaction)) |
|
9291 { |
|
9292 SimulateKeyEventL(EKeyF20); // to delete previous char in secret text editor |
|
9293 } |
|
9294 //we receive an extra key press if we simulate a key that is also a device key |
|
9295 if (ch.IsDigit() || TUint(ch) == EStarKeyUnicodeValue || TUint(ch) == EHashKeyUnicodeValue) |
|
9296 { |
|
9297 SetFlag(EFlagPassNextKey); |
|
9298 } |
|
9299 if ( ch.IsDigit() && iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic ) |
|
9300 { |
|
9301 ClearFlag(EFlagPassNextKey); |
|
9302 SimulateKeyEventL(ch + (TChar)KLatinToArabicIndicDigitsDelta ); |
|
9303 } |
|
9304 else if ( ch.IsDigit() |
|
9305 && iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic ) |
|
9306 { |
|
9307 ClearFlag(EFlagPassNextKey); |
|
9308 if(iLanguageCapabilities.iInputLanguageCode == ELangUrdu |
|
9309 || iLanguageCapabilities.iInputLanguageCode == ELangFarsi) |
|
9310 { |
|
9311 SimulateKeyEventL(ch + (TChar)KLatinToEasternArabicIndicDigitsDelta ); |
|
9312 } |
|
9313 } |
|
9314 else if ( ch.IsDigit() && iLanguageCapabilities.iLocalDigitType == EDigitTypeDevanagari ) |
|
9315 { |
|
9316 ClearFlag(EFlagPassNextKey); |
|
9317 SimulateKeyEventL(ch + (TChar)KLatinToDevanagariDigitsDelta); |
|
9318 } |
|
9319 else |
|
9320 { |
|
9321 SimulateKeyEventL(ch); |
|
9322 } |
|
9323 SetFlag(EFlagInsideMultitapInlineEditingTransaction | EFlagInsideInlineEditingTransaction); |
|
9324 } |
|
9325 else if (EditorHasFreeSpace() || IsFlagSet(EFlagInsideMultitapInlineEditingTransaction)) |
|
9326 { |
|
9327 TBuf<1> buf; |
|
9328 if ( ch.IsDigit() && iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic ) |
|
9329 { |
|
9330 buf.Append( ch + (TChar)KLatinToArabicIndicDigitsDelta ); |
|
9331 } |
|
9332 else if ( ch.IsDigit() |
|
9333 && iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic ) |
|
9334 { |
|
9335 if(iLanguageCapabilities.iInputLanguageCode == ELangUrdu |
|
9336 || iLanguageCapabilities.iInputLanguageCode == ELangFarsi) |
|
9337 { |
|
9338 buf.Append( ch + (TChar)KLatinToEasternArabicIndicDigitsDelta ); |
|
9339 } |
|
9340 } |
|
9341 else if ( ch.IsDigit() && iLanguageCapabilities.iLocalDigitType == EDigitTypeDevanagari ) |
|
9342 { |
|
9343 buf.Append( ch + (TChar)KLatinToDevanagariDigitsDelta ); |
|
9344 } |
|
9345 else |
|
9346 { |
|
9347 buf.Append( ch ); |
|
9348 } |
|
9349 |
|
9350 if (iFepManState == EAknFepStateInitial) //multitapping |
|
9351 { |
|
9352 if (!IsFlagSet(EFlagInsideMultitapInlineEditingTransaction)) |
|
9353 { |
|
9354 TInt edSize = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
9355 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
9356 if (iAknEditorFlags & EAknEditorFlagMTAutoOverwrite && iMode == ELatin |
|
9357 && !WesternPredictive() |
|
9358 && iUncommittedText.iCursorPos < edSize |
|
9359 && iUncommittedText.Length() == 0) |
|
9360 { |
|
9361 // If the cursor is at the beginning or in the middle of the text, |
|
9362 // existing characters are replaced with new ones in latin multitap input. |
|
9363 iUncommittedText.iCursorPos++; |
|
9364 StartInlineEditL(iUncommittedText, buf, ESingleCharacter, EFalse); |
|
9365 SetFlag(EFlagInsideMultitapInlineEditingTransaction); |
|
9366 UpdateInlineEditL(buf, ESingleCharacter); |
|
9367 } |
|
9368 else |
|
9369 { |
|
9370 StartInlineEditL(buf); |
|
9371 SetFlag(EFlagInsideMultitapInlineEditingTransaction); |
|
9372 } |
|
9373 } |
|
9374 else |
|
9375 { |
|
9376 UpdateInlineEditL(buf, ESingleCharacter); |
|
9377 } |
|
9378 |
|
9379 if(!EditorHasFreeSpace()) |
|
9380 { |
|
9381 SetFlag(EFlagLastCharacterInEditor); |
|
9382 } |
|
9383 } |
|
9384 else |
|
9385 { |
|
9386 iInputCapabilities.FepAwareTextEditor()->StartFepInlineEditL(buf, ESingleCharacter, |
|
9387 ETrue, NULL, *this, *this); |
|
9388 } |
|
9389 SetFlag(EFlagInsideInlineEditingTransaction); |
|
9390 } |
|
9391 } |
|
9392 |
|
9393 void CAknFepManager::NewTextL(const TDesC& aText) |
|
9394 { |
|
9395 ClearFlag(EFlagLineFeedCharacter); |
|
9396 TBool unlimit = EFalse; |
|
9397 TInt freeSpace = EditorFreeSpace(unlimit); |
|
9398 |
|
9399 if (IsFlagSet(EFlagInsideMultitapInlineEditingTransaction) || |
|
9400 unlimit || freeSpace > 0 ) // |
|
9401 { |
|
9402 if( unlimit || freeSpace > aText.Length() ) |
|
9403 { |
|
9404 iInputCapabilities.FepAwareTextEditor()->StartFepInlineEditL(aText, aText.Length(), ETrue, |
|
9405 NULL, *this, *this); |
|
9406 } |
|
9407 else |
|
9408 { |
|
9409 iInputCapabilities.FepAwareTextEditor()->StartFepInlineEditL(aText.Left(freeSpace), freeSpace, ETrue, |
|
9410 NULL, *this, *this); |
|
9411 } |
|
9412 |
|
9413 SetFlag(EFlagInsideInlineEditingTransaction); |
|
9414 } |
|
9415 } |
|
9416 |
|
9417 |
|
9418 void CAknFepManager::NewCharacterSequenceL(const TDesC& aText, TIndicInputResponse aResponse) |
|
9419 { |
|
9420 TChar zws((ZERO_WIDTH_SPACE)); |
|
9421 TChar virama((TAknFepUiIndicInputManager::Virama(TLanguage( |
|
9422 iLanguageCapabilities.iInputLanguageCode)))); |
|
9423 TBool ret = ETrue; |
|
9424 TBuf<CAknFepManager::EMaximumFepWordLength> buf; |
|
9425 buf.Zero(); |
|
9426 TBool isTextLayoutPresent = (AknFepDocumentNavigation() || TextLayout()) ? ETrue : EFalse; |
|
9427 switch( aResponse ) |
|
9428 { |
|
9429 case EIndicInputResponseNone: |
|
9430 { |
|
9431 NewCharacterL(aText); |
|
9432 } |
|
9433 break; |
|
9434 case EIndicInputResponseNumber: |
|
9435 { |
|
9436 NewCharacterL(aText); |
|
9437 CommitInlineEditL(); |
|
9438 } |
|
9439 break; |
|
9440 case EIndicInputResponseZWSandCharacter: |
|
9441 { |
|
9442 if (! iInputCapabilities.SupportsSecretText() && isTextLayoutPresent) |
|
9443 { |
|
9444 buf.Append(zws); |
|
9445 NewCharacterL(buf); |
|
9446 CommitInlineEditL(); |
|
9447 } |
|
9448 NewCharacterL(aText); |
|
9449 } |
|
9450 break; |
|
9451 case EIndicInputResponseInsertZWS: |
|
9452 { |
|
9453 buf.Append(virama); |
|
9454 if(isTextLayoutPresent) |
|
9455 buf.Append(zws); |
|
9456 ret = EFalse; |
|
9457 } |
|
9458 break; |
|
9459 case EIndicInputResponseInsertZWSandLigature: |
|
9460 { |
|
9461 buf.Append(virama); |
|
9462 if(isTextLayoutPresent) |
|
9463 buf.Append(zws); |
|
9464 if ( iInputCapabilities.SupportsSecretText() ) |
|
9465 { |
|
9466 buf.Append(aText); |
|
9467 } |
|
9468 ret = EFalse; |
|
9469 } |
|
9470 break; |
|
9471 |
|
9472 case EIndicInputResponseInsertRepha: |
|
9473 { |
|
9474 MCoeFepAwareTextEditor* fepAwareTextEditor = |
|
9475 iInputCapabilities.FepAwareTextEditor(); |
|
9476 |
|
9477 if( fepAwareTextEditor ) |
|
9478 { |
|
9479 TInt nextCharPos = 0; |
|
9480 TCursorSelection curSel; |
|
9481 |
|
9482 fepAwareTextEditor->GetCursorSelectionForFep( curSel ); |
|
9483 |
|
9484 // Insert Repha before the desired syllable. |
|
9485 TBool leftFlag = GetNextVisualLeftCharacter( nextCharPos ); |
|
9486 if( leftFlag ) |
|
9487 { |
|
9488 curSel.iCursorPos = nextCharPos; |
|
9489 curSel.iAnchorPos = nextCharPos; |
|
9490 |
|
9491 fepAwareTextEditor->SetCursorSelectionForFepL( curSel ); |
|
9492 |
|
9493 TAknFepUiIndicInputManager::GetRepha( buf, |
|
9494 TLanguage( iLanguageCapabilities.iInputLanguageCode ) ); |
|
9495 |
|
9496 ret = EFalse; |
|
9497 } |
|
9498 } |
|
9499 break; |
|
9500 } |
|
9501 |
|
9502 case EIndicInputResponseInsertRakar: |
|
9503 { |
|
9504 TAknFepUiIndicInputManager::GetRakar( buf, |
|
9505 TLanguage( iLanguageCapabilities.iInputLanguageCode ) ); |
|
9506 ret = EFalse; |
|
9507 } |
|
9508 break; |
|
9509 #ifdef RD_HINDI_PHONETIC_INPUT |
|
9510 case EIndicInputResponsePhoneticMultitapText: |
|
9511 { |
|
9512 buf.Append(aText); |
|
9513 ret = EFalse; |
|
9514 } |
|
9515 break; |
|
9516 case EIndicInputResponsePhoneticQwertyText: |
|
9517 { |
|
9518 buf.Append(aText); |
|
9519 ret = EFalse; |
|
9520 } |
|
9521 break; |
|
9522 #endif |
|
9523 |
|
9524 case EIndicInputResponseInsertDirectLigature: |
|
9525 { |
|
9526 // In key-0, the new line character preceeds the Ksha. |
|
9527 // First clear the new line flag. |
|
9528 ClearFlag( EFlagLineFeedCharacter ); |
|
9529 |
|
9530 buf.Append( aText ); |
|
9531 ret = EFalse; |
|
9532 } |
|
9533 break; |
|
9534 |
|
9535 case EIndicInputResponseInsertViramaZWSandDirectLigature: |
|
9536 { |
|
9537 // This case handles the insertion of Virama when star key |
|
9538 // is pressed. |
|
9539 |
|
9540 // In key-0, the new line character preceeds the Ksha. |
|
9541 // First clear the new line flag. |
|
9542 ClearFlag( EFlagLineFeedCharacter ); |
|
9543 |
|
9544 buf.Append(virama); |
|
9545 if(isTextLayoutPresent) |
|
9546 buf.Append(zws); |
|
9547 if ( iInputCapabilities.SupportsSecretText() ) |
|
9548 { |
|
9549 buf.Append(aText); |
|
9550 } |
|
9551 ret = EFalse; |
|
9552 } |
|
9553 break; |
|
9554 |
|
9555 case EIndicInputResponseZWSandDirectLigature: |
|
9556 { |
|
9557 if (! iInputCapabilities.SupportsSecretText() && isTextLayoutPresent) |
|
9558 { |
|
9559 buf.Append(zws); |
|
9560 NewCharacterL(buf); |
|
9561 CommitInlineEditL(); |
|
9562 } |
|
9563 buf.Zero(); |
|
9564 buf.Append( aText ); |
|
9565 ret = EFalse; |
|
9566 } |
|
9567 break; |
|
9568 |
|
9569 #ifdef RD_MARATHI |
|
9570 case EIndicInputResponseInsertEyeLashRa: |
|
9571 { |
|
9572 TAknFepUiIndicInputManager::GetEyeLashRa( buf, |
|
9573 (TLanguage)iLanguageCapabilities.iInputLanguageCode ); |
|
9574 ret = EFalse; |
|
9575 } |
|
9576 break; |
|
9577 |
|
9578 case EIndicInputResponseInsertChandraA: |
|
9579 { |
|
9580 TAknFepUiIndicInputManager::GetChandraA( buf ); |
|
9581 ret = EFalse; |
|
9582 } |
|
9583 break; |
|
9584 #endif // RD_MARATHI |
|
9585 |
|
9586 default: |
|
9587 break; |
|
9588 } |
|
9589 |
|
9590 if(ret) |
|
9591 return; |
|
9592 |
|
9593 if ( iInputCapabilities.SupportsSecretText() ) |
|
9594 { |
|
9595 if ( IsFlagSet(EFlagInsideMultitapInlineEditingTransaction) ) |
|
9596 { |
|
9597 SimulateKeyEventL(EKeyF20); // to delete previous char in secret text editor |
|
9598 } |
|
9599 for( TInt counter=0; counter<buf.Length(); counter++ ) |
|
9600 { |
|
9601 if( (buf[counter] != ZERO_WIDTH_SPACE) ) |
|
9602 SimulateKeyEventL(buf[counter]); |
|
9603 } |
|
9604 SetFlag(EFlagInsideMultitapInlineEditingTransaction | EFlagInsideInlineEditingTransaction); |
|
9605 } |
|
9606 else if ( EditorHasFreeSpace() || IsFlagSet(EFlagInsideMultitapInlineEditingTransaction) ) |
|
9607 { |
|
9608 if ( iFepManState == EAknFepStateInitial ) //multitapping |
|
9609 { |
|
9610 if ( !IsFlagSet(EFlagInsideMultitapInlineEditingTransaction) ) |
|
9611 { |
|
9612 TInt edSize = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
9613 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
9614 if (iAknEditorFlags & EAknEditorFlagMTAutoOverwrite && iMode == ELatin |
|
9615 && !WesternPredictive() |
|
9616 && iUncommittedText.iCursorPos < edSize |
|
9617 && iUncommittedText.Length() == 0) |
|
9618 { |
|
9619 // If the cursor is at the beginning or in the middle of the text, |
|
9620 // existing characters are replaced with new ones in latin multitap input. |
|
9621 iUncommittedText.iCursorPos++; |
|
9622 StartInlineEditL(iUncommittedText, buf, ESingleCharacter, EFalse); |
|
9623 } |
|
9624 else |
|
9625 { |
|
9626 StartInlineEditL(); |
|
9627 } |
|
9628 SetFlag(EFlagInsideMultitapInlineEditingTransaction); |
|
9629 } |
|
9630 UpdateInlineEditL(buf, buf.Length()); |
|
9631 |
|
9632 if( !EditorHasFreeSpace() ) |
|
9633 { |
|
9634 SetFlag(EFlagLastCharacterInEditor); |
|
9635 } |
|
9636 } |
|
9637 SetFlag(EFlagInsideInlineEditingTransaction); |
|
9638 |
|
9639 // Check if text needs to be committed |
|
9640 if( ( TAknFepUiIndicInputManager::IsToCommitCharSeq( aResponse ) ) ) |
|
9641 { |
|
9642 CommitInlineEditL(); |
|
9643 } |
|
9644 if( aResponse == EIndicInputResponseInsertZWSandLigature ) |
|
9645 { |
|
9646 NewCharacterL(aText); |
|
9647 } |
|
9648 else if( aResponse == EIndicInputResponseInsertViramaZWSandDirectLigature ) |
|
9649 { |
|
9650 // Doing this here because we first commit the virama |
|
9651 // and ZWS and keep the ligature in the inline buffer. |
|
9652 NewLigatureL( aText ); |
|
9653 } |
|
9654 } |
|
9655 } |
|
9656 |
|
9657 void CAknFepManager::CommitInlineEditL() |
|
9658 { |
|
9659 if ( !IsFlagSet( CAknFepManager::EFlagInsideInlineEditingTransaction ) ) |
|
9660 { |
|
9661 return; |
|
9662 } |
|
9663 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
9664 // Before commit inline, check and close |
|
9665 // tooltip on FSQ first. |
|
9666 SendEventsToPluginManL( EPluginHideTooltip ); |
|
9667 |
|
9668 // Predictive QWERTY (XT9) changes ----> |
|
9669 // Exact word popup is hidden when the inline editor is closed |
|
9670 iExactWordPopupContent->HidePopUp(); |
|
9671 // Predictive QWERTY (XT9) changes <---- |
|
9672 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
9673 if (iInputCapabilities.FepAwareTextEditor()) |
|
9674 { |
|
9675 if (IsFlagSet(EFlagLineFeedCharacter)) |
|
9676 { |
|
9677 if (iInputCapabilities.SupportsSecretText()) |
|
9678 { |
|
9679 SimulateKeyEventL(EKeyF20); // backspace to delete previous char in secret text editor |
|
9680 SimulateKeyEventL(EKeyEnter); |
|
9681 SimulateKeyEventL(EKeyF19); // Asyncronous case update |
|
9682 } |
|
9683 else |
|
9684 { |
|
9685 __ASSERT_DEBUG(iInputCapabilities.FepAwareTextEditor(), |
|
9686 AknFepPanic(EAknFepPanicNoHandleToFepAwareTextEditor)); |
|
9687 iInputCapabilities.FepAwareTextEditor()->SetInlineEditingCursorVisibilityL(ETrue); |
|
9688 iInputCapabilities.FepAwareTextEditor()->CancelFepInlineEdit(); |
|
9689 |
|
9690 // Multitapping enter event is not posted for find pane. |
|
9691 // It would never accept it anyway but the event causes problems in gallery's find. |
|
9692 // Allow real enter from qwerty keyboard though. |
|
9693 if (!(iAknEditorFlags & EAknEditorFlagFindPane) || iQwertyInputMode) |
|
9694 { |
|
9695 SimulateKeyEventL(EKeyEnter); |
|
9696 SimulateKeyEventL(EKeyF19); // Asyncronous case update |
|
9697 } |
|
9698 } |
|
9699 } |
|
9700 else if (IsFlagSet(EFlagSpaceCharacter | EFlagFullWidthSpaceCharacter)) |
|
9701 { |
|
9702 TBuf<ESingleCharacter> charAsDesc(ESingleCharacter); |
|
9703 |
|
9704 if (IsFlagSet(EFlagSpaceCharacter)) |
|
9705 { |
|
9706 charAsDesc[0] = TText(0x0020); // 0x0020 is space |
|
9707 } |
|
9708 else |
|
9709 { |
|
9710 charAsDesc[0] = TText(0x3000); // 0x3000 is full-width space |
|
9711 } |
|
9712 |
|
9713 if (iInputCapabilities.SupportsSecretText()) |
|
9714 { |
|
9715 SimulateKeyEventL(EKeyF20); // backspace to delete previous char in secret text editor |
|
9716 SimulateKeyEventL(charAsDesc[0]); |
|
9717 SimulateKeyEventL(EKeyF19); // Asyncronous case update |
|
9718 } |
|
9719 else |
|
9720 { |
|
9721 iInputCapabilities.FepAwareTextEditor()->UpdateFepInlineTextL(charAsDesc, 1); |
|
9722 iInputCapabilities.FepAwareTextEditor()->SetInlineEditingCursorVisibilityL(ETrue); |
|
9723 CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
9724 iInputCapabilities.FepAwareTextEditor()->CommitFepInlineEditL(*coeEnv); |
|
9725 iCaseMan->UpdateCase(ENullNaviEvent); |
|
9726 if (!EditorHasFreeSpace()) |
|
9727 { |
|
9728 SetFlag(EFlagEditorFull); |
|
9729 } |
|
9730 else |
|
9731 { |
|
9732 ClearFlag(EFlagEditorFull); |
|
9733 } |
|
9734 } |
|
9735 } |
|
9736 else if (IsFlagSet(EFlagInsideInlineEditingTransaction) |
|
9737 && !iInputCapabilities.SupportsSecretText()) |
|
9738 { |
|
9739 // Chinese languages seem not to support this |
|
9740 if ( !IsChineseInputLanguage() && |
|
9741 (iUncommittedText.Length() == 0 || |
|
9742 ( |
|
9743 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
9744 !IsAutoCompleteOn() && |
|
9745 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
9746 !EditorSupportsNeutralProtection() |
|
9747 ) |
|
9748 ) |
|
9749 ) |
|
9750 |
|
9751 { // empty insertions need no resolution. |
|
9752 /*Hindi*/ |
|
9753 if( (TAknFepUiIndicInputManager :: IsIndicLangauge( |
|
9754 TLanguage(iLanguageCapabilities.iInputLanguageCode))) |
|
9755 #ifdef RD_HINDI_PHONETIC_INPUT |
|
9756 || ( TAknFepUiIndicInputManager :: IsIndicPhoneticLanguage( |
|
9757 TLanguage(iLanguageCapabilities.iInputLanguageCode)) ) |
|
9758 #endif |
|
9759 ) |
|
9760 { |
|
9761 // NOTE! Need to get cursor visibility information from some where. |
|
9762 CommitInlineEditWithoutResolutionL( *(iInputCapabilities.FepAwareTextEditor()), |
|
9763 ETrue, EFalse); |
|
9764 } |
|
9765 else |
|
9766 { |
|
9767 // NOTE! Need to get cursor visibility information from some where. |
|
9768 CommitInlineEditWithoutResolutionL( *(iInputCapabilities.FepAwareTextEditor()), |
|
9769 ETrue); |
|
9770 } |
|
9771 } |
|
9772 else |
|
9773 { |
|
9774 |
|
9775 //note secret text editors do not use the MCoeFepAwareTextEditor interface, |
|
9776 //we only need to clear the flags to 'commit' a character |
|
9777 |
|
9778 __ASSERT_DEBUG(iInputCapabilities.FepAwareTextEditor(), |
|
9779 AknFepPanic(EAknFepPanicNoHandleToFepAwareTextEditor)); |
|
9780 CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
9781 |
|
9782 TBool showCursor = ETrue; |
|
9783 if (IsFlagSet(EFlagInsideMultitapInlineEditingTransaction) || |
|
9784 IsCcpuFlagSet(ECcpuStateLosingFocus)) |
|
9785 { |
|
9786 showCursor = EFalse; |
|
9787 } |
|
9788 else |
|
9789 { |
|
9790 if(IsKoreanInputLanguage( ) && IsFlagSet(CAknFepManager::EFlagInsideInlineEditingTransaction)) |
|
9791 { |
|
9792 showCursor = EFalse; |
|
9793 } |
|
9794 } |
|
9795 |
|
9796 iInputCapabilities.FepAwareTextEditor()->SetInlineEditingCursorVisibilityL(showCursor); |
|
9797 ClearFlag(EFlagInsideInlineEditingTransaction); |
|
9798 iInputCapabilities.FepAwareTextEditor()->CommitFepInlineEditL(*coeEnv); |
|
9799 |
|
9800 // Arabic & Hebrew required functionality added ----> |
|
9801 if (IsFlagSet(EFlagInsideMultitapInlineEditingTransaction)) // Condition added for AknFep. |
|
9802 { |
|
9803 // 3 * as each original character can potentially take 2 markers |
|
9804 HBufC* decoratedTextBuf = HBufC::NewLC(KMaxInlineEditSize + 2); // +2 to accommodate previous and next charcaters |
|
9805 TPtr decoratedText = decoratedTextBuf->Des(); |
|
9806 // Resolve in a slightly wider range than the new text. Attempt to expand 1 character in each direction |
|
9807 TCursorSelection resolveSpan(iUncommittedText.HigherPos(), |
|
9808 iUncommittedText.LowerPos()); |
|
9809 TInt decCursor = 0; |
|
9810 |
|
9811 // Gets the CPlainText object from the focused editor if it exists. |
|
9812 CPlainText* plainText = PlainText(); |
|
9813 TBool containsTextField = EFalse; |
|
9814 if (resolveSpan.iAnchorPos > 0) |
|
9815 { |
|
9816 if (plainText) |
|
9817 { |
|
9818 // Check if surrounding document position contains text field. |
|
9819 containsTextField = plainText->FindFields(resolveSpan.iAnchorPos - 1); |
|
9820 } |
|
9821 TBuf<ESingleCharacter> chDes; |
|
9822 iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep( chDes, |
|
9823 resolveSpan.iAnchorPos - 1, ESingleCharacter); |
|
9824 if ( chDes.Length() != 0 && chDes[0] != CEditableText::EPictureCharacter && !containsTextField) |
|
9825 { |
|
9826 // Resolve span is not extended if surrounding character is picture character or it |
|
9827 // contains text field. Text field data would be lost when FEP replaces existing editor |
|
9828 // content with new text buffer content that does not have text field data. |
|
9829 // ResolveDecoratedText() call does not handle these special cases which can has some |
|
9830 // effects to Arabic & Hebrew text rendering. |
|
9831 resolveSpan.iAnchorPos--; |
|
9832 } |
|
9833 } |
|
9834 if (resolveSpan.iCursorPos < |
|
9835 iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep()) |
|
9836 { |
|
9837 containsTextField = EFalse; |
|
9838 if (plainText) |
|
9839 { |
|
9840 // Check if surrounding document position contains text fields. |
|
9841 containsTextField = plainText->FindFields(resolveSpan.iCursorPos); |
|
9842 } |
|
9843 TBuf<ESingleCharacter> chDes; |
|
9844 iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep( chDes, |
|
9845 resolveSpan.iCursorPos, ESingleCharacter); |
|
9846 if ( chDes.Length() != 0 && chDes[0] != CEditableText::EPictureCharacter && !containsTextField) |
|
9847 { |
|
9848 // Resolve span is not extended if surrounding character is picture character or it |
|
9849 // contains text field. Text field data would be lost when FEP replaces existing editor |
|
9850 // content with new text buffer content that does not have text field data. |
|
9851 // ResolveDecoratedText() call does not handle these special cases which can has some |
|
9852 // effect to Arabic & Hebrew text rendering. |
|
9853 resolveSpan.iCursorPos++; |
|
9854 decCursor++; |
|
9855 } |
|
9856 } |
|
9857 |
|
9858 // resolveSpan has been widened. Now go get the text for that span. |
|
9859 iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(decoratedText, |
|
9860 resolveSpan.iAnchorPos, resolveSpan.Length()); |
|
9861 |
|
9862 if ( decoratedText.Length() != resolveSpan.Length() ) |
|
9863 { |
|
9864 // This assert checks is we have failed to retrieve enough text. Should not happen |
|
9865 // __ASSERT_DEBUG( decoratedText.Length() == resolveSpan.Length(), Panic(EEikPanicT9CharPosOutOfRange) ); |
|
9866 // Abondon the resolution. |
|
9867 |
|
9868 iInputCapabilities.FepAwareTextEditor()->SetInlineEditingCursorVisibilityL( ETrue ); |
|
9869 } |
|
9870 else |
|
9871 { |
|
9872 TInt lowerOffset = iUncommittedText.LowerPos() - resolveSpan.LowerPos(); |
|
9873 |
|
9874 TBool needsResolving = iInlineTextDecorator->ResolveDecoratedText(decoratedText, |
|
9875 TCursorSelection(lowerOffset, lowerOffset + iUncommittedText.Length())); |
|
9876 |
|
9877 if ( needsResolving ) |
|
9878 { |
|
9879 TBool setToTrue=EFalse; |
|
9880 iInputCapabilities.FepAwareTextEditor()->Extension1()->StartFepInlineEditL( |
|
9881 setToTrue, |
|
9882 resolveSpan, |
|
9883 decoratedText, |
|
9884 decoratedText.Length() - decCursor, |
|
9885 EFalse, |
|
9886 0, // MFormCustomDrawer* |
|
9887 *this, |
|
9888 *this); |
|
9889 |
|
9890 iInputCapabilities.FepAwareTextEditor()->SetInlineEditingCursorVisibilityL( ETrue ); |
|
9891 if (IsFeatureSupportedJapanese()) |
|
9892 { |
|
9893 // need to call clear buffer of PtiEngine for Japanese varint |
|
9894 // before calling second CommitFepInlineEditL(). |
|
9895 // because the committed string is set as reading string twice |
|
9896 iPtiEngine->ClearCurrentWord(); |
|
9897 } |
|
9898 iInputCapabilities.FepAwareTextEditor()->CommitFepInlineEditL(*coeEnv); |
|
9899 } |
|
9900 else |
|
9901 { |
|
9902 // Go directly via CTextView because the normal way via the FepAwareEditor can only be called |
|
9903 // during an inline edit. |
|
9904 // Line cursor is made invisible here. There is no line cursor in S60 LAF, even though there is |
|
9905 // an Edwin flag which govern this. See CEikEdwin::SetCursorVisibilityL(TBool) |
|
9906 // Cursor is not set if this CommitInlineEditL call was prompted when losing focus. |
|
9907 MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
9908 if ( (docNavi || TextView()) && !IsCcpuFlagSet(ECcpuStateLosingFocus) ) |
|
9909 { |
|
9910 if (docNavi) |
|
9911 { |
|
9912 docNavi->SetCursorVisibilityL( TCursor::EFCursorInvisible, |
|
9913 TCursor::EFCursorFlashing ); |
|
9914 } |
|
9915 else |
|
9916 { |
|
9917 TextView()->SetCursorVisibilityL( TCursor::EFCursorInvisible, |
|
9918 TCursor::EFCursorFlashing ); |
|
9919 } |
|
9920 } |
|
9921 } |
|
9922 } |
|
9923 // iMatchState=EWordMatchFirst; |
|
9924 |
|
9925 CleanupStack::PopAndDestroy(); // decoratedTextBuf |
|
9926 } |
|
9927 if (iInputCapabilities.FepAwareTextEditor()) |
|
9928 { |
|
9929 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
9930 } |
|
9931 |
|
9932 iCaseMan->UpdateCase(ENullNaviEvent); |
|
9933 // <---- Arabic & Hebrew required functionality added |
|
9934 if (!EditorHasFreeSpace()) |
|
9935 { |
|
9936 SetFlag(EFlagEditorFull); |
|
9937 } |
|
9938 else |
|
9939 { |
|
9940 ClearFlag(EFlagEditorFull); |
|
9941 } |
|
9942 } |
|
9943 } |
|
9944 else if (IsFlagSet(EFlagInsideInlineEditingTransaction) |
|
9945 && iInputCapabilities.SupportsSecretText()) |
|
9946 { |
|
9947 CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
9948 iInputCapabilities.FepAwareTextEditor()->CommitFepInlineEditL(*coeEnv); |
|
9949 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
9950 |
|
9951 if (iQwertyInputMode) |
|
9952 { |
|
9953 // Case may need to updated automatically in case of qwerty secret text editor |
|
9954 // beause of the sticky shift feature. |
|
9955 if (iCaseMan->CurrentCase() == EAknEditorLowerCase) |
|
9956 { |
|
9957 SetCase(ELowerCase); |
|
9958 } |
|
9959 else |
|
9960 { |
|
9961 SetCase(EUpperCase); |
|
9962 } |
|
9963 UpdateIndicators(); |
|
9964 } |
|
9965 } |
|
9966 } |
|
9967 |
|
9968 // SendEventsToPluginManL( EPluginSyncFepAwareText, EPluginSyncUpdatedText ); |
|
9969 |
|
9970 ClearFlag(EFlagInsideMultitapInlineEditingTransaction | EFlagInsideInlineEditingTransaction | |
|
9971 EFlagLineFeedCharacter | EFlagLastCharacterInEditor | EFlagSpaceCharacter | |
|
9972 EFlagFullWidthSpaceCharacter); |
|
9973 |
|
9974 // No-edit_key devices: Inline editing ending, allow edit-menu again. |
|
9975 ClearCcpuFlag(ECcpuStateIgnoreStarUp | ECcpuStateNewPredictiveWord); |
|
9976 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
9977 iUncommittedText.iCursorPos=0; |
|
9978 iUncommittedText.iAnchorPos=0; |
|
9979 #endif |
|
9980 if (!iInputCapabilities.FepAwareTextEditor()) |
|
9981 { |
|
9982 // In case while updating the inline edit, 3rd party app removes the focus out of editor before the transaction |
|
9983 // completes, we return with an error. |
|
9984 User::Leave(KErrCorrupt); |
|
9985 } |
|
9986 |
|
9987 } |
|
9988 |
|
9989 void CAknFepManager::CommitInlineEditL(const TDesC& aText, TInt aUncommitedTextChange) |
|
9990 { |
|
9991 if (iMode == EHiraganaKanji) |
|
9992 { |
|
9993 // When there is not enough editing space to enter the selected candidate, |
|
9994 // the error tone is played. |
|
9995 if ((iFreeSpaceOfEditor > 0) && (iFreeSpaceOfEditor < aText.Length())) |
|
9996 { |
|
9997 PlaySound(EAvkonSIDErrorTone); |
|
9998 } |
|
9999 } |
|
10000 |
|
10001 //maxLength of 0 means the editor has no limit |
|
10002 TInt maxEdSize = iInputCapabilities.FepAwareTextEditor()->DocumentMaximumLengthForFep(); |
|
10003 if ( maxEdSize != 0 && iFreeSpaceOfEditor < aText.Length()) |
|
10004 { |
|
10005 TPtrC charbuf = aText.Left(iFreeSpaceOfEditor); |
|
10006 TInt uncommitedTextChange = charbuf.Length(); |
|
10007 UpdateInlineEditL(charbuf, uncommitedTextChange); |
|
10008 } |
|
10009 else |
|
10010 { |
|
10011 UpdateInlineEditL(aText, aUncommitedTextChange); |
|
10012 } |
|
10013 |
|
10014 ClearFlag(EFlagInsideMultitapInlineEditingTransaction); |
|
10015 CommitInlineEditL(); |
|
10016 } |
|
10017 |
|
10018 void CAknFepManager::CancelInlineEdit() |
|
10019 { |
|
10020 if( !EditorState()->CurrentInlineEditSpan().Length() ) |
|
10021 { |
|
10022 ClearFlag(EFlagInsideInlineEditingTransaction); |
|
10023 if(IsFlagSet(CAknFepManager::EFlagNoMatches)) |
|
10024 { |
|
10025 ClearFlag(CAknFepManager::EFlagNoMatches); |
|
10026 } |
|
10027 } |
|
10028 if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
10029 { |
|
10030 TRAP_IGNORE(TryRemoveNoMatchesIndicatorL()); |
|
10031 |
|
10032 if (iInputCapabilities.SupportsSecretText()) |
|
10033 { |
|
10034 TRAP_IGNORE(SimulateKeyEventL(EKeyF20)); // backspace to delete previous char in secret text editor |
|
10035 } |
|
10036 else if (IsFeatureSupportedJapanese() |
|
10037 && iFepManState == EAknFepStateUIActive) |
|
10038 { |
|
10039 FepUI()->CloseUI(); |
|
10040 FepUI()->ExpireMultitapTimer(); |
|
10041 iPtiEngine->ClearCurrentWord(); |
|
10042 SyncStates(EAknFepStateInitial); |
|
10043 } |
|
10044 } |
|
10045 |
|
10046 iUncommittedText.iCursorPos=0; |
|
10047 |
|
10048 iUncommittedText.iAnchorPos=0; |
|
10049 |
|
10050 iInputCapabilities.FepAwareTextEditor()->CancelFepInlineEdit(); |
|
10051 ClearFlag(EFlagInsideMultitapInlineEditingTransaction | EFlagInsideInlineEditingTransaction |
|
10052 | EFlagLineFeedCharacter | EFlagSpaceCharacter | EFlagFullWidthSpaceCharacter); |
|
10053 ClearCcpuFlag(ECcpuStateNewPredictiveWord); |
|
10054 } |
|
10055 |
|
10056 void CAknFepManager::GetScreenCoordinatesL(TPoint& aLeftSideOfBaseLine, TInt& aHeight, |
|
10057 TInt& aAscent, TInt aDocumentOffset) |
|
10058 { |
|
10059 TCursorSelection cursorSelection; |
|
10060 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(cursorSelection); |
|
10061 TInt documentPosition = cursorSelection.LowerPos() - aDocumentOffset; |
|
10062 if (documentPosition < 0) |
|
10063 documentPosition = 0; |
|
10064 iInputCapabilities.FepAwareTextEditor()->GetScreenCoordinatesForFepL(aLeftSideOfBaseLine, |
|
10065 aHeight, aAscent, documentPosition); |
|
10066 } |
|
10067 |
|
10068 void CAknFepManager::GetScreenCoordinatesL(TPoint& aLeftSideOfBaseLine, |
|
10069 TInt& aHeight, TInt& aAscent) |
|
10070 { |
|
10071 TCursorSelection cursorSelection; |
|
10072 MCoeFepAwareTextEditor* fepAwareTextEditor = iInputCapabilities.FepAwareTextEditor(); |
|
10073 |
|
10074 fepAwareTextEditor->GetCursorSelectionForFep(cursorSelection); |
|
10075 fepAwareTextEditor->GetScreenCoordinatesForFepL(aLeftSideOfBaseLine, aHeight, aAscent, |
|
10076 cursorSelection.LowerPos()); |
|
10077 } |
|
10078 |
|
10079 TBool CAknFepManager::EditorHasFreeSpace( TInt aRequiredNumberOfCharacter ) const |
|
10080 { |
|
10081 TBool unlimit = EFalse; |
|
10082 TInt freeSpace = 0; |
|
10083 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
10084 if(WesternPredictive()) |
|
10085 { |
|
10086 freeSpace = EditorFreeSpaceForAutoWordCompletion(unlimit); |
|
10087 } |
|
10088 else |
|
10089 { |
|
10090 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
10091 freeSpace = EditorFreeSpace(unlimit); |
|
10092 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
10093 } |
|
10094 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
10095 if( unlimit || freeSpace > aRequiredNumberOfCharacter ) |
|
10096 { |
|
10097 return ETrue; |
|
10098 } |
|
10099 return EFalse; |
|
10100 } |
|
10101 |
|
10102 TBool CAknFepManager::IsEditorHasFreeSpace() const |
|
10103 { |
|
10104 TBool unlimit = EFalse; |
|
10105 TInt freeSpace = 0; |
|
10106 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
10107 if(WesternPredictive()) |
|
10108 { |
|
10109 freeSpace = EditorFreeSpaceForAutoWordCompletion(unlimit); |
|
10110 } |
|
10111 else |
|
10112 { |
|
10113 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
10114 freeSpace = EditorFreeSpace(unlimit); |
|
10115 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
10116 } |
|
10117 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
10118 if( unlimit || freeSpace > 0 ) |
|
10119 { |
|
10120 return ETrue; |
|
10121 } |
|
10122 return EFalse; |
|
10123 } |
|
10124 |
|
10125 TInt CAknFepManager::EditorFreeSpace(TBool& aUnlimit, |
|
10126 TBool isToCountUncommittedTextLength /*= EFalse */) const |
|
10127 { |
|
10128 aUnlimit = EFalse; |
|
10129 |
|
10130 if (!iInputCapabilities.FepAwareTextEditor()) |
|
10131 { |
|
10132 //no handle to MCoeFepAwareTextEditor in non Edwin derived editors |
|
10133 return 0; |
|
10134 } |
|
10135 |
|
10136 //maxLength of 0 means the editor has no limit |
|
10137 TInt maxEdSize = iInputCapabilities.FepAwareTextEditor()->DocumentMaximumLengthForFep(); |
|
10138 TInt edSize = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
10139 TCursorSelection currentSelection; |
|
10140 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(currentSelection); |
|
10141 |
|
10142 aUnlimit = (maxEdSize == 0 || ((iAknEditorFlags & EAknEditorFlagMTAutoOverwrite) && |
|
10143 (currentSelection.iCursorPos >= 0 && |
|
10144 currentSelection.iCursorPos < maxEdSize) )); |
|
10145 if(aUnlimit) |
|
10146 { |
|
10147 return 0; |
|
10148 } |
|
10149 else |
|
10150 { |
|
10151 if( isToCountUncommittedTextLength ) |
|
10152 { |
|
10153 return ( maxEdSize - edSize + |
|
10154 currentSelection.Length() + UncommittedText().Length() ); |
|
10155 } |
|
10156 return (maxEdSize - edSize + currentSelection.Length()); |
|
10157 } |
|
10158 } |
|
10159 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
10160 TInt CAknFepManager::EditorFreeSpaceForAutoWordCompletion(TBool& aUnlimit, |
|
10161 TBool /* isToCountUncommittedTextLength = EFalse*/ ) const |
|
10162 { |
|
10163 aUnlimit = EFalse; |
|
10164 |
|
10165 if (!iInputCapabilities.FepAwareTextEditor()) |
|
10166 { |
|
10167 //no handle to MCoeFepAwareTextEditor in non Edwin derived editors |
|
10168 return 0; |
|
10169 } |
|
10170 |
|
10171 //maxLength of 0 means the editor has no limit |
|
10172 TInt maxEdSize = iInputCapabilities.FepAwareTextEditor()->DocumentMaximumLengthForFep(); |
|
10173 TInt edSize = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
10174 TInt keySequenceLength = iPtiEngine->CurrentInputSequence().Length(); |
|
10175 TCursorSelection currentSelectionOrUncommitted; |
|
10176 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(currentSelectionOrUncommitted); |
|
10177 |
|
10178 aUnlimit = (maxEdSize == 0 || ((iAknEditorFlags & EAknEditorFlagMTAutoOverwrite) && |
|
10179 (currentSelectionOrUncommitted.iCursorPos >= 0 && |
|
10180 currentSelectionOrUncommitted.iCursorPos < maxEdSize) )); |
|
10181 if(aUnlimit) |
|
10182 { |
|
10183 return 0; |
|
10184 } |
|
10185 else |
|
10186 { |
|
10187 |
|
10188 if ( !iQwertyInputMode ) |
|
10189 { |
|
10190 return ( maxEdSize - edSize + currentSelectionOrUncommitted.Length() ); |
|
10191 } |
|
10192 else |
|
10193 { |
|
10194 // In the predictive QWERTY mode, the keySequenceLength doesn't necessarily have anything |
|
10195 // to do with the amount of characters on screen. At least entering accented characters with |
|
10196 // Chr-multitapping will increase the key sequence length although number of characters |
|
10197 // doesn't change (this is either bug or feature of ZiCore). Ask the auto-completion |
|
10198 // length directly from PtiEngine instead of trying to calculate it on our own. |
|
10199 TInt tailLength = 0; |
|
10200 TRAP_IGNORE(iPtiEngine->HandleCommandL( EPtiCommandGetAutoCompletionTailLength, &tailLength )); |
|
10201 if( tailLength < 0 ) |
|
10202 { |
|
10203 tailLength = 0; |
|
10204 } |
|
10205 return (maxEdSize - edSize + currentSelectionOrUncommitted.Length() + tailLength); |
|
10206 } |
|
10207 } |
|
10208 } |
|
10209 #endif |
|
10210 #ifdef __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__ |
|
10211 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
10212 |
|
10213 TInt CAknFepManager::DocumentLength() const |
|
10214 { |
|
10215 TInt ret = 0; |
|
10216 if ( iInputCapabilities.FepAwareTextEditor() ) |
|
10217 { |
|
10218 ret = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
10219 } |
|
10220 return ret; |
|
10221 } |
|
10222 |
|
10223 TBool CAknFepManager::KeyEventWillReplaceCharacter( const TKeyEvent& aKeyEvent ) |
|
10224 { |
|
10225 // The function is currently used only in QWERTY mode. It might not work correctly |
|
10226 // with ITU-T input. |
|
10227 TBool ret = EFalse; |
|
10228 if ( IsFlagSet(EFlagInsideMultitapInlineEditingTransaction) ) |
|
10229 { |
|
10230 // Multitapping |
|
10231 ret = ETrue; |
|
10232 } |
|
10233 else if ( aKeyEvent.iRepeats && |
|
10234 LongPressNumberEntryOnQwerty() && |
|
10235 FnKeyState() == CAknFepFnKeyManager::EFnKeyNone && |
|
10236 KeyMapsDifferentCharacterWithFn( (TPtiKey)aKeyEvent.iScanCode ) ) |
|
10237 { |
|
10238 // QWERTY key long press producing another charcter |
|
10239 ret = ETrue; |
|
10240 } |
|
10241 return ret; |
|
10242 } |
|
10243 #endif |
|
10244 #endif |
|
10245 TChar CAknFepManager::CurrentDecimalSeparator() const |
|
10246 { |
|
10247 TLocale tLoc; |
|
10248 return tLoc.DecimalSeparator(); |
|
10249 } |
|
10250 |
|
10251 void CAknFepManager::ConfigureFEPFromEditorStateL() |
|
10252 { |
|
10253 User::LeaveIfError(SyncStates(EAknFepStateInitial)); |
|
10254 |
|
10255 CAknEdwinState* editorState = EditorState(); |
|
10256 TInt editorMode = editorState->CurrentInputMode(); |
|
10257 TInt sharedDataMode = iSharedDataInterface->InputMode(); |
|
10258 TBool latinCaseSet = EFalse; |
|
10259 iPermittedInputModes = editorState->PermittedInputModes(); |
|
10260 TInt defaultInputMode = editorState->DefaultInputMode(); |
|
10261 if(iAknEditorFlags != editorState->Flags()) |
|
10262 { |
|
10263 iAknEditorFlags = editorState->Flags(); |
|
10264 UpdateLocalDigitMode(); |
|
10265 } |
|
10266 iAknEditorNumericKeymap = editorState->NumericKeymap(); |
|
10267 |
|
10268 TLanguage localLanguage = ELangTest; |
|
10269 if (GetLocalLanguage( localLanguage ) ) |
|
10270 { |
|
10271 iLanguageCapabilities.iLocalInputLanguageInUse = ETrue; |
|
10272 if ( localLanguage != iLanguageCapabilities.iInputLanguageCode ) |
|
10273 { |
|
10274 ChangeInputLanguageL(localLanguage); |
|
10275 } |
|
10276 } |
|
10277 else if (iLanguageCapabilities.iLocalInputLanguageInUse) |
|
10278 { |
|
10279 ChangeInputLanguageL(iSharedDataInterface->InputTextLanguage()); |
|
10280 iLanguageCapabilities.iLocalInputLanguageInUse = EFalse; |
|
10281 ClearFlag(EFlagNewSharedDataInputMode); |
|
10282 } |
|
10283 |
|
10284 if (IsFlagSet(EFlagNewSharedDataInputLanguage) ) |
|
10285 { |
|
10286 //Global mode or input language has been changed in general settings |
|
10287 if ( !iLanguageCapabilities.iLocalInputLanguageInUse) |
|
10288 { |
|
10289 ChangeInputLanguageL(iSharedDataInterface->InputTextLanguage()); |
|
10290 } |
|
10291 ClearFlag(EFlagNewSharedDataInputLanguage); |
|
10292 } |
|
10293 |
|
10294 if (IsFeatureSupportedJapanese()) |
|
10295 { |
|
10296 // set Japanese predicitve ON/OFF |
|
10297 if (iAknEditorFlags & EAknEditorFlagNoT9) |
|
10298 { |
|
10299 iJapanesePredictive = EFalse; |
|
10300 } |
|
10301 else |
|
10302 { |
|
10303 // Is it supported Japanese predictive input |
|
10304 if (HasJapanesePredictionInputMode()) |
|
10305 { |
|
10306 iJapanesePredictive = iSharedDataInterface->PredictiveTextJapaneseOn(); |
|
10307 } |
|
10308 else |
|
10309 { |
|
10310 // if Predictive Japanese input isn't supported in PtiEngine, set to OFF. |
|
10311 iJapanesePredictive = EFalse; |
|
10312 iSharedDataInterface->ResetJapanesePredictiveTextOn(); |
|
10313 } |
|
10314 } |
|
10315 |
|
10316 // In Japanese variant, EAknEditorTextInputMode of allow input mode |
|
10317 // means all input mode. |
|
10318 if (iPermittedInputModes & EAknEditorTextInputMode) |
|
10319 { |
|
10320 iPermittedInputModes |= (EAknEditorKatakanaInputMode | |
|
10321 EAknEditorHalfWidthTextInputMode | |
|
10322 EAknEditorFullWidthTextInputMode | |
|
10323 EAknEditorFullWidthNumericInputMode | |
|
10324 EAknEditorFullWidthKatakanaInputMode | |
|
10325 EAknEditorHiraganaKanjiInputMode | |
|
10326 EAknEditorHiraganaInputMode); |
|
10327 } |
|
10328 |
|
10329 if (iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) |
|
10330 { |
|
10331 if (iPermittedInputModes == EAknEditorNumericInputMode) |
|
10332 { |
|
10333 iPermittedInputModes = EAknEditorNumericInputMode; |
|
10334 } |
|
10335 else if (iPermittedInputModes & EAknEditorNumericInputMode) |
|
10336 { |
|
10337 iPermittedInputModes = (EAknEditorHalfWidthTextInputMode |
|
10338 | EAknEditorNumericInputMode); |
|
10339 } |
|
10340 else |
|
10341 { |
|
10342 iPermittedInputModes = EAknEditorHalfWidthTextInputMode; |
|
10343 } |
|
10344 } |
|
10345 |
|
10346 if (editorMode) |
|
10347 { |
|
10348 editorMode = ConfigureFepModeFromEditorMode(editorMode); |
|
10349 } |
|
10350 else // for new editors |
|
10351 { |
|
10352 iCharWidth = EHalfWidthChar; |
|
10353 sharedDataMode = EHiraganaKanji; |
|
10354 // First input mode is changed to Latin from Hiragana/Kanji |
|
10355 // if display language is English. |
|
10356 TInt dispLang = iSharedDataInterface->DisplayLanguage(); |
|
10357 // ELangTest means Automatic as display language in GS |
|
10358 if (dispLang == ELangTest) |
|
10359 { |
|
10360 // UiLanguage isn't Japanese, Latin is set. |
|
10361 if (iUiLanguage != ELangJapanese) |
|
10362 { |
|
10363 sharedDataMode = ELatin; |
|
10364 } |
|
10365 } |
|
10366 else if (dispLang != ELangJapanese) |
|
10367 { |
|
10368 // Display language isn't Japanese, Latin is set. |
|
10369 sharedDataMode = ELatin; |
|
10370 } |
|
10371 |
|
10372 if (!(iPermittedInputModes & EAknEditorHiraganaKanjiInputMode)) |
|
10373 { |
|
10374 if (IsOnlyFullWidthCharacterPermitted()) |
|
10375 { |
|
10376 iCharWidth = EFullWidthChar; |
|
10377 } |
|
10378 else if (IsOnlyHalfWidthCharacterPermitted()) |
|
10379 { |
|
10380 iCharWidth = EHalfWidthChar; |
|
10381 } |
|
10382 |
|
10383 if (iPermittedInputModes & (EAknEditorKatakanaInputMode | |
|
10384 EAknEditorFullWidthKatakanaInputMode)) |
|
10385 { |
|
10386 // In case setting Latin as above, Latin is used preferentially. |
|
10387 if (sharedDataMode == ELatin |
|
10388 && (iPermittedInputModes & |
|
10389 (EAknEditorHalfWidthTextInputMode | EAknEditorFullWidthTextInputMode))) |
|
10390 { |
|
10391 sharedDataMode = ELatin; |
|
10392 } |
|
10393 else |
|
10394 { |
|
10395 sharedDataMode = EKatakana; |
|
10396 } |
|
10397 } |
|
10398 else if (iPermittedInputModes & (EAknEditorHalfWidthTextInputMode | |
|
10399 EAknEditorFullWidthTextInputMode)) |
|
10400 { |
|
10401 sharedDataMode = ELatin; |
|
10402 } |
|
10403 else if (iPermittedInputModes & (EAknEditorNumericInputMode | |
|
10404 EAknEditorFullWidthNumericInputMode)) |
|
10405 { |
|
10406 sharedDataMode = ENumber; |
|
10407 } |
|
10408 // First input mode is changed to latin from katakana |
|
10409 // if display language is English. |
|
10410 if (!(dispLang == ELangTest || dispLang == ELangJapanese)) |
|
10411 { |
|
10412 if ((iPermittedInputModes & EAknEditorKatakanaInputMode) && |
|
10413 (iPermittedInputModes & EAknEditorHalfWidthTextInputMode)) |
|
10414 { |
|
10415 sharedDataMode = ELatin; |
|
10416 } |
|
10417 |
|
10418 if ((iPermittedInputModes & EAknEditorKatakanaInputMode) && |
|
10419 (iPermittedInputModes & EAknEditorFullWidthTextInputMode)) |
|
10420 { |
|
10421 sharedDataMode = ELatin; |
|
10422 } |
|
10423 } |
|
10424 } |
|
10425 } |
|
10426 } |
|
10427 else // for other variants (western or chinese) |
|
10428 { |
|
10429 if (!(iPermittedInputModes & (EAknEditorTextInputMode | EAknEditorNumericInputMode |
|
10430 | EAknEditorSecretAlphaInputMode))) |
|
10431 { |
|
10432 // Any latin input mode is not permitted by the editor. |
|
10433 // For compatibility permitted japanese input modes are checked and |
|
10434 // corresponding latin input modes are allowed. |
|
10435 if ( iPermittedInputModes & (EAknEditorKatakanaInputMode | |
|
10436 EAknEditorHalfWidthTextInputMode | |
|
10437 EAknEditorFullWidthTextInputMode | |
|
10438 EAknEditorFullWidthKatakanaInputMode | |
|
10439 EAknEditorHiraganaKanjiInputMode | |
|
10440 EAknEditorHiraganaInputMode)) |
|
10441 { |
|
10442 iPermittedInputModes |= EAknEditorTextInputMode; |
|
10443 } |
|
10444 if ( iPermittedInputModes & EAknEditorFullWidthNumericInputMode ) |
|
10445 { |
|
10446 iPermittedInputModes |= EAknEditorNumericInputMode; |
|
10447 } |
|
10448 |
|
10449 if ( !(defaultInputMode & (EAknEditorTextInputMode | EAknEditorNumericInputMode))) |
|
10450 { |
|
10451 if (defaultInputMode & (EAknEditorKatakanaInputMode | |
|
10452 EAknEditorHalfWidthTextInputMode| |
|
10453 EAknEditorFullWidthTextInputMode | |
|
10454 EAknEditorFullWidthKatakanaInputMode | |
|
10455 EAknEditorHiraganaKanjiInputMode | |
|
10456 EAknEditorHiraganaInputMode)) |
|
10457 { |
|
10458 defaultInputMode = EAknEditorTextInputMode; |
|
10459 } |
|
10460 else if (defaultInputMode & EAknEditorFullWidthNumericInputMode) |
|
10461 { |
|
10462 defaultInputMode = EAknEditorNumericInputMode; |
|
10463 } |
|
10464 } |
|
10465 } |
|
10466 } |
|
10467 |
|
10468 // object provider items |
|
10469 iEditMenuBar = NULL; |
|
10470 editorState->SetMenu(); |
|
10471 editorState->SetCba(); |
|
10472 |
|
10473 #ifdef __ITI_VIRTUAL_TOUCH_FIRST_GENERATION_SUPPORT__ |
|
10474 iOptionsMenuBar = NULL; |
|
10475 #endif |
|
10476 |
|
10477 SetWesternPredictive(iSharedDataInterface->PredictiveTextOn()); |
|
10478 //check that we don't have a Chinese find mode saved to an editor that is |
|
10479 //not a Chinese find pane |
|
10480 __ASSERT_DEBUG( !((editorMode == EZhuyinFind || editorMode == EStrokeFind) && |
|
10481 !(iAknEditorFlags & EAknEditorFlagForceTransparentFepModes)) |
|
10482 , AknFepPanic(EAknFepPanicFindModeSavedToNonFindEditor)); |
|
10483 |
|
10484 ReadHashKeyLoopL(); |
|
10485 |
|
10486 UpdateNumericEditorDigitType(); |
|
10487 if ( IsMfneEditor() ) |
|
10488 { |
|
10489 UpdateLocalDigitMode(); |
|
10490 } |
|
10491 |
|
10492 if (editorMode) //should be an editor that has been used before |
|
10493 { |
|
10494 if (IsFlagSet(EFlagNewSharedDataInputMode) && (IsModePermitted(sharedDataMode)) && !IsKoreanInputLanguage() |
|
10495 && (!(iAknEditorFlags & EAknEditorFlagForceTransparentFepModes))) |
|
10496 { |
|
10497 |
|
10498 { |
|
10499 //change to global mode, except in Find Pane, where we ignore |
|
10500 //GS setting |
|
10501 TryChangeModeL(sharedDataMode); |
|
10502 ClearFlag(EFlagNewSharedDataInputMode); |
|
10503 latinCaseSet = sharedDataMode & (ELatinUpper | ELatinLower); |
|
10504 if (sharedDataMode == ELatinText) |
|
10505 { |
|
10506 editorState->SetFlags( editorState->Flags() & ~EFlagSupressAutoUpdate ); |
|
10507 } |
|
10508 } |
|
10509 } |
|
10510 |
|
10511 // Next two cases are apps/UI intitialinsg their editors in the |
|
10512 // with the modes defined in uikon.hrh, change these to an appropriate |
|
10513 // FEP mode |
|
10514 else if (editorMode == EAknEditorNumericInputMode) |
|
10515 { |
|
10516 iCharWidth = EHalfWidthChar; |
|
10517 if ( (iMode == ENumber || iMode == ENativeNumber) && |
|
10518 IsModePermitted(iMode)) |
|
10519 { |
|
10520 TryChangeModeL( iMode ); |
|
10521 } |
|
10522 else if ( IsInputModeAvailable(ENativeNumber) && |
|
10523 ( iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic || |
|
10524 iLanguageCapabilities.iLocalDigitType == EDigitTypeDevanagari || |
|
10525 iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic ) ) |
|
10526 { |
|
10527 TryChangeModeL( ENativeNumber ); |
|
10528 } |
|
10529 else |
|
10530 { |
|
10531 TryChangeModeL( ENumber ); |
|
10532 } |
|
10533 } |
|
10534 else if (editorMode == EAknEditorSecretAlphaInputMode) |
|
10535 { |
|
10536 //this is safe default as it is currently allowed in all FEPs |
|
10537 SetWesternPredictive(EFalse); |
|
10538 TryChangeModeL(ELatin); |
|
10539 } |
|
10540 else if (editorMode == EAknEditorTextInputMode) |
|
10541 { |
|
10542 if (IsKoreanInputLanguage()) |
|
10543 { |
|
10544 if(iMode == EHangul || iMode == ENumber || iMode == EAknEditorNullInputMode ) |
|
10545 { |
|
10546 SetWesternPredictive(EFalse); |
|
10547 TryChangeModeL(EHangul); |
|
10548 } |
|
10549 else |
|
10550 { |
|
10551 TryChangeModeL(ELatin); |
|
10552 } |
|
10553 } |
|
10554 else |
|
10555 { |
|
10556 //this is safe default as it is currently allowed in all FEPs |
|
10557 TryChangeModeL(ELatin); |
|
10558 } |
|
10559 } |
|
10560 else if (!iStrokeUsedInQWERTY) |
|
10561 { |
|
10562 if (editorMode == EStroke && sharedDataMode == ECangJie) |
|
10563 { |
|
10564 TryChangeModeL(sharedDataMode); |
|
10565 } |
|
10566 else |
|
10567 { |
|
10568 TryChangeModeL(editorMode); |
|
10569 } |
|
10570 } |
|
10571 else //normal case, use locally stored mode |
|
10572 { |
|
10573 if (editorMode == ECangJie && sharedDataMode == ECangJie && iQwertyInputMode) |
|
10574 { |
|
10575 TryChangeModeL(EStroke); |
|
10576 } |
|
10577 else |
|
10578 { |
|
10579 TryChangeModeL(editorMode); |
|
10580 } |
|
10581 } |
|
10582 } |
|
10583 else if ((iAknEditorFlags & EAknEditorFlagForceTransparentFepModes) |
|
10584 && !IsFeatureSupportedJapanese()) //new find pane |
|
10585 { |
|
10586 // the default chinese find mode is the first mode in the hash key loop, except PrcChinese |
|
10587 if( iLanguageCapabilities.iInputLanguageCode == ELangPrcChinese) |
|
10588 { |
|
10589 // Fix bug EHST-6DBFUJ: Default searching language shall be ELatin |
|
10590 // Changed from EPinyin to ELatin here |
|
10591 TryChangeModeL(ELatin); |
|
10592 } |
|
10593 else |
|
10594 { |
|
10595 TryChangeModeL(iHashKeyLoop[0]); |
|
10596 } |
|
10597 } |
|
10598 else //new editor |
|
10599 { |
|
10600 if (defaultInputMode == EAknEditorNumericInputMode) |
|
10601 { |
|
10602 //numeric mode is not saved to/retreived from shared data |
|
10603 iCharWidth = EHalfWidthChar; |
|
10604 |
|
10605 if( IsInputModeAvailable(ENativeNumber) && |
|
10606 ( iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic || |
|
10607 iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic || |
|
10608 iLanguageCapabilities.iLocalDigitType == EDigitTypeDevanagari ) ) |
|
10609 { |
|
10610 TryChangeModeL( ENativeNumber ); |
|
10611 } |
|
10612 else |
|
10613 { |
|
10614 TryChangeModeL( ENumber ); |
|
10615 } |
|
10616 } |
|
10617 else if ((defaultInputMode == EAknEditorTextInputMode) && |
|
10618 ((iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) || |
|
10619 (iAknEditorFlags & EAknEditorFlagNoT9))) |
|
10620 { |
|
10621 //Chinese Modes or Western Predictive mode not allowed. |
|
10622 //See if we are ok going to the current shared data mode, |
|
10623 //otherwise go for a safe default |
|
10624 if (TryChangeModeL(sharedDataMode)) |
|
10625 { |
|
10626 latinCaseSet = sharedDataMode & (ELatinUpper | ELatinLower); |
|
10627 } |
|
10628 else |
|
10629 { |
|
10630 TryChangeModeL(ELatin); |
|
10631 } |
|
10632 } |
|
10633 else if (defaultInputMode == EAknEditorHalfWidthTextInputMode) |
|
10634 { |
|
10635 iCharWidth = EHalfWidthChar; |
|
10636 TryChangeModeL(ELatin); |
|
10637 } |
|
10638 else if (defaultInputMode == EAknEditorHiraganaInputMode) |
|
10639 { |
|
10640 TryChangeModeL(EHiragana); |
|
10641 } |
|
10642 else if ( iLanguageCapabilities.iInputLanguageCode == ELangJapanese |
|
10643 && (defaultInputMode == EAknEditorKatakanaInputMode |
|
10644 || defaultInputMode == EAknEditorFullWidthKatakanaInputMode)) |
|
10645 { |
|
10646 iCharWidth = (defaultInputMode == EAknEditorKatakanaInputMode)? |
|
10647 EHalfWidthChar : EFullWidthChar; |
|
10648 TryChangeModeL(EKatakana); |
|
10649 } |
|
10650 else if (defaultInputMode == EAknEditorFullWidthTextInputMode) |
|
10651 { |
|
10652 iCharWidth = EFullWidthChar; |
|
10653 TryChangeModeL(ELatin); |
|
10654 } |
|
10655 else if (defaultInputMode == EAknEditorFullWidthNumericInputMode) |
|
10656 { |
|
10657 iCharWidth = EFullWidthChar; |
|
10658 if( IsInputModeAvailable(ENativeNumber) && |
|
10659 ( iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic || |
|
10660 iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic || |
|
10661 iLanguageCapabilities.iLocalDigitType == EDigitTypeDevanagari ) ) |
|
10662 { |
|
10663 TryChangeModeL( ENativeNumber ); |
|
10664 } |
|
10665 else |
|
10666 { |
|
10667 TryChangeModeL( ENumber ); |
|
10668 } |
|
10669 } |
|
10670 else if (defaultInputMode == EAknEditorTextInputMode |
|
10671 && iLanguageCapabilities.iInputLanguageCode == ELangHindi ) |
|
10672 { |
|
10673 TryChangeModeL( EHindi ); |
|
10674 } |
|
10675 else // Default input mode is EAknEditorTextInputMode |
|
10676 { |
|
10677 // Check possibility move this section on else if |
|
10678 if (IsKoreanInputLanguage()) |
|
10679 { |
|
10680 TryChangeModeL(EHangul); |
|
10681 } |
|
10682 else if (TryChangeModeL(sharedDataMode)) |
|
10683 { |
|
10684 latinCaseSet = sharedDataMode & (ELatinUpper | ELatinLower); |
|
10685 } |
|
10686 else |
|
10687 { |
|
10688 TryChangeModeL(ELatin); |
|
10689 } |
|
10690 |
|
10691 } |
|
10692 } |
|
10693 |
|
10694 if (!iMode) |
|
10695 { |
|
10696 // If mode change wasn't successful, try latin mode as fallback. |
|
10697 TryChangeModeL(ELatin); |
|
10698 } |
|
10699 |
|
10700 // if also fallback fails, panic. |
|
10701 __ASSERT_DEBUG(iMode, AknFepPanic(EAknFepPanicNoPermittedEditorModesAvailable)); |
|
10702 |
|
10703 if (iCaseMan && !latinCaseSet) |
|
10704 { |
|
10705 iCaseMan->ConfigureCaseStateFromEditorState(); |
|
10706 if ( (editorState->Flags() & EFlagSupressAutoUpdate) || |
|
10707 editorMode == EAknEditorSecretAlphaInputMode ) |
|
10708 { |
|
10709 SetFlag(EFlagSupressAutoUpdate); |
|
10710 } |
|
10711 else |
|
10712 { |
|
10713 ClearFlag(EFlagSupressAutoUpdate); |
|
10714 } |
|
10715 } |
|
10716 if ((iAknEditorFlags & EAknEditorFlagForceTransparentFepModes) && |
|
10717 IsChineseInputLanguage() && iCaseMan != NULL ) |
|
10718 { |
|
10719 SetFlag(EFlagSupressAutoUpdate); |
|
10720 iCaseMan->SetCurrentCase(EAknEditorLowerCase); |
|
10721 } |
|
10722 |
|
10723 UpdateEditorContext(); |
|
10724 |
|
10725 // Check if this editor was previously inline editing |
|
10726 if ( WesternPredictive() && editorState->CurrentInlineEditSpan().Length()) |
|
10727 { // restore the fep to an inline editing state |
|
10728 iUncommittedText = editorState->CurrentInlineEditSpan(); |
|
10729 TInt docLenFep=iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
10730 if (iUncommittedText.iCursorPos>docLenFep) |
|
10731 iUncommittedText.iCursorPos=docLenFep; |
|
10732 if (iUncommittedText.iAnchorPos>docLenFep) |
|
10733 iUncommittedText.iAnchorPos=docLenFep; |
|
10734 |
|
10735 TBuf<EMaximumFepWordLength> textToUncommit; |
|
10736 iInputCapabilities.FepAwareTextEditor()-> |
|
10737 GetEditorContentForFep(textToUncommit, iUncommittedText.iAnchorPos, |
|
10738 Min(iUncommittedText.Length(), EMaximumFepWordLength)); |
|
10739 |
|
10740 // Activates western predictive UI to an inline editing state. |
|
10741 FepUI()->ActivateUI(); |
|
10742 SyncStates(EAknFepStateUIActive); |
|
10743 TInt err = iPtiEngine->SetCurrentWord(textToUncommit); |
|
10744 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
10745 // Predictive QWERTY (XT9) changes (TEST) ----> |
|
10746 // The PtiXt9Core may choose to ignore the SetCurrentInputSequence() call. |
|
10747 // Make sure our text buffer is in sync with the one in PtiEngine. |
|
10748 if(KErrNone != err) |
|
10749 textToUncommit = iPtiEngine->CurrentWord(); |
|
10750 TInt maxEdSize = iInputCapabilities.FepAwareTextEditor()->DocumentMaximumLengthForFep(); |
|
10751 if((maxEdSize > 0) && (iUncommittedText.iAnchorPos + textToUncommit.Length() > maxEdSize)) |
|
10752 { |
|
10753 textToUncommit.SetLength(maxEdSize - iUncommittedText.iAnchorPos); |
|
10754 iUncommittedText.iCursorPos = maxEdSize; |
|
10755 } |
|
10756 // Predictive QWERTY (XT9) changes <---- |
|
10757 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
10758 StartInlineEditL(iUncommittedText, textToUncommit, textToUncommit.Length(), EFalse); |
|
10759 |
|
10760 // Make sure editor character case in sync |
|
10761 if( iUncommittedText.iAnchorPos == 0 ) |
|
10762 iCaseMan->UpdateCase(ENullNaviEvent); |
|
10763 |
|
10764 } |
|
10765 |
|
10766 if (editorState != iPreviousEditorState) |
|
10767 { |
|
10768 // we have changed editor, time to update local digits mode |
|
10769 UpdateLocalDigitMode(); |
|
10770 iPreviousEditorState = editorState; |
|
10771 } |
|
10772 |
|
10773 if(IsExtendedFlagSet(EExtendedFlagShiftReleasedOnPopup) && !(iAknEditorFlags & EAknEditorFlagFindPane) ) |
|
10774 { |
|
10775 // If in FEP context, shift is released on a non fep aware dialog |
|
10776 // like "text copied to clipboard", then release the shift |
|
10777 // when the editor comes in focus by simulating shift up event. |
|
10778 ClearExtendedFlag(EExtendedFlagShiftReleasedOnPopup); |
|
10779 TKeyEvent shiftUp = {0, EStdKeyLeftShift, 0, 0}; |
|
10780 CCoeEnv::Static()->SimulateKeyEventL(shiftUp, EEventKeyUp); |
|
10781 } |
|
10782 else if (IsFlagSet(EFlagLongShiftKeyPress) && !(iAknEditorFlags & EAknEditorFlagFindPane)) |
|
10783 { |
|
10784 // Find pane editor does not require any shift simulation |
|
10785 |
|
10786 // After the "text copied" note and if the shift key was not released |
|
10787 // then simulate shift down event. |
|
10788 TKeyEvent shiftDown = {0, EStdKeyLeftShift, 0, 0}; |
|
10789 CCoeEnv::Static()->SimulateKeyEventL(shiftDown, EEventKeyDown); |
|
10790 if((!iCandidatePopup) && (KeyboardLayout() != EPtiKeyboard12Key )) |
|
10791 ResetShiftKeyMonitorL(); |
|
10792 } |
|
10793 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
10794 TransferFepStateToEditorL(EFalse); // ensure editor has up to date state |
|
10795 #else |
|
10796 TransferFepStateToEditorL(); // ensure editor has up to date state |
|
10797 #endif |
|
10798 |
|
10799 iHashKeyMan->ResetIndicHashKeyStateL(); |
|
10800 ClearExtendedFlag(EExtendedFlagShortPressHashKey); |
|
10801 } |
|
10802 |
|
10803 TInt CAknFepManager::ConfigureFepModeFromEditorMode(TInt aEditorMode) |
|
10804 { |
|
10805 TInt fepMode(aEditorMode); |
|
10806 |
|
10807 switch (aEditorMode) |
|
10808 { |
|
10809 case EAknEditorNumericInputMode: |
|
10810 if( IsInputModeAvailable(ENativeNumber) && |
|
10811 ( iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic || |
|
10812 iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic || |
|
10813 iLanguageCapabilities.iLocalDigitType == EDigitTypeDevanagari ) ) |
|
10814 { |
|
10815 fepMode = ENativeNumber; |
|
10816 } |
|
10817 else |
|
10818 { |
|
10819 fepMode = ENumber; |
|
10820 } |
|
10821 iCharWidth = EHalfWidthChar; |
|
10822 break; |
|
10823 case EAknEditorSecretAlphaInputMode: |
|
10824 case EAknEditorTextInputMode: |
|
10825 case EAknEditorHalfWidthTextInputMode: |
|
10826 fepMode = ELatin; |
|
10827 iCharWidth = EHalfWidthChar; |
|
10828 break; |
|
10829 case EAknEditorKatakanaInputMode: |
|
10830 fepMode = EKatakana; |
|
10831 iCharWidth = EHalfWidthChar; |
|
10832 break; |
|
10833 case EAknEditorFullWidthTextInputMode: |
|
10834 fepMode = ELatin; |
|
10835 iCharWidth = EFullWidthChar; |
|
10836 break; |
|
10837 case EAknEditorFullWidthKatakanaInputMode: |
|
10838 fepMode = EKatakana; |
|
10839 iCharWidth = EFullWidthChar; |
|
10840 break; |
|
10841 case EAknEditorFullWidthNumericInputMode: |
|
10842 if( IsInputModeAvailable(ENativeNumber) && |
|
10843 ( iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic || |
|
10844 iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic || |
|
10845 iLanguageCapabilities.iLocalDigitType == EDigitTypeDevanagari ) ) |
|
10846 { |
|
10847 fepMode = ENativeNumber; |
|
10848 } |
|
10849 else |
|
10850 { |
|
10851 fepMode = ENumber; |
|
10852 } |
|
10853 iCharWidth = EFullWidthChar; |
|
10854 break; |
|
10855 case EAknEditorHiraganaKanjiInputMode: |
|
10856 fepMode = EHiraganaKanji; |
|
10857 break; |
|
10858 case EAknEditorHiraganaInputMode: |
|
10859 fepMode = EHiragana; |
|
10860 break; |
|
10861 default: |
|
10862 break; |
|
10863 } |
|
10864 return fepMode; |
|
10865 } |
|
10866 |
|
10867 void CAknFepManager::LaunchHelpTextQueryL() |
|
10868 { |
|
10869 TUid fepUid = CCoeEnv::Static()->FepUid(); |
|
10870 ClearExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
10871 iUiInterface->LaunchHelpTextQueryL(R_AKNFEP_HELP_TEXT); |
|
10872 PrepareFepAfterDialogExitL(fepUid); |
|
10873 } |
|
10874 |
|
10875 void CAknFepManager::UpdateEditorContext() const |
|
10876 { |
|
10877 if(EditingStateIndicator()) |
|
10878 { |
|
10879 iUiInterface->UpdateEditorContext(*EditingStateIndicator(), *FepUI()); |
|
10880 } |
|
10881 } |
|
10882 |
|
10883 TBool CAknFepManager::TextIsValidInEditor(const TDesC& aText) |
|
10884 { |
|
10885 TBool ret = ETrue; |
|
10886 TUint length = aText.Length(); |
|
10887 TCoeInputCapabilities::MCoeFepSpecificExtensions* ipCapExt = |
|
10888 iInputCapabilities.FepSpecificExtensions(TUid::Uid(EAknFepUid)); |
|
10889 if (ipCapExt) |
|
10890 { |
|
10891 while(length--) |
|
10892 { |
|
10893 if (!ipCapExt->IsValidCharacter(aText[length])) |
|
10894 { |
|
10895 ret = EFalse; |
|
10896 } |
|
10897 } |
|
10898 } |
|
10899 return ret; |
|
10900 } |
|
10901 |
|
10902 TBool CAknFepManager::CharIsValidInEditor(TChar aChar) |
|
10903 { |
|
10904 TBool ret = ETrue; |
|
10905 TCoeInputCapabilities::MCoeFepSpecificExtensions* ipCapExt = |
|
10906 iInputCapabilities.FepSpecificExtensions(TUid::Uid(EAknFepUid)); |
|
10907 if (ipCapExt) |
|
10908 { |
|
10909 if (!ipCapExt->IsValidCharacter(aChar)) |
|
10910 { |
|
10911 ret = EFalse; |
|
10912 } |
|
10913 } |
|
10914 return ret; |
|
10915 } |
|
10916 |
|
10917 void CAknFepManager::SetCursorType(TChineseFepCursorType aType) |
|
10918 { |
|
10919 TBool setToTrue = ETrue; |
|
10920 TTextCursor newCursor; |
|
10921 |
|
10922 newCursor.iType=TTextCursor::ETypeRectangle; |
|
10923 if (aType == EPassive) |
|
10924 { |
|
10925 newCursor.iType=TTextCursor::ETypeHollowRectangle; |
|
10926 } |
|
10927 if ( IsFepAwareTextEditor() ) |
|
10928 { |
|
10929 iInputCapabilities.FepAwareTextEditor()->Extension1()->SetCursorType(setToTrue, newCursor); |
|
10930 } |
|
10931 } |
|
10932 |
|
10933 MAknEditingStateIndicator* CAknFepManager::EditingStateIndicator() const |
|
10934 { |
|
10935 MAknEditingStateIndicator* indicator = NULL; |
|
10936 |
|
10937 // First ask indicator from controls owning the editor. |
|
10938 // For example CAknQueryControl and CAknSearchField implement |
|
10939 // their own indicators. |
|
10940 |
|
10941 MObjectProvider* objectProvider = NULL; |
|
10942 |
|
10943 // First try through CAknEdwinState object. |
|
10944 // It exists with CEikEdwin-derived editors. |
|
10945 |
|
10946 MCoeFepAwareTextEditor* editor = NULL; |
|
10947 MCoeFepAwareTextEditor_Extension1* ext1 = NULL; |
|
10948 CAknEdwinState* state = NULL; |
|
10949 |
|
10950 editor = iInputCapabilities.FepAwareTextEditor(); |
|
10951 |
|
10952 if(editor) |
|
10953 ext1 = editor->Extension1() ; |
|
10954 if(ext1) |
|
10955 state = (CAknEdwinState*)ext1->State( KNullUid ) ; |
|
10956 |
|
10957 if ( IsFepAwareTextEditor() && ( editor ) && ( ext1) && ( state )) |
|
10958 { |
|
10959 objectProvider = state->ObjectProvider(); |
|
10960 } |
|
10961 |
|
10962 // If not found, try to get object provider from input capabilities. |
|
10963 // It is set there with CEikMfne-derived editors. |
|
10964 |
|
10965 if ( !objectProvider ) |
|
10966 { |
|
10967 objectProvider = iInputCapabilities.ObjectProvider(); |
|
10968 } |
|
10969 |
|
10970 if ( objectProvider ) |
|
10971 { |
|
10972 indicator = objectProvider->MopGetObject( indicator ); |
|
10973 } |
|
10974 |
|
10975 // If no indicator was supplied, get one from CAknEnv. |
|
10976 // By default, this one is FEP's own indicator. |
|
10977 |
|
10978 if ( !indicator ) |
|
10979 { |
|
10980 indicator = CAknEnv::Static()->EditingStateIndicator(); |
|
10981 if (indicator != iIndicator) |
|
10982 { |
|
10983 CAknEnv::Static()->SwapEditingStateIndicator(iIndicator); |
|
10984 indicator = iIndicator; |
|
10985 } |
|
10986 } |
|
10987 |
|
10988 return indicator; |
|
10989 } |
|
10990 |
|
10991 TBool CAknFepManager::TryHandleArrowRightEventL(TInt aDokumentLength) |
|
10992 { |
|
10993 TBool ret = EFalse; |
|
10994 TBool thai = (iLanguageCapabilities.iInputLanguageCode == ELangThai); |
|
10995 if ( iInputCapabilities.FepAwareTextEditor() && |
|
10996 (iSharedDataInterface->SpaceWithScrollRight() || thai ) && |
|
10997 (!(iAknEditorFlags & EAknEditorFlagNoLRNavigation)) && |
|
10998 iFepManState == EAknFepStateInitial && |
|
10999 (!IsFlagSet(EFlagInsideInlineEditingTransaction) ) && |
|
11000 (!IsFlagSet(EFlagShiftKeyDepressed)) && |
|
11001 iMode != EHiragana ) // Not supported in only Hiragana input mode |
|
11002 { |
|
11003 TInt cursorPos = DocPos().iPos; |
|
11004 TCursorSelection cursorSel; |
|
11005 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(cursorSel); |
|
11006 if (( cursorPos == aDokumentLength) |
|
11007 && !cursorSel.Length() |
|
11008 && (IsFeatureSupportedJapanese() || (PreviousChar() != 0x0020)) ) |
|
11009 { |
|
11010 // set to half-width space or full-width space by current input mode. |
|
11011 // 0x0020 is unicode for half-width space |
|
11012 // 0x3000 is unicode for full-width space |
|
11013 TUint code(0); |
|
11014 switch (iMode) |
|
11015 { |
|
11016 case EHiraganaKanji: |
|
11017 code = 0x3000; |
|
11018 break; |
|
11019 case ELatin: |
|
11020 code = (!WesternPredictive() && iCharWidth == EFullWidthChar)? |
|
11021 0x3000 : 0x0020; |
|
11022 break; |
|
11023 case EHiragana: |
|
11024 // Not supported in only Hiragana input mode |
|
11025 break; |
|
11026 case EHangul: |
|
11027 code = 0x0020; |
|
11028 break; |
|
11029 case ENumber: |
|
11030 case ENativeNumber: |
|
11031 case EKatakana: |
|
11032 default: |
|
11033 code = (iCharWidth == EFullWidthChar)? 0x3000 : 0x0020; |
|
11034 break; |
|
11035 } |
|
11036 if (code) |
|
11037 { |
|
11038 SimulateKeyEventL(code); // add a space |
|
11039 SimulateKeyEventL(EKeyF19); // Asyncronous case update |
|
11040 ret = ETrue; |
|
11041 } |
|
11042 } |
|
11043 } |
|
11044 return ret; |
|
11045 } |
|
11046 |
|
11047 TBool CAknFepManager::TryHandleArrowLeftEventL(TInt aDokumentLength) |
|
11048 { |
|
11049 TBool ret = EFalse; |
|
11050 if (iInputCapabilities.FepAwareTextEditor() && |
|
11051 iSharedDataInterface->SpaceWithScrollRight() && |
|
11052 (!(iAknEditorFlags & EAknEditorFlagNoLRNavigation)) && |
|
11053 iFepManState == EAknFepStateInitial && |
|
11054 (!IsFlagSet(EFlagInsideInlineEditingTransaction) ) && |
|
11055 (!IsFlagSet(EFlagShiftKeyDepressed)) && |
|
11056 iMode != EHiragana ) // Not supported in only Hiragana input mode |
|
11057 { |
|
11058 TInt cursorPos = DocPos().iPos; |
|
11059 TCursorSelection cursorSel; |
|
11060 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(cursorSel); |
|
11061 TText previousChar = PreviousChar(); |
|
11062 if (( cursorPos == aDokumentLength) |
|
11063 && !cursorSel.Length() |
|
11064 && (IsFeatureSupportedJapanese() |
|
11065 && (previousChar == 0x3000 || previousChar == 0x0020) )) // full width or half-width space. |
|
11066 { |
|
11067 SimulateKeyEventL(EKeyBackspace); |
|
11068 SimulateKeyEventL(EKeyF19); // Asyncronous case update |
|
11069 ret = ETrue; |
|
11070 } |
|
11071 } |
|
11072 return ret; |
|
11073 } |
|
11074 |
|
11075 TBool CAknFepManager::TryHandleArrowDownEventL(TInt aDokumentLength) |
|
11076 { |
|
11077 TBool ret = EFalse; |
|
11078 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
11079 // Predictive QWERTY (XT9) changes ----> |
|
11080 if ( iWesternPredictive && |
|
11081 IsFlagSet(CAknFepManager::EFlagInsideInlineEditingTransaction) && !(iAknEditorFlags & EAknEditorFlagNoT9) |
|
11082 && !IsFlagSet(EFlagInsideMultitapInlineEditingTransaction) && !IsFlagSet(EFlagNoMatches)) |
|
11083 { |
|
11084 LaunchCandidatePopupListL(); |
|
11085 ret = ETrue; |
|
11086 } |
|
11087 // Predictive QWERTY (XT9) changes <---- |
|
11088 else |
|
11089 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
11090 if ( ( iAknEditorFlags & EAknEditorFlagAllowEntersWithScrollDown ) && |
|
11091 iInputCapabilities.FepAwareTextEditor() && |
|
11092 ( iSharedDataInterface->EntersWithScrollDown() ) && |
|
11093 iFepManState == EAknFepStateInitial && |
|
11094 !IsFlagSet(EFlagInsideInlineEditingTransaction) && |
|
11095 !IsFlagSet(EFlagShiftKeyDepressed) ) |
|
11096 { |
|
11097 TInt cursorPos = DocPos().iPos; |
|
11098 TCursorSelection cursorSel; |
|
11099 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(cursorSel); |
|
11100 if ( cursorPos == aDokumentLength && |
|
11101 !cursorSel.Length() ) |
|
11102 { |
|
11103 SimulateKeyEventL(EKeyEnter); // add line feed |
|
11104 SimulateKeyEventL(EKeyF19); // Asyncronous case update |
|
11105 ret = ETrue; |
|
11106 } |
|
11107 } |
|
11108 return ret; |
|
11109 } |
|
11110 |
|
11111 TUint CAknFepManager::EditorModeFromFepMode(TInt aFepMode) |
|
11112 { |
|
11113 TUint editorMode(aFepMode); |
|
11114 switch (aFepMode) |
|
11115 { |
|
11116 case ELatin: |
|
11117 if (iPermittedInputModes & EAknEditorTextInputMode) |
|
11118 { |
|
11119 editorMode = EAknEditorTextInputMode; |
|
11120 if (IsFeatureSupportedJapanese()) |
|
11121 { |
|
11122 if (iCharWidth == EHalfWidthChar |
|
11123 && (iPermittedInputModes & EAknEditorHalfWidthTextInputMode)) |
|
11124 { |
|
11125 editorMode = EAknEditorHalfWidthTextInputMode; |
|
11126 } |
|
11127 else if (iCharWidth == EFullWidthChar |
|
11128 && (iPermittedInputModes & EAknEditorFullWidthTextInputMode)) |
|
11129 { |
|
11130 editorMode = EAknEditorFullWidthTextInputMode; |
|
11131 } |
|
11132 } |
|
11133 } |
|
11134 else if (iPermittedInputModes & EAknEditorHalfWidthTextInputMode) |
|
11135 { |
|
11136 editorMode = EAknEditorTextInputMode; |
|
11137 if (IsFeatureSupportedJapanese()) |
|
11138 { |
|
11139 editorMode = EAknEditorHalfWidthTextInputMode; |
|
11140 if (iCharWidth == EFullWidthChar |
|
11141 &&(iPermittedInputModes & EAknEditorFullWidthTextInputMode)) |
|
11142 { |
|
11143 editorMode = EAknEditorFullWidthTextInputMode; |
|
11144 } |
|
11145 } |
|
11146 } |
|
11147 else if (iPermittedInputModes & EAknEditorFullWidthTextInputMode) |
|
11148 { |
|
11149 editorMode = EAknEditorTextInputMode; |
|
11150 if (IsFeatureSupportedJapanese()) |
|
11151 { |
|
11152 editorMode = EAknEditorFullWidthTextInputMode; |
|
11153 } |
|
11154 } |
|
11155 else |
|
11156 { |
|
11157 editorMode = EAknEditorSecretAlphaInputMode; |
|
11158 } |
|
11159 break; |
|
11160 case ENumber: |
|
11161 case ENativeNumber: |
|
11162 editorMode = EAknEditorNumericInputMode; |
|
11163 if (iCharWidth == EFullWidthChar |
|
11164 && (iPermittedInputModes & EAknEditorFullWidthNumericInputMode)) |
|
11165 { |
|
11166 editorMode = EAknEditorFullWidthNumericInputMode; |
|
11167 } |
|
11168 break; |
|
11169 case EHangul: |
|
11170 editorMode = EAknEditorTextInputMode; |
|
11171 break; |
|
11172 default: |
|
11173 if (IsFeatureSupportedJapanese()) |
|
11174 { |
|
11175 editorMode = EditorMode(aFepMode, iCharWidth); |
|
11176 } |
|
11177 break; |
|
11178 } |
|
11179 return editorMode; |
|
11180 } |
|
11181 |
|
11182 CAknKeySoundSystem* CAknFepManager::SoundSystem() const |
|
11183 { |
|
11184 CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
11185 if (coeEnv->AppUi()) |
|
11186 { |
|
11187 return iAvkonAppUiBase->KeySounds(); |
|
11188 } |
|
11189 return NULL; |
|
11190 } |
|
11191 |
|
11192 void CAknFepManager::SetHashKeyStyle() |
|
11193 { |
|
11194 CAknFepHashKeyManager::THashKeyStyle style = CAknFepHashKeyManager::EHashKeyStyleWestern; |
|
11195 |
|
11196 switch (iLanguageCapabilities.iInputLanguageCode) |
|
11197 { |
|
11198 case ELangPrcChinese: |
|
11199 case ELangHongKongChinese: |
|
11200 case ELangTaiwanChinese: |
|
11201 style = CAknFepHashKeyManager::EHashKeyStyleChineseWithWestern; |
|
11202 break; |
|
11203 case ELangJapanese: |
|
11204 style = CAknFepHashKeyManager::EHashKeyStyleJapanese; |
|
11205 break; |
|
11206 case ELangKorean: |
|
11207 style = CAknFepHashKeyManager::EHashKeyStyleKoreanWithWestern; |
|
11208 break; |
|
11209 default: |
|
11210 break; |
|
11211 } |
|
11212 |
|
11213 iHashKeyMan->SetHashKeyStyle( style ); |
|
11214 } |
|
11215 |
|
11216 void CAknFepManager::ReadHashKeyLoopL() |
|
11217 { |
|
11218 iHashKeyLoop.Reset(); |
|
11219 |
|
11220 CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
11221 TResourceReader reader; |
|
11222 coeEnv->CreateResourceReaderLC(reader, R_HASH_KEY_LOOP_ALL_INPUT_MODES); |
|
11223 |
|
11224 iVariantPermittedModes = 0; |
|
11225 const TInt count = reader.ReadInt16(); |
|
11226 for (TInt ii=0; ii<count; ii++) |
|
11227 { |
|
11228 TInt mode = reader.ReadInt32(); |
|
11229 if ( IsInputModeAvailable(mode) ) |
|
11230 { |
|
11231 if ( mode == EPRCFind) |
|
11232 { |
|
11233 mode = ELatin; |
|
11234 } |
|
11235 iHashKeyLoop.Append(mode); |
|
11236 iVariantPermittedModes |= mode; |
|
11237 } |
|
11238 } |
|
11239 CleanupStack::PopAndDestroy(); //reader |
|
11240 } |
|
11241 |
|
11242 TBool CAknFepManager::IsValidInLineCharacter(TChar aCharacter) const |
|
11243 { |
|
11244 TBool validInlineCharacter = ETrue; |
|
11245 TChar::TCategory category = aCharacter.GetCategory(); |
|
11246 TChar::TBdCategory bdCategory = aCharacter.GetBdCategory(); |
|
11247 switch (iLanguageCapabilities.iInputLanguageCode) |
|
11248 { |
|
11249 case ELangArabic: |
|
11250 { |
|
11251 // Needs more specific category |
|
11252 validInlineCharacter = ( (category & TChar::ELetterOtherGroup) && |
|
11253 (bdCategory == TChar::ERightToLeftArabic) ); |
|
11254 break; |
|
11255 } |
|
11256 case ELangHebrew: |
|
11257 { |
|
11258 // Needs more specific category |
|
11259 validInlineCharacter = ( (category & TChar::ELetterOtherGroup) && |
|
11260 (bdCategory == TChar::ERightToLeft) ); |
|
11261 break; |
|
11262 } |
|
11263 case ELangFarsi: |
|
11264 case ELangUrdu: |
|
11265 { |
|
11266 // Needs more specific category |
|
11267 validInlineCharacter = ( (category & TChar::ELetterOtherGroup) && |
|
11268 (bdCategory == TChar::ERightToLeftArabic) ); |
|
11269 break; |
|
11270 } |
|
11271 /*Hindi*/ |
|
11272 case ELangHindi: |
|
11273 #ifdef RD_MARATHI |
|
11274 /* Same for Marathi */ |
|
11275 case ELangMarathi: |
|
11276 #endif |
|
11277 { |
|
11278 // Needs more specific category |
|
11279 validInlineCharacter = IsValidInlineIndicCharacter(aCharacter); |
|
11280 |
|
11281 break; |
|
11282 } |
|
11283 case ELangVietnamese: |
|
11284 { |
|
11285 validInlineCharacter = (aCharacter.IsAlpha() && |
|
11286 !((category & TChar::ELetterOtherGroup))) || |
|
11287 ((category == TChar::EMarkGroup) && |
|
11288 (bdCategory == TChar::ENonSpacingMark)); |
|
11289 break; |
|
11290 } |
|
11291 case ELangThai: |
|
11292 { |
|
11293 validInlineCharacter = (!(aCharacter.IsSpace() || (aCharacter == 0x2029))) && |
|
11294 ((aCharacter.IsAlpha() && |
|
11295 !(category & TChar::ELetterOtherGroup)) || |
|
11296 ((category & TChar::EMarkGroup) && |
|
11297 (bdCategory == TChar::ENonSpacingMark)) || |
|
11298 ((category & TChar::ELetterModifierGroup) && |
|
11299 (bdCategory == TChar::ELeftToRight)) || |
|
11300 ((category & TChar::ESeparatorGroup ) && |
|
11301 (bdCategory == TChar::EWhitespace))|| |
|
11302 ((category & TChar::EMcCategory) && |
|
11303 (bdCategory == TChar::ELeftToRight))); |
|
11304 break; |
|
11305 } |
|
11306 case ELangTaiwanChinese: |
|
11307 case ELangHongKongChinese: |
|
11308 case ELangPrcChinese: |
|
11309 case ELangEnglish: |
|
11310 { |
|
11311 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
11312 // for qwerty special characters should not break the word |
|
11313 if( iQwertyInputMode && ( KeyboardLayout() !=EPtiKeyboardHalfQwerty )) |
|
11314 { |
|
11315 validInlineCharacter = (!( aCharacter.IsSpace() || (aCharacter == 0x2029) || |
|
11316 ( aCharacter.IsAlpha() && |
|
11317 (category & TChar::ELetterOtherGroup))|| |
|
11318 ((category & TChar::EMarkGroup) && |
|
11319 (bdCategory == TChar::ENonSpacingMark)) || |
|
11320 ((category & TChar::ELetterModifierGroup) && |
|
11321 (bdCategory == TChar::ELeftToRight)) || |
|
11322 ((category & TChar::ESeparatorGroup ) && |
|
11323 (bdCategory == TChar::EWhitespace)))); |
|
11324 } |
|
11325 else |
|
11326 #endif // whereas for ITUT and Half Qwerty they should |
|
11327 { |
|
11328 validInlineCharacter = ( aCharacter.IsAlpha() && !(category & TChar::ELetterOtherGroup) ); |
|
11329 } |
|
11330 break; |
|
11331 } |
|
11332 default: |
|
11333 { |
|
11334 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
11335 // for qwerty special characters should not break the word |
|
11336 |
|
11337 if( iQwertyInputMode && ( KeyboardLayout() !=EPtiKeyboardHalfQwerty ) ) |
|
11338 { |
|
11339 validInlineCharacter = (!(aCharacter.IsSpace() || (aCharacter == 0x2029))); |
|
11340 } |
|
11341 else |
|
11342 #endif // whereas for ITUT and Half Qwerty they should |
|
11343 { |
|
11344 validInlineCharacter = ( aCharacter.IsAlpha() && !(category & TChar::ELetterOtherGroup) ); |
|
11345 } |
|
11346 |
|
11347 |
|
11348 break; |
|
11349 } |
|
11350 } |
|
11351 |
|
11352 TUint16 key = 0; |
|
11353 if(validInlineCharacter) |
|
11354 { |
|
11355 validInlineCharacter = EFalse; |
|
11356 ConvertCharToKey(aCharacter, key); |
|
11357 if(0 != key) |
|
11358 { |
|
11359 validInlineCharacter = ETrue; |
|
11360 } |
|
11361 } |
|
11362 |
|
11363 return validInlineCharacter; |
|
11364 } |
|
11365 TBool CAknFepManager::IsValidInlineIndicCharacter(TChar aCharacter) const |
|
11366 { |
|
11367 TBool validInlineCharacter = ETrue; |
|
11368 TChar::TCategory category = aCharacter.GetCategory(); |
|
11369 TChar::TBdCategory bdCategory = aCharacter.GetBdCategory(); |
|
11370 |
|
11371 if(!((category == TChar::EPoCategory) || aCharacter == 0x0950 || aCharacter == 0x093D)) |
|
11372 { |
|
11373 validInlineCharacter = ((( (category & TChar::ELetterOtherGroup) |
|
11374 && (bdCategory == TChar::ELeftToRight) ) |
|
11375 ||( (category & TChar::EMcCategory) |
|
11376 && (bdCategory == TChar::ELeftToRight) ) |
|
11377 ||( (category & TChar::EMarkGroup) |
|
11378 && (bdCategory == TChar::ENonSpacingMark)) ) |
|
11379 &&( ! ( aCharacter.IsAlpha() |
|
11380 && !(category & TChar::ELetterOtherGroup) ))); |
|
11381 } |
|
11382 else |
|
11383 { |
|
11384 validInlineCharacter = EFalse; |
|
11385 } |
|
11386 return validInlineCharacter; |
|
11387 } |
|
11388 |
|
11389 TInt CAknFepManager::WordConcatenationTimerTimeoutCallback(TAny* aObj) |
|
11390 { |
|
11391 TRAPD(err, static_cast<CAknFepManager*>(aObj)->WordConcatenationTimerTimeoutL()); |
|
11392 if (err) |
|
11393 { |
|
11394 static_cast<CAknFepManager*>(aObj)->CleanUpFep(); |
|
11395 return KErrNoMemory; |
|
11396 } |
|
11397 return KErrNone; |
|
11398 } |
|
11399 |
|
11400 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
11401 |
|
11402 TBool CAknFepManager::IsHybridAplhaEditor() const |
|
11403 { |
|
11404 TBool phoneIdle = (EditorType() == CAknExtendedInputCapabilities::EHybridAlphaNumericEditor); |
|
11405 return phoneIdle; |
|
11406 } |
|
11407 |
|
11408 TBool CAknFepManager::IsHybridAlphaModeChangedtoAplhanumeric() const |
|
11409 { |
|
11410 return iHybridAplphaChangedToAlphanumeric; |
|
11411 } |
|
11412 |
|
11413 TBool CAknFepManager::IsPhoneNumberEditor() const |
|
11414 { |
|
11415 TBool phoneEditor = (EditorType() == CAknExtendedInputCapabilities::EPhoneNumberEditor); |
|
11416 return phoneEditor; |
|
11417 } |
|
11418 CAknFepFnKeyManager::TFnKeyState CAknFepManager::FnKeyState() |
|
11419 { |
|
11420 return iFnKeyManager->FnKeyState(); |
|
11421 } |
|
11422 void CAknFepManager::SetFnKeyState(CAknFepFnKeyManager::TFnKeyState aState) |
|
11423 { |
|
11424 iFnKeyManager->SetFnKeyState(aState); |
|
11425 } |
|
11426 #ifdef __REVERSE_FN_KEY_SUPPORTED |
|
11427 TBool CAknFepManager::IsReverseFnkeyInput() |
|
11428 { |
|
11429 return iIsReverseFnkeyInput; |
|
11430 } |
|
11431 void CAknFepManager::SetReverseFnkeyInputMode(TBool iIsOn) |
|
11432 { |
|
11433 iIsReverseFnkeyInput = iIsOn; |
|
11434 } |
|
11435 TBool CAknFepManager::IsValidCharInNumericEditorL( TChar aChar ) const |
|
11436 { |
|
11437 if(!EditorState()) |
|
11438 { |
|
11439 return EFalse; |
|
11440 } |
|
11441 TBool validChar = EFalse; |
|
11442 if( aChar.IsDigit() ) |
|
11443 { |
|
11444 return ETrue; |
|
11445 } |
|
11446 TBool phoneIdle = (EditorType() == CAknExtendedInputCapabilities::EPhoneNumberEditor); |
|
11447 if( (phoneIdle || (IsHybridAplhaEditor() && !IsHybridAlphaModeChangedtoAplhanumeric())) |
|
11448 && aChar == '#') |
|
11449 { |
|
11450 return ETrue; |
|
11451 } |
|
11452 if( aChar == '.' && EAknEditorConverterNumberModeKeymap == iAknEditorNumericKeymap) |
|
11453 { |
|
11454 return ETrue; |
|
11455 } |
|
11456 if( IsAllowedKeymappingForNumberMode(aChar) ) |
|
11457 { |
|
11458 return ETrue; |
|
11459 } |
|
11460 |
|
11461 TInt resourceSCTId = EditorState()->SpecialCharacterTableResourceId(); |
|
11462 // No SCT table use default SCT |
|
11463 if( resourceSCTId == KErrNotFound || !resourceSCTId || |
|
11464 (IsHybridAplhaEditor()&& !IsHybridAlphaModeChangedtoAplhanumeric())) |
|
11465 { |
|
11466 resourceSCTId = NumericModeSCTResourceId(); |
|
11467 } |
|
11468 |
|
11469 if( resourceSCTId ) |
|
11470 { |
|
11471 TResourceReader reader; |
|
11472 CEikonEnv::Static()->CreateResourceReaderLC(reader,resourceSCTId); |
|
11473 reader.ReadInt32(); // skip sct id |
|
11474 TPtrC chars=reader.ReadTPtrC(); // read special char |
|
11475 validChar = ( chars.Locate(aChar)>=0 ); |
|
11476 CleanupStack::PopAndDestroy(); |
|
11477 } |
|
11478 return validChar; |
|
11479 |
|
11480 } |
|
11481 TInt CAknFepManager::GetNumericSCTResID() |
|
11482 { |
|
11483 if(!EditorState()) |
|
11484 { |
|
11485 return NumericModeSCTResourceId(); |
|
11486 } |
|
11487 TInt resourceSCTId = EditorState()->SpecialCharacterTableResourceId(); |
|
11488 if(resourceSCTId == KErrNotFound || !resourceSCTId ) |
|
11489 { |
|
11490 resourceSCTId = NumericModeSCTResourceId(); |
|
11491 } |
|
11492 return resourceSCTId; |
|
11493 } |
|
11494 |
|
11495 TBool CAknFepManager::IsValidCharForNumericInFnReverseL(TInt aKey, TPtiTextCase aCase) |
|
11496 { |
|
11497 if(!EditorState()) |
|
11498 { |
|
11499 return EFalse; |
|
11500 } |
|
11501 TBuf<32> keyMaps; |
|
11502 iPtiEngine->MappingDataForKey( (TPtiKey)aKey, keyMaps, aCase); |
|
11503 |
|
11504 TBool validKey(EFalse); |
|
11505 if( keyMaps.Length()<= 0 ) |
|
11506 { |
|
11507 return validKey; |
|
11508 } |
|
11509 TChar chr =keyMaps[0]; |
|
11510 if( chr.IsDigit() ) |
|
11511 { |
|
11512 return ETrue; |
|
11513 } |
|
11514 |
|
11515 TInt resourceSCTId = EditorState()->SpecialCharacterTableResourceId(); |
|
11516 // No SCT table use default SCT |
|
11517 if( resourceSCTId == KErrNotFound || !resourceSCTId ) |
|
11518 { |
|
11519 resourceSCTId = NumericModeSCTResourceId(); |
|
11520 } |
|
11521 |
|
11522 if( resourceSCTId ) |
|
11523 { |
|
11524 TResourceReader reader; |
|
11525 CEikonEnv::Static()->CreateResourceReaderLC(reader,resourceSCTId); |
|
11526 reader.ReadInt32(); // skip sct id |
|
11527 TPtrC chars=reader.ReadTPtrC(); // read special char |
|
11528 |
|
11529 validKey = (chars.Locate(chr)>=0 ); |
|
11530 if(chr.IsAlpha()) |
|
11531 { |
|
11532 chr.UpperCase(); |
|
11533 validKey |= (chars.Locate(chr)>=0 ) ; |
|
11534 } |
|
11535 |
|
11536 CleanupStack::PopAndDestroy(); |
|
11537 } |
|
11538 |
|
11539 return validKey; |
|
11540 |
|
11541 } |
|
11542 #endif //__REVERSE_FN_KEY_SUPPORTED |
|
11543 void CAknFepManager::AddOneSpaceOrMoveCursorL() |
|
11544 { |
|
11545 if(static_cast<TChar>(NextChar()).IsSpace()) |
|
11546 { |
|
11547 TCursorSelection sel; |
|
11548 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(sel); |
|
11549 sel.iCursorPos++; |
|
11550 sel.iAnchorPos++; |
|
11551 iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(sel); |
|
11552 } |
|
11553 else if(IsEditorHasFreeSpace()) |
|
11554 { |
|
11555 SimulateKeyEventL(EKeySpace); |
|
11556 } |
|
11557 SimulateKeyEventL(EKeyF19); |
|
11558 } |
|
11559 #endif |
|
11560 TBool CAknFepManager::IsOnlyNumericPermitted() const |
|
11561 { |
|
11562 if (IsFeatureSupportedJapanese()) |
|
11563 { |
|
11564 return !(iPermittedInputModes & ~(EAknEditorNumericInputMode |
|
11565 | EAknEditorFullWidthNumericInputMode) ); |
|
11566 } |
|
11567 else |
|
11568 { |
|
11569 // Only non-japanese modes are considered. |
|
11570 return !( iPermittedInputModes & |
|
11571 (EAknEditorTextInputMode | EAknEditorSecretAlphaInputMode) ); |
|
11572 } |
|
11573 } |
|
11574 |
|
11575 void CAknFepManager::TryIncrementModeL(TInt aCurrentMode) |
|
11576 { |
|
11577 //check that we are currently in the correct mode |
|
11578 __ASSERT_DEBUG(IsModePermitted(iMode), |
|
11579 AknFepPanic(EAknFepPanicNonPermittedEditorMode)); |
|
11580 __ASSERT_DEBUG(iInputCapabilities.FepAwareTextEditor(), |
|
11581 AknFepPanic(EAknFepPanicNoHandleToFepAwareTextEditor)); |
|
11582 |
|
11583 const TInt lastModePos = iHashKeyLoop.Count()-1 ; |
|
11584 const TInt currentModePos = iHashKeyLoop.Find(aCurrentMode); |
|
11585 TInt newModePos = currentModePos; |
|
11586 |
|
11587 __ASSERT_DEBUG(currentModePos != KErrNotFound , |
|
11588 AknFepPanic(EAknFepPanicNonPermittedEditorMode)); |
|
11589 |
|
11590 do { |
|
11591 if (newModePos == lastModePos) |
|
11592 { |
|
11593 //we've got to the end of the hash key loop, go back to the beginning |
|
11594 newModePos = 0; |
|
11595 } |
|
11596 else |
|
11597 { |
|
11598 newModePos++; |
|
11599 } |
|
11600 |
|
11601 if (TryChangeModeL(iHashKeyLoop[newModePos])) |
|
11602 { |
|
11603 return; //succeeded to move to next available mode |
|
11604 } |
|
11605 } |
|
11606 while (newModePos != currentModePos); |
|
11607 } |
|
11608 |
|
11609 void CAknFepManager::TryIncrementModeChineseQwertyL(TInt aCurrentMode) |
|
11610 { |
|
11611 __ASSERT_DEBUG(IsModePermitted(aCurrentMode),AknFepPanic(EAknFepPanicNonPermittedEditorMode)); |
|
11612 |
|
11613 const TInt lastModePos = iHashKeyLoop.Count() - 1 ; |
|
11614 const TInt currentModePos = iHashKeyLoop.Find(aCurrentMode); |
|
11615 TInt newModePos = currentModePos; |
|
11616 |
|
11617 __ASSERT_DEBUG(currentModePos != KErrNotFound , |
|
11618 AknFepPanic(EAknFepPanicNonPermittedEditorMode)); |
|
11619 |
|
11620 do |
|
11621 { |
|
11622 if (newModePos == lastModePos) |
|
11623 { |
|
11624 //we've got to the end of the hash key loop, go back to the beginning |
|
11625 newModePos = 0; |
|
11626 } |
|
11627 else |
|
11628 { |
|
11629 newModePos++; |
|
11630 } |
|
11631 }while(iHashKeyLoop[newModePos] == ENumber && !IsOnlyNumericPermitted()); // no number mode in Chinese qwerty input, except those editors which only support number |
|
11632 |
|
11633 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
11634 if(TryChangeModeL(iHashKeyLoop[newModePos])) |
|
11635 { |
|
11636 return; //succeeded to move to next available mode |
|
11637 } |
|
11638 } |
|
11639 |
|
11640 void CAknFepManager::TryIncrementChineseModeForQwertyL( TInt aCurrentMode ) |
|
11641 { |
|
11642 __ASSERT_DEBUG(IsModePermitted(aCurrentMode),AknFepPanic(EAknFepPanicNonPermittedEditorMode)); |
|
11643 |
|
11644 const TInt lastModePos = iHashKeyLoop.Count() - 1; |
|
11645 const TInt currentModePos = iHashKeyLoop.Find( aCurrentMode ); |
|
11646 TInt newModePos = currentModePos; |
|
11647 |
|
11648 __ASSERT_DEBUG(currentModePos != KErrNotFound , |
|
11649 AknFepPanic(EAknFepPanicNonPermittedEditorMode)); |
|
11650 |
|
11651 do |
|
11652 { |
|
11653 if ( newModePos == lastModePos ) |
|
11654 { |
|
11655 //we've got to the end of the hash key loop, go back to the beginning |
|
11656 newModePos = 0; |
|
11657 } |
|
11658 else |
|
11659 { |
|
11660 newModePos++; |
|
11661 } |
|
11662 } |
|
11663 while ( (iHashKeyLoop[newModePos] == ENumber |
|
11664 && !IsOnlyNumericPermitted()) || (iHashKeyLoop[newModePos] == ELatin |
|
11665 && IsChangeModeByShiftAndSpace() ) ); // no number mode and latin in Chinese qwerty input, except those editors which only support number |
|
11666 |
|
11667 SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
11668 if ( TryChangeModeL( iHashKeyLoop[newModePos] ) ) |
|
11669 { |
|
11670 return; //succeeded to move to next available mode |
|
11671 } |
|
11672 } |
|
11673 |
|
11674 void CAknFepManager::TryChangeToSharedDataModeL() |
|
11675 { |
|
11676 TInt sharedDataMode = iSharedDataInterface->InputMode(); |
|
11677 TryChangeModeL(sharedDataMode); |
|
11678 } |
|
11679 |
|
11680 void CAknFepManager::TryChangeToModeBeforeL() |
|
11681 { |
|
11682 if (TryChangeModeL(iModeBefore)) |
|
11683 { |
|
11684 if (iModeBefore==ELatin) |
|
11685 { |
|
11686 if ( iCaseBefore ) |
|
11687 { |
|
11688 iCaseMan->SetCurrentCase(iCaseBefore); |
|
11689 } |
|
11690 else |
|
11691 { |
|
11692 iCaseMan->UpdateCase(ENullNaviEvent); |
|
11693 } |
|
11694 } |
|
11695 } |
|
11696 } |
|
11697 |
|
11698 #ifdef RD_HINDI_PHONETIC_INPUT |
|
11699 |
|
11700 TBool CAknFepManager::IsIndicPhoneticInputLanguage() const |
|
11701 { |
|
11702 MPtiLanguage* ptilang = iPtiEngine->CurrentLanguage(); |
|
11703 TInt currentPtiLang = (ptilang)? ptilang->LanguageCode() : 0; |
|
11704 return (TAknFepUiIndicInputManager::IsIndicPhoneticLanguage(TLanguage(currentPtiLang))); |
|
11705 } |
|
11706 |
|
11707 void CAknFepManager::TryChangePhoneticModeL() |
|
11708 { |
|
11709 MPtiLanguage* ptilang = iPtiEngine->CurrentLanguage(); |
|
11710 TInt currentPtiLang = (ptilang)? ptilang->LanguageCode() : 0; |
|
11711 TInt lang = 0; |
|
11712 |
|
11713 (TAknFepUiIndicInputManager :: IsIndicPhoneticLanguage(TLanguage(currentPtiLang)))? |
|
11714 lang = ELangEnglish : lang = iLanguageCapabilities.iInputLanguageCode; |
|
11715 |
|
11716 iPtiEngine->ActivateLanguageL(lang); |
|
11717 iLangMan->SetInputLanguageL(lang); |
|
11718 InternalFepUI()->SetMode(iMode, EFalse, iQwertyInputMode); |
|
11719 iCaseMan->UpdateCase(ENullNaviEvent); |
|
11720 UpdateIndicators(); |
|
11721 CommitInlineEditL(); |
|
11722 } |
|
11723 |
|
11724 TInt CAknFepManager::SetPhoneticIndicator(TLanguage aInputLanguage) |
|
11725 { |
|
11726 TInt newState = 0; |
|
11727 TInt currentCase = iCaseMan->CurrentCase(); |
|
11728 |
|
11729 switch(aInputLanguage) |
|
11730 { |
|
11731 case KLangHindiPhonetic: |
|
11732 if(currentCase == EAknEditorUpperCase) |
|
11733 { |
|
11734 newState = EIndicatorStateHindiPhoneticUpper; |
|
11735 } |
|
11736 else |
|
11737 { |
|
11738 newState = EIndicatorStateHindiPhoneticLower; |
|
11739 } |
|
11740 break; |
|
11741 default: |
|
11742 break; |
|
11743 } |
|
11744 return newState; |
|
11745 } |
|
11746 #endif |
|
11747 TBool CAknFepManager::TryChangeModeL(TInt aMode) |
|
11748 { |
|
11749 CAknEdwinState* editorState = EditorState(); |
|
11750 TInt sharedDataMode = iSharedDataInterface->InputMode(); |
|
11751 |
|
11752 if (aMode == EStroke && iQwertyInputMode && sharedDataMode == ECangJie) |
|
11753 { |
|
11754 iEditorStateStrokeUsed = editorState; |
|
11755 iStrokeUsedInQWERTY = ETrue; |
|
11756 } |
|
11757 else if (iEditorStateStrokeUsed == editorState) |
|
11758 { |
|
11759 iStrokeUsedInQWERTY = EFalse; |
|
11760 } |
|
11761 |
|
11762 if (aMode == ECangJie && !iQwertyInputMode && |
|
11763 (iFepPluginManager->PluginInputMode() != EPluginInputModeVkb |
|
11764 || iFepPluginManager->PluginInputMode() != EPluginInputModeFSQ)) |
|
11765 { |
|
11766 aMode = EStroke; |
|
11767 } |
|
11768 |
|
11769 if (aMode == ELatinText ||aMode == ELatinUpper || aMode == ELatinLower) |
|
11770 { |
|
11771 if (TryChangeModeL(ELatin)) |
|
11772 { |
|
11773 if ( !(iAknEditorFlags & EAknEditorFlagFixedCase) ) |
|
11774 { |
|
11775 if (aMode == ELatinText) |
|
11776 { |
|
11777 ClearFlag(EFlagSupressAutoUpdate); |
|
11778 } |
|
11779 else if (aMode == ELatinUpper) |
|
11780 { |
|
11781 //Modify for allow text case after entering a dot and space |
|
11782 ClearFlag(EFlagSupressAutoUpdate); |
|
11783 //Modify for allow text case after entering a dot and space |
|
11784 iCaseMan->SetCurrentCase(EAknEditorUpperCase); |
|
11785 } |
|
11786 else //lower |
|
11787 { |
|
11788 //Modify for allow text case after entering a dot and space |
|
11789 ClearFlag(EFlagSupressAutoUpdate); |
|
11790 //Modify for allow text case after entering a dot and space |
|
11791 iCaseMan->SetCurrentCase(EAknEditorLowerCase); |
|
11792 } |
|
11793 UpdateIndicators(); |
|
11794 } |
|
11795 return ETrue; |
|
11796 } |
|
11797 return EFalse; |
|
11798 } |
|
11799 |
|
11800 if ( iQwertyInputMode && ( aMode == ENumber || aMode == ENativeNumber ) && |
|
11801 !IsOnlyNumericPermitted() |
|
11802 // Add this condition to exclude all touch inputmethods. |
|
11803 // When change to number range on touch inputmethods, fn key state can't be locked. |
|
11804 && iFepPluginManager |
|
11805 && iFepPluginManager->PluginInputMode() == EPluginInputModeNone ) |
|
11806 { |
|
11807 if (TryChangeModeL(ELatin)) |
|
11808 { |
|
11809 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
11810 // If editor should be launched in FnLock state, because in case of QWERTY keypad |
|
11811 // Current numeric mode converted to alphanumeric mode. |
|
11812 if( iFnKeyManager ) |
|
11813 { |
|
11814 iFnKeyManager->SetFnKeyState(CAknFepFnKeyManager::EFnKeyLock); |
|
11815 SetCase((TCase)EFnKeyLowerCase); |
|
11816 } |
|
11817 #endif // RD_INTELLIGENT_TEXT_INPUT |
|
11818 return ETrue; |
|
11819 } |
|
11820 } |
|
11821 |
|
11822 if (IsModePermitted(aMode)) |
|
11823 { |
|
11824 if (aMode == ELatin) |
|
11825 { |
|
11826 if (iAknEditorFlags & EAknEditorFlagNoT9) |
|
11827 { |
|
11828 SetWesternPredictive(EFalse); |
|
11829 } |
|
11830 |
|
11831 if (iAknEditorFlags & EAknEditorFlagFixedCase) |
|
11832 { |
|
11833 iCaseMan->ConfigureCaseStateFromEditorState(); |
|
11834 } |
|
11835 } |
|
11836 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
11837 if (!iQwertyInputMode && WesternPredictive() && iFepManState == EAknFepStateUIActive) |
|
11838 #else |
|
11839 if (WesternPredictive() && iFepManState == EAknFepStateUIActive) |
|
11840 #endif |
|
11841 { |
|
11842 TryRemoveNoMatchesIndicatorL(); |
|
11843 UpdateCbaL(NULL); |
|
11844 } |
|
11845 TryCloseUiL(); |
|
11846 |
|
11847 // getting a new ui manager object corresponded in aMode. |
|
11848 MAknFepManagerInterface* fepUI = iLangMan->GetFepUI(aMode, iCharWidth, |
|
11849 IsPredictive(aMode)); |
|
11850 // getting the currect language id from ptiengine. |
|
11851 MPtiLanguage* ptilang = iPtiEngine->CurrentLanguage(); |
|
11852 TInt currentPtiLang = (ptilang)? ptilang->LanguageCode() : 0; |
|
11853 // getting the supported language id in current ui manager. |
|
11854 TInt currentUiLang = fepUI->SupportLanguage(aMode); |
|
11855 |
|
11856 // changing language id both ptiengine and ui manager |
|
11857 // 1. check the currect ui manager for input mode |
|
11858 // 2. check the current ptiengine and ui manager |
|
11859 if (iCurrentFepUI != fepUI |
|
11860 || currentPtiLang != currentUiLang) |
|
11861 { |
|
11862 iCurrentFepUI = fepUI; |
|
11863 TInt err = iPtiEngine->ActivateLanguageL(currentUiLang); |
|
11864 if (err != KErrNone) |
|
11865 { |
|
11866 #ifdef _DEBUG |
|
11867 RDebug::Print(_L("ActivateLanguageL error return code=[%d] language id=[%d]"), |
|
11868 err, iLanguageCapabilities.iInputLanguageCode); |
|
11869 #endif |
|
11870 ChangeInputLanguageL(ELangEnglish); |
|
11871 return ETrue; |
|
11872 } |
|
11873 } |
|
11874 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
11875 #ifdef FF_DUAL_LANGUAGE_SUPPORT |
|
11876 // Change secondary input |
|
11877 iPtiEngine->SetSecondaryInputL(iSharedDataInterface->InputTextLanguageSecondary()); |
|
11878 #endif //FF_DUAL_LANGUAGE_SUPPORT |
|
11879 #endif |
|
11880 |
|
11881 //#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
11882 TBuf<50> mapData; |
|
11883 //Init Data |
|
11884 for (TInt i = 0; i < 50; i++) |
|
11885 { |
|
11886 mapData.Append(0); |
|
11887 } |
|
11888 |
|
11889 //Backup original input mode |
|
11890 TPtiEngineInputMode oriMode = iPtiEngine->InputMode(); |
|
11891 |
|
11892 //Change current input mode, since MappingDataForKey I/F only worked |
|
11893 //when in EPtiEngineMultitapping mode |
|
11894 iPtiEngine->SetInputMode(EPtiEngineMultitapping); |
|
11895 iPtiEngine->MappingDataForKey(EPtiKey1, mapData, iPtiEngine->Case()); |
|
11896 |
|
11897 //Restore |
|
11898 iPtiEngine->SetInputMode(oriMode); |
|
11899 |
|
11900 //Get first three symbols |
|
11901 if(mapData.Length() > 0) |
|
11902 { |
|
11903 iSymbolData.iSymbol1 = mapData[0]; |
|
11904 |
|
11905 if (mapData.Length() > 1) |
|
11906 iSymbolData.iSymbol2 = mapData[1]; |
|
11907 if (mapData.Length() > 2) |
|
11908 iSymbolData.iSymbol3 = mapData[2]; |
|
11909 } |
|
11910 |
|
11911 //Write data to stream |
|
11912 if (iFepPluginManager && iFepPluginManager->CurrentPluginInputFepUI()) |
|
11913 { |
|
11914 iFepPluginManager->CurrentPluginInputFepUI()->HandleCommandL( |
|
11915 ECmdPenInputSymbolOfHardKeyOne, reinterpret_cast<TInt>(&iSymbolData)); |
|
11916 } |
|
11917 //#endif |
|
11918 iMode = aMode; |
|
11919 |
|
11920 #ifdef RD_SCALABLE_UI_V2 |
|
11921 if ( IsChineseInputMode( aMode ) ) |
|
11922 { |
|
11923 iLastChineseInputMode = aMode; |
|
11924 } |
|
11925 #endif // RD_SCALABLE_UI_V2 |
|
11926 if(iMode == ENumber || iMode == ENativeNumber ) |
|
11927 { |
|
11928 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
11929 ClearFlag(CAknFepManager::EFlagNewSharedDataInputLanguage); |
|
11930 ClearFlag(CAknFepManager::EFlagNewSharedDataInputMode); |
|
11931 #endif // RD_INTELLIGENT_TEXT_INPUT |
|
11932 InternalFepUI()->SetNumberModeKeyMappingL(iAknEditorNumericKeymap); |
|
11933 } |
|
11934 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
11935 InternalFepUI()->SetMode(iMode, IsPredictive(), iQwertyInputMode, KeyboardLayout()); |
|
11936 #else |
|
11937 InternalFepUI()->SetMode(iMode, IsPredictive(), iQwertyInputMode); |
|
11938 #endif |
|
11939 iHashKeyMan->SetMode(iMode, IsPredictive()); |
|
11940 // ensure editor is aware of new fep mode |
|
11941 if ( IsFepAwareTextEditor() ) |
|
11942 { |
|
11943 EditorState()->SetCurrentInputMode(EditorModeFromFepMode(aMode)); |
|
11944 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
11945 AdjustCursorTypeForCurrentPosition(); |
|
11946 } |
|
11947 |
|
11948 // when cursor is in between two words and SCT is launched and |
|
11949 // cancel key is pressed, dont move the cursor at the end of |
|
11950 // second word. |
|
11951 if (WesternPredictive(aMode) && !iUncommittedText.Length() |
|
11952 && CursorInsideWord() && !IsCcpuFlagSet(ECcpuStateSupressCursorMoveToEnd) |
|
11953 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
11954 && (!iSupressCursorMoveToEndChrKeyPressed) |
|
11955 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
11956 ) |
|
11957 { |
|
11958 MoveCursorToEndOfWordL(); |
|
11959 } |
|
11960 else |
|
11961 { |
|
11962 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
11963 iSupressCursorMoveToEndChrKeyPressed = EFalse; |
|
11964 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
11965 ClearCcpuFlag(ECcpuStateSupressCursorMoveToEnd); |
|
11966 } |
|
11967 |
|
11968 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
11969 // Ensure that autocompletion state is updated |
|
11970 if (WesternPredictive()) |
|
11971 { |
|
11972 SetAutoCompletionState(iSharedDataInterface->PredictiveTextAutoCompleteOn()); |
|
11973 } |
|
11974 #endif |
|
11975 // Set multitap timer to PtiEngine for Japanese variant only |
|
11976 if (IsFeatureSupportedJapanese()) |
|
11977 { |
|
11978 TInt timeout = (iInputCapabilities.SupportsSecretText())? |
|
11979 KSyncPasswdTimeout : iMultiTapTimer; |
|
11980 iPtiEngine->HandleCommandL(EPtiCommandSetMultitapTimer, &timeout); |
|
11981 iPtiEngine->HandleCommandL(EPtiCommandSetJapaneseQwertyFlags, &iJapaneseQwertyFlags); |
|
11982 TInt clear = iSharedDataInterface->ClearDirection(); |
|
11983 iPtiEngine->HandleCommandL(EPtiCommandSetClearFunction, &clear); |
|
11984 // Send PtiEngine the command whether Pictograph is allowed in Candidate list |
|
11985 TInt allow = IsAbleToLaunchPCT(); |
|
11986 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
11987 iPtiEngine->HandleCommandL(EPtiCommandAllowPictographCandidate, &allow); |
|
11988 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
11989 } |
|
11990 |
|
11991 UpdateIndicators(); // moved to bottom to avoid extra indicator updates |
|
11992 |
|
11993 return ETrue; |
|
11994 } |
|
11995 return EFalse; |
|
11996 } |
|
11997 |
|
11998 void CAknFepManager::ChangeInputLanguageL(TInt aInputLanguage) |
|
11999 { |
|
12000 if(iLangMan) |
|
12001 { |
|
12002 iLangMan->SetInputLanguageL(aInputLanguage); |
|
12003 |
|
12004 SetInputLanguageCapabilities(aInputLanguage); |
|
12005 |
|
12006 ReadHashKeyLoopL(); |
|
12007 // we need to make sure that we commit the word to ptiengine, |
|
12008 // so that the word gets added to the UWD |
|
12009 SetCcpuFlag(ECcpuStataCommitPredictiveWord); |
|
12010 // Addition for ITI on FSQ |
|
12011 // When FSQ is opened with the ITI-supported input language, |
|
12012 // if switch to another language which doesn't support ITI, such as Korean, |
|
12013 // need to restore the previous configuration on FEP |
|
12014 if ( iFepPluginManager ) |
|
12015 { |
|
12016 iFepPluginManager->ResetItiStateL(); |
|
12017 } |
|
12018 if ( !TryChangeModeL(NewInputModeAfterLanguageChange()) ) |
|
12019 { |
|
12020 if ( !TryChangeModeL(ELatin) ) |
|
12021 { |
|
12022 // If the editor does not support text input mode, we try number mode. |
|
12023 if( IsInputModeAvailable(ENativeNumber) && |
|
12024 ( iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic || |
|
12025 iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic || |
|
12026 iLanguageCapabilities.iLocalDigitType == EDigitTypeDevanagari ) ) |
|
12027 { |
|
12028 TryChangeModeL(ENativeNumber);; |
|
12029 } |
|
12030 else |
|
12031 { |
|
12032 TryChangeModeL(ENumber); |
|
12033 } |
|
12034 } |
|
12035 } |
|
12036 |
|
12037 if (!iLanguageCapabilities.iLocalInputLanguageInUse) |
|
12038 { |
|
12039 switch (iSharedDataInterface->InputTextLanguage()) |
|
12040 { |
|
12041 case ELangPrcChinese: |
|
12042 { |
|
12043 iSharedDataInterface->SetInputMode(EPinyin); |
|
12044 SetFlag(EFlagNewSharedDataInputMode); |
|
12045 break; |
|
12046 } |
|
12047 case ELangTaiwanChinese: |
|
12048 { |
|
12049 iSharedDataInterface->SetInputMode(EZhuyin); |
|
12050 SetFlag(EFlagNewSharedDataInputMode); |
|
12051 break; |
|
12052 } |
|
12053 case ELangHongKongChinese: |
|
12054 { |
|
12055 iSharedDataInterface->SetInputMode(EStroke); |
|
12056 iSharedDataInterface->SetCangJieMode(ECangJieNormal); |
|
12057 SetFlag(EFlagNewSharedDataInputMode); |
|
12058 break; |
|
12059 } |
|
12060 default: |
|
12061 break; |
|
12062 } |
|
12063 } |
|
12064 |
|
12065 SetHashKeyStyle(); |
|
12066 UpdateEditorContext(); |
|
12067 } |
|
12068 //add notify to phrase creation udbmanagement view |
|
12069 |
|
12070 if(iUserdbdlg) |
|
12071 { |
|
12072 iUserdbdlg->OnChangeLanguageL( aInputLanguage ); |
|
12073 if ( aInputLanguage != ELangPrcChinese && |
|
12074 aInputLanguage != ELangTaiwanChinese && |
|
12075 aInputLanguage != ELangHongKongChinese ) |
|
12076 { |
|
12077 iUserdbdlg = NULL; |
|
12078 } |
|
12079 } |
|
12080 } |
|
12081 |
|
12082 void CAknFepManager::RemovePreviousCharacterL() |
|
12083 { |
|
12084 if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
12085 { |
|
12086 CommitInlineEditL(); |
|
12087 } |
|
12088 |
|
12089 // Set cursor span on previous character |
|
12090 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
12091 if (iUncommittedText.iAnchorPos > 0) |
|
12092 { |
|
12093 iUncommittedText.iAnchorPos--; |
|
12094 } |
|
12095 |
|
12096 |
|
12097 // get text to replace |
|
12098 TBuf<ESingleCharacter> charToReplace; |
|
12099 iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(charToReplace, |
|
12100 iUncommittedText.iAnchorPos, |
|
12101 ESingleCharacter); |
|
12102 |
|
12103 // delete the character with an inline edit |
|
12104 StartInlineEditL(iUncommittedText, charToReplace, ESingleCharacter, EFalse); |
|
12105 UpdateInlineEditL(KNullDesC, 0); |
|
12106 CommitInlineEditL(); |
|
12107 } |
|
12108 |
|
12109 void CAknFepManager::RemoveZWSCharacterL( TBool aIsViramaInputted, |
|
12110 TBool aIsInMultitappingHalant, |
|
12111 TBool aIsCharModifier, |
|
12112 TBool aIsLigaturePresent /*= EFalse*/) |
|
12113 { |
|
12114 CTextLayout* textLayout = TextLayout(); |
|
12115 MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
12116 if(!textLayout && !docNavi) |
|
12117 return; |
|
12118 |
|
12119 if( aIsLigaturePresent ) |
|
12120 { |
|
12121 TTmDocPosSpec pos = DocPos(); |
|
12122 TTmPosInfo2 info; |
|
12123 TTmLineInfo lineInfo; |
|
12124 if (docNavi) |
|
12125 { |
|
12126 docNavi->FindDocPos(pos, info, lineInfo); |
|
12127 } |
|
12128 else |
|
12129 { |
|
12130 textLayout->TagmaTextLayout().FindDocPos(pos, info, lineInfo); |
|
12131 } |
|
12132 |
|
12133 if( IsZWSCharacterPresent( ETrue ) ) |
|
12134 { |
|
12135 TInt commitPoint = pos.iPos - 2; |
|
12136 if( IsFlagSet( EFlagInsideInlineEditingTransaction ) ) |
|
12137 { |
|
12138 CommitInlineEditL(); |
|
12139 } |
|
12140 |
|
12141 TCursorSelection sel( commitPoint, commitPoint ); |
|
12142 iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(sel); |
|
12143 } |
|
12144 } |
|
12145 else |
|
12146 { |
|
12147 if ( IsFlagSet(EFlagInsideInlineEditingTransaction) && IsZWSCharacterPresent()) |
|
12148 { |
|
12149 CommitInlineEditL(); |
|
12150 } |
|
12151 } |
|
12152 |
|
12153 TTmDocPosSpec pos = DocPos(); |
|
12154 pos.iType = TTmDocPosSpec::ETrailing; |
|
12155 TTmPosInfo2 info; |
|
12156 TTmLineInfo lineInfo; |
|
12157 if ( ! iInputCapabilities.SupportsSecretText() ) |
|
12158 { |
|
12159 if (docNavi) |
|
12160 { |
|
12161 docNavi->FindDocPos(pos, info, lineInfo); |
|
12162 } |
|
12163 else |
|
12164 { |
|
12165 textLayout->TagmaTextLayout().FindDocPos(pos, info, lineInfo); |
|
12166 } |
|
12167 TBuf<2> previousCharacter; |
|
12168 TBuf<1> zwsPrevChar; |
|
12169 previousCharacter.FillZ(); |
|
12170 zwsPrevChar.FillZ(); |
|
12171 TBool found = EFalse; |
|
12172 |
|
12173 TCursorSelection curSel; |
|
12174 if ( IsFepAwareTextEditor() ) |
|
12175 { |
|
12176 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(curSel); |
|
12177 TInt lowerpos = curSel.LowerPos(); |
|
12178 if( lowerpos > 0) |
|
12179 { |
|
12180 if(lowerpos > 1) |
|
12181 iInputCapabilities.FepAwareTextEditor()-> |
|
12182 GetEditorContentForFep(previousCharacter, lowerpos - 2, 2); |
|
12183 else |
|
12184 iInputCapabilities.FepAwareTextEditor()-> |
|
12185 GetEditorContentForFep(previousCharacter, lowerpos - 1, 1); |
|
12186 |
|
12187 if( lowerpos > 1 ) |
|
12188 { |
|
12189 if(previousCharacter[1] == ZERO_WIDTH_SPACE) |
|
12190 { |
|
12191 zwsPrevChar.Append(previousCharacter[1]); |
|
12192 if( aIsInMultitappingHalant ) |
|
12193 { |
|
12194 curSel.iAnchorPos = lowerpos - 2; |
|
12195 } |
|
12196 else |
|
12197 { |
|
12198 curSel.iAnchorPos = lowerpos - 1; |
|
12199 } |
|
12200 found = ETrue; |
|
12201 } |
|
12202 else if( previousCharacter[0] == ZERO_WIDTH_SPACE ) |
|
12203 { |
|
12204 zwsPrevChar.Append(previousCharacter[0]); |
|
12205 curSel.iAnchorPos = lowerpos - 2; |
|
12206 curSel.iCursorPos = lowerpos - 1; |
|
12207 found = ETrue; |
|
12208 } |
|
12209 } |
|
12210 else |
|
12211 { |
|
12212 if(previousCharacter[0] == ZERO_WIDTH_SPACE) |
|
12213 { |
|
12214 zwsPrevChar.Append(previousCharacter[0]); |
|
12215 if( aIsInMultitappingHalant ) |
|
12216 { |
|
12217 curSel.iAnchorPos = lowerpos - 2; |
|
12218 } |
|
12219 else |
|
12220 { |
|
12221 curSel.iAnchorPos = lowerpos - 1; |
|
12222 } |
|
12223 found = ETrue; |
|
12224 } |
|
12225 } |
|
12226 |
|
12227 } |
|
12228 } |
|
12229 if( found ) |
|
12230 { |
|
12231 StartInlineEditL(curSel, zwsPrevChar, ESingleCharacter, ETrue); |
|
12232 UpdateInlineEditL(KNullDesC, 0); |
|
12233 CommitInlineEditL(); |
|
12234 if ( !aIsInMultitappingHalant && ! iInputCapabilities.SupportsSecretText() ) |
|
12235 { |
|
12236 if ( aIsViramaInputted ) |
|
12237 { |
|
12238 TTmDocPosSpec pos = DocPos(); |
|
12239 TTmPosInfo2 infotemp; |
|
12240 if (docNavi) |
|
12241 { |
|
12242 docNavi->FindDocPos(pos, info, lineInfo); |
|
12243 } |
|
12244 else |
|
12245 { |
|
12246 textLayout->TagmaTextLayout().FindDocPos(pos, info, lineInfo); |
|
12247 } |
|
12248 if(NextChar() && TAknFepUiIndicInputManager::IsCharBaseConsonant(NextChar(), |
|
12249 TLanguage(iLanguageCapabilities.iInputLanguageCode))) |
|
12250 { |
|
12251 TInt nextPos; |
|
12252 if (docNavi) |
|
12253 { |
|
12254 nextPos = docNavi->FindNextPos(pos.iPos); |
|
12255 } |
|
12256 else |
|
12257 { |
|
12258 nextPos = textLayout->TagmaTextLayout().FindNextPos(pos.iPos); |
|
12259 } |
|
12260 info.iDocPos.iPos = nextPos; |
|
12261 } |
|
12262 else if((TAknFepUiIndicInputManager::IsCharAnVowel(NextChar(), |
|
12263 TLanguage(iLanguageCapabilities.iInputLanguageCode))) |
|
12264 &&(aIsCharModifier && TAknFepUiIndicInputManager::IsCharVirama( |
|
12265 PreviousChar(), TLanguage(iLanguageCapabilities.iInputLanguageCode)))) |
|
12266 { |
|
12267 bool posFound; |
|
12268 if (docNavi) |
|
12269 { |
|
12270 posFound = docNavi->GetNextVisualCursorPos(pos, infotemp, EFalse); |
|
12271 } |
|
12272 else |
|
12273 { |
|
12274 posFound = textLayout->TagmaTextLayout().GetNextVisualCursorPos(pos, |
|
12275 infotemp, |
|
12276 EFalse); |
|
12277 } |
|
12278 |
|
12279 if (posFound) |
|
12280 { |
|
12281 info.iDocPos.iPos = infotemp.iDocPos.iPos; |
|
12282 } |
|
12283 } |
|
12284 TCursorSelection sel(info.iDocPos.iPos ,info.iDocPos.iPos ); |
|
12285 iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(sel); |
|
12286 } |
|
12287 else |
|
12288 { |
|
12289 TCursorSelection sel(info.iDocPos.iPos - 1,info.iDocPos.iPos - 1); |
|
12290 iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(sel); |
|
12291 } |
|
12292 |
|
12293 SendEventsToPluginManL( EPluginSyncFepAwareText ); |
|
12294 } |
|
12295 } |
|
12296 } |
|
12297 } |
|
12298 |
|
12299 void CAknFepManager::TryChangePredictiveInputModeL(TBool aFlag) |
|
12300 { |
|
12301 if(Japanese() && iMode != ELatin) |
|
12302 { |
|
12303 if(aFlag) |
|
12304 { |
|
12305 if (!(iAknEditorFlags & EAknEditorFlagNoT9) |
|
12306 && HasJapanesePredictionInputMode()) |
|
12307 { |
|
12308 iJapanesePredictive = aFlag; |
|
12309 iSharedDataInterface->SetJapanesePredictiveTextOn(); |
|
12310 } |
|
12311 } |
|
12312 else |
|
12313 { |
|
12314 iJapanesePredictive = aFlag; |
|
12315 iSharedDataInterface->ResetJapanesePredictiveTextOn(); |
|
12316 } |
|
12317 } |
|
12318 else |
|
12319 { |
|
12320 SetWesternPredictive(aFlag); |
|
12321 } |
|
12322 TryChangeModeL(iMode); |
|
12323 } |
|
12324 |
|
12325 MCoeFepAwareTextEditor* CAknFepManager::FepAwareTextEditor() const |
|
12326 { |
|
12327 return iInputCapabilities.FepAwareTextEditor(); |
|
12328 } |
|
12329 |
|
12330 TBool CAknFepManager::IsFepAwareTextEditor() const |
|
12331 { |
|
12332 #ifdef RD_SCALABLE_UI_V2 |
|
12333 return FullyFepAwareTextEditor(); |
|
12334 #else |
|
12335 return ( iInputCapabilities.FepAwareTextEditor() ? ETrue : EFalse ); |
|
12336 #endif |
|
12337 } |
|
12338 |
|
12339 TCursorSelection CAknFepManager::UncommittedText() const |
|
12340 { |
|
12341 return iUncommittedText; |
|
12342 } |
|
12343 |
|
12344 void CAknFepManager::SetCase(TCase aCase) |
|
12345 { |
|
12346 // For QWERTY only keypad, extended input state like FnLock is applicable. |
|
12347 // In case of ITU-T keypad, this flag should not be part of editor flag. |
|
12348 // In case of numeric only editor Only FnReverse state is valid and editor will be on EFnReverse |
|
12349 // State if FnKey is hold on state. |
|
12350 |
|
12351 //TODO: In case of other functionized input state like (FnNext), it should be stored in editor |
|
12352 |
|
12353 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
12354 if(EditorState()) |
|
12355 { |
|
12356 if( iFnKeyManager && ( iFnKeyManager->FnKeyState()== CAknFepFnKeyManager::EFnKeyLock ) ) |
|
12357 { |
|
12358 EditorState()->SetFlags( EditorState()->Flags() | EAknEditorFlagFnLock ); |
|
12359 } |
|
12360 else |
|
12361 { |
|
12362 EditorState()->SetFlags( EditorState()->Flags() & ~EAknEditorFlagFnLock ); |
|
12363 } |
|
12364 } |
|
12365 #endif |
|
12366 |
|
12367 InternalFepUI()->SetCase(aCase); |
|
12368 } |
|
12369 |
|
12370 CAknEdwinState* CAknFepManager::EditorState() const |
|
12371 { |
|
12372 if ( IsFepAwareTextEditor() ) |
|
12373 { |
|
12374 MCoeFepAwareTextEditor* fepAvareTextEditor = iInputCapabilities.FepAwareTextEditor(); |
|
12375 |
|
12376 if ( fepAvareTextEditor && fepAvareTextEditor->Extension1() ) |
|
12377 { |
|
12378 return static_cast<CAknEdwinState*>( fepAvareTextEditor->Extension1()->State( KNullUid ) ); |
|
12379 } |
|
12380 } |
|
12381 return NULL; |
|
12382 } |
|
12383 |
|
12384 void CAknFepManager::SetPredictiveIndicatorState(TAknEditingState& aState) |
|
12385 { |
|
12386 |
|
12387 TInt currentCase = iCaseMan->CurrentCase(); |
|
12388 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
12389 if(iIsAutoCompleteOn && iLanguageCapabilities.iInputLanguageCode != ELangThai) |
|
12390 { |
|
12391 if (iLanguageCapabilities.iInputLanguageCode == ELangArabic) |
|
12392 aState=EAutoCompleteArabic; |
|
12393 |
|
12394 else if (iLanguageCapabilities.iInputLanguageCode == ELangHebrew) |
|
12395 aState=EAutoCompleteHebrew; |
|
12396 |
|
12397 else if (iLanguageCapabilities.iInputLanguageCode == ELangFarsi || |
|
12398 iLanguageCapabilities.iInputLanguageCode == ELangUrdu) |
|
12399 aState=EAutoCompleteFarsiAndUrdu; |
|
12400 /*Hindi*/ |
|
12401 else if ( (iLanguageCapabilities.iInputLanguageCode == ELangHindi) || (iLanguageCapabilities.iInputLanguageCode == ELangMarathi)) |
|
12402 aState = EAutoCompleteHindi; |
|
12403 |
|
12404 else if(iLanguageCapabilities.iInputLanguageCode == ELangVietnamese) |
|
12405 { |
|
12406 switch (currentCase) |
|
12407 { |
|
12408 case EAknEditorUpperCase: |
|
12409 aState = EAutoCompleteUpperVietnamese; |
|
12410 break; |
|
12411 case EAknEditorLowerCase: |
|
12412 aState = EAutoCompleteLowerVietnamese; |
|
12413 break; |
|
12414 case EAknEditorTextCase: |
|
12415 aState = EAutoCompleteShiftedVietnamese; |
|
12416 break; |
|
12417 default: |
|
12418 break; |
|
12419 } |
|
12420 } |
|
12421 else |
|
12422 { |
|
12423 switch (currentCase) |
|
12424 { |
|
12425 case EAknEditorUpperCase: |
|
12426 aState = EAutoCompleteUpper; |
|
12427 break; |
|
12428 case EAknEditorLowerCase: |
|
12429 aState = EAutoCompleteLower; |
|
12430 break; |
|
12431 case EAknEditorTextCase: |
|
12432 aState = EAutoCompleteShifted; |
|
12433 break; |
|
12434 default: |
|
12435 break; |
|
12436 } |
|
12437 } |
|
12438 |
|
12439 } |
|
12440 else |
|
12441 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
12442 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
12443 if(iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyNone) |
|
12444 { |
|
12445 aState = EFnKeyPressed; |
|
12446 if(iFnKeyManager->FnKeyState() == CAknFepFnKeyManager::EFnKeyLock) |
|
12447 aState = EFnKeyLocked; |
|
12448 } |
|
12449 else |
|
12450 #endif |
|
12451 { |
|
12452 if (iLanguageCapabilities.iInputLanguageCode == ELangArabic) |
|
12453 aState = ET9Arabic; |
|
12454 |
|
12455 else if (iLanguageCapabilities.iInputLanguageCode == ELangHebrew) |
|
12456 aState = ET9Hebrew; |
|
12457 |
|
12458 else if (iLanguageCapabilities.iInputLanguageCode == ELangFarsi || |
|
12459 iLanguageCapabilities.iInputLanguageCode == ELangUrdu) |
|
12460 aState = ET9FarsiAndUrdu; |
|
12461 |
|
12462 else if (iLanguageCapabilities.iInputLanguageCode == ELangThai) |
|
12463 aState = ET9Thai; |
|
12464 |
|
12465 /*Hindi*/ |
|
12466 #ifdef RD_MARATHI |
|
12467 /*Marathi*/ |
|
12468 else if ( iLanguageCapabilities.iInputLanguageCode == ELangMarathi ) |
|
12469 aState = EIndicatorStatePredictiveMarathi; |
|
12470 #endif // RD_MARATHI |
|
12471 |
|
12472 else if(iLanguageCapabilities.iInputLanguageCode == ELangVietnamese) |
|
12473 { |
|
12474 switch (currentCase) |
|
12475 { |
|
12476 case EAknEditorUpperCase: |
|
12477 aState = ET9UpperVietnamese; |
|
12478 break; |
|
12479 case EAknEditorLowerCase: |
|
12480 aState = ET9LowerVietnamese; |
|
12481 break; |
|
12482 case EAknEditorTextCase: |
|
12483 aState = ET9ShiftedVietnamese; |
|
12484 break; |
|
12485 default: |
|
12486 break; |
|
12487 } |
|
12488 } |
|
12489 |
|
12490 else if(iLanguageCapabilities.iInputLanguageCode == ELangGreek) |
|
12491 { |
|
12492 switch (currentCase) |
|
12493 { |
|
12494 case EAknEditorUpperCase: |
|
12495 aState = ET9UpperGreek; |
|
12496 break; |
|
12497 case EAknEditorLowerCase: |
|
12498 aState = ET9LowerGreek; |
|
12499 break; |
|
12500 case EAknEditorTextCase: |
|
12501 aState = ET9ShiftedGreek; |
|
12502 break; |
|
12503 default: |
|
12504 break; |
|
12505 } |
|
12506 } |
|
12507 |
|
12508 //Cyrillic alphabet is used for Russian, Bulgarian and |
|
12509 //Ukranian languages |
|
12510 else if(iLanguageCapabilities.iInputLanguageCode == ELangRussian || |
|
12511 iLanguageCapabilities.iInputLanguageCode == ELangBulgarian || |
|
12512 iLanguageCapabilities.iInputLanguageCode == ELangUkrainian ) |
|
12513 { |
|
12514 switch (currentCase) |
|
12515 { |
|
12516 case EAknEditorUpperCase: |
|
12517 aState = ET9UpperCyrillic; |
|
12518 break; |
|
12519 case EAknEditorLowerCase: |
|
12520 aState = ET9LowerCyrillic; |
|
12521 break; |
|
12522 case EAknEditorTextCase: |
|
12523 aState = ET9ShiftedCyrillic; |
|
12524 break; |
|
12525 default: |
|
12526 break; |
|
12527 } |
|
12528 } |
|
12529 else |
|
12530 { |
|
12531 switch (currentCase) |
|
12532 { |
|
12533 case EAknEditorUpperCase: |
|
12534 aState = ET9Upper; |
|
12535 break; |
|
12536 case EAknEditorLowerCase: |
|
12537 aState = ET9Lower; |
|
12538 break; |
|
12539 case EAknEditorTextCase: |
|
12540 aState = ET9Shifted; |
|
12541 break; |
|
12542 default: |
|
12543 break; |
|
12544 } |
|
12545 } |
|
12546 |
|
12547 } |
|
12548 } |
|
12549 void CAknFepManager::UpdateIndicators() |
|
12550 { |
|
12551 if(ELongKeyPress == iKeyRepeat) |
|
12552 return; |
|
12553 // If it is fepware editor update the Indicators |
|
12554 // otherwise not need excute remainig part of code. |
|
12555 if( !iInputCapabilities.FepAwareTextEditor() || !iFepFullyConstructed ) |
|
12556 { |
|
12557 //Ensure, If no idicator is require, make indicator state None |
|
12558 if (!IsFlagSet(EFlagForegroundUIComponentVisible | EFlagMenuPaneVisible)) |
|
12559 iIndicator->SetState(EStateNone); |
|
12560 return; |
|
12561 } |
|
12562 |
|
12563 TAknEditingState newState = EStateNone; |
|
12564 MPtiLanguage* ptiLang = PtiEngine()->CurrentLanguage(); |
|
12565 MAknEditingStateIndicator* editingStateIndicator = EditingStateIndicator(); |
|
12566 |
|
12567 TBool findPaneIndicator( |
|
12568 iAknEditorFlags & EAknEditorFlagNoEditIndicators && |
|
12569 iAknEditorFlags & EAknEditorFlagForceTransparentFepModes && |
|
12570 editingStateIndicator != (MAknEditingStateIndicator*)iIndicator ); |
|
12571 |
|
12572 #ifdef RD_SCALABLE_UI_V2 |
|
12573 TBool fingerItutIndicator = ( iFepPluginManager && |
|
12574 iFepPluginManager->PluginInputMode() == EPluginInputModeItut ); |
|
12575 #else |
|
12576 TBool fingerItutIndicator = EFalse; |
|
12577 |
|
12578 #endif |
|
12579 if ( IsHybridAplhaEditor() && !iHybridAplphaChangedToAlphanumeric ) |
|
12580 { |
|
12581 newState = EHybridModeLatin; |
|
12582 } |
|
12583 else if (!(iAknEditorFlags & EAknEditorFlagNoEditIndicators) |
|
12584 || findPaneIndicator || fingerItutIndicator) |
|
12585 { |
|
12586 |
|
12587 #ifdef RD_SCALABLE_UI_V2 |
|
12588 if ( ( IsFlagSet(EFlagQwertyShiftMode) || IsFlagSet(EFlagLongShiftKeyPress)) && |
|
12589 ((iFepPluginManager && iFepPluginManager->PluginInputMode() == EPluginInputModeVkb) || |
|
12590 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
12591 iQwertyInputMode |
|
12592 #else |
|
12593 ( iQwertyInputMode && (IsFlagSet(EFlagQwertyShiftMode) ||IsFlagSet(EFlagLongShiftKeyPress)) |
|
12594 && (iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyNext) |
|
12595 && (iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyLock) |
|
12596 && (iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyForced) |
|
12597 ) |
|
12598 #endif |
|
12599 )) |
|
12600 #else |
|
12601 if ( iQwertyInputMode && IsFlagSet(EFlagQwertyShiftMode)) |
|
12602 |
|
12603 #endif |
|
12604 { |
|
12605 newState = EQwertyShift; |
|
12606 |
|
12607 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
12608 // To keep the shift key indicator in |
|
12609 // Check if fn/shift both key are pressed |
|
12610 if((iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyNone) && |
|
12611 (IsFlagSet(EFlagQwertyShiftMode) || IsFlagSet(EFlagLongShiftKeyPress))) |
|
12612 { |
|
12613 newState = EFnKeyPressed; |
|
12614 } |
|
12615 #endif |
|
12616 |
|
12617 } |
|
12618 else |
|
12619 { |
|
12620 switch (iMode) |
|
12621 { |
|
12622 case EHiraganaKanji: |
|
12623 if (IsPredictive()) |
|
12624 { |
|
12625 newState = EIndicatorStateJapanesePredictive; |
|
12626 } |
|
12627 else |
|
12628 { |
|
12629 newState = EIndicatorStateHiraganaKanji; |
|
12630 } |
|
12631 break; |
|
12632 case EKatakana: |
|
12633 if (iCharWidth == EHalfWidthChar) |
|
12634 { |
|
12635 newState = EIndicatorStateHalfKatakana; |
|
12636 } |
|
12637 else if (iCharWidth == EFullWidthChar) |
|
12638 { |
|
12639 newState = EIndicatorStateFullKatakana; |
|
12640 } |
|
12641 break; |
|
12642 case EHiragana: |
|
12643 { |
|
12644 newState = EIndicatorStateHiragana; |
|
12645 } |
|
12646 break; |
|
12647 case EPinyin: |
|
12648 if (ptiLang->HasInputMode(EPtiEnginePinyinByPhrase)) |
|
12649 { |
|
12650 newState = EIndicatorStatePinyinPhrase; |
|
12651 } |
|
12652 else |
|
12653 { |
|
12654 newState = EIndicatorStatePinyin; |
|
12655 } |
|
12656 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
12657 if ( iFnKeyManager->FnKeyState() |
|
12658 == CAknFepFnKeyManager::EFnKeyLock ) |
|
12659 newState = EFnKeyLocked; |
|
12660 else if ( iFnKeyManager->FnKeyState() |
|
12661 != CAknFepFnKeyManager::EFnKeyNone ) |
|
12662 newState = EFnKeyPressed; |
|
12663 #endif |
|
12664 break; |
|
12665 case EZhuyin: |
|
12666 if (ptiLang->HasInputMode(EPtiEngineZhuyinByPhrase)) |
|
12667 { |
|
12668 newState = EIndicatorStateZhuyinPhrase; |
|
12669 } |
|
12670 else |
|
12671 { |
|
12672 newState = EIndicatorStateZhuyin; |
|
12673 } |
|
12674 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
12675 if ( iFnKeyManager->FnKeyState() |
|
12676 == CAknFepFnKeyManager::EFnKeyLock ) |
|
12677 newState = EFnKeyLocked; |
|
12678 else if ( iFnKeyManager->FnKeyState() |
|
12679 != CAknFepFnKeyManager::EFnKeyNone ) |
|
12680 newState = EFnKeyPressed; |
|
12681 #endif |
|
12682 break; |
|
12683 case EStroke: |
|
12684 { |
|
12685 TBool flag = ptiLang->HasInputMode(EPtiEngineStrokeByPhrase); |
|
12686 if (iLanguageCapabilities.iInputLanguageCode == ELangPrcChinese) |
|
12687 { |
|
12688 if (flag) |
|
12689 { |
|
12690 newState = EIndicatorStateStrokePhrase; |
|
12691 } |
|
12692 else |
|
12693 { |
|
12694 newState = EIndicatorStateStroke; |
|
12695 } |
|
12696 } |
|
12697 else |
|
12698 { |
|
12699 if (flag) |
|
12700 { |
|
12701 newState = EIndicatorStateStrokeTradPhrase; |
|
12702 } |
|
12703 else |
|
12704 { |
|
12705 newState = EIndicatorStateStrokeTrad; |
|
12706 } |
|
12707 } |
|
12708 } |
|
12709 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
12710 if ( iFnKeyManager->FnKeyState() |
|
12711 == CAknFepFnKeyManager::EFnKeyLock ) |
|
12712 newState = EFnKeyLocked; |
|
12713 else if ( iFnKeyManager->FnKeyState() |
|
12714 != CAknFepFnKeyManager::EFnKeyNone ) |
|
12715 newState = EFnKeyPressed; |
|
12716 #endif |
|
12717 break; |
|
12718 case ECangJie: |
|
12719 newState = EIndicatorStateCangJie; |
|
12720 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
12721 if ( iFnKeyManager->FnKeyState() |
|
12722 == CAknFepFnKeyManager::EFnKeyLock ) |
|
12723 newState = EFnKeyLocked; |
|
12724 else if ( iFnKeyManager->FnKeyState() |
|
12725 != CAknFepFnKeyManager::EFnKeyNone ) |
|
12726 newState = EFnKeyPressed; |
|
12727 #endif |
|
12728 break; |
|
12729 case EZhuyinFind: |
|
12730 newState = EIndicatorStateZhuyinFind; |
|
12731 break; |
|
12732 case EStrokeFind: |
|
12733 newState = EIndicatorStateStrokeFind; |
|
12734 break; |
|
12735 case ENumber: |
|
12736 { |
|
12737 newState = ENumeric; |
|
12738 //iLanguageCapabilities.iLocalDigitType = EDigitTypeWestern; |
|
12739 } |
|
12740 break; |
|
12741 case ENativeNumber: |
|
12742 { |
|
12743 UpdateNumberIndicator( newState ); |
|
12744 } |
|
12745 break; |
|
12746 case EHangul: |
|
12747 { |
|
12748 newState = EIndicatorStateHangul; |
|
12749 } |
|
12750 break; |
|
12751 case ELatin: |
|
12752 { |
|
12753 UpdateLatinIndicator( newState ); |
|
12754 } |
|
12755 break; |
|
12756 case EHindi: |
|
12757 { |
|
12758 UpdateHindiIndicator( newState ); |
|
12759 } |
|
12760 break; |
|
12761 default: |
|
12762 break; |
|
12763 } |
|
12764 } |
|
12765 } |
|
12766 |
|
12767 if ( iFepPluginManager && iFepPluginManager->PluginInputMode() == EPluginInputModeVkb ) |
|
12768 { |
|
12769 newState = iFepPluginManager->VKBIndicatorState( newState ); |
|
12770 } |
|
12771 |
|
12772 // Update indicators only if the state has been changed, or if the indicator has swapped |
|
12773 if ((iPreviousEditingState != newState) || (editingStateIndicator != iEditIndicatorAtLastUpdate)) |
|
12774 { |
|
12775 if (editingStateIndicator) |
|
12776 { |
|
12777 // because current avkon have not find chinese phrase indicator, |
|
12778 // so change back to no-phrase |
|
12779 if (findPaneIndicator || iAknEditorFlags & EAknEditorFlagFindPane ) |
|
12780 { |
|
12781 switch(newState) |
|
12782 { |
|
12783 case EIndicatorStateStrokePhrase: |
|
12784 { |
|
12785 newState = EIndicatorStateStroke; |
|
12786 } |
|
12787 break; |
|
12788 case EIndicatorStateStrokeTradPhrase: |
|
12789 { |
|
12790 newState = EIndicatorStateStrokeTrad; |
|
12791 } |
|
12792 break; |
|
12793 case EIndicatorStatePinyinPhrase: |
|
12794 { |
|
12795 newState = EIndicatorStatePinyin; |
|
12796 } |
|
12797 break; |
|
12798 case EIndicatorStateZhuyinPhrase: |
|
12799 { |
|
12800 newState = EIndicatorStateZhuyin; |
|
12801 } |
|
12802 break; |
|
12803 default: |
|
12804 { |
|
12805 break; |
|
12806 } |
|
12807 } |
|
12808 } |
|
12809 // Add This condition for Fixing EYYE-7HHBWW: Phonebook, ReTe, PF52.50_2008_wk32: |
|
12810 // Navigation bar disappears after tapping find pane and then returning back to Names list view. |
|
12811 if (!(editingStateIndicator == (MAknEditingStateIndicator*)iIndicator && |
|
12812 ( iFepPluginManager && iFepPluginManager->PluginInputMode() == EPluginInputModeItut ) && |
|
12813 IsFindPaneEditor())) |
|
12814 { |
|
12815 editingStateIndicator->SetState(newState); |
|
12816 } |
|
12817 |
|
12818 // Ensure that no indicator is shown in navi pane when other |
|
12819 // indicator is changed in use. |
|
12820 if ( editingStateIndicator != (MAknEditingStateIndicator*)iIndicator && |
|
12821 iPreviousEditingState == EStateNone && |
|
12822 (!IsFlagSet(EFlagForegroundUIComponentVisible | EFlagMenuPaneVisible)) ) |
|
12823 |
|
12824 { |
|
12825 iIndicator->SetState( EStateNone ); |
|
12826 } |
|
12827 |
|
12828 iPreviousEditingState = newState; |
|
12829 iEditIndicatorAtLastUpdate=editingStateIndicator; |
|
12830 } |
|
12831 } |
|
12832 } |
|
12833 |
|
12834 void CAknFepManager::UpdateNumberIndicator( TAknEditingState& aNewState ) |
|
12835 { |
|
12836 |
|
12837 // chnage for AIYR-6L7DGU; This problrm persist in all variants. |
|
12838 // The fix is made only for Hindi |
|
12839 UpdateNumericEditorDigitType(); |
|
12840 TBool supportsWesternNumericIntegerOrReal = |
|
12841 ( iInputCapabilities.SupportsWesternNumericIntegerPositive() || |
|
12842 iInputCapabilities.SupportsWesternNumericIntegerNegative() || |
|
12843 iInputCapabilities.SupportsWesternNumericReal() ); |
|
12844 |
|
12845 #ifdef RD_SCALABLE_UI_V2 |
|
12846 iFepPluginManager->SetPluginNativeRange( ETrue ); |
|
12847 #endif // RD_SCALABLE_UI_V2 |
|
12848 // In usual case digit mode is Arabic-Indic digits if local digit mode is |
|
12849 // Arabic-Indic and current input language is Arabic. |
|
12850 if ( (!supportsWesternNumericIntegerOrReal && |
|
12851 iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic /* && |
|
12852 iLanguageCapabilities.iInputLanguageCode == ELangArabic*/ |
|
12853 ) |
|
12854 || |
|
12855 // But digit mode is Arabic-Indic digit in MFNE and real number |
|
12856 // editors if UI language is Arabic and global digit setting is |
|
12857 // Arabic-Indic digits. |
|
12858 ( !(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) && |
|
12859 iLanguageCapabilities.iNumericEditorDigitType == EDigitTypeArabicIndic && // AknTextUtils::DigitModeQuery(AknTextUtils::EDigitModeShownToUser) && |
|
12860 supportsWesternNumericIntegerOrReal && |
|
12861 iUiLanguage == ELangArabic |
|
12862 ) |
|
12863 ) |
|
12864 { |
|
12865 aNewState=EArabicIndicNumeric; |
|
12866 |
|
12867 } |
|
12868 else if ( (!supportsWesternNumericIntegerOrReal && |
|
12869 iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic /* && |
|
12870 iLanguageCapabilities.iInputLanguageCode == ELangUrdu,Farasi*/ |
|
12871 ) |
|
12872 || |
|
12873 // But digit mode is Arabic-Indic digit in MFNE and real number |
|
12874 // editors if UI language is Arabic and global digit setting is |
|
12875 // Arabic-Indic digits. |
|
12876 ( !(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) && |
|
12877 iLanguageCapabilities.iNumericEditorDigitType == EDigitTypeEasternArabicIndic && // AknTextUtils::DigitModeQuery(AknTextUtils::EDigitModeShownToUser) && |
|
12878 supportsWesternNumericIntegerOrReal && |
|
12879 (iUiLanguage == ELangUrdu || iUiLanguage == ELangFarsi))) |
|
12880 { |
|
12881 aNewState=EArabicIndicNumeric; |
|
12882 } |
|
12883 /* Devanagari Scripts */ |
|
12884 else if ( (!supportsWesternNumericIntegerOrReal && |
|
12885 iLanguageCapabilities.iLocalDigitType == EDigitTypeDevanagari //&& |
|
12886 //iLanguageCapabilities.iInputLanguageCode == ELangHindi |
|
12887 ) |
|
12888 || |
|
12889 ( !(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) && |
|
12890 iLanguageCapabilities.iNumericEditorDigitType == EDigitTypeDevanagari && // AknTextUtils::DigitModeQuery(AknTextUtils::EDigitModeShownToUser) && |
|
12891 supportsWesternNumericIntegerOrReal && |
|
12892 TAknFepUiIndicInputManager::IsScriptDevanagari( iUiLanguage ) |
|
12893 ) |
|
12894 ) |
|
12895 { |
|
12896 aNewState= EDevanagariIndicNumeric; |
|
12897 } |
|
12898 else |
|
12899 { |
|
12900 if ( iLanguageCapabilities.iInputLanguageCode == ELangArabic ) |
|
12901 { |
|
12902 //iLanguageCapabilities.iLocalDigitType = EDigitTypeArabicIndic; |
|
12903 aNewState=EArabicIndicNumeric; |
|
12904 } |
|
12905 else if ( iLanguageCapabilities.iInputLanguageCode == ELangFarsi |
|
12906 || iLanguageCapabilities.iInputLanguageCode == ELangUrdu ) |
|
12907 { |
|
12908 //iLanguageCapabilities.iLocalDigitType = EDigitTypeEasternArabicIndic; |
|
12909 aNewState=EArabicIndicNumeric; |
|
12910 } |
|
12911 else if ( iLanguageCapabilities.iInputLanguageCode == ELangHindi ) |
|
12912 { |
|
12913 //iLanguageCapabilities.iLocalDigitType = EDigitTypeDevanagari; |
|
12914 aNewState= EDevanagariIndicNumeric; |
|
12915 } |
|
12916 } |
|
12917 } |
|
12918 |
|
12919 void CAknFepManager::UpdateLatinIndicator( TAknEditingState& aNewState ) |
|
12920 { |
|
12921 if (IsPredictive()) |
|
12922 { |
|
12923 //AutoComplete - Begin |
|
12924 SetPredictiveIndicatorState( aNewState ); |
|
12925 //AutoComplete - End |
|
12926 |
|
12927 return; |
|
12928 } |
|
12929 |
|
12930 TInt currentCase = iCaseMan->CurrentCase(); |
|
12931 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
12932 if(iFnKeyManager->FnKeyState() == CAknFepFnKeyManager::EFnKeyLock) |
|
12933 aNewState = EFnKeyLocked; |
|
12934 else if(iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyNone) |
|
12935 aNewState = EFnKeyPressed; |
|
12936 else |
|
12937 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
12938 { |
|
12939 #ifdef RD_SCALABLE_UI_V2 |
|
12940 if( iFepPluginManager && |
|
12941 ( !iFepPluginManager->SyncWithPluginRange() || iFepPluginManager->PluginNativeRange() ) ) |
|
12942 { |
|
12943 iFepPluginManager->SetPluginNativeRange( ETrue ); |
|
12944 #endif // RD_SCALABLE_UI_V2 |
|
12945 switch ( iLanguageCapabilities.iInputLanguageCode ) |
|
12946 { |
|
12947 case ELangArabic: |
|
12948 { |
|
12949 aNewState=EMultitapArabic; |
|
12950 } |
|
12951 return; |
|
12952 case ELangHebrew: |
|
12953 { |
|
12954 aNewState=EMultitapHebrew; |
|
12955 } |
|
12956 return; |
|
12957 case ELangFarsi: |
|
12958 case ELangUrdu: |
|
12959 { |
|
12960 aNewState=EMultitapFarsiAndUrdu; |
|
12961 } |
|
12962 return; |
|
12963 case ELangThai: |
|
12964 { |
|
12965 aNewState = EMultitapThai; |
|
12966 } |
|
12967 return; |
|
12968 |
|
12969 #ifdef RD_MARATHI |
|
12970 case ELangMarathi: |
|
12971 { |
|
12972 aNewState = EIndicatorStateMultitapMarathi; |
|
12973 } |
|
12974 return; |
|
12975 #endif // RD_MARATHI |
|
12976 |
|
12977 #ifdef RD_HINDI_PHONETIC_INPUT |
|
12978 case KLangHindiPhonetic: |
|
12979 { |
|
12980 TInt currentPtiLang = (ptiLang)? ptiLang->LanguageCode() : 0; |
|
12981 |
|
12982 if(TAknFepUiIndicInputManager::IsIndicPhoneticLanguage(TLanguage(currentPtiLang))) |
|
12983 { |
|
12984 aNewState = TAknEditingState(SetPhoneticIndicator(TLanguage(currentPtiLang))); |
|
12985 } |
|
12986 else |
|
12987 { |
|
12988 switch ( currentCase ) |
|
12989 { |
|
12990 case EAknEditorUpperCase: |
|
12991 aNewState=EMultitapUpper; |
|
12992 if (iCharWidth == EFullWidthChar) |
|
12993 { |
|
12994 aNewState=EIndicatorStateFullLatinUpper; |
|
12995 } |
|
12996 break; |
|
12997 case EAknEditorLowerCase: |
|
12998 aNewState=EMultitapLower; |
|
12999 if (iCharWidth == EFullWidthChar) |
|
13000 { |
|
13001 aNewState=EIndicatorStateFullLatinLower; |
|
13002 } |
|
13003 break; |
|
13004 case EAknEditorTextCase: |
|
13005 aNewState=EMultitapShifted; |
|
13006 if (iCharWidth == EFullWidthChar) |
|
13007 { |
|
13008 aNewState=EIndicatorStateFullLatinText; |
|
13009 } |
|
13010 break; |
|
13011 default: |
|
13012 break; |
|
13013 } |
|
13014 } |
|
13015 |
|
13016 } |
|
13017 return; |
|
13018 #endif |
|
13019 case ELangVietnamese: |
|
13020 { |
|
13021 switch (currentCase) |
|
13022 { |
|
13023 case EAknEditorUpperCase: |
|
13024 aNewState = EMultitapUpperVietnamese; |
|
13025 break; |
|
13026 case EAknEditorLowerCase: |
|
13027 aNewState = EMultitapLowerVietnamese; |
|
13028 break; |
|
13029 case EAknEditorTextCase: |
|
13030 aNewState = EMultitapShiftedVietnamese; |
|
13031 break; |
|
13032 default: |
|
13033 break; |
|
13034 } |
|
13035 return; |
|
13036 } |
|
13037 |
|
13038 case ELangGreek: |
|
13039 { |
|
13040 switch (currentCase) |
|
13041 { |
|
13042 case EAknEditorUpperCase: |
|
13043 aNewState = EMultitapUpperGreek; |
|
13044 break; |
|
13045 case EAknEditorLowerCase: |
|
13046 aNewState = EMultitapLowerGreek; |
|
13047 break; |
|
13048 case EAknEditorTextCase: |
|
13049 aNewState = EMultitapShiftedGreek; |
|
13050 break; |
|
13051 default: |
|
13052 break; |
|
13053 } |
|
13054 return; |
|
13055 } |
|
13056 |
|
13057 //Cyrillic alphabet is used for Russian, Bulgarian and |
|
13058 //Ukranian languages. So fall through for all these languages - |
|
13059 case ELangRussian: |
|
13060 case ELangBulgarian: |
|
13061 case ELangUkrainian: |
|
13062 { |
|
13063 switch (currentCase) |
|
13064 { |
|
13065 case EAknEditorUpperCase: |
|
13066 aNewState = EMultitapUpperCyrillic; |
|
13067 break; |
|
13068 case EAknEditorLowerCase: |
|
13069 aNewState = EMultitapLowerCyrillic; |
|
13070 break; |
|
13071 case EAknEditorTextCase: |
|
13072 aNewState = EMultitapShiftedCyrillic; |
|
13073 break; |
|
13074 default: |
|
13075 break; |
|
13076 } |
|
13077 return; |
|
13078 } |
|
13079 } |
|
13080 #ifdef RD_SCALABLE_UI_V2 |
|
13081 } |
|
13082 // if plugin is not native range |
|
13083 |
|
13084 if(iFepPluginManager && iLanguageCapabilities.iInputLanguageCode != ELangRussian && |
|
13085 iLanguageCapabilities.iInputLanguageCode != ELangBulgarian && |
|
13086 iLanguageCapabilities.iInputLanguageCode != ELangUkrainian && |
|
13087 iLanguageCapabilities.iInputLanguageCode != ELangGreek ) |
|
13088 { |
|
13089 iFepPluginManager->SetPluginNativeRange( EFalse ); |
|
13090 } |
|
13091 |
|
13092 #endif // RD_SCALABLE_UI_V2 |
|
13093 } |
|
13094 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
13095 if(FnKeyState() == CAknFepFnKeyManager::EFnKeyNone) |
|
13096 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
13097 { |
|
13098 switch (currentCase) |
|
13099 { |
|
13100 case EAknEditorUpperCase: |
|
13101 aNewState=EMultitapUpper; |
|
13102 if (iCharWidth == EFullWidthChar) |
|
13103 { |
|
13104 aNewState=EIndicatorStateFullLatinUpper; |
|
13105 } |
|
13106 break; |
|
13107 case EAknEditorLowerCase: |
|
13108 aNewState=EMultitapLower; |
|
13109 if (iCharWidth == EFullWidthChar) |
|
13110 { |
|
13111 aNewState=EIndicatorStateFullLatinLower; |
|
13112 } |
|
13113 break; |
|
13114 case EAknEditorTextCase: |
|
13115 aNewState=EMultitapShifted; |
|
13116 if (iCharWidth == EFullWidthChar) |
|
13117 { |
|
13118 aNewState=EIndicatorStateFullLatinText; |
|
13119 } |
|
13120 break; |
|
13121 default: |
|
13122 break; |
|
13123 } |
|
13124 } |
|
13125 } |
|
13126 void CAknFepManager::UpdateHindiIndicator( TAknEditingState& aNewState ) |
|
13127 { |
|
13128 if ( IsPredictive() ) |
|
13129 { |
|
13130 if( iIsAutoCompleteOn ) |
|
13131 aNewState = EAutoCompleteHindi; |
|
13132 else |
|
13133 aNewState = EIndicatorStatePredictiveHindi; |
|
13134 } |
|
13135 else |
|
13136 { |
|
13137 aNewState = EIndicatorStateMultitapHindi; |
|
13138 } |
|
13139 } |
|
13140 TBool CAknFepManager::GetIndicatorImgID(TInt& aIndicatorImgID, TInt& aIndicatorTextID) |
|
13141 { |
|
13142 if (iPreviousEditingState == EStateNone) |
|
13143 { |
|
13144 UpdateIndicators(); |
|
13145 if (iPreviousEditingState == EStateNone) |
|
13146 { |
|
13147 return EFalse; |
|
13148 } |
|
13149 } |
|
13150 |
|
13151 TBool predictiveMode = QueryPredictiveState(iPreviousEditingState); |
|
13152 TBool predictiveAutoCompleteMode = EFalse; |
|
13153 if(!predictiveMode) |
|
13154 { |
|
13155 predictiveAutoCompleteMode = QueryPredictiveAutoCompleteState(iPreviousEditingState); |
|
13156 } |
|
13157 |
|
13158 if (predictiveMode) |
|
13159 { |
|
13160 aIndicatorImgID = EAknNaviPaneEditorIndicatorT9; |
|
13161 } |
|
13162 else if (predictiveAutoCompleteMode) |
|
13163 { |
|
13164 aIndicatorImgID = EAknNaviPaneEditorIndicatorAutoComplete; |
|
13165 } |
|
13166 else |
|
13167 { |
|
13168 aIndicatorImgID = EAknNaviPaneEditorIndicatorQuery; |
|
13169 } |
|
13170 |
|
13171 aIndicatorTextID = EvaluateState(iPreviousEditingState); |
|
13172 |
|
13173 return ETrue; |
|
13174 } |
|
13175 |
|
13176 TInt CAknFepManager::EvaluateState(const TAknEditingState aState) |
|
13177 { |
|
13178 TInt result = 0; |
|
13179 switch(aState) |
|
13180 { |
|
13181 case EArabicIndicNumeric: |
|
13182 result = EAknNaviPaneEditorIndicatorArabicIndicNumberCase; |
|
13183 break; |
|
13184 |
|
13185 case ET9Thai: |
|
13186 case EMultitapThai: |
|
13187 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
13188 case EAutoCompleteThai: |
|
13189 #endif |
|
13190 result = EAknNaviPaneEditorIndicatorThai; |
|
13191 break; |
|
13192 |
|
13193 case EIndicatorStatePredictiveHindi: |
|
13194 case EIndicatorStateMultitapHindi: |
|
13195 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
13196 case EAutoCompleteHindi: |
|
13197 #endif |
|
13198 #ifdef RD_MARATHI |
|
13199 case EIndicatorStateMultitapMarathi: |
|
13200 case EIndicatorStatePredictiveMarathi: |
|
13201 #endif // RD_MARATHI |
|
13202 result = EAknNaviPaneEditorIndicatorDevanagariCase; |
|
13203 break; |
|
13204 |
|
13205 case ET9Arabic: |
|
13206 case EMultitapArabic: |
|
13207 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
13208 case EAutoCompleteArabic: |
|
13209 #endif |
|
13210 result = EAknNaviPaneEditorIndicatorArabicCase; |
|
13211 break; |
|
13212 |
|
13213 case ET9Hebrew: |
|
13214 case EMultitapHebrew: |
|
13215 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
13216 case EAutoCompleteHebrew: |
|
13217 #endif |
|
13218 result = EAknNaviPaneEditorIndicatorHebrewCase; |
|
13219 break; |
|
13220 |
|
13221 case ET9FarsiAndUrdu: |
|
13222 case EMultitapFarsiAndUrdu: |
|
13223 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
13224 case EAutoCompleteFarsiAndUrdu: |
|
13225 #endif |
|
13226 result = EAknNaviPaneEditorIndicatorFarsiAndUrduCase; |
|
13227 break; |
|
13228 |
|
13229 |
|
13230 case ET9Upper: |
|
13231 case EMultitapUpper: |
|
13232 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
13233 case EAutoCompleteUpper: |
|
13234 #endif |
|
13235 result = EAknNaviPaneEditorIndicatorUpperCase; |
|
13236 break; |
|
13237 |
|
13238 case ET9Lower: |
|
13239 case EMultitapLower: |
|
13240 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
13241 case EAutoCompleteLower: |
|
13242 #endif |
|
13243 result = EAknNaviPaneEditorIndicatorLowerCase; |
|
13244 break; |
|
13245 |
|
13246 case ET9Shifted: |
|
13247 case EMultitapShifted: |
|
13248 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
13249 case EAutoCompleteShifted: |
|
13250 #endif |
|
13251 result = EAknNaviPaneEditorIndicatorTextCase; |
|
13252 break; |
|
13253 |
|
13254 case ENumeric: |
|
13255 result = EAknNaviPaneEditorIndicatorNumberCase; |
|
13256 break; |
|
13257 |
|
13258 |
|
13259 case EIndicatorStatePinyin: |
|
13260 result = EAknNaviPaneEditorIndicatorPinyin; |
|
13261 break; |
|
13262 case EIndicatorStatePinyinPhrase: |
|
13263 result = EAknNaviPaneEditorIndicatorPinyinPhrase; |
|
13264 break; |
|
13265 |
|
13266 case EIndicatorStateZhuyin: |
|
13267 result = EAknNaviPaneEditorIndicatorZhuyin; |
|
13268 break; |
|
13269 case EIndicatorStateZhuyinPhrase: |
|
13270 result = EAknNaviPaneEditorIndicatorZhuyinPhrase; |
|
13271 break; |
|
13272 |
|
13273 case EIndicatorStateZhuyinFind: |
|
13274 result = EAknNaviPaneEditorIndicatorZhuyinFind; |
|
13275 break; |
|
13276 |
|
13277 case EDevanagariIndicNumeric : |
|
13278 result = EAknNaviPaneEditorIndicatorDevanagariIndicNumberCase; |
|
13279 break; |
|
13280 |
|
13281 case EIndicatorStateHiraganaKanji: |
|
13282 case EIndicatorStateJapanesePredictive: |
|
13283 result = EAknNaviPaneEditorIndicatorJapaneseHiraganaKanji; |
|
13284 break; |
|
13285 |
|
13286 case EIndicatorStateFullKatakana: |
|
13287 result = EAknNaviPaneEditorIndicatorJapaneseFullKatakana; |
|
13288 break; |
|
13289 |
|
13290 case EIndicatorStateHalfKatakana: |
|
13291 result = EAknNaviPaneEditorIndicatorJapaneseHalfKatakana; |
|
13292 break; |
|
13293 |
|
13294 case EIndicatorStateFullLatinText: |
|
13295 result = EAknNaviPaneEditorIndicatorJapaneseFullTextAlphabet; |
|
13296 break; |
|
13297 |
|
13298 case EIndicatorStateFullLatinUpper: |
|
13299 result = EAknNaviPaneEditorIndicatorJapaneseFullUpperAlphabet; |
|
13300 break; |
|
13301 |
|
13302 case EIndicatorStateFullLatinLower: |
|
13303 result = EAknNaviPaneEditorIndicatorJapaneseFullLowerAlphabet; |
|
13304 break; |
|
13305 |
|
13306 case EIndicatorStateFullNumeric: |
|
13307 result = EAknNaviPaneEditorIndicatorJapaneseFullNumeric; |
|
13308 break; |
|
13309 |
|
13310 case EIndicatorStateHiragana: |
|
13311 result = EAknNaviPaneEditorIndicatorJapaneseHiragana; |
|
13312 break; |
|
13313 |
|
13314 case EIndicatorStateStroke: |
|
13315 result = EAknNaviPaneEditorIndicatorStroke; |
|
13316 break; |
|
13317 case EIndicatorStateStrokePhrase: |
|
13318 result = EAknNaviPaneEditorIndicatorStrokePhrase; |
|
13319 break; |
|
13320 |
|
13321 case EIndicatorStateStrokeTrad: |
|
13322 result = EAknNaviPaneEditorIndicatorStrokeTrad; |
|
13323 break; |
|
13324 case EIndicatorStateStrokeTradPhrase: |
|
13325 result = EAknNaviPaneEditorIndicatorStrokeTradPhrase; |
|
13326 break; |
|
13327 |
|
13328 case EQwertyShift: |
|
13329 result = EAknNaviPaneEditorIndicatorQwertyShift; |
|
13330 break; |
|
13331 |
|
13332 case EIndicatorStateStrokeFind: |
|
13333 result = EAknNaviPaneEditorIndicatorStrokeFind; |
|
13334 break; |
|
13335 |
|
13336 case EIndicatorStateCangJie: |
|
13337 result = EAknNaviPaneEditorIndicatorCangJie; |
|
13338 break; |
|
13339 |
|
13340 case ET9UpperVietnamese: |
|
13341 case EMultitapUpperVietnamese: |
|
13342 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
13343 case EAutoCompleteUpperVietnamese: |
|
13344 #endif |
|
13345 result = EAknNaviPaneEditorIndicatorVietnameseUpperCase; |
|
13346 break; |
|
13347 |
|
13348 case ET9LowerVietnamese: |
|
13349 case EMultitapLowerVietnamese: |
|
13350 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
13351 case EAutoCompleteLowerVietnamese: |
|
13352 #endif |
|
13353 result = EAknNaviPaneEditorIndicatorVietnameseLowerCase; |
|
13354 break; |
|
13355 |
|
13356 case ET9ShiftedVietnamese: |
|
13357 case EMultitapShiftedVietnamese: |
|
13358 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
13359 case EAutoCompleteShiftedVietnamese: |
|
13360 #endif |
|
13361 result = EAknNaviPaneEditorIndicatorVietnameseTextCase; |
|
13362 break; |
|
13363 #ifdef RD_HINDI_PHONETIC_INPUT |
|
13364 case EIndicatorStateHindiPhoneticUpper: |
|
13365 result = EAknNaviPaneEditorIndicatorDevanagariPhoneticUpperCase; |
|
13366 break; |
|
13367 case EIndicatorStateHindiPhoneticLower: |
|
13368 result = EAknNaviPaneEditorIndicatorDevanagariPhoneticLowerCase; |
|
13369 break; |
|
13370 #endif |
|
13371 case ET9UpperGreek: |
|
13372 case EMultitapUpperGreek: |
|
13373 result = EAknNaviPaneEditorIndicatorGreekUpperCase; |
|
13374 break; |
|
13375 |
|
13376 case ET9LowerGreek: |
|
13377 case EMultitapLowerGreek: |
|
13378 result = EAknNaviPaneEditorIndicatorGreekLowerCase; |
|
13379 break; |
|
13380 |
|
13381 case ET9ShiftedGreek: |
|
13382 case EMultitapShiftedGreek: |
|
13383 result = EAknNaviPaneEditorIndicatorGreekTextCase; |
|
13384 break; |
|
13385 |
|
13386 case ET9UpperCyrillic: |
|
13387 case EMultitapUpperCyrillic: |
|
13388 result = EAknNaviPaneEditorIndicatorCyrillicUpperCase; |
|
13389 break; |
|
13390 |
|
13391 case ET9LowerCyrillic: |
|
13392 case EMultitapLowerCyrillic: |
|
13393 result = EAknNaviPaneEditorIndicatorCyrillicLowerCase; |
|
13394 break; |
|
13395 |
|
13396 case ET9ShiftedCyrillic: |
|
13397 case EMultitapShiftedCyrillic: |
|
13398 result = EAknNaviPaneEditorIndicatorCyrillicTextCase; |
|
13399 break; |
|
13400 |
|
13401 case EHybridModeLatin: |
|
13402 result = EAknNaviPaneEditorIndicatorHybridLatin; |
|
13403 break; |
|
13404 case EIndicatorStateHangul: |
|
13405 result = EAknNaviPaneEditorIndicatorKoreanHangul; |
|
13406 break; |
|
13407 |
|
13408 } |
|
13409 return result; |
|
13410 |
|
13411 } |
|
13412 |
|
13413 TBool CAknFepManager::IsAbleToLaunchSCT() const |
|
13414 { |
|
13415 TBool ableToLaunchSCT = ETrue; |
|
13416 |
|
13417 if (ExtendedInputCapabilities() & CAknExtendedInputCapabilities::EDisableSCT && |
|
13418 PluginInputMode() == EPluginInputModeNone ) |
|
13419 { |
|
13420 // The editor doesn't allow SCT. |
|
13421 return EFalse; |
|
13422 } |
|
13423 |
|
13424 if (iMode == ENumber || iMode == ENativeNumber) |
|
13425 { |
|
13426 if (iPermittedInputModes == EAknEditorNumericInputMode || !NumericModeSCTResourceId()) |
|
13427 { |
|
13428 // SCT is not launched if the number mode is the only input mode or |
|
13429 // if there is not keymap resource for the current numeric keymap mode. |
|
13430 ableToLaunchSCT = EFalse; |
|
13431 } |
|
13432 if (iAknEditorFlags & EAknEditorFlagUseSCTNumericCharmap || |
|
13433 ( (iAknEditorNumericKeymap == EAknEditorAlphanumericNumberModeKeymap) && |
|
13434 (iPermittedInputModes != EAknEditorNumericInputMode) )) |
|
13435 { |
|
13436 // SCT is launched in the number mode if requested by editor flag |
|
13437 // EAknEditorFlagUseSCTNumericCharmap or if also text input modes are |
|
13438 // allowed and the keymap is EAknEditorAlphanumericNumberModeKeymap. |
|
13439 ableToLaunchSCT = ETrue; |
|
13440 } |
|
13441 } |
|
13442 if (!(EditorHasFreeSpace() && EditorState() |
|
13443 && EditorState()->SpecialCharacterTableResourceId())) |
|
13444 { |
|
13445 ableToLaunchSCT = EFalse; |
|
13446 } |
|
13447 |
|
13448 return ableToLaunchSCT; |
|
13449 } |
|
13450 |
|
13451 TBool CAknFepManager::QueryPredictiveState(const TAknEditingState aState) |
|
13452 { |
|
13453 return (( aState == EIndicatorStatePinyin) || |
|
13454 ( aState == EIndicatorStatePinyinPhrase) || |
|
13455 ( aState == EIndicatorStateZhuyin) || |
|
13456 ( aState == EIndicatorStateZhuyinPhrase) || |
|
13457 ( aState == EIndicatorStateZhuyinFind) || |
|
13458 ( aState == EIndicatorStateStrokeFind) || |
|
13459 ( aState == EIndicatorStateStroke) || |
|
13460 ( aState == EIndicatorStateStrokePhrase) || |
|
13461 ( aState == EIndicatorStateCangJie) || |
|
13462 ( aState == EIndicatorStateStrokeTrad) || |
|
13463 ( aState == EIndicatorStateStrokeTradPhrase) || |
|
13464 ( aState == ET9Upper) || |
|
13465 ( aState == ET9Shifted) || |
|
13466 ( aState == ET9Lower) || |
|
13467 ( aState == ET9Arabic) || |
|
13468 ( aState == ET9Hebrew) || |
|
13469 ( aState == ET9FarsiAndUrdu) || |
|
13470 ( aState == ET9Thai) || |
|
13471 ( aState == EIndicatorStatePredictiveHindi) || |
|
13472 #ifdef RD_MARATHI |
|
13473 ( aState == EIndicatorStatePredictiveMarathi) || |
|
13474 #endif // RD_MARATHI |
|
13475 ( aState == EIndicatorStateJapanesePredictive) || |
|
13476 ( aState == ET9UpperVietnamese) || |
|
13477 ( aState == ET9LowerVietnamese) || |
|
13478 ( aState == ET9ShiftedVietnamese) || |
|
13479 ( aState == ET9UpperGreek) || |
|
13480 ( aState == ET9LowerGreek) || |
|
13481 ( aState == ET9ShiftedGreek) || |
|
13482 ( aState == ET9UpperCyrillic) || |
|
13483 ( aState == ET9LowerCyrillic) || |
|
13484 ( aState == ET9ShiftedCyrillic) ); |
|
13485 } |
|
13486 |
|
13487 TBool CAknFepManager::QueryPredictiveAutoCompleteState(TAknEditingState aState) |
|
13488 { |
|
13489 |
|
13490 return (( aState == EAutoCompleteUpper ) || |
|
13491 ( aState == EAutoCompleteShifted ) || |
|
13492 ( aState == EAutoCompleteLower ) || |
|
13493 ( aState == EAutoCompleteHindi ) || |
|
13494 ( aState == EAutoCompleteArabic ) || |
|
13495 ( aState == EAutoCompleteHebrew ) || |
|
13496 ( aState == EAutoCompleteFarsiAndUrdu ) || |
|
13497 ( aState == EAutoCompleteThai ) || |
|
13498 ( aState == EAutoCompleteUpperVietnamese ) || |
|
13499 ( aState == EAutoCompleteLowerVietnamese ) || |
|
13500 ( aState == EAutoCompleteShiftedVietnamese )); |
|
13501 } |
|
13502 |
|
13503 void CAknFepManager::LaunchSpecialCharacterTableL(TInt aResourceId, TBool aLaunchedByTouchWin, TBool aSmileyFirst) |
|
13504 { |
|
13505 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
13506 // Set the iSupressCursorMoveToEndChrKeyPressed when cursor is in |
|
13507 // between two words and SCT is launched |
|
13508 iSupressCursorMoveToEndChrKeyPressed = ETrue; |
|
13509 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
13510 #ifdef RD_SCALABLE_UI_V2 |
|
13511 if ( iStarKeyPressed && iFepPluginManager && |
|
13512 iFepPluginManager->PluginInputMode() == EPluginInputModeItut ) |
|
13513 { |
|
13514 aLaunchedByTouchWin = ETrue; |
|
13515 } |
|
13516 iCancelPopupInQwerty = aLaunchedByTouchWin; |
|
13517 #endif //RD_SCALABLE_UI_V2 |
|
13518 DoLaunchSctAndPctL(aResourceId, aSmileyFirst ? EShowSmileyFirst : EShowSctFirst ); |
|
13519 #ifdef RD_SCALABLE_UI_V2 |
|
13520 iCancelPopupInQwerty = EFalse; |
|
13521 #endif //RD_SCALABLE_UI_V2 |
|
13522 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
13523 iSupressCursorMoveToEndChrKeyPressed = ETrue; |
|
13524 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
13525 } |
|
13526 |
|
13527 TBool CAknFepManager::IsAbleToLaunchPCT() const |
|
13528 { |
|
13529 TBool isAbleToLaunch = EFalse; |
|
13530 if (FeatureManager::FeatureSupported(KFeatureIdJapanesePicto) |
|
13531 && (iAknEditorFlags & EAknEditorFlagEnablePictographInput)) |
|
13532 { |
|
13533 isAbleToLaunch = ETrue; |
|
13534 } |
|
13535 return isAbleToLaunch; |
|
13536 } |
|
13537 |
|
13538 TBool CAknFepManager::IsAbleToLaunchSmiley() const |
|
13539 { |
|
13540 TBool ableToLaunchSmiley(EFalse); |
|
13541 |
|
13542 CAknEdwinState* edwinState = EditorState(); |
|
13543 if(edwinState) |
|
13544 { |
|
13545 CAknEdwinFormAccessor* formAccessor = edwinState->FormAccessor(); |
|
13546 if(formAccessor) |
|
13547 { |
|
13548 CEikEdwin *edwin = static_cast<CEikEdwin*>(formAccessor->FormClientControl()); |
|
13549 if(edwin) |
|
13550 { |
|
13551 ableToLaunchSmiley = ((edwin->UserFlags()&CEikEdwin::EAvkonEnableSmileySupport) != 0); |
|
13552 } |
|
13553 } |
|
13554 } |
|
13555 |
|
13556 return ableToLaunchSmiley; |
|
13557 } |
|
13558 |
|
13559 TInt CAknFepManager::GetCurrentEditorSCTResId() const |
|
13560 { |
|
13561 if(!EditorState()) |
|
13562 { |
|
13563 return NumericModeSCTResourceId(); |
|
13564 } |
|
13565 TInt currentEditorSCTResId = EditorState()->SpecialCharacterTableResourceId(); |
|
13566 if ( FeatureManager::FeatureSupported(KFeatureIdChinese) ) |
|
13567 { |
|
13568 if (currentEditorSCTResId == R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG) |
|
13569 { |
|
13570 if (iMode == EZhuyin) |
|
13571 { |
|
13572 currentEditorSCTResId = |
|
13573 R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_FOR_ZHUYIN_SYMBOL_INPUT; |
|
13574 } |
|
13575 else |
|
13576 { |
|
13577 currentEditorSCTResId = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_CHINESE; |
|
13578 } |
|
13579 } |
|
13580 } |
|
13581 if (currentEditorSCTResId == EDefaultSCTResourceId) // -1 forces the default in SCT resource definition |
|
13582 { |
|
13583 if (iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) |
|
13584 { |
|
13585 currentEditorSCTResId = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_LATIN_ONLY; |
|
13586 } |
|
13587 else |
|
13588 { |
|
13589 // only ITU-T and when Bopomofo symbol input mode is supported, we use new sct table |
|
13590 TInt supportSCTToneMarks = EFalse; |
|
13591 MPtiCoreInfo* ptiCoreInfo = iPtiEngine->CoreInfo(EPtiEngineZhuyin); |
|
13592 |
|
13593 if(ptiCoreInfo) |
|
13594 { |
|
13595 supportSCTToneMarks = ptiCoreInfo->CapsBits() & ESupportSCTToneMarks; |
|
13596 } |
|
13597 |
|
13598 ptiCoreInfo = iPtiEngine->CoreInfo(EPtiEngineZhuyinByPhrase); |
|
13599 if(ptiCoreInfo) |
|
13600 { |
|
13601 supportSCTToneMarks = supportSCTToneMarks || |
|
13602 (ptiCoreInfo->CapsBits() & ESupportSCTToneMarks); |
|
13603 } |
|
13604 |
|
13605 if(!iQwertyInputMode && (iMode == EZhuyin) && supportSCTToneMarks) |
|
13606 { |
|
13607 currentEditorSCTResId = |
|
13608 R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_FOR_ZHUYIN_SYMBOL_INPUT; |
|
13609 } |
|
13610 else |
|
13611 { |
|
13612 if ( FeatureManager::FeatureSupported(KFeatureIdChinese) ) |
|
13613 { |
|
13614 currentEditorSCTResId = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_CHINESE; |
|
13615 } |
|
13616 else |
|
13617 { |
|
13618 currentEditorSCTResId = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG; |
|
13619 } |
|
13620 } |
|
13621 } |
|
13622 } |
|
13623 return currentEditorSCTResId; |
|
13624 } |
|
13625 |
|
13626 void CAknFepManager::LaunchPictographCharacterTableL() |
|
13627 { |
|
13628 DoLaunchSctAndPctL(NULL, EShowPctFirst); |
|
13629 } |
|
13630 |
|
13631 |
|
13632 void CAknFepManager::UpdateInlineEditL(const TDesC& aNewInlineText, |
|
13633 TInt aPositionOfInsertionPointInInlineText) |
|
13634 { |
|
13635 if ( ! IsFlagSet ( EFlagInsideInlineEditingTransaction ) ) |
|
13636 { |
|
13637 return; |
|
13638 } |
|
13639 // Japanese implementation needs to be merged with functionality of other languages. Now they are separate. |
|
13640 if (iLanguageCapabilities.iInputLanguageCode == ELangJapanese) |
|
13641 { |
|
13642 iUncommittedText.iCursorPos = iUncommittedText.iAnchorPos + |
|
13643 aPositionOfInsertionPointInInlineText; |
|
13644 |
|
13645 if (aNewInlineText.Length() == 1) |
|
13646 { |
|
13647 if (aNewInlineText[0] == KAknFEPLineFeedSymbol || |
|
13648 aNewInlineText[0] == KAknFEPMirroredLineFeedSymbol) |
|
13649 { |
|
13650 SetFlag(EFlagLineFeedCharacter); |
|
13651 ClearFlag(EFlagSpaceCharacter | EFlagFullWidthSpaceCharacter); |
|
13652 } |
|
13653 else if (aNewInlineText[0] == iSpaceCharacterCode) |
|
13654 { |
|
13655 SetFlag(EFlagSpaceCharacter); |
|
13656 ClearFlag(EFlagLineFeedCharacter | EFlagFullWidthSpaceCharacter); |
|
13657 } |
|
13658 else if (aNewInlineText[0] == iFullWidthSpaceCharacterCode) |
|
13659 { |
|
13660 SetFlag(EFlagFullWidthSpaceCharacter); |
|
13661 ClearFlag(EFlagLineFeedCharacter | EFlagSpaceCharacter); |
|
13662 } |
|
13663 else |
|
13664 { |
|
13665 ClearFlag(EFlagLineFeedCharacter |
|
13666 | EFlagSpaceCharacter |
|
13667 | EFlagFullWidthSpaceCharacter); |
|
13668 } |
|
13669 if (iInputCapabilities.SupportsSecretText()) |
|
13670 { |
|
13671 TBuf<1> buf; |
|
13672 buf.Append(aNewInlineText[0]); |
|
13673 NewCharacterL(buf); |
|
13674 } |
|
13675 else |
|
13676 { |
|
13677 SetFlag(EFlagInsideMultitapInlineEditingTransaction); |
|
13678 iInputCapabilities.FepAwareTextEditor()->UpdateFepInlineTextL(aNewInlineText, |
|
13679 aPositionOfInsertionPointInInlineText); |
|
13680 } |
|
13681 } |
|
13682 else |
|
13683 { |
|
13684 ClearFlag(EFlagLineFeedCharacter | EFlagSpaceCharacter | EFlagFullWidthSpaceCharacter); |
|
13685 iInputCapabilities.FepAwareTextEditor()->UpdateFepInlineTextL(aNewInlineText, |
|
13686 aPositionOfInsertionPointInInlineText); |
|
13687 } |
|
13688 #ifdef _DEBUG |
|
13689 RDebug::Print(_L("UpdateInlineEditL text=[%S] len=[%d] CurPos=[%d] AncPos=[%d] change=[%d]"), |
|
13690 &aNewInlineText, iUncommittedText.Length(), |
|
13691 iUncommittedText.iCursorPos, iUncommittedText.iAnchorPos, |
|
13692 aPositionOfInsertionPointInInlineText); |
|
13693 #endif |
|
13694 } |
|
13695 else |
|
13696 { |
|
13697 TInt curPos = iUncommittedText.iAnchorPos + aNewInlineText.Length(); |
|
13698 |
|
13699 TInt deltaCur = curPos - iUncommittedText.iCursorPos; |
|
13700 |
|
13701 TInt maxEdSize = iInputCapabilities.FepAwareTextEditor()->DocumentMaximumLengthForFep(); |
|
13702 |
|
13703 TInt docLength = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
13704 |
|
13705 HBufC* newInlineText=NULL; |
|
13706 |
|
13707 TBool syncLater = ETrue; |
|
13708 // we have to restrict to a length that is permissible in the editor |
|
13709 // this situation comes when we select the max length condition is reached |
|
13710 // in the editor and we navigate to one of the words in the middle |
|
13711 // and select a longer word from the candidate list |
|
13712 |
|
13713 |
|
13714 if( (maxEdSize > 0) && ( deltaCur > 0 ) |
|
13715 && (( docLength + deltaCur) > maxEdSize ) ) |
|
13716 { |
|
13717 newInlineText= aNewInlineText.Left( aNewInlineText.Length() - (docLength + deltaCur - maxEdSize )).AllocLC(); |
|
13718 aPositionOfInsertionPointInInlineText=newInlineText->Length(); |
|
13719 } |
|
13720 else if((maxEdSize > 0) && (curPos > maxEdSize)) |
|
13721 { |
|
13722 newInlineText= aNewInlineText.Left(maxEdSize - iUncommittedText.iAnchorPos).AllocLC(); |
|
13723 aPositionOfInsertionPointInInlineText=newInlineText->Length(); |
|
13724 } |
|
13725 else |
|
13726 { |
|
13727 newInlineText=aNewInlineText.AllocLC(); |
|
13728 syncLater = EFalse; |
|
13729 } |
|
13730 // The Below code changes are made to sync iTextBuffer and the last word in the editor.When the |
|
13731 // cursor position reaches more than the max length of editor, tail length is modified according |
|
13732 // to truncated last word and Autocompletion bit length (Element count) value to display last |
|
13733 // word in the editor properly. |
|
13734 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
13735 if(syncLater) |
|
13736 { |
|
13737 TBuf<CAknFepManager::EMaximumFepWordLength> currentText = iPtiEngine->CurrentWord(); |
|
13738 currentText.SetLength(newInlineText->Length()); |
|
13739 iPtiEngine->HandleCommandL( EPtiCommandSetCursorCrossedMaxLength ); |
|
13740 iPtiEngine->SetCurrentWord(currentText); |
|
13741 TransferFepStateToEditorL(); |
|
13742 iPtiEngine->HandleCommandL( EPtiCommandResetCursorCrossedMaxLength ); |
|
13743 } |
|
13744 #endif |
|
13745 // CleanupStack::PushL(TCleanupItem(ClearFepStateOnLeave,this)); |
|
13746 iUncommittedText.iCursorPos = iUncommittedText.iAnchorPos + aPositionOfInsertionPointInInlineText; |
|
13747 |
|
13748 HBufC* decoratedInlineEdit = HBufC::NewLC(aNewInlineText.Length()*3); |
|
13749 TPtr bufferPtr(decoratedInlineEdit->Des()); |
|
13750 |
|
13751 if ( EditorSupportsNeutralProtection() ) |
|
13752 { |
|
13753 if ( newInlineText->Length() > 0 ) |
|
13754 { |
|
13755 iInlineTextDecorator->DecorateInlineText( |
|
13756 newInlineText->Des(), |
|
13757 bufferPtr, |
|
13758 aPositionOfInsertionPointInInlineText, |
|
13759 static_cast<TChar>(PreviousChar()), |
|
13760 IsRightToLeftParagraph(DocPos() ), |
|
13761 ( CurrentInputDirectionality() == TBidiText::ERightToLeft ) ); |
|
13762 } |
|
13763 |
|
13764 // Because the length of the new inline edit may bear no relation to the old inline edit, |
|
13765 // the passed desired position of the cursor (which is hidden in S60 anyway) in the new |
|
13766 // inline edit is restricted to its Length(). The input value of parameter |
|
13767 // aPositionOfInsertionPointInInlineText is ignored, and its modified value |
|
13768 // from the DecorateInlineText routine is also ignored. |
|
13769 |
|
13770 aPositionOfInsertionPointInInlineText = decoratedInlineEdit->Length(); |
|
13771 |
|
13772 iInputCapabilities.FepAwareTextEditor()->UpdateFepInlineTextL( |
|
13773 bufferPtr, aPositionOfInsertionPointInInlineText); |
|
13774 |
|
13775 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
13776 iUncommittedText.iAnchorPos-=decoratedInlineEdit->Length(); |
|
13777 } |
|
13778 |
|
13779 else |
|
13780 { |
|
13781 // Even without the issue of decoration, the length of the new inline edit may bear no |
|
13782 // relation to the old inline edit. It is always set to length (the end) of the new inline edit |
|
13783 aPositionOfInsertionPointInInlineText = newInlineText->Length(); |
|
13784 |
|
13785 iInputCapabilities.FepAwareTextEditor()->UpdateFepInlineTextL( |
|
13786 newInlineText->Des(), aPositionOfInsertionPointInInlineText); |
|
13787 |
|
13788 // This is needed here too because we should not insist that the new text is the same length |
|
13789 // as the old, and so the iUncommitted text should be reset. |
|
13790 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
13791 iUncommittedText.iAnchorPos-=newInlineText->Length(); |
|
13792 } |
|
13793 |
|
13794 |
|
13795 CleanupStack::PopAndDestroy(decoratedInlineEdit); |
|
13796 SendEventsToPluginManL( EPluginSyncFepAwareText, EPluginSyncUpdatedText ); |
|
13797 CleanupStack::PopAndDestroy(newInlineText); |
|
13798 //Send info to engine to set EPtiXt9FlagAutoCompletionSetOnToOff flag as false |
|
13799 TInt value = 0; |
|
13800 TRAP_IGNORE(iPtiEngine->HandleCommandL( EPtiCommandAutoCompletionOnToOff,&value)); |
|
13801 } |
|
13802 } |
|
13803 |
|
13804 void CAknFepManager::StartInlineEditL() |
|
13805 { |
|
13806 if(iConcatenationTimer->IsActive()) |
|
13807 iConcatenationTimer->Cancel(); |
|
13808 |
|
13809 //currently western only, would need to sort out flags if this were to be used |
|
13810 //in multitap modes |
|
13811 switch (iMode) |
|
13812 { |
|
13813 case ELatin: |
|
13814 case EKatakana: |
|
13815 case EHiragana: |
|
13816 iInputCapabilities.FepAwareTextEditor()->StartFepInlineEditL(KNullDesC, 0, EFalse, |
|
13817 NULL, *this, *this); |
|
13818 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
13819 break; |
|
13820 default: |
|
13821 iInputCapabilities.FepAwareTextEditor()->StartFepInlineEditL(KNullDesC, 0, EFalse, |
|
13822 NULL, *this, *this); |
|
13823 break; |
|
13824 } |
|
13825 #ifdef _DEBUG |
|
13826 RDebug::Print(_L("StartInlineEditL len=[%d] CurPos=[%d] AncPos=[%d]"), |
|
13827 iUncommittedText.Length(), |
|
13828 iUncommittedText.iCursorPos, iUncommittedText.iAnchorPos ); |
|
13829 #endif |
|
13830 |
|
13831 // have to calculate the number of free space on current EDITOR after StartFepInlineEditL(). |
|
13832 TInt maxEdSize = iInputCapabilities.FepAwareTextEditor()->DocumentMaximumLengthForFep(); |
|
13833 TInt edSize = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
13834 iFreeSpaceOfEditor = maxEdSize - edSize; |
|
13835 |
|
13836 SetFlag(EFlagInsideInlineEditingTransaction); |
|
13837 } |
|
13838 |
|
13839 void CAknFepManager::StartInlineEditL(const TDesC& aText) |
|
13840 { |
|
13841 if(iConcatenationTimer->IsActive()) |
|
13842 iConcatenationTimer->Cancel(); |
|
13843 |
|
13844 TInt textLength = aText.Length(); |
|
13845 |
|
13846 // CleanupStack::PushL(TCleanupItem(ClearFepStateOnLeave,this)); |
|
13847 |
|
13848 HBufC* decoratedInlineEdit = HBufC::NewLC(aText.Length()*3); |
|
13849 TPtr bufferPtr(decoratedInlineEdit->Des()); |
|
13850 |
|
13851 // decorate the inline edit |
|
13852 if( aText.Length() > 0 && EditorSupportsNeutralProtection() ) |
|
13853 { |
|
13854 iInlineTextDecorator->DecorateInlineText( |
|
13855 aText, |
|
13856 bufferPtr, |
|
13857 textLength, // aPositionOfInsertionPointInInlineText, |
|
13858 static_cast<TChar>(PreviousChar()), |
|
13859 IsRightToLeftParagraph( DocPos() ), |
|
13860 ( CurrentInputDirectionality() == TBidiText::ERightToLeft ) ); |
|
13861 } |
|
13862 else |
|
13863 { |
|
13864 |
|
13865 bufferPtr.Copy(aText); |
|
13866 } |
|
13867 |
|
13868 // Before starting editor inline, we cancel editor inline if by any chance editor ends up in inline edit and fep does not |
|
13869 TBool phoneIdle = (EditorType() == CAknExtendedInputCapabilities::EPhoneNumberEditor); |
|
13870 |
|
13871 if(phoneIdle) |
|
13872 { |
|
13873 iInputCapabilities.FepAwareTextEditor()->CancelFepInlineEdit(); |
|
13874 } |
|
13875 |
|
13876 // operates at the current insertion point or selection |
|
13877 iInputCapabilities.FepAwareTextEditor()->StartFepInlineEditL( |
|
13878 |
|
13879 bufferPtr, |
|
13880 textLength, // aPositionOfInsertionPointInInlineText, |
|
13881 EFalse, // Cursor visibility |
|
13882 0, // MFormCustomDrawer* |
|
13883 *this, |
|
13884 *this); |
|
13885 |
|
13886 // CleanupStack::Pop(); // cleanupitem for FEP state. |
|
13887 |
|
13888 if (!iInputCapabilities.FepAwareTextEditor()) |
|
13889 { |
|
13890 // In case while starting the inline edit, 3rd party app removes the focus out of editor before the transaction |
|
13891 // completes, we return with an error. |
|
13892 User::Leave(KErrCorrupt); |
|
13893 } |
|
13894 // cursor span needs to be updated following potential modification |
|
13895 // of the inline edit content before it was started |
|
13896 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
13897 iUncommittedText.iAnchorPos-=decoratedInlineEdit->Length(); |
|
13898 CleanupStack::PopAndDestroy(decoratedInlineEdit); |
|
13899 |
|
13900 SetFlag(EFlagInsideInlineEditingTransaction); |
|
13901 } |
|
13902 |
|
13903 void CAknFepManager::StartInlineEditL(TCursorSelection aCursorSelection, |
|
13904 const TDesC& aInitialInlineText, |
|
13905 TInt aPositionOfInsertionPointInInlineText, |
|
13906 TBool aCursorVisibility) |
|
13907 { |
|
13908 |
|
13909 if(iConcatenationTimer->IsActive()) |
|
13910 iConcatenationTimer->Cancel(); |
|
13911 |
|
13912 TBool setToTrue=EFalse; |
|
13913 |
|
13914 // setToTrue parameter forces use of selection hiding inline edit editor API - |
|
13915 // this method also sets the cursor selection to the second parameter |
|
13916 // CleanupStack::PushL(TCleanupItem(ClearFepStateOnLeave,this)); |
|
13917 iInputCapabilities.FepAwareTextEditor()->Extension1()->StartFepInlineEditL( |
|
13918 setToTrue, |
|
13919 aCursorSelection, |
|
13920 aInitialInlineText, |
|
13921 aPositionOfInsertionPointInInlineText, |
|
13922 aCursorVisibility, |
|
13923 0, // MFormCustomDrawer* ? |
|
13924 *this, |
|
13925 *this); |
|
13926 // CleanupStack::Pop(); // cleanupitem for FEP state. |
|
13927 SetFlag(EFlagInsideInlineEditingTransaction); |
|
13928 //This will suppress Edit submenu from poping up |
|
13929 SetCcpuFlag(ECcpuStateIgnoreStarUp); |
|
13930 } |
|
13931 |
|
13932 TBool CAknFepManager::CloseUiIfWordDeletedL() |
|
13933 { |
|
13934 if (iUncommittedText.Length()==0) |
|
13935 { |
|
13936 // word has been totally deleted |
|
13937 ClearFlag(EFlagCompoundWord); |
|
13938 TryCloseUiL(); |
|
13939 return ETrue; |
|
13940 } |
|
13941 return EFalse; |
|
13942 } |
|
13943 |
|
13944 TBool CAknFepManager::TryGetTextToUncommitL(TDes& aText, TInt aCode, TBool& aComsumeKey) |
|
13945 { |
|
13946 TWesternNaviEvent naviEvent = ENullNaviEvent; |
|
13947 if (aCode == EKeyLeftArrow) |
|
13948 { |
|
13949 naviEvent = ELeftNaviEvent; |
|
13950 } |
|
13951 else if (aCode == EKeyRightArrow) |
|
13952 { |
|
13953 naviEvent = ERightNaviEvent; |
|
13954 } |
|
13955 else if (aCode == EKeyBackspace) |
|
13956 { |
|
13957 naviEvent = EBackspaceEvent; |
|
13958 } |
|
13959 |
|
13960 TInt nextCharPos = 0; // Character ordinal in logical memory (0 - n-1) |
|
13961 TBool hindibackspace = 0 ; |
|
13962 TBool nextPositionFound = EFalse; |
|
13963 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
13964 if ( naviEvent == ERightNaviEvent ) |
|
13965 { |
|
13966 nextPositionFound = GetNextVisualRightCharacter( nextCharPos ); |
|
13967 if( (TAknFepUiIndicInputManager :: IsIndicLangauge(TLanguage(iLanguageCapabilities.iInputLanguageCode))) || |
|
13968 (TLanguage(iLanguageCapabilities.iInputLanguageCode) == ELangThai)) |
|
13969 { |
|
13970 FindStartOfWord(nextCharPos); |
|
13971 |
|
13972 if(nextCharPos < iUncommittedText.LowerPos()) |
|
13973 { |
|
13974 nextCharPos = iUncommittedText.LowerPos(); |
|
13975 } |
|
13976 } |
|
13977 } |
|
13978 else if ( naviEvent == ELeftNaviEvent ) |
|
13979 { |
|
13980 nextPositionFound = GetNextVisualLeftCharacter( nextCharPos ); |
|
13981 if( nextPositionFound && (TAknFepUiIndicInputManager :: IsIndicLangauge(TLanguage(iLanguageCapabilities.iInputLanguageCode))) || |
|
13982 (nextPositionFound && (TLanguage(iLanguageCapabilities.iInputLanguageCode) == ELangThai))) |
|
13983 { |
|
13984 FindEndOfWord(nextCharPos); |
|
13985 if(nextCharPos > iUncommittedText.HigherPos()) |
|
13986 { |
|
13987 nextCharPos = iUncommittedText.HigherPos(); |
|
13988 } |
|
13989 } |
|
13990 |
|
13991 } |
|
13992 else if ( naviEvent == EBackspaceEvent ) |
|
13993 { |
|
13994 if (iLanguageCapabilities.iRightToLeftLanguage) |
|
13995 { |
|
13996 nextPositionFound = GetNextVisualRightCharacter( nextCharPos ); |
|
13997 } |
|
13998 else |
|
13999 { |
|
14000 if( (TAknFepUiIndicInputManager :: IsIndicLangauge(TLanguage(iLanguageCapabilities.iInputLanguageCode))) || |
|
14001 (TLanguage(iLanguageCapabilities.iInputLanguageCode) == ELangThai)) |
|
14002 { |
|
14003 TCursorSelection curSel; |
|
14004 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(curSel); |
|
14005 nextCharPos = curSel.iCursorPos; |
|
14006 hindibackspace = ETrue; |
|
14007 } |
|
14008 else |
|
14009 { |
|
14010 nextPositionFound = GetNextVisualLeftCharacter( nextCharPos ); |
|
14011 } |
|
14012 } |
|
14013 } |
|
14014 |
|
14015 if ( !nextPositionFound && !hindibackspace ) |
|
14016 { |
|
14017 aComsumeKey = EFalse; |
|
14018 return EFalse; |
|
14019 } |
|
14020 |
|
14021 TInt anchorPos = 0; |
|
14022 TInt cursorPos = 0; |
|
14023 TTmDocPosSpec pos = DocPos(); |
|
14024 CTmTextLayout::TTmChunkDescription leftChunk; |
|
14025 CTmTextLayout::TTmChunkDescription rightChunk; |
|
14026 FindAdjacentChunks(pos, leftChunk, rightChunk); |
|
14027 |
|
14028 if (( naviEvent == ELeftNaviEvent && leftChunk.iRightToLeft ) || |
|
14029 ( naviEvent == ERightNaviEvent && !rightChunk.iRightToLeft )) |
|
14030 { |
|
14031 anchorPos = nextCharPos; |
|
14032 cursorPos = nextCharPos; |
|
14033 FindEndOfWord(cursorPos); |
|
14034 } |
|
14035 else |
|
14036 { |
|
14037 if( (TAknFepUiIndicInputManager :: IsIndicLangauge(TLanguage(iLanguageCapabilities.iInputLanguageCode))) || |
|
14038 (TLanguage(iLanguageCapabilities.iInputLanguageCode) == ELangThai)) |
|
14039 { |
|
14040 cursorPos = nextCharPos; |
|
14041 } |
|
14042 else |
|
14043 { |
|
14044 cursorPos = nextCharPos + 1; |
|
14045 } |
|
14046 anchorPos = nextCharPos; |
|
14047 FindStartOfWord(anchorPos); |
|
14048 } |
|
14049 |
|
14050 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
14051 TCursorSelection curSel; |
|
14052 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(curSel); |
|
14053 // if selection happens dont consume the event pass it to editor |
|
14054 if((naviEvent == EBackspaceEvent) |
|
14055 && (!IsFlagSet(CAknFepManager::EFlagInsideInlineEditingTransaction)) |
|
14056 && (curSel.iAnchorPos != curSel.iCursorPos)) |
|
14057 { |
|
14058 aComsumeKey = EFalse; |
|
14059 return EFalse; |
|
14060 } |
|
14061 #endif |
|
14062 |
|
14063 iUncommittedText.SetSelection(cursorPos, anchorPos); |
|
14064 |
|
14065 if (iUncommittedText.Length() <= EMaximumFepWordLength) |
|
14066 { |
|
14067 iInputCapabilities.FepAwareTextEditor()-> |
|
14068 GetEditorContentForFep(aText, iUncommittedText.iAnchorPos, iUncommittedText.Length()); |
|
14069 aComsumeKey = ETrue; |
|
14070 return ETrue; |
|
14071 } |
|
14072 else |
|
14073 { |
|
14074 if (naviEvent == EBackspaceEvent) |
|
14075 { |
|
14076 // delete the last character |
|
14077 cursorPos--; |
|
14078 iUncommittedText.SetSelection(cursorPos, cursorPos); |
|
14079 aComsumeKey = EFalse; |
|
14080 } |
|
14081 else |
|
14082 { |
|
14083 TInt newCursorPosition= (pos.iPos == cursorPos) ? anchorPos : cursorPos; |
|
14084 iUncommittedText.SetSelection(newCursorPosition, newCursorPosition); |
|
14085 iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(iUncommittedText); |
|
14086 aComsumeKey = ETrue; |
|
14087 } |
|
14088 // The word is longer than EMaximumFepWordLength. Ui is deactivated. |
|
14089 TryCloseUiL(); |
|
14090 return EFalse; |
|
14091 } |
|
14092 } |
|
14093 |
|
14094 |
|
14095 TBool CAknFepManager::TryGetTextToUncommitL(TDes& aText, TBool& aComsumeKey) |
|
14096 { |
|
14097 TInt nextCharRightPos = 0; // Character ordinal in logical memory (0 - n-1) |
|
14098 TInt nextCharLeftPos = 0; |
|
14099 TBool nextRightPosFound = EFalse; |
|
14100 TBool nextLeftPosFound = EFalse; |
|
14101 |
|
14102 nextRightPosFound = GetNextVisualRightCharacter( nextCharRightPos ); |
|
14103 if( (TAknFepUiIndicInputManager :: IsIndicLangauge(TLanguage(iLanguageCapabilities.iInputLanguageCode))) || |
|
14104 (TLanguage(iLanguageCapabilities.iInputLanguageCode) == ELangThai)) |
|
14105 { |
|
14106 FindStartOfWord(nextCharRightPos); |
|
14107 |
|
14108 if(nextCharRightPos < iUncommittedText.LowerPos()) |
|
14109 { |
|
14110 nextCharRightPos = iUncommittedText.LowerPos(); |
|
14111 } |
|
14112 } |
|
14113 |
|
14114 |
|
14115 nextLeftPosFound = GetNextVisualLeftCharacter( nextCharLeftPos ); |
|
14116 if( nextLeftPosFound && (TAknFepUiIndicInputManager :: IsIndicLangauge(TLanguage(iLanguageCapabilities.iInputLanguageCode))) || |
|
14117 (nextLeftPosFound && (TLanguage(iLanguageCapabilities.iInputLanguageCode) == ELangThai))) |
|
14118 { |
|
14119 FindEndOfWord(nextCharLeftPos); |
|
14120 if(nextCharLeftPos > iUncommittedText.HigherPos()) |
|
14121 { |
|
14122 nextCharLeftPos = iUncommittedText.HigherPos(); |
|
14123 } |
|
14124 } |
|
14125 |
|
14126 |
|
14127 |
|
14128 |
|
14129 if ( !nextRightPosFound && !nextLeftPosFound ) |
|
14130 { |
|
14131 aComsumeKey = EFalse; |
|
14132 return EFalse; |
|
14133 } |
|
14134 |
|
14135 TInt anchorPos = 0; |
|
14136 TInt cursorPos = 0; |
|
14137 |
|
14138 |
|
14139 |
|
14140 TTmDocPosSpec pos = DocPos(); |
|
14141 CTmTextLayout::TTmChunkDescription leftChunk; |
|
14142 CTmTextLayout::TTmChunkDescription rightChunk; |
|
14143 FindAdjacentChunks(pos, leftChunk, rightChunk); |
|
14144 |
|
14145 /* |
|
14146 if( (TAknFepUiIndicInputManager :: IsIndicLangauge(TLanguage(iLanguageCapabilities.iInputLanguageCode))) || |
|
14147 (TLanguage(iLanguageCapabilities.iInputLanguageCode) == ELangThai)) |
|
14148 { |
|
14149 cursorPos = pos.iPos; |
|
14150 } |
|
14151 else |
|
14152 { |
|
14153 cursorPos = pos.iPos + 1; |
|
14154 } |
|
14155 */ |
|
14156 |
|
14157 anchorPos = pos.iPos; |
|
14158 cursorPos = pos.iPos; |
|
14159 FindEndOfWord(cursorPos); |
|
14160 FindStartOfWord(anchorPos); |
|
14161 |
|
14162 |
|
14163 if(cursorPos == pos.iPos || anchorPos == pos.iPos) |
|
14164 { |
|
14165 iUncommittedText.SetSelection(pos.iPos, pos.iPos); |
|
14166 aComsumeKey = ETrue; |
|
14167 return EFalse; |
|
14168 } |
|
14169 else |
|
14170 { |
|
14171 iUncommittedText.SetSelection(cursorPos, anchorPos); |
|
14172 } |
|
14173 |
|
14174 if (iUncommittedText.Length() <= EMaximumFepWordLength) |
|
14175 { |
|
14176 iInputCapabilities.FepAwareTextEditor()-> |
|
14177 GetEditorContentForFep(aText, iUncommittedText.iAnchorPos, iUncommittedText.Length()); |
|
14178 aComsumeKey = ETrue; |
|
14179 return ETrue; |
|
14180 } |
|
14181 else |
|
14182 { |
|
14183 /* |
|
14184 TInt newCursorPosition= (pos.iPos == cursorPos) ? anchorPos : cursorPos; |
|
14185 iUncommittedText.SetSelection(newCursorPosition, newCursorPosition); |
|
14186 iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(iUncommittedText); |
|
14187 */ |
|
14188 aComsumeKey = ETrue; |
|
14189 // The word is longer than EMaximumFepWordLength. Ui is deactivated. |
|
14190 TryCloseUiL(); |
|
14191 return EFalse; |
|
14192 } |
|
14193 } |
|
14194 |
|
14195 void CAknFepManager::UpdateCbaL(TInt aResourceId) |
|
14196 { |
|
14197 if ( !IsFepAwareTextEditor() ) |
|
14198 { |
|
14199 return; |
|
14200 } |
|
14201 |
|
14202 if (IsCcpuFlagSet(ECcpuStateStartCopy | ECcpuStateCopy | ECcpuStateStartCut | ECcpuStateCut)) |
|
14203 { |
|
14204 return; |
|
14205 } |
|
14206 |
|
14207 //For bug ESSG-7RXC96 |
|
14208 if((iAknEditorFlags & EAknEditorFlagFindPane)&& IsChineseInputLanguage()&& aResourceId != NULL) |
|
14209 { |
|
14210 return; |
|
14211 } |
|
14212 |
|
14213 iUiInterface->UpdateSoftkeysL(aResourceId, EditorState(), this, |
|
14214 iSharedDataInterface->InputMode()); |
|
14215 } |
|
14216 |
|
14217 |
|
14218 TBool CAknFepManager::TryRemoveNoMatchesIndicatorL() |
|
14219 { |
|
14220 __ASSERT_DEBUG(IsFlagSet(EFlagInsideInlineEditingTransaction), |
|
14221 AknFepPanic(EAknFepPanicNotInsideInlineEdit)); |
|
14222 |
|
14223 if (IsFlagSet(CAknFepManager::EFlagNoMatches)) |
|
14224 { |
|
14225 ClearFlag(CAknFepManager::EFlagNoMatches); |
|
14226 TBuf<EMaximumFepWordLength> newText; |
|
14227 iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(newText, |
|
14228 iUncommittedText.iAnchorPos, |
|
14229 iUncommittedText.Length()); |
|
14230 iInputCapabilities.FepAwareTextEditor()->UpdateFepInlineTextL(newText, |
|
14231 iUncommittedText.Length()); |
|
14232 SendEventsToPluginManL( EPluginSyncFepAwareText ); |
|
14233 return ETrue; |
|
14234 } |
|
14235 return EFalse; |
|
14236 } |
|
14237 |
|
14238 TBool CAknFepManager::IsMoreGoodWordsComing(TInt aNewWordLength) const |
|
14239 { |
|
14240 return (aNewWordLength == iUncommittedText.Length() + 1); |
|
14241 } |
|
14242 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
14243 TBool CAknFepManager::IsMoreGoodAutoCompleteWordsComing(TInt aInputMode,TInt aPreviousWordLength, |
|
14244 TInt aNewWordLength) const |
|
14245 { |
|
14246 return ((aInputMode == EPtiEngineWordCompletion) && (aPreviousWordLength != aNewWordLength )); |
|
14247 } |
|
14248 #endif |
|
14249 |
|
14250 void CAknFepManager::TryStartCompoundWord() |
|
14251 { |
|
14252 // check if this word constitutes a 'compound' word |
|
14253 // i.e. is either adjacent char is an alphabetic characeter |
|
14254 TBuf<ESingleCharacter> ch; |
|
14255 // check the previous character |
|
14256 if(iUncommittedText.iAnchorPos>0) |
|
14257 { |
|
14258 iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(ch, |
|
14259 iUncommittedText.iAnchorPos-1, |
|
14260 ESingleCharacter); |
|
14261 if (ch.Length()>0 && STATIC_CAST(TChar, IsValidInLineCharacter(ch[0]))) |
|
14262 { |
|
14263 SetFlag(EFlagCompoundWord); |
|
14264 } |
|
14265 } |
|
14266 |
|
14267 // check the next character |
|
14268 TInt edSize = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
14269 if (!IsFlagSet(EFlagCompoundWord) && iUncommittedText.iAnchorPos < edSize) |
|
14270 { |
|
14271 iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(ch, |
|
14272 iUncommittedText.iAnchorPos, |
|
14273 ESingleCharacter); |
|
14274 if (ch.Length()>0 && STATIC_CAST(TChar, IsValidInLineCharacter(ch[0]))) |
|
14275 { |
|
14276 SetFlag(EFlagCompoundWord); |
|
14277 } |
|
14278 } |
|
14279 } |
|
14280 |
|
14281 void CAknFepManager::AddCompoundWordToUdbL() |
|
14282 { |
|
14283 __ASSERT_DEBUG(WesternPredictive() , AknFepPanic(EAknFepPanicNonPermittedEditorMode)); |
|
14284 |
|
14285 HBufC* compoundWordBuf = |
|
14286 HBufC::NewLC(iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep()); // buffer for text |
|
14287 TPtr compoundWord=compoundWordBuf->Des(); |
|
14288 |
|
14289 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
14290 |
|
14291 // reset cursor span on word |
|
14292 FindStartOfWord(iUncommittedText.iAnchorPos); |
|
14293 FindEndOfWord(iUncommittedText.iCursorPos); |
|
14294 |
|
14295 iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(compoundWord, |
|
14296 iUncommittedText.iAnchorPos, |
|
14297 iUncommittedText.Length()); |
|
14298 FepUI()->AddTextToUserDictionaryL(compoundWord); |
|
14299 CleanupStack::PopAndDestroy(); // compoundWordBuf |
|
14300 } |
|
14301 |
|
14302 void CAknFepManager::SetWesternPredictive( const TBool aWesternPredictive ) |
|
14303 { |
|
14304 const TInt previousValue = iWesternPredictive; |
|
14305 iWesternPredictive = aWesternPredictive && !(iAknEditorFlags & EAknEditorFlagNoT9) && |
|
14306 // Predictive QWERTY (XT9) changes ----> |
|
14307 ( |
|
14308 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
14309 ( |
|
14310 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
14311 iLanguageCapabilities.iSupportsWesternPredictive |
|
14312 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
14313 && !iQwertyInputMode) |
|
14314 || (iLanguageCapabilities.iSupportsWesternQwertyPredictive && iQwertyInputMode) |
|
14315 #ifdef __HALF_QWERTY_KEYPAD |
|
14316 || (iLanguageCapabilities.iSupportsWesternHalfQwertyPredictive && iQwertyInputMode) |
|
14317 #endif //__HALF_QWERTY_KEYPAD |
|
14318 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
14319 ); |
|
14320 // Predictive QWERTY (XT9) changes <---- |
|
14321 if ( (previousValue != iWesternPredictive) && !(iAknEditorFlags & EAknEditorFlagNoT9) ) |
|
14322 { |
|
14323 if (iWesternPredictive) |
|
14324 { |
|
14325 iSharedDataInterface->SetPredictiveTextOn(); |
|
14326 } |
|
14327 else |
|
14328 { |
|
14329 iSharedDataInterface->ResetPredictiveTextOn(); |
|
14330 } |
|
14331 } |
|
14332 } |
|
14333 |
|
14334 void CAknFepManager::SetWesternAutoComplete( const TBool aWesternAutoComplete ) |
|
14335 { |
|
14336 const TInt previousValue = iIsAutoCompleteOn; |
|
14337 iIsAutoCompleteOn = aWesternAutoComplete && !(iAknEditorFlags & EAknEditorFlagNoT9); |
|
14338 if ( (previousValue != iIsAutoCompleteOn) && !(iAknEditorFlags & EAknEditorFlagNoT9) ) |
|
14339 { |
|
14340 if (iIsAutoCompleteOn) |
|
14341 { |
|
14342 iSharedDataInterface->SetPredictiveTextAutoCompleteOn(); |
|
14343 } |
|
14344 else |
|
14345 { |
|
14346 iSharedDataInterface->ResetPredictiveTextAutoCompleteOn(); |
|
14347 } |
|
14348 } |
|
14349 } |
|
14350 |
|
14351 void CAknFepManager::SetJapanesePredictive(const TBool aJapanesePredictive) |
|
14352 { |
|
14353 if (iJapanesePredictive != aJapanesePredictive) |
|
14354 { |
|
14355 iJapanesePredictive = aJapanesePredictive; |
|
14356 } |
|
14357 if (iJapanesePredictive & iSharedDataInterface->PredictiveTextJapaneseOn() |
|
14358 || !iJapanesePredictive & !iSharedDataInterface->PredictiveTextJapaneseOn()) |
|
14359 { |
|
14360 if(iJapanesePredictive) |
|
14361 { |
|
14362 iSharedDataInterface->SetJapanesePredictiveTextOn(); |
|
14363 } |
|
14364 else |
|
14365 { |
|
14366 iSharedDataInterface->ResetJapanesePredictiveTextOn(); |
|
14367 } |
|
14368 } |
|
14369 } |
|
14370 |
|
14371 void CAknFepManager::SetQwertyMode(const TBool aQwertyInputMode) |
|
14372 { |
|
14373 #ifdef RD_SCALABLE_UI_V2 |
|
14374 if( aQwertyInputMode && iFepPluginManager && |
|
14375 iSharedDataInterface->PluginInputMode() != EPluginInputModeNone |
|
14376 // Add this condition for addtion of ITI features on FSQ. |
|
14377 // iSharedDataInterface->QwertyInputMode() == 1, means that |
|
14378 // hw keyboard is slided, then need to close touch inputmethods. |
|
14379 && iSharedDataInterface->QwertyInputMode() ) |
|
14380 { |
|
14381 iFepPluginManager->ResetMenuState(EFalse); |
|
14382 ExitPluginSpellModeByCancel(); |
|
14383 TRAP_IGNORE(iFepPluginManager->ClosePluginInputModeL( ETrue )); |
|
14384 if ( iCancelPopupInQwerty ) |
|
14385 { |
|
14386 TRAP_IGNORE( SimulateKeyEventL( EKeyCBA2 ) ); |
|
14387 } |
|
14388 } |
|
14389 SetQwertyModeToInputcapbility(); |
|
14390 #endif//RD_SCALABLE_UI_V2 |
|
14391 if (!COMPARE_BOOLS(aQwertyInputMode, iQwertyInputMode)) |
|
14392 { |
|
14393 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
14394 if(IsAutoCompleteOn()) |
|
14395 { |
|
14396 TRAP_IGNORE(RemoveSuggestedCompletionL()); |
|
14397 } |
|
14398 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
14399 iQwertyInputMode = aQwertyInputMode; |
|
14400 if (!iQwertyInputMode) |
|
14401 { |
|
14402 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
14403 SetTypingCorrectionLevel(EPtiErrorCorrectionLevelHigh); |
|
14404 SetNumberCandidateState(ETrue); // ETrue |
|
14405 SetPrimaryCandidate(EFalse); // Best prediction |
|
14406 #endif |
|
14407 ClearFlag(EFlagQwertyShiftMode | EFlagNoActionDuringChrKeyPress); |
|
14408 } |
|
14409 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
14410 else |
|
14411 { |
|
14412 iSharedDataInterface->HandlePredictiveTextNumberCandidateSettingChange(); |
|
14413 iSharedDataInterface->HandlePredictiveTextTypingCorrectionLevelChange(); |
|
14414 iSharedDataInterface->HandlePredictiveTextPrimaryCandidateChange(); |
|
14415 } |
|
14416 #endif |
|
14417 |
|
14418 if ( iFepManState != EAknFepStateNull && IsFepAwareTextEditor() ) |
|
14419 { |
|
14420 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
14421 |
|
14422 // In case of layout remove the auto completion part |
|
14423 // Before transfer fep state to editor state. |
|
14424 if(IsAutoCompleteOn()) |
|
14425 { |
|
14426 #ifdef RD_SCALABLE_UI_V2 |
|
14427 if( iFepPluginManager |
|
14428 && iFepPluginManager->IsSupportITIOnFSQ() |
|
14429 && !iQwertyInputMode ) |
|
14430 { |
|
14431 TRAP_IGNORE( iPtiEngine->HandleCommandL( EPtiCommandLockCurrentCandidate ) ); |
|
14432 } |
|
14433 else |
|
14434 #endif //RD_SCALABLE_UI_V2 |
|
14435 { |
|
14436 TInt tailLength = 0; |
|
14437 TRAP_IGNORE(iPtiEngine->HandleCommandL( EPtiCommandGetAutoCompletionTailLength, &tailLength )); |
|
14438 if(tailLength > 0) |
|
14439 { |
|
14440 TRAP_IGNORE( |
|
14441 { |
|
14442 RemoveSuggestedAdvanceCompletionL(); |
|
14443 iPtiEngine->HandleCommandL( EPtiCommandLockCurrentCandidate ); |
|
14444 }); |
|
14445 } |
|
14446 } |
|
14447 } |
|
14448 #endif |
|
14449 if ( !iFocusedItemDestroy ) |
|
14450 { |
|
14451 TRAP_IGNORE( |
|
14452 { |
|
14453 TransferFepStateToEditorL(); |
|
14454 TryCloseUiL(); |
|
14455 ConfigureFEPFromEditorStateL(); |
|
14456 }); |
|
14457 } |
|
14458 } |
|
14459 } |
|
14460 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
14461 if(iFnKeyManager) |
|
14462 iFnKeyManager->SetQwertyInputMode(aQwertyInputMode); |
|
14463 #endif |
|
14464 } |
|
14465 |
|
14466 TBool CAknFepManager::WesternPredictive(TInt aMode) const |
|
14467 { |
|
14468 TInt mode = iMode; |
|
14469 if ( aMode ) |
|
14470 { |
|
14471 mode = aMode; |
|
14472 } |
|
14473 return (mode == ELatin && iWesternPredictive && |
|
14474 // Predictive QWERTY (XT9) changes ----> |
|
14475 |
|
14476 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
14477 (( |
|
14478 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
14479 iLanguageCapabilities.iSupportsWesternPredictive |
|
14480 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
14481 && !iQwertyInputMode) |
|
14482 || (iLanguageCapabilities.iSupportsWesternQwertyPredictive && iQwertyInputMode) |
|
14483 #ifdef __HALF_QWERTY_KEYPAD |
|
14484 || (iLanguageCapabilities.iSupportsWesternHalfQwertyPredictive && iQwertyInputMode) |
|
14485 #endif //__HALF_QWERTY_KEYPAD |
|
14486 ) |
|
14487 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
14488 ); |
|
14489 // Predictive QWERTY (XT9) changes <---- |
|
14490 } |
|
14491 |
|
14492 TBool CAknFepManager::IsPredictive(TInt aMode) const |
|
14493 { |
|
14494 TBool isPredictive = EFalse; |
|
14495 TInt mode = iMode; |
|
14496 if ( aMode ) |
|
14497 { |
|
14498 mode = aMode; |
|
14499 } |
|
14500 if (mode == EHiraganaKanji ) |
|
14501 { |
|
14502 if ((iPermittedInputModes & EAknEditorHiraganaKanjiInputMode) |
|
14503 && iJapanesePredictive |
|
14504 && !(iAknEditorFlags & EAknEditorFlagNoT9) |
|
14505 && HasJapanesePredictionInputMode()) |
|
14506 { |
|
14507 isPredictive = ETrue; |
|
14508 // Japanese predictive input is available on both Qwerty and not Qwerty |
|
14509 return isPredictive; |
|
14510 } |
|
14511 } |
|
14512 else if (mode == ELatin) |
|
14513 { |
|
14514 if ((iPermittedInputModes & (EAknEditorTextInputMode | EAknEditorHalfWidthTextInputMode)) |
|
14515 && !(iAknEditorFlags & EAknEditorFlagNoT9) |
|
14516 && iWesternPredictive && |
|
14517 (iLanguageCapabilities.iSupportsWesternPredictive |
|
14518 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
14519 ||iLanguageCapabilities.iSupportsWesternQwertyPredictive |
|
14520 #ifdef __HALF_QWERTY_KEYPAD |
|
14521 ||iLanguageCapabilities.iSupportsWesternHalfQwertyPredictive |
|
14522 #endif //__HALF_QWERTY_KEYPAD |
|
14523 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
14524 )) // Predictive QWERTY (XT9) changes |
|
14525 { |
|
14526 isPredictive = ETrue; |
|
14527 } |
|
14528 } |
|
14529 #ifdef RD_SCALABLE_UI_V2 |
|
14530 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
14531 return isPredictive; //&& (iFepPluginManager->PluginInputMode() == EPluginInputModeNone); |
|
14532 #else |
|
14533 return isPredictive && !iQwertyInputMode |
|
14534 && ((iFepPluginManager->PluginInputMode() == EPluginInputModeItut) |
|
14535 || (iFepPluginManager->PluginInputMode() == EPluginInputModeNone)); |
|
14536 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
14537 #else |
|
14538 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
14539 return isPredictive; |
|
14540 #else |
|
14541 return isPredictive && !iQwertyInputMode; |
|
14542 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
14543 #endif //RD_SCALABLE_UI_V2 |
|
14544 } |
|
14545 |
|
14546 TBool CAknFepManager::Japanese() const |
|
14547 { |
|
14548 TBool rtn = EFalse; |
|
14549 switch (iMode) |
|
14550 { |
|
14551 case EHiraganaKanji: |
|
14552 case EKatakana: |
|
14553 case EHiragana: |
|
14554 rtn = ETrue; |
|
14555 break; |
|
14556 case ELatin: |
|
14557 if ((!WesternPredictive()) && iCharWidth == EFullWidthChar) |
|
14558 { |
|
14559 rtn = ETrue; |
|
14560 } |
|
14561 break; |
|
14562 case ENumber: |
|
14563 if (iCharWidth == EFullWidthChar) |
|
14564 { |
|
14565 rtn = ETrue; |
|
14566 } |
|
14567 break; |
|
14568 default: |
|
14569 break; |
|
14570 } |
|
14571 return rtn; |
|
14572 } |
|
14573 |
|
14574 TBool CAknFepManager::IsOnlyFullWidthCharacterPermitted() const |
|
14575 { |
|
14576 CAknEdwinState* editorState = EditorState(); |
|
14577 TUint permittedInputModes = editorState->PermittedInputModes(); |
|
14578 TUint fullWidthPermitted = (EAknEditorFullWidthTextInputMode |
|
14579 | EAknEditorFullWidthNumericInputMode |
|
14580 | EAknEditorFullWidthKatakanaInputMode); |
|
14581 TUint fullWidthNotPermitted = ~fullWidthPermitted; |
|
14582 TBool isfullchar = ETrue; |
|
14583 if (permittedInputModes & fullWidthNotPermitted) |
|
14584 { |
|
14585 isfullchar = EFalse; |
|
14586 } |
|
14587 |
|
14588 if (!(permittedInputModes & fullWidthPermitted)) |
|
14589 { |
|
14590 isfullchar = EFalse; |
|
14591 } |
|
14592 |
|
14593 return isfullchar; |
|
14594 } |
|
14595 |
|
14596 TBool CAknFepManager::IsOnlyHalfWidthCharacterPermitted() const |
|
14597 { |
|
14598 CAknEdwinState* editorState = EditorState(); |
|
14599 TUint permittedInputModes; |
|
14600 if( editorState ) |
|
14601 { |
|
14602 permittedInputModes= editorState->PermittedInputModes(); |
|
14603 } |
|
14604 else |
|
14605 { |
|
14606 permittedInputModes = EAknEditorNumericInputMode; |
|
14607 } |
|
14608 TUint halfWidthNotPermitted = (EAknEditorFullWidthTextInputMode |
|
14609 | EAknEditorFullWidthNumericInputMode |
|
14610 | EAknEditorFullWidthKatakanaInputMode |
|
14611 | EAknEditorHiraganaKanjiInputMode |
|
14612 | EAknEditorHiraganaInputMode); |
|
14613 |
|
14614 TUint halfWidthPermitted = ~halfWidthNotPermitted; |
|
14615 TBool ishalfchar = ETrue; |
|
14616 if (permittedInputModes & halfWidthNotPermitted) |
|
14617 { |
|
14618 ishalfchar = EFalse; |
|
14619 } |
|
14620 |
|
14621 if (!(permittedInputModes & halfWidthPermitted)) |
|
14622 { |
|
14623 ishalfchar = EFalse; |
|
14624 } |
|
14625 if (permittedInputModes & EAknEditorTextInputMode) |
|
14626 { |
|
14627 ishalfchar = EFalse; |
|
14628 } |
|
14629 if (editorState && (editorState->Flags() & EAknEditorFlagLatinInputModesOnly)) |
|
14630 { |
|
14631 ishalfchar = ETrue; |
|
14632 } |
|
14633 return ishalfchar; |
|
14634 } |
|
14635 |
|
14636 TBool CAknFepManager::IsHalfAndFullKatakanaPermitted() const |
|
14637 { |
|
14638 CAknEdwinState* editorState = EditorState(); |
|
14639 TUint permittedInputModes = editorState->PermittedInputModes(); |
|
14640 TUint katakanaInputMode = (EAknEditorKatakanaInputMode |
|
14641 | EAknEditorFullWidthKatakanaInputMode); |
|
14642 TBool iskatakana = EFalse; |
|
14643 if ((permittedInputModes & katakanaInputMode) == katakanaInputMode) |
|
14644 { |
|
14645 iskatakana = ETrue; |
|
14646 } |
|
14647 return iskatakana; |
|
14648 } |
|
14649 |
|
14650 TBool CAknFepManager::IsHalfAndFullLatinPermitted() const |
|
14651 { |
|
14652 CAknEdwinState* editorState = EditorState(); |
|
14653 TUint permittedInputModes = editorState->PermittedInputModes(); |
|
14654 TUint latinInputMode = (EAknEditorHalfWidthTextInputMode |
|
14655 | EAknEditorFullWidthTextInputMode); |
|
14656 TBool islatin = EFalse; |
|
14657 |
|
14658 if ((permittedInputModes & latinInputMode) == latinInputMode) |
|
14659 { |
|
14660 islatin = ETrue; |
|
14661 } |
|
14662 return islatin; |
|
14663 } |
|
14664 |
|
14665 TBool CAknFepManager::IsHalfAndFullNumberPermitted() const |
|
14666 { |
|
14667 CAknEdwinState* editorState = EditorState(); |
|
14668 TUint permittedInputModes = editorState->PermittedInputModes(); |
|
14669 TUint numInputMode = (EAknEditorNumericInputMode |
|
14670 | EAknEditorFullWidthNumericInputMode); |
|
14671 TBool isnum = EFalse; |
|
14672 if ((permittedInputModes & numInputMode) == numInputMode) |
|
14673 { |
|
14674 isnum = ETrue; |
|
14675 } |
|
14676 |
|
14677 return isnum; |
|
14678 } |
|
14679 |
|
14680 TWidthChar CAknFepManager::CharacterWidth() const |
|
14681 { |
|
14682 return iCharWidth; |
|
14683 } |
|
14684 |
|
14685 CPtiEngine* CAknFepManager::PtiEngine() const |
|
14686 { |
|
14687 return iPtiEngine; |
|
14688 } |
|
14689 |
|
14690 void CAknFepManager::SetInlineEditingCursorVisibilityL(TBool aCursorVisibility) |
|
14691 { |
|
14692 #ifdef RD_SCALABLE_UI_V2 |
|
14693 if ( SemiFepAwareTextEditor( ETrue ) ) |
|
14694 #else |
|
14695 if (iInputCapabilities.FepAwareTextEditor()) |
|
14696 #endif // RD_SCALABLE_UI_V2 |
|
14697 { |
|
14698 iInputCapabilities.FepAwareTextEditor()->SetInlineEditingCursorVisibilityL(aCursorVisibility); |
|
14699 } |
|
14700 } |
|
14701 |
|
14702 TInt CAknFepManager::InputMode() const |
|
14703 { |
|
14704 return iMode; |
|
14705 } |
|
14706 |
|
14707 TInt CAknFepManager::CangJieMode() const |
|
14708 { |
|
14709 TInt shareMode = iSharedDataInterface->CangJieMode(); |
|
14710 TInt cangjieMode = shareMode + EPtiEngineNormalCangjieQwerty; |
|
14711 return cangjieMode; |
|
14712 } |
|
14713 |
|
14714 TBool CAknFepManager::InputLanguageSupportsCaseChanges() const |
|
14715 { |
|
14716 return iLanguageCapabilities.iSupportsCase; |
|
14717 } |
|
14718 |
|
14719 TBool CAknFepManager::IsAbleScrollLatinPredictive() const |
|
14720 { |
|
14721 return iSharedDataInterface->ScrollLatinPredictiveCandidates(); |
|
14722 } |
|
14723 |
|
14724 TText CAknFepManager::PreviousChar( TBool /*aContextSensitive*/ ) |
|
14725 { |
|
14726 TBuf<ESingleCharacter> previousCharacter(ESingleCharacter); |
|
14727 previousCharacter.FillZ(); |
|
14728 |
|
14729 TCursorSelection curSel; |
|
14730 if ( IsFepAwareTextEditor() ) |
|
14731 { |
|
14732 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(curSel); |
|
14733 TInt lowerpos = curSel.LowerPos(); |
|
14734 if(lowerpos > 0) |
|
14735 { |
|
14736 iInputCapabilities.FepAwareTextEditor()-> |
|
14737 GetEditorContentForFep(previousCharacter, lowerpos-1, ESingleCharacter); |
|
14738 if (previousCharacter.Length()) |
|
14739 return previousCharacter[0]; |
|
14740 } |
|
14741 } |
|
14742 return NULL; |
|
14743 } |
|
14744 |
|
14745 TBool CAknFepManager::IsZWSCharacterPresent( TBool aLigaturePresent /* = EFalse*/ ) |
|
14746 { |
|
14747 TBuf<3> previousCharacter; |
|
14748 previousCharacter.Zero(); |
|
14749 TBool found = EFalse; |
|
14750 previousCharacter.FillZ(); |
|
14751 |
|
14752 TCursorSelection curSel; |
|
14753 if ( IsFepAwareTextEditor() ) |
|
14754 { |
|
14755 MCoeFepAwareTextEditor* fepAwareTextEditor = |
|
14756 iInputCapabilities.FepAwareTextEditor(); |
|
14757 fepAwareTextEditor->GetCursorSelectionForFep(curSel); |
|
14758 TInt lowerpos = curSel.LowerPos(); |
|
14759 if( lowerpos > 1 ) |
|
14760 { |
|
14761 if( aLigaturePresent && lowerpos > 3 ) |
|
14762 { |
|
14763 fepAwareTextEditor-> |
|
14764 GetEditorContentForFep(previousCharacter, |
|
14765 lowerpos - 4, 2); |
|
14766 } |
|
14767 else |
|
14768 { |
|
14769 fepAwareTextEditor-> |
|
14770 GetEditorContentForFep(previousCharacter, |
|
14771 lowerpos - 2, 2); |
|
14772 } |
|
14773 if( previousCharacter[0] == ZERO_WIDTH_SPACE |
|
14774 || previousCharacter[1] == ZERO_WIDTH_SPACE ) |
|
14775 { |
|
14776 found = ETrue; |
|
14777 } |
|
14778 } |
|
14779 } |
|
14780 return found; |
|
14781 } |
|
14782 |
|
14783 TText CAknFepManager::NextChar() |
|
14784 { |
|
14785 TBuf<ESingleCharacter> nextCharacter(ESingleCharacter); |
|
14786 nextCharacter.FillZ(); |
|
14787 |
|
14788 TCursorSelection curSel; |
|
14789 if ( IsFepAwareTextEditor() ) |
|
14790 { |
|
14791 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(curSel); |
|
14792 TInt higherpos = curSel.HigherPos(); |
|
14793 TInt maxLength = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
14794 if ( higherpos >= 0 && higherpos <= maxLength && maxLength >= 1 ) |
|
14795 { |
|
14796 iInputCapabilities.FepAwareTextEditor()-> |
|
14797 GetEditorContentForFep(nextCharacter, higherpos, ESingleCharacter); |
|
14798 if( nextCharacter.Length() ) |
|
14799 return nextCharacter[0]; |
|
14800 } |
|
14801 } |
|
14802 return NULL; |
|
14803 } |
|
14804 |
|
14805 void CAknFepManager::FindStartOfWord(TInt& aAnchorPos) const |
|
14806 { |
|
14807 TBuf<ESingleCharacter> characterBuffer; |
|
14808 FOREVER |
|
14809 { |
|
14810 if (aAnchorPos<=0) |
|
14811 { |
|
14812 break; // start of editor |
|
14813 } |
|
14814 iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(characterBuffer, |
|
14815 aAnchorPos-1, |
|
14816 ESingleCharacter); |
|
14817 if (!IsValidInLineCharacter(characterBuffer[0])) |
|
14818 { |
|
14819 break; |
|
14820 } |
|
14821 aAnchorPos--; |
|
14822 } |
|
14823 } |
|
14824 |
|
14825 void CAknFepManager::FindEndOfWord(TInt& aCursorPos) const |
|
14826 { |
|
14827 TBuf<ESingleCharacter> characterBuffer; |
|
14828 FOREVER |
|
14829 { |
|
14830 if (aCursorPos>=iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep()) |
|
14831 { |
|
14832 break; // end of editor |
|
14833 } |
|
14834 iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(characterBuffer, |
|
14835 aCursorPos, |
|
14836 ESingleCharacter); |
|
14837 if (!IsValidInLineCharacter(characterBuffer[0])) |
|
14838 { |
|
14839 break; |
|
14840 } |
|
14841 aCursorPos++; |
|
14842 } |
|
14843 } |
|
14844 |
|
14845 TBool CAknFepManager::CursorInsideWord() |
|
14846 { |
|
14847 TBuf<ESingleCharacter> characterBuffer; |
|
14848 TBool insideWord=ETrue; |
|
14849 |
|
14850 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
14851 TInt cursorPos=iUncommittedText.iCursorPos; |
|
14852 |
|
14853 if (cursorPos) |
|
14854 { |
|
14855 // check character before cursor |
|
14856 iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(characterBuffer, |
|
14857 cursorPos-1, |
|
14858 ESingleCharacter); |
|
14859 if (characterBuffer.Length()) |
|
14860 { |
|
14861 if (!IsValidInLineCharacter(characterBuffer[0])) |
|
14862 { |
|
14863 insideWord=EFalse; |
|
14864 } |
|
14865 } |
|
14866 } |
|
14867 else // at start of editor |
|
14868 { |
|
14869 insideWord=EFalse; |
|
14870 } |
|
14871 |
|
14872 if (insideWord && cursorPos<iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep()) |
|
14873 { |
|
14874 // put character after cursor into buffer |
|
14875 iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(characterBuffer, cursorPos, |
|
14876 ESingleCharacter); |
|
14877 if (characterBuffer.Length()) |
|
14878 { |
|
14879 if (!IsValidInLineCharacter(characterBuffer[0])) |
|
14880 { |
|
14881 insideWord=EFalse; |
|
14882 } |
|
14883 } |
|
14884 } |
|
14885 else // at end of editor |
|
14886 { |
|
14887 insideWord=EFalse; |
|
14888 } |
|
14889 |
|
14890 return insideWord; |
|
14891 } |
|
14892 |
|
14893 void CAknFepManager::MoveCursorToStartOfWordL() |
|
14894 { |
|
14895 TInt anchorPos=iUncommittedText.iAnchorPos; |
|
14896 FindStartOfWord(anchorPos); |
|
14897 iUncommittedText.SetSelection(anchorPos, anchorPos); |
|
14898 iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(iUncommittedText); |
|
14899 } |
|
14900 |
|
14901 void CAknFepManager::MoveCursorToEndOfWordL() |
|
14902 { |
|
14903 TInt cursorPos=iUncommittedText.iCursorPos; |
|
14904 |
|
14905 if(!IsExtendedFlagSet(EExtendedFlagOkKeyPressOnCandidatePopup)) |
|
14906 FindEndOfWord(cursorPos); |
|
14907 iUncommittedText.SetSelection(cursorPos, cursorPos); |
|
14908 iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(iUncommittedText); |
|
14909 } |
|
14910 |
|
14911 TKeyResponse CAknFepManager::HandleNaviEventOutsideInlineEditL(TUint aCode, |
|
14912 TKeyPressLength aLength) |
|
14913 { |
|
14914 TKeyResponse response = EKeyWasNotConsumed; |
|
14915 |
|
14916 if (TryHandleCommonArrowAndBackspaceFunctionalityL(aCode, response)) |
|
14917 { |
|
14918 return response; |
|
14919 } |
|
14920 if (WesternPredictive()) |
|
14921 { |
|
14922 response = HandlePredictiveNaviEventOutsideInlineEditL(aCode, aLength); |
|
14923 } |
|
14924 |
|
14925 return response; |
|
14926 } |
|
14927 |
|
14928 TKeyResponse CAknFepManager::HandleWesternPredictiveArrowKeyL(TInt aCode, TKeyPressLength aLength) |
|
14929 { |
|
14930 TKeyResponse response = EKeyWasNotConsumed; |
|
14931 |
|
14932 if (IsFlagSet(EFlagLineFeedCharacter)) |
|
14933 { |
|
14934 // This event will stop the multitapping timer for enter chr. |
|
14935 // just return. |
|
14936 return EKeyWasConsumed; |
|
14937 } |
|
14938 |
|
14939 TCursorSelection selection; |
|
14940 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(selection); |
|
14941 if(!IsMfneEditor() && |
|
14942 ( iFepPluginManager->PluginInputMode() == EPluginInputModeItut) && |
|
14943 selection.Length() > 0) |
|
14944 { |
|
14945 // If open virtual ITUT and highlight some chars |
|
14946 return EKeyWasConsumed; |
|
14947 } |
|
14948 if (aCode == EKeyUpArrow || aCode == EKeyDownArrow) |
|
14949 { |
|
14950 ClearFlag(EFlagCompoundWord); |
|
14951 if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
14952 { |
|
14953 // moving out of an inline edit |
|
14954 TryRemoveNoMatchesIndicatorL(); |
|
14955 UpdateCbaL(NULL); |
|
14956 // To rip off suggested word completion when user presses UP / DOWN arrow keys |
|
14957 if(IsAutoCompleteOn()) |
|
14958 { |
|
14959 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
14960 |
|
14961 RemoveSuggestedCompletionL(); |
|
14962 |
|
14963 #else |
|
14964 TInt tailLength = 0; |
|
14965 iPtiEngine->HandleCommandL( EPtiCommandGetAutoCompletionTailLength, |
|
14966 &tailLength ); |
|
14967 if(tailLength > 0) |
|
14968 { |
|
14969 RemoveSuggestedAdvanceCompletionL(); |
|
14970 return EKeyWasConsumed; |
|
14971 } |
|
14972 #endif |
|
14973 } |
|
14974 if (IsFlagSet(EFlagShiftKeyDepressed) || IsCcpuFlagSet(ECcpuStateHashDown)) |
|
14975 { |
|
14976 CommitInlineEditL(); |
|
14977 TryCloseUiL(); |
|
14978 SimulateKeyEventL(EKeyF19); // Asyncronous case update |
|
14979 // pass to editor for text selection. |
|
14980 response=EKeyWasNotConsumed; |
|
14981 } |
|
14982 } |
|
14983 if ((iInputCapabilities.FepAwareTextEditor() && !TryHandleTextSelectedNaviEventL(aCode, response)) && !IsFlagSet(EFlagShiftKeyDepressed)) |
|
14984 { |
|
14985 if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
14986 { |
|
14987 ClearFlag(CAknFepManager::EFlagNoMatches); |
|
14988 TryRemoveNoMatchesIndicatorL(); |
|
14989 CommitInlineEditL(); |
|
14990 } |
|
14991 UpdateCbaL(NULL); |
|
14992 |
|
14993 // simulate a designated key event to catch and check if we're inside a word |
|
14994 if (aCode == EKeyDownArrow) |
|
14995 { |
|
14996 SimulateKeyEventL(EKeyF22); |
|
14997 } |
|
14998 else |
|
14999 { |
|
15000 SimulateKeyEventL(EKeyF23); |
|
15001 } |
|
15002 // pass to editor for text selection. |
|
15003 response=EKeyWasNotConsumed; |
|
15004 } |
|
15005 else if (IsFlagSet(EFlagShiftKeyDepressed) || IsCcpuFlagSet(ECcpuStateHashDown)) |
|
15006 { |
|
15007 // Need to update case indicator if text selection is made upwards. |
|
15008 SimulateKeyEventL(EKeyF19); |
|
15009 } |
|
15010 } |
|
15011 else // right or left |
|
15012 { |
|
15013 if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
15014 { |
|
15015 // moving out of an inline edit |
|
15016 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
15017 if(IsAutoCompleteOn()) |
|
15018 { |
|
15019 if((aCode == EKeyLeftArrow && |
|
15020 CurrentInputDirectionality() == TBidiText::ELeftToRight) || |
|
15021 (aCode == EKeyRightArrow && |
|
15022 CurrentInputDirectionality() == TBidiText::ERightToLeft)) |
|
15023 { |
|
15024 RemoveSuggestedCompletionL(); |
|
15025 } |
|
15026 } |
|
15027 #else |
|
15028 if(IsAutoCompleteOn()) |
|
15029 { |
|
15030 TInt tailLength = 0; |
|
15031 iPtiEngine->HandleCommandL( EPtiCommandGetAutoCompletionTailLength, &tailLength ); |
|
15032 // In case the inline editing is ongoing and there is a word completion |
|
15033 // currently shown, the first backwards tap will remove the suggested |
|
15034 // completion. |
|
15035 if(tailLength > 0) |
|
15036 { |
|
15037 if (((CurrentInputDirectionality()==TBidiText::ERightToLeft) && aCode == EKeyLeftArrow) |
|
15038 || ((CurrentInputDirectionality()==TBidiText::ELeftToRight) && aCode == EKeyRightArrow )) |
|
15039 { |
|
15040 iPtiEngine->HandleCommandL( EPtiCommandLockCurrentCandidate); |
|
15041 TPtrC selectedWord = iPtiEngine->CurrentWord(); |
|
15042 UpdateInlineEditL( selectedWord, selectedWord.Length() ); //selection.iAnchorPosition |
|
15043 iPtiEngine->CommitCurrentWord(); |
|
15044 TryCloseUiL(); |
|
15045 // Asyncronous case update after the editor has handled the key |
|
15046 SimulateKeyEventL(EKeyF19); |
|
15047 response=EKeyWasConsumed; |
|
15048 } |
|
15049 else if(((CurrentInputDirectionality()== TBidiText::ERightToLeft ) && aCode == EKeyRightArrow) |
|
15050 || ((CurrentInputDirectionality()== TBidiText::ELeftToRight) && aCode == EKeyLeftArrow )) |
|
15051 { |
|
15052 RemoveSuggestedAdvanceCompletionL(); |
|
15053 response=EKeyWasConsumed; |
|
15054 } |
|
15055 return response; |
|
15056 } |
|
15057 else if (!IsQwerty()) |
|
15058 { |
|
15059 iPtiEngine->CommitCurrentWord(); |
|
15060 } |
|
15061 |
|
15062 } |
|
15063 #endif // RD_INTELLIGENT_TEXT_INPUT |
|
15064 TryRemoveNoMatchesIndicatorL(); |
|
15065 UpdateCbaL(NULL); |
|
15066 if (IsFlagSet(EFlagShiftKeyDepressed) || IsCcpuFlagSet(ECcpuStateHashDown)) |
|
15067 { |
|
15068 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
15069 if(IsAutoCompleteOn()) // To rip off suggested completion when shift key is pressed |
|
15070 { |
|
15071 RemoveSuggestedCompletionL(); |
|
15072 } |
|
15073 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
15074 CommitInlineEditL(); |
|
15075 TryCloseUiL(); |
|
15076 SimulateKeyEventL(EKeyF19); // Asyncronous case update |
|
15077 // pass to editor for text selection. |
|
15078 response=EKeyWasNotConsumed; |
|
15079 } |
|
15080 else |
|
15081 { |
|
15082 TWesternNaviEvent naviEvent = ELeftNaviEvent; |
|
15083 if (aCode == EKeyRightArrow) |
|
15084 { |
|
15085 naviEvent = ERightNaviEvent; |
|
15086 } |
|
15087 // Find the visual left/right end of the current word |
|
15088 TTmDocPosSpec pos; |
|
15089 GetAvkonDefinedVisualLimitsOfSelection( |
|
15090 iUncommittedText, naviEvent, pos, NULL ); |
|
15091 |
|
15092 if (IsCcpuFlagSet(ECcpuStateNewPredictiveWord)) |
|
15093 { |
|
15094 // This is new predictive word which is being committed with arrow |
|
15095 // key. Force ::TryCloseUiL to commit PtiEngie word to keep |
|
15096 // frequency information in sync. |
|
15097 SetCcpuFlag(ECcpuStataCommitPredictiveWord); |
|
15098 } |
|
15099 |
|
15100 TryCloseUiL(); |
|
15101 |
|
15102 // Position should be dis-ambiguated based on last navigation and direction of blocks. |
|
15103 AdjustPosSpecForAmbiguityAfterLeftOrRightNavigation( pos, naviEvent ); |
|
15104 |
|
15105 SetCursorPositionL( pos ); |
|
15106 if (CursorInsideWord() && naviEvent == ERightNaviEvent) |
|
15107 { |
|
15108 MoveCursorToEndOfWordL(); |
|
15109 } |
|
15110 |
|
15111 iCaseMan->UpdateCase(ENullNaviEvent); |
|
15112 response=EKeyWasConsumed; |
|
15113 } |
|
15114 } |
|
15115 else |
|
15116 { |
|
15117 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
15118 if ( iLanguageCapabilities.iInputLanguageCode == ELangThai ) // Without this, t9 goes inside words |
|
15119 { // That is not allowed in Thai |
|
15120 response = EKeyWasNotConsumed; |
|
15121 } |
|
15122 else |
|
15123 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
15124 response = HandleNaviEventOutsideInlineEditL(aCode, aLength); |
|
15125 if (response == EKeyWasNotConsumed) |
|
15126 { |
|
15127 // moving over a space |
|
15128 if (aCode == EKeyLeftArrow && !IsFlagSet(EFlagShiftKeyDepressed)) |
|
15129 { |
|
15130 iCaseMan->UpdateCase(ELeftNaviEvent); |
|
15131 } |
|
15132 else if (!IsFlagSet(EFlagShiftKeyDepressed)) // EKeyRightArrow |
|
15133 { |
|
15134 iCaseMan->UpdateCase(ERightNaviEvent); |
|
15135 } |
|
15136 } |
|
15137 else |
|
15138 iCaseMan->UpdateCase(ENullNaviEvent); |
|
15139 } |
|
15140 } |
|
15141 return response; |
|
15142 } |
|
15143 |
|
15144 TBool CAknFepManager::TryHandleTextSelectedNaviEventL(TInt aCode, TKeyResponse& response) |
|
15145 { |
|
15146 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
15147 |
|
15148 if (!IsFlagSet(EFlagShiftKeyDepressed) && iUncommittedText.Length()) |
|
15149 { |
|
15150 if (aCode == EKeyBackspace) |
|
15151 { |
|
15152 iCaseMan->UpdateCase(EBackspaceEvent); |
|
15153 response = EKeyWasNotConsumed; |
|
15154 } |
|
15155 else |
|
15156 { |
|
15157 TInt newCursorPos = iUncommittedText.HigherPos(); //default, right or down |
|
15158 if (aCode == EKeyLeftArrow || aCode == EKeyUpArrow) |
|
15159 { |
|
15160 newCursorPos = iUncommittedText.LowerPos(); |
|
15161 } |
|
15162 iUncommittedText.SetSelection(newCursorPos, newCursorPos); |
|
15163 iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(iUncommittedText); |
|
15164 |
|
15165 if (WesternPredictive()) |
|
15166 { |
|
15167 if (CursorInsideWord()) |
|
15168 { |
|
15169 if (aCode == EKeyLeftArrow || aCode == EKeyUpArrow) |
|
15170 { |
|
15171 MoveCursorToStartOfWordL(); |
|
15172 } |
|
15173 else //right or down |
|
15174 { |
|
15175 MoveCursorToEndOfWordL(); |
|
15176 } |
|
15177 } |
|
15178 iCaseMan->UpdateCase(ENullNaviEvent); |
|
15179 } |
|
15180 response = EKeyWasConsumed; |
|
15181 } |
|
15182 return ETrue; |
|
15183 } |
|
15184 return EFalse; |
|
15185 } |
|
15186 |
|
15187 TBool CAknFepManager::TryHandleCommonArrowAndBackspaceFunctionalityL(TInt aCode, |
|
15188 TKeyResponse& aResponse) |
|
15189 { |
|
15190 TBool keyHandled = ETrue; |
|
15191 if ( !IsFepAwareTextEditor() ) |
|
15192 { |
|
15193 aResponse=EKeyWasNotConsumed; |
|
15194 return keyHandled; |
|
15195 } |
|
15196 #ifdef RD_HINDI_PHONETIC_INPUT |
|
15197 if(iLanguageCapabilities.iInputLanguageCode == KLangHindiPhonetic) |
|
15198 { |
|
15199 if (aCode == EKeyBackspace) |
|
15200 { |
|
15201 CommitInlineEditL(); |
|
15202 FepUI()->HandleKeyL(aCode, EShortKeyPress); |
|
15203 } |
|
15204 if(IsFlagSet(CAknFepManager::EFlagNoMatches)) |
|
15205 { |
|
15206 if(PreviousChar() == 0x003F && aCode != EKeyBackspace) |
|
15207 { |
|
15208 RemovePreviousCharacterL(); |
|
15209 } |
|
15210 ClearFlag(CAknFepManager::EFlagNoMatches); |
|
15211 FepUI()->ExpireMultitapTimer(); |
|
15212 } |
|
15213 iPtiEngine->HandleCommandL(EPtiCommandBreakSyllable, NULL ); |
|
15214 } |
|
15215 #endif |
|
15216 if (IsFlagSet(EFlagInsideMultitapInlineEditingTransaction)) |
|
15217 { |
|
15218 FepUI()->ExpireMultitapTimer(); |
|
15219 |
|
15220 if (aCode == EKeyBackspace) |
|
15221 { |
|
15222 aResponse = EKeyWasNotConsumed; // let editor handle the move |
|
15223 } |
|
15224 else |
|
15225 { |
|
15226 aResponse = EKeyWasConsumed; |
|
15227 } |
|
15228 } |
|
15229 else |
|
15230 { |
|
15231 //selecting text |
|
15232 if (IsFlagSet(EFlagShiftKeyDepressed) || IsCcpuFlagSet(ECcpuStateCopy | ECcpuStateCut)) |
|
15233 { |
|
15234 if (iShiftKeypressMonitor->IsActive()) |
|
15235 { |
|
15236 ResetShiftKeyMonitorL(); //don't want edit menu |
|
15237 } |
|
15238 ClearFlag(EFlagQwertyShiftMode); |
|
15239 SimulateKeyEventL(EKeyF19); // Asyncronous case update |
|
15240 aResponse = EKeyWasNotConsumed; |
|
15241 return keyHandled; |
|
15242 } |
|
15243 |
|
15244 TCursorSelection currentEditorSelection; |
|
15245 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(currentEditorSelection); |
|
15246 |
|
15247 TWesternNaviEvent naviEvent = ENullNaviEvent; |
|
15248 |
|
15249 // Translate key code to internal navi-event |
|
15250 switch( aCode ) |
|
15251 { |
|
15252 case EKeyUpArrow: |
|
15253 naviEvent = EUpNaviEvent; |
|
15254 break; |
|
15255 case EKeyDownArrow: |
|
15256 naviEvent = EDownNaviEvent; |
|
15257 break; |
|
15258 case EKeyRightArrow: |
|
15259 naviEvent = ERightNaviEvent; |
|
15260 break; |
|
15261 case EKeyLeftArrow: |
|
15262 naviEvent = ELeftNaviEvent; |
|
15263 break; |
|
15264 default: // just leave it as NULL |
|
15265 break; |
|
15266 } |
|
15267 |
|
15268 if (currentEditorSelection.Length()) |
|
15269 { |
|
15270 // we have text selected - set cursor to start/end of current selection |
|
15271 TTmDocPosSpec newPos; |
|
15272 aResponse = NavigateFromSelectionL( currentEditorSelection, naviEvent, newPos ); |
|
15273 if ( aCode != EKeyBackspace && WesternPredictive() ) |
|
15274 { |
|
15275 if (CursorInsideWord()) |
|
15276 { |
|
15277 TBool rightToleftParagraph = IsRightToLeftParagraph(newPos); |
|
15278 if ( (rightToleftParagraph && naviEvent == ELeftNaviEvent) || |
|
15279 (!rightToleftParagraph && naviEvent == ERightNaviEvent) ) |
|
15280 { |
|
15281 MoveCursorToEndOfWordL(); |
|
15282 } |
|
15283 else |
|
15284 { |
|
15285 MoveCursorToStartOfWordL(); |
|
15286 } |
|
15287 } |
|
15288 |
|
15289 } |
|
15290 } |
|
15291 else if (!(EditorState()->Flags() & EAknEditorFlagNoLRNavigation)) |
|
15292 { |
|
15293 if ((naviEvent != ENullNaviEvent) && HandleLoopingInNaviEventL(naviEvent)) |
|
15294 { |
|
15295 aResponse=EKeyWasConsumed; |
|
15296 } |
|
15297 else |
|
15298 { |
|
15299 if (iMode == ELatin) |
|
15300 { |
|
15301 // normal operation of Down/Up scroll keypress action. |
|
15302 switch( aCode ) |
|
15303 { |
|
15304 case EKeyUpArrow: |
|
15305 case EKeyDownArrow: |
|
15306 SimulateKeyEventL(EKeyF22); |
|
15307 break; |
|
15308 case EKeyRightArrow: |
|
15309 case EKeyLeftArrow: |
|
15310 { |
|
15311 /*Hindi*/ |
|
15312 if( (TAknFepUiIndicInputManager :: IsIndicLangauge( |
|
15313 TLanguage(iLanguageCapabilities.iInputLanguageCode))) |
|
15314 && IsZWSCharacterPresent() ) |
|
15315 { |
|
15316 RemoveZWSCharacterL(EKeyLeftArrow); |
|
15317 } |
|
15318 } |
|
15319 break; |
|
15320 default: // nothing |
|
15321 break; |
|
15322 } |
|
15323 } |
|
15324 keyHandled = EFalse; |
|
15325 } |
|
15326 } |
|
15327 } |
|
15328 |
|
15329 return keyHandled; |
|
15330 } |
|
15331 |
|
15332 /** |
|
15333 * Routine handled navigation and also backspace events at "beginning" of document |
|
15334 * |
|
15335 */ |
|
15336 TBool CAknFepManager::HandleLoopingInNaviEventL(TWesternNaviEvent aNaviEvent) |
|
15337 { |
|
15338 TBool looping = EFalse; |
|
15339 TBool eventHandled = EFalse; |
|
15340 TTmDocPosSpec newCursorPos; |
|
15341 |
|
15342 // This routine may handle Left, Right and Backspace and nothing else |
|
15343 // Note that Up and Down cannot do any sort of document looping in FEP |
|
15344 if ( aNaviEvent != ELeftNaviEvent |
|
15345 && aNaviEvent != ERightNaviEvent |
|
15346 && aNaviEvent != EBackspaceEvent ) |
|
15347 return eventHandled; // not consumed |
|
15348 |
|
15349 TTmDocPosSpec pos = DocPos(); |
|
15350 TBool rightToLeftParagraph = IsRightToLeftParagraph(pos); |
|
15351 |
|
15352 TWesternNaviEvent incrementingNaviEvent = |
|
15353 rightToLeftParagraph ? ELeftNaviEvent : ERightNaviEvent; |
|
15354 TWesternNaviEvent decrementingNaviEvent = |
|
15355 rightToLeftParagraph ? ERightNaviEvent : ELeftNaviEvent; |
|
15356 |
|
15357 if (aNaviEvent == decrementingNaviEvent) |
|
15358 { |
|
15359 // Abandon early if we are not in the first line. |
|
15360 if ( InFirstLineAndFormatted( pos ) ) |
|
15361 { |
|
15362 TTmDocPosSpec startPos; |
|
15363 GetVisualDocStart( startPos ); |
|
15364 if( AtVisualStart( pos, startPos ) ) |
|
15365 { |
|
15366 TTmDocPosSpec endPos; |
|
15367 if ( !GetVisualDocEnd( endPos ) ) |
|
15368 { |
|
15369 // End of document is not formatted. Value returned is just pos at DocLength. |
|
15370 // So actually move the cursor there (this is guranteed to format the last line) |
|
15371 // and the end End position is found a 2nd time. |
|
15372 newCursorPos = endPos; |
|
15373 SetCursorPositionL( newCursorPos ); |
|
15374 GetVisualDocEnd( endPos ); |
|
15375 } |
|
15376 newCursorPos = endPos; |
|
15377 looping = ETrue; |
|
15378 } |
|
15379 } |
|
15380 } |
|
15381 else if (aNaviEvent == incrementingNaviEvent ) |
|
15382 { |
|
15383 if ( InLastLineAndFormatted( pos ) ) |
|
15384 { |
|
15385 TTmDocPosSpec endPos; |
|
15386 GetVisualDocEnd( endPos ); |
|
15387 if( AtVisualEnd( pos, endPos, |
|
15388 iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep() ) ) |
|
15389 { |
|
15390 TTmDocPosSpec startPos; |
|
15391 if ( !GetVisualDocStart( startPos ) ) |
|
15392 { |
|
15393 // Document was not formatted at docPos(0). So actually move the cursor |
|
15394 // to that line at least, and then ask for the start pos again. |
|
15395 newCursorPos = startPos; |
|
15396 SetCursorPositionL( newCursorPos ); |
|
15397 GetVisualDocStart( startPos ); |
|
15398 } |
|
15399 newCursorPos = startPos; |
|
15400 looping = ETrue; |
|
15401 } |
|
15402 } |
|
15403 } |
|
15404 else if ( aNaviEvent == EBackspaceEvent ) |
|
15405 { |
|
15406 // Deletion is always logical, so the condition is simply to test the logical pos. |
|
15407 if ( pos.iPos ==0 ) |
|
15408 { |
|
15409 eventHandled = ETrue; |
|
15410 } |
|
15411 } |
|
15412 |
|
15413 if (looping) |
|
15414 { |
|
15415 // This takes language issues into account, adjusting the cursor position: |
|
15416 AdjustPosSpecForInputLanguageAfterDocumentLoop( newCursorPos, aNaviEvent, |
|
15417 (aNaviEvent == incrementingNaviEvent) ); |
|
15418 SetCursorPositionL( newCursorPos ); |
|
15419 eventHandled = ETrue; |
|
15420 } |
|
15421 return eventHandled; |
|
15422 } |
|
15423 |
|
15424 void CAknFepManager::TransferFepStateToEditorL( TBool aFnLockSync ) |
|
15425 { |
|
15426 // If editor in Fnlock state, need to set actual input mode |
|
15427 // because, in case of qwerty keypad alphanumeric editor there is no numeric mode |
|
15428 // numeric mode handle as FnLock |
|
15429 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
15430 |
|
15431 if( aFnLockSync && iQwertyInputMode && iFnKeyManager && iFnKeyManager->FnKeyState()==CAknFepFnKeyManager::EFnKeyLock) |
|
15432 { |
|
15433 EditorState()->SetCurrentInputMode(EditorModeFromFepMode(ENumber)); |
|
15434 // Indicator should not be reset, if menu is displaying from editor. |
|
15435 if(!IsFlagSet(EFlagForegroundUIComponentVisible | EFlagMenuPaneVisible)) |
|
15436 iFnKeyManager->ClearFnKeyState(); |
|
15437 } |
|
15438 else |
|
15439 { |
|
15440 #endif |
|
15441 EditorState()->SetCurrentInputMode(EditorModeFromFepMode(iMode)); |
|
15442 |
|
15443 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
15444 } |
|
15445 if(iFnKeyManager && iFnKeyManager->FnKeyState()!=CAknFepFnKeyManager::EFnKeyLock) |
|
15446 iFnKeyManager->ClearFnKeyState(); |
|
15447 |
|
15448 #endif |
|
15449 |
|
15450 |
|
15451 if ((iMode == ELatin && iWesternPredictive && |
|
15452 IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
15453 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
15454 ||(IsLanguageSupportPrediction() && IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
15455 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
15456 ) |
|
15457 { |
|
15458 EditorState()->SetInlineEditSpan(iUncommittedText); |
|
15459 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
15460 if (IsFlagSet(CAknFepManager::EFlagNoMatches)) |
|
15461 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
15462 TryRemoveNoMatchesIndicatorL(); |
|
15463 UpdateCbaL(NULL); |
|
15464 } |
|
15465 else |
|
15466 { |
|
15467 EditorState()->SetInlineEditSpan(TCursorSelection(0,0)); |
|
15468 } |
|
15469 EditorState()->SetCurrentCaseWithNoInitialisation(iCaseMan->CurrentCase()); |
|
15470 if ( IsFlagSet( EFlagSupressAutoUpdate ) ) |
|
15471 { |
|
15472 EditorState()->SetFlags( EditorState()->Flags() | EFlagSupressAutoUpdate ); |
|
15473 } |
|
15474 else |
|
15475 { |
|
15476 EditorState()->SetFlags( EditorState()->Flags() & ~EFlagSupressAutoUpdate ); |
|
15477 } |
|
15478 SetQwertyModeToInputcapbility(); |
|
15479 } |
|
15480 |
|
15481 MAknFepManagerInterface* CAknFepManager::FepUI() const |
|
15482 { |
|
15483 #ifdef RD_SCALABLE_UI_V2 |
|
15484 if ( iFepFullyConstructed && ( iFepPluginManager->PluginInputMode() != EPluginInputModeNone ) ) |
|
15485 { |
|
15486 if (iFepPluginManager->PluginInputMode() == EPluginInputModeItut) |
|
15487 { |
|
15488 return iFepPluginManager->CurrentFepInputUI() ? |
|
15489 iFepPluginManager->CurrentFepInputUI() : iCurrentFepUI; |
|
15490 } |
|
15491 if ( iFepPluginManager->EnableITIOnFSQ() ) |
|
15492 { |
|
15493 return iCurrentFepUI; |
|
15494 } |
|
15495 return iFepPluginManager->CurrentPluginInputFepUI(); |
|
15496 } |
|
15497 #endif |
|
15498 return iCurrentFepUI; |
|
15499 } |
|
15500 |
|
15501 void CAknFepManager::LaunchLanguagesPopupListL(TBool aLaunchedByTouchWin) |
|
15502 { |
|
15503 #ifdef RD_SCALABLE_UI_V2 |
|
15504 if( iFepPluginManager->PluginInputMode() != EPluginInputModeNone && |
|
15505 iFepPluginManager->PluginInputMode() != EPluginInputModeItut |
|
15506 // Add this condition for correction of dim features on FSQ |
|
15507 && iFepPluginManager->PluginInputMode() != EPluginInputModeFSQ ) |
|
15508 { |
|
15509 iFepPluginManager->LaunchPenInputLanguageSelectionL(aLaunchedByTouchWin); |
|
15510 return; |
|
15511 } |
|
15512 #endif //RD_SCALABLE_UI_V2 |
|
15513 |
|
15514 CArrayFixFlat<TInt>* languages = |
|
15515 new( ELeave )CArrayFixFlat<TInt>( ELanguageArrayGranularity ); |
|
15516 CleanupStack::PushL( languages ); |
|
15517 iPtiEngine->GetAvailableLanguagesL( languages ); |
|
15518 |
|
15519 // Create a list of languages for the dialog |
|
15520 CDesCArrayFlat* languagesList = |
|
15521 new( ELeave )CDesCArrayFlat( ELanguageArrayGranularity ); |
|
15522 CleanupStack::PushL( languagesList ); |
|
15523 |
|
15524 // Item format should be "<icon_index>\t<item_text>" |
|
15525 _LIT( KIconIndexSelected, "0\t" ); |
|
15526 _LIT( KIconIndexNotSelected, "\t" );// No icon |
|
15527 |
|
15528 MPtiLanguage* lang = NULL; |
|
15529 TInt currentLanguage = iSharedDataInterface->InputTextLanguage(); |
|
15530 TInt selectedLanguageIndex = 0; |
|
15531 |
|
15532 for (TInt ii=0; ii < languages->Count(); ii++) |
|
15533 { |
|
15534 lang = iPtiEngine->GetLanguage( ( *languages )[ii] ); |
|
15535 if (!lang) |
|
15536 { |
|
15537 User::Leave( KErrCorrupt ); |
|
15538 } |
|
15539 // Buffer should contain both tabulator string and localized name: |
|
15540 HBufC* langStrBuf = HBufC::NewL( lang->LocalizedName().Length() + 3 ); |
|
15541 CleanupStack::PushL( langStrBuf ); |
|
15542 |
|
15543 TPtr langStrPtr = langStrBuf->Des(); |
|
15544 |
|
15545 // If language is current language - use selected icon in lbx: |
|
15546 if( lang->LanguageCode() == currentLanguage ) |
|
15547 { |
|
15548 langStrPtr.Append( KIconIndexSelected ); |
|
15549 selectedLanguageIndex = ii; |
|
15550 } |
|
15551 else |
|
15552 { |
|
15553 langStrPtr.Append( KIconIndexNotSelected ); |
|
15554 } |
|
15555 langStrPtr.Append( lang->LocalizedName() ); |
|
15556 languagesList->AppendL( langStrPtr ); |
|
15557 CleanupStack::PopAndDestroy( langStrBuf ); |
|
15558 } |
|
15559 |
|
15560 // Add icons to the listbox: |
|
15561 CArrayPtr<CGulIcon>* icons = new( ELeave ) CArrayPtrFlat<CGulIcon>(10); |
|
15562 CleanupStack::PushL( icons ); |
|
15563 LoadIconL( icons, EMbmAvkonQgn_prop_sub_current, |
|
15564 EMbmAvkonQgn_prop_sub_current_mask ); |
|
15565 |
|
15566 TInt index = 0; |
|
15567 SetFlag( EFlagForegroundUIComponentVisible ); |
|
15568 CleanupStack::Pop( icons ); // iUiInterface->LaunchListPopupL takes ownership immediately |
|
15569 #ifdef RD_SCALABLE_UI_V2 |
|
15570 /* tp teleca fix 17.9.2009 to IKIM-7VK8GG*/ |
|
15571 /*if( iFepFullyConstructed && iFepPluginManager) |
|
15572 { |
|
15573 iFepPluginManager->SetMenuState(); |
|
15574 }*/ |
|
15575 // tp teleca fix end |
|
15576 #endif |
|
15577 // Fire up the dialog |
|
15578 #ifdef RD_SCALABLE_UI_V2 |
|
15579 iCancelPopupInQwerty = aLaunchedByTouchWin; |
|
15580 #endif //RD_SCALABLE_UI_V2 |
|
15581 TUid fepUid = CCoeEnv::Static()->FepUid(); |
|
15582 ClearExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
15583 TInt returnValue = iUiInterface->LaunchListPopupL(R_AVKON_T9_LANGUAGES_QUERY, index, |
|
15584 selectedLanguageIndex, languagesList, icons); |
|
15585 #ifdef RD_SCALABLE_UI_V2 |
|
15586 iCancelPopupInQwerty = EFalse; |
|
15587 #endif //RD_SCALABLE_UI_V2 |
|
15588 PrepareFepAfterDialogExitL(fepUid); |
|
15589 CleanupStack::PopAndDestroy( languagesList ); |
|
15590 |
|
15591 if(returnValue == EAknSoftkeyOk) |
|
15592 { |
|
15593 // Selected item index from the languages array |
|
15594 HandleChangeInFocusL(); |
|
15595 |
|
15596 // The user has changed language and the local language is not used any more. |
|
15597 iLanguageCapabilities.iLocalInputLanguageInUse = EFalse; |
|
15598 if (EditorState()) |
|
15599 { |
|
15600 EditorState()->SetLocalLanguage( ELangTest ); |
|
15601 } |
|
15602 |
|
15603 TBool westernPredictiveInUse = WesternPredictive(); |
|
15604 |
|
15605 // Truncate autocompletion portion on change of writing language |
|
15606 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
15607 RemoveSuggestedAdvanceCompletionL(); |
|
15608 #endif // RD_INTELLIGENT_TEXT_INPUT |
|
15609 //Hindi Change Bug Fix |
|
15610 iSharedDataInterface->SetInputTextLanguage(languages->At(index)); |
|
15611 CAknEnv::Static()->SettingCache().Update(KEikInputLanguageChange); |
|
15612 ChangeInputLanguageL(languages->At(index)); |
|
15613 SetFlag( EFlagNewSharedDataInputLanguage | EFlagNewSharedDataInputMode ); |
|
15614 // This pice of code TSW Fute error fixing. |
|
15615 // Display the confirmation msg if the dictionary is not available for |
|
15616 // Current language. |
|
15617 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
15618 // Display the confirmation msg only for Western languages |
|
15619 if (!IsChineseInputLanguage()) |
|
15620 { |
|
15621 if (!IsLanguageSupportPrediction()) |
|
15622 { |
|
15623 LaunchConfirmationNoteL(R_AVKON_T9_NOTE_NO_AVAILABLE); |
|
15624 } |
|
15625 } |
|
15626 #endif |
|
15627 |
|
15628 |
|
15629 } |
|
15630 CleanupStack::PopAndDestroy( languages ); |
|
15631 } |
|
15632 |
|
15633 void CAknFepManager::LaunchRecognitionWithDictionaryPopupListL() |
|
15634 { |
|
15635 #ifdef RD_SCALABLE_UI_V2 |
|
15636 if( iFepPluginManager && (iFepPluginManager->PluginInputMode() == EPluginInputModeHwr) ) |
|
15637 { |
|
15638 iFepPluginManager->LaunchPenInputRecognitionWithDictionarySelectionL(); |
|
15639 return; |
|
15640 } |
|
15641 #endif //RD_SCALABLE_UI_V2 |
|
15642 } |
|
15643 |
|
15644 void CAknFepManager::LoadIconL( CArrayPtr<CGulIcon>* aIcons, |
|
15645 TInt aBitmapId, |
|
15646 TInt aMaskId ) |
|
15647 { |
|
15648 CGulIcon* icon = CGulIcon::NewLC(); |
|
15649 CFbsBitmap* bitmap = 0; |
|
15650 CFbsBitmap* mask = 0; |
|
15651 AknIconUtils::CreateIconL( bitmap, mask, KAvkonBitmapFile, aBitmapId, aMaskId ); |
|
15652 icon->SetBitmap( bitmap ); |
|
15653 icon->SetMask( mask ); |
|
15654 aIcons->AppendL( icon ); |
|
15655 CleanupStack::Pop( icon ); |
|
15656 } |
|
15657 |
|
15658 |
|
15659 TBool CAknFepManager::IsInputModeAvailable(TInt aMode) const |
|
15660 { |
|
15661 TBool isAvailable = ETrue; |
|
15662 const TInt inputLanguage = iLanguageCapabilities.iInputLanguageCode; |
|
15663 switch (aMode) |
|
15664 { |
|
15665 case ELatin: |
|
15666 isAvailable = !( ( inputLanguage == ELangPrcChinese ) && |
|
15667 (iAknEditorFlags & EAknEditorFlagForceTransparentFepModes)); |
|
15668 break; |
|
15669 case EPinyin: |
|
15670 isAvailable = ( inputLanguage == ELangPrcChinese ); |
|
15671 break; |
|
15672 case EStroke: |
|
15673 isAvailable = ( inputLanguage == ELangPrcChinese || |
|
15674 inputLanguage == ELangHongKongChinese || |
|
15675 inputLanguage == ELangTaiwanChinese); |
|
15676 break; |
|
15677 case ECangJie: |
|
15678 { |
|
15679 isAvailable = ( ( inputLanguage == ELangHongKongChinese ) && |
|
15680 iQwertyInputMode ); |
|
15681 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
15682 #ifdef __HALF_QWERTY_KEYPAD |
|
15683 isAvailable = isAvailable && (EPtiKeyboardHalfQwerty != KeyboardLayout()); |
|
15684 #endif //__HALF_QWERTY_KEYPAD |
|
15685 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
15686 } |
|
15687 |
|
15688 break; |
|
15689 case EZhuyin: |
|
15690 isAvailable = ( inputLanguage == ELangTaiwanChinese ); |
|
15691 break; |
|
15692 case EPRCFind: |
|
15693 isAvailable = ( ( inputLanguage == ELangPrcChinese ) && |
|
15694 (iAknEditorFlags & EAknEditorFlagForceTransparentFepModes)); |
|
15695 break; |
|
15696 case EZhuyinFind: |
|
15697 isAvailable = ( ( inputLanguage == ELangTaiwanChinese ) && |
|
15698 (iAknEditorFlags & EAknEditorFlagForceTransparentFepModes)); |
|
15699 break; |
|
15700 case EStrokeFind: |
|
15701 isAvailable = ( ( inputLanguage == ELangHongKongChinese ) && |
|
15702 (iAknEditorFlags & EAknEditorFlagForceTransparentFepModes)); |
|
15703 break; |
|
15704 case EHiraganaKanji: |
|
15705 isAvailable = (inputLanguage == ELangJapanese); |
|
15706 break; |
|
15707 case EKatakana: |
|
15708 isAvailable = (inputLanguage == ELangJapanese ); |
|
15709 break; |
|
15710 case EHindi: |
|
15711 isAvailable = (inputLanguage == ELangHindi ); |
|
15712 break; |
|
15713 case EHangul: |
|
15714 isAvailable = (inputLanguage == ELangKorean ); |
|
15715 break; |
|
15716 case ENativeNumber: |
|
15717 isAvailable = (inputLanguage == ELangHindi |
|
15718 || inputLanguage == ELangArabic |
|
15719 || inputLanguage == ELangUrdu |
|
15720 || inputLanguage == ELangFarsi/* |
|
15721 || ( inputLanguage == ELangThai && iFepPluginManager && |
|
15722 iFepPluginManager->PluginInputMode() != EPluginInputModeItut && |
|
15723 iFepPluginManager->PluginInputMode() != EPluginInputModeNone)*/ ); |
|
15724 default: |
|
15725 break; |
|
15726 } |
|
15727 return isAvailable; |
|
15728 } |
|
15729 |
|
15730 TInt CAknFepManager::NewInputModeAfterLanguageChange() const |
|
15731 { |
|
15732 TInt inputMode = 0; |
|
15733 switch (iLanguageCapabilities.iInputLanguageCode) |
|
15734 { |
|
15735 case ELangPrcChinese: |
|
15736 if ( iAknEditorFlags & EAknEditorFlagForceTransparentFepModes ) |
|
15737 { |
|
15738 inputMode = ELatin; // EPRCFind from hashkey loop |
|
15739 } |
|
15740 else |
|
15741 { |
|
15742 inputMode = EPinyin; |
|
15743 } |
|
15744 break; |
|
15745 case ELangHongKongChinese: |
|
15746 if ( iAknEditorFlags & EAknEditorFlagForceTransparentFepModes ) |
|
15747 { |
|
15748 inputMode = EStrokeFind; |
|
15749 } |
|
15750 else |
|
15751 { |
|
15752 TInt sharedDataMode = iSharedDataInterface->InputMode(); |
|
15753 if (iQwertyInputMode && |
|
15754 sharedDataMode == ECangJie) |
|
15755 { |
|
15756 inputMode = ECangJie; |
|
15757 } |
|
15758 else |
|
15759 { |
|
15760 inputMode = EStroke; |
|
15761 } |
|
15762 } |
|
15763 break; |
|
15764 case ELangTaiwanChinese: |
|
15765 if ( iAknEditorFlags & EAknEditorFlagForceTransparentFepModes ) |
|
15766 { |
|
15767 inputMode = EZhuyinFind; |
|
15768 } |
|
15769 else |
|
15770 { |
|
15771 inputMode = EZhuyin; |
|
15772 } |
|
15773 break; |
|
15774 case ELangJapanese: |
|
15775 inputMode = EHiraganaKanji; |
|
15776 break; |
|
15777 case ELangKorean: |
|
15778 inputMode = EHangul; |
|
15779 break; |
|
15780 default: |
|
15781 inputMode = ELatin; |
|
15782 break; |
|
15783 } |
|
15784 return inputMode; |
|
15785 } |
|
15786 |
|
15787 void CAknFepManager::SetInputLanguageCapabilities(const TInt aInputLanguage) |
|
15788 { |
|
15789 iLanguageCapabilities.iInputLanguageCode = aInputLanguage; |
|
15790 |
|
15791 if ( aInputLanguage == ELangArabic || aInputLanguage == ELangHebrew || |
|
15792 aInputLanguage == ELangFarsi || aInputLanguage == ELangUrdu ) |
|
15793 { |
|
15794 iLanguageCapabilities.iSupportsCase = EFalse; |
|
15795 iLanguageCapabilities.iRightToLeftLanguage = ETrue; |
|
15796 SetCursorTypeForInputDirection(EFalse); |
|
15797 } |
|
15798 else |
|
15799 { |
|
15800 /*Hindi*/ |
|
15801 if ( aInputLanguage == ELangThai |
|
15802 || (TAknFepUiIndicInputManager :: IsIndicLangauge(TLanguage(aInputLanguage))) |
|
15803 ) |
|
15804 { |
|
15805 iLanguageCapabilities.iSupportsCase = EFalse; |
|
15806 } |
|
15807 else |
|
15808 { |
|
15809 iLanguageCapabilities.iSupportsCase = ETrue; |
|
15810 } |
|
15811 iLanguageCapabilities.iRightToLeftLanguage = EFalse; |
|
15812 SetCursorTypeForInputDirection(ETrue); |
|
15813 } |
|
15814 |
|
15815 TLanguage uiLanguage = User::Language(); |
|
15816 iLanguageCapabilities.iArabicIndicDigitsAllowed = |
|
15817 ( aInputLanguage == ELangArabic || uiLanguage == ELangArabic); |
|
15818 iLanguageCapabilities.iEasternArabicIndicDigitsAllowed = ( |
|
15819 ( aInputLanguage == ELangUrdu || uiLanguage == ELangUrdu ) || |
|
15820 ( aInputLanguage == ELangFarsi|| uiLanguage == ELangFarsi ) ); |
|
15821 /*Hindi*/ |
|
15822 iLanguageCapabilities.iIndicDigitsAllowed = |
|
15823 ( (TAknFepUiIndicInputManager :: IsIndicDigitsSupported(TLanguage(aInputLanguage))) ); |
|
15824 UpdateLocalDigitMode(); |
|
15825 |
|
15826 MAknFepManagerInterface* fepUI = iLangMan->GetFepUI(ELatin, iCharWidth, ETrue); |
|
15827 MPtiLanguage* ptiLanguage = iPtiEngine->GetLanguage(fepUI->SupportLanguage(ELatin)); |
|
15828 if (ptiLanguage) // can be NULL in some uncommon situations, see TAVN-6SWB4Z |
|
15829 { |
|
15830 iLanguageCapabilities.iSupportsWesternPredictive = |
|
15831 ptiLanguage->HasInputMode(EPtiEnginePredictive); |
|
15832 // tp teleca change Korean lang does not support predictive |
|
15833 // and we want to disable predictive even with local editors |
|
15834 if(/*IsKoreanInputLanguage()*/GetInputLanguageFromSharedDataInterface() == ELangKorean ) |
|
15835 { |
|
15836 iLanguageCapabilities.iSupportsWesternPredictive = EFalse; |
|
15837 } |
|
15838 |
|
15839 |
|
15840 // tp teleca change end |
|
15841 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
15842 // Predictive QWERTY (XT9) changes ----> |
|
15843 iLanguageCapabilities.iSupportsWesternQwertyPredictive = |
|
15844 ptiLanguage->HasInputMode(EPtiEngineQwertyPredictive ); |
|
15845 if ( GetInputLanguageFromSharedDataInterface() == ELangKorean ) |
|
15846 { |
|
15847 iLanguageCapabilities.iSupportsWesternQwertyPredictive = EFalse; |
|
15848 } |
|
15849 |
|
15850 // Predictive QWERTY (XT9) changes <---- |
|
15851 #ifdef __HALF_QWERTY_KEYPAD |
|
15852 iLanguageCapabilities.iSupportsWesternHalfQwertyPredictive = ptiLanguage->HasInputMode(EPtiEngineHalfQwertyPredictive ); |
|
15853 #endif |
|
15854 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
15855 } |
|
15856 |
|
15857 if (!iLanguageCapabilities.iSupportsWesternPredictive |
|
15858 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
15859 && !iLanguageCapabilities.iSupportsWesternQwertyPredictive |
|
15860 // Predictive QWERTY changes |
|
15861 #ifdef __HALF_QWERTY_KEYPAD |
|
15862 && !iLanguageCapabilities.iSupportsWesternHalfQwertyPredictive |
|
15863 #endif //__HALF_QWERTY_KEYPAD |
|
15864 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
15865 ) // Predictive QWERTY changes |
|
15866 { |
|
15867 SetWesternPredictive(EFalse); |
|
15868 } |
|
15869 } |
|
15870 |
|
15871 TInt CAknFepManager::SubstituteSublanguageId(const TInt aUiLanguage) const |
|
15872 { |
|
15873 return DefaultInputLanguageFromUILanguage(aUiLanguage); |
|
15874 } |
|
15875 |
|
15876 TTmDocPosSpec CAknFepManager::DocPos() |
|
15877 { |
|
15878 TTmDocPosSpec docPos = TTmDocPosSpec(); |
|
15879 TTmDocPos rawDocPos; |
|
15880 TBool gotPos = EFalse; |
|
15881 MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
15882 if (docNavi) |
|
15883 { |
|
15884 docNavi->GetDocPos(rawDocPos); |
|
15885 gotPos = ETrue; |
|
15886 } |
|
15887 else |
|
15888 { |
|
15889 CTextView* textView = TextView(); |
|
15890 if (textView) |
|
15891 { |
|
15892 TextView()->GetCursorPos(rawDocPos); |
|
15893 gotPos = ETrue; |
|
15894 } |
|
15895 } |
|
15896 if (gotPos) |
|
15897 { |
|
15898 docPos.iPos = rawDocPos.iPos; |
|
15899 TTmDocPosSpec::TType docPosType = |
|
15900 rawDocPos.iLeadingEdge ? TTmDocPosSpec::ELeading : TTmDocPosSpec::ETrailing; |
|
15901 docPos.iType = docPosType; |
|
15902 } |
|
15903 return docPos; |
|
15904 } |
|
15905 |
|
15906 /** |
|
15907 * This method needs EditorState() to exist |
|
15908 * |
|
15909 */ |
|
15910 CTextView* CAknFepManager::TextView() const |
|
15911 { |
|
15912 if (EditorState()) |
|
15913 { |
|
15914 CAknEdwinFormAccessor* formAccessor = EditorState()->FormAccessor(); |
|
15915 if (formAccessor) |
|
15916 { |
|
15917 return formAccessor->GetTextView(); |
|
15918 } |
|
15919 } |
|
15920 return NULL; |
|
15921 } |
|
15922 |
|
15923 CTextLayout* CAknFepManager::TextLayout() const |
|
15924 { |
|
15925 if( EditorState() ) |
|
15926 { |
|
15927 CAknEdwinFormAccessor* formAccessor = EditorState()->FormAccessor(); |
|
15928 if (formAccessor) |
|
15929 { |
|
15930 return formAccessor->GetTextLayout(); |
|
15931 } |
|
15932 } |
|
15933 return NULL; |
|
15934 } |
|
15935 |
|
15936 CPlainText* CAknFepManager::PlainText() const |
|
15937 { |
|
15938 return iUiInterface->PlainText(EditorState()); |
|
15939 } |
|
15940 |
|
15941 /** |
|
15942 * Checks if the paragraph containing aPos is Right to left. |
|
15943 * This routine will return nonsense if |
|
15944 * - TextLayout() does not return a pointer |
|
15945 * - the position passed is not in the formatted region |
|
15946 * |
|
15947 * Note, the return value from FindDocPos is thrown away |
|
15948 */ |
|
15949 TBool CAknFepManager::IsRightToLeftParagraph(TTmDocPosSpec aPos) const |
|
15950 { |
|
15951 TTmPosInfo2 posInfo; |
|
15952 TTmLineInfo lineInfo; |
|
15953 MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
15954 if (docNavi) |
|
15955 { |
|
15956 docNavi->FindDocPos(aPos, posInfo, lineInfo); |
|
15957 } |
|
15958 else |
|
15959 { |
|
15960 CTextLayout* textLayout = TextLayout(); |
|
15961 if (textLayout) |
|
15962 { |
|
15963 textLayout->TagmaTextLayout().FindDocPos(aPos, posInfo, lineInfo); |
|
15964 } |
|
15965 } |
|
15966 |
|
15967 return lineInfo.iFlags & TTmLineInfo::EParRightToLeft; |
|
15968 } |
|
15969 |
|
15970 |
|
15971 void CAknFepManager::FindAdjacentChunks(const TTmDocPosSpec& aPos, |
|
15972 CTmTextLayout::TTmChunkDescription& aLeft, |
|
15973 CTmTextLayout::TTmChunkDescription& aRight) const |
|
15974 { |
|
15975 aLeft.iStart = -1; |
|
15976 aLeft.iEnd = -1; |
|
15977 aLeft.iRightToLeft = EFalse; |
|
15978 aRight.iStart = -1; |
|
15979 aRight.iEnd = -1; |
|
15980 aRight.iRightToLeft = EFalse; |
|
15981 |
|
15982 MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
15983 if (docNavi) |
|
15984 { |
|
15985 docNavi->FindAdjacentChunks(aPos, aLeft, aRight); |
|
15986 } |
|
15987 else |
|
15988 { |
|
15989 CTextLayout* textLayout = TextLayout(); |
|
15990 if (textLayout) |
|
15991 { |
|
15992 textLayout->TagmaTextLayout().FindAdjacentChunks(aPos, aLeft, aRight); |
|
15993 } |
|
15994 } |
|
15995 } |
|
15996 |
|
15997 |
|
15998 TBool CAknFepManager::GetNextVisualRightCharacter( TInt& aPosition ) |
|
15999 { |
|
16000 TTmDocPosSpec pos = DocPos(); |
|
16001 TTmPosInfo2 info; |
|
16002 TBool nextPositionFound = EFalse; |
|
16003 MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
16004 if (docNavi) |
|
16005 { |
|
16006 nextPositionFound = docNavi->GetNextVisualCursorPos(pos, info, EFalse); |
|
16007 } |
|
16008 else |
|
16009 { |
|
16010 CTextLayout* textLayout = TextLayout(); |
|
16011 if (textLayout) |
|
16012 { |
|
16013 nextPositionFound = textLayout->TagmaTextLayout().GetNextVisualCursorPos(pos, |
|
16014 info, |
|
16015 EFalse); |
|
16016 } |
|
16017 } |
|
16018 if (nextPositionFound) |
|
16019 { |
|
16020 aPosition = info.iDocPos.iPos; |
|
16021 |
|
16022 CTmTextLayout::TTmChunkDescription leftChunk; |
|
16023 CTmTextLayout::TTmChunkDescription rightChunk; |
|
16024 FindAdjacentChunks(pos, leftChunk, rightChunk); |
|
16025 |
|
16026 if ( !rightChunk.iRightToLeft ) |
|
16027 { |
|
16028 aPosition -= 1; |
|
16029 } |
|
16030 } |
|
16031 return nextPositionFound; |
|
16032 } |
|
16033 |
|
16034 TBool CAknFepManager::GetNextVisualLeftCharacter( TInt& aPosition ) |
|
16035 { |
|
16036 TTmDocPosSpec pos = DocPos(); |
|
16037 TTmPosInfo2 info; |
|
16038 TBool nextPositionFound = EFalse; |
|
16039 MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
16040 if (docNavi) |
|
16041 { |
|
16042 nextPositionFound = docNavi->GetNextVisualCursorPos(pos, info, ETrue); |
|
16043 } |
|
16044 else |
|
16045 { |
|
16046 CTextLayout* textLayout = TextLayout(); |
|
16047 if (textLayout) |
|
16048 { |
|
16049 nextPositionFound = TextLayout()->TagmaTextLayout().GetNextVisualCursorPos(pos, |
|
16050 info, |
|
16051 ETrue); |
|
16052 } |
|
16053 } |
|
16054 if (nextPositionFound) |
|
16055 { |
|
16056 aPosition = info.iDocPos.iPos; |
|
16057 CTmTextLayout::TTmChunkDescription leftChunk; |
|
16058 CTmTextLayout::TTmChunkDescription rightChunk; |
|
16059 FindAdjacentChunks(pos, leftChunk, rightChunk); |
|
16060 |
|
16061 if ( leftChunk.iRightToLeft ) |
|
16062 { |
|
16063 aPosition -= 1; |
|
16064 } |
|
16065 if (iLanguageCapabilities.iInputLanguageCode == ELangVietnamese) |
|
16066 { |
|
16067 aPosition = pos.iPos -1; |
|
16068 } |
|
16069 } |
|
16070 return nextPositionFound; |
|
16071 } |
|
16072 |
|
16073 void CAknFepManager::FindVisualRightOfWord(TInt& aPosition) |
|
16074 { |
|
16075 TTmDocPosSpec pos = DocPos(); |
|
16076 CTmTextLayout::TTmChunkDescription leftChunk; |
|
16077 CTmTextLayout::TTmChunkDescription rightChunk; |
|
16078 FindAdjacentChunks(pos, leftChunk, rightChunk); |
|
16079 |
|
16080 if ( rightChunk.iRightToLeft ) |
|
16081 { |
|
16082 FindStartOfWord(aPosition); |
|
16083 } |
|
16084 else |
|
16085 { |
|
16086 FindEndOfWord(aPosition); |
|
16087 } |
|
16088 } |
|
16089 |
|
16090 void CAknFepManager::FindVisualLeftOfWord(TInt& aPosition) |
|
16091 { |
|
16092 TTmDocPosSpec pos = DocPos(); |
|
16093 CTmTextLayout::TTmChunkDescription leftChunk; |
|
16094 CTmTextLayout::TTmChunkDescription rightChunk; |
|
16095 FindAdjacentChunks(pos, leftChunk, rightChunk); |
|
16096 |
|
16097 if ( leftChunk.iRightToLeft) |
|
16098 { |
|
16099 FindEndOfWord(aPosition); |
|
16100 } |
|
16101 else |
|
16102 { |
|
16103 FindStartOfWord(aPosition); |
|
16104 } |
|
16105 } |
|
16106 |
|
16107 |
|
16108 |
|
16109 TBool CAknFepManager::GetVisualDocStart( TTmDocPosSpec& aPos) const |
|
16110 { |
|
16111 // Set up the initial try as leading to the first logical character |
|
16112 // It is a requirement that this position is at least in the first line |
|
16113 TTmDocPosSpec pos(0, TTmDocPosSpec::ELeading); |
|
16114 |
|
16115 // Need to record if we are in aleft to right paragraph or not |
|
16116 TBool leftToRightParagraph = !IsRightToLeftParagraph(pos); |
|
16117 |
|
16118 TBool success(EFalse); |
|
16119 CTextLayout* textLayout = TextLayout(); |
|
16120 TTmDocPosSpec docPos; |
|
16121 if (AknFepDocumentNavigation() || textLayout) |
|
16122 { |
|
16123 // This was written because Tagma's LineExtreme() method did not seem to work |
|
16124 success = GetAknFepLineExtreme( pos, !leftToRightParagraph, docPos ); |
|
16125 } |
|
16126 |
|
16127 if (success) |
|
16128 aPos = docPos; |
|
16129 else // Possible cleanup; action for when there is insufficient information |
|
16130 { |
|
16131 aPos.iPos = 0; |
|
16132 aPos.iType = TTmDocPosSpec::ELeading; |
|
16133 } |
|
16134 |
|
16135 return success; |
|
16136 } |
|
16137 |
|
16138 TBool CAknFepManager::GetVisualDocEnd( TTmDocPosSpec& aPos) const |
|
16139 { |
|
16140 TInt docLength = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
16141 |
|
16142 // Set up the initial try as trailing after the last logical character |
|
16143 // It is a requirement that this position is at least in the last line |
|
16144 TTmDocPosSpec pos(docLength, TTmDocPosSpec::ETrailing); |
|
16145 |
|
16146 // Need to record if we are in a left to right paragraph or not |
|
16147 TBool leftToRightParagraph = !IsRightToLeftParagraph(pos); |
|
16148 |
|
16149 TBool success(EFalse); |
|
16150 CTextLayout* textLayout = TextLayout(); |
|
16151 TTmDocPosSpec docPos; |
|
16152 if (AknFepDocumentNavigation() || textLayout) |
|
16153 { |
|
16154 // This was written because Tagma's LineExtreme() method did not seem to work |
|
16155 success = GetAknFepLineExtreme( pos, leftToRightParagraph, docPos ); |
|
16156 } |
|
16157 |
|
16158 if (success) |
|
16159 aPos = docPos; |
|
16160 else // Possible cleanup; action for when there is insufficient information |
|
16161 { |
|
16162 aPos.iPos = docLength; |
|
16163 aPos.iType = TTmDocPosSpec::ETrailing; |
|
16164 } |
|
16165 return success; |
|
16166 } |
|
16167 |
|
16168 |
|
16169 TBool CAknFepManager::GetAknFepLineExtreme( const TTmDocPosSpec& aPos, TBool aToRight, |
|
16170 TTmDocPosSpec& aExtreme) const |
|
16171 { |
|
16172 TBool success(EFalse); |
|
16173 |
|
16174 TTmPosInfo2 posInfo; |
|
16175 TTmLineInfo lineInfo; |
|
16176 TBool found = EFalse; |
|
16177 MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
16178 if (docNavi) |
|
16179 { |
|
16180 found = docNavi->FindDocPos(aPos, posInfo, lineInfo); |
|
16181 } |
|
16182 else |
|
16183 { |
|
16184 CTextLayout* textLayout = TextLayout(); |
|
16185 if ( textLayout ) |
|
16186 { |
|
16187 found = textLayout->TagmaTextLayout().FindDocPos(aPos, posInfo, lineInfo); |
|
16188 } |
|
16189 } |
|
16190 |
|
16191 if ( found ) |
|
16192 { |
|
16193 // Make a selection of the line info. Cursor first, Anchar 2nd: |
|
16194 TCursorSelection theWholeLine( lineInfo.iEnd-1, lineInfo.iStart ); |
|
16195 |
|
16196 TWesternNaviEvent event; |
|
16197 if ( aToRight ) |
|
16198 event = ERightNaviEvent; |
|
16199 else |
|
16200 event = ELeftNaviEvent; |
|
16201 |
|
16202 GetAvkonDefinedVisualLimitsOfSelection( theWholeLine, event, aExtreme, NULL ); |
|
16203 success = ETrue; |
|
16204 } |
|
16205 |
|
16206 return success; |
|
16207 } |
|
16208 |
|
16209 |
|
16210 /** |
|
16211 * This routine analyses a selection (Does not have to be a real selection, but the datastructure |
|
16212 * is used as input) to find its visual start or end, according to the passed parameter |
|
16213 * The algo used is: |
|
16214 * - First find the top line of the selection. |
|
16215 * - Then find the bottom line of the selection. |
|
16216 * - Look at the two lines' directionality (from the paragraph they belong to) and decide what the overall |
|
16217 * directionality of the selection is. Thus right/left can be translated to increment/decrement. |
|
16218 * (Note that Up is always decrement; down is always increment). So that allows the key actions to be |
|
16219 * correctly grouped, and allows it to be determined which keys act from the top or the bottom line |
|
16220 * (Decrement always acts from the top line; Increment always acts from the bottom line) |
|
16221 * |
|
16222 * - When the keys are handled, the action is again translated back to right/left according to the key- |
|
16223 * grouping and whether you are acting from the top line or from the bottom line. Eg, decrement in RTL |
|
16224 * line is visually to the Right. |
|
16225 * - the appropriate "ExtremePos" API is called passing in the position on the line in which we are acting |
|
16226 * |
|
16227 */ |
|
16228 void CAknFepManager::GetAvkonDefinedVisualLimitsOfSelection( |
|
16229 const TCursorSelection& aSelection, |
|
16230 TWesternNaviEvent aEvent, |
|
16231 TTmDocPosSpec& aLimitPos, |
|
16232 TWesternNaviEvent* aEffectiveRightOrLeftEvent ) const |
|
16233 { |
|
16234 // in case an irrelvant event is sent, initialize aLimitPos to something safe |
|
16235 aLimitPos.iPos = 0; |
|
16236 aLimitPos.iType = TTmDocPosSpec::ELeading; |
|
16237 |
|
16238 TTmDocPosSpec lowLogicalPos( aSelection.LowerPos(), TTmDocPosSpec::ELeading ); |
|
16239 TTmDocPosSpec highLogicalPos( aSelection.HigherPos(), TTmDocPosSpec::ETrailing ); |
|
16240 |
|
16241 // this records what the resulting Right/left direction (for optional return) |
|
16242 TWesternNaviEvent effectiveEvent = aEvent; |
|
16243 |
|
16244 // Get line and paragraph of the lower limit of the selection: |
|
16245 TTmPosInfo2 posInfo; |
|
16246 TTmLineInfo lineInfo; |
|
16247 TBool lowIsRightToLeft; |
|
16248 TBool highIsRightToLeft; |
|
16249 TBool layoutExists = EFalse; |
|
16250 |
|
16251 MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
16252 if (docNavi) |
|
16253 { |
|
16254 docNavi->FindDocPos(lowLogicalPos, posInfo, lineInfo); |
|
16255 lowIsRightToLeft = lineInfo.iFlags & TTmLineInfo::EParRightToLeft; |
|
16256 docNavi->FindDocPos(highLogicalPos, posInfo, lineInfo); |
|
16257 highIsRightToLeft = lineInfo.iFlags & TTmLineInfo::EParRightToLeft; |
|
16258 layoutExists = ETrue; |
|
16259 } |
|
16260 else |
|
16261 { |
|
16262 CTextLayout* textLayout = TextLayout(); |
|
16263 if (textLayout) |
|
16264 { |
|
16265 textLayout->TagmaTextLayout().FindDocPos(lowLogicalPos, posInfo, lineInfo); |
|
16266 lowIsRightToLeft = lineInfo.iFlags & TTmLineInfo::EParRightToLeft; |
|
16267 textLayout->TagmaTextLayout().FindDocPos(highLogicalPos, posInfo, lineInfo); |
|
16268 highIsRightToLeft = lineInfo.iFlags & TTmLineInfo::EParRightToLeft; |
|
16269 layoutExists = ETrue; |
|
16270 } |
|
16271 } |
|
16272 |
|
16273 if (layoutExists) |
|
16274 { |
|
16275 // Decide on the net directionality. This if looks a bit laboured, but it |
|
16276 // exhibits the Averell policy. |
|
16277 TBool netDirectionIsRightToLeft(EFalse); |
|
16278 if ( lowIsRightToLeft == highIsRightToLeft ) |
|
16279 netDirectionIsRightToLeft = lowIsRightToLeft; |
|
16280 else |
|
16281 netDirectionIsRightToLeft = lowIsRightToLeft;// ambiguous - Take first paragraph |
|
16282 |
|
16283 if ( netDirectionIsRightToLeft ) |
|
16284 switch ( aEvent ) |
|
16285 { |
|
16286 case ELeftNaviEvent: |
|
16287 case EDownNaviEvent: |
|
16288 effectiveEvent = ELeftNaviEvent; |
|
16289 aLimitPos = LeftVisualExtremePos( highLogicalPos, lowLogicalPos.iPos, |
|
16290 highLogicalPos.iPos ); |
|
16291 break; |
|
16292 case ERightNaviEvent: |
|
16293 case EUpNaviEvent: |
|
16294 effectiveEvent = ERightNaviEvent; |
|
16295 aLimitPos = RightVisualExtremePos(lowLogicalPos, lowLogicalPos.iPos, |
|
16296 highLogicalPos.iPos ); |
|
16297 break; |
|
16298 default: |
|
16299 // No action. Only the events above are handled. |
|
16300 break; |
|
16301 } |
|
16302 else |
|
16303 switch (aEvent) |
|
16304 { |
|
16305 case ELeftNaviEvent: |
|
16306 case EUpNaviEvent: |
|
16307 effectiveEvent = ELeftNaviEvent; |
|
16308 aLimitPos = LeftVisualExtremePos( lowLogicalPos, lowLogicalPos.iPos, |
|
16309 highLogicalPos.iPos); |
|
16310 break; |
|
16311 case ERightNaviEvent: |
|
16312 case EDownNaviEvent: |
|
16313 effectiveEvent = ERightNaviEvent; |
|
16314 aLimitPos = RightVisualExtremePos( highLogicalPos, lowLogicalPos.iPos, |
|
16315 highLogicalPos.iPos ); |
|
16316 break; |
|
16317 default: |
|
16318 // No action. Only the events above are handled. |
|
16319 break; |
|
16320 } |
|
16321 } |
|
16322 |
|
16323 else |
|
16324 { |
|
16325 // No text layout: Left or Up naviEvent gives low end; Right or down give high end |
|
16326 switch ( aEvent ) |
|
16327 { |
|
16328 case ELeftNaviEvent: |
|
16329 case EUpNaviEvent: |
|
16330 effectiveEvent = ELeftNaviEvent; |
|
16331 aLimitPos = lowLogicalPos; |
|
16332 break; |
|
16333 case ERightNaviEvent: |
|
16334 case EDownNaviEvent: |
|
16335 effectiveEvent = ERightNaviEvent; |
|
16336 aLimitPos = highLogicalPos; |
|
16337 break; |
|
16338 default: |
|
16339 // No action. Only the events above are handled. |
|
16340 break; |
|
16341 } |
|
16342 } |
|
16343 // return the effective direction (Right or Left) |
|
16344 if ( aEffectiveRightOrLeftEvent ) |
|
16345 *aEffectiveRightOrLeftEvent = effectiveEvent; |
|
16346 |
|
16347 } |
|
16348 |
|
16349 |
|
16350 TTmDocPosSpec CAknFepManager::LeftVisualExtremePos( const TTmDocPosSpec& aStartPos, |
|
16351 TInt aMinPos, TInt aMaxPos ) const |
|
16352 { |
|
16353 // Start at start and find adjacent left chunks repeatedly until we find no more chunks, or our max or min |
|
16354 // is within a chunk |
|
16355 TTmDocPosSpec currentPos = aStartPos; |
|
16356 CTextLayout* textLayout = TextLayout(); |
|
16357 if (AknFepDocumentNavigation() || textLayout) |
|
16358 { |
|
16359 CTmTextLayout::TTmChunkDescription leftChunk; |
|
16360 CTmTextLayout::TTmChunkDescription rightChunk; |
|
16361 |
|
16362 TInt iterations(0); |
|
16363 TBool endFound(EFalse); |
|
16364 |
|
16365 while( !endFound && iterations < KMaxChunkWalkIterations ) |
|
16366 { |
|
16367 iterations++; |
|
16368 FindAdjacentChunks(currentPos, leftChunk, rightChunk); |
|
16369 // Try to move to left end of left chunk |
|
16370 endFound = LeftEndOfChunkWithinRange( leftChunk, aMinPos, aMaxPos, currentPos ); |
|
16371 } |
|
16372 } |
|
16373 return currentPos; |
|
16374 } |
|
16375 |
|
16376 TTmDocPosSpec CAknFepManager::RightVisualExtremePos( const TTmDocPosSpec& aStartPos, |
|
16377 TInt aMinPos, TInt aMaxPos ) const |
|
16378 { |
|
16379 // Start at start and find adjacent right chunks repeatedly until we find no more chunks, or our max or min |
|
16380 // is within a chunk |
|
16381 TTmDocPosSpec currentPos = aStartPos; |
|
16382 CTextLayout* textLayout = TextLayout(); |
|
16383 if (AknFepDocumentNavigation() || textLayout) |
|
16384 { |
|
16385 CTmTextLayout::TTmChunkDescription leftChunk; |
|
16386 CTmTextLayout::TTmChunkDescription rightChunk; |
|
16387 |
|
16388 TInt iterations(0); |
|
16389 TBool endFound(EFalse); |
|
16390 |
|
16391 while( !endFound && iterations < KMaxChunkWalkIterations ) |
|
16392 { |
|
16393 iterations++; |
|
16394 FindAdjacentChunks(currentPos, leftChunk, rightChunk); |
|
16395 // Try to move to left end of left chunk |
|
16396 endFound = RightEndOfChunkWithinRange( rightChunk, aMinPos, aMaxPos, currentPos ); |
|
16397 } |
|
16398 } |
|
16399 return currentPos; |
|
16400 } |
|
16401 |
|
16402 TBool CAknFepManager::LeftEndOfChunkWithinRange( const CTmTextLayout::TTmChunkDescription& aChunk, |
|
16403 TInt aMinPos, TInt aMaxPos, TTmDocPosSpec& aNewPos) const |
|
16404 { |
|
16405 TBool constrained = EFalse; |
|
16406 TInt leftEnd; |
|
16407 if ( !ChunkIsValid( aChunk ) ) |
|
16408 { |
|
16409 constrained = ETrue; // leave the aNewPos as it is |
|
16410 } |
|
16411 else if ( aChunk.iStart >= iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep() ) |
|
16412 { |
|
16413 constrained = ETrue; // That chunk was a ficticious one: |
|
16414 } |
|
16415 else if ( aChunk.iEnd <= aMinPos || aChunk.iStart >= aMaxPos ) |
|
16416 { |
|
16417 constrained = ETrue; // That chunk found does not actually overlap with valid range. Don't go there |
|
16418 } |
|
16419 else |
|
16420 { |
|
16421 if ( aChunk.iRightToLeft ) |
|
16422 { |
|
16423 leftEnd = aChunk.iEnd; |
|
16424 if ( leftEnd >= aMaxPos ) |
|
16425 { |
|
16426 constrained = ETrue; |
|
16427 aNewPos.iPos = aMaxPos; |
|
16428 } |
|
16429 else |
|
16430 { |
|
16431 aNewPos.iPos = leftEnd; |
|
16432 } |
|
16433 aNewPos.iType = TTmDocPosSpec::ETrailing; |
|
16434 } |
|
16435 else |
|
16436 { |
|
16437 leftEnd = aChunk.iStart; |
|
16438 if ( leftEnd <= aMinPos ) |
|
16439 { |
|
16440 constrained = ETrue; |
|
16441 aNewPos.iPos = aMinPos; |
|
16442 } |
|
16443 else |
|
16444 { |
|
16445 aNewPos.iPos = leftEnd; |
|
16446 } |
|
16447 aNewPos.iType = TTmDocPosSpec::ELeading; |
|
16448 } |
|
16449 } |
|
16450 return constrained; |
|
16451 } |
|
16452 |
|
16453 TBool CAknFepManager::RightEndOfChunkWithinRange( const CTmTextLayout::TTmChunkDescription& aChunk, |
|
16454 TInt aMinPos, TInt aMaxPos, TTmDocPosSpec& aNewPos) const |
|
16455 { |
|
16456 TBool constrained = EFalse; |
|
16457 TInt rightEnd; |
|
16458 if ( !ChunkIsValid( aChunk ) ) |
|
16459 { |
|
16460 constrained = ETrue; // leave the aNewPos as it is |
|
16461 } |
|
16462 else if ( aChunk.iStart >= iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep() ) |
|
16463 { |
|
16464 constrained = ETrue; // That chunk was a ficticious one: |
|
16465 } |
|
16466 else if ( aChunk.iEnd <= aMinPos || aChunk.iStart >= aMaxPos ) |
|
16467 { |
|
16468 constrained = ETrue; // That chunk found does not actually overlap with valid range. Don't go there |
|
16469 } |
|
16470 else |
|
16471 { |
|
16472 if ( aChunk.iRightToLeft ) |
|
16473 { |
|
16474 rightEnd = aChunk.iStart; |
|
16475 if ( rightEnd <= aMinPos ) |
|
16476 { |
|
16477 constrained = ETrue; |
|
16478 aNewPos.iPos = aMinPos; |
|
16479 } |
|
16480 else |
|
16481 { |
|
16482 aNewPos.iPos = rightEnd; |
|
16483 } |
|
16484 aNewPos.iType = TTmDocPosSpec::ELeading; |
|
16485 } |
|
16486 else |
|
16487 { |
|
16488 rightEnd = aChunk.iEnd; |
|
16489 if ( rightEnd >= aMaxPos ) |
|
16490 { |
|
16491 constrained = ETrue; |
|
16492 aNewPos.iPos = aMaxPos; |
|
16493 } |
|
16494 else |
|
16495 { |
|
16496 aNewPos.iPos = rightEnd; |
|
16497 } |
|
16498 aNewPos.iType = TTmDocPosSpec::ETrailing; |
|
16499 } |
|
16500 } |
|
16501 return constrained; |
|
16502 } |
|
16503 |
|
16504 /** |
|
16505 * This method handles the attachment to the chunk being navigated toward. |
|
16506 * Should only be used for Right and Left navigation. |
|
16507 * The actual direction of that chunk does not need to be looked at. Even if |
|
16508 * is the same direction as the one being moved from, you still attach to it, as it may not |
|
16509 * be logically contiguous. |
|
16510 */ |
|
16511 void CAknFepManager::AdjustPosSpecForAmbiguityAfterLeftOrRightNavigation( TTmDocPosSpec& aPos, |
|
16512 TWesternNaviEvent aEvent ) const |
|
16513 { |
|
16514 |
|
16515 CTmTextLayout::TTmChunkDescription leftChunk; |
|
16516 CTmTextLayout::TTmChunkDescription rightChunk; |
|
16517 FindAdjacentChunks(aPos, leftChunk, rightChunk); |
|
16518 |
|
16519 TBool inputDirectionIsRTL = ( CurrentInputDirectionality() == TBidiText::ERightToLeft ); |
|
16520 |
|
16521 switch (aEvent) |
|
16522 { |
|
16523 case ELeftNaviEvent: |
|
16524 { |
|
16525 // Do not attach to the left chunk if its directionality is not the same as aDirection |
|
16526 if ( ChunkIsValid( leftChunk ) ) |
|
16527 if ( COMPARE_BOOLS(inputDirectionIsRTL, leftChunk.iRightToLeft) ) |
|
16528 AttachToLeftChunk( aPos, leftChunk ); |
|
16529 break; |
|
16530 } |
|
16531 case ERightNaviEvent: |
|
16532 { |
|
16533 if ( ChunkIsValid( rightChunk ) ) |
|
16534 if ( COMPARE_BOOLS(inputDirectionIsRTL, rightChunk.iRightToLeft) ) |
|
16535 AttachToRightChunk( aPos, rightChunk ); |
|
16536 break; |
|
16537 } |
|
16538 default: |
|
16539 break; |
|
16540 } |
|
16541 |
|
16542 } |
|
16543 |
|
16544 |
|
16545 void CAknFepManager::AttachToRightChunk( TTmDocPosSpec& aPos, |
|
16546 const CTmTextLayout::TTmChunkDescription& aRightChunk ) |
|
16547 { |
|
16548 if ( aRightChunk.iRightToLeft ) |
|
16549 { |
|
16550 aPos.iPos = aRightChunk.iEnd; |
|
16551 aPos.iType = TTmDocPosSpec::ETrailing; |
|
16552 } |
|
16553 else |
|
16554 { |
|
16555 aPos.iPos = aRightChunk.iStart; |
|
16556 aPos.iType = TTmDocPosSpec::ELeading; |
|
16557 } |
|
16558 } |
|
16559 |
|
16560 void CAknFepManager::AttachToLeftChunk( TTmDocPosSpec& aPos, |
|
16561 const CTmTextLayout::TTmChunkDescription& aLeftChunk ) |
|
16562 { |
|
16563 if ( aLeftChunk.iRightToLeft ) |
|
16564 { |
|
16565 aPos.iPos = aLeftChunk.iStart; |
|
16566 aPos.iType = TTmDocPosSpec::ELeading; |
|
16567 } |
|
16568 else |
|
16569 { |
|
16570 aPos.iPos = aLeftChunk.iEnd; |
|
16571 aPos.iType = TTmDocPosSpec::ETrailing; |
|
16572 } |
|
16573 } |
|
16574 |
|
16575 /** |
|
16576 * This routine ensures that the cursor position is not attached to a chunk of opposite direction. |
|
16577 * For end of document, the normal routine can be used. |
|
16578 * For the start, usually do nothing, but there is the possibility of forcing position 0/Trailing, when |
|
16579 * the edge chunk and the input directionality are opposite. |
|
16580 */ |
|
16581 void CAknFepManager::AdjustPosSpecForInputLanguageAfterDocumentLoop( TTmDocPosSpec& aPos, |
|
16582 TWesternNaviEvent /*aNaviEvent*/, TBool aLoopToTop ) const |
|
16583 { |
|
16584 |
|
16585 // Looping based on a Left event should adjust the cursor position as if that point had |
|
16586 // been reached by navigation to that same visual position outwards from the body |
|
16587 // Define this as the effective navigation that has just happened: |
|
16588 TWesternNaviEvent effectiveEvent(ELeftNaviEvent); |
|
16589 |
|
16590 // Rule for this effective navigation is |
|
16591 // move to top of document : if paradirection is LTR then treat it as a LEFT navi |
|
16592 // move to top of document : if paradirection is RTL then treat it as RIGHT navi |
|
16593 // move to bottom of document : if paradirection is LTR then treat is as RIGHT navi |
|
16594 // move to bottom of document : if paradirection is RTL then treat as LEFT navi |
|
16595 // However, NOTE that decrementing events leads to looping to the END! (and vice versa) |
|
16596 TBool newParaIsRTL = IsRightToLeftParagraph(aPos); |
|
16597 if ( aLoopToTop && newParaIsRTL ) // move to top; RTL |
|
16598 effectiveEvent = ERightNaviEvent; |
|
16599 else if ( !aLoopToTop && !newParaIsRTL ) // move to bottom; LTR |
|
16600 effectiveEvent = ERightNaviEvent; |
|
16601 |
|
16602 if ( aLoopToTop ) |
|
16603 { |
|
16604 // There is no ficticious block of the paragraph direction at -1 to 0. So we have to |
|
16605 // behave as if there is one: |
|
16606 // |
|
16607 CTmTextLayout::TTmChunkDescription leftChunk; |
|
16608 CTmTextLayout::TTmChunkDescription rightChunk; |
|
16609 CTmTextLayout::TTmChunkDescription& edgeChunk = leftChunk; |
|
16610 |
|
16611 FindAdjacentChunks(aPos, leftChunk, rightChunk); |
|
16612 |
|
16613 // Get input language direction |
|
16614 TBool inputDirectionIsRTL = ( CurrentInputDirectionality() == TBidiText::ERightToLeft ); |
|
16615 if ( effectiveEvent == ELeftNaviEvent ) |
|
16616 edgeChunk = leftChunk; |
|
16617 else |
|
16618 edgeChunk = rightChunk; |
|
16619 |
|
16620 // Check edgechunk for its direction |
|
16621 if ( !COMPARE_BOOLS( edgeChunk.iRightToLeft, inputDirectionIsRTL ) ) |
|
16622 { |
|
16623 // Input language disagrees with the chunk that we are on, |
|
16624 aPos.iPos = 0; |
|
16625 aPos.iType = TTmDocPosSpec::ETrailing; |
|
16626 } |
|
16627 |
|
16628 } |
|
16629 else // Looping to the end of document |
|
16630 { |
|
16631 // There IS a ficticious block at the doc end, so use the usual routine. |
|
16632 AdjustPosSpecForAmbiguityAfterLeftOrRightNavigation( aPos, effectiveEvent ); |
|
16633 } |
|
16634 |
|
16635 } |
|
16636 |
|
16637 TBool CAknFepManager::ChunkIsValid( const CTmTextLayout::TTmChunkDescription& aChunk ) |
|
16638 { |
|
16639 TBool isValid(ETrue); |
|
16640 |
|
16641 const TInt KNotValid = -1; |
|
16642 if ( aChunk.iRightToLeft == KNotValid ) |
|
16643 isValid = EFalse; |
|
16644 else if (aChunk.iStart == KNotValid ) |
|
16645 isValid = EFalse; |
|
16646 else if (aChunk.iEnd == KNotValid ) |
|
16647 isValid = EFalse; |
|
16648 |
|
16649 #ifdef _DEBUG |
|
16650 if (isValid) |
|
16651 __ASSERT_DEBUG( aChunk.iStart <= aChunk.iEnd, |
|
16652 AknFepPanic( EAknFepPanicBadCursorNavigationState ) ); |
|
16653 #endif |
|
16654 |
|
16655 return isValid; |
|
16656 } |
|
16657 /** |
|
16658 * Finds the current input direction. This is determined as best as it can using |
|
16659 * - T9Interface as the preferred source of information |
|
16660 * - shared data (via AknTextUtils) if that fails |
|
16661 * - localLanguage overrides the above sources of information |
|
16662 * - when fep is in numeric mode it returns LTR |
|
16663 * - if FEP is in an irelevant mode, then LTR is returned |
|
16664 * |
|
16665 * @return TDirectionality::ELeftToRight for LTR alpha mode or numeric mode |
|
16666 */ |
|
16667 TBidiText::TDirectionality CAknFepManager::CurrentInputDirectionality() const |
|
16668 { |
|
16669 TBidiText::TDirectionality directionality(TBidiText::ELeftToRight); |
|
16670 |
|
16671 // See if we are in a mode where the directionality is defined: |
|
16672 TBool checkForRTLValid(EFalse); |
|
16673 |
|
16674 switch (iMode ) |
|
16675 { |
|
16676 case ELatin: |
|
16677 case ENumber: |
|
16678 checkForRTLValid = ETrue; |
|
16679 break; |
|
16680 default: |
|
16681 break; |
|
16682 } |
|
16683 |
|
16684 if ( checkForRTLValid ) |
|
16685 { |
|
16686 MPtiLanguage* ptilang = iPtiEngine->CurrentLanguage(); // No need to get language from PtiEngine ? |
|
16687 TInt inputLanguage = (ptilang)? ptilang->LanguageCode() : 0; |
|
16688 if ( inputLanguage ) |
|
16689 { |
|
16690 directionality = TBidiText::ScriptDirectionality( (TLanguage)inputLanguage ); |
|
16691 checkForRTLValid = EFalse; |
|
16692 } |
|
16693 } |
|
16694 |
|
16695 // if no T9 interface information is available, then go for other sources |
|
16696 // Note that you have to check for local language in this case (belt-and-braces) |
|
16697 if ( checkForRTLValid ) |
|
16698 { |
|
16699 TLanguage localLanguage = ELangTest; |
|
16700 if ( GetLocalLanguage( localLanguage ) ) |
|
16701 directionality = TBidiText::ScriptDirectionality( localLanguage ); |
|
16702 else |
|
16703 directionality = AknTextUtils::CurrentScriptDirectionality(); |
|
16704 } |
|
16705 |
|
16706 return directionality; |
|
16707 } |
|
16708 |
|
16709 |
|
16710 TBool CAknFepManager::GetLocalLanguage( TLanguage& aLanguage ) const |
|
16711 { |
|
16712 TBool result(EFalse); |
|
16713 // Check for a local language override |
|
16714 if ( IsFepAwareTextEditor() ) |
|
16715 { |
|
16716 // For ITU-T keyboard we always use english in latin-only editors. |
|
16717 // In case of qwerty keyboard, some languages can be used in latin |
|
16718 // only-editors, some require that english is used instead. That |
|
16719 // is decided here. |
|
16720 const TInt globalLang = iSharedDataInterface->InputTextLanguage(); |
|
16721 TBool allowTest = |
|
16722 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
16723 !iQwertyInputMode || |
|
16724 #endif |
|
16725 globalLang == ELangPrcChinese || |
|
16726 globalLang == ELangHongKongChinese || |
|
16727 globalLang == ELangTaiwanChinese || |
|
16728 globalLang == ELangThai || |
|
16729 globalLang == ELangGreek || |
|
16730 globalLang == ELangArabic || |
|
16731 globalLang == ELangFarsi || |
|
16732 globalLang == ELangUrdu || |
|
16733 globalLang == ELangHebrew || |
|
16734 globalLang == ELangRussian || |
|
16735 globalLang == ELangUkrainian || |
|
16736 globalLang == ELangHindi || |
|
16737 #ifdef RD_MARATHI |
|
16738 globalLang == ELangMarathi || |
|
16739 #endif // RD_MARATHI |
|
16740 |
|
16741 #ifdef RD_HINDI_PHONETIC_INPUT |
|
16742 globalLang == KLangHindiPhonetic || |
|
16743 #endif |
|
16744 globalLang == ELangBulgarian || |
|
16745 globalLang == ELangVietnamese; |
|
16746 |
|
16747 if (allowTest && iAknEditorFlags & EAknEditorFlagLatinInputModesOnly && |
|
16748 iLanguageCapabilities.iInputLanguageCode != ELangJapanese) |
|
16749 { |
|
16750 aLanguage = ELangEnglish; |
|
16751 } |
|
16752 else |
|
16753 { |
|
16754 aLanguage = EditorState()->LocalLanguage(); |
|
16755 } |
|
16756 |
|
16757 if ( aLanguage != ELangTest ) |
|
16758 { |
|
16759 MPtiLanguage* languageObject = NULL; |
|
16760 languageObject = iPtiEngine->GetLanguage(aLanguage); |
|
16761 if (languageObject) // Check if the input language is supported. |
|
16762 { |
|
16763 result = ETrue; |
|
16764 } |
|
16765 else |
|
16766 { |
|
16767 aLanguage = ELangTest; |
|
16768 } |
|
16769 } |
|
16770 } |
|
16771 return result; |
|
16772 } |
|
16773 |
|
16774 |
|
16775 TBool CAknFepManager::GetExposedDirectionOfText( TInt aPos, TBool aForward, |
|
16776 TBool& aIsRightToLeft ) const |
|
16777 { |
|
16778 TBool hasStrongCharacter(EFalse); |
|
16779 |
|
16780 // Access the plain text from the editor, getting a little bit at a time. |
|
16781 |
|
16782 TInt docLen = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
16783 |
|
16784 // Init with defaults for aForward = ETrue |
|
16785 TInt limit = docLen; |
|
16786 TInt increment = 1; |
|
16787 if ( !aForward ) |
|
16788 { |
|
16789 limit = -1; // Loop does not execute if == limit |
|
16790 increment = -1; |
|
16791 } |
|
16792 |
|
16793 for ( TInt index = aPos; index != limit ; index += increment ) |
|
16794 { |
|
16795 TChar ch = CharAt(index); |
|
16796 if ( iInlineTextDecorator->CharacterIsStrongRightToLeft( (TText)ch ) ) |
|
16797 { |
|
16798 hasStrongCharacter = ETrue; |
|
16799 aIsRightToLeft = ETrue; |
|
16800 break; |
|
16801 } |
|
16802 else if ( iInlineTextDecorator->CharacterIsStrongLeftToRight( (TText)ch ) ) |
|
16803 { |
|
16804 hasStrongCharacter = ETrue; |
|
16805 aIsRightToLeft = EFalse; |
|
16806 break; |
|
16807 } |
|
16808 } |
|
16809 |
|
16810 return hasStrongCharacter; |
|
16811 } |
|
16812 |
|
16813 TBool CAknFepManager::GetExposedDirectionOfTextInDescriptor( const TDesC& aText, TBool aForward, |
|
16814 TBool& aIsRightToLeft ) const |
|
16815 { |
|
16816 TBool hasStrongCharacter(EFalse); |
|
16817 |
|
16818 TInt textLen = aText.Length(); |
|
16819 |
|
16820 TInt start = 0; |
|
16821 TInt limit = textLen; |
|
16822 TInt increment = 1; |
|
16823 if ( !aForward ) |
|
16824 { |
|
16825 start = textLen-1; |
|
16826 limit = -1; // Loop does not execute if == limit |
|
16827 increment = -1; |
|
16828 } |
|
16829 |
|
16830 for ( TInt index = start; index != limit ; index += increment ) |
|
16831 { |
|
16832 if ( iInlineTextDecorator->CharacterIsStrongRightToLeft( (TText)aText[index] ) ) |
|
16833 { |
|
16834 hasStrongCharacter = ETrue; |
|
16835 aIsRightToLeft = ETrue; |
|
16836 break; |
|
16837 } |
|
16838 else if ( iInlineTextDecorator->CharacterIsStrongLeftToRight( (TText)aText[index] ) ) |
|
16839 { |
|
16840 hasStrongCharacter = ETrue; |
|
16841 aIsRightToLeft = EFalse; |
|
16842 break; |
|
16843 } |
|
16844 } |
|
16845 |
|
16846 return hasStrongCharacter; |
|
16847 } |
|
16848 |
|
16849 TChar CAknFepManager::CharAt( TInt aPos ) const |
|
16850 { |
|
16851 TBuf<ESingleCharacter> chDes; |
|
16852 #ifdef RD_SCALABLE_UI_V2 |
|
16853 if ( SemiFepAwareTextEditor( ETrue ) ) |
|
16854 #else |
|
16855 if ( iInputCapabilities.FepAwareTextEditor() ) |
|
16856 #endif // RD_SCALABLE_UI_V2 |
|
16857 iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep( chDes, aPos, |
|
16858 ESingleCharacter); |
|
16859 if( chDes.Length() > 0 ) |
|
16860 return chDes[0]; |
|
16861 else |
|
16862 return TChar(0); |
|
16863 } |
|
16864 |
|
16865 |
|
16866 /** |
|
16867 * Navigate off of selected text using an Up/Down/Right/Left navigation event |
|
16868 * |
|
16869 * The code takes account of the paragraph directionality that the passed selection is |
|
16870 * found in. |
|
16871 * |
|
16872 * The new cursor position is resolved for ambuguity and set using SetCursorPosition and |
|
16873 * so it has the same side-effects: |
|
16874 * iUncommittedText is set to the zero-width "cursor" state with the new cursor position |
|
16875 * iUncommittedText is set into the FepAwareTextEditor state |
|
16876 * iCaseManager is updated with a ENullNaviEvent |
|
16877 * the doc pos is set in TextView object if present |
|
16878 */ |
|
16879 TKeyResponse CAknFepManager::NavigateFromSelectionL( |
|
16880 const TCursorSelection& aSelection, |
|
16881 TWesternNaviEvent aNaviEvent, |
|
16882 TTmDocPosSpec& aPos) |
|
16883 { |
|
16884 if (IsCcpuFlagSet(ECcpuStateCopy | ECcpuStateCut | ECcpuStateHashDown)) |
|
16885 { |
|
16886 return EKeyWasNotConsumed; |
|
16887 } |
|
16888 |
|
16889 switch( aNaviEvent ) |
|
16890 { |
|
16891 case EUpNaviEvent: |
|
16892 case EDownNaviEvent: |
|
16893 case ERightNaviEvent: |
|
16894 case ELeftNaviEvent: |
|
16895 // Carry on. Handle this event |
|
16896 break; |
|
16897 default: // just leave it as NULL |
|
16898 return EKeyWasNotConsumed; |
|
16899 } |
|
16900 // Find the visual end of the selection |
|
16901 TWesternNaviEvent effectiveEvent; // used to return either Right or Left event from next call: |
|
16902 GetAvkonDefinedVisualLimitsOfSelection( aSelection, aNaviEvent, aPos, &effectiveEvent ); |
|
16903 AdjustPosSpecForAmbiguityAfterLeftOrRightNavigation( aPos, effectiveEvent ); |
|
16904 |
|
16905 // Set this as the current position |
|
16906 SetCursorPositionL( aPos ); |
|
16907 |
|
16908 return EKeyWasConsumed; |
|
16909 } |
|
16910 |
|
16911 |
|
16912 void CAknFepManager::SetCursorPositionL( const TTmDocPosSpec& aNewCursorPos, TBool aDragSelectOn ) |
|
16913 { |
|
16914 if ( !iInputCapabilities.FepAwareTextEditor() ) |
|
16915 return; |
|
16916 |
|
16917 TInt newAnchorPos = aNewCursorPos.iPos; |
|
16918 |
|
16919 if ( aDragSelectOn ) |
|
16920 { |
|
16921 TCursorSelection selection; |
|
16922 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(selection); |
|
16923 if ( selection.Length() > 0 ) // there is a selection. Keep the anchor |
|
16924 newAnchorPos = selection.iAnchorPos; |
|
16925 } |
|
16926 |
|
16927 iUncommittedText.SetSelection( aNewCursorPos.iPos, newAnchorPos ); |
|
16928 |
|
16929 iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(iUncommittedText); |
|
16930 iCaseMan->UpdateCase(ENullNaviEvent); |
|
16931 |
|
16932 // This is able to set the directional attachment of the cursor in a way that the FepAwareTextEditor interface cannot |
|
16933 MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
16934 if (docNavi) |
|
16935 { |
|
16936 docNavi->SetDocPosL(aNewCursorPos, aDragSelectOn); |
|
16937 } |
|
16938 else |
|
16939 { |
|
16940 CAknEdwinFormAccessor* formAccessor = EditorState()->FormAccessor(); |
|
16941 if (formAccessor) |
|
16942 { |
|
16943 CEikEdwin *edwin = static_cast<CEikEdwin *>( formAccessor->FormClientControl() ); |
|
16944 if (edwin) |
|
16945 edwin->SetCursorPosL( aNewCursorPos.iPos, aDragSelectOn ); |
|
16946 } |
|
16947 } |
|
16948 } |
|
16949 |
|
16950 |
|
16951 |
|
16952 TBool CAknFepManager::InFirstLineAndFormatted( const TTmDocPosSpec& aPos ) const |
|
16953 { |
|
16954 return DocPosInFirstOrLastLineAndFormatted( aPos, ETrue); |
|
16955 } |
|
16956 |
|
16957 TBool CAknFepManager::InLastLineAndFormatted( const TTmDocPosSpec& aPos ) const |
|
16958 { |
|
16959 return DocPosInFirstOrLastLineAndFormatted( aPos, EFalse ); |
|
16960 } |
|
16961 |
|
16962 TBool CAknFepManager::DocPosInFirstOrLastLineAndFormatted( const TTmDocPosSpec& aPos, |
|
16963 TBool aCheckFirstLine ) const |
|
16964 { |
|
16965 TBool success(EFalse); |
|
16966 TTmLineInfo lineInfo; |
|
16967 MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
16968 if (docNavi) |
|
16969 { |
|
16970 success = docNavi->DocPosToLine( aPos, lineInfo); |
|
16971 } |
|
16972 else |
|
16973 { |
|
16974 CTextLayout* textLayout = TextLayout(); |
|
16975 if ( textLayout ) |
|
16976 { |
|
16977 success = textLayout->TagmaTextLayout().DocPosToLine( aPos, lineInfo); |
|
16978 } |
|
16979 } |
|
16980 |
|
16981 if ( success ) |
|
16982 { |
|
16983 if ( aCheckFirstLine ) |
|
16984 success = (lineInfo.iLineNumber == 0 ); |
|
16985 else |
|
16986 { |
|
16987 // Current position has yielded line information. But how to tell if it is the last line? |
|
16988 // Use the fact that the docpos of the last character will be in the last line. |
|
16989 // Also account for the fact that these APIs report a character at docLength itself, a |
|
16990 // ficticious end of paragraph character. So use a >= docLength |
|
16991 success = (lineInfo.iEnd >= |
|
16992 iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep() ); |
|
16993 } |
|
16994 } |
|
16995 |
|
16996 return success; |
|
16997 } |
|
16998 |
|
16999 TBool CAknFepManager::AtVisualStart( const TTmDocPosSpec& aCurrentPos, |
|
17000 const TTmDocPosSpec& aLimitPos ) const |
|
17001 { |
|
17002 TBool positionsAreTheSame(EFalse); |
|
17003 if ( aCurrentPos.iPos == aLimitPos.iPos && aCurrentPos.iType == aLimitPos.iType ) |
|
17004 positionsAreTheSame = ETrue; |
|
17005 else if ( aCurrentPos.iPos == 0 && aCurrentPos.iType == TTmDocPosSpec::ETrailing ) |
|
17006 positionsAreTheSame = ETrue; |
|
17007 |
|
17008 return positionsAreTheSame; |
|
17009 } |
|
17010 |
|
17011 TBool CAknFepManager::AtVisualEnd( const TTmDocPosSpec& aCurrentPos, |
|
17012 const TTmDocPosSpec& aLimitPos, TInt aDocLength ) const |
|
17013 { |
|
17014 TBool positionsAreTheSame(EFalse); |
|
17015 if ( aCurrentPos.iPos == aLimitPos.iPos && aCurrentPos.iType == aLimitPos.iType ) |
|
17016 positionsAreTheSame = ETrue; |
|
17017 else if ( aCurrentPos.iPos == aDocLength && aCurrentPos.iType == TTmDocPosSpec::ELeading ) |
|
17018 positionsAreTheSame = ETrue; |
|
17019 else if ( aCurrentPos.iPos > aDocLength ) |
|
17020 positionsAreTheSame = ETrue; |
|
17021 |
|
17022 return positionsAreTheSame; |
|
17023 } |
|
17024 |
|
17025 |
|
17026 void CAknFepManager::SetCursorType(TBool aIsLeftToRight) |
|
17027 { |
|
17028 if ( !BidiCursorRequired() ) |
|
17029 return; |
|
17030 |
|
17031 // Optimization to prevent excessive Wserv communication: |
|
17032 if ( IsFlagSet( EFlagBidiCursorIsInitialized ) |
|
17033 && COMPARE_BOOLS( !aIsLeftToRight, IsFlagSet( EFlagCursorPointsRightToLeft ) ) ) |
|
17034 return; |
|
17035 |
|
17036 SetFlag( EFlagBidiCursorIsInitialized ); |
|
17037 |
|
17038 MCoeFepAwareTextEditor* editor = iInputCapabilities.FepAwareTextEditor(); |
|
17039 if (editor && editor->Extension1()) |
|
17040 { |
|
17041 TCharFormat format; |
|
17042 TInt docPos = DocPos().iPos; |
|
17043 editor->GetFormatForFep(format, docPos); |
|
17044 |
|
17045 // Use Avkon routine to make all the layout decisions. It returns a TTextCursor object |
|
17046 TTextCursor newCursor; |
|
17047 AknCustomCursorSupport::GetBidiTextCursorFromFontSpec( format.iFontSpec, |
|
17048 !aIsLeftToRight, newCursor ); |
|
17049 TBool setToTrue(ETrue); |
|
17050 editor->Extension1()->SetCursorType(setToTrue, newCursor); |
|
17051 |
|
17052 // Keep flag in step for optimization |
|
17053 if ( aIsLeftToRight ) |
|
17054 ClearFlag( EFlagCursorPointsRightToLeft ); |
|
17055 else |
|
17056 SetFlag( EFlagCursorPointsRightToLeft ); |
|
17057 } |
|
17058 } |
|
17059 |
|
17060 TBool CAknFepManager::DeviceSupportsRTLLanguageL() |
|
17061 { |
|
17062 CArrayFixFlat<TInt>* languages = new (ELeave) CArrayFixFlat<TInt>(ELanguageArrayGranularity); |
|
17063 CleanupStack::PushL(languages); |
|
17064 iPtiEngine->GetAvailableLanguagesL(languages); |
|
17065 |
|
17066 TBool bidiCursorSuppressed(EFalse); |
|
17067 #if defined(__WINS__) |
|
17068 bidiCursorSuppressed = ETrue; |
|
17069 // Test (Disabled) mode (fake) UID, key and its value |
|
17070 const TInt KTestModeValue = 1; // 1 = show Bidi cursor |
|
17071 |
|
17072 CRepository* repository = NULL; |
|
17073 TRAPD(ret, repository = CRepository::NewL(KCRUidAknFep)); |
|
17074 if (ret == KErrNone) |
|
17075 { |
|
17076 TInt modeValue = 0; |
|
17077 if (repository->Get(KAknFepTestModeKey, modeValue) == KErrNone) |
|
17078 { |
|
17079 if (modeValue == KTestModeValue) |
|
17080 { |
|
17081 bidiCursorSuppressed = EFalse; // show bidi cursor |
|
17082 } |
|
17083 } |
|
17084 } |
|
17085 delete repository; |
|
17086 #endif |
|
17087 |
|
17088 TBool result = EFalse; |
|
17089 if (!bidiCursorSuppressed) |
|
17090 { |
|
17091 for (TInt jj = 0; jj < languages->Count(); jj++) |
|
17092 { |
|
17093 if (languages->At(jj) == ELangArabic || |
|
17094 languages->At(jj) == ELangHebrew || |
|
17095 languages->At(jj) == ELangFarsi || |
|
17096 languages->At(jj) == ELangUrdu ) |
|
17097 // + others... |
|
17098 { |
|
17099 result = ETrue; |
|
17100 break; |
|
17101 } |
|
17102 } |
|
17103 } |
|
17104 |
|
17105 CleanupStack::PopAndDestroy(); // languages |
|
17106 return result; |
|
17107 } |
|
17108 |
|
17109 void CAknFepManager::CalculateEditorDigitType(TDigitType& aDestination) |
|
17110 { |
|
17111 TBool ASCIIDigits = EFalse; |
|
17112 MObjectProvider* mop = iInputCapabilities.ObjectProvider(); |
|
17113 |
|
17114 if ( mop ) |
|
17115 { |
|
17116 CAknExtendedInputCapabilities* extendedInputCapabilities = |
|
17117 mop->MopGetObject( extendedInputCapabilities ); |
|
17118 |
|
17119 if ( extendedInputCapabilities ) |
|
17120 { |
|
17121 if ( extendedInputCapabilities->SupportsCapabilities( |
|
17122 CAknExtendedInputCapabilities::ESupportsOnlyASCIIDigits ) ) |
|
17123 { |
|
17124 // If this is true, then the inputcaps wants only ascii |
|
17125 // digits -> you can, when the editor is seen as numeric, |
|
17126 // be sure that only latin indicator is then wanted. |
|
17127 ASCIIDigits = ETrue; |
|
17128 } |
|
17129 } |
|
17130 } |
|
17131 |
|
17132 if (iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) |
|
17133 { |
|
17134 // use of only latin characters implies that numbers are also western |
|
17135 ASCIIDigits = ETrue; |
|
17136 } |
|
17137 |
|
17138 AknTextUtils::TDigitModeQueryType editorType = AknTextUtils::EDigitModeEditorDefault; |
|
17139 TBool numberOnlyEditor = iPermittedInputModes == EAknEditorNumericInputMode; |
|
17140 if ( numberOnlyEditor ) |
|
17141 { |
|
17142 editorType = AknTextUtils::EDigitModeNumberEditor; |
|
17143 if (ASCIIDigits) |
|
17144 { |
|
17145 editorType = AknTextUtils::EDigitModeLatinNumberEditor; |
|
17146 } |
|
17147 } |
|
17148 |
|
17149 if (iLanguageCapabilities.iArabicIndicDigitsAllowed && |
|
17150 AknTextUtils::DigitModeQuery(editorType) && |
|
17151 !ASCIIDigits) |
|
17152 { |
|
17153 aDestination = EDigitTypeArabicIndic; |
|
17154 } |
|
17155 else if (iLanguageCapabilities.iEasternArabicIndicDigitsAllowed && |
|
17156 AknTextUtils::DigitModeQuery(editorType)&& |
|
17157 !ASCIIDigits) |
|
17158 { |
|
17159 aDestination = EDigitTypeEasternArabicIndic; |
|
17160 } |
|
17161 /*Hindi*/ |
|
17162 else if ( iLanguageCapabilities.iIndicDigitsAllowed && |
|
17163 AknTextUtils::DigitModeQuery(editorType) && |
|
17164 !ASCIIDigits) |
|
17165 { |
|
17166 aDestination = EDigitTypeDevanagari; |
|
17167 } |
|
17168 else |
|
17169 { |
|
17170 aDestination = EDigitTypeWestern; |
|
17171 } |
|
17172 } |
|
17173 |
|
17174 |
|
17175 void CAknFepManager::UpdateNumericEditorDigitType() |
|
17176 { |
|
17177 if (iLanguageCapabilities.iNumericEditorDigitType == EDigitTypeUnknown) |
|
17178 { |
|
17179 CalculateEditorDigitType(iLanguageCapabilities.iNumericEditorDigitType); |
|
17180 } |
|
17181 } |
|
17182 |
|
17183 void CAknFepManager::UpdateLocalDigitMode() |
|
17184 { |
|
17185 TInt oldLocalDigitType = iLanguageCapabilities.iLocalDigitType; |
|
17186 CalculateEditorDigitType(iLanguageCapabilities.iLocalDigitType); |
|
17187 |
|
17188 if (oldLocalDigitType != iLanguageCapabilities.iLocalDigitType && |
|
17189 iCaseMan) // happens in destructor |
|
17190 { |
|
17191 UpdateIndicators(); |
|
17192 } |
|
17193 } |
|
17194 |
|
17195 /** |
|
17196 * This routine should be called if the flag is set that says that the last navigation was to an |
|
17197 * ambiguous point. |
|
17198 * The routine checks to see if the event passed is |
|
17199 * - Right or Left Arrow |
|
17200 * - Would be the event to "jump" across the ambiguity. That is |
|
17201 * - if at the "left" side of a LTR | RTL point, you need a Right arrow |
|
17202 * - if at the "right" side of a LTR | RTL point, you need a Left arrow. |
|
17203 * - if at the "left" side of a RTL | LTR point, you need a Right arrow |
|
17204 * - if at the "right" side of a RTL | LTR point, you need a Left arrow. |
|
17205 * |
|
17206 */ |
|
17207 // TKeyResponse CAknFepManager::AttemptCursorFlipAtAmbiguousPointL( const TKeyEvent& aKeyEvent, TEventCode aEventCode ) |
|
17208 TKeyResponse CAknFepManager::AttemptCursorFlipAtAmbiguousPointL( const TUint aCode ) |
|
17209 { |
|
17210 TKeyResponse response = EKeyWasNotConsumed; |
|
17211 |
|
17212 if ( IsFlagSet(EFlagAtDirectionallyAmbiguousPoint) // only perform if already at ambi-point? |
|
17213 && !IsFlagSet(EFlagInsideInlineEditingTransaction) ) // do not flip if inside inline edit |
|
17214 { |
|
17215 if ( aCode == EKeyRightArrow || aCode == EKeyLeftArrow ) |
|
17216 { |
|
17217 if ( iInputCapabilities.FepAwareTextEditor() && EditorState() |
|
17218 && (AknFepDocumentNavigation() || TextView()) ) |
|
17219 { |
|
17220 TTmDocPosSpec docPos = DocPos(); |
|
17221 TTextDirectionalInfo status = LocalTextDirectionalStatus( docPos ); |
|
17222 |
|
17223 CTmTextLayout::TTmChunkDescription leftChunk; |
|
17224 CTmTextLayout::TTmChunkDescription rightChunk; |
|
17225 FindAdjacentChunks(docPos, leftChunk, rightChunk); |
|
17226 |
|
17227 if ( status.iBlockEnvironment == |
|
17228 TTextDirectionalInfo::EAtRightEndOfBlockFacingOppositeDirectionalBlock |
|
17229 && aCode == EKeyRightArrow ) |
|
17230 { |
|
17231 response = EKeyWasConsumed; |
|
17232 // Set cursor to new directionality ( opposite to current ) |
|
17233 SetCursorTypeForTextDirection( status.iDirectionalStatus == |
|
17234 TTextDirectionalInfo::ERightToLeft ); |
|
17235 // Must actually change the docpos! |
|
17236 AttachToRightChunk( docPos, rightChunk ); |
|
17237 SetCursorPositionL( docPos, ETrue ); // Drag any existing selection |
|
17238 } |
|
17239 else if ( status.iBlockEnvironment == |
|
17240 TTextDirectionalInfo::EAtLeftEndOfBlockFacingOppositeDirectionalBlock |
|
17241 && aCode == EKeyLeftArrow ) |
|
17242 { |
|
17243 response = EKeyWasConsumed; |
|
17244 // Effectively this toggles the direction of the cursor |
|
17245 SetCursorTypeForTextDirection( status.iDirectionalStatus == |
|
17246 TTextDirectionalInfo::ERightToLeft ); |
|
17247 // Must actually change the docpos! |
|
17248 AttachToLeftChunk( docPos, leftChunk ); |
|
17249 SetCursorPositionL( docPos, ETrue ); // Drag any existing selection |
|
17250 } |
|
17251 } |
|
17252 } |
|
17253 } |
|
17254 return response; |
|
17255 } |
|
17256 |
|
17257 |
|
17258 TInt CAknFepManager::PostEventCheckCallback(TAny* aObj) |
|
17259 { |
|
17260 TRAP_IGNORE(static_cast<CAknFepManager*>(aObj)->DoCursorDirectionCheckL()); |
|
17261 return KErrNone; |
|
17262 } |
|
17263 |
|
17264 TBool CAknFepManager::BidiCursorRequired() const |
|
17265 { |
|
17266 return iDeviceSupportsRtlLanguage; |
|
17267 } |
|
17268 |
|
17269 void CAknFepManager::DoCursorDirectionCheckL() |
|
17270 { |
|
17271 iPostEventCheck->Cancel(); |
|
17272 if(BidiCursorRequired()) |
|
17273 { |
|
17274 AdjustCursorTypeForCurrentPosition(); |
|
17275 } |
|
17276 |
|
17277 if ( !BidiCursorRequired() |
|
17278 || (TAknFepUiIndicInputManager :: IsIndicLangauge(TLanguage(iLanguageCapabilities.iInputLanguageCode)) )) |
|
17279 { |
|
17280 /*Hindi*/ |
|
17281 if( ( !WesternPredictive() ) && |
|
17282 ( TAknFepUiIndicInputManager::IsIndicLangauge( |
|
17283 TLanguage( iLanguageCapabilities.iInputLanguageCode ) ) ) && |
|
17284 ( ( TAknFepUiIndicInputManager::IsCharVirama( |
|
17285 PreviousChar( ETrue ), TLanguage( iLanguageCapabilities.iInputLanguageCode ) ) ) |
|
17286 #ifdef RD_MARATHI |
|
17287 || ( IsEyeLashRaPresentL() && |
|
17288 TAknFepUiIndicInputManager::IsCharVirama( |
|
17289 PreviousToPreviousChar( ETrue ), TLanguage( iLanguageCapabilities.iInputLanguageCode ) ) ) |
|
17290 #endif |
|
17291 ) |
|
17292 && !( iInputCapabilities.SupportsSecretText() ) |
|
17293 ) |
|
17294 { |
|
17295 TTmDocPosSpec pos = DocPos(); |
|
17296 pos.iType = TTmDocPosSpec::ETrailing; |
|
17297 TTmPosInfo2 info; |
|
17298 TTmLineInfo lineInfo; |
|
17299 TBool findAvailable = EFalse; |
|
17300 MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
17301 if (docNavi) |
|
17302 { |
|
17303 docNavi->FindDocPos(pos, info, lineInfo); |
|
17304 findAvailable = ETrue; |
|
17305 } |
|
17306 else |
|
17307 { |
|
17308 CTextLayout* textLayout = TextLayout(); |
|
17309 if ( textLayout ) |
|
17310 { |
|
17311 textLayout->TagmaTextLayout().FindDocPos(pos, info, lineInfo); |
|
17312 findAvailable = ETrue; |
|
17313 } |
|
17314 } |
|
17315 if (findAvailable) |
|
17316 { |
|
17317 TCursorSelection sel(info.iDocPos.iPos ,info.iDocPos.iPos ); |
|
17318 iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(sel); |
|
17319 } |
|
17320 } |
|
17321 } |
|
17322 } |
|
17323 |
|
17324 void CAknFepManager::AdjustCursorTypeForCurrentPosition() |
|
17325 { |
|
17326 if ( iInputCapabilities.FepAwareTextEditor() && EditorState() |
|
17327 && (AknFepDocumentNavigation() || TextView()) ) |
|
17328 AdjustCursorTypeForPosition( DocPos() ); |
|
17329 } |
|
17330 |
|
17331 void CAknFepManager::SchedulePostEventCheckL( TUint aCode ) |
|
17332 { |
|
17333 |
|
17334 TBool isToPostEvent = EFalse; |
|
17335 TBool isIndicLanguage = TAknFepUiIndicInputManager :: |
|
17336 IsIndicLangauge(TLanguage(iLanguageCapabilities.iInputLanguageCode)); |
|
17337 |
|
17338 if ( BidiCursorRequired() ) |
|
17339 { |
|
17340 switch ( aCode ) |
|
17341 { |
|
17342 // Navigation cases: |
|
17343 case EKeyDownArrow: |
|
17344 case EKeyUpArrow: |
|
17345 case EPtiKey1: |
|
17346 case EPtiKey2: |
|
17347 case EPtiKey3: |
|
17348 case EPtiKey4: |
|
17349 case EPtiKey5: |
|
17350 case EPtiKey6: |
|
17351 case EPtiKey7: |
|
17352 case EPtiKey8: |
|
17353 case EPtiKey9: |
|
17354 case EPtiKey0: |
|
17355 { |
|
17356 isToPostEvent = ETrue; |
|
17357 } |
|
17358 break; |
|
17359 case EKeyBackspace: |
|
17360 case EKeyDelete: |
|
17361 { |
|
17362 if(!isIndicLanguage) |
|
17363 { |
|
17364 isToPostEvent = ETrue; |
|
17365 } |
|
17366 } |
|
17367 break; |
|
17368 case EKeyLeftArrow: |
|
17369 case EKeyRightArrow: |
|
17370 { |
|
17371 if(!isIndicLanguage) |
|
17372 { |
|
17373 isToPostEvent = ETrue; |
|
17374 } |
|
17375 } |
|
17376 break; |
|
17377 default: |
|
17378 break; |
|
17379 } |
|
17380 |
|
17381 // If Repha has been inserted then do not post event. |
|
17382 if( isIndicLanguage ) |
|
17383 { |
|
17384 if( aCode == EPtiKey1 && ( !iQwertyInputMode ) ) |
|
17385 { |
|
17386 if( IsRephaPresent() |
|
17387 #ifdef RD_MARATHI |
|
17388 || IsEyeLashRaPresentL() |
|
17389 #endif |
|
17390 ) |
|
17391 { |
|
17392 isToPostEvent = EFalse; |
|
17393 } |
|
17394 } |
|
17395 } |
|
17396 } |
|
17397 |
|
17398 if(isIndicLanguage) // iQwertyInputMode check is added so as to ensure that the event is not posted for Qwerty mode. |
|
17399 { |
|
17400 if((aCode == EKeyBackspace || aCode == EKeyDelete) && (!iQwertyInputMode)) |
|
17401 { |
|
17402 isToPostEvent = ETrue; |
|
17403 } |
|
17404 } |
|
17405 |
|
17406 if(isToPostEvent) |
|
17407 { |
|
17408 if ( iPostEventCheck->IsActive() ) |
|
17409 iPostEventCheck->Cancel(); |
|
17410 iPostEventCheck->Start( TCallBack(PostEventCheckCallback, this) ); |
|
17411 } |
|
17412 } |
|
17413 |
|
17414 void CAknFepManager::AdjustCursorTypeForPosition( const TTmDocPosSpec& aDocPos ) |
|
17415 { |
|
17416 |
|
17417 TTextDirectionalInfo dirInfo = LocalTextDirectionalStatus( aDocPos ); |
|
17418 // default clearing of this flag |
|
17419 ClearFlag( EFlagAtDirectionallyAmbiguousPoint ); |
|
17420 |
|
17421 switch ( dirInfo.iBlockEnvironment ) |
|
17422 { |
|
17423 case TTextDirectionalInfo::EUndefined: |
|
17424 // Set according to input direction |
|
17425 SetCursorTypeForTextDirection( CurrentInputDirectionality() == |
|
17426 TBidiText::ELeftToRight ); |
|
17427 break; // do nothing |
|
17428 |
|
17429 // All unambiguous cases |
|
17430 case TTextDirectionalInfo::EInsideBlock: |
|
17431 case TTextDirectionalInfo::EAtRightEndOfLine: |
|
17432 case TTextDirectionalInfo::EAtLeftEndOfLine: |
|
17433 case TTextDirectionalInfo::EAtRightEndOfBlockFacingSameDirectionBlock: |
|
17434 case TTextDirectionalInfo::EAtLeftEndOfBlockFacingSameDirectionBlock: |
|
17435 SetCursorTypeForTextDirection( dirInfo.iDirectionalStatus == |
|
17436 TTextDirectionalInfo::ELeftToRight ); |
|
17437 break; |
|
17438 |
|
17439 // Ambiguous. Navigation has resulted in an ambiguous visual position. Set cursor according |
|
17440 // to current direction |
|
17441 case TTextDirectionalInfo::EAtRightEndOfBlockFacingOppositeDirectionalBlock: |
|
17442 case TTextDirectionalInfo::EAtLeftEndOfBlockFacingOppositeDirectionalBlock: |
|
17443 SetCursorTypeForTextDirection( dirInfo.iDirectionalStatus == |
|
17444 TTextDirectionalInfo::ELeftToRight ); |
|
17445 SetFlag( EFlagAtDirectionallyAmbiguousPoint ); |
|
17446 break; |
|
17447 default: |
|
17448 // Do nothing |
|
17449 break; |
|
17450 } |
|
17451 } |
|
17452 |
|
17453 void CAknFepManager::SetCursorTypeForTextDirection( TBool aLeftToRight ) |
|
17454 { |
|
17455 SetCursorType( aLeftToRight ); |
|
17456 } |
|
17457 |
|
17458 void CAknFepManager::SetCursorTypeForInputDirection( TBool /*aLeftToRight*/ ) |
|
17459 { |
|
17460 // Do nothing |
|
17461 } |
|
17462 |
|
17463 CAknFepManager::TTextDirectionalInfo CAknFepManager:: |
|
17464 LocalTextDirectionalStatus( const TTmDocPosSpec& aDocPos ) const |
|
17465 { |
|
17466 TTextDirectionalInfo directionalInfo; |
|
17467 |
|
17468 MCoeFepAwareTextEditor* fepAwareTextEditor = iInputCapabilities.FepAwareTextEditor(); |
|
17469 if ( !fepAwareTextEditor ) |
|
17470 return directionalInfo; |
|
17471 |
|
17472 if ( aDocPos.iPos < 0 ) // somehow, we are before the first character |
|
17473 directionalInfo.iDirectionalStatus = TTextDirectionalInfo::ENotInDocument; |
|
17474 else if ( aDocPos.iPos > fepAwareTextEditor->DocumentLengthForFep() ) // (iPos = docLen still is within document) |
|
17475 directionalInfo.iDirectionalStatus = TTextDirectionalInfo::ENotInDocument; |
|
17476 else if ( fepAwareTextEditor->DocumentLengthForFep() == 0 ) // zero length; no document |
|
17477 directionalInfo.iDirectionalStatus = TTextDirectionalInfo::ENotInDocument; |
|
17478 |
|
17479 if ( directionalInfo.iDirectionalStatus == TTextDirectionalInfo::EUnknown ) |
|
17480 { |
|
17481 CTmTextLayout::TTmChunkDescription leftChunk; |
|
17482 CTmTextLayout::TTmChunkDescription rightChunk; |
|
17483 FindAdjacentChunks(aDocPos, leftChunk, rightChunk); |
|
17484 |
|
17485 // Cases: |
|
17486 // position is within a chunk (chunks are continuous in logical index and same directionality. |
|
17487 // ->Return directionality |
|
17488 // position is betweeen two chunks of opposite directionality |
|
17489 // -> return simple ambiguity |
|
17490 // position is between two chnks of same directionality, but logical index is not contiguous |
|
17491 // -> return complex ambiguity ; return directionality |
|
17492 |
|
17493 if ( leftChunk.iStart == -1 && rightChunk.iStart == -1 ) // 2 chunks invalid; direction stays EUnkonwn |
|
17494 { |
|
17495 directionalInfo.iDirectionalStatus = TTextDirectionalInfo::ENoDirectionalChunks; |
|
17496 } |
|
17497 else if ( leftChunk.iStart == -1 ) // no left block |
|
17498 { |
|
17499 directionalInfo.iBlockEnvironment = TTextDirectionalInfo::EAtLeftEndOfLine; |
|
17500 directionalInfo.SetDirectionFromChunk( rightChunk ); |
|
17501 } |
|
17502 else if ( rightChunk.iStart == -1 ) // no right block |
|
17503 { |
|
17504 directionalInfo.iBlockEnvironment = TTextDirectionalInfo::EAtRightEndOfLine; |
|
17505 directionalInfo.SetDirectionFromChunk( leftChunk ); |
|
17506 } |
|
17507 // Both chunks are the same direction. |
|
17508 // We are either nicely inside a block or the two blocks are at +/- 2, 4, etc levels |
|
17509 else if ( COMPARE_BOOLS( leftChunk.iRightToLeft, rightChunk.iRightToLeft ) ) |
|
17510 { |
|
17511 // Can set direction from either chunk; use left one |
|
17512 directionalInfo.SetDirectionFromChunk( leftChunk ); |
|
17513 |
|
17514 if (leftChunk.iRightToLeft ) |
|
17515 { |
|
17516 if ( leftChunk.iStart == rightChunk.iEnd ) // chunks are continguous |
|
17517 directionalInfo.iBlockEnvironment = TTextDirectionalInfo::EInsideBlock; |
|
17518 else // Chunks are separated by 2, 4 etc. levels |
|
17519 directionalInfo.iBlockEnvironment = ( aDocPos.iPos == leftChunk.iStart ) ? |
|
17520 TTextDirectionalInfo::EAtRightEndOfBlockFacingSameDirectionBlock : |
|
17521 TTextDirectionalInfo::EAtLeftEndOfBlockFacingSameDirectionBlock; |
|
17522 } |
|
17523 else |
|
17524 { |
|
17525 if ( leftChunk.iEnd == rightChunk.iStart ) // chunks are continguous |
|
17526 directionalInfo.iBlockEnvironment = TTextDirectionalInfo::EInsideBlock; |
|
17527 else // Chunks are separated by 2, 4 etc. levels |
|
17528 directionalInfo.iBlockEnvironment = ( aDocPos.iPos == leftChunk.iEnd ) ? |
|
17529 TTextDirectionalInfo::EAtRightEndOfBlockFacingSameDirectionBlock : |
|
17530 TTextDirectionalInfo::EAtLeftEndOfBlockFacingSameDirectionBlock; |
|
17531 } |
|
17532 } |
|
17533 else // Blocks are in opposite direction. Have to deal with all the values of the iType enum |
|
17534 { |
|
17535 TInt charPos; |
|
17536 switch( aDocPos.iType ) |
|
17537 { |
|
17538 case TTmDocPosSpec::ETrailing: // position follows a block End |
|
17539 { |
|
17540 charPos = aDocPos.iPos - 1; // attachment is to character[iPos-1] - now find it |
|
17541 if ( leftChunk.iStart <= charPos && charPos < leftChunk.iEnd ) // pos is in left chunk |
|
17542 { |
|
17543 directionalInfo.SetDirectionFromChunk( leftChunk ); |
|
17544 directionalInfo.iBlockEnvironment = |
|
17545 TTextDirectionalInfo::EAtRightEndOfBlockFacingOppositeDirectionalBlock; |
|
17546 } |
|
17547 else if( rightChunk.iStart <= charPos && charPos < rightChunk.iEnd ) // pos is in right chunk |
|
17548 { |
|
17549 directionalInfo.SetDirectionFromChunk( rightChunk ); |
|
17550 directionalInfo.iBlockEnvironment = |
|
17551 TTextDirectionalInfo::EAtLeftEndOfBlockFacingOppositeDirectionalBlock; |
|
17552 } |
|
17553 else // Probably impossible situation. Supply reasonable defaults rather than panicking |
|
17554 { |
|
17555 directionalInfo.iDirectionalStatus = TTextDirectionalInfo::ELeftToRight; |
|
17556 directionalInfo.iBlockEnvironment = |
|
17557 TTextDirectionalInfo::EAtLeftEndOfBlockFacingOppositeDirectionalBlock; |
|
17558 } |
|
17559 break; |
|
17560 } |
|
17561 case TTmDocPosSpec::ELeading: // position precedes a block start |
|
17562 { |
|
17563 charPos = aDocPos.iPos; // attachment is to character[iPos] - now find it |
|
17564 if ( leftChunk.iStart <= charPos && charPos < leftChunk.iEnd ) // pos is in left chunk |
|
17565 { |
|
17566 directionalInfo.SetDirectionFromChunk( leftChunk ); |
|
17567 directionalInfo.iBlockEnvironment = |
|
17568 TTextDirectionalInfo::EAtRightEndOfBlockFacingOppositeDirectionalBlock; |
|
17569 } |
|
17570 else if( rightChunk.iStart <= charPos && charPos < rightChunk.iEnd ) // pos is in right chunk |
|
17571 { |
|
17572 directionalInfo.SetDirectionFromChunk( rightChunk ); |
|
17573 directionalInfo.iBlockEnvironment = |
|
17574 TTextDirectionalInfo::EAtLeftEndOfBlockFacingOppositeDirectionalBlock; |
|
17575 } |
|
17576 else // Probably impossible situation. Supply reasonable defaults rather than panicking |
|
17577 { |
|
17578 directionalInfo.iDirectionalStatus = TTextDirectionalInfo::ELeftToRight; |
|
17579 directionalInfo.iBlockEnvironment = |
|
17580 TTextDirectionalInfo::EAtLeftEndOfBlockFacingOppositeDirectionalBlock; |
|
17581 } |
|
17582 break; |
|
17583 } |
|
17584 case TTmDocPosSpec::ELeftToRight: // Is attached to a Left to right block |
|
17585 { |
|
17586 directionalInfo.iDirectionalStatus = TTextDirectionalInfo::ELeftToRight; |
|
17587 // If left chunk is RTL, then we are NOT attached to that left block |
|
17588 // (ie. we are at left end of the right block) |
|
17589 directionalInfo.iBlockEnvironment = leftChunk.iRightToLeft ? |
|
17590 TTextDirectionalInfo::EAtLeftEndOfBlockFacingOppositeDirectionalBlock : // must be in right chunk then (left end of it) |
|
17591 TTextDirectionalInfo::EAtRightEndOfBlockFacingOppositeDirectionalBlock; // else in left chunk (right end of it) |
|
17592 break; |
|
17593 } |
|
17594 case TTmDocPosSpec::ERightToLeft: |
|
17595 { |
|
17596 directionalInfo.iDirectionalStatus = TTextDirectionalInfo::ERightToLeft; |
|
17597 // If left chunk if RTL, then we are attached to that left block (ie. at right end of it) |
|
17598 directionalInfo.iBlockEnvironment = leftChunk.iRightToLeft ? // is it in left chunk? |
|
17599 TTextDirectionalInfo::EAtRightEndOfBlockFacingOppositeDirectionalBlock : // right end of left chunk |
|
17600 TTextDirectionalInfo::EAtLeftEndOfBlockFacingOppositeDirectionalBlock; |
|
17601 break; |
|
17602 } |
|
17603 } |
|
17604 |
|
17605 } |
|
17606 } |
|
17607 return directionalInfo; |
|
17608 } |
|
17609 |
|
17610 |
|
17611 /** |
|
17612 * Redecoration is carried out if a neutral is exposed by the deletion to a directionality |
|
17613 * different to that which is was already marked. |
|
17614 * |
|
17615 * The routine leaves iUncommittedText again set to the (possibly new) cursor position. |
|
17616 * |
|
17617 */ |
|
17618 void CAknFepManager::RedecorateAfterDeletionL( const TDesC& aTextThatWasDeleted ) |
|
17619 { |
|
17620 if (!EditorSupportsNeutralProtection()) |
|
17621 return; |
|
17622 |
|
17623 if ( aTextThatWasDeleted.Length() == 0 ) |
|
17624 return; |
|
17625 |
|
17626 TBool protect = ETrue; |
|
17627 |
|
17628 // Set up iUncommittedText with the current cursor position so that PreviousChar will work: |
|
17629 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
17630 |
|
17631 TTmDocPosSpec docPos = DocPos(); |
|
17632 TInt docLen = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
17633 |
|
17634 TInt previousPos = docPos.iPos; |
|
17635 // Trailing iType actually points to character at index iPos - 1 |
|
17636 if( docPos.iType == TTmDocPosSpec::ETrailing ) |
|
17637 previousPos = previousPos -= 1; |
|
17638 TInt nextPos = previousPos + 1; |
|
17639 |
|
17640 // Perform no neutral protection if the beginning of the text is deleted. |
|
17641 // Note that there MAY be protection occuring if the delete is from the end so there is |
|
17642 // no corresponding test on DocLength. That is handled later where the paragraph direction |
|
17643 // is used for the "forward" directionality. |
|
17644 if ( previousPos < 0 ) |
|
17645 return; |
|
17646 |
|
17647 // Up to 2 protection characters, one RTL and one LTR |
|
17648 TBuf<2> textToInsert; |
|
17649 |
|
17650 TBool adjacentPrecedingIsNeutral(EFalse); |
|
17651 TBool adjacentTrailingIsNeutral(EFalse); |
|
17652 |
|
17653 // See if either preceding or next is neutral |
|
17654 adjacentPrecedingIsNeutral = iInlineTextDecorator->CharacterIsNeutral( CharAt(previousPos) ); |
|
17655 if ( nextPos < docLen ) |
|
17656 adjacentTrailingIsNeutral = iInlineTextDecorator->CharacterIsNeutral( CharAt(nextPos) ); |
|
17657 |
|
17658 if ( !adjacentPrecedingIsNeutral && !adjacentTrailingIsNeutral ) |
|
17659 protect = EFalse; |
|
17660 |
|
17661 // Inits actually correspond to LTR, but they are only used if the bools indicating |
|
17662 // strong directionality found get set |
|
17663 TBool directionPrecedingDeleteIsRTL(EFalse); |
|
17664 TBool directionTrailingDeleteIsRTL(EFalse); |
|
17665 if ( protect ) |
|
17666 { |
|
17667 TBool strongPreceding = GetExposedDirectionOfText( previousPos, EFalse, |
|
17668 directionPrecedingDeleteIsRTL ); |
|
17669 TBool strongTrailing = GetExposedDirectionOfText( nextPos, ETrue, |
|
17670 directionTrailingDeleteIsRTL ); |
|
17671 if (!strongTrailing) |
|
17672 { |
|
17673 TBool isRTLPara = IsRightToLeftParagraph(docPos); |
|
17674 directionTrailingDeleteIsRTL = isRTLPara; |
|
17675 strongTrailing = ETrue; |
|
17676 } |
|
17677 if ( !strongPreceding || !strongTrailing) // Must have strong in both directions |
|
17678 protect = EFalse; |
|
17679 else if ( COMPARE_BOOLS( directionPrecedingDeleteIsRTL, directionTrailingDeleteIsRTL ) ) // Must differ |
|
17680 protect = EFalse; |
|
17681 } |
|
17682 |
|
17683 TBool forwardProtection(EFalse); |
|
17684 |
|
17685 if ( protect ) |
|
17686 { |
|
17687 protect = EFalse; |
|
17688 TBool deletedWasRTL; |
|
17689 |
|
17690 // Check for and do reverse protection |
|
17691 if ( adjacentPrecedingIsNeutral ) |
|
17692 { |
|
17693 TBool deletedTextIsStrong = GetExposedDirectionOfTextInDescriptor( aTextThatWasDeleted, |
|
17694 ETrue, |
|
17695 deletedWasRTL ); // search forward into deleted stuff |
|
17696 if ( deletedTextIsStrong && (directionPrecedingDeleteIsRTL == deletedWasRTL)) |
|
17697 { |
|
17698 protect = ETrue; |
|
17699 forwardProtection = EFalse; |
|
17700 if ( deletedWasRTL ) |
|
17701 textToInsert.Append( CAknFepInlineTextDecorator::ERightToLeftMark ); |
|
17702 else |
|
17703 textToInsert.Append( CAknFepInlineTextDecorator::ELeftToRightMark ); |
|
17704 } |
|
17705 } |
|
17706 |
|
17707 // Check for and do forward protection |
|
17708 // Note it is possible to have both forward and reverse redecoration. |
|
17709 if ( adjacentTrailingIsNeutral ) |
|
17710 { |
|
17711 TBool deletedTextIsStrong = GetExposedDirectionOfTextInDescriptor( aTextThatWasDeleted, |
|
17712 EFalse, |
|
17713 deletedWasRTL ); // search backward in deleted stuff |
|
17714 if (deletedTextIsStrong && (directionTrailingDeleteIsRTL == deletedWasRTL) ) |
|
17715 { |
|
17716 protect = ETrue; |
|
17717 forwardProtection = ETrue; |
|
17718 if ( deletedWasRTL ) |
|
17719 textToInsert.Append( CAknFepInlineTextDecorator::ERightToLeftMark ); |
|
17720 else |
|
17721 textToInsert.Append( CAknFepInlineTextDecorator::ELeftToRightMark ); |
|
17722 } |
|
17723 } |
|
17724 } |
|
17725 |
|
17726 |
|
17727 if ( protect ) |
|
17728 { |
|
17729 StartInlineEditL(textToInsert); |
|
17730 CommitInlineEditWithoutResolutionL(*(iInputCapabilities.FepAwareTextEditor()), ETrue); |
|
17731 // iUncommittedText is now set to correct value by the Commitxxxx method |
|
17732 // Document position is adjusted to as to keep the cursor stable. |
|
17733 // Make a docPos. If reverse protection, then the position should trail |
|
17734 TTmDocPosSpec docPos( iUncommittedText.LowerPos() , TTmDocPosSpec::ETrailing ); |
|
17735 // But if there has been forward Protection, then we have to back up the cursor by 1 |
|
17736 // and lead. (This is OK too, if there is simultaneous reversse and forward protection) |
|
17737 if ( forwardProtection ) |
|
17738 { |
|
17739 docPos.iPos = Max(docPos.iPos - 1, 0 ); |
|
17740 docPos.iType = TTmDocPosSpec::ELeading; |
|
17741 } |
|
17742 SetCursorPositionL( docPos ); |
|
17743 } |
|
17744 } |
|
17745 |
|
17746 TBool CAknFepManager::EditorSupportsNeutralProtection() |
|
17747 { |
|
17748 TBool ret = ETrue; |
|
17749 if ( !IsFepAwareTextEditor() ) |
|
17750 ret = EFalse; |
|
17751 |
|
17752 else if (iInputCapabilities.SupportsSecretText()) |
|
17753 ret = EFalse; |
|
17754 |
|
17755 else if ( iAknEditorFlags & EAknEditorFlagLatinInputModesOnly ) |
|
17756 ret = EFalse; |
|
17757 |
|
17758 else if (iPermittedInputModes == EAknEditorNumericInputMode) |
|
17759 ret = EFalse; |
|
17760 |
|
17761 else if ( !CharIsValidInEditor( CAknFepInlineTextDecorator::ERightToLeftMark ) ) |
|
17762 ret = EFalse; |
|
17763 |
|
17764 return ret; |
|
17765 } |
|
17766 |
|
17767 void CAknFepManager::CommitInlineEditWithoutResolutionL(MCoeFepAwareTextEditor& aFepAwareTextEditor, |
|
17768 TBool aCursorVisibility , TBool aClearPti ) |
|
17769 { |
|
17770 aFepAwareTextEditor.SetInlineEditingCursorVisibilityL(aCursorVisibility); |
|
17771 /* |
|
17772 On any call to CommitFepInlineEditL, the mode will change |
|
17773 even when a leave event occurs. |
|
17774 */ |
|
17775 ClearFlag(EFlagInsideInlineEditingTransaction | EFlagInsideMultitapInlineEditingTransaction); |
|
17776 ClearCcpuFlag(ECcpuStateNewPredictiveWord); |
|
17777 |
|
17778 if(aClearPti) |
|
17779 { |
|
17780 iPtiEngine->CommitCurrentWord(); |
|
17781 } |
|
17782 CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
17783 aFepAwareTextEditor.CommitFepInlineEditL(*coeEnv); |
|
17784 aFepAwareTextEditor.GetCursorSelectionForFep(iUncommittedText); |
|
17785 // iMatchState=EWordMatchFirst; |
|
17786 iCaseMan->UpdateCase(ENullNaviEvent); |
|
17787 } |
|
17788 |
|
17789 void CAknFepManager::WordConcatenationTimerTimeoutL() |
|
17790 { |
|
17791 iConcatenationTimer->Cancel(); |
|
17792 |
|
17793 // add concatenated word to the UDB (a concatenated word is a compound word) |
|
17794 AddCompoundWordToUdbL(); |
|
17795 |
|
17796 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
17797 MoveCursorToEndOfWordL(); |
|
17798 #endif |
|
17799 } |
|
17800 |
|
17801 |
|
17802 TKeyResponse CAknFepManager::HandlePredictiveNaviEventOutsideInlineEditL(TUint aCode, |
|
17803 TKeyPressLength aLength) |
|
17804 { |
|
17805 TKeyResponse response = EKeyWasNotConsumed; |
|
17806 |
|
17807 TWesternNaviEvent naviEvent = ENullNaviEvent; |
|
17808 if (aCode == EKeyLeftArrow) |
|
17809 { |
|
17810 naviEvent = ELeftNaviEvent; |
|
17811 } |
|
17812 else if (aCode == EKeyRightArrow) |
|
17813 { |
|
17814 naviEvent = ERightNaviEvent; |
|
17815 } |
|
17816 else if (aCode == EKeyBackspace) |
|
17817 { |
|
17818 naviEvent = EBackspaceEvent; |
|
17819 } |
|
17820 |
|
17821 TInt nextCharPos = 0; // Character ordinal in logical memory (0 - n-1) |
|
17822 TBool nextPositionFound = EFalse; |
|
17823 if ( naviEvent == ERightNaviEvent ) |
|
17824 { |
|
17825 nextPositionFound = GetNextVisualRightCharacter( nextCharPos ); |
|
17826 } |
|
17827 else if ( naviEvent == ELeftNaviEvent ) |
|
17828 { |
|
17829 nextPositionFound = GetNextVisualLeftCharacter( nextCharPos ); |
|
17830 } |
|
17831 else if ( naviEvent == EBackspaceEvent ) |
|
17832 { |
|
17833 if (iLanguageCapabilities.iRightToLeftLanguage) |
|
17834 { |
|
17835 TChar character = PreviousChar(); |
|
17836 TChar::TBdCategory bdCategory = character.GetBdCategory(); |
|
17837 // In case last character in buffer is number or Latin characters, needs to delete |
|
17838 // character from left. |
|
17839 if (TChar::EEuropeanNumber == bdCategory || TChar::EArabicNumber == bdCategory || |
|
17840 TChar::ELeftToRight == bdCategory ) |
|
17841 { |
|
17842 nextPositionFound = GetNextVisualLeftCharacter( nextCharPos ); |
|
17843 } |
|
17844 else |
|
17845 { |
|
17846 nextPositionFound = GetNextVisualRightCharacter( nextCharPos ); |
|
17847 } |
|
17848 } |
|
17849 else |
|
17850 { |
|
17851 nextPositionFound = GetNextVisualLeftCharacter( nextCharPos ); |
|
17852 } |
|
17853 } |
|
17854 |
|
17855 if ( !nextPositionFound ) |
|
17856 { |
|
17857 response = EKeyWasNotConsumed; |
|
17858 } |
|
17859 else // not looping - lets see what to do |
|
17860 { |
|
17861 TBuf<ESingleCharacter> characterBuffer; |
|
17862 iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(characterBuffer, |
|
17863 nextCharPos, |
|
17864 ESingleCharacter); |
|
17865 |
|
17866 if ( !IsValidInLineCharacter( STATIC_CAST(TChar, characterBuffer[0])) ) |
|
17867 { |
|
17868 // if the character is a non-alpha character; let it go |
|
17869 response=EKeyWasNotConsumed; |
|
17870 if (IsFlagSet(EFlagCompoundWord)) |
|
17871 { |
|
17872 if (STATIC_CAST(TChar, characterBuffer[0]).IsSpace()) |
|
17873 // we are navigating over a space so add any current compond word to the udb |
|
17874 AddCompoundWordToUdbL(); |
|
17875 ClearFlag(EFlagCompoundWord); |
|
17876 } |
|
17877 //allow to popup editsubmenu |
|
17878 ClearCcpuFlag(ECcpuStateIgnoreStarUp); |
|
17879 } |
|
17880 else |
|
17881 { |
|
17882 if (FepUI()->HandleKeyL(aCode, aLength)) |
|
17883 { |
|
17884 response=EKeyWasConsumed; |
|
17885 } |
|
17886 } |
|
17887 } |
|
17888 return response; |
|
17889 } |
|
17890 |
|
17891 /** |
|
17892 * Call back function: |
|
17893 */ |
|
17894 TInt CAknFepManager::DoSimulateKey(TAny* aThisPtr) |
|
17895 { |
|
17896 CAknFepManager* myobj = static_cast<CAknFepManager*>(aThisPtr); |
|
17897 TRAPD(error, myobj->HandleOwnedSimulateKeyL()); |
|
17898 return error; |
|
17899 } |
|
17900 |
|
17901 void CAknFepManager::HandleOwnedSimulateKeyL() |
|
17902 { |
|
17903 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
17904 #ifdef __HALF_QWERTY_KEYPAD |
|
17905 if( KeyboardLayout() == EPtiKeyboardHalfQwerty ) |
|
17906 { |
|
17907 CCoeEnv::Static()->SimulateKeyEventL( iHalfQwertyLastKeyEvent, EEventKey ); |
|
17908 } |
|
17909 else |
|
17910 #endif //__HALF_QWERTY_KEYPAD |
|
17911 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
17912 if (iSimulateKey > 0) |
|
17913 { |
|
17914 HandleKeyEventL(iSimulateKey, EShortKeyPress); |
|
17915 iSimulateKey = 0; |
|
17916 } |
|
17917 } |
|
17918 |
|
17919 /** |
|
17920 * This method is that the label of CBA is updated by aTextResId. |
|
17921 * @param aPosition CBA position, either ELeftSoftkeyIndex or ERightSoftkeyIndex |
|
17922 * @param aCommandId command id for softkey |
|
17923 * @param aTextResId resource id to set string on label. |
|
17924 * @return TBool The return value is ETrue in case it is necessary to update CBA. |
|
17925 */ |
|
17926 TBool CAknFepManager::UpdateCBALabelL(TInt aPosition, TInt aCommandId, TInt aTextResId) |
|
17927 { |
|
17928 return iUiInterface->UpdateSoftkeyLabelL(aPosition, aCommandId, aTextResId); |
|
17929 } |
|
17930 |
|
17931 void CAknFepManager::DoLaunchSctAndPctL(TInt aResourceId, TShowSctMode aShowSctMode) |
|
17932 { |
|
17933 TBool replace = EFalse; |
|
17934 TBool disableRecentItemRow = EFalse; |
|
17935 |
|
17936 if (ExtendedInputCapabilities() & CAknExtendedInputCapabilities::EDisableSCT) |
|
17937 { |
|
17938 // The editor doesn't allow SCT. |
|
17939 return; |
|
17940 } |
|
17941 if ( EditorType() == CAknExtendedInputCapabilities::EEikSecretEditorBased ) |
|
17942 { |
|
17943 |
|
17944 disableRecentItemRow = ETrue; |
|
17945 } |
|
17946 |
|
17947 if (IsCcpuFlagSet(ECcpuStateCbaSymbol) && |
|
17948 iMode == ELatin && WesternPredictive(ELatin) && |
|
17949 iPtiEngine->LastEnteredKey() == EPtiKey1) |
|
17950 { |
|
17951 // User is entering special character as result of pressing key '1' and |
|
17952 // cycling through candidates until left softkey turns into "Symbol". In |
|
17953 // that case we want to replace last cahracter instead of adding new one. |
|
17954 replace = ETrue; |
|
17955 } |
|
17956 |
|
17957 //Commit characters in latin multitap as some editors may call CancelFepTransaction() |
|
17958 //which will be received before the focus change notification. |
|
17959 if (IsFeatureSupportedJapanese()) |
|
17960 { |
|
17961 TryCloseUiL(); |
|
17962 } |
|
17963 else |
|
17964 { |
|
17965 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
17966 if(!(WesternPredictive())) |
|
17967 #endif |
|
17968 CommitInlineEditL(); |
|
17969 } |
|
17970 |
|
17971 if (!EditorHasFreeSpace()) |
|
17972 { |
|
17973 return; |
|
17974 } |
|
17975 |
|
17976 // get the SCT resource id from editor default settings |
|
17977 TInt currentEditorSCTResId = GetCurrentEditorSCTResId(); |
|
17978 TInt charMap = aResourceId; |
|
17979 if ( FeatureManager::FeatureSupported(KFeatureIdChinese) ) |
|
17980 { |
|
17981 if (charMap == R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG) |
|
17982 { |
|
17983 charMap = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_CHINESE; |
|
17984 } |
|
17985 } |
|
17986 if (!charMap) |
|
17987 { |
|
17988 // override numeric keymap if necessary. flag is for non standard charmaps |
|
17989 TInt standardNumericCharMap = EDefaultNumericCharMapResId; |
|
17990 if ((iMode == ENumber || iMode == ENativeNumber) && |
|
17991 !(iAknEditorFlags & EAknEditorFlagUseSCTNumericCharmap) && |
|
17992 (iCharWidth == EHalfWidthChar) && |
|
17993 ( (iAknEditorNumericKeymap != EAknEditorAlphanumericNumberModeKeymap) || |
|
17994 (iPermittedInputModes == EAknEditorNumericInputMode) )) |
|
17995 { |
|
17996 standardNumericCharMap = NumericModeSCTResourceId(); |
|
17997 } |
|
17998 charMap = standardNumericCharMap; |
|
17999 } |
|
18000 |
|
18001 if ( charMap == ENoCharacters && !IsAbleToLaunchSCT()) |
|
18002 { |
|
18003 currentEditorSCTResId = charMap; |
|
18004 } |
|
18005 |
|
18006 if (currentEditorSCTResId) |
|
18007 { |
|
18008 TBuf<32> specialChars; |
|
18009 |
|
18010 TInt sctChars = EAknSCTChiChineseInputModes; |
|
18011 TInt afterSctChars = EAknSCTHalfCase; |
|
18012 |
|
18013 if (iCharWidth == EFullWidthChar) |
|
18014 { |
|
18015 sctChars = EAknSCTFullCase; |
|
18016 if (iMode == ELatin) |
|
18017 { |
|
18018 afterSctChars = EAknSCTUpperCase; |
|
18019 if (iCaseMan->CurrentCase() == EAknEditorLowerCase) |
|
18020 { |
|
18021 afterSctChars = EAknSCTLowerCase; |
|
18022 } |
|
18023 } |
|
18024 else if (iMode == ENumber||iMode == ENativeNumber) |
|
18025 { |
|
18026 afterSctChars = EAknSCTLowerCase; |
|
18027 } |
|
18028 } |
|
18029 else |
|
18030 { |
|
18031 if (iMode == ELatin) |
|
18032 { |
|
18033 if ( FeatureManager::FeatureSupported(KFeatureIdChinese) ) |
|
18034 { |
|
18035 sctChars = EAknSCTChiLatinInputModes; |
|
18036 } |
|
18037 else |
|
18038 { |
|
18039 if (iQwertyInputMode) |
|
18040 { |
|
18041 sctChars = EAknSCTQwerty; |
|
18042 afterSctChars = EAknSCTFullCase; |
|
18043 } |
|
18044 else |
|
18045 { |
|
18046 sctChars = EAknSCTUpperCase; |
|
18047 afterSctChars = EAknSCTFullCase; |
|
18048 if (iCaseMan->CurrentCase() == EAknEditorLowerCase) |
|
18049 { |
|
18050 sctChars = EAknSCTLowerCase; |
|
18051 } |
|
18052 } |
|
18053 } |
|
18054 } |
|
18055 else if (iMode == ENumber||iMode == ENativeNumber) |
|
18056 { |
|
18057 sctChars = EAknSCTNumeric; |
|
18058 if ( ((iAknEditorFlags & EAknEditorFlagUseSCTNumericCharmap) || |
|
18059 (iAknEditorNumericKeymap == EAknEditorAlphanumericNumberModeKeymap)) && |
|
18060 !IsOnlyHalfWidthCharacterPermitted() ) |
|
18061 { |
|
18062 sctChars = EAknSCTLowerCase; |
|
18063 afterSctChars = EAknSCTFullCase; |
|
18064 } |
|
18065 } |
|
18066 else if (iMode == EHiraganaKanji) |
|
18067 { |
|
18068 sctChars = EAknSCTFullCase; |
|
18069 } |
|
18070 else if(iMode == EKatakana) |
|
18071 { |
|
18072 sctChars = EAknSCTHalfCase; |
|
18073 afterSctChars = EAknSCTFullCase; |
|
18074 } |
|
18075 } |
|
18076 |
|
18077 SetFlag(EFlagForegroundUIComponentVisible); |
|
18078 |
|
18079 TBool showAnotherTable = EFalse; |
|
18080 if (IsFeatureSupportedJapanese()) |
|
18081 { |
|
18082 if (sctChars == EAknSCTFullCase) |
|
18083 { |
|
18084 if (!IsOnlyFullWidthCharacterPermitted()) |
|
18085 { |
|
18086 showAnotherTable = ETrue; |
|
18087 } |
|
18088 } |
|
18089 else if (sctChars == EAknSCTHalfCase || sctChars == EAknSCTUpperCase |
|
18090 || sctChars == EAknSCTLowerCase) |
|
18091 { |
|
18092 if (!IsOnlyHalfWidthCharacterPermitted() |
|
18093 && !(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly)) |
|
18094 { |
|
18095 showAnotherTable = ETrue; |
|
18096 } |
|
18097 } |
|
18098 } |
|
18099 #ifdef RD_SCALABLE_UI_V2 |
|
18100 if( iFepFullyConstructed && !iFepPluginManager->IsGlobleNotes()) |
|
18101 { |
|
18102 if (iFepPluginManager->PluginInputMode() == EPluginInputModeItut || |
|
18103 iFepPluginManager->PluginInputMode() == EPluginInputModeFSQ || |
|
18104 iFepPluginManager->PluginInputMode() == EPluginInputModeFingerHwr) |
|
18105 { |
|
18106 SetStopProcessFocus(ETrue, EFalse); |
|
18107 iFepPluginManager->SetMenuState(); |
|
18108 } |
|
18109 else if (!iFepPluginManager->IsGlobleNotes()) |
|
18110 { |
|
18111 iFepPluginManager->ClosePluginInputUiL( ETrue ); |
|
18112 } |
|
18113 } |
|
18114 #endif |
|
18115 |
|
18116 TBool lockNumericKeys = ( iPtiEngine->IsQwertyBasedMode(iPtiEngine->InputMode())) |
|
18117 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
18118 || ( iPtiEngine->InputMode() == EPtiEngineHalfQwerty ) || |
|
18119 ( iPtiEngine->InputMode() == EPtiEngineHalfQwertyPredictive ) |
|
18120 #endif |
|
18121 ; |
|
18122 TUid fepUid = CCoeEnv::Static()->FepUid(); |
|
18123 |
|
18124 if(IsAbleToLaunchSmiley()) |
|
18125 { |
|
18126 if(aShowSctMode == EShowSmileyFirst) |
|
18127 { |
|
18128 sctChars |= EAknCharMapEmotionFirst; |
|
18129 } |
|
18130 else |
|
18131 { |
|
18132 sctChars |= EAknCharMapEmotionUse; |
|
18133 } |
|
18134 } |
|
18135 ClearExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
18136 |
|
18137 if (iUiInterface->CharMapDialogL( |
|
18138 sctChars, |
|
18139 specialChars, |
|
18140 charMap, |
|
18141 lockNumericKeys, |
|
18142 aShowSctMode==EShowPctFirst, |
|
18143 !IsAbleToLaunchPCT(), |
|
18144 showAnotherTable, |
|
18145 afterSctChars, |
|
18146 currentEditorSCTResId, |
|
18147 disableRecentItemRow)) |
|
18148 { |
|
18149 PrepareFepAfterDialogExitL(fepUid); |
|
18150 SetCcpuFlag(ECcpuStateSupressCursorMoveToEnd); |
|
18151 |
|
18152 #ifdef RD_SCALABLE_UI_V2 |
|
18153 |
|
18154 if( iFepFullyConstructed && iFepPluginManager) |
|
18155 { |
|
18156 if (iFepPluginManager->PluginInputMode() == EPluginInputModeItut || |
|
18157 iFepPluginManager->PluginInputMode() == EPluginInputModeFSQ || |
|
18158 iFepPluginManager->PluginInputMode() == EPluginInputModeFingerHwr) |
|
18159 { |
|
18160 SetStopProcessFocus(EFalse); |
|
18161 } |
|
18162 else |
|
18163 { |
|
18164 HandleChangeInFocus(); |
|
18165 } |
|
18166 } |
|
18167 else |
|
18168 { |
|
18169 HandleChangeInFocus(); |
|
18170 } |
|
18171 // Set the flag, not change focus for next. |
|
18172 iDisalbleFocusChangeForSCT = ETrue; |
|
18173 #endif |
|
18174 |
|
18175 //Removes auto-complition part if SCT is launched and any special character is selected |
|
18176 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
18177 if( specialChars.Length() > 0 ) |
|
18178 { |
|
18179 RemoveSuggestedAdvanceCompletionL(); |
|
18180 } |
|
18181 #endif // RD_INTELLIGENT_TEXT_INPUT |
|
18182 TBuf<ESingleCharacter> charAsDesc(ESingleCharacter); |
|
18183 for ( TInt ii = 0; ii < specialChars.Length(); ii++) |
|
18184 { |
|
18185 charAsDesc[0]=(TText)specialChars[ii]; |
|
18186 |
|
18187 if (iInputCapabilities.SupportsSecretText()) |
|
18188 { |
|
18189 TChar ch = charAsDesc[0]; |
|
18190 if (ch == TText(0x000A) || ch == TText(CEditableText::EParagraphDelimiter)) |
|
18191 // 0x000A is ascii, EParagraphDelimiter is unicode - future |
|
18192 // proofs against sct changing to unicode |
|
18193 ch = EKeyEnter; |
|
18194 if (CharIsValidInEditor(ch)) |
|
18195 { |
|
18196 //we receive an extra key press if we simulate a key that is also a device key |
|
18197 if (ch.IsDigit() || TUint(ch) == EStarKeyUnicodeValue |
|
18198 || TUint(ch) == EHashKeyUnicodeValue) |
|
18199 SetFlag(EFlagPassNextKey); |
|
18200 SimulateKeyEventL(ch); |
|
18201 } |
|
18202 } |
|
18203 else |
|
18204 { |
|
18205 if (charAsDesc[0] == TText(0x000A)) // 0x000A is line feed |
|
18206 { |
|
18207 charAsDesc[0] = CEditableText::EParagraphDelimiter; |
|
18208 } |
|
18209 |
|
18210 if (CharIsValidInEditor(charAsDesc[0])) |
|
18211 { |
|
18212 TCursorSelection cursorSelection(0,0); |
|
18213 if ((iAknEditorFlags & EAknEditorFlagMTAutoOverwrite) && iMode == ELatin |
|
18214 && !WesternPredictive()) |
|
18215 { |
|
18216 TInt edSize = |
|
18217 iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
18218 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
18219 if (iUncommittedText.iCursorPos < edSize |
|
18220 && iUncommittedText.Length() == 0) |
|
18221 { |
|
18222 cursorSelection = TCursorSelection(iUncommittedText.iCursorPos + 1, |
|
18223 iUncommittedText.iAnchorPos); |
|
18224 } |
|
18225 } |
|
18226 if (EditorState()) |
|
18227 { |
|
18228 if (charAsDesc[0] == CEditableText::EParagraphDelimiter) |
|
18229 { |
|
18230 // This is line feed character. Post it to editor and let it decide |
|
18231 // if it is valid. |
|
18232 if (!(iAknEditorFlags & EAknEditorFlagFindPane) |
|
18233 && specialChars.Length() == 1) |
|
18234 { |
|
18235 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
18236 CommitInlineEditL(); |
|
18237 #endif |
|
18238 |
|
18239 SimulateKeyEventL(EKeyEnter); |
|
18240 SimulateKeyEventL(EKeyF19); // Asyncronous case update |
|
18241 } |
|
18242 } |
|
18243 else |
|
18244 { |
|
18245 if (replace) |
|
18246 { |
|
18247 TKeyEvent delKey = {8, EStdKeyBackspace, 1, 0}; |
|
18248 CCoeEnv::Static()->SimulateKeyEventL(delKey, EEventKey); |
|
18249 } |
|
18250 InsertTextFromDialogL(charAsDesc, cursorSelection); |
|
18251 //There may be several char to be inserted, need disable Focus change to avoid multi-focus change. |
|
18252 #ifdef RD_SCALABLE_UI_V2 |
|
18253 iDisalbleFocusChangeForSCT = ETrue; |
|
18254 #endif |
|
18255 } |
|
18256 // Clear dead key, vowel sequence and vietnamese tone mark states. |
|
18257 iPtiEngine->HandleCommandL(EPtiCommandGetAndClearLastVietnameseChar, |
|
18258 NULL); |
|
18259 iPtiEngine->HandleCommandL(EPtiCommandClearVowelSeq, |
|
18260 NULL); |
|
18261 iPtiEngine->HandleCommandL(EPtiCommandGetAndClearDeadKeyRootChar, |
|
18262 NULL); |
|
18263 } |
|
18264 } |
|
18265 } |
|
18266 } |
|
18267 } |
|
18268 else |
|
18269 { |
|
18270 iClosePeninputUi = EFalse; |
|
18271 iStopProcessFocus = EFalse; |
|
18272 } |
|
18273 |
|
18274 PrepareFepAfterDialogExitL(fepUid); |
|
18275 } |
|
18276 } |
|
18277 |
|
18278 /** |
|
18279 * Queries supportting of SecretText |
|
18280 * |
|
18281 * @since 2.6 |
|
18282 * @return ETrue if SecretText was supported |
|
18283 */ |
|
18284 TBool CAknFepManager::IsSupportsSecretText() const |
|
18285 { |
|
18286 TBool bSecret = iInputCapabilities.SupportsSecretText(); |
|
18287 if( !bSecret ) |
|
18288 { |
|
18289 //test java editor |
|
18290 MObjectProvider* mop = iInputCapabilities.ObjectProvider(); |
|
18291 if ( mop ) |
|
18292 { |
|
18293 CAknExtendedInputCapabilities* extendedInputCapabilities; |
|
18294 extendedInputCapabilities = mop->MopGetObject( extendedInputCapabilities ); |
|
18295 if ( extendedInputCapabilities ) |
|
18296 { |
|
18297 TUint constraints = extendedInputCapabilities->MIDPConstrainst(); |
|
18298 if( constraints & 0x10000 ) |
|
18299 { |
|
18300 bSecret = ETrue; |
|
18301 } |
|
18302 } |
|
18303 } |
|
18304 } |
|
18305 |
|
18306 return bSecret; |
|
18307 } |
|
18308 |
|
18309 void CAknFepManager::SendEventsToPluginManL( TInt aEventType, TInt aEventData ) |
|
18310 { |
|
18311 #ifdef RD_SCALABLE_UI_V2 |
|
18312 if ( iFepFullyConstructed ) |
|
18313 { |
|
18314 iFepPluginManager->HandleEventsFromFepL( aEventType, aEventData ); |
|
18315 } |
|
18316 #endif //RD_SCALABLE_UI_V2 |
|
18317 } |
|
18318 |
|
18319 void CAknFepManager::UpdateCangJieState(TInt aNewMode) |
|
18320 { |
|
18321 CAknFepUIManagerChinese* fepUiMgr = STATIC_CAST(CAknFepUIManagerChinese*, |
|
18322 iLangMan->GetFepUI(ECangJie, ENoneWidthChar, EFalse)); |
|
18323 |
|
18324 if (aNewMode >= 0) |
|
18325 { |
|
18326 if ( fepUiMgr ) |
|
18327 { |
|
18328 fepUiMgr->UpdateCangJieState(); |
|
18329 } |
|
18330 |
|
18331 // Store CangJie settings into the sharedata |
|
18332 iSharedDataInterface->SetCangJieMode(aNewMode); |
|
18333 } |
|
18334 } |
|
18335 |
|
18336 TInt CAknFepManager::LaunchCangJieOptionDlgL() |
|
18337 { |
|
18338 // Get the CangJie level from the GS |
|
18339 TInt currentLevel = iSharedDataInterface->CangJieMode(); |
|
18340 |
|
18341 if ((currentLevel != ECangJieNormal) |
|
18342 && (currentLevel != ECangJieEasy) |
|
18343 && (currentLevel != ECangJieAdvanced)) |
|
18344 return KErrGeneral; |
|
18345 |
|
18346 // Launch the CangJie setting menu |
|
18347 CDesCArrayFlat* items = CCoeEnv::Static()->ReadDesC16ArrayResourceL(R_AVKON_CANGJIE_OPTIONS_LBX); |
|
18348 CleanupStack::PushL(items); |
|
18349 |
|
18350 TUid fepUid = CCoeEnv::Static()->FepUid(); |
|
18351 ClearExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
18352 TInt ret = iUiInterface->LaunchCangJieOptionDlgL( |
|
18353 R_AVKON_CANGJIE_MODE_OPTIONS_SETTING_PAGE, |
|
18354 currentLevel, |
|
18355 items |
|
18356 ); |
|
18357 PrepareFepAfterDialogExitL(fepUid); |
|
18358 |
|
18359 CleanupStack::PopAndDestroy(items); |
|
18360 |
|
18361 return ret ? currentLevel : KErrGeneral; |
|
18362 } |
|
18363 |
|
18364 GLDEF_C void AknFepPanic(TAknFepPanic aPanic) |
|
18365 { |
|
18366 User::Panic(_L("AKNFEP"),aPanic); |
|
18367 } |
|
18368 |
|
18369 /** |
|
18370 * Set Multitap timer value. |
|
18371 * |
|
18372 * @since 3.0 |
|
18373 * @param Value of KAknFepMultiTapTimer setting |
|
18374 */ |
|
18375 void CAknFepManager::SetMultiTapTimer(const TInt aMultiTapTimer) |
|
18376 { |
|
18377 if (iMultiTapTimer != aMultiTapTimer) |
|
18378 { |
|
18379 iMultiTapTimer = aMultiTapTimer; |
|
18380 } |
|
18381 } |
|
18382 |
|
18383 /** |
|
18384 * Set Japanese Qwerty Flags value. |
|
18385 * |
|
18386 * @since 3.0 |
|
18387 * @param Value of KAknFepJapaneseSpecialCharFlag setting |
|
18388 */ |
|
18389 void CAknFepManager::SetJapaneseQwertyFlags(const TInt aJapaneseQwertyFlags) |
|
18390 { |
|
18391 if (iJapaneseQwertyFlags != aJapaneseQwertyFlags) |
|
18392 { |
|
18393 iJapaneseQwertyFlags = aJapaneseQwertyFlags; |
|
18394 } |
|
18395 } |
|
18396 |
|
18397 /** |
|
18398 * Handle the Chr Key Monitor |
|
18399 * for Japanese variant only. |
|
18400 * |
|
18401 * @since 3.0 |
|
18402 * @return KErrNone if succeed, KErrDied if failed |
|
18403 */ |
|
18404 TInt CAknFepManager::HandleChrKeyMonitorCallback(TAny* aObj) |
|
18405 { |
|
18406 TRAPD(err, static_cast<CAknFepManager*>(aObj)->HandleChrKeyMonitorL()); |
|
18407 if (err) |
|
18408 { |
|
18409 static_cast<CAknFepManager*>(aObj)->CleanUpFep(); |
|
18410 return KErrDied; |
|
18411 } |
|
18412 return KErrNone; |
|
18413 } |
|
18414 |
|
18415 /** |
|
18416 * Handle the Chr Key Monitor |
|
18417 * for Japanese variant only. |
|
18418 * |
|
18419 * @since 3.0 |
|
18420 */ |
|
18421 void CAknFepManager::HandleChrKeyMonitorL() |
|
18422 { |
|
18423 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
18424 #ifdef __HALF_QWERTY_KEYPAD |
|
18425 if ( IsFlagSet(EFlagQwertyChrKeyDepressed) && |
|
18426 IsFlagSet(EFlagNoActionDuringChrKeyPress) && |
|
18427 (EPtiKeyboardHalfQwerty == KeyboardLayout() ) && |
|
18428 ( iWesternPredictive || iMode == EPinyin || |
|
18429 iMode == EStroke || iMode == EZhuyin ) ) |
|
18430 { |
|
18431 // Clear the chr key depressed flag |
|
18432 TBool validchr = FepUI()->IsValidLongChrKeyPress(); |
|
18433 |
|
18434 if(!validchr || !IsAbleToLaunchSCT() ) |
|
18435 { |
|
18436 FepUI()->HandleKeyL( EStdKeyLeftFunc, EShortKeyPress ); |
|
18437 ClearFlag( EFlagQwertyChrKeyDepressed | EFlagNoActionDuringChrKeyPress); |
|
18438 } |
|
18439 else |
|
18440 { |
|
18441 // will launch SCT later |
|
18442 iChrLongKeyPress = ETrue; |
|
18443 } |
|
18444 |
|
18445 } |
|
18446 else |
|
18447 #endif |
|
18448 #endif |
|
18449 if (IsFlagSet(EFlagQwertyChrKeyDepressed) && IsFlagSet(EFlagNoActionDuringChrKeyPress) |
|
18450 && iCurrentFepUI->IsValidShiftKeyPress()) |
|
18451 { |
|
18452 // Timer cancel |
|
18453 iChrKeypressMonitor->Cancel(); |
|
18454 // Commit characters |
|
18455 HandleChangeInFocus(); |
|
18456 // Clear flags |
|
18457 ClearFlag(EFlagQwertyChrKeyDepressed | EFlagNoActionDuringChrKeyPress); |
|
18458 // Open editting menu |
|
18459 LaunchSelectModeMenuL(); |
|
18460 } |
|
18461 } |
|
18462 |
|
18463 |
|
18464 // ----------------------------------------------------------------------------- |
|
18465 // CAknFepManager::SetCursorSelectionL |
|
18466 // Set editor cursor selection. |
|
18467 // (other items were commented in a header). |
|
18468 // ----------------------------------------------------------------------------- |
|
18469 // |
|
18470 void CAknFepManager::SetCursorSelectionL(const TCursorSelection& /*aCurSel*/, TBool /*aSyncCursor*/) |
|
18471 { |
|
18472 } |
|
18473 |
|
18474 TInt CAknFepManager::HandleResourceChangedCallback(TAny* aObj) |
|
18475 { |
|
18476 TRAPD(err, static_cast<CAknFepManager*>(aObj)->ResourceChangedTimeroutL()); |
|
18477 if (err) |
|
18478 { |
|
18479 static_cast<CAknFepManager*>(aObj)->CleanUpFep(); |
|
18480 return KErrNoMemory; |
|
18481 } |
|
18482 return KErrNone; |
|
18483 } |
|
18484 |
|
18485 void CAknFepManager::ResourceChangedTimeroutL() |
|
18486 { |
|
18487 if(iCurrentFepUI) |
|
18488 { |
|
18489 iCurrentFepUI->ResourceChanged(1); |
|
18490 } |
|
18491 } |
|
18492 |
|
18493 |
|
18494 // ----------------------------------------------------------------------------- |
|
18495 // pen related inplementation |
|
18496 // ----------------------------------------------------------------------------- |
|
18497 #ifdef RD_SCALABLE_UI_V2 |
|
18498 |
|
18499 // ----------------------------------------------------------------------------- |
|
18500 // CAknFepManager::HandleLayoutChange |
|
18501 // Update plugin UI case mode. |
|
18502 // (other items were commented in a header). |
|
18503 // ----------------------------------------------------------------------------- |
|
18504 // |
|
18505 void CAknFepManager::HandleResourceChange(TInt aType) |
|
18506 { |
|
18507 if(iCurrentFepUI) |
|
18508 { |
|
18509 iAsyncResouceChanged.CallBack(); |
|
18510 } |
|
18511 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
18512 if(iCandidatePopup && iPtiEngine && (aType == KEikDynamicLayoutVariantSwitch)) |
|
18513 { |
|
18514 //When there is a change of layout, the inline text position changes and hence the candidate |
|
18515 //list position also needs to change accordingly. |
|
18516 //We need the editor to be brought back to focus, this is because we need the position of |
|
18517 //the inline text. |
|
18518 iCandidatePopup->UnFocus(); |
|
18519 //Need to get the editor state back after it is brought back to focus. |
|
18520 TRAP_IGNORE( HandleChangeInFocusL()); |
|
18521 |
|
18522 // Add candidate list control stack to get the layout change event |
|
18523 // after dialog control...... |
|
18524 TRAP_IGNORE( iCandidatePopup->SetFocusAddStackReducePriorityL() ); |
|
18525 |
|
18526 } |
|
18527 #endif |
|
18528 TRAP_IGNORE(SendEventsToPluginManL( EPluginResourceChanged, aType )); |
|
18529 } |
|
18530 void CAknFepManager::HandlePointerEventL(const TPointerEvent& aPointerEvent) |
|
18531 { |
|
18532 if (IsFlagSet(CAknFepManager::EFlagNoMatches)) |
|
18533 { |
|
18534 ClearFlag(CAknFepManager::EFlagNoMatches); |
|
18535 } |
|
18536 |
|
18537 if(aPointerEvent.iType == TPointerEvent::EDrag) |
|
18538 { |
|
18539 SetExtendedFlag(EExtendedFlagPointerEventTypeEDrag); |
|
18540 } |
|
18541 if (aPointerEvent.iType == TPointerEvent::EButton1Up) |
|
18542 { |
|
18543 ClearExtendedFlag(EExtendedFlagPointerEventTypeEDrag); |
|
18544 |
|
18545 // Remember last up-click in case it is needed for displaying |
|
18546 // stylus ccpu-menu. |
|
18547 iClickPoint = aPointerEvent.iPosition; |
|
18548 } |
|
18549 } |
|
18550 |
|
18551 // ----------------------------------------------------------------------------- |
|
18552 // CAknFepManager::HandleSelModeArrowKeyEventL |
|
18553 // Set text selection when tap on the arrow keys. |
|
18554 // (other items were commented in a header). |
|
18555 // ----------------------------------------------------------------------------- |
|
18556 // |
|
18557 TBool CAknFepManager::HandleSelModeArrowKeyEventL(const TKeyEvent& aKeyEvent, |
|
18558 TEventCode aEventCode, |
|
18559 TKeyResponse& aRetCode) |
|
18560 { |
|
18561 TCursorSelection currentEditorSelection(0,0); |
|
18562 if(iInputCapabilities.FepAwareTextEditor()) |
|
18563 { |
|
18564 iInputCapabilities.FepAwareTextEditor()-> |
|
18565 GetCursorSelectionForFep(currentEditorSelection); |
|
18566 } |
|
18567 |
|
18568 if(!IsMfneEditor() && |
|
18569 (PluginInputMode() == EPluginInputModeItut || |
|
18570 PluginInputMode() == EPluginInputModeFSQ) && |
|
18571 currentEditorSelection.Length() != 0) |
|
18572 { |
|
18573 |
|
18574 if ((aKeyEvent.iScanCode == EStdKeyLeftArrow) || (aKeyEvent.iScanCode == EStdKeyRightArrow)) |
|
18575 { |
|
18576 if (!(aKeyEvent.iModifiers & EModifierShift)) |
|
18577 { |
|
18578 TKeyEvent ccpuStart = aKeyEvent; |
|
18579 ccpuStart.iModifiers |= EModifierShift; |
|
18580 ccpuStart.iModifiers |= EModifierRightShift; |
|
18581 CCoeEnv::Static()->SimulateKeyEventL(ccpuStart, aEventCode); |
|
18582 |
|
18583 aRetCode = EKeyWasConsumed; |
|
18584 return ETrue; |
|
18585 } |
|
18586 else |
|
18587 { |
|
18588 aRetCode = EKeyWasNotConsumed; |
|
18589 return ETrue; |
|
18590 } |
|
18591 } |
|
18592 } |
|
18593 aRetCode = EKeyWasNotConsumed; |
|
18594 return EFalse; |
|
18595 } |
|
18596 |
|
18597 #else // !RD_SCALABLE_UI_V2 |
|
18598 // ----------------------------------------------------------------------------- |
|
18599 // CAknFepManager::HandleResourceChange |
|
18600 // Update plugin UI case mode. |
|
18601 // (other items were commented in a header). |
|
18602 // ----------------------------------------------------------------------------- |
|
18603 // |
|
18604 void CAknFepManager::HandleResourceChange(TInt aType) |
|
18605 { |
|
18606 if (iFepFullyConstructed && Japanese() ) |
|
18607 { |
|
18608 // Japaneseinput should handle the event of changing layout or screen. |
|
18609 FepUI()->ResourceChanged(aType); |
|
18610 } |
|
18611 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
18612 if(iCandidatePopup && iPtiEngine && (aType == KEikDynamicLayoutVariantSwitch)) |
|
18613 { |
|
18614 //When there is a change of layout, the inline text position changes and hence the candidate |
|
18615 //list position also needs to change accordingly. |
|
18616 //We need the editor to be brought back to focus, this is because we need the position of |
|
18617 //the inline text. |
|
18618 iCandidatePopup->UnFocus(); |
|
18619 //Need to get the editor state back after it is brought back to focus. |
|
18620 TRAP_IGNORE(HandleChangeInFocusL()); |
|
18621 //Can not do anything if FEP is not constructed fully |
|
18622 if(iFepFullyConstructed) |
|
18623 { |
|
18624 //Now we read the position of the inline text |
|
18625 TPoint inlineEditorTl; |
|
18626 TPoint inlineEditorBr; |
|
18627 TInt height; |
|
18628 TInt ascent; |
|
18629 TInt documentOffset = iPtiEngine->CurrentWord().Length(); |
|
18630 // Popup Position for RTL |
|
18631 if(iLanguageCapabilities.iRightToLeftLanguage) |
|
18632 documentOffset = 0; |
|
18633 // Popup Position for RTL |
|
18634 TRAP_IGNORE( GetScreenCoordinatesL( inlineEditorTl, height, ascent, documentOffset )); |
|
18635 inlineEditorTl.iY -= height; |
|
18636 TRAP_IGNORE( GetScreenCoordinatesL( inlineEditorBr, height, ascent )); |
|
18637 |
|
18638 //Let the candidate list know about a change of resource and update the |
|
18639 //inline text rectangle. |
|
18640 //Now show the candidate list at the re-calculated position |
|
18641 iCandidatePopup->ShowAtNewPosition(TRect(inlineEditorTl,inlineEditorBr)); |
|
18642 } |
|
18643 } |
|
18644 #endif |
|
18645 } |
|
18646 |
|
18647 #endif //RD_SCALABLE_UI_V2 |
|
18648 |
|
18649 TDigitType CAknFepManager::LocalDigit() |
|
18650 { |
|
18651 return iLanguageCapabilities.iLocalDigitType; |
|
18652 } |
|
18653 |
|
18654 /** |
|
18655 * Returns ETrue if arabic indic digit setting is on. |
|
18656 * |
|
18657 * @since 3.0 |
|
18658 */ |
|
18659 TBool CAknFepManager::ArabicIndicDigitsInUse() const |
|
18660 { |
|
18661 return (iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic); |
|
18662 } |
|
18663 |
|
18664 TBool CAknFepManager::EasternArabicIndicDigitsInUse() const |
|
18665 { |
|
18666 return (iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic); |
|
18667 } |
|
18668 |
|
18669 /** |
|
18670 * Sets delayed commit on (predicitve word will be commited in |
|
18671 * next call to TryCloseUiL. This is needed because of Japanese ReadingTextL). |
|
18672 * |
|
18673 * @since 3.1 |
|
18674 */ |
|
18675 void CAknFepManager::SetDelayedCommit() |
|
18676 { |
|
18677 iCcpuMode |= ECcpuStataCommitPredictiveWord; |
|
18678 } |
|
18679 |
|
18680 // ----------------------------------------------------------------------------- |
|
18681 // CAknFepManager::SetDefaultNumberMode |
|
18682 // |
|
18683 // Set default number mode for non-latin languagues |
|
18684 // |
|
18685 // Copied from CGSLangModel::SetDefaultNumberMode |
|
18686 // ----------------------------------------------------------------------------- |
|
18687 // |
|
18688 void CAknFepManager::SetDefaultNumberMode( TInt aMode, TInt aNbrModeType ) |
|
18689 { |
|
18690 //As aMode comes from the UI, it can either be 0 or 1. This needs |
|
18691 //special handling for Indic mode as it has been defined as an enum |
|
18692 //constant and has a value of 2. This applies to any values defined |
|
18693 //in the enum and have a value > 1. |
|
18694 if ( aNbrModeType == ENbrModeTypeArabic || |
|
18695 aNbrModeType == ENbrModeTypeEasternArabic ) |
|
18696 { |
|
18697 iSharedDataInterface->SetDefaultNumberMode( KSettingsDefaultNumberMode, aMode ); |
|
18698 } |
|
18699 else |
|
18700 { |
|
18701 iSharedDataInterface->SetDefaultNumberMode( KSettingsIndicDefaultNumberMode, aMode ); |
|
18702 } |
|
18703 |
|
18704 TLocale locale; |
|
18705 if ( aMode == ENbrModeLatin ) |
|
18706 { |
|
18707 locale.SetDigitType( EDigitTypeWestern ); |
|
18708 } |
|
18709 else |
|
18710 { |
|
18711 //if aMode != EGSNbrModeLatin, then it should be either latin or arabic. However |
|
18712 //as EGSNbrModeArabic and EGsNbrModeIndic both have a value = 1, we can't use |
|
18713 //that constant for below comparison. Hence, need to depend on the 2nd param. |
|
18714 switch ( aNbrModeType ) |
|
18715 { |
|
18716 case ENbrModeTypeArabic: |
|
18717 locale.SetDigitType( EDigitTypeArabicIndic ); |
|
18718 break; |
|
18719 case ENbrModeTypeIndic: |
|
18720 locale.SetDigitType( EDigitTypeDevanagari ); |
|
18721 break; |
|
18722 case ENbrModeTypeEasternArabic: |
|
18723 locale.SetDigitType( EDigitTypeEasternArabicIndic ); |
|
18724 break; |
|
18725 default: |
|
18726 break; |
|
18727 } |
|
18728 } |
|
18729 |
|
18730 locale.Set(); |
|
18731 } |
|
18732 |
|
18733 // ----------------------------------------------------------------------------- |
|
18734 // CAknFepManager::ResolveCurrentCandidateListIndex |
|
18735 // |
|
18736 // Calculates correct selection index for matches popup list. |
|
18737 // ----------------------------------------------------------------------------- |
|
18738 // |
|
18739 TInt CAknFepManager::ResolveCurrentCandidateListIndex(CDesCArrayFlat* aCandList) |
|
18740 { |
|
18741 if (iPtiEngine && aCandList) |
|
18742 { |
|
18743 TBuf<EMaximumFepWordLength> currentCand; |
|
18744 |
|
18745 currentCand.Copy(iPtiEngine->CurrentWord()); |
|
18746 for (TInt i = 0; i < aCandList->Count(); i++) |
|
18747 { |
|
18748 if (currentCand == aCandList->MdcaPoint(i)) |
|
18749 { |
|
18750 if (i == aCandList->Count() - 1) |
|
18751 { |
|
18752 return 0; |
|
18753 } |
|
18754 return i + 1; |
|
18755 } |
|
18756 } |
|
18757 } |
|
18758 |
|
18759 return 0; |
|
18760 } |
|
18761 |
|
18762 void CAknFepManager::AlignLogicalAndVisualCursorL( TTmDocPosSpec::TType aType, |
|
18763 TBool aToLeft ) |
|
18764 { |
|
18765 if( !( iInputCapabilities.SupportsSecretText() ) ) |
|
18766 { |
|
18767 if( IsFlagSet( EFlagInsideInlineEditingTransaction ) && |
|
18768 IsFlagSet( EFlagInsideMultitapInlineEditingTransaction ) ) |
|
18769 { |
|
18770 CommitInlineEditL(); |
|
18771 } |
|
18772 |
|
18773 MCoeFepAwareTextEditor* fepAwareTextEditor = |
|
18774 iInputCapabilities.FepAwareTextEditor(); |
|
18775 |
|
18776 MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
18777 if( (docNavi || TextLayout()) && fepAwareTextEditor ) |
|
18778 { |
|
18779 TTmDocPosSpec pos = DocPos(); |
|
18780 pos.iType = aType; |
|
18781 TTmPosInfo2 info; |
|
18782 if (docNavi) |
|
18783 { |
|
18784 docNavi->GetNextVisualCursorPos( pos, info, aToLeft ); |
|
18785 } |
|
18786 else |
|
18787 { |
|
18788 TextLayout()->TagmaTextLayout().GetNextVisualCursorPos( pos, info, aToLeft ); |
|
18789 } |
|
18790 TCursorSelection curSel( info.iDocPos.iPos, info.iDocPos.iPos ); |
|
18791 fepAwareTextEditor->SetCursorSelectionForFepL( curSel ); |
|
18792 } |
|
18793 } |
|
18794 } |
|
18795 |
|
18796 void CAknFepManager::RemoveRephaCharacterL() |
|
18797 { |
|
18798 MCoeFepAwareTextEditor* fepAwareTextEditor = |
|
18799 iInputCapabilities.FepAwareTextEditor(); |
|
18800 |
|
18801 if( fepAwareTextEditor ) |
|
18802 { |
|
18803 TInt previousCharPos = 0; |
|
18804 TBool leftFlag = GetNextVisualLeftCharacter( previousCharPos ); |
|
18805 |
|
18806 if( !leftFlag ) |
|
18807 { |
|
18808 return; |
|
18809 } |
|
18810 |
|
18811 TCursorSelection curSel; |
|
18812 fepAwareTextEditor->GetCursorSelectionForFep( curSel ); |
|
18813 |
|
18814 TInt lowerPos = curSel.LowerPos(); |
|
18815 if( lowerPos > 1 ) |
|
18816 { |
|
18817 const TInt rephaLength( 2 ); |
|
18818 TBuf<rephaLength> previousCharacter; |
|
18819 previousCharacter.FillZ(); |
|
18820 |
|
18821 fepAwareTextEditor-> |
|
18822 GetEditorContentForFep( previousCharacter, |
|
18823 previousCharPos, rephaLength ); |
|
18824 |
|
18825 if (rephaLength == previousCharacter.Length()) |
|
18826 { |
|
18827 if( previousCharacter[0] == TAknFepUiIndicInputManager::RaCharacter( |
|
18828 TLanguage( iLanguageCapabilities.iInputLanguageCode ) ) && |
|
18829 previousCharacter[1] == TAknFepUiIndicInputManager::Virama( |
|
18830 TLanguage( iLanguageCapabilities.iInputLanguageCode ) ) ) |
|
18831 { |
|
18832 curSel.iAnchorPos = previousCharPos; |
|
18833 curSel.iCursorPos = previousCharPos + rephaLength; |
|
18834 |
|
18835 // Remove the repha |
|
18836 |
|
18837 if( IsFlagSet( EFlagInsideInlineEditingTransaction ) && |
|
18838 IsFlagSet( EFlagInsideMultitapInlineEditingTransaction ) ) |
|
18839 { |
|
18840 CommitInlineEditL(); |
|
18841 } |
|
18842 StartInlineEditL( curSel, previousCharacter, rephaLength, ETrue ); |
|
18843 UpdateInlineEditL( KNullDesC, 0 ); |
|
18844 CommitInlineEditL(); |
|
18845 |
|
18846 // Go to the visual right position of current ligature as the |
|
18847 // repha has been deleted. |
|
18848 AlignLogicalAndVisualCursorL( TTmDocPosSpec::ELeading, EFalse ); |
|
18849 } |
|
18850 } |
|
18851 } |
|
18852 } |
|
18853 } |
|
18854 |
|
18855 TBool CAknFepManager::IsRephaPresent() |
|
18856 { |
|
18857 TBool result = EFalse; |
|
18858 |
|
18859 MCoeFepAwareTextEditor* fepAwareTextEditor = |
|
18860 iInputCapabilities.FepAwareTextEditor(); |
|
18861 |
|
18862 if( fepAwareTextEditor ) |
|
18863 { |
|
18864 TCursorSelection curSel; |
|
18865 |
|
18866 fepAwareTextEditor->GetCursorSelectionForFep( curSel ); |
|
18867 |
|
18868 TInt previousCharPos = 0; |
|
18869 TBool leftFlag = GetNextVisualLeftCharacter( previousCharPos ); |
|
18870 |
|
18871 if( !leftFlag ) |
|
18872 { |
|
18873 return result; |
|
18874 } |
|
18875 |
|
18876 TInt lowerPos = curSel.LowerPos(); |
|
18877 if( lowerPos > 1 ) |
|
18878 { |
|
18879 const TInt rephaLength( 2 ); |
|
18880 TBuf<rephaLength> previousCharacter; |
|
18881 previousCharacter.FillZ(); |
|
18882 |
|
18883 fepAwareTextEditor-> |
|
18884 GetEditorContentForFep( previousCharacter, |
|
18885 previousCharPos, rephaLength ); |
|
18886 |
|
18887 // Verify whether the length of the string is equal to the length |
|
18888 // of repha before doing further checks. |
|
18889 if( previousCharacter.Length() == rephaLength ) |
|
18890 { |
|
18891 if( previousCharacter[0] == TAknFepUiIndicInputManager::RaCharacter( |
|
18892 TLanguage( iLanguageCapabilities.iInputLanguageCode ) ) && |
|
18893 previousCharacter[1] == TAknFepUiIndicInputManager::Virama( |
|
18894 TLanguage( iLanguageCapabilities.iInputLanguageCode ) ) ) |
|
18895 { |
|
18896 result = ETrue; |
|
18897 } |
|
18898 } |
|
18899 } |
|
18900 } |
|
18901 |
|
18902 return result; |
|
18903 } |
|
18904 |
|
18905 TText CAknFepManager::PreviousToPreviousChar( TBool aContextSensitive ) |
|
18906 { |
|
18907 TBuf<ESingleCharacter> prevToPrevChar( ESingleCharacter ); |
|
18908 prevToPrevChar.FillZ(); |
|
18909 |
|
18910 if( !aContextSensitive ) |
|
18911 { |
|
18912 TTmDocPosSpec pos = DocPos(); |
|
18913 |
|
18914 // Pos=0 means it is before the first character and there is no previous character |
|
18915 if (pos.iPos > 0 ) |
|
18916 { |
|
18917 if( iInputCapabilities.FepAwareTextEditor() ) |
|
18918 { |
|
18919 iInputCapabilities.FepAwareTextEditor()-> |
|
18920 GetEditorContentForFep( prevToPrevChar, pos.iPos - 1, ESingleCharacter ); |
|
18921 } |
|
18922 } |
|
18923 } |
|
18924 else |
|
18925 { |
|
18926 TCursorSelection curSel; |
|
18927 |
|
18928 MCoeFepAwareTextEditor* fepAwareTextEditor = |
|
18929 iInputCapabilities.FepAwareTextEditor(); |
|
18930 |
|
18931 if( fepAwareTextEditor ) |
|
18932 { |
|
18933 fepAwareTextEditor->GetCursorSelectionForFep( curSel ); |
|
18934 TInt lowerpos = curSel.LowerPos(); |
|
18935 |
|
18936 if( lowerpos > 1 ) |
|
18937 { |
|
18938 fepAwareTextEditor-> |
|
18939 GetEditorContentForFep( prevToPrevChar, lowerpos - 2, ESingleCharacter ); |
|
18940 } |
|
18941 } |
|
18942 } |
|
18943 if (prevToPrevChar.Length()) |
|
18944 return prevToPrevChar[0]; |
|
18945 else |
|
18946 return NULL; |
|
18947 } |
|
18948 |
|
18949 void CAknFepManager::RemoveRakarCharacterL() |
|
18950 { |
|
18951 MCoeFepAwareTextEditor* fepAwareTextEditor = |
|
18952 iInputCapabilities.FepAwareTextEditor(); |
|
18953 |
|
18954 if( fepAwareTextEditor ) |
|
18955 { |
|
18956 TCursorSelection curSel; |
|
18957 |
|
18958 fepAwareTextEditor->GetCursorSelectionForFep( curSel ); |
|
18959 |
|
18960 TInt lowerpos = curSel.LowerPos(); |
|
18961 |
|
18962 if( lowerpos > 1 ) |
|
18963 { |
|
18964 const TInt rakarLength( 2 ); |
|
18965 TBuf<rakarLength> buffer; |
|
18966 buffer.FillZ(); |
|
18967 |
|
18968 fepAwareTextEditor-> |
|
18969 GetEditorContentForFep( buffer, lowerpos - rakarLength, rakarLength ); |
|
18970 |
|
18971 if (rakarLength == buffer.Length()) |
|
18972 { |
|
18973 if( buffer[0] == TAknFepUiIndicInputManager::Virama( |
|
18974 TLanguage( iLanguageCapabilities.iInputLanguageCode ) ) && |
|
18975 buffer[1] == TAknFepUiIndicInputManager::RaCharacter( |
|
18976 TLanguage( iLanguageCapabilities.iInputLanguageCode ) ) ) |
|
18977 { |
|
18978 curSel.iAnchorPos = lowerpos - rakarLength; |
|
18979 curSel.iCursorPos = lowerpos; |
|
18980 |
|
18981 // Remove the repha |
|
18982 |
|
18983 if( IsFlagSet( EFlagInsideInlineEditingTransaction ) && |
|
18984 IsFlagSet( EFlagInsideMultitapInlineEditingTransaction ) ) |
|
18985 { |
|
18986 CommitInlineEditL(); |
|
18987 } |
|
18988 StartInlineEditL( curSel, buffer, rakarLength, ETrue ); |
|
18989 UpdateInlineEditL( KNullDesC, 0 ); |
|
18990 CommitInlineEditL(); |
|
18991 } |
|
18992 } |
|
18993 } |
|
18994 } |
|
18995 } |
|
18996 |
|
18997 /** |
|
18998 * Returns the status of predictive input. |
|
18999 * |
|
19000 * @since 3.2 |
|
19001 * @return ETrue is available predictive input. |
|
19002 */ |
|
19003 TBool CAknFepManager::IsAbleToChangePrediction() const |
|
19004 { |
|
19005 TBool ret = EFalse; |
|
19006 if (!(iAknEditorFlags & EAknEditorFlagNoT9)) |
|
19007 { |
|
19008 if (iMode == EHiraganaKanji) |
|
19009 { |
|
19010 if (HasJapanesePredictionInputMode()) |
|
19011 { |
|
19012 ret = ETrue; |
|
19013 } |
|
19014 } |
|
19015 else |
|
19016 { |
|
19017 ret = ETrue; |
|
19018 } |
|
19019 } |
|
19020 return ret; |
|
19021 } |
|
19022 |
|
19023 TLanguage CAknFepManager :: GetInputLanguageFromSharedDataInterface() |
|
19024 { |
|
19025 return ((TLanguage)(iSharedDataInterface->InputTextLanguage())); |
|
19026 } |
|
19027 |
|
19028 |
|
19029 void CAknFepManager::DeactivatePredicitveWordAndMoveCursorL() |
|
19030 { |
|
19031 if (WesternPredictive()) |
|
19032 { |
|
19033 TWesternNaviEvent naviEvent = ERightNaviEvent; |
|
19034 |
|
19035 if (iLanguageCapabilities.iRightToLeftLanguage) |
|
19036 { |
|
19037 naviEvent = ELeftNaviEvent; |
|
19038 } |
|
19039 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
19040 // This function is called at time of Cut/Copy command |
|
19041 // TryCloseUiL will remove the auto completion part |
|
19042 // To adjust the visual cursor position commit the text with |
|
19043 // auto completion part. |
|
19044 if( IsAutoCompleteOn()) |
|
19045 { |
|
19046 TInt tailLength = 0; |
|
19047 iPtiEngine->HandleCommandL( EPtiCommandGetAutoCompletionTailLength, &tailLength ); |
|
19048 |
|
19049 if( tailLength > 0) |
|
19050 { |
|
19051 // Sync the key sequence and editor text. |
|
19052 iPtiEngine->HandleCommandL( EPtiCommandLockCurrentCandidate ); |
|
19053 } |
|
19054 } |
|
19055 #endif |
|
19056 |
|
19057 // Find the visual left/right end of the current word |
|
19058 TTmDocPosSpec pos; |
|
19059 GetAvkonDefinedVisualLimitsOfSelection( |
|
19060 iUncommittedText, naviEvent, pos, NULL ); |
|
19061 |
|
19062 TryCloseUiL(); |
|
19063 |
|
19064 // Position should be dis-ambiguated based on last navigation and direction of blocks. |
|
19065 AdjustPosSpecForAmbiguityAfterLeftOrRightNavigation( pos, naviEvent ); |
|
19066 |
|
19067 SetCursorPositionL( pos ); |
|
19068 |
|
19069 iCaseMan->UpdateCase(ENullNaviEvent); |
|
19070 } |
|
19071 } |
|
19072 |
|
19073 |
|
19074 // ----------------------------------------------------------------------------- |
|
19075 // CAknFepManager::EditorCcpuStatus |
|
19076 // |
|
19077 // Returns the Ccpu status of given editor state as a flag combination. |
|
19078 // ----------------------------------------------------------------------------- |
|
19079 // |
|
19080 TInt CAknFepManager::EditorCcpuStatus(CAknEdwinState* aEdwinState) |
|
19081 { |
|
19082 TInt ret = 0; |
|
19083 |
|
19084 if (aEdwinState && aEdwinState->CcpuState()) |
|
19085 { |
|
19086 if (aEdwinState->CcpuState()->CcpuCanCopy()) |
|
19087 { |
|
19088 ret |= ECcpuStatusFlagCanCopy; |
|
19089 } |
|
19090 if (aEdwinState->CcpuState()->CcpuCanCut()) |
|
19091 { |
|
19092 ret |= ECcpuStatusFlagCanCut; |
|
19093 } |
|
19094 if (aEdwinState->CcpuState()->CcpuCanPaste()) |
|
19095 { |
|
19096 ret |= ECcpuStatusFlagCanPaste; |
|
19097 } |
|
19098 } |
|
19099 return ret; |
|
19100 } |
|
19101 |
|
19102 void CAknFepManager::NewLigatureL( const TDesC& aText ) |
|
19103 { |
|
19104 if( !iInputCapabilities.SupportsSecretText() && |
|
19105 ( EditorHasFreeSpace() || |
|
19106 IsFlagSet( EFlagInsideMultitapInlineEditingTransaction ) ) ) |
|
19107 { |
|
19108 if ( iFepManState == EAknFepStateInitial ) //multitapping |
|
19109 { |
|
19110 if ( !IsFlagSet( EFlagInsideMultitapInlineEditingTransaction ) ) |
|
19111 { |
|
19112 ClearFlag( EFlagLineFeedCharacter ); |
|
19113 StartInlineEditL( aText ); |
|
19114 SetFlag( EFlagInsideMultitapInlineEditingTransaction ); |
|
19115 SetFlag( EFlagInsideInlineEditingTransaction ); |
|
19116 } |
|
19117 } |
|
19118 } |
|
19119 } |
|
19120 |
|
19121 |
|
19122 |
|
19123 // ----------------------------------------------------------------------------- |
|
19124 // CAknFepManager::CancelCcpuMode |
|
19125 // |
|
19126 // Cancels the copy / cut mode initiated from editing options -submenu. |
|
19127 // ----------------------------------------------------------------------------- |
|
19128 // |
|
19129 void CAknFepManager::CancelCcpuMode() |
|
19130 { |
|
19131 iIndicator->SetCopyMode(EFalse); |
|
19132 if (IsCcpuFlagSet(ECcpuStateStartCopy | ECcpuStateCopy | ECcpuStateStartCut | ECcpuStateCut)) |
|
19133 { |
|
19134 iUiInterface->DeleteSoftkeys(); |
|
19135 } |
|
19136 |
|
19137 ResetCcpuFlags(); |
|
19138 } |
|
19139 |
|
19140 // ----------------------------------------------------------------------------- |
|
19141 // CAknFepManager::CancelShiftKeyTimer |
|
19142 // |
|
19143 // Cancels shift key timer. |
|
19144 // ----------------------------------------------------------------------------- |
|
19145 // |
|
19146 void CAknFepManager::CancelShiftKeyTimer() |
|
19147 { |
|
19148 ClearFlag(EFlagShiftKeyDepressed); |
|
19149 if (iShiftKeypressMonitor) |
|
19150 { |
|
19151 iShiftKeypressMonitor->Cancel(); |
|
19152 } |
|
19153 } |
|
19154 |
|
19155 void CAknFepManager::RemoveTextFromEditorL( TInt aNumOfCharacters, |
|
19156 TInt aPos /*= 0*/, |
|
19157 TBool aIsToAlignCursor /* = ETrue */) |
|
19158 { |
|
19159 if( IsFlagSet( EFlagInsideInlineEditingTransaction ) && |
|
19160 IsFlagSet( EFlagInsideMultitapInlineEditingTransaction ) ) |
|
19161 { |
|
19162 // Update the inline buffer with NULL descriptor. |
|
19163 // Inline buffer can be only at position 0, i.e. |
|
19164 // where the cursor stands. |
|
19165 if( aNumOfCharacters == UncommittedText().Length() |
|
19166 && aPos == 0 ) |
|
19167 { |
|
19168 UpdateInlineEditL( KNullDesC, 0 ); |
|
19169 } |
|
19170 CommitInlineEditL(); |
|
19171 } |
|
19172 else |
|
19173 { |
|
19174 MCoeFepAwareTextEditor* fepAwareTextEditor = |
|
19175 iInputCapabilities.FepAwareTextEditor(); |
|
19176 |
|
19177 if( fepAwareTextEditor && aPos >= 0 ) |
|
19178 { |
|
19179 // Get the previous cursor position. |
|
19180 TCursorSelection cursorSelPrevious; |
|
19181 fepAwareTextEditor->GetCursorSelectionForFep( cursorSelPrevious ); |
|
19182 |
|
19183 // Place the cursor at the desired position. |
|
19184 TCursorSelection sel( cursorSelPrevious.iCursorPos - aPos, |
|
19185 cursorSelPrevious.iCursorPos - aPos ); |
|
19186 fepAwareTextEditor->SetCursorSelectionForFepL( sel ); |
|
19187 |
|
19188 // Set cursor span on previous N characters |
|
19189 if ( sel.iAnchorPos >= aNumOfCharacters ) |
|
19190 { |
|
19191 sel.iAnchorPos -= aNumOfCharacters; |
|
19192 |
|
19193 // get text to clear |
|
19194 TBuf<EMaximumFepWordLength> bufToClear; |
|
19195 fepAwareTextEditor->GetEditorContentForFep( bufToClear, sel.iAnchorPos, |
|
19196 aNumOfCharacters ); |
|
19197 |
|
19198 // delete the character with an inline edit |
|
19199 StartInlineEditL( sel, bufToClear, aNumOfCharacters, EFalse ); |
|
19200 UpdateInlineEditL( KNullDesC, 0 ); |
|
19201 CommitInlineEditL(); |
|
19202 |
|
19203 if( aIsToAlignCursor ) |
|
19204 { |
|
19205 // Move the cursor to the original position considering the |
|
19206 // aNumOfCharacters |
|
19207 cursorSelPrevious.iCursorPos -= aNumOfCharacters; |
|
19208 cursorSelPrevious.iAnchorPos = cursorSelPrevious.iCursorPos; |
|
19209 fepAwareTextEditor->SetCursorSelectionForFepL( cursorSelPrevious ); |
|
19210 } |
|
19211 } |
|
19212 } |
|
19213 } |
|
19214 } |
|
19215 |
|
19216 #ifdef RD_MARATHI |
|
19217 |
|
19218 TBool CAknFepManager::IsChandraAPresentL() |
|
19219 { |
|
19220 TBool result = EFalse; |
|
19221 |
|
19222 MCoeFepAwareTextEditor* fepAwareTextEditor = |
|
19223 iInputCapabilities.FepAwareTextEditor(); |
|
19224 |
|
19225 if( fepAwareTextEditor ) |
|
19226 { |
|
19227 TCursorSelection curSel; |
|
19228 |
|
19229 fepAwareTextEditor->GetCursorSelectionForFep( curSel ); |
|
19230 |
|
19231 TInt lowerpos = curSel.LowerPos(); |
|
19232 |
|
19233 TInt chandraALength = 2; |
|
19234 TBuf<2> buf; |
|
19235 TAknFepUiIndicInputManager::GetChandraA( buf ); |
|
19236 |
|
19237 if( lowerpos > ( chandraALength - 1 ) ) |
|
19238 { |
|
19239 TBuf<2>previousCharacter; |
|
19240 |
|
19241 fepAwareTextEditor->GetEditorContentForFep( |
|
19242 previousCharacter, lowerpos-chandraALength, chandraALength ); |
|
19243 |
|
19244 if( buf.CompareC( previousCharacter ) == 0 ) |
|
19245 { |
|
19246 // Chandra-A found |
|
19247 result = ETrue; |
|
19248 } |
|
19249 } |
|
19250 } |
|
19251 return result; |
|
19252 } |
|
19253 |
|
19254 TBool CAknFepManager::IsEyeLashRaPresentL() |
|
19255 { |
|
19256 TBool result = EFalse; |
|
19257 |
|
19258 MCoeFepAwareTextEditor* fepAwareTextEditor = |
|
19259 iInputCapabilities.FepAwareTextEditor(); |
|
19260 |
|
19261 if( fepAwareTextEditor ) |
|
19262 { |
|
19263 TCursorSelection curSel; |
|
19264 |
|
19265 fepAwareTextEditor->GetCursorSelectionForFep( curSel ); |
|
19266 |
|
19267 TInt lowerpos = curSel.LowerPos(); |
|
19268 |
|
19269 |
|
19270 TBuf<3> buf; |
|
19271 TAknFepUiIndicInputManager::GetEyeLashRa( buf, |
|
19272 (TLanguage)iLanguageCapabilities.iInputLanguageCode ); |
|
19273 TInt eyeLashRaLength = buf.Length(); |
|
19274 |
|
19275 if( ( lowerpos - eyeLashRaLength ) >= 0 ) |
|
19276 { |
|
19277 TBuf<3>previousCharacter; |
|
19278 |
|
19279 fepAwareTextEditor->GetEditorContentForFep( |
|
19280 previousCharacter, lowerpos-eyeLashRaLength, eyeLashRaLength ); |
|
19281 |
|
19282 if( previousCharacter.Length() >=2 && |
|
19283 buf.CompareC( previousCharacter ) == 0 ) |
|
19284 { |
|
19285 // EyeLashRa found |
|
19286 result = ETrue; |
|
19287 } |
|
19288 } |
|
19289 } |
|
19290 return result; |
|
19291 } |
|
19292 |
|
19293 #endif // RD_MARATHI |
|
19294 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
19295 void CAknFepManager::RemoveSuggestedCompletionL() |
|
19296 { |
|
19297 if(iPtiEngine->InputMode() == EPtiEngineWordCompletion && |
|
19298 IsFlagSet(CAknFepManager::EFlagInsideInlineEditingTransaction)) |
|
19299 { |
|
19300 TBuf<CAknFepManager::EMaximumFepWordLength> currentText = iPtiEngine->CurrentWord(); |
|
19301 if(currentText.Length() > iPtiEngine->CurrentInputSequence().Length()) |
|
19302 { |
|
19303 currentText.SetLength(iPtiEngine->CurrentInputSequence().Length()); |
|
19304 iPtiEngine->SetCurrentWord(currentText); |
|
19305 UpdateInlineEditL(currentText,currentText.Length()); |
|
19306 TransferFepStateToEditorL(); |
|
19307 } |
|
19308 |
|
19309 } |
|
19310 } |
|
19311 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
19312 |
|
19313 |
|
19314 // ----------------------------------------------------------------------------- |
|
19315 // CAknFepManager::ExtendedInputCapabilities |
|
19316 // |
|
19317 // Returns the extended input bapabilities bitvector. |
|
19318 // ----------------------------------------------------------------------------- |
|
19319 // |
|
19320 TUint CAknFepManager::ExtendedInputCapabilities() const |
|
19321 { |
|
19322 MObjectProvider* mop = iInputCapabilities.ObjectProvider(); |
|
19323 |
|
19324 if ( mop && iInputCapabilities.FepAwareTextEditor() )//IsFepAwareTextEditor() |
|
19325 { |
|
19326 CAknExtendedInputCapabilities* extendedInputCapabilities = |
|
19327 mop->MopGetObject( extendedInputCapabilities ); |
|
19328 |
|
19329 if ( extendedInputCapabilities ) |
|
19330 { |
|
19331 return extendedInputCapabilities->Capabilities(); |
|
19332 } |
|
19333 } |
|
19334 |
|
19335 return 0; |
|
19336 } |
|
19337 |
|
19338 |
|
19339 #ifdef RD_SCALABLE_UI_V2 |
|
19340 // ----------------------------------------------------------------------------- |
|
19341 // CAknFepManager::LaunchStylusCcpuMenuL |
|
19342 // |
|
19343 // Displays stylus ccpu-menu. |
|
19344 // ----------------------------------------------------------------------------- |
|
19345 // |
|
19346 void CAknFepManager::LaunchStylusCcpuMenuL(TPoint &aClickPoint) |
|
19347 { |
|
19348 const TInt KItemCopy = 0x01; |
|
19349 const TInt KItemCut = 0x02; |
|
19350 const TInt KItemPaste = 0x04; |
|
19351 |
|
19352 delete iStylusCcpuMenu; |
|
19353 iStylusCcpuMenu = NULL; |
|
19354 |
|
19355 // It is assume that this method is called only if there is selected |
|
19356 // text in suitable editor, ie. there will be at least "copy"-item available. |
|
19357 TInt items = KItemCopy; |
|
19358 |
|
19359 CAknEdwinState* editorState = EditorState(); |
|
19360 if (editorState && editorState->CcpuState()) |
|
19361 { |
|
19362 if (editorState->CcpuState()->CcpuCanCut()) |
|
19363 { |
|
19364 items |= KItemCut; |
|
19365 } |
|
19366 if (editorState->CcpuState()->CcpuCanPaste()) |
|
19367 { |
|
19368 items |= KItemPaste; |
|
19369 } |
|
19370 } |
|
19371 |
|
19372 if (items) |
|
19373 { |
|
19374 TBuf<CAknFepUiInterfaceMenuPane::SItemData::ENominalTextLength> itemStr; |
|
19375 iStylusCcpuMenu = iUiInterface->NewStylusPopUpMenuL(this, aClickPoint); |
|
19376 |
|
19377 if (items & KItemCopy) |
|
19378 { |
|
19379 StringLoader::Load(itemStr, R_AKNFEP_SOFTKEY_COPY); |
|
19380 iStylusCcpuMenu->AddMenuItemL(itemStr.Mid(1, itemStr.Length() - 1).Left(CAknFepUiInterfaceMenuPane::SItemData::ENominalTextLength), EEikCmdEditCopy); |
|
19381 } |
|
19382 if (items & KItemCut) |
|
19383 { |
|
19384 itemStr.Zero(); |
|
19385 StringLoader::Load(itemStr, R_AKNFEP_SOFTKEY_CUT); |
|
19386 iStylusCcpuMenu->AddMenuItemL(itemStr.Mid(1, itemStr.Length() - 1).Left(CAknFepUiInterfaceMenuPane::SItemData::ENominalTextLength), EEikCmdEditCut); |
|
19387 } |
|
19388 if (items & KItemPaste) |
|
19389 { |
|
19390 itemStr.Zero(); |
|
19391 StringLoader::Load(itemStr, R_AKNFEP_STYLUS_CCPU_MENU_PASTE); |
|
19392 iStylusCcpuMenu->AddMenuItemL(itemStr.Mid(1, itemStr.Length() - 1).Left(CAknFepUiInterfaceMenuPane::SItemData::ENominalTextLength), EEikCmdEditPaste); |
|
19393 } |
|
19394 |
|
19395 SetCcpuFlag(ECcpuStateCopy); // This forces ProcessCommandL to handle the events. |
|
19396 iStylusCcpuMenu->SetPosition(aClickPoint); |
|
19397 iStylusCcpuMenu->ShowMenu(); |
|
19398 } |
|
19399 } |
|
19400 #endif |
|
19401 |
|
19402 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
19403 TBool CAknFepManager::IsFnKeyMappedL(TPtiKeyboardType aKeyboardType) |
|
19404 { |
|
19405 MPtiLanguage *lang = NULL; |
|
19406 RArray < TPtiNumericKeyBinding > keybinding; |
|
19407 TBool ret = EFalse; |
|
19408 if(iPtiEngine) |
|
19409 { |
|
19410 lang = iPtiEngine->CurrentLanguage(); |
|
19411 if(lang) |
|
19412 { |
|
19413 iPtiEngine->GetNumericModeKeysForQwertyL(lang->LanguageCode(), keybinding, aKeyboardType); |
|
19414 TInt numericKeysCount = keybinding.Count(); |
|
19415 while ( numericKeysCount-- ) |
|
19416 { |
|
19417 TPtiNumericKeyBinding numKeyBind = keybinding[numericKeysCount]; |
|
19418 if ( numKeyBind.iCase == EPtiCaseFnLower || numKeyBind.iCase == EPtiCaseFnUpper) |
|
19419 { |
|
19420 ret = ETrue; |
|
19421 break; |
|
19422 } |
|
19423 } |
|
19424 } |
|
19425 } |
|
19426 keybinding.Reset(); |
|
19427 return ret; |
|
19428 } |
|
19429 TBool CAknFepManager::IsFnKeyMapped() |
|
19430 { |
|
19431 return iIsFnKeyMapped; |
|
19432 } |
|
19433 |
|
19434 void CAknFepManager::SetFnKeyMappingState() |
|
19435 { |
|
19436 TRAP_IGNORE(iIsFnKeyMapped = IsFnKeyMappedL()); |
|
19437 } |
|
19438 |
|
19439 TBool CAknFepManager::KeyMapsDifferentCharacterWithFn( TPtiKey aKey ) const |
|
19440 { |
|
19441 // we are interested only about the first mapped character => buffer length 1 is adequate |
|
19442 TBuf<1> lowerMapping; |
|
19443 TBuf<1> upperMapping; |
|
19444 TBuf<1> lowerFnMapping; |
|
19445 TBuf<1> upperFnMapping; |
|
19446 iPtiEngine->MappingDataForKey( aKey, lowerMapping, EPtiCaseLower ); |
|
19447 iPtiEngine->MappingDataForKey( aKey, upperMapping, EPtiCaseUpper ); |
|
19448 iPtiEngine->MappingDataForKey( aKey, lowerFnMapping, EPtiCaseFnLower ); |
|
19449 iPtiEngine->MappingDataForKey( aKey, upperFnMapping, EPtiCaseFnUpper ); |
|
19450 |
|
19451 if ( lowerFnMapping.Length() ) |
|
19452 { |
|
19453 if ( !lowerMapping.Length() || // < key maps character only with Fn |
|
19454 lowerMapping[0] != lowerFnMapping[0] ) // < Fn changes the character of the key |
|
19455 { |
|
19456 return ETrue; |
|
19457 } |
|
19458 } |
|
19459 else if ( upperFnMapping.Length() ) |
|
19460 { |
|
19461 if ( !upperMapping.Length() || // < key maps character only with Fn |
|
19462 upperMapping[0] != upperFnMapping[0] ) // < Fn changes the character of the key |
|
19463 { |
|
19464 return ETrue; |
|
19465 } |
|
19466 } |
|
19467 |
|
19468 return EFalse; // The key doesn't have symbol behind Fn or the symbol is the same as without Fn |
|
19469 } |
|
19470 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
19471 MAknFepDocumentNavigation* CAknFepManager::AknFepDocumentNavigation() const |
|
19472 { |
|
19473 MAknFepDocumentNavigation* navi = NULL; |
|
19474 |
|
19475 MObjectProvider* mop = iInputCapabilities.ObjectProvider(); |
|
19476 if ( mop ) |
|
19477 { |
|
19478 mop->MopGetObject( navi ); |
|
19479 } |
|
19480 |
|
19481 return navi; |
|
19482 } |
|
19483 |
|
19484 CAknFepUIInterface* CAknFepManager::UiInterface() |
|
19485 { |
|
19486 return iUiInterface; |
|
19487 } |
|
19488 |
|
19489 void CAknFepManager::AlignLogicalAndVisualCursorL() |
|
19490 { |
|
19491 TBool isIndicLang = |
|
19492 TAknFepUiIndicInputManager:: |
|
19493 IsIndicLangauge( TLanguage( iLanguageCapabilities.iInputLanguageCode ) ); |
|
19494 |
|
19495 if( isIndicLang ) |
|
19496 { |
|
19497 TTmDocPosSpec pos = DocPos(); |
|
19498 pos.iType = TTmDocPosSpec::ETrailing; |
|
19499 TTmPosInfo2 info; |
|
19500 TTmLineInfo lineInfo; |
|
19501 |
|
19502 TBool findAvailable = EFalse; |
|
19503 |
|
19504 MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
19505 |
|
19506 if ( docNavi ) |
|
19507 { |
|
19508 docNavi->FindDocPos( pos, info, lineInfo ); |
|
19509 findAvailable = ETrue; |
|
19510 } |
|
19511 else |
|
19512 { |
|
19513 CTextLayout* textLayout = TextLayout(); |
|
19514 if ( textLayout ) |
|
19515 { |
|
19516 textLayout->TagmaTextLayout().FindDocPos( pos, info, lineInfo ); |
|
19517 findAvailable = ETrue; |
|
19518 } |
|
19519 } |
|
19520 |
|
19521 if ( findAvailable ) |
|
19522 { |
|
19523 TCursorSelection sel( info.iDocPos.iPos, info.iDocPos.iPos ); |
|
19524 iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(sel); |
|
19525 } |
|
19526 } |
|
19527 } |
|
19528 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
19529 TKeyResponse CAknFepManager::HandleFnKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aEventCode ) |
|
19530 { |
|
19531 TKeyResponse ret; |
|
19532 |
|
19533 #ifdef __HALF_QWERTY_KEYPAD |
|
19534 if ( IsFlagSet( EFlagShiftKeyDepressed ) && |
|
19535 ( EPtiKeyboardHalfQwerty == KeyboardLayout() )&& |
|
19536 ( aEventCode != EEventKeyUp ) ) |
|
19537 { |
|
19538 return EKeyWasNotConsumed; |
|
19539 } |
|
19540 #endif |
|
19541 |
|
19542 if (!iCurrentFepUI->IsValidFnKeyPress() && EStdKeyRightFunc == aKeyEvent.iScanCode) |
|
19543 { |
|
19544 TBool Uiret = ETrue; |
|
19545 if (EEventKeyDown == aEventCode ) |
|
19546 { |
|
19547 Uiret = FepUI()->HandleKeyL(EKeyRightFunc, EShortKeyPress); |
|
19548 } |
|
19549 |
|
19550 if (Uiret) |
|
19551 { |
|
19552 ret = EKeyWasConsumed; |
|
19553 } |
|
19554 else |
|
19555 { |
|
19556 ret = iFnKeyManager->HandleFnKeyEventL( aKeyEvent, aEventCode, |
|
19557 iInputCapabilities ) ; |
|
19558 } |
|
19559 } |
|
19560 else |
|
19561 { |
|
19562 |
|
19563 ret = iFnKeyManager->HandleFnKeyEventL( aKeyEvent, aEventCode, |
|
19564 iInputCapabilities ) ; |
|
19565 } |
|
19566 if(IsHybridAplhaEditor() && !iHybridAplphaChangedToAlphanumeric) |
|
19567 { |
|
19568 if(FnKeyState() != CAknFepFnKeyManager::EFnKeyLock) |
|
19569 iHybridAplphaChangedToAlphanumeric = ETrue; |
|
19570 } |
|
19571 |
|
19572 return ret; |
|
19573 } |
|
19574 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
19575 |
|
19576 // ----------------------------------------------------------------------------- |
|
19577 // CAknFepManager::HasJapanesePredictionInputMode |
|
19578 // Has Japanese prediction input mode in PtiEngine |
|
19579 // ----------------------------------------------------------------------------- |
|
19580 // |
|
19581 TBool CAknFepManager::HasJapanesePredictionInputMode() const |
|
19582 { |
|
19583 // Is it supported Japanese predictive input |
|
19584 TBool ret = EFalse; |
|
19585 MPtiLanguage* ptilang = iPtiEngine->GetLanguage(ELangJapanese); |
|
19586 if ( ptilang |
|
19587 && ( (!iQwertyInputMode && ptilang->HasInputMode(EPtiEngineHiraganaKanjiPredictive)) |
|
19588 ||(iQwertyInputMode && ptilang->HasInputMode(EPtiEngineHiraganaKanjiPredictiveQwerty)) ) ) |
|
19589 { |
|
19590 ret = ETrue; |
|
19591 } |
|
19592 return ret; |
|
19593 } |
|
19594 #ifdef RD_HINDI_PHONETIC_INPUT |
|
19595 void CAknFepManager::HandleIndicCaseL() |
|
19596 { |
|
19597 iHashKeyMan->HandleSetIndicStateL(); |
|
19598 } |
|
19599 #endif |
|
19600 |
|
19601 // ----------------------------------------------------------------------------- |
|
19602 // CAknFepManager::IsCursorAtEndOfWord |
|
19603 // |
|
19604 // ----------------------------------------------------------------------------- |
|
19605 // |
|
19606 TBool CAknFepManager::IsCursorAtEndOfWord() |
|
19607 { |
|
19608 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
19609 TInt origPos = iUncommittedText.iCursorPos; |
|
19610 |
|
19611 FindEndOfWord(iUncommittedText.iCursorPos); |
|
19612 |
|
19613 if (origPos != iUncommittedText.iCursorPos) |
|
19614 { |
|
19615 return EFalse; |
|
19616 } |
|
19617 |
|
19618 return ETrue; |
|
19619 } |
|
19620 |
|
19621 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
19622 TInt CAknFepManager::GetCurrentCase() |
|
19623 { |
|
19624 TCase returnCase; |
|
19625 |
|
19626 switch( iCaseMan->CurrentCase() ) |
|
19627 { |
|
19628 case EAknEditorUpperCase: |
|
19629 case EAknEditorTextCase: |
|
19630 { |
|
19631 returnCase = EUpperCase; |
|
19632 } |
|
19633 break; |
|
19634 |
|
19635 case EAknEditorLowerCase: |
|
19636 { |
|
19637 returnCase = ELowerCase; |
|
19638 } |
|
19639 break; |
|
19640 |
|
19641 default: |
|
19642 returnCase = ELowerCase; |
|
19643 break; |
|
19644 } |
|
19645 return returnCase; |
|
19646 } |
|
19647 // Predictive QWERTY changes (XT9) ----> |
|
19648 |
|
19649 void CAknFepManager::GetCandidatesL( CDesCArray& aArray, TInt& aActiveIdx ) |
|
19650 { |
|
19651 iPtiEngine->GetCandidateListL(aArray); |
|
19652 iPtiEngine->HandleCommandL( EPtiCommandUserActionGetCurrentIndexOfCandidates, &aActiveIdx ); |
|
19653 } |
|
19654 |
|
19655 void CAknFepManager::GetUpdateCandidatePositionL(TRect& aRect) |
|
19656 { |
|
19657 if(iCandidatePopup && iFepFullyConstructed && iPtiEngine) |
|
19658 { |
|
19659 //Now we read the position of the inline text |
|
19660 TPoint inlineEditorTl; |
|
19661 TPoint inlineEditorBr; |
|
19662 TInt height; |
|
19663 TInt ascent; |
|
19664 TInt documentOffset = iPtiEngine->CurrentWord().Length(); |
|
19665 // Popup Position for RTL |
|
19666 if(iLanguageCapabilities.iRightToLeftLanguage) |
|
19667 documentOffset = 0; |
|
19668 // Popup Position for RTL |
|
19669 GetScreenCoordinatesL(inlineEditorTl, height, ascent, documentOffset); |
|
19670 inlineEditorTl.iY -= height; |
|
19671 GetScreenCoordinatesL(inlineEditorBr, height, ascent); |
|
19672 aRect.iTl = inlineEditorTl; |
|
19673 aRect.iBr = inlineEditorBr; |
|
19674 } |
|
19675 } |
|
19676 |
|
19677 TBool CAknFepManager::IsRightToLeftLanguage() |
|
19678 { |
|
19679 return iLanguageCapabilities.iRightToLeftLanguage ; |
|
19680 } |
|
19681 |
|
19682 /** |
|
19683 * Setter for the advanced predictive typing correction. |
|
19684 * @param aLevel The level to be set. |
|
19685 */ |
|
19686 void CAknFepManager::SetTypingCorrectionLevel(TInt aLevel) |
|
19687 { |
|
19688 iTypingCorrectionLevel = aLevel; |
|
19689 |
|
19690 if(iFepFullyConstructed) |
|
19691 { |
|
19692 TPtiErrorCorrectionLevel correctionLevel = (TPtiErrorCorrectionLevel)aLevel; |
|
19693 TRAP_IGNORE(iPtiEngine->HandleCommandL( EPtiCommandSetCorrectionLevel, &correctionLevel )); |
|
19694 } |
|
19695 } |
|
19696 |
|
19697 /** |
|
19698 * Resetter for the advanced predictive Number Candidate setting. |
|
19699 * @param aValue The value to be set. |
|
19700 */ |
|
19701 void CAknFepManager::SetNumberCandidateState(TInt aValue) |
|
19702 { |
|
19703 if(aValue == 0) |
|
19704 iIsNumberCandidateShown = EFalse; |
|
19705 else if(aValue == 1) |
|
19706 iIsNumberCandidateShown = ETrue; |
|
19707 |
|
19708 if(iFepFullyConstructed) |
|
19709 { |
|
19710 TRAP_IGNORE(iPtiEngine->HandleCommandL( EPtiCommandSetNumberCandidateStatus, |
|
19711 &iIsNumberCandidateShown )); |
|
19712 } |
|
19713 } |
|
19714 |
|
19715 void CAknFepManager::RemoveSuggestedAdvanceCompletionL() |
|
19716 { |
|
19717 if( IsFlagSet(CAknFepManager::EFlagInsideInlineEditingTransaction) && |
|
19718 iPtiEngine->CurrentWord().Length() ) |
|
19719 { |
|
19720 TRAP_IGNORE(iPtiEngine->HandleCommandL( EPtiCommandUserActionShorten )); |
|
19721 TPtrC currentText = iPtiEngine->CurrentWord(); |
|
19722 UpdateInlineEditL( currentText, currentText.Length() ); |
|
19723 } |
|
19724 } |
|
19725 /** |
|
19726 * Setes the current state from GS to the local state |
|
19727 */ |
|
19728 |
|
19729 void CAknFepManager::SetAutoCompletionState(TInt aValue) |
|
19730 { |
|
19731 if(aValue == 0) |
|
19732 { |
|
19733 iIsAutoCompleteOn = EFalse; |
|
19734 } |
|
19735 else if(aValue == 1) |
|
19736 { |
|
19737 iIsAutoCompleteOn = ETrue; |
|
19738 } |
|
19739 |
|
19740 if(iFepFullyConstructed) |
|
19741 { |
|
19742 if(iIsAutoCompleteOn) |
|
19743 { |
|
19744 TRAP_IGNORE(iPtiEngine->HandleCommandL( EPtiCommandEnableAutoCompletion )); |
|
19745 } |
|
19746 else |
|
19747 { |
|
19748 TInt tailLength = 0; |
|
19749 TRAP_IGNORE(iPtiEngine->HandleCommandL( EPtiCommandGetAutoCompletionTailLength, &tailLength )); |
|
19750 if(tailLength > 0) |
|
19751 { |
|
19752 // send an update to engine to signify change in autocompletion from on to off while tail exists |
|
19753 // This will set EPtiXt9FlagAutoCompletionSetOnToOff flag as true in engine |
|
19754 TInt value = 1; |
|
19755 TRAP_IGNORE(iPtiEngine->HandleCommandL( EPtiCommandAutoCompletionOnToOff,&value)); |
|
19756 } |
|
19757 |
|
19758 |
|
19759 TRAP_IGNORE(iPtiEngine->HandleCommandL( EPtiCommandDisableAutoCompletion )); |
|
19760 } |
|
19761 } |
|
19762 } |
|
19763 |
|
19764 /** |
|
19765 * Sets the primary candidate from GS to the local state |
|
19766 */ |
|
19767 |
|
19768 void CAknFepManager::SetPrimaryCandidate(TInt aValue) |
|
19769 { |
|
19770 if(aValue == 0) |
|
19771 iPrimaryCandidate = ETrue; |
|
19772 else if(aValue == 1) |
|
19773 iPrimaryCandidate = EFalse; |
|
19774 if(iFepFullyConstructed) |
|
19775 { |
|
19776 TRAP_IGNORE(iPtiEngine->HandleCommandL( EPtiCommandSetProactiveCorrection, |
|
19777 &iPrimaryCandidate )); |
|
19778 } |
|
19779 } |
|
19780 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
19781 |
|
19782 CAknFepPluginManager* CAknFepManager::PluginUIManager() |
|
19783 { |
|
19784 #ifdef RD_SCALABLE_UI_V2 |
|
19785 |
|
19786 return iFepPluginManager; |
|
19787 #else |
|
19788 return NULL; |
|
19789 #endif //RD_SCALABLE_UI_V2 |
|
19790 } |
|
19791 |
|
19792 // add for phrase creation |
|
19793 MZhuyinKeyHandler* CAknFepManager::ZhuyinKeyHandler() |
|
19794 { |
|
19795 return iZhuyinKeyHandler; |
|
19796 } |
|
19797 // add for phrase creation |
|
19798 CAknFepZhuyinAnalyser* CAknFepManager::ZhuyinAnalyser() |
|
19799 { |
|
19800 return iZhuyinAnalyser; |
|
19801 } |
|
19802 |
|
19803 #ifdef RD_SCALABLE_UI_V2 |
|
19804 void CAknFepManager::UpdateTouchCaseMode() |
|
19805 { |
|
19806 if (iFepFullyConstructed && |
|
19807 iFepPluginManager |
|
19808 // case should be updated even if current input mode is none because iPreviousCoseMode |
|
19809 // still need to be updated. |
|
19810 /*&& |
|
19811 iFepPluginManager->PluginInputMode() != EPluginInputModeNone*/) |
|
19812 { |
|
19813 iFepPluginManager->UpdateCaseMode(); |
|
19814 } |
|
19815 } |
|
19816 #endif// RD_SCALABLE_UI_V2 |
|
19817 |
|
19818 void CAknFepManager::SetStopProcessFocus(TBool aStop, TBool aClose) |
|
19819 { |
|
19820 iClosePeninputUi = aClose; |
|
19821 iStopProcessFocus = aStop; |
|
19822 if (!aStop) |
|
19823 { |
|
19824 HandleChangeInFocus(); |
|
19825 } |
|
19826 } |
|
19827 |
|
19828 TBool CAknFepManager::StopProcessFocus() |
|
19829 { |
|
19830 return iStopProcessFocus; |
|
19831 } |
|
19832 |
|
19833 TBool CAknFepManager::CloseUiOnFocusChange() |
|
19834 { |
|
19835 return iClosePeninputUi; |
|
19836 } |
|
19837 void CAknFepManager::HandleCopyCutStateL() |
|
19838 { |
|
19839 if (IsCcpuFlagSet(ECcpuStateCopy | ECcpuStateCut)) |
|
19840 { |
|
19841 TCursorSelection selection; |
|
19842 iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(selection); |
|
19843 TBool update; |
|
19844 if (selection.Length() > 0) |
|
19845 { |
|
19846 if (!IsCcpuFlagSet(ECcpuStateButton)) |
|
19847 { |
|
19848 __ASSERT_DEBUG(iUiInterface->SoftkeysExist(), |
|
19849 AknFepPanic(EAknFepPanicNoHandleToFepAwareTextEditor)); |
|
19850 if (IsCcpuFlagSet(ECcpuStateCopy)) |
|
19851 { |
|
19852 update = UpdateCBALabelL(ELeftSoftkeyIndex, EEikCmdEditCopy, R_AKNFEP_SOFTKEY_COPY); |
|
19853 update |= UpdateCBALabelL( EMiddleSoftkeyIndex, EEikCmdEditCopy, R_AVKON_SOFTKEY_SELECT_TEXT ); |
|
19854 } |
|
19855 else |
|
19856 { |
|
19857 update = UpdateCBALabelL(ELeftSoftkeyIndex, EEikCmdEditCut, R_AKNFEP_SOFTKEY_CUT); |
|
19858 update |= UpdateCBALabelL( EMiddleSoftkeyIndex, EEikCmdEditCut, R_AVKON_SOFTKEY_SELECT_TEXT ); |
|
19859 } |
|
19860 if (update) |
|
19861 { |
|
19862 iUiInterface->DrawSoftkeysNow(); |
|
19863 } |
|
19864 SetCcpuFlag(ECcpuStateButton); |
|
19865 } |
|
19866 } |
|
19867 else if (IsCcpuFlagSet(ECcpuStateButton)) |
|
19868 { |
|
19869 ClearCcpuFlag(ECcpuStateButton); |
|
19870 update = EFalse; |
|
19871 update = UpdateCBALabelL(ELeftSoftkeyIndex, KNullCommandId, R_TEXT_SOFTKEY_EMPTY); |
|
19872 update |= UpdateCBALabelL( EMiddleSoftkeyIndex, KNullCommandId, R_TEXT_SOFTKEY_EMPTY ); |
|
19873 if (update) |
|
19874 { |
|
19875 iUiInterface->DrawSoftkeysNow(); |
|
19876 } |
|
19877 } |
|
19878 } |
|
19879 } |
|
19880 #ifdef RD_SCALABLE_UI_V2 |
|
19881 TInt GetForegroundTaskAppWgId() |
|
19882 { |
|
19883 TApaTaskList tList(CCoeEnv::Static()->WsSession()); |
|
19884 |
|
19885 TApaTask task = tList.FindByPos(0); |
|
19886 return task.WgId(); |
|
19887 } |
|
19888 |
|
19889 void CAknFepManager::DimInputmodeTouchMenuItems(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
19890 { |
|
19891 DimEditMenuModeItems(aMenuPane); |
|
19892 |
|
19893 if ( IsChineseInputLanguage() ) |
|
19894 { |
|
19895 DoChineseTouchMenu(aMenuPane); |
|
19896 } |
|
19897 else if ( iLanguageCapabilities.iInputLanguageCode == ELangJapanese) |
|
19898 { |
|
19899 DoJapaneseMenu(aMenuPane); |
|
19900 } |
|
19901 else |
|
19902 { |
|
19903 DoWesternTouchMenu(aMenuPane); |
|
19904 } |
|
19905 } |
|
19906 #endif |
|
19907 |
|
19908 void CAknFepManager::DimInputmodeMenuItems(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
19909 { |
|
19910 DimEditMenuModeItems(aMenuPane); |
|
19911 |
|
19912 if ( IsChineseInputLanguage() ) |
|
19913 { |
|
19914 DoChineseMenu(aMenuPane); |
|
19915 } |
|
19916 else if ( iLanguageCapabilities.iInputLanguageCode == ELangJapanese) |
|
19917 { |
|
19918 DoJapaneseMenu(aMenuPane); |
|
19919 } |
|
19920 else |
|
19921 { |
|
19922 DoWesternMenu(aMenuPane); |
|
19923 } |
|
19924 } |
|
19925 |
|
19926 void CAknFepManager::HandleCopyCutEventL(TInt aCommandId) |
|
19927 { |
|
19928 if (iCcpuMode != ECcpuStateNone) |
|
19929 { |
|
19930 ResetCcpuFlags(); |
|
19931 iUiInterface->DeleteSoftkeys(); |
|
19932 |
|
19933 SetCcpuFlag(ECcpuStatePosted); |
|
19934 |
|
19935 #ifdef RD_SCALABLE_UI_V2 |
|
19936 if (aCommandId == EEikCmdEditCopy) |
|
19937 { |
|
19938 // Send copy event to AknCcpuSupport. |
|
19939 CCoeEnv::Static()->SimulateKeyEventL(KAknCcpuCopyEvent, EEventKey); |
|
19940 } |
|
19941 else |
|
19942 { |
|
19943 // Send cut event to AknCcpuSupport. |
|
19944 CCoeEnv::Static()->SimulateKeyEventL(KAknCcpuCutEvent, EEventKey); |
|
19945 } |
|
19946 #else |
|
19947 /*As part of build warnings commenting this perticular code it might require when touch is enabled. |
|
19948 if (aCommandId == EEikCmdEditCopy) |
|
19949 { |
|
19950 // Send copy-event to editor. |
|
19951 CCoeEnv::Static()->SimulateKeyEventL(KEditorCopyEvent, EEventKey); |
|
19952 } |
|
19953 else |
|
19954 { |
|
19955 // send cut-event to editor. |
|
19956 CCoeEnv::Static()->SimulateKeyEventL(KEditorCutEvent, EEventKey); |
|
19957 } |
|
19958 */ |
|
19959 #endif // RD_SCALABLE_UI_V2 |
|
19960 |
|
19961 if (iInputCapabilities.FepAwareTextEditor()) |
|
19962 { |
|
19963 // update indicators only if this is editable component. |
|
19964 iIndicator->SetCopyMode(EFalse); |
|
19965 UpdateIndicators(); |
|
19966 } |
|
19967 #ifdef RD_SCALABLE_UI_V2 |
|
19968 HandleChangeInFocus(); |
|
19969 #endif |
|
19970 |
|
19971 } |
|
19972 |
|
19973 } |
|
19974 |
|
19975 TInt CAknFepManager::FepShowVkbPreviewStatus() |
|
19976 { |
|
19977 return iSharedDataInterface->FepShowVkbPreviewStatus(); |
|
19978 } |
|
19979 |
|
19980 void CAknFepManager::InitPreviewMenuPane(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
19981 { |
|
19982 if (FepShowVkbPreviewStatus() > 0) |
|
19983 { |
|
19984 aMenuPane->GetMenuPane()->SetItemButtonState(EPenInputCmdPreviewOn, |
|
19985 EEikMenuItemSymbolOn ); |
|
19986 } |
|
19987 else |
|
19988 { |
|
19989 aMenuPane->GetMenuPane()->SetItemButtonState(EPenInputCmdPreviewOff, |
|
19990 EEikMenuItemSymbolOn ); |
|
19991 } |
|
19992 } |
|
19993 |
|
19994 void CAknFepManager::SynCCPSoftKey() |
|
19995 { |
|
19996 TRAP_IGNORE(HandleCopyCutStateL()); |
|
19997 } |
|
19998 |
|
19999 TInt CAknFepManager::PluginInputMode() const |
|
20000 { |
|
20001 #ifdef RD_SCALABLE_UI_V2 |
|
20002 return iFepPluginManager ? iFepPluginManager->PluginInputMode() : EPluginInputModeNone; |
|
20003 #else |
|
20004 return EPluginInputModeNone; |
|
20005 #endif |
|
20006 } |
|
20007 |
|
20008 void CAknFepManager::HandleEndKeyL() |
|
20009 { |
|
20010 #ifdef RD_SCALABLE_UI_V2 |
|
20011 |
|
20012 if (iFepPluginManager) |
|
20013 { |
|
20014 return; |
|
20015 } |
|
20016 |
|
20017 RWsSession &ws = CCoeEnv::Static()->WsSession(); |
|
20018 //TInt wgId =ws.GetFocusWindowGroup(); |
|
20019 CApaWindowGroupName* wg = CApaWindowGroupName::NewLC(ws, |
|
20020 CCoeEnv::Static()->WsSession().GetFocusWindowGroup()); |
|
20021 |
|
20022 TUid id = wg->AppUid(); |
|
20023 CleanupStack::PopAndDestroy(wg); |
|
20024 |
|
20025 if (0x10207218 == id.iUid || |
|
20026 0x10281EF2 == id.iUid) |
|
20027 { |
|
20028 RPeninputServer iPenInputServer; |
|
20029 |
|
20030 TInt err = iPenInputServer.Connect(); |
|
20031 if(err == KErrNone) |
|
20032 { |
|
20033 iPenInputServer.SetForeground(ETrue); |
|
20034 iPenInputServer.ActivateLayout( EFalse ); |
|
20035 iPenInputServer.HandleCommand(ECmdPenInputWindowClose); |
|
20036 |
|
20037 iPenInputServer.ClearServerEvent(); |
|
20038 iPenInputServer.LoseForeground(); |
|
20039 iPenInputServer.Close(); |
|
20040 } |
|
20041 } |
|
20042 #endif //RD_SCALABLE_UI_V2 |
|
20043 } |
|
20044 void CAknFepManager::NeedDisableKeySound(const TKeyEvent& aKeyEvent, TEventCode aEventCode) |
|
20045 { |
|
20046 #ifdef RD_SCALABLE_UI_V2 |
|
20047 TInt keyCode = aKeyEvent.iScanCode; |
|
20048 TBool interestKey = EFalse; |
|
20049 if ( keyCode == EPtiKey0 || |
|
20050 keyCode == EPtiKey1 || |
|
20051 keyCode == EPtiKey2 || |
|
20052 keyCode == EPtiKey3 || |
|
20053 keyCode == EPtiKey4 || |
|
20054 keyCode == EPtiKey5 || |
|
20055 keyCode == EPtiKey6 || |
|
20056 keyCode == EPtiKey7 || |
|
20057 keyCode == EPtiKey8 || |
|
20058 keyCode == EPtiKey9 || |
|
20059 keyCode == EStdKeyDownArrow || |
|
20060 keyCode == EStdKeyRightArrow || |
|
20061 keyCode == EStdKeyLeftArrow || |
|
20062 keyCode == EStdKeyUpArrow || |
|
20063 keyCode == EStdKeyBackspace |
|
20064 ) |
|
20065 { |
|
20066 interestKey = ETrue; |
|
20067 } |
|
20068 if( interestKey && iFepPluginManager && |
|
20069 iFepPluginManager->PluginInputMode() == EPluginInputModeItut) |
|
20070 { |
|
20071 if( aEventCode == EEventKeyDown ) |
|
20072 { |
|
20073 static_cast<CAknAppUi*>(CEikonEnv::Static()->EikAppUi())-> |
|
20074 DisableNextKeySound( keyCode ); |
|
20075 } |
|
20076 else if( aEventCode == EEventKey ) |
|
20077 { |
|
20078 #ifdef RD_TACTILE_FEEDBACK |
|
20079 MTouchFeedback::Instance()-> |
|
20080 InstantFeedback(ETouchFeedbackSensitive); |
|
20081 #endif |
|
20082 } |
|
20083 } |
|
20084 #endif |
|
20085 } |
|
20086 |
|
20087 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
20088 void CAknFepManager::SetComposChrFlag( TBool aFlag ) |
|
20089 { |
|
20090 iComposChrFlag = aFlag; |
|
20091 } |
|
20092 TBool CAknFepManager::GetComposChrFlag( ) |
|
20093 { |
|
20094 return iComposChrFlag; |
|
20095 } |
|
20096 #endif |
|
20097 |
|
20098 // add for phrase creation User db view |
|
20099 void CAknFepManager::AddUserDBDlgItemL( CAknFepUiInterfaceMenuPane* aMenuPane, TInt aIndex ) |
|
20100 { |
|
20101 CAknFepUiInterfaceMenuPane::SItemData mData; |
|
20102 |
|
20103 TBuf<KMaxFileName> langStr; |
|
20104 TInt Inputlangindex; |
|
20105 if (!aMenuPane->MenuItemExists(EAknCmdUserDBDlg, Inputlangindex)) |
|
20106 { |
|
20107 StringLoader::Load(langStr, R_AKNFEP_OPTIONS_USER_DB_DLG); |
|
20108 |
|
20109 mData.iCommandId = EAknCmdUserDBDlg; |
|
20110 mData.iCascadeId = 0; |
|
20111 mData.iFlags = 0; |
|
20112 mData.iText.Copy(langStr.Mid(1, langStr.Length() - 1).Left(CAknFepUiInterfaceMenuPane::SItemData::ENominalTextLength)); |
|
20113 |
|
20114 aMenuPane->InsertMenuItemL(mData, aIndex); |
|
20115 } |
|
20116 } |
|
20117 // add for phrase creation |
|
20118 void CAknFepManager::LaunchUserDBDlgL( ) |
|
20119 { |
|
20120 TInt itemIndex = 0; |
|
20121 |
|
20122 //Change title text |
|
20123 CEikStatusPane* statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane(); |
|
20124 CAknTitlePane* title = static_cast< CAknTitlePane* >( |
|
20125 statusPane->ControlL( TUid::Uid( EEikStatusPaneUidTitle) ) ); |
|
20126 |
|
20127 //Save the old title tet |
|
20128 HBufC* Oldtitletext = title->Text()->AllocLC(); |
|
20129 //Load the new title text |
|
20130 HBufC* titletext = StringLoader::LoadLC( R_AKNFEP_USER_DB_MANAGEMENT_TITLE ); |
|
20131 //Set title to the new text |
|
20132 title->SetTextL( *titletext ); |
|
20133 |
|
20134 CDesCArray* items = new( ELeave ) CDesCArrayFlat( KSelectItemSize ); |
|
20135 CleanupStack::PushL( items ); |
|
20136 CArrayFix<TInt>* selectedItems = new( ELeave ) CArrayFixFlat<TInt>( KSelectItemSize ); |
|
20137 CleanupStack::PushL( selectedItems ); |
|
20138 |
|
20139 CAknToolbar* toolbar = iAvkonAppUi->CurrentFixedToolbar(); |
|
20140 |
|
20141 if( toolbar && toolbar->IsShown() && toolbar->CountComponentControls()>0 ) |
|
20142 { |
|
20143 toolbar->SetDimmed( ETrue ); |
|
20144 toolbar->DrawDeferred(); |
|
20145 } |
|
20146 |
|
20147 TUid naviPaneUid; |
|
20148 naviPaneUid.iUid = EEikStatusPaneUidNavi; |
|
20149 |
|
20150 CEikStatusPaneBase::TPaneCapabilities subPane = |
|
20151 statusPane->PaneCapabilities(naviPaneUid); |
|
20152 // if we can access the navigation pane |
|
20153 if (subPane.IsPresent() && subPane.IsAppOwned()) |
|
20154 { |
|
20155 CAknNavigationControlContainer |
|
20156 * naviPane = |
|
20157 (CAknNavigationControlContainer *) statusPane->ControlL(naviPaneUid); |
|
20158 iTapGroup = naviPane->CreateTabGroupL(); |
|
20159 iTapGroup->MakeVisible( EFalse ); |
|
20160 naviPane->PushL( *iTapGroup ); |
|
20161 } |
|
20162 |
|
20163 iUserdbdlg = CAknFepUserdbDlg::NewL( itemIndex, |
|
20164 selectedItems, items, R_AKNFEP_USERDB_DLG_MENUBAR, iPtiEngine, this ); |
|
20165 |
|
20166 iIsUserdbdlgActive = 1; |
|
20167 |
|
20168 iUserdbdlg->RunLD(); |
|
20169 |
|
20170 iIsUserdbdlgActive = 0; |
|
20171 |
|
20172 // if we can access the navigation pane |
|
20173 if (subPane.IsPresent() && subPane.IsAppOwned()) |
|
20174 { |
|
20175 |
|
20176 CAknNavigationControlContainer |
|
20177 * naviPane = |
|
20178 (CAknNavigationControlContainer *) statusPane->ControlL(naviPaneUid); |
|
20179 naviPane->Pop(); |
|
20180 delete iTapGroup; |
|
20181 iTapGroup = NULL; |
|
20182 } |
|
20183 |
|
20184 //Set the title to old text |
|
20185 title->SetTextL( *Oldtitletext ); |
|
20186 |
|
20187 if( toolbar ) |
|
20188 { |
|
20189 toolbar->SetDimmed( EFalse ); |
|
20190 toolbar->DrawNow(); |
|
20191 } |
|
20192 |
|
20193 CleanupStack::PopAndDestroy( selectedItems ); |
|
20194 CleanupStack::PopAndDestroy( items ); |
|
20195 CleanupStack::PopAndDestroy( titletext ); |
|
20196 CleanupStack::PopAndDestroy( Oldtitletext ); |
|
20197 iUserdbdlg = NULL; |
|
20198 } |
|
20199 // add for phrase creation |
|
20200 TBool CAknFepManager::IsPinyinPhraseCreation() const |
|
20201 { |
|
20202 return iPinyinPhraseCreation; |
|
20203 } |
|
20204 |
|
20205 void CAknFepManager::PinyinPhraseCreation( TBool aPinyinPhraseCreation ) |
|
20206 { |
|
20207 if ( iPinyinPhraseCreation != aPinyinPhraseCreation ) |
|
20208 { |
|
20209 iPinyinPhraseCreation = aPinyinPhraseCreation; |
|
20210 } |
|
20211 } |
|
20212 // add for phrase creation |
|
20213 TBool CAknFepManager::IsPhraseCreation() const |
|
20214 { |
|
20215 return iPhraseCreation; |
|
20216 } |
|
20217 // add for phrase creation |
|
20218 void CAknFepManager::PhraseCreation( TBool aPhraseCreation ) |
|
20219 { |
|
20220 if ( iPhraseCreation != aPhraseCreation ) |
|
20221 { |
|
20222 iPhraseCreation = aPhraseCreation; |
|
20223 } |
|
20224 } |
|
20225 // add for phrase creation |
|
20226 TBool CAknFepManager::IsEntryPhrase() const |
|
20227 { |
|
20228 return iEntryPhrase; |
|
20229 } |
|
20230 // add for phrase creation |
|
20231 void CAknFepManager::EntryPhrase( TBool aEntryPhrase ) |
|
20232 { |
|
20233 if ( iEntryPhrase != aEntryPhrase ) |
|
20234 { |
|
20235 iEntryPhrase = aEntryPhrase; |
|
20236 } |
|
20237 } |
|
20238 // add for phrase creation |
|
20239 void CAknFepManager::EnableKeyStar( TBool aEnable ) |
|
20240 { |
|
20241 if ( iKeyStar != aEnable ) |
|
20242 { |
|
20243 iKeyStar = aEnable; |
|
20244 } |
|
20245 } |
|
20246 // add for phrase creation |
|
20247 TBool CAknFepManager::IsEnableKeyStar( ) const |
|
20248 { |
|
20249 return iKeyStar; |
|
20250 } |
|
20251 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
20252 |
|
20253 |
|
20254 #ifdef __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__ |
|
20255 /** |
|
20256 * @return ETrue If the number entry with long key press is supported on QWERTY keyboard. |
|
20257 */ |
|
20258 TBool CAknFepManager::LongPressNumberEntryOnQwerty() const |
|
20259 { |
|
20260 TBool value = EFalse; |
|
20261 if ( iSharedDataInterface ) |
|
20262 { |
|
20263 value = iSharedDataInterface->LongPressNumberEntryOnQwerty(); |
|
20264 } |
|
20265 return value; |
|
20266 } |
|
20267 |
|
20268 #endif // __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__ |
|
20269 |
|
20270 |
|
20271 void CAknFepManager::MultitapThroughSCTCharL(TCallBack aCallBack) |
|
20272 { |
|
20273 |
|
20274 TInt res = GetNumericSCTResID(); |
|
20275 |
|
20276 if(!res) |
|
20277 { |
|
20278 return; |
|
20279 } |
|
20280 |
|
20281 if(!iNumericResourceTimer) |
|
20282 { |
|
20283 iNumericResourceTimer = CChrMultiTapTimer::NewL(aCallBack); |
|
20284 } |
|
20285 |
|
20286 if(!iResourceString || iNumericResourceId !=res ) |
|
20287 { |
|
20288 // either the resource string has not be created or the resource ID has changed |
|
20289 if(iResourceString) |
|
20290 { |
|
20291 delete iResourceString; |
|
20292 iResourceString = NULL; |
|
20293 } |
|
20294 iNumericResourceId = res; |
|
20295 TResourceReader reader; |
|
20296 CEikonEnv::Static()->CreateResourceReaderLC(reader,iNumericResourceId); |
|
20297 reader.ReadInt32(); // skip sct id |
|
20298 iResourceString = reader.ReadHBufC16L(); |
|
20299 CleanupStack::PopAndDestroy(); |
|
20300 } |
|
20301 if(!iResourceString) |
|
20302 { |
|
20303 return; |
|
20304 } |
|
20305 if(iNumericResourceTimer->IsActive()) |
|
20306 { |
|
20307 if( iChrCharIndex == iResourceString->Length() ) |
|
20308 { |
|
20309 iChrCharIndex = 0; |
|
20310 } |
|
20311 |
|
20312 iNumericResourceTimer->Cancel(); |
|
20313 iNumericResourceTimer->After(KChrKeyMultitapTimeout); |
|
20314 } |
|
20315 else |
|
20316 { |
|
20317 iChrCharIndex = 0; |
|
20318 iNumericResourceTimer->After(KChrKeyMultitapTimeout); |
|
20319 } |
|
20320 TBuf<1> buf; |
|
20321 buf.Append((*iResourceString)[iChrCharIndex]); |
|
20322 NewCharacterL(buf); |
|
20323 iChrCharIndex++; |
|
20324 if (iResourceString->Length() == 1) |
|
20325 { |
|
20326 NumericResourceMultiTapTimerTimeoutL(); |
|
20327 } |
|
20328 |
|
20329 } |
|
20330 TBool CAknFepManager::NumericResourceMultiTapTimerTimeoutL() |
|
20331 { |
|
20332 if(iNumericResourceTimer->IsActive()) |
|
20333 { |
|
20334 iNumericResourceTimer->Cancel(); |
|
20335 if(IsFlagSet(CAknFepManager::EFlagInsideMultitapInlineEditingTransaction)) |
|
20336 { |
|
20337 CommitInlineEditL(); |
|
20338 return ETrue; |
|
20339 } |
|
20340 } |
|
20341 return EFalse; |
|
20342 } |
|
20343 |
|
20344 //------------------------------------------------------------------- |
|
20345 |
|
20346 // |
|
20347 // CChrMultiTapTimer |
|
20348 // |
|
20349 |
|
20350 // --------------------------------------------------------------------------- |
|
20351 // CChrMultiTapTimer::NewL |
|
20352 // |
|
20353 // --------------------------------------------------------------------------- |
|
20354 // |
|
20355 CChrMultiTapTimer* CChrMultiTapTimer::NewL(TCallBack aCallback) |
|
20356 { |
|
20357 CChrMultiTapTimer* self = new(ELeave)CChrMultiTapTimer(aCallback); |
|
20358 CleanupStack::PushL(self); |
|
20359 self->ConstructL(); |
|
20360 CleanupStack::Pop(); // self |
|
20361 return self; |
|
20362 } |
|
20363 |
|
20364 |
|
20365 // --------------------------------------------------------------------------- |
|
20366 // CChrMultiTapTimer::CChrMultiTapTimer |
|
20367 // |
|
20368 // --------------------------------------------------------------------------- |
|
20369 // |
|
20370 CChrMultiTapTimer::CChrMultiTapTimer(TCallBack aCallback) |
|
20371 :CTimer(EPriorityStandard), iCallback(aCallback) |
|
20372 { |
|
20373 } |
|
20374 |
|
20375 // --------------------------------------------------------------------------- |
|
20376 // CChrMultiTapTimer::ConstructL |
|
20377 // |
|
20378 // --------------------------------------------------------------------------- |
|
20379 // |
|
20380 void CChrMultiTapTimer::ConstructL() |
|
20381 { |
|
20382 CTimer::ConstructL(); |
|
20383 CActiveScheduler::Add(this); |
|
20384 } |
|
20385 |
|
20386 // --------------------------------------------------------------------------- |
|
20387 // CChrMultiTapTimer::After |
|
20388 // |
|
20389 // --------------------------------------------------------------------------- |
|
20390 // |
|
20391 void CChrMultiTapTimer::After(TTimeIntervalMicroSeconds32 aInterval) |
|
20392 { |
|
20393 if (IsActive()) |
|
20394 { |
|
20395 Cancel(); |
|
20396 } |
|
20397 CTimer::After(aInterval); |
|
20398 } |
|
20399 |
|
20400 // --------------------------------------------------------------------------- |
|
20401 // CChrMultiTapTimer::RunL |
|
20402 // |
|
20403 // --------------------------------------------------------------------------- |
|
20404 // |
|
20405 void CChrMultiTapTimer::RunL() |
|
20406 { |
|
20407 iCallback.CallBack(); |
|
20408 } |
|
20409 |
|
20410 TBool CAknFepManager::IsLanguageSupportPrediction() |
|
20411 { |
|
20412 TBool isLanguagugeSupportsPrediction = EFalse; |
|
20413 switch(iKeyboardType) |
|
20414 { |
|
20415 case EPtiKeyboardHalfQwerty: |
|
20416 #ifdef __HALF_QWERTY_KEYPAD |
|
20417 isLanguagugeSupportsPrediction = (iQwertyInputMode) & (iLanguageCapabilities.iSupportsWesternHalfQwertyPredictive); |
|
20418 #endif |
|
20419 break; |
|
20420 case EPtiKeyboardQwerty4x12: |
|
20421 case EPtiKeyboardQwerty4x10: |
|
20422 case EPtiKeyboardQwerty3x11: |
|
20423 case EPtiKeyboardCustomQwerty: |
|
20424 isLanguagugeSupportsPrediction = (iQwertyInputMode) & (iLanguageCapabilities.iSupportsWesternQwertyPredictive); |
|
20425 break; |
|
20426 case EPtiKeyboardNone: |
|
20427 case EPtiKeyboard12Key: |
|
20428 isLanguagugeSupportsPrediction = (!iQwertyInputMode) & (iLanguageCapabilities.iSupportsWesternPredictive); |
|
20429 break; |
|
20430 default: |
|
20431 isLanguagugeSupportsPrediction = (!iQwertyInputMode) & (iLanguageCapabilities.iSupportsWesternPredictive); |
|
20432 break; |
|
20433 } |
|
20434 return isLanguagugeSupportsPrediction; |
|
20435 } |
|
20436 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
20437 |
|
20438 TBool CAknFepManager::IsAllowedKeymappingForNumberMode(TChar aChar) const |
|
20439 { |
|
20440 TBool response = EFalse; |
|
20441 |
|
20442 |
|
20443 switch ( iAknEditorNumericKeymap ) |
|
20444 { |
|
20445 case EAknEditorStandardNumberModeKeymap: |
|
20446 case EAknEditorFixedDiallingNumberModeKeymap: |
|
20447 case EAknEditorSATNumberModeKeymap: |
|
20448 case EAknEditorSATHiddenNumberModeKeymap: |
|
20449 { |
|
20450 response = (aChar == '#'); |
|
20451 } |
|
20452 break; |
|
20453 case EAknEditorCalculatorNumberModeKeymap: |
|
20454 case EAknEditorConverterNumberModeKeymap: |
|
20455 { |
|
20456 TLocale tLoc; |
|
20457 response = (aChar == tLoc.DecimalSeparator()); |
|
20458 } |
|
20459 break; |
|
20460 case EAknEditorToFieldNumberModeKeymap: |
|
20461 { |
|
20462 response = (aChar == ';'); |
|
20463 } |
|
20464 break; |
|
20465 case EAknEditorPlainNumberModeKeymap: |
|
20466 case EAknEditorReservedInternalUseKeymap: |
|
20467 default: |
|
20468 break; |
|
20469 } |
|
20470 |
|
20471 return response; |
|
20472 } |
|
20473 /** |
|
20474 * Return wether ipnut mode is change by press shift+space. |
|
20475 * This is for half-qwerty. |
|
20476 */ |
|
20477 TBool CAknFepManager::IsChangeModeByShiftAndSpace() |
|
20478 { |
|
20479 return iShiftAndSpace; |
|
20480 } |
|
20481 |
|
20482 /** |
|
20483 * Set wether ipnut mode is change by press shift+space. |
|
20484 * This is for half-qwerty. |
|
20485 */ |
|
20486 void CAknFepManager::SetChangeModeByShiftAndSpace( TBool aFlag ) |
|
20487 { |
|
20488 iShiftAndSpace = aFlag; |
|
20489 } |
|
20490 |
|
20491 void CAknFepManager::HideExactWordPopUp() |
|
20492 { |
|
20493 iExactWordPopupContent->HidePopUp(); |
|
20494 } |
|
20495 |
|
20496 TBool CAknFepManager::IsExactWordPopUpShown() |
|
20497 { |
|
20498 return iExactWordPopupContent->IsPopUpVisible(); |
|
20499 } |
|
20500 void CAknFepManager::StopDisplayingMenuBar() |
|
20501 { |
|
20502 if (iEditMenuBar) |
|
20503 { |
|
20504 iEditMenuBar->StopDisplayingMenuBar(); |
|
20505 iEditMenuBar = NULL; |
|
20506 } |
|
20507 #ifdef __ITI_VIRTUAL_TOUCH_FIRST_GENERATION_SUPPORT__ |
|
20508 if (iOptionsMenuBar) |
|
20509 { |
|
20510 iOptionsMenuBar->StopDisplayingMenuBar(); |
|
20511 iOptionsMenuBar = NULL; |
|
20512 } |
|
20513 #endif //__ITI_VIRTUAL_TOUCH_FIRST_GENERATION_SUPPORT__ |
|
20514 } |
|
20515 |
|
20516 void CAknFepManager::SetQwertyModeToInputcapbility() |
|
20517 { |
|
20518 if ( iSharedDataInterface->QwertyInputMode() ) |
|
20519 { |
|
20520 SetExtendedInputCapabilities( ExtendedInputCapabilities() | |
|
20521 CAknExtendedInputCapabilities::EInputEditorQwertyInputActive ); |
|
20522 } |
|
20523 else |
|
20524 { |
|
20525 SetExtendedInputCapabilities( ExtendedInputCapabilities() & |
|
20526 ~CAknExtendedInputCapabilities::EInputEditorQwertyInputActive ); |
|
20527 } |
|
20528 } |
|
20529 void CAknFepManager::SetExtendedInputCapabilities( TUint aCapabilities) |
|
20530 { |
|
20531 MObjectProvider* mop = iInputCapabilities.ObjectProvider(); |
|
20532 |
|
20533 if ( mop && iInputCapabilities.FepAwareTextEditor() )//IsFepAwareTextEditor() |
|
20534 { |
|
20535 CAknExtendedInputCapabilities* extendedInputCapabilities = |
|
20536 mop->MopGetObject( extendedInputCapabilities ); |
|
20537 |
|
20538 if ( extendedInputCapabilities ) |
|
20539 { |
|
20540 extendedInputCapabilities->SetCapabilities( aCapabilities ); |
|
20541 } |
|
20542 } |
|
20543 |
|
20544 return; |
|
20545 } |
|
20546 |
|
20547 void CAknFepManager::PrepareFepAfterDialogExitL(TUid aFepUid) |
|
20548 { |
|
20549 // This ensures that on 3rd party fep change we do not have access to other fep variables |
|
20550 if (aFepUid != CCoeEnv::Static()->FepUid()) |
|
20551 { |
|
20552 // In case the fep has changed, then leave |
|
20553 User::Leave(KErrNone); |
|
20554 } |
|
20555 // Once the editor which launches a dialog is destroyed, this flag is set |
|
20556 // In case we have any dialog launched we leave as the underneath editor is |
|
20557 // destroyed |
|
20558 if (IsExtendedFlagSet(EExtendedFlagEdwinEditorDestroyed)) |
|
20559 { |
|
20560 if(!iFepAwareDialogParentEditor) |
|
20561 { |
|
20562 // For Eg: Messaging editor launches spell query which inturn launches |
|
20563 // SCT. Then don't clear the flag once we dismiss SCT because we even |
|
20564 // need to dismiss spell query dialog. |
|
20565 ClearExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
20566 } |
|
20567 User::Leave(KErrNone); |
|
20568 } |
|
20569 if(!iFepAwareDialogParentEditor) |
|
20570 { |
|
20571 ClearExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
20572 } |
|
20573 } |
|
20574 |
|
20575 void CAknFepManager::PrepareFepForFepAwareDialogLaunch() |
|
20576 { |
|
20577 iFepAwareDialogParentEditor = EditorState(); |
|
20578 SetExtendedFlag(EExtendedFlagFepAwareDialogLaunched); |
|
20579 } |
|
20580 |
|
20581 void CAknFepManager::PrepareFepAfterFepAwareDialogExitL(TUid aFepUid) |
|
20582 { |
|
20583 // This ensures that on 3rd party fep change we do not have access to other fep variables |
|
20584 if (aFepUid != CCoeEnv::Static()->FepUid()) |
|
20585 { |
|
20586 // In case the fep has changed, then leave |
|
20587 User::Leave(KErrNone); |
|
20588 } |
|
20589 iFepAwareDialogParentEditor = NULL; |
|
20590 ClearExtendedFlag(EExtendedFlagFepAwareDialogLaunched); |
|
20591 } |
|
20592 |
|
20593 void CAknFepManager::ConvertCharToKey(TChar aChar, TUint16& aKey) const |
|
20594 { |
|
20595 aKey = 0; |
|
20596 |
|
20597 if (!iPtiEngine) |
|
20598 return; |
|
20599 |
|
20600 CPtiCoreLanguage* lang = (CPtiCoreLanguage*)iPtiEngine->GetLanguage(iLanguageCapabilities.iInputLanguageCode); |
|
20601 TPtiEngineInputMode inputMode = iPtiEngine->InputMode(); |
|
20602 |
|
20603 if (!lang) |
|
20604 return; |
|
20605 |
|
20606 const TBool vietnamese = (iLanguageCapabilities.iInputLanguageCode == ELangVietnamese); |
|
20607 |
|
20608 MPtiKeyMappings* map; |
|
20609 if (inputMode == EPtiEngineQwerty || inputMode == EPtiEngineQwertyPredictive) |
|
20610 { |
|
20611 map = lang->GetQwertyKeymappings(); |
|
20612 } |
|
20613 else if( inputMode == EPtiEngineHalfQwerty || inputMode == EPtiEngineHalfQwertyPredictive ) |
|
20614 { |
|
20615 map = lang->GetHalfQwertyKeymappings(); |
|
20616 } |
|
20617 else |
|
20618 { |
|
20619 map = lang->GetKeymappings(); |
|
20620 } |
|
20621 |
|
20622 if (!map) |
|
20623 { |
|
20624 return; |
|
20625 } |
|
20626 |
|
20627 TUint16 ch; |
|
20628 ch = (TUint16)map->KeyForCharacter(aChar); |
|
20629 if (!ch && vietnamese) |
|
20630 { |
|
20631 // This may be Vietnamese tone mark or an accented character which isn't listed |
|
20632 // in keymappings. |
|
20633 ch = RemapVietnameseAccentedCharacter(aChar); |
|
20634 } |
|
20635 |
|
20636 aKey = ch; |
|
20637 } |
|
20638 |
|
20639 // --------------------------------------------------------------------------- |
|
20640 // LOCAL METHODS |
|
20641 // |
|
20642 // --------------------------------------------------------------------------- |
|
20643 // |
|
20644 const TInt KVietKeyMarker = 0xffff; |
|
20645 const TUint16 vietnameseAccents[] = |
|
20646 { |
|
20647 KVietKeyMarker, EPtiKey2, // For key 2, a-based |
|
20648 0x00c1, 0x00c0, 0x1ea2, 0x00c3, 0x1ea0, |
|
20649 0x00e1, 0x00e0, 0x1ea3, 0x00e3, 0x1ea1, |
|
20650 0x0102, 0x1eae, 0x1eb0, 0x1eb2, 0x1eb4, 0x1eb6, |
|
20651 0x0103, 0x1eaf, 0x1eb1, 0x1eb3, 0x1eb5, 0x1eb7, |
|
20652 0x00c2, 0x1ea4, 0x1ea6, 0x1ea8, 0x1eaa, 0x1eac, |
|
20653 0x00e2, 0x1ea5, 0x1ea7, 0x1ea9, 0x1eab, 0x1ead, |
|
20654 |
|
20655 KVietKeyMarker, EPtiKey3, // For key 3, e-based |
|
20656 0x00c9, 0x00c8, 0x1eba, 0x1ebc, 0x1eb8, |
|
20657 0x00e9, 0x00e8, 0x1ebb, 0x1ebd, 0x1eb9, |
|
20658 0x00ca, 0x1ebe, 0x1ec0, 0x1ec2, 0x1ec4, 0x1ec6, |
|
20659 0x00ea, 0x1ebf, 0x1ec1, 0x1ec3, 0x1ec5, 0x1ec7, |
|
20660 |
|
20661 KVietKeyMarker, EPtiKey4, // For key 4, i-based |
|
20662 0x00cd, 0x00cc, 0x1ec8, 0x0128, 0x1eca, |
|
20663 0x00ed, 0x00ec, 0x1ec9, 0x0129, 0x1ecb, |
|
20664 |
|
20665 KVietKeyMarker, EPtiKey6, // For key 6, o-based |
|
20666 0x00d3, 0x00d2, 0x1ece, 0x00d5, 0x1ecc, |
|
20667 0x00f3, 0x00f2, 0x1ecf, 0x00f5, 0x1ecd, |
|
20668 0x00d4, 0x1ed0, 0x1ed2, 0x1ed4, 0x1ed6, 0x1ed8, |
|
20669 0x00f4, 0x1ed1, 0x1ed3, 0x1ed5, 0x1ed7, 0x1ed9, |
|
20670 0x01a0, 0x1eda, 0x1edc, 0x1ede, 0x1ee0, 0x1ee2, |
|
20671 0x01a1, 0x1edb, 0x1edd, 0x1edf, 0x1ee1, 0x1ee3, |
|
20672 0 |
|
20673 }; |
|
20674 |
|
20675 |
|
20676 // --------------------------------------------------------------------------- |
|
20677 // RemapVietnameseAccentedCharacter |
|
20678 // |
|
20679 // --------------------------------------------------------------------------- |
|
20680 // |
|
20681 LOCAL_C TInt RemapVietnameseAccentedCharacter(TUint16 aChr) |
|
20682 { |
|
20683 // Check tone marks first. |
|
20684 switch (aChr) |
|
20685 { |
|
20686 case 0x0301: |
|
20687 return EPtiKey2; |
|
20688 case 0x0300: |
|
20689 return EPtiKey3; |
|
20690 case 0x0309: |
|
20691 return EPtiKey4; |
|
20692 case 0x0303: |
|
20693 return EPtiKey5; |
|
20694 case 0x0323: |
|
20695 return EPtiKey6; |
|
20696 default: |
|
20697 break; |
|
20698 } |
|
20699 |
|
20700 TInt ret = 0; |
|
20701 |
|
20702 for (const TUint16* ptr = vietnameseAccents; *ptr != 0; ptr++) |
|
20703 { |
|
20704 if (*ptr == KVietKeyMarker) |
|
20705 { |
|
20706 ret = ptr[1]; |
|
20707 ptr++; |
|
20708 } |
|
20709 else |
|
20710 { |
|
20711 if (*ptr == aChr) |
|
20712 { |
|
20713 break; |
|
20714 } |
|
20715 } |
|
20716 } |
|
20717 |
|
20718 return ret; |
|
20719 } |
|
20720 |
|
20721 // End of file |