author | Simon Howkins <simonh@symbian.org> |
Mon, 15 Nov 2010 14:00:51 +0000 | |
branch | RCL_3 |
changeset 59 | 7febbd162ded |
parent 56 | 8152b1f1763a |
permissions | -rw-r--r-- |
44 | 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 |
#include <AknFepInternalPSKeys.h> |
|
135 |
#include <e32property.h> |
|
136 |
#include <AknDef.h> |
|
137 |
||
138 |
const TInt KSelectItemSize(10); |
|
139 |
_LIT(KAknFepResourceFileName, "z:\\resource\\fep\\aknfep.rsc"); |
|
140 |
||
141 |
#define text_to_field_mode_hash_key ';' |
|
142 |
#define iAvkonAppUi ((CAknAppUi*)CEikonEnv::Static()->EikAppUi()) |
|
143 |
#define __SHIFT_KEY_LOOP |
|
144 |
||
145 |
// EAknEditorNativeKeysNumberModeKeymap is used for example in MFNE editors. |
|
146 |
#define EAknEditorNativeKeysNumberModeKeymap EAknEditorReservedInternalUseKeymap |
|
147 |
||
148 |
// UID of user dictionary application |
|
149 |
const TUid KUidUserDictApp = {0x101F8645}; |
|
150 |
||
151 |
const TText KAknFEPLineFeedSymbol = 0x21B2; |
|
152 |
const TText KAknFEPMirroredLineFeedSymbol = 0x21B3; |
|
153 |
const TText KAknFEPZeroKey = 0x30; |
|
154 |
||
155 |
// inline text decoration potentially adds 2 directional markers for every "real" character. Buffer needs to be 3 x predictive engine bufsize |
|
156 |
const TInt KMaxInlineEditSize( 3 * CAknFepManager::EMaximumFepWordLength ); |
|
157 |
||
158 |
// Maximum number of chunks to navigate throught attempting to get to the visual end of a selection. |
|
159 |
// Since chunks are arranged only within a line, this should be more than the number of chunks likely in |
|
160 |
// a single line of text |
|
161 |
const TInt KMaxChunkWalkIterations(20); |
|
162 |
||
163 |
// This command is is used for setting empty CBA. |
|
164 |
const TInt KNullCommandId = 0; |
|
165 |
||
166 |
_LIT_SECURE_ID(KPhoneSecureId, 0x100058b3); |
|
167 |
||
168 |
#ifdef RD_HINDI_PHONETIC_INPUT |
|
169 |
||
170 |
const TUint KQuestionMark = 0x003F; |
|
171 |
||
172 |
#endif |
|
173 |
||
174 |
// Ccpu key events. |
|
175 |
/*As part of build warnings commenting this perticular code it might require when touch is enabled. |
|
176 |
const TKeyEvent KEditorCopyEvent = {3, 67, 161, 0}; // Ctrl + C |
|
177 |
const TKeyEvent KEditorCutEvent = {24, 88, 161, 0}; // Ctrl + X |
|
178 |
*/ |
|
179 |
||
180 |
const TInt KTouchInputPreviewOn = 1; |
|
181 |
const TInt KTouchInputPreviewOff = 0; |
|
182 |
||
183 |
#ifdef RD_SCALABLE_UI_V2 |
|
184 |
const TKeyEvent KAknCcpuCopyEvent = {EKeyF18, EEikCmdEditCopy, EModifierCtrl, 1}; // Copy event for AknCcpuSupport |
|
185 |
const TKeyEvent KAknCcpuCutEvent = {EKeyF18, EEikCmdEditCut, EModifierCtrl, 1}; // Cut event for AknCcpuSupport |
|
186 |
||
187 |
const TInt KMaxMenuSize = 28; |
|
188 |
const TInt KEditorMenuPermitedSend[KMaxMenuSize] = |
|
189 |
{ |
|
190 |
EJapanFepCmdModeHiragana, |
|
191 |
EJapanFepCmdModeKatakana, |
|
192 |
EJapanFepCmdEditModeAlpha, |
|
193 |
EJapanFepCmdEditModeNumber, |
|
194 |
EJapanFepCmdModeFullWidth, |
|
195 |
EJapanFepCmdModeHalfWidth, |
|
196 |
EChinFepCmdModePinyin, |
|
197 |
EChinFepCmdModeZhuyin, |
|
198 |
EChinFepCmdModeStroke, |
|
199 |
EChinFepCmdModePinyinPhrase, |
|
200 |
EChinFepCmdModeZhuyinPhrase, |
|
201 |
EChinFepCmdModeStrokePhrase, |
|
202 |
EAknCmdT9PredictiveT9Off, |
|
203 |
EAknCmdMultitapPredictiveT9On, |
|
204 |
EJapanFepCmdMultitapPredictiveT9On, |
|
205 |
EChinFepCmdModeZhuyinFind, |
|
206 |
EChinFepCmdModeStrokeFind, |
|
207 |
EAknCmdEditModeAlpha, |
|
208 |
EAknCmdEditModeLatinText, |
|
209 |
EChinFepCmdModeLatinUpper, |
|
210 |
EChinFepCmdModeLatinLower, |
|
211 |
EAknCmdEditModeNumber, |
|
212 |
EChinFepCmdModeNumber, |
|
213 |
EAknCmdEditModeArabicIndicNumber, |
|
214 |
EAknCmdEditModeEasternArabicIndicNumber, |
|
215 |
EAknCmdEditModeIndicNumber, |
|
216 |
EAknCmdEditModeKorean, |
|
217 |
EAknCmdEditModeEnglish |
|
218 |
}; |
|
219 |
||
220 |
#endif // RD_SCALABLE_UI_V2 |
|
221 |
||
222 |
||
223 |
// Number modes used by Arabic or Hindi. |
|
224 |
enum TNonLatinNumberModes |
|
225 |
{ |
|
226 |
ENbrModeLatin, |
|
227 |
ENbrModeArabic = 1, |
|
228 |
ENbrModeIndic = 1 |
|
229 |
}; |
|
230 |
||
231 |
// Number mode type |
|
232 |
enum TNonLatinNumberModeType |
|
233 |
{ |
|
234 |
ENbrModeTypeArabic, |
|
235 |
ENbrModeTypeIndic, |
|
236 |
ENbrModeTypeEasternArabic //for Urdu & Farsi languages |
|
237 |
}; |
|
238 |
||
239 |
// The passwd timeout is same as defined on CEikSecretEditor. |
|
240 |
const TInt KSyncPasswdTimeout = 1000000; |
|
241 |
||
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
242 |
// The offset to show underline |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
243 |
const TInt KUnderlineHeight = 4; |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
244 |
|
44 | 245 |
#ifdef RD_SCALABLE_UI_V2 |
246 |
TUid AppUidFromWndGroupId(TInt aWndGrpId); |
|
247 |
extern TUid GetCurAppUid(); |
|
248 |
extern TBool IsGlobalNotesApp(TUid& aUid); |
|
249 |
TInt GetForegroundTaskAppWgId(); |
|
250 |
#endif |
|
251 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
252 |
const TInt KWordToFocusInCandidateList = 1; |
|
253 |
#endif |
|
254 |
||
255 |
LOCAL_C TInt RemapVietnameseAccentedCharacter(TUint16 aChr); |
|
256 |
||
257 |
// |
|
258 |
// Class TTextDirectionalInfo |
|
259 |
// |
|
260 |
/** |
|
261 |
* The implementation inializes with well-defined "null" state |
|
262 |
*/ |
|
263 |
CAknFepManager::TTextDirectionalInfo::TTextDirectionalInfo() : |
|
264 |
iDirectionalStatus(EUnknown), iBlockEnvironment(EUndefined) |
|
265 |
{} |
|
266 |
||
267 |
void CAknFepManager::TTextDirectionalInfo::SetDirectionFromChunk( |
|
268 |
const CTmTextLayout::TTmChunkDescription& aChunk ) |
|
269 |
{ |
|
270 |
if ( aChunk.iStart >= 0 ) // Condition for valid block. Does nothing otherwise |
|
271 |
iDirectionalStatus = aChunk.iRightToLeft ? ERightToLeft : ELeftToRight; |
|
272 |
} |
|
273 |
||
274 |
||
275 |
void TFepLanguageTranslation::ReadFromResource(TResourceReader& aReader) |
|
276 |
{ |
|
277 |
iName.Set(aReader.ReadTPtrC()); |
|
278 |
iLanguageId = aReader.ReadInt16(); |
|
279 |
iCommandId = aReader.ReadInt16(); |
|
280 |
} |
|
281 |
||
282 |
||
283 |
CAknFepManager::CAknFepManager(CCoeEnv& aConeEnvironment) |
|
284 |
:CCoeFep(aConeEnvironment), |
|
285 |
iAsyncResouceChanged(EActivePriorityDefault), |
|
286 |
iPreviousEditingState(EStateNone), |
|
287 |
iInputCapabilities(TCoeInputCapabilities::ENone), |
|
288 |
iModeBefore(ELatin), |
|
289 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
290 |
iKeyPressedDuringShift(EFalse), |
|
291 |
#endif |
|
292 |
iCharWidth(EHalfWidthChar), |
|
293 |
iAsyncOwnSimulateKey(EActivePriorityDefault), |
|
294 |
iLongThai0Key(EFalse), |
|
295 |
iEditCharsPtr(0,0), |
|
296 |
iComposChrFlag(0), |
|
297 |
iIsUserdbdlgActive(0), |
|
298 |
iLongClearAfterCloseUI(EFalse), |
|
299 |
// phrase creation |
|
300 |
iPhraseCreation(0), |
|
301 |
iPinyinPhraseCreation(0), |
|
302 |
iEntryPhrase(0) |
|
303 |
||
304 |
||
305 |
{ |
|
306 |
} |
|
307 |
||
308 |
void CAknFepManager::ConstructL(const CCoeFepParameters& aFepParameters) |
|
309 |
{ |
|
310 |
BaseConstructL(aFepParameters); |
|
311 |
iUiInterface = CAknFepUIInterface::NewL(); |
|
312 |
iIndicator = iUiInterface->NewIndicatorL(); |
|
313 |
iPreviousIndicator = CAknEnv::Static()->SwapEditingStateIndicator(iIndicator); |
|
314 |
||
315 |
// Set up resources |
|
316 |
TFileName resourceName(KAknFepResourceFileName); |
|
317 |
CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
318 |
BaflUtils::NearestLanguageFile(coeEnv->FsSession(), resourceName); |
|
319 |
iResId = coeEnv->AddResourceFileL(resourceName); |
|
320 |
||
321 |
// Save Japanese Feature support to a member variable |
|
322 |
iFeatureSupportedJapanese = FeatureManager::FeatureSupported(KFeatureIdJapanese); |
|
323 |
||
324 |
iUiLanguage = User::Language(); |
|
325 |
||
326 |
// Shared Data |
|
327 |
iSharedDataInterface = CAknFepSharedDataInterface::NewL(this); |
|
328 |
||
329 |
TInt previUiLanguage = iSharedDataInterface->PluginUILanguage(); |
|
330 |
||
331 |
if (iUiLanguage != previUiLanguage) |
|
332 |
{ |
|
333 |
||
334 |
// if UI language has changed we need to set text input language according to UI language |
|
335 |
iSharedDataInterface->SetPluginUILanguage(iUiLanguage); |
|
336 |
iSharedDataInterface->SetInputTextLanguage(0); // signals that it needs to be updated |
|
337 |
} |
|
338 |
||
339 |
if (!iSharedDataInterface->InputMode()) //not initialised yet - first time device is switched on |
|
340 |
{ |
|
341 |
switch (iUiLanguage) |
|
342 |
{ |
|
343 |
case ELangPrcChinese: |
|
344 |
iSharedDataInterface->SetInputMode(EPinyin); |
|
345 |
break; |
|
346 |
case ELangTaiwanChinese: |
|
347 |
iSharedDataInterface->SetInputMode(EZhuyin); |
|
348 |
break; |
|
349 |
case ELangHongKongChinese: |
|
350 |
iSharedDataInterface->SetInputMode(EStroke); |
|
351 |
iSharedDataInterface->SetCangJieMode(ECangJieNormal); |
|
352 |
break; |
|
353 |
case ELangJapanese: |
|
354 |
iSharedDataInterface->SetInputMode(EHiraganaKanji); |
|
355 |
break; |
|
356 |
case ELangKorean: |
|
357 |
iSharedDataInterface->SetInputMode(EHangul); |
|
358 |
break; |
|
359 |
case ELangHindi: |
|
360 |
iSharedDataInterface->SetInputMode(EHindi); |
|
361 |
break; |
|
362 |
default: |
|
363 |
iSharedDataInterface->SetInputMode(ELatin); |
|
364 |
break; |
|
365 |
} |
|
366 |
} |
|
367 |
||
368 |
iUiInterface->SetFepMenuObserver(this); |
|
369 |
||
370 |
TInt inputLanguage = iSharedDataInterface->InputTextLanguage(); |
|
371 |
||
372 |
// A process instantiating Fep may miss ECapabilityWriteDeviceData capability, |
|
373 |
// which is needed for updating locale repository. |
|
374 |
// A workaround is to delay change up to a process that has the capability |
|
375 |
TSecurityInfo info; |
|
376 |
info.Set(RProcess()); |
|
377 |
||
378 |
TBool hasCapability = info.iCaps.HasCapability(ECapabilityWriteDeviceData); |
|
379 |
||
380 |
if (!inputLanguage && hasCapability) |
|
381 |
{ |
|
382 |
// set correct input language |
|
383 |
inputLanguage = SubstituteSublanguageId(iUiLanguage); |
|
384 |
||
385 |
// If Ptiengine is not initialize, initialize it |
|
386 |
if (!iPtiEngine) |
|
387 |
{ |
|
388 |
iPtiEngine = CPtiEngine::NewL(ETrue); |
|
389 |
} |
|
390 |
// If still not found, default to english. |
|
391 |
if (!iPtiEngine->GetLanguage(inputLanguage)) |
|
392 |
{ |
|
393 |
inputLanguage = ELangEnglish; |
|
394 |
} |
|
395 |
||
396 |
// Set the current input language |
|
397 |
iSharedDataInterface->SetInputTextLanguage(inputLanguage); |
|
398 |
||
399 |
// update numeric input |
|
400 |
if ( iUiLanguage == ELangArabic ) |
|
401 |
{ |
|
402 |
SetDefaultNumberMode( ENbrModeArabic, |
|
403 |
ENbrModeTypeArabic ); |
|
404 |
} |
|
405 |
else if ( ( iUiLanguage == ELangUrdu ) || |
|
406 |
( iUiLanguage == ELangFarsi ) ) |
|
407 |
{ |
|
408 |
SetDefaultNumberMode( ENbrModeArabic, |
|
409 |
ENbrModeTypeEasternArabic ); |
|
410 |
} |
|
411 |
else if ( TAknFepUiIndicInputManager::IsScriptDevanagari( iUiLanguage ) ) |
|
412 |
{ |
|
413 |
SetDefaultNumberMode( ENbrModeLatin, |
|
414 |
ENbrModeTypeIndic ); |
|
415 |
} |
|
416 |
else |
|
417 |
{ |
|
418 |
SetDefaultNumberMode( ENbrModeLatin, ENbrModeTypeArabic ); |
|
419 |
} |
|
420 |
} |
|
421 |
||
422 |
iSctEditChars = HBufC::NewL( 10 ); |
|
423 |
||
424 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
425 |
// Predictive QWERTY (XT9) changes ----> |
|
426 |
if(CCoeEnv::Static()->AppUi()) |
|
427 |
iExactWordPopupContent = iUiInterface->CreateWordPopupContentL(); |
|
428 |
// Predictive QWERTY (XT9) changes <---- |
|
429 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
430 |
// If the following line is uncommented, the FEP is fully constructed |
|
431 |
// for all applications at application startup. |
|
432 |
// ConstructFullyL(); |
|
433 |
iShiftKeypressMonitor = CPeriodic::NewL(CActive::EPriorityStandard); |
|
434 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
435 |
iFnKeyManager = CAknFepFnKeyManager::NewL( *this,iSharedDataInterface ); |
|
436 |
#endif |
|
437 |
TRAPD(result,iKeyCatcher = CAknFepKeyCatcher::NewL(*this)); |
|
438 |
if(result == KErrNone) |
|
439 |
{ |
|
440 |
iKeyCatcher->ActivateL(); |
|
441 |
} |
|
442 |
// the follow 3 objects for phrase creation |
|
443 |
iZhuyinKeyHandler = CZhuyinKeyHandler::NewL(); |
|
444 |
iZhuyinAnalyserDb = CZhuyinAnalyserDbFeed::NewL(EPinyinAnalyserTypeZhuyin); |
|
445 |
iZhuyinAnalyser = CAknFepZhuyinAnalyser::NewL(iZhuyinAnalyserDb); |
|
446 |
iAknFepThaiSCTSelector = CAknFepThaiSCTSelector::NewL(); |
|
447 |
iHybridAplphaChangedToAlphanumeric = EFalse; |
|
448 |
iLastFocusedEditor = NULL; |
|
449 |
iFepAwareDialogParentEditor = NULL; |
|
450 |
||
451 |
// Fep manager should have both read and write privilege. |
|
452 |
// Known case: Auto-completion cannot be changed in setting dialog. |
|
453 |
RProperty::Define( KPSUidAknFep, KAknFepSettingDialogState, RProperty::EInt ); |
|
454 |
} |
|
455 |
||
456 |
void CAknFepManager::ConstructFullyL() |
|
457 |
{ |
|
458 |
if (!iPtiEngine) |
|
459 |
{ |
|
460 |
iPtiEngine = CPtiEngine::NewL(ETrue); |
|
461 |
} |
|
462 |
||
463 |
if ( !(iPtiEngine->GetLanguage(iSharedDataInterface->InputTextLanguage())) ) |
|
464 |
{ |
|
465 |
// If input language cenrep value is set to language unknown to PtiEngine, |
|
466 |
// try to reset based on UI-language. |
|
467 |
TInt inputLang = SubstituteSublanguageId(iUiLanguage); |
|
468 |
||
469 |
// If still not found, default to english. |
|
470 |
if (!iPtiEngine->GetLanguage(inputLang)) |
|
471 |
{ |
|
472 |
inputLang = ELangEnglish; |
|
473 |
} |
|
474 |
iSharedDataInterface->SetInputTextLanguage(inputLang); |
|
475 |
} |
|
476 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
477 |
#ifdef FF_DUAL_LANGUAGE_SUPPORT |
|
478 |
if (iPtiEngine->GetLanguage(iSharedDataInterface->InputTextLanguageSecondary()) == NULL) |
|
479 |
{ |
|
480 |
// If secondary input language is unknown to PtiEngine, set it to none |
|
481 |
iSharedDataInterface->SetInputTextLanguageSecondary(0); |
|
482 |
} |
|
483 |
#endif //FF_DUAL_LANGUAGE_SUPPORT |
|
484 |
#endif |
|
485 |
||
486 |
if(NULL == iKeyCatcher) |
|
487 |
{ |
|
488 |
iKeyCatcher = CAknFepKeyCatcher::NewL(*this); |
|
489 |
iKeyCatcher->ActivateL(); |
|
490 |
} |
|
491 |
||
492 |
iConcatenationTimer=CPeriodic::NewL(CActive::EPriorityStandard); |
|
493 |
iPostEventCheck=CIdle::NewL(CActive::EPriorityStandard); |
|
494 |
iChrKeypressMonitor = CPeriodic::NewL(CActive::EPriorityStandard); |
|
495 |
||
496 |
CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
497 |
TInt inputLanguage = iSharedDataInterface->InputTextLanguage(); |
|
498 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
499 |
#ifdef FF_DUAL_LANGUAGE_SUPPORT |
|
500 |
TInt inputLanguageSecondary = iSharedDataInterface->InputTextLanguageSecondary(); |
|
501 |
#endif //FF_DUAL_LANGUAGE_SUPPORT |
|
502 |
#endif |
|
503 |
SetWesternPredictive(iSharedDataInterface->PredictiveTextOn()); |
|
504 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
505 |
iIsAutoCompleteOn = iSharedDataInterface->PredictiveTextAutoCompleteOn(); // AutoCompletion disabled by Default |
|
506 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
507 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
508 |
iIsAutoCompleteOn = iSharedDataInterface->PredictiveTextAutoCompleteOn(); // AutoCompletion disabled by Default |
|
509 |
iTypingCorrectionLevel = iSharedDataInterface->PredictiveTextTypingCorrectionLevel(); |
|
510 |
iIsNumberCandidateShown = iSharedDataInterface->PredictiveTextNumberCandidateShown(); |
|
511 |
TInt primaryCandidateValue = iSharedDataInterface->PredictiveTextPrimaryCandidate(); |
|
512 |
if( primaryCandidateValue == 0) |
|
513 |
iPrimaryCandidate = ETrue; |
|
514 |
else if(primaryCandidateValue == 1) |
|
515 |
iPrimaryCandidate = EFalse; |
|
516 |
#endif // RD_INTELLIGENT_TEXT_INPUT |
|
517 |
iJapanesePredictive = iSharedDataInterface->PredictiveTextJapaneseOn(); |
|
518 |
iQwertyInputMode = iSharedDataInterface->QwertyInputMode(); |
|
519 |
iMultiTapTimer = iSharedDataInterface->MultiTapTimer(); |
|
520 |
iJapaneseQwertyFlags = iSharedDataInterface->JapaneseQwertyFlags(); |
|
521 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
522 |
if(!iFnKeyManager) |
|
523 |
{ |
|
524 |
iFnKeyManager = CAknFepFnKeyManager::NewL( *this,iSharedDataInterface ); |
|
525 |
} |
|
526 |
#endif |
|
527 |
iCaseMan = CAknFepCaseManager::NewL(*this); |
|
528 |
iLangMan = CAknFepLanguageManager::NewL( this, iCaseMan, iSharedDataInterface ); |
|
529 |
iPtiEngine->ActivateLanguageL(inputLanguage); |
|
530 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
531 |
#ifdef FF_DUAL_LANGUAGE_SUPPORT |
|
532 |
iPtiEngine->SetSecondaryInputL(inputLanguageSecondary); |
|
533 |
#endif //FF_DUAL_LANGUAGE_SUPPORT |
|
534 |
#endif |
|
535 |
iLangMan->SetInputLanguageL(inputLanguage); |
|
536 |
SetInputLanguageCapabilities(inputLanguage); |
|
537 |
iCurrentFepUI = iLangMan->GetFepUI(ELatin, iCharWidth, IsPredictive(ELatin)); |
|
538 |
||
539 |
iLastKeyPressedWasHashKey = EFalse; |
|
540 |
iDeviceSupportsRtlLanguage = DeviceSupportsRTLLanguageL(); |
|
541 |
||
542 |
TResourceReader reader; |
|
543 |
// get character from resource to represent an 'enter' character |
|
544 |
coeEnv->CreateResourceReaderLC(reader, R_AVKON_SCT_SPACE_SYMBOL); |
|
545 |
iSpaceCharacterCode = reader.ReadUint16(); |
|
546 |
coeEnv->CreateResourceReaderLC(reader, R_AVKON_SCT_FULLWIDTHSPACE_SYMBOL); |
|
547 |
iFullWidthSpaceCharacterCode = reader.ReadUint16(); |
|
548 |
CleanupStack::PopAndDestroy(2); //reader |
|
549 |
||
550 |
//initialise states |
|
551 |
iMode = EAknEditorNullInputMode; //Force a sync of mode... |
|
552 |
SyncStates(EAknFepStateNull); |
|
553 |
ResetFlags(); |
|
554 |
ResetExtendedFlags(); |
|
555 |
||
556 |
ReadHashKeyLoopL(); |
|
557 |
iHashKeyMan = CAknFepHashKeyManager::NewL(*this, iCaseMan); |
|
558 |
SetHashKeyStyle(); |
|
559 |
iInlineTextDecorator = new (ELeave) CAknFepInlineTextDecorator; |
|
560 |
if (IsFeatureSupportedJapanese()) |
|
561 |
{ |
|
562 |
CAknJapaneseReading::CreateL(iPtiEngine); |
|
563 |
} |
|
564 |
// setting call back |
|
565 |
TCallBack callback(DoSimulateKey, this); |
|
566 |
iAsyncOwnSimulateKey.Set(callback); |
|
567 |
||
568 |
TCallBack resourcechangedcallback(HandleResourceChangedCallback,this); |
|
569 |
iAsyncResouceChanged.Set(resourcechangedcallback); |
|
570 |
#ifdef RD_SCALABLE_UI_V2 |
|
571 |
iFepPluginManager = CAknFepPluginManager::NewL |
|
572 |
( *this, *iSharedDataInterface, *iLangMan, *iCaseMan); |
|
573 |
iNotifyPlugin = ETrue; |
|
574 |
#endif //RD_SCALABLE_UI_V2 |
|
575 |
||
576 |
iFepFullyConstructed = ETrue; |
|
577 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
578 |
iIsFnKeyMapped = IsFnKeyMappedL(); |
|
579 |
iKeyboardType = (TPtiKeyboardType)iSharedDataInterface->KeyboardLayout(); |
|
580 |
#endif |
|
581 |
||
582 |
iFnKeypressMonitor = CPeriodic::NewL(CActive::EPriorityStandard); |
|
583 |
} |
|
584 |
||
585 |
CAknFepManager::~CAknFepManager() |
|
586 |
{ |
|
587 |
#ifdef RD_PF_SEC_APPARC |
|
588 |
delete iNullService; |
|
589 |
#else |
|
590 |
//Embedding - removing created document |
|
591 |
if ( iEmbedded ) |
|
592 |
{ |
|
593 |
CEikonEnv::Static()->Process()->DestroyDocument(iEmbedded); // User dictionary |
|
594 |
iEmbedded = NULL; |
|
595 |
} |
|
596 |
#endif |
|
597 |
if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
598 |
{ |
|
599 |
SetFlag(CAknFepManager::EFlagSupressAutoUpdate); |
|
600 |
TRAPD(err, CommitInlineEditL()) |
|
601 |
if (err) |
|
602 |
{ |
|
603 |
CleanUpFep(); |
|
604 |
} |
|
605 |
} |
|
606 |
||
607 |
if ( EditorState() ) |
|
608 |
{ |
|
609 |
EditorState()->SetObserver(NULL); |
|
610 |
} |
|
611 |
if (iLastFocusedEditor) |
|
612 |
{ |
|
613 |
iLastFocusedEditor->SetObserver(NULL); |
|
614 |
iLastFocusedEditor = NULL; |
|
615 |
} |
|
616 |
if (iFepAwareDialogParentEditor) |
|
617 |
{ |
|
618 |
iFepAwareDialogParentEditor->SetObserver(NULL); |
|
619 |
iFepAwareDialogParentEditor = NULL; |
|
620 |
} |
|
621 |
||
622 |
delete iSharedDataInterface; |
|
623 |
MAknEditingStateIndicator* indicator = CAknEnv::Static()->EditingStateIndicator(); |
|
624 |
if (indicator == iIndicator) |
|
625 |
{ |
|
626 |
CAknEnv::Static()->SwapEditingStateIndicator(NULL); |
|
627 |
} |
|
628 |
||
629 |
||
630 |
delete iIndicator; |
|
631 |
iIndicator = NULL; |
|
632 |
CCoeEnv::Static()->DeleteResourceFile(iResId); |
|
633 |
||
634 |
// Everything that is constructed in ConstructFullyL() method |
|
635 |
// needs to be deleted in CommonDestroyFep() method. |
|
636 |
CommonDestroyFep(); |
|
637 |
||
638 |
if (iUiInterface) |
|
639 |
iUiInterface->SetFepMenuObserver(NULL); |
|
640 |
||
641 |
delete iPtiEngine; |
|
642 |
delete iSctEditChars; |
|
643 |
||
644 |
#ifdef RD_SCALABLE_UI_V2 |
|
645 |
if ( FepAwareTextEditor() ) |
|
646 |
{ |
|
647 |
UnregisterObserver(); |
|
648 |
} |
|
649 |
delete iFepPluginManager; |
|
650 |
delete iStylusCcpuMenu; |
|
651 |
||
652 |
delete iSpellInitText; |
|
653 |
#endif // RD_SCALABLE_UI_V2 |
|
654 |
delete iUiInterface; |
|
655 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
656 |
// Predictive QWERTY (XT9) changes ----> |
|
657 |
delete iExactWordPopupContent; |
|
658 |
iExactWordPopupContent = 0; |
|
659 |
delete iCandidatePopup; |
|
660 |
iCandidatePopup = 0; |
|
661 |
delete iResourceString; |
|
662 |
iResourceString = 0; |
|
663 |
// Predictive QWERTY (XT9) changes <---- |
|
664 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
665 |
// the follow objects for phrase creation |
|
666 |
delete iZhuyinKeyHandler; |
|
667 |
delete iZhuyinAnalyser; |
|
668 |
delete iAknFepThaiSCTSelector; |
|
669 |
} |
|
670 |
||
671 |
void CAknFepManager::CommonDestroyFep() |
|
672 |
{ |
|
673 |
iFepFullyConstructed = EFalse; |
|
674 |
||
675 |
// This method is called both from destructor and CleanUpFep methods. |
|
676 |
iAsyncOwnSimulateKey.Cancel(); |
|
677 |
iAsyncResouceChanged.Cancel(); |
|
678 |
delete iShiftKeypressMonitor; |
|
679 |
iShiftKeypressMonitor = NULL; |
|
680 |
delete iConcatenationTimer; |
|
681 |
iConcatenationTimer = NULL; |
|
682 |
delete iChrKeypressMonitor; |
|
683 |
iChrKeypressMonitor = NULL; |
|
684 |
delete iLangMan; |
|
685 |
iLangMan = NULL; |
|
686 |
iCurrentFepUI = NULL; |
|
687 |
delete iKeyCatcher; |
|
688 |
iKeyCatcher = NULL; |
|
689 |
||
690 |
delete iPostEventCheck; |
|
691 |
iPostEventCheck = NULL; |
|
692 |
delete iHashKeyMan; |
|
693 |
iHashKeyMan = NULL; |
|
694 |
delete iCaseMan; |
|
695 |
iCaseMan = NULL; |
|
696 |
delete iInlineTextDecorator; |
|
697 |
iInlineTextDecorator = NULL; |
|
698 |
iHashKeyLoop.Close(); |
|
699 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
700 |
if(iFnKeyManager) |
|
701 |
{ |
|
702 |
delete iFnKeyManager; |
|
703 |
iFnKeyManager = NULL; |
|
704 |
} |
|
705 |
if( iNumericResourceTimer ) |
|
706 |
{ |
|
707 |
delete iNumericResourceTimer; |
|
708 |
iNumericResourceTimer = NULL; |
|
709 |
} |
|
710 |
#endif |
|
711 |
delete iFnKeypressMonitor; |
|
712 |
iFnKeypressMonitor = NULL; |
|
713 |
} |
|
714 |
||
715 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
716 |
void CAknFepManager::SetKeyboardLayout(TPtiKeyboardType aType) |
|
717 |
{ |
|
718 |
||
719 |
if(iQwertyInputMode && iFnKeyManager |
|
720 |
&& (iFnKeyManager->FnKeyState()== CAknFepFnKeyManager::EFnKeyLock |
|
721 |
||iFnKeyManager->FnKeyState()== CAknFepFnKeyManager::EFnKeyNext)) |
|
722 |
{ |
|
723 |
iMode = ENumber; |
|
724 |
} |
|
725 |
||
726 |
if(iFnKeyManager) |
|
727 |
{ |
|
728 |
iFnKeyManager->ClearFnKeyState(); |
|
729 |
} |
|
730 |
||
731 |
if(iPtiEngine) |
|
732 |
{ |
|
733 |
iPtiEngine->SetKeyboardType(aType); |
|
734 |
} |
|
735 |
iKeyboardType = aType; |
|
736 |
} |
|
737 |
||
738 |
TPtiKeyboardType CAknFepManager::KeyboardLayout() const |
|
739 |
{ |
|
740 |
return iKeyboardType; |
|
741 |
} |
|
742 |
#endif |
|
743 |
TBool CAknFepManager::TryCloseUiL() |
|
744 |
{ |
|
745 |
#ifdef RD_HINDI_PHONETIC_INPUT |
|
746 |
if ((iSharedDataInterface->InputTextLanguage() == KLangHindiPhonetic) && |
|
747 |
IsFlagSet(CAknFepManager::EFlagNoMatches)) |
|
748 |
{ |
|
749 |
ClearFlag(CAknFepManager::EFlagNoMatches); |
|
750 |
if (PreviousChar() == KQuestionMark) |
|
751 |
RemovePreviousCharacterL(); |
|
752 |
} |
|
753 |
#endif |
|
754 |
if (iFepManState == EAknFepStateUIActive) |
|
755 |
{ |
|
756 |
// In Japanese input, |
|
757 |
// commit inline editing at only the western predictive mode. |
|
758 |
if (!IsFeatureSupportedJapanese() || WesternPredictive()) |
|
759 |
{ |
|
760 |
if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
761 |
{ |
|
762 |
TryRemoveNoMatchesIndicatorL(); |
|
763 |
UpdateCbaL(NULL); |
|
764 |
} |
|
765 |
||
766 |
||
767 |
||
768 |
//#ifdef __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__ |
|
769 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
770 |
if ( iFepPluginManager && |
|
771 |
(iFepPluginManager->PluginInputMode() == EPluginInputModeNone)) |
|
772 |
{ |
|
773 |
RemoveSuggestedAdvanceCompletionL(); |
|
774 |
} |
|
775 |
#endif // RD_INTELLIGENT_TEXT_INPUT |
|
776 |
//#endif // __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__ |
|
777 |
||
778 |
#ifdef RD_SCALABLE_UI_V2 |
|
779 |
||
780 |
if ( iFepPluginManager != NULL && |
|
781 |
iFepPluginManager->BeforeSpell() ) |
|
782 |
{ |
|
783 |
iFepPluginManager->SetBeforeSpell(EFalse); |
|
784 |
} |
|
785 |
else |
|
786 |
#endif |
|
787 |
||
788 |
{ |
|
789 |
CommitInlineEditL(); |
|
790 |
} |
|
791 |
} |
|
792 |
if (IsCcpuFlagSet(ECcpuStataCommitPredictiveWord)) |
|
793 |
{ |
|
794 |
// Word commiting must be done after CommitInlineEditL call (because |
|
795 |
// of Japanese ReadingTextL funtionality), hence the delayed commit here. |
|
796 |
iPtiEngine->CommitCurrentWord(); |
|
797 |
ClearCcpuFlag(ECcpuStataCommitPredictiveWord); |
|
798 |
} |
|
799 |
InternalFepUI()->CloseUI(); |
|
800 |
SyncStates(EAknFepStateInitial); |
|
801 |
if (iMode == EPinyin || iMode == EZhuyin || iMode == EStroke || iMode == ECangJie) |
|
802 |
{ |
|
803 |
SetCursorType(EActive); |
|
804 |
if ( EditorState() ) |
|
805 |
{ |
|
806 |
EditorState()->SetFlags( EditorState()->Flags() & ~EAknEditorFlagChinesePopup ); |
|
807 |
} |
|
808 |
} |
|
809 |
||
810 |
// EFalse in case of latin input in Japanese variant |
|
811 |
if (IsFeatureSupportedJapanese() |
|
812 |
&& iMode == ELatin && !WesternPredictive()) |
|
813 |
{ |
|
814 |
return EFalse; |
|
815 |
} |
|
816 |
||
817 |
return ETrue; |
|
818 |
} |
|
819 |
else |
|
820 |
{ |
|
821 |
if (IsKoreanInputLanguage()) |
|
822 |
{ |
|
823 |
if (IsFlagSet(CAknFepManager::EFlagInsideInlineEditingTransaction)) |
|
824 |
{ |
|
825 |
CommitInlineEditL(); |
|
826 |
PtiEngine()->ClearCurrentWord(); |
|
827 |
} |
|
828 |
} |
|
829 |
||
830 |
//in initial state characters should either: |
|
831 |
//1. not be consumed by the FEP. |
|
832 |
//2. be committed immediately by the Input State. |
|
833 |
//3. be multitap chars, in which case they may need to be committed |
|
834 |
// here. It is best to let the engine deal with this. |
|
835 |
if ( IsFlagSet( EFlagInsideInlineEditingTransaction ) ) |
|
836 |
{ |
|
837 |
InternalFepUI()->ExpireMultitapTimer(); |
|
838 |
} |
|
839 |
return EFalse; |
|
840 |
} |
|
841 |
} |
|
842 |
||
843 |
void CAknFepManager::SendUIActivatedNotification() |
|
844 |
{ |
|
845 |
SyncStates(EAknFepStateUIActive); |
|
846 |
} |
|
847 |
||
848 |
void CAknFepManager::SendUIDeActivatedNotification() |
|
849 |
{ |
|
850 |
SyncStates(EAknFepStateInitial); |
|
851 |
} |
|
852 |
||
853 |
void CAknFepManager::PlaySound(TAvkonSystemSID aSound) const |
|
854 |
{ |
|
855 |
if (SoundSystem()) |
|
856 |
{ |
|
857 |
SoundSystem()->PlaySound(aSound); |
|
858 |
} |
|
859 |
} |
|
860 |
||
861 |
void CAknFepManager::SetLongClearAfterCloseUI(TBool aLongClear) |
|
862 |
{ |
|
863 |
iLongClearAfterCloseUI = aLongClear; |
|
864 |
} |
|
865 |
||
866 |
TKeyResponse CAknFepManager::HandleKeyEventL(TUint aCode, TKeyPressLength aLength,TEventCode aEventCode) |
|
867 |
{ |
|
868 |
TKeyResponse response = EKeyWasNotConsumed; |
|
869 |
||
870 |
TInt documentLength = -1; |
|
871 |
if (iInputCapabilities.FepAwareTextEditor()) |
|
872 |
{ |
|
873 |
documentLength = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
874 |
} |
|
875 |
||
876 |
if (iFepFullyConstructed && iConcatenationTimer->IsActive()) |
|
877 |
{ |
|
878 |
if (!( aCode == EKeyRightArrow || |
|
879 |
aCode == EKeyLeftArrow || |
|
880 |
aCode == EKeyUpArrow || |
|
881 |
aCode == EKeyDownArrow )) |
|
882 |
{ |
|
883 |
iConcatenationTimer->Cancel(); |
|
884 |
} |
|
885 |
} |
|
886 |
||
887 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
888 |
||
889 |
if(iKeyBackSpaceHit && aCode != EKeyBackspace) |
|
890 |
iKeyBackSpaceHit = 0; |
|
891 |
||
892 |
if (aCode != EPtiKeyStar && iNumericResourceTimer) |
|
893 |
{ |
|
894 |
// return with EKeyWasConsumed if any of the arrow keys are pressed with |
|
895 |
// iNumericResourceTimer is active |
|
896 |
if(NumericResourceMultiTapTimerTimeoutL()&& |
|
897 |
(aCode == EKeyRightArrow || aCode == EKeyLeftArrow || aCode == EKeyUpArrow || aCode ==EKeyDownArrow)) |
|
898 |
return EKeyWasConsumed; |
|
899 |
} |
|
900 |
#endif |
|
901 |
||
902 |
||
903 |
||
904 |
// This method is implemented independent of all modes, so it can be called by anyone, anywhere |
|
905 |
if ( BidiCursorRequired() ) |
|
906 |
{ |
|
907 |
response = AttemptCursorFlipAtAmbiguousPointL( aCode ); |
|
908 |
if ( response == EKeyWasConsumed ) |
|
909 |
{ |
|
910 |
return response; |
|
911 |
} |
|
912 |
} |
|
913 |
||
914 |
if ( aCode != EPtiKeyHash |
|
915 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
916 |
#ifdef __HALF_QWERTY_KEYPAD |
|
917 |
#ifdef __SHIFT_KEY_LOOP |
|
918 |
&& ( aCode != EPtiKeyQwertyLeftShift |
|
919 |
|| EPtiKeyboardHalfQwerty != KeyboardLayout() ) |
|
920 |
#endif //__SHIFT_KEY_LOOP |
|
921 |
#endif //__HALF_QWERTY_KEYPAD |
|
922 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
923 |
) |
|
924 |
||
925 |
{ |
|
926 |
||
927 |
SetLastPressedHashKeyStatus(EFalse); |
|
928 |
||
929 |
if(iHashKeyMan) |
|
930 |
{ |
|
931 |
iHashKeyMan->CancelHashKeyTimer(); |
|
932 |
if (aCode != EKeyOK) |
|
933 |
{ |
|
934 |
iHashKeyMan->ClearSelectionModeHashKeyLoop(); |
|
935 |
} |
|
936 |
} |
|
937 |
} |
|
938 |
// Always commit the text before handling arrow keys |
|
939 |
if (iMode == EHangul && IsFlagSet(CAknFepManager::EFlagInsideInlineEditingTransaction)) |
|
940 |
{ |
|
941 |
if ( aCode == EKeyRightArrow || |
|
942 |
aCode == EKeyLeftArrow || |
|
943 |
aCode == EKeyUpArrow || |
|
944 |
aCode == EKeyDownArrow ) |
|
945 |
{ |
|
946 |
CommitInlineEditL(); |
|
947 |
iPtiEngine->ClearCurrentWord(); |
|
948 |
} |
|
949 |
} |
|
950 |
TBool isPassNext = IsFlagSet(EFlagPassNextKey); |
|
951 |
||
952 |
switch (aCode) |
|
953 |
{ |
|
954 |
case EKeyEscape: |
|
955 |
||
956 |
#ifdef RD_SCALABLE_UI_V2 |
|
957 |
if( iFepFullyConstructed && iFepPluginManager) |
|
958 |
{ |
|
959 |
iFepPluginManager->ResetMenuState(EFalse); |
|
960 |
} |
|
961 |
#endif |
|
962 |
if (TryCloseUiL()) |
|
963 |
{ |
|
964 |
response = EKeyWasConsumed; |
|
965 |
// phrase creation |
|
966 |
PhraseCreation(EFalse); |
|
967 |
// phrase creation |
|
968 |
PinyinPhraseCreation(EFalse); |
|
969 |
} |
|
970 |
break; |
|
971 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
972 |
#ifdef __HALF_QWERTY_KEYPAD |
|
973 |
#ifdef __SHIFT_KEY_LOOP |
|
974 |
case EPtiKeyQwertyLeftShift: |
|
975 |
if( EPtiKeyboardHalfQwerty == KeyboardLayout() ) |
|
976 |
{ |
|
977 |
response = HandleHashKeyL(aLength); |
|
978 |
(aLength == ELongKeyPress)? SetLastPressedHashKeyStatus(EFalse):SetLastPressedHashKeyStatus(ETrue); |
|
979 |
} |
|
980 |
break; |
|
981 |
#endif //__SHIFT_KEY_LOOP |
|
982 |
#endif //__HALF_QWERTY_KEYPAD |
|
983 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
984 |
case EPtiKeyHash: |
|
985 |
if(InputMode() == EHangul) |
|
986 |
{ |
|
987 |
if (aLength == EShortKeyPress) |
|
988 |
{ |
|
989 |
FepUI()->HandleKeyL(aCode, aLength); |
|
990 |
response = EKeyWasConsumed; |
|
991 |
} |
|
992 |
else |
|
993 |
{ |
|
994 |
//PhraseCreation(EFalse); |
|
995 |
response = HandleHashKeyL(aLength); |
|
996 |
(aLength == ELongKeyPress)? SetLastPressedHashKeyStatus(EFalse): |
|
997 |
SetLastPressedHashKeyStatus(ETrue); |
|
998 |
} |
|
999 |
} |
|
1000 |
else if (InputMode()!= EZhuyin) |
|
1001 |
{ |
|
1002 |
if (IsPinyinPhraseCreation() ) |
|
1003 |
{ |
|
1004 |
ClearCcpuFlag( ECcpuStateHashDown ); |
|
1005 |
response = EKeyWasConsumed; |
|
1006 |
} |
|
1007 |
else |
|
1008 |
{ |
|
1009 |
response = HandleHashKeyL(aLength); |
|
1010 |
(aLength == ELongKeyPress) |
|
1011 |
? SetLastPressedHashKeyStatus(EFalse) |
|
1012 |
: SetLastPressedHashKeyStatus(ETrue); |
|
1013 |
} |
|
1014 |
} |
|
1015 |
else |
|
1016 |
{ |
|
1017 |
PhraseCreation(EFalse); |
|
1018 |
response = HandleHashKeyL(aLength); |
|
1019 |
(aLength == ELongKeyPress) |
|
1020 |
? SetLastPressedHashKeyStatus(EFalse) |
|
1021 |
: SetLastPressedHashKeyStatus(ETrue); |
|
1022 |
} |
|
1023 |
break; |
|
1024 |
case EKeyCBA1: |
|
1025 |
if(Japanese()) |
|
1026 |
{ |
|
1027 |
if (FepUI()->HandleKeyL(aCode, aLength)) |
|
1028 |
{ |
|
1029 |
response = EKeyWasConsumed; |
|
1030 |
} |
|
1031 |
break; |
|
1032 |
} |
|
1033 |
// phrase creation the key CBA2 need to solve. |
|
1034 |
if ( IsEntryPhrase() ) |
|
1035 |
{ |
|
1036 |
if ( FepUI()->HandleKeyL( aCode, aLength ) ) |
|
1037 |
{ |
|
1038 |
response = EKeyWasConsumed; |
|
1039 |
break; |
|
1040 |
} |
|
1041 |
} |
|
1042 |
||
1043 |
if (!WesternPredictive()) |
|
1044 |
{ |
|
1045 |
if (TryCloseUiL()) |
|
1046 |
{ |
|
1047 |
response = EKeyWasConsumed; |
|
1048 |
} |
|
1049 |
} |
|
1050 |
break; |
|
1051 |
case EKeyCBA2: |
|
1052 |
if(Japanese()) |
|
1053 |
{ |
|
1054 |
if (FepUI()->HandleKeyL(aCode, aLength)) |
|
1055 |
{ |
|
1056 |
response = EKeyWasConsumed; |
|
1057 |
} |
|
1058 |
break; |
|
1059 |
} |
|
1060 |
if (!WesternPredictive()) |
|
1061 |
{ |
|
1062 |
if (TryCloseUiL()) |
|
1063 |
{ |
|
1064 |
// phrase creation the key CBA2 need to solve. |
|
1065 |
PhraseCreation( EFalse ); |
|
1066 |
response = EKeyWasConsumed; |
|
1067 |
} |
|
1068 |
} |
|
1069 |
else |
|
1070 |
{ |
|
1071 |
if ( IsFlagSet( EFlagInsideInlineEditingTransaction ) ) |
|
1072 |
{ |
|
1073 |
InternalFepUI()->ExpireMultitapTimer(); |
|
1074 |
} |
|
1075 |
} |
|
1076 |
// phrase creation the key CBA2 need to solve. |
|
1077 |
EntryPhrase( EFalse ); |
|
1078 |
break; |
|
1079 |
case EPtiKeyStar: |
|
1080 |
if (IsFlagSet(EFlagPassNextKey)) |
|
1081 |
{ |
|
1082 |
ClearFlag(EFlagPassNextKey); |
|
1083 |
} |
|
1084 |
else if ( !IsFepAwareTextEditor() ) |
|
1085 |
{ |
|
1086 |
// The editor is MFNE or other non FEP aware text editor. |
|
1087 |
// Pass the key to the editor to handle. |
|
1088 |
response = EKeyWasNotConsumed; |
|
1089 |
} |
|
1090 |
else if (IsFlagSet(EFlagShiftKeyDepressed)) |
|
1091 |
{ |
|
1092 |
response = EKeyWasConsumed; |
|
1093 |
} |
|
1094 |
else |
|
1095 |
{ |
|
1096 |
#ifdef RD_SCALABLE_UI_V2 |
|
1097 |
iStarKeyPressed = ETrue; |
|
1098 |
#endif // RD_SCALABLE_UI_V2 |
|
1099 |
if (FepUI()->HandleKeyL(aCode, aLength, aEventCode)) |
|
1100 |
{ |
|
1101 |
response = EKeyWasConsumed; |
|
1102 |
} |
|
1103 |
#ifdef RD_SCALABLE_UI_V2 |
|
1104 |
iStarKeyPressed = EFalse; |
|
1105 |
#endif // RD_SCALABLE_UI_V2 |
|
1106 |
} |
|
1107 |
break; |
|
1108 |
case EKeyRightArrow: |
|
1109 |
if (TryHandleArrowRightEventL(documentLength)) |
|
1110 |
{ |
|
1111 |
response = EKeyWasConsumed; |
|
1112 |
break; |
|
1113 |
} |
|
1114 |
// fall through |
|
1115 |
case EKeyLeftArrow: |
|
1116 |
if (aCode == EKeyLeftArrow && TryHandleArrowLeftEventL(documentLength)) |
|
1117 |
{ |
|
1118 |
response = EKeyWasConsumed; |
|
1119 |
break; |
|
1120 |
} |
|
1121 |
||
1122 |
if (IsCcpuFlagSet(ECcpuStateCopy | ECcpuStateCut)) |
|
1123 |
{ |
|
1124 |
response = EKeyWasNotConsumed; |
|
1125 |
break; |
|
1126 |
} |
|
1127 |
else if (IsCcpuFlagSet(ECcpuStateStartCopy | ECcpuStateStartCut)) |
|
1128 |
{ |
|
1129 |
TryHandleCommonArrowAndBackspaceFunctionalityL(aCode, response); |
|
1130 |
break; |
|
1131 |
} |
|
1132 |
||
1133 |
if (iLanguageCapabilities.iInputLanguageCode == ELangJapanese && iMode != ELatin) |
|
1134 |
{ |
|
1135 |
if(FepUI()->HandleKeyL(aCode, aLength)) |
|
1136 |
{ |
|
1137 |
response = EKeyWasConsumed; |
|
1138 |
} |
|
1139 |
} |
|
1140 |
else |
|
1141 |
{ |
|
1142 |
if (WesternPredictive()) |
|
1143 |
{ |
|
1144 |
response = HandleWesternPredictiveArrowKeyL(aCode, aLength); |
|
1145 |
} |
|
1146 |
else |
|
1147 |
{ |
|
1148 |
if (iFepManState == EAknFepStateUIActive) |
|
1149 |
{ |
|
1150 |
FepUI()->HandleKeyL(aCode, aLength); |
|
1151 |
response = EKeyWasConsumed; |
|
1152 |
} |
|
1153 |
else |
|
1154 |
{ |
|
1155 |
/* |
|
1156 |
TCursorSelection currentEditorSelection(0,0); |
|
1157 |
if(iInputCapabilities.FepAwareTextEditor()) |
|
1158 |
{ |
|
1159 |
iInputCapabilities.FepAwareTextEditor()-> |
|
1160 |
GetCursorSelectionForFep(currentEditorSelection); |
|
1161 |
} |
|
1162 |
||
1163 |
if(!IsMfneEditor() && |
|
1164 |
(PluginInputMode() == EPluginInputModeItut || |
|
1165 |
PluginInputMode() == EPluginInputModeFSQ) && |
|
1166 |
currentEditorSelection.Length() != 0) |
|
1167 |
{ |
|
1168 |
response = EKeyWasConsumed; |
|
1169 |
break; |
|
1170 |
} |
|
1171 |
*/ |
|
1172 |
||
1173 |
response = HandleNaviEventOutsideInlineEditL(aCode, aLength); |
|
1174 |
if (response == EKeyWasConsumed) |
|
1175 |
{ |
|
1176 |
iCaseMan->UpdateCase(ENullNaviEvent); |
|
1177 |
} |
|
1178 |
else if (aCode == EKeyLeftArrow && !IsFlagSet(EFlagShiftKeyDepressed)) |
|
1179 |
{ |
|
1180 |
iCaseMan->UpdateCase(ELeftNaviEvent); |
|
1181 |
} |
|
1182 |
else if (!IsFlagSet(EFlagShiftKeyDepressed)) |
|
1183 |
{ |
|
1184 |
iCaseMan->UpdateCase(ERightNaviEvent); |
|
1185 |
} |
|
1186 |
} |
|
1187 |
} |
|
1188 |
} |
|
1189 |
break; |
|
1190 |
case EKeyDownArrow: |
|
1191 |
if( iWesternPredictive && IsFlagSet(EFlagInsideInlineEditingTransaction) && |
|
1192 |
( EPtiKeyboard12Key == KeyboardLayout() ) && ( IsFlagSet(EFlagShiftKeyDepressed) || |
|
1193 |
HashKeySelectionInUse()&& IsCcpuFlagSet(ECcpuStateHashDown) ) ) |
|
1194 |
{ |
|
1195 |
iPtiEngine->CommitCurrentWord(); |
|
1196 |
CommitInlineEditL(); |
|
1197 |
response = EKeyWasConsumed; |
|
1198 |
break; |
|
1199 |
} |
|
1200 |
||
1201 |
if (TryHandleArrowDownEventL(documentLength) || IsFlagSet(EFlagNoMatches)) |
|
1202 |
{ |
|
1203 |
response = EKeyWasConsumed; |
|
1204 |
break; |
|
1205 |
} |
|
1206 |
||
1207 |
case EKeyUpArrow: |
|
1208 |
if (iLanguageCapabilities.iInputLanguageCode == ELangJapanese && iMode != ELatin) |
|
1209 |
{ |
|
1210 |
if ( (iAknEditorFlags & EAknEditorFlagNoLRNavigation) && |
|
1211 |
IsFlagSet(EFlagShiftKeyDepressed) ) |
|
1212 |
{ |
|
1213 |
// Up or down key is pressed during shift key press. |
|
1214 |
ClearFlag(EFlagNoActionDuringShiftKeyPress); |
|
1215 |
return EKeyWasNotConsumed; |
|
1216 |
} |
|
1217 |
||
1218 |
if(FepUI()->HandleKeyL(aCode, aLength)) |
|
1219 |
{ |
|
1220 |
response = EKeyWasConsumed; |
|
1221 |
} |
|
1222 |
else |
|
1223 |
{ |
|
1224 |
TryHandleCommonArrowAndBackspaceFunctionalityL(aCode, response); |
|
1225 |
} |
|
1226 |
} |
|
1227 |
else |
|
1228 |
{ |
|
1229 |
if (iLanguageCapabilities.iInputLanguageCode == ELangThai && |
|
1230 |
iFepManState == EAknFepStateUIActive && |
|
1231 |
WesternPredictive() ) |
|
1232 |
{ |
|
1233 |
if (FepUI()->HandleKeyL(aCode, aLength)) |
|
1234 |
{ |
|
1235 |
ClearFlag(EFlagChangeInputMode); |
|
1236 |
response = EKeyWasConsumed; |
|
1237 |
} |
|
1238 |
break; |
|
1239 |
} |
|
1240 |
else if ( (iAknEditorFlags & EAknEditorFlagNoLRNavigation) && |
|
1241 |
IsFlagSet(EFlagShiftKeyDepressed) ) |
|
1242 |
{ |
|
1243 |
// Up or down key is pressed during shift key press. |
|
1244 |
ClearFlag(EFlagNoActionDuringShiftKeyPress); |
|
1245 |
return EKeyWasNotConsumed; |
|
1246 |
} |
|
1247 |
if (WesternPredictive()) |
|
1248 |
{ |
|
1249 |
// For customizabal of Down/Up scroll keypress action. |
|
1250 |
// If it need to custom it, the function of HandleKeyL returns EFalse. |
|
1251 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
1252 |
// Predictive QWERTY (XT9) changes ----> |
|
1253 |
if ( IsFlagSet(CAknFepManager::EFlagInsideInlineEditingTransaction) ) |
|
1254 |
{ |
|
1255 |
TInt wordIndexToSelect = 0; |
|
1256 |
||
1257 |
if(iQwertyInputMode && EPtiKeyboardHalfQwerty != KeyboardLayout()) |
|
1258 |
{ |
|
1259 |
if(!iPrimaryCandidate) |
|
1260 |
iPtiEngine->HandleCommandL( EPtiCommandUserActionGetIndexOfSecondaryCandidate, |
|
1261 |
&wordIndexToSelect ); |
|
1262 |
||
1263 |
if( iQwertyInputMode |
|
1264 |
&& IsExactWordPopUpShown() |
|
1265 |
&& aCode == EKeyUpArrow ) |
|
1266 |
{ |
|
1267 |
iExactWordPopupContent->HidePopUp(); |
|
1268 |
||
1269 |
// When press up, if FSQ is opened, |
|
1270 |
// also need to check and close tooltip on it. |
|
1271 |
SendEventsToPluginManL( EPluginHideTooltip ); |
|
1272 |
||
1273 |
iPtiEngine->HandleCommandL( |
|
1274 |
EPtiCommandUserActionSetCurrentIndexOfCandidates, |
|
1275 |
&wordIndexToSelect ); |
|
1276 |
iPtiEngine->HandleCommandL( EPtiCommandLockCurrentCandidate ); |
|
1277 |
/* Update the Candidate List in case of Exact Typing as best predicted word is |
|
1278 |
selected from the tooltip to the editor */ |
|
1279 |
if(!iPrimaryCandidate) |
|
1280 |
iPtiEngine->HandleCommandL(EPtiCommandSetFlagToUpdateCandidates); |
|
1281 |
||
1282 |
TPtrC selectedWord = iPtiEngine->CurrentWord(); |
|
1283 |
UpdateInlineEditL( selectedWord, selectedWord.Length() ); |
|
1284 |
response = EKeyWasConsumed; |
|
1285 |
||
1286 |
} |
|
1287 |
else |
|
1288 |
{ |
|
1289 |
LaunchCandidatePopupListL( wordIndexToSelect ); |
|
1290 |
response = EKeyWasConsumed; |
|
1291 |
} |
|
1292 |
} |
|
1293 |
else |
|
1294 |
{ |
|
1295 |
if (!IsFlagSet(EFlagInsideMultitapInlineEditingTransaction)) |
|
1296 |
{ |
|
1297 |
TInt lastCandidateIndex = iPtiEngine->NumberOfCandidates() -1; |
|
1298 |
if( EPtiKeyboard12Key == KeyboardLayout() && ( IsFlagSet(EFlagShiftKeyDepressed) || |
|
1299 |
HashKeySelectionInUse()&& IsCcpuFlagSet(ECcpuStateHashDown) ) ) |
|
1300 |
{ |
|
1301 |
if (response != EKeyWasConsumed) |
|
1302 |
{ |
|
1303 |
response = HandleWesternPredictiveArrowKeyL(aCode, aLength); |
|
1304 |
} |
|
1305 |
} |
|
1306 |
else if(aCode == EKeyUpArrow && lastCandidateIndex >= 0) |
|
1307 |
{ |
|
1308 |
// Get last word on list |
|
1309 |
LaunchCandidatePopupListL( lastCandidateIndex ); |
|
1310 |
response = EKeyWasConsumed; |
|
1311 |
} |
|
1312 |
else |
|
1313 |
{ |
|
1314 |
// Get next word on list (wrap around if at end) |
|
1315 |
iPtiEngine->HandleCommandL( EPtiCommandUserActionGetCurrentIndexOfCandidates, |
|
1316 |
&wordIndexToSelect ); |
|
1317 |
wordIndexToSelect < lastCandidateIndex ? wordIndexToSelect++ : wordIndexToSelect = 0; |
|
1318 |
LaunchCandidatePopupListL( wordIndexToSelect ); |
|
1319 |
response = EKeyWasConsumed; |
|
1320 |
} |
|
1321 |
} |
|
1322 |
else |
|
1323 |
response = EKeyWasConsumed; |
|
1324 |
} |
|
1325 |
} |
|
1326 |
else |
|
1327 |
{ |
|
1328 |
// Predictive QWERTY (XT9) changes <---- |
|
1329 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
1330 |
if(iFepManState == EAknFepStateUIActive && |
|
1331 |
FepUI()->HandleKeyL(aCode, aLength)) |
|
1332 |
{ |
|
1333 |
response = EKeyWasConsumed; |
|
1334 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
1335 |
||
1336 |
// When press up, if FSQ is opened, |
|
1337 |
// also need to check and close tooltip on it. |
|
1338 |
SendEventsToPluginManL( EPluginHideTooltip ); |
|
1339 |
||
1340 |
// Predictive QWERTY (XT9) changes ----> |
|
1341 |
// Exact word popup is hidden when the exact word is selected |
|
1342 |
iExactWordPopupContent->HidePopUp(); |
|
1343 |
// Predictive QWERTY (XT9) changes <---- |
|
1344 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
1345 |
} |
|
1346 |
// normal operation of Down/Up scroll keypress action. |
|
1347 |
if (response != EKeyWasConsumed) |
|
1348 |
{ |
|
1349 |
response = HandleWesternPredictiveArrowKeyL(aCode, aLength); |
|
1350 |
} |
|
1351 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
1352 |
} // Predictive QWERTY (XT9) changes |
|
1353 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
1354 |
} |
|
1355 |
else |
|
1356 |
{ |
|
1357 |
if (iFepManState == EAknFepStateUIActive) |
|
1358 |
{ |
|
1359 |
FepUI()->HandleKeyL(aCode, aLength); |
|
1360 |
response = EKeyWasConsumed; |
|
1361 |
} |
|
1362 |
else |
|
1363 |
{ |
|
1364 |
TryHandleCommonArrowAndBackspaceFunctionalityL(aCode, response); |
|
1365 |
} |
|
1366 |
} |
|
1367 |
} |
|
1368 |
break; |
|
1369 |
case EKeyBackspace: |
|
1370 |
if (iLanguageCapabilities.iInputLanguageCode == ELangJapanese && |
|
1371 |
!(iMode == ELatin || iMode == ENumber)) |
|
1372 |
{ |
|
1373 |
if (FepUI()->HandleKeyL(aCode, aLength)) |
|
1374 |
{ |
|
1375 |
response = EKeyWasConsumed; |
|
1376 |
} |
|
1377 |
} |
|
1378 |
else if (iLanguageCapabilities.iInputLanguageCode == ELangVietnamese) |
|
1379 |
{ |
|
1380 |
TCursorSelection cursorSelection; |
|
1381 |
if ( !IsFepAwareTextEditor() ) |
|
1382 |
{ |
|
1383 |
response = EKeyWasNotConsumed; |
|
1384 |
} |
|
1385 |
else |
|
1386 |
{ |
|
1387 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(cursorSelection); |
|
1388 |
if (cursorSelection.Length() != 0) |
|
1389 |
{ |
|
1390 |
response = EKeyWasNotConsumed; |
|
1391 |
} |
|
1392 |
#ifdef RD_SCALABLE_UI_V2 |
|
1393 |
else if ( !documentLength |
|
1394 |
&& ( iFepPluginManager->PluginInputMode() == EPluginInputModeItut |
|
1395 |
|| iFepPluginManager->PluginInputMode() == EPluginInputModeVkb ) ) |
|
1396 |
{ |
|
1397 |
response = EKeyWasConsumed; |
|
1398 |
} |
|
1399 |
#endif |
|
1400 |
else |
|
1401 |
{ |
|
1402 |
if (FepUI()->HandleKeyL(aCode, aLength)) |
|
1403 |
{ |
|
1404 |
response = EKeyWasConsumed; |
|
1405 |
} |
|
1406 |
else |
|
1407 |
{ |
|
1408 |
if( WesternPredictive() ) |
|
1409 |
{ |
|
1410 |
// We need to start the autoconcatination timer |
|
1411 |
SimulateKeyEventL(EKeyF24); |
|
1412 |
} |
|
1413 |
} |
|
1414 |
} |
|
1415 |
} |
|
1416 |
||
1417 |
} |
|
1418 |
else if (IsKoreanInputLanguage() && iMode == EHangul) |
|
1419 |
{ |
|
1420 |
if (FepUI()->HandleKeyL(aCode, aLength)) |
|
1421 |
{ |
|
1422 |
response = EKeyWasConsumed; |
|
1423 |
} |
|
1424 |
} |
|
1425 |
else |
|
1426 |
{ |
|
1427 |
if (iFepManState == EAknFepStateInitial) |
|
1428 |
{ |
|
1429 |
#ifdef RD_SCALABLE_UI_V2 |
|
1430 |
if ( iFepPluginManager->PluginInputMode() == EPluginInputModeItut ) |
|
1431 |
{ |
|
1432 |
if ( iFepPluginManager->CurrentFepInputUI() && |
|
1433 |
FepUI()->HandleKeyL(aCode, aLength)) |
|
1434 |
{ |
|
1435 |
response = EKeyWasConsumed; |
|
1436 |
break; |
|
1437 |
} |
|
1438 |
} |
|
1439 |
if ( !documentLength |
|
1440 |
&& ( iFepPluginManager->PluginInputMode() == EPluginInputModeItut |
|
1441 |
|| iFepPluginManager->PluginInputMode() == EPluginInputModeVkb ) ) |
|
1442 |
{ |
|
1443 |
response = EKeyWasConsumed; |
|
1444 |
break; |
|
1445 |
||
1446 |
} |
|
1447 |
#endif |
|
1448 |
if (IsFlagSet(EFlagLineFeedCharacter)) |
|
1449 |
{ |
|
1450 |
// restore cursor visibility |
|
1451 |
if (IsFlagSet(EFlagInsideMultitapInlineEditingTransaction)) |
|
1452 |
{ |
|
1453 |
iInputCapabilities.FepAwareTextEditor()->SetInlineEditingCursorVisibilityL(ETrue); |
|
1454 |
} |
|
1455 |
||
1456 |
iInputCapabilities.FepAwareTextEditor()->CancelFepInlineEdit(); |
|
1457 |
ClearFlag(EFlagInsideMultitapInlineEditingTransaction | |
|
1458 |
EFlagInsideInlineEditingTransaction | |
|
1459 |
EFlagLineFeedCharacter); |
|
1460 |
response = EKeyWasConsumed; |
|
1461 |
} |
|
1462 |
else |
|
1463 |
{ |
|
1464 |
response = HandleNaviEventOutsideInlineEditL(aCode, aLength); |
|
1465 |
if (WesternPredictive() && response == EKeyWasNotConsumed) |
|
1466 |
{ |
|
1467 |
// if we're passing a backspace to the editor simulate any old keypress |
|
1468 |
// to catch and check the state of play after the deletion |
|
1469 |
SimulateKeyEventL(EKeyF24); |
|
1470 |
} |
|
1471 |
if (response == EKeyWasNotConsumed) |
|
1472 |
{ |
|
1473 |
if(iMode == EZhuyinFind) |
|
1474 |
{ |
|
1475 |
SetFlag(EFlagSupressAutoUpdate); |
|
1476 |
} |
|
1477 |
if (iLongClearAfterCloseUI && |
|
1478 |
aLength == ELongKeyPress) |
|
1479 |
{ |
|
1480 |
response = EKeyWasConsumed; |
|
1481 |
} |
|
1482 |
||
1483 |
iCaseMan->UpdateCase(EBackspaceEvent); |
|
1484 |
} |
|
1485 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
1486 |
if(IsAutoCompleteOn()) |
|
1487 |
{ |
|
1488 |
TInt tailLength = 0; |
|
1489 |
iPtiEngine->HandleCommandL( EPtiCommandGetAutoCompletionTailLength, |
|
1490 |
&tailLength ); |
|
1491 |
if(tailLength > 0) |
|
1492 |
{ |
|
1493 |
RemoveSuggestedAdvanceCompletionL(); |
|
1494 |
} |
|
1495 |
} |
|
1496 |
#endif |
|
1497 |
} |
|
1498 |
||
1499 |
// Clear the star key flag. |
|
1500 |
if( FepUI() ) |
|
1501 |
{ |
|
1502 |
FepUI()->SetStarKeyFlag( EFalse ); |
|
1503 |
} |
|
1504 |
} |
|
1505 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
1506 |
else if (IsAutoCompleteOn()) |
|
1507 |
{ |
|
1508 |
if(FepUI()->HandleKeyL(aCode, aLength)) |
|
1509 |
{ |
|
1510 |
if( EPtiKeyboardHalfQwerty == KeyboardLayout() |
|
1511 |
&& iWesternPredictive |
|
1512 |
&& iCaseMan->CurrentCase() != EAknEditorUpperCase ) |
|
1513 |
{ |
|
1514 |
ClearFlag(CAknFepManager::EFlagChangeInputMode); |
|
1515 |
} |
|
1516 |
TInt tailLength = 0; |
|
1517 |
iPtiEngine->HandleCommandL( EPtiCommandGetAutoCompletionTailLength, &tailLength ); |
|
1518 |
if(tailLength > 0) |
|
1519 |
{ |
|
1520 |
RemoveSuggestedAdvanceCompletionL(); |
|
1521 |
} |
|
1522 |
response = EKeyWasConsumed; |
|
1523 |
} |
|
1524 |
} |
|
1525 |
else if(FepUI()->HandleKeyL(aCode, aLength)) |
|
1526 |
{ |
|
1527 |
response = EKeyWasConsumed; |
|
1528 |
} |
|
1529 |
SendEventsToPluginManL( EPluginHideTooltip ); |
|
1530 |
iExactWordPopupContent->HidePopUp(); |
|
1531 |
#else |
|
1532 |
else if (FepUI()->HandleKeyL(aCode, aLength)) |
|
1533 |
{ |
|
1534 |
response = EKeyWasConsumed; |
|
1535 |
} |
|
1536 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
1537 |
} |
|
1538 |
break; |
|
1539 |
case EKeyDelete: |
|
1540 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
1541 |
if(IsAutoCompleteOn()) |
|
1542 |
{ |
|
1543 |
TInt tailLength = 0; |
|
1544 |
iPtiEngine->HandleCommandL( EPtiCommandGetAutoCompletionTailLength, |
|
1545 |
&tailLength ); |
|
1546 |
if(tailLength > 0) |
|
1547 |
{ |
|
1548 |
RemoveSuggestedAdvanceCompletionL(); |
|
1549 |
} |
|
1550 |
} |
|
1551 |
||
1552 |
// When press delete key, if FSQ is opened, |
|
1553 |
// also need to check and close tooltip on it. |
|
1554 |
SendEventsToPluginManL( EPluginHideTooltip ); |
|
1555 |
||
1556 |
iExactWordPopupContent->HidePopUp(); |
|
1557 |
if ( IsFlagSet( EFlagInsideInlineEditingTransaction ) ) |
|
1558 |
{ |
|
1559 |
TryRemoveNoMatchesIndicatorL(); |
|
1560 |
UpdateCbaL(NULL); |
|
1561 |
CommitInlineEditL(); |
|
1562 |
} |
|
1563 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
1564 |
break; |
|
1565 |
case EKeyF19: // Fep simulated event to asynchronously update the case. |
|
1566 |
iCaseMan->UpdateCase(ENullNaviEvent); |
|
1567 |
response=EKeyWasConsumed; |
|
1568 |
ClearExtendedFlag(EExtendedFlagOkKeyPressOnCandidatePopup ); |
|
1569 |
break; |
|
1570 |
case EKeyF22: |
|
1571 |
if (WesternPredictive()) |
|
1572 |
{ |
|
1573 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
1574 |
if (CursorInsideWord()) |
|
1575 |
{ |
|
1576 |
MoveCursorToEndOfWordL(); |
|
1577 |
} |
|
1578 |
if (iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep()) |
|
1579 |
{ |
|
1580 |
iCaseMan->UpdateCase(ENullNaviEvent); |
|
1581 |
} |
|
1582 |
} |
|
1583 |
else if (iMode == ELatin) |
|
1584 |
{ |
|
1585 |
iCaseMan->UpdateCase(ENullNaviEvent); |
|
1586 |
} |
|
1587 |
ClearCcpuFlag(ECcpuStateIgnoreStarUp); |
|
1588 |
response=EKeyWasConsumed; |
|
1589 |
break; |
|
1590 |
case EKeyF23: |
|
1591 |
if (WesternPredictive()) |
|
1592 |
{ |
|
1593 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
1594 |
if (CursorInsideWord()) |
|
1595 |
{ |
|
1596 |
MoveCursorToStartOfWordL(); |
|
1597 |
} |
|
1598 |
if (iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep()) |
|
1599 |
{ |
|
1600 |
iCaseMan->UpdateCase(ENullNaviEvent); |
|
1601 |
} |
|
1602 |
} |
|
1603 |
else if (iMode == ELatin) |
|
1604 |
{ |
|
1605 |
iCaseMan->UpdateCase(ENullNaviEvent); |
|
1606 |
} |
|
1607 |
ClearCcpuFlag(ECcpuStateIgnoreStarUp); |
|
1608 |
response=EKeyWasConsumed; |
|
1609 |
break; |
|
1610 |
case EKeyF24: |
|
1611 |
if (WesternPredictive() && CursorInsideWord()) |
|
1612 |
{ |
|
1613 |
// word concatenation - start the timer; add concatenated word |
|
1614 |
// to UDB on timer expiry |
|
1615 |
iConcatenationTimer->Start(EWordConcatenationTimeout, EWordConcatenationTimeout, |
|
1616 |
TCallBack(WordConcatenationTimerTimeoutCallback, this)); |
|
1617 |
} |
|
1618 |
response=EKeyWasConsumed; |
|
1619 |
break; |
|
1620 |
case EPtiKey0: //fall through |
|
1621 |
case EPtiKey1: |
|
1622 |
case EPtiKey2: |
|
1623 |
case EPtiKey3: |
|
1624 |
case EPtiKey4: |
|
1625 |
case EPtiKey5: |
|
1626 |
case EPtiKey6: |
|
1627 |
case EPtiKey7: |
|
1628 |
case EPtiKey8: |
|
1629 |
case EPtiKey9: |
|
1630 |
#ifdef RD_SCALABLE_UI_V2 |
|
1631 |
if ( aLength == ELongKeyPress && !isPassNext && (aCode == EPtiKey0) ) |
|
1632 |
{ |
|
1633 |
if( !IsQwerty() && |
|
1634 |
!IsFlagSet(CAknFepManager::EFlagPassNextKey)&& |
|
1635 |
iFepPluginManager->PluginInputMode() != EPluginInputModeItut ) |
|
1636 |
{ |
|
1637 |
iFepPluginManager->ClosePluginInputModeL( ETrue ); |
|
1638 |
} |
|
1639 |
} |
|
1640 |
#endif |
|
1641 |
if (IsFlagSet(EFlagLineFeedCharacter) && aCode != EPtiKey0) |
|
1642 |
{ |
|
1643 |
// There is line feed character waiting. Pospone this event and handle |
|
1644 |
// line feed first. |
|
1645 |
CancelInlineEdit(); |
|
1646 |
if (!(iAknEditorFlags & EAknEditorFlagFindPane) || iQwertyInputMode) |
|
1647 |
{ |
|
1648 |
SimulateKeyEventL(EKeyEnter); |
|
1649 |
SimulateKeyEventL(EKeyF19); // Asyncronous case update |
|
1650 |
} |
|
1651 |
SimulateKeyEventL((TPtiKey)aCode); |
|
1652 |
ClearFlag(EFlagLineFeedCharacter); |
|
1653 |
return EKeyWasConsumed; |
|
1654 |
} |
|
1655 |
if (iLanguageCapabilities.iInputLanguageCode == ELangJapanese && iMode != ELatin) |
|
1656 |
{ |
|
1657 |
if (EditorHasFreeSpace() || iFepManState == EAknFepStateUIActive) |
|
1658 |
{ |
|
1659 |
if (FepUI()->HandleKeyL(aCode, aLength)) |
|
1660 |
{ |
|
1661 |
ClearFlag(EFlagChangeInputMode); |
|
1662 |
response = EKeyWasConsumed; |
|
1663 |
} |
|
1664 |
// response is EKeyWasNotConsumed |
|
1665 |
} |
|
1666 |
} |
|
1667 |
else |
|
1668 |
{ |
|
1669 |
//pass extra key received when doing secret text edit |
|
1670 |
if (IsFlagSet(EFlagPassNextKey)) |
|
1671 |
{ |
|
1672 |
ClearFlag(EFlagPassNextKey); |
|
1673 |
} |
|
1674 |
else if (IsFlagSet(EFlagShiftKeyDepressed) || IsCcpuFlagSet(ECcpuStateHashDown)) |
|
1675 |
{ |
|
1676 |
response = EKeyWasConsumed; |
|
1677 |
} |
|
1678 |
||
1679 |
// The key event is passed to the editor to handle in case of |
|
1680 |
// MFNE and other non FEP aware editors (response = EKeyWasNotConsumed). |
|
1681 |
else if ( IsFepAwareTextEditor() ) |
|
1682 |
{ |
|
1683 |
if ( ( iMode != ENumber && iMode != ENativeNumber ) || |
|
1684 |
( ( iMode == ENumber || iMode == ENativeNumber ) && aLength == ELongKeyPress)) |
|
1685 |
{ |
|
1686 |
// Be default the key event is handled by FEP for FEP aware editors. |
|
1687 |
response = EKeyWasConsumed; |
|
1688 |
} |
|
1689 |
||
1690 |
// New character can be entered to the editor if there is |
|
1691 |
// space left in the editor. Editor can be modified also |
|
1692 |
// is the last character is multitapped or last character |
|
1693 |
// in inline state is replaced with a digit. |
|
1694 |
/*Hindi*/ |
|
1695 |
//This condition is added for Hindi language in case of multitapping of EKey1 to get |
|
1696 |
//a numeral value "1" because of a clasical case of Halant and ZWS getting added |
|
1697 |
//before numeral 1 which may affect incase of limited space in editor |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
1698 |
|
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
1699 |
if (( EditorHasFreeSpace() |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
1700 |
|| (!WesternPredictive() && !EditorHasFreeSpace() && |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
1701 |
(TAknFepUiIndicInputManager::IsIndicLangauge( |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
1702 |
TLanguage(iLanguageCapabilities.iInputLanguageCode)))) |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
1703 |
|| IsFlagSet(EFlagInsideMultitapInlineEditingTransaction) |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
1704 |
|| (IsFlagSet(EFlagInsideInlineEditingTransaction) && aLength == ELongKeyPress))) |
44 | 1705 |
{ |
1706 |
ClearFlag(EFlagEditorFull); |
|
1707 |
||
1708 |
if (aLength == ELongKeyPress && |
|
1709 |
(iMode != ELatin && iMode != ENumber && iMode != ENativeNumber && iMode != EStrokeFind && iMode != EHangul) && |
|
1710 |
FepUI()->IsValidNumericLongKeyPress(aCode)) |
|
1711 |
{ |
|
1712 |
if (iFepManState == EAknFepStateInitial) // Multitapping |
|
1713 |
{ |
|
1714 |
#ifdef RD_SCALABLE_UI_V2 |
|
1715 |
if (iFepFullyConstructed && |
|
1716 |
iFepPluginManager->CurrentFepInputUI() ) |
|
1717 |
{ |
|
1718 |
if (iFepPluginManager->CurrentFepInputUI()->HandleKeyL(aCode, |
|
1719 |
aLength)) |
|
1720 |
{ |
|
1721 |
response = EKeyWasConsumed; |
|
1722 |
break; |
|
1723 |
} |
|
1724 |
} |
|
1725 |
#endif |
|
1726 |
// Current multitabbed character is replaced with a number. |
|
1727 |
TChar ch(aCode); |
|
1728 |
TBuf<1> buf; |
|
1729 |
buf.Append(ch); |
|
1730 |
NewCharacterL(buf); |
|
1731 |
CommitInlineEditL(); |
|
1732 |
iPtiEngine->ClearCurrentWord(); |
|
1733 |
} |
|
1734 |
else |
|
1735 |
{ |
|
1736 |
// Long number key press is given to the editor. |
|
1737 |
TryCloseUiL(); |
|
1738 |
response = EKeyWasNotConsumed; |
|
1739 |
} |
|
1740 |
} |
|
1741 |
else if (FepUI()->HandleKeyL(aCode, aLength)) |
|
1742 |
{ |
|
1743 |
if ( (iMode == EPinyin || iMode == EZhuyin || iMode == EStroke || iMode == ECangJie) |
|
1744 |
&& iFepManState == EAknFepStateUIActive ) |
|
1745 |
{ |
|
1746 |
if ( EditorState() ) |
|
1747 |
{ |
|
1748 |
EditorState()->SetFlags( EditorState()->Flags() | EAknEditorFlagChinesePopup ); |
|
1749 |
} |
|
1750 |
} |
|
1751 |
ClearFlag(EFlagChangeInputMode); |
|
1752 |
// for japanese variant |
|
1753 |
if (IsFeatureSupportedJapanese() |
|
1754 |
&& iMode == ENumber) |
|
1755 |
{ |
|
1756 |
response = EKeyWasConsumed; |
|
1757 |
} |
|
1758 |
} |
|
1759 |
else |
|
1760 |
{ |
|
1761 |
//By default, pass long keypress to an editor for inserting number. |
|
1762 |
response = EKeyWasNotConsumed; |
|
1763 |
//No need to handle long key press in dialer |
|
1764 |
if ( RProcess().SecureId().iId != KPhoneSecureId ) |
|
1765 |
{ |
|
1766 |
||
1767 |
if ( iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic ) |
|
1768 |
{ |
|
1769 |
SimulateKeyEventL( aCode + KLatinToArabicIndicDigitsDelta ); |
|
1770 |
response = EKeyWasConsumed; |
|
1771 |
} |
|
1772 |
else if( iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic ) |
|
1773 |
{ |
|
1774 |
SimulateKeyEventL( aCode + KLatinToEasternArabicIndicDigitsDelta ); |
|
1775 |
response = EKeyWasConsumed; |
|
1776 |
} |
|
1777 |
/*Hindi*/ |
|
1778 |
else if ( iLanguageCapabilities.iLocalDigitType == EDigitTypeDevanagari |
|
1779 |
|| iPreviousEditingState == EDevanagariIndicNumeric ) |
|
1780 |
{ |
|
1781 |
||
1782 |
SimulateKeyEventL( aCode + KLatinToDevanagariDigitsDelta ); |
|
1783 |
||
1784 |
response = EKeyWasConsumed; |
|
1785 |
} |
|
1786 |
} |
|
1787 |
} |
|
1788 |
} |
|
1789 |
} |
|
1790 |
} |
|
1791 |
break; |
|
1792 |
case EKeyOK: |
|
1793 |
{ |
|
1794 |
if (iUiInterface->SoftkeysExist() && EditSubmenuInUse()) |
|
1795 |
{ |
|
1796 |
if (iUiInterface->SoftkeyCommandId(ELeftSoftkeyIndex) == EAknFepSoftkeyStartCopy) |
|
1797 |
{ |
|
1798 |
ProcessCommandL(EAknFepSoftkeyStartCopy); |
|
1799 |
response = EKeyWasConsumed; |
|
1800 |
break; |
|
1801 |
} |
|
1802 |
else if (iUiInterface->SoftkeyCommandId(ELeftSoftkeyIndex) == EAknFepSoftkeyStartCut) |
|
1803 |
{ |
|
1804 |
ProcessCommandL(EAknFepSoftkeyStartCut); |
|
1805 |
response = EKeyWasConsumed; |
|
1806 |
break; |
|
1807 |
} |
|
1808 |
else if (iUiInterface->SoftkeyCommandId(ELeftSoftkeyIndex) == EEikCmdEditCopy) |
|
1809 |
{ |
|
1810 |
ProcessCommandL(EEikCmdEditCopy); |
|
1811 |
response = EKeyWasConsumed; |
|
1812 |
break; |
|
1813 |
} |
|
1814 |
else if (iUiInterface->SoftkeyCommandId(ELeftSoftkeyIndex) == EEikCmdEditCut) |
|
1815 |
{ |
|
1816 |
ProcessCommandL(EEikCmdEditCut); |
|
1817 |
response = EKeyWasConsumed; |
|
1818 |
break; |
|
1819 |
} |
|
1820 |
} |
|
1821 |
||
1822 |
if ( (iAknEditorFlags & EAknEditorFlagNoLRNavigation) && |
|
1823 |
IsFlagSet(EFlagShiftKeyDepressed) ) |
|
1824 |
{ |
|
1825 |
// Selection key is pressed during shift key press. |
|
1826 |
ClearFlag(EFlagNoActionDuringShiftKeyPress); |
|
1827 |
return EKeyWasNotConsumed; |
|
1828 |
} |
|
1829 |
if (iLanguageCapabilities.iInputLanguageCode == ELangJapanese && iMode != ELatin) |
|
1830 |
{ |
|
1831 |
if (FepUI()->HandleKeyL(aCode, aLength)) |
|
1832 |
{ |
|
1833 |
response = EKeyWasConsumed; |
|
1834 |
} |
|
1835 |
} |
|
1836 |
else |
|
1837 |
{ |
|
1838 |
if (IsFlagSet(EFlagShiftKeyDepressed) && |
|
1839 |
!(iAknEditorFlags & EAknEditorFlagSupressShiftMenu)) |
|
1840 |
{ |
|
1841 |
response = EKeyWasConsumed; |
|
1842 |
} |
|
1843 |
else if (iFepManState == EAknFepStateUIActive) |
|
1844 |
{ |
|
1845 |
if (FepUI()->HandleKeyL(aCode, aLength)) |
|
1846 |
{ |
|
1847 |
response = EKeyWasConsumed; |
|
1848 |
} |
|
1849 |
} |
|
1850 |
else if (iMode == ELatin && !WesternPredictive() && |
|
1851 |
IsFlagSet(EFlagInsideMultitapInlineEditingTransaction)) |
|
1852 |
{ |
|
1853 |
CommitInlineEditL(); |
|
1854 |
} |
|
1855 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
1856 |
// Predictive QWERTY (XT9) changes ----> |
|
1857 |
// Accept current candidate (including possible auto-completed part) and insert space after the word |
|
1858 |
// if selection key pressed while inline editing (on Qwerty only!) |
|
1859 |
// this is not the expected behavior for half qwerty |
|
1860 |
||
1861 |
TBool isQwertyMode = iQwertyInputMode && |
|
1862 |
!( EPtiKeyboardHalfQwerty == KeyboardLayout() ); |
|
1863 |
if ( response == EKeyWasNotConsumed && iWesternPredictive && isQwertyMode && |
|
1864 |
IsFlagSet(EFlagInsideInlineEditingTransaction) |
|
1865 |
// For addition of ITI features on FSQ. |
|
1866 |
// If FSQ is opened with ITI features activated, don't commit as HW's action |
|
1867 |
&& !( iFepPluginManager && iFepPluginManager->EnableITIOnFSQ() ) ) |
|
1868 |
{ |
|
1869 |
||
1870 |
// If the primary candidate setting is exact typing, The tooltip/bubble always shows the best prediction. |
|
1871 |
// Word on the typing line is accepted into editor on selection key event.. |
|
1872 |
||
1873 |
iPtiEngine->CommitCurrentWord(); |
|
1874 |
CommitInlineEditL(); |
|
1875 |
TryCloseUiL(); |
|
1876 |
if(!static_cast<TChar>(NextChar()).IsSpace()) |
|
1877 |
{ |
|
1878 |
SimulateKeyEventL(EKeySpace); |
|
1879 |
} |
|
1880 |
else |
|
1881 |
{ |
|
1882 |
TCursorSelection sel; |
|
1883 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(sel); |
|
1884 |
sel.iCursorPos++; |
|
1885 |
sel.iAnchorPos++; |
|
1886 |
iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(sel); |
|
1887 |
} |
|
1888 |
SimulateKeyEventL(EKeyF19); // asynchronous case update |
|
1889 |
||
1890 |
response = EKeyWasConsumed; |
|
1891 |
} |
|
1892 |
// Predictive QWERTY (XT9) changes <---- |
|
1893 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
1894 |
} |
|
1895 |
} |
|
1896 |
break; |
|
1897 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
1898 |
case EKeyPhoneEnd: |
|
1899 |
{ |
|
1900 |
// Suggested word should get committed in exact typing |
|
1901 |
if ( iWesternPredictive && |
|
1902 |
IsFlagSet(EFlagInsideInlineEditingTransaction) ) |
|
1903 |
{ |
|
1904 |
||
1905 |
// If the primary candidate setting is exact typing, The tooltip/bubble always shows the best prediction. |
|
1906 |
// Word on the typing line is accepted into editor on end key event.. |
|
1907 |
||
1908 |
iPtiEngine->CommitCurrentWord(); |
|
1909 |
CommitInlineEditL(); |
|
1910 |
TryCloseUiL(); |
|
1911 |
ClearFlag(CAknFepManager::EFlagNoMatches); |
|
1912 |
SimulateKeyEventL(EKeyF19); // asynchronous case update |
|
1913 |
} |
|
1914 |
} |
|
1915 |
break; |
|
1916 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
1917 |
default: |
|
1918 |
break; |
|
1919 |
} |
|
1920 |
SchedulePostEventCheckL(aCode); |
|
1921 |
||
1922 |
#ifdef RD_SCALABLE_UI_V2 |
|
1923 |
if ( !isPassNext ) |
|
1924 |
{ |
|
1925 |
SendEventsToPluginManL( EPluginKeyEvent, aCode ); |
|
1926 |
} |
|
1927 |
#endif |
|
1928 |
||
1929 |
return response; |
|
1930 |
} |
|
1931 |
||
1932 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
1933 |
void CAknFepManager::HandleShiftHalfQwertyChineseL(TEventCode aEventCode) |
|
1934 |
{ |
|
1935 |
if (aEventCode == EEventKeyDown) |
|
1936 |
{ |
|
1937 |
ClearCcpuFlag(ECcpuStateCbaShown); |
|
1938 |
SetFlag(EFlagShiftKeyDepressed | EFlagNoActionDuringShiftKeyPress); |
|
1939 |
ClearFlag(EFlagNoActionDuringChrKeyPress); |
|
1940 |
SetFlag(EFlagQwertyShiftMode); |
|
1941 |
// Long press of shift key timer is activated. |
|
1942 |
iShiftKeypressMonitor->Start(EShiftKeyRepeatDelay, |
|
1943 |
EShiftKeyRepeatDelay, TCallBack(ResetShiftKeyMonitorCallback, |
|
1944 |
this) ); |
|
1945 |
} |
|
1946 |
else if (aEventCode == EEventKeyUp) |
|
1947 |
{ |
|
1948 |
ClearFlag(EFlagShiftKeyDepressed |
|
1949 |
|EFlagNoActionDuringShiftKeyPress); |
|
1950 |
ClearFlag(EFlagQwertyShiftMode); |
|
1951 |
iShiftKeypressMonitor->Cancel(); |
|
1952 |
||
1953 |
if ( (iKeyPressedDuringShift)|| IsFlagSet(EFlagLongShiftKeyPress) ) |
|
1954 |
{ |
|
1955 |
iKeyPressedDuringShift = EFalse; |
|
1956 |
ClearFlag( EFlagLongShiftKeyPress ); |
|
1957 |
if ( iFnKeyManager->FnKeyState() ) |
|
1958 |
{ |
|
1959 |
iFnKeyManager->SetFnKeyState( CAknFepFnKeyManager::EFnKeyNone ); |
|
1960 |
} |
|
1961 |
UpdateIndicators(); |
|
1962 |
} |
|
1963 |
else |
|
1964 |
{ |
|
1965 |
CAknEdwinState* editorState = EditorState(); |
|
1966 |
TInt permittedCases = editorState->PermittedCases(); |
|
1967 |
permittedCases = permittedCases == 0 ? |
|
1968 |
EAknEditorLowerCase | EAknEditorUpperCase : permittedCases; |
|
1969 |
||
1970 |
if (iMode == ELatin && (permittedCases & EAknEditorTextCase)) |
|
1971 |
{ |
|
1972 |
// Latin case update is changed back to automatic if latin |
|
1973 |
// text case is allowed and the case is changed manually from #-key. |
|
1974 |
ClearFlag(CAknFepManager::EFlagSupressAutoUpdate); |
|
1975 |
} |
|
1976 |
TInt currentCase = iCaseMan->CurrentCase(); |
|
1977 |
||
1978 |
// Is current latin case last available case. |
|
1979 |
TBool lastCase = ( ( !(permittedCases & EAknEditorTextCase) |
|
1980 |
&& ((currentCase == EAknEditorLowerCase) |
|
1981 |
|| (currentCase == EAknEditorUpperCase |
|
1982 |
&& !(permittedCases |
|
1983 |
& EAknEditorLowerCase)) ) |
|
1984 |
|| (editorState->Flags() & EAknEditorFlagFixedCase) ) |
|
1985 |
|| (editorState->Flags() |
|
1986 |
& EAknEditorFlagForceTransparentFepModes) ); |
|
1987 |
||
1988 |
if (iMode == ELatin |
|
1989 |
&& !IsFlagSet(CAknFepManager::EFlagChangeInputMode) |
|
1990 |
&& !lastCase) |
|
1991 |
{ |
|
1992 |
if (iWesternPredictive) |
|
1993 |
{ |
|
1994 |
// Input mode is still Latin. Only case is updated. |
|
1995 |
if (permittedCases & EAknEditorTextCase) |
|
1996 |
{ |
|
1997 |
iCaseMan->ManualCaseUpdate(); |
|
1998 |
} |
|
1999 |
else |
|
2000 |
{ |
|
2001 |
iCaseMan->SetCurrentCase(EAknEditorLowerCase); |
|
2002 |
} |
|
2003 |
} |
|
2004 |
else |
|
2005 |
{ |
|
2006 |
if(iCaseMan->CurrentCase() == EAknEditorUpperCase) |
|
2007 |
{ |
|
2008 |
iCaseMan->SetCurrentCase(EAknEditorLowerCase); |
|
2009 |
} |
|
2010 |
else |
|
2011 |
{ |
|
2012 |
iCaseMan->SetCurrentCase(EAknEditorUpperCase); |
|
2013 |
} |
|
2014 |
} |
|
2015 |
||
2016 |
// Next time input mode is changed if any text is not entered before. |
|
2017 |
SetFlag(CAknFepManager::EFlagChangeInputMode); |
|
2018 |
} |
|
2019 |
else |
|
2020 |
{ |
|
2021 |
// Input mode is incremented. |
|
2022 |
SetChangeModeByShiftAndSpace( EFalse ); |
|
2023 |
TryIncrementChineseModeForQwertyL(iMode); |
|
2024 |
||
2025 |
ClearFlag(CAknFepManager::EFlagChangeInputMode); |
|
2026 |
||
2027 |
if ( iMode == ELatin && iWesternPredictive ) // New mode after Increment. |
|
2028 |
||
2029 |
{ |
|
2030 |
if (editorState->Flags() & EAknEditorFlagFixedCase) |
|
2031 |
{ |
|
2032 |
// Only one fixed case is available. Use it. |
|
2033 |
iCaseMan->ConfigureCaseStateFromEditorState(); |
|
2034 |
SetFlag(CAknFepManager::EFlagChangeInputMode); |
|
2035 |
} |
|
2036 |
else if (editorState->Flags() |
|
2037 |
& EAknEditorFlagForceTransparentFepModes) |
|
2038 |
{ |
|
2039 |
// Only lower case is used with find pane. |
|
2040 |
iCaseMan->SetCurrentCase(EAknEditorLowerCase); |
|
2041 |
SetFlag(CAknFepManager::EFlagSupressAutoUpdate); |
|
2042 |
SetFlag(CAknFepManager::EFlagChangeInputMode); |
|
2043 |
} |
|
2044 |
else if (permittedCases & EAknEditorTextCase) |
|
2045 |
{ |
|
2046 |
iCaseMan->SetCurrentCase(EAknEditorTextCase); |
|
2047 |
iCaseMan->UpdateCase(ENullNaviEvent); |
|
2048 |
} |
|
2049 |
else |
|
2050 |
{ |
|
2051 |
if (permittedCases & EAknEditorUpperCase) |
|
2052 |
{ |
|
2053 |
iCaseMan->SetCurrentCase(EAknEditorUpperCase); |
|
2054 |
if ( !(permittedCases |
|
2055 |
& EAknEditorLowerCase)) |
|
2056 |
{ |
|
2057 |
// We need to move to next input mode since only upper case |
|
2058 |
// is permitted in Latin input mode. |
|
2059 |
SetFlag(CAknFepManager::EFlagChangeInputMode); |
|
2060 |
} |
|
2061 |
} |
|
2062 |
else |
|
2063 |
{ |
|
2064 |
iCaseMan->SetCurrentCase(EAknEditorLowerCase); |
|
2065 |
SetFlag(CAknFepManager::EFlagChangeInputMode); |
|
2066 |
} |
|
2067 |
} |
|
2068 |
} |
|
2069 |
} |
|
2070 |
} |
|
2071 |
} |
|
2072 |
} |
|
2073 |
||
2074 |
void CAknFepManager::HandleShiftQwertyChineseL(TEventCode aEventCode) |
|
2075 |
{ |
|
2076 |
if ( IsFlagSet( EFlagQwertyChrKeyDepressed ) && |
|
2077 |
!IsFeatureSupportedJapanese() && |
|
2078 |
iCurrentFepUI->IsValidShiftKeyPress()) |
|
2079 |
{ |
|
2080 |
ClearFlag(EFlagQwertyChrKeyDepressed | EFlagNoActionDuringChrKeyPress); |
|
2081 |
LaunchLanguagesPopupListL(); |
|
2082 |
return; |
|
2083 |
} |
|
2084 |
||
2085 |
TInt language = iSharedDataInterface->InputTextLanguage(); |
|
2086 |
||
2087 |
if (aEventCode == EEventKeyUp) |
|
2088 |
{ |
|
2089 |
ClearCcpuFlag(ECcpuStateCbaShown); |
|
2090 |
if (FepUI()) |
|
2091 |
{ |
|
2092 |
FepUI()->HandleKeyL(EKeyLeftShift, EShortKeyPress); |
|
2093 |
} |
|
2094 |
TBool validShift = iCurrentFepUI->IsValidShiftKeyPress(); |
|
2095 |
||
2096 |
if (IsFlagSet(EFlagLongShiftKeyPress) ||iKeyPressedDuringShift) |
|
2097 |
{ |
|
2098 |
if (iKeyPressedDuringShift || IsFlagSet(EFlagQwertyShiftMode)) |
|
2099 |
{ |
|
2100 |
iShiftKeypressMonitor->Cancel(); |
|
2101 |
iKeyPressedDuringShift = EFalse; |
|
2102 |
ClearFlag(EFlagQwertyShiftMode); |
|
2103 |
} |
|
2104 |
} |
|
2105 |
else |
|
2106 |
if (IsFlagSet(EFlagQwertyShiftMode)) |
|
2107 |
{ |
|
2108 |
if ( iMode != ELatin && validShift ) |
|
2109 |
{ |
|
2110 |
iModeBefore = iMode; |
|
2111 |
TryChangeModeL(ELatin); |
|
2112 |
ClearFlag( EFlagQwertyShiftMode ); |
|
2113 |
} |
|
2114 |
} |
|
2115 |
else |
|
2116 |
{ |
|
2117 |
if (iMode == ELatin) |
|
2118 |
{ |
|
2119 |
TBool isWsPr= EFalse; |
|
2120 |
if (WesternPredictive()) |
|
2121 |
{ |
|
2122 |
SetWesternPredictive(EFalse); |
|
2123 |
isWsPr = ETrue; |
|
2124 |
} |
|
2125 |
TInt Modetemp = iModeBefore; |
|
2126 |
TInt sharedDataMode = iSharedDataInterface->InputMode(); |
|
2127 |
if (Modetemp == EStroke && |
|
2128 |
iQwertyInputMode && |
|
2129 |
sharedDataMode == ECangJie) |
|
2130 |
{ |
|
2131 |
Modetemp = ECangJie; |
|
2132 |
} |
|
2133 |
||
2134 |
TryChangeModeL(Modetemp); |
|
2135 |
if (isWsPr) |
|
2136 |
{ |
|
2137 |
SetWesternPredictive(ETrue); |
|
2138 |
} |
|
2139 |
} |
|
2140 |
} |
|
2141 |
||
2142 |
ClearFlag(EFlagShiftKeyDepressed); |
|
2143 |
||
2144 |
if (IsFlagSet(EFlagLongShiftKeyPress) |
|
2145 |
&& iMode == ELatin |
|
2146 |
&& IsFlagSet(EFlagQwertyShiftMode))//latin shift ->abc |
|
2147 |
{ |
|
2148 |
ClearFlag(EFlagQwertyShiftMode); |
|
2149 |
} |
|
2150 |
||
2151 |
if (IsFlagSet(EFlagLongShiftKeyPress)) //long keypress up |
|
2152 |
{ |
|
2153 |
ClearFlag(EFlagLongShiftKeyPress |
|
2154 |
|EFlagNoActionDuringShiftKeyPress); |
|
2155 |
} |
|
2156 |
else // short keypress up |
|
2157 |
{ |
|
2158 |
iShiftKeypressMonitor->Cancel(); |
|
2159 |
} |
|
2160 |
||
2161 |
ClearFlag(EFlagNoActionDuringChrKeyPress); |
|
2162 |
ClearFlag(EFlagNoActionDuringShiftKeyPress); |
|
2163 |
if ( validShift ) |
|
2164 |
{ |
|
2165 |
UpdateIndicators(); |
|
2166 |
} |
|
2167 |
else |
|
2168 |
{ |
|
2169 |
ClearFlag(EFlagQwertyShiftMode); |
|
2170 |
} |
|
2171 |
} |
|
2172 |
else |
|
2173 |
if (aEventCode == EEventKeyDown) |
|
2174 |
{ |
|
2175 |
||
2176 |
SetFlag(EFlagShiftKeyDepressed | EFlagNoActionDuringShiftKeyPress); |
|
2177 |
ClearFlag(EFlagNoActionDuringChrKeyPress); |
|
2178 |
||
2179 |
if (IsFlagSet(EFlagQwertyShiftMode)) |
|
2180 |
{ |
|
2181 |
ClearFlag(EFlagQwertyShiftMode); |
|
2182 |
} |
|
2183 |
else |
|
2184 |
{ |
|
2185 |
SetFlag(EFlagQwertyShiftMode); |
|
2186 |
if ( iCurrentFepUI->IsValidShiftKeyPress() |
|
2187 |
|| iMode == ELatin ) |
|
2188 |
{ |
|
2189 |
UpdateIndicators(); |
|
2190 |
} |
|
2191 |
// If the iShiftKeypressMonitor is actived now, cancel it first. |
|
2192 |
iShiftKeypressMonitor->Cancel(); |
|
2193 |
// Long press of shift key timer is activated. |
|
2194 |
iShiftKeypressMonitor->Start(EShiftKeyRepeatDelay, |
|
2195 |
EShiftKeyRepeatDelay, TCallBack( |
|
2196 |
ResetShiftKeyMonitorCallback, this)); |
|
2197 |
} |
|
2198 |
} |
|
2199 |
} |
|
2200 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
2201 |
TKeyResponse CAknFepManager::HandleShiftKeyEventL(TEventCode aEventCode) |
|
2202 |
{ |
|
2203 |
TKeyResponse response = EKeyWasNotConsumed; |
|
2204 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2205 |
// GQF clarification |
|
2206 |
// In case irrespective Fn/shift key Text case should not be changed. |
|
2207 |
// Like Shift +Fn + Shift should not toggle the text case of the editor. |
|
2208 |
// Only Consecutive press of shift key should change the text case |
|
2209 |
if( iQwertyInputMode && (EEventKeyDown== aEventCode) && EPtiKeyboardHalfQwerty != KeyboardLayout()) |
|
2210 |
{ |
|
2211 |
if( (iFnKeyManager->FnKeyState() == CAknFepFnKeyManager::EFnKeyNext) && |
|
2212 |
IsFlagSet(EFlagQwertyShiftMode)) |
|
2213 |
{ |
|
2214 |
iFnKeyManager->ClearFnKeyState(); |
|
2215 |
iPtiEngine->SetCase((TPtiTextCase)EPtiCaseLower); |
|
2216 |
ClearFlag(EFlagQwertyShiftMode); |
|
2217 |
} |
|
2218 |
} |
|
2219 |
TInt language = iSharedDataInterface->InputTextLanguage(); |
|
2220 |
#endif |
|
2221 |
||
2222 |
if (iQwertyInputMode) |
|
2223 |
{ |
|
2224 |
if ( !iInputCapabilities.FepAwareTextEditor() ) |
|
2225 |
{ |
|
2226 |
response = EKeyWasNotConsumed; |
|
2227 |
} |
|
2228 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2229 |
else if (language == ELangTaiwanChinese|| |
|
2230 |
language == ELangHongKongChinese || |
|
2231 |
language == ELangPrcChinese) |
|
2232 |
{ |
|
2233 |
if ( ( EPtiKeyboardHalfQwerty == KeyboardLayout() && FepUI() ) && |
|
2234 |
iPtiEngine && |
|
2235 |
( EPtiCaseFnUpper == iPtiEngine->Case() || EPtiCaseFnLower == iPtiEngine->Case() ) && |
|
2236 |
( aEventCode == EEventKeyDown || aEventCode == EEventKeyUp ) ) |
|
2237 |
{ |
|
2238 |
// Ignore the KeyUp event |
|
2239 |
if( aEventCode == EEventKeyDown ) |
|
2240 |
{ |
|
2241 |
FepUI()->HandleKeyL( EPtiKeyQwertyLeftShift, |
|
2242 |
EShortKeyPress ); |
|
2243 |
} |
|
2244 |
if( aEventCode == EEventKeyUp ) |
|
2245 |
{ |
|
2246 |
ClearCcpuFlag(ECcpuStateCbaShown); |
|
2247 |
} |
|
2248 |
} |
|
2249 |
else |
|
2250 |
{ |
|
2251 |
if ((iAknEditorFlags & EAknEditorFlagFindPane)&& (CAknFepFnKeyManager::EFnKeyNone ==FnKeyState())) |
|
2252 |
{ |
|
2253 |
if (aEventCode == EEventKeyUp) |
|
2254 |
{ |
|
2255 |
ClearCcpuFlag(ECcpuStateCbaShown); |
|
2256 |
if ( iKeyPressedDuringShift ) |
|
2257 |
{ |
|
2258 |
iKeyPressedDuringShift = EFalse; |
|
2259 |
} |
|
2260 |
else |
|
2261 |
{ |
|
2262 |
TryIncrementModeChineseQwertyL( iMode ); |
|
2263 |
} |
|
2264 |
ClearFlag( EFlagShiftKeyDepressed | EFlagNoActionDuringShiftKeyPress ); |
|
2265 |
} |
|
2266 |
else if(aEventCode == EEventKeyDown) |
|
2267 |
{ |
|
2268 |
SetFlag(EFlagShiftKeyDepressed | EFlagNoActionDuringShiftKeyPress); |
|
2269 |
ClearFlag(EFlagNoActionDuringChrKeyPress); |
|
2270 |
} |
|
2271 |
return EKeyWasConsumed; |
|
2272 |
} |
|
2273 |
if (EPtiKeyboardHalfQwerty == KeyboardLayout()) |
|
2274 |
{ |
|
2275 |
HandleShiftHalfQwertyChineseL(aEventCode); |
|
2276 |
} |
|
2277 |
else |
|
2278 |
{ |
|
2279 |
HandleShiftQwertyChineseL(aEventCode); |
|
2280 |
} |
|
2281 |
} |
|
2282 |
} |
|
2283 |
#endif // ITI flag |
|
2284 |
else if (aEventCode == EEventKeyDown) |
|
2285 |
{ |
|
2286 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2287 |
#ifdef __HALF_QWERTY_KEYPAD |
|
2288 |
if( ( EPtiKeyboardHalfQwerty == KeyboardLayout() && FepUI() ) && |
|
2289 |
iPtiEngine && EditorHasFreeSpace()) |
|
2290 |
{ |
|
2291 |
if (IsFlagSet(CAknFepManager::EFlagInsideMultitapInlineEditingTransaction)) |
|
2292 |
{ |
|
2293 |
iPtiEngine->CancelTimerActivity(); |
|
2294 |
} |
|
2295 |
if( EPtiCaseFnUpper == iPtiEngine->Case() || EPtiCaseFnLower == iPtiEngine->Case() ) |
|
2296 |
{ |
|
2297 |
FepUI()->HandleKeyL( EPtiKeyQwertyLeftShift, |
|
2298 |
EShortKeyPress ); |
|
2299 |
iFnCharInsertedForShift = ETrue; |
|
2300 |
} |
|
2301 |
} |
|
2302 |
#endif // Half Qwerty flag |
|
2303 |
#endif // ITI flag |
|
2304 |
||
2305 |
// Shift key is pressed down. |
|
2306 |
SetFlag(EFlagShiftKeyDepressed | EFlagNoActionDuringShiftKeyPress); |
|
2307 |
ClearFlag(EFlagNoActionDuringChrKeyPress); |
|
2308 |
if ( IsFlagSet(EFlagQwertyShiftMode) && IsFlagSet(EFlagNoActionDuringShiftKeyPress) ) |
|
2309 |
{ |
|
2310 |
ClearFlag(EFlagQwertyShiftMode | EFlagNoActionDuringShiftKeyPress); |
|
2311 |
// If long shift key press flag is set, then do not do manual case update. |
|
2312 |
if (!IsFlagSet(EFlagLongShiftKeyPress)) |
|
2313 |
{ |
|
2314 |
iCaseMan->ManualCaseUpdate(); |
|
2315 |
} |
|
2316 |
} |
|
2317 |
else |
|
2318 |
{ |
|
2319 |
if (!(iCurrentFepUI->IsValidShiftKeyPress())) |
|
2320 |
{ |
|
2321 |
return EKeyWasConsumed; |
|
2322 |
} |
|
2323 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2324 |
#ifdef __HALF_QWERTY_KEYPAD |
|
2325 |
if(!iFnCharInsertedForShift) |
|
2326 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
2327 |
#endif //__HALF_QWERTY_KEYPAD |
|
2328 |
{ |
|
2329 |
SetFlag(EFlagQwertyShiftMode); |
|
2330 |
} |
|
2331 |
||
2332 |
if(iShiftKeypressMonitor->IsActive()) |
|
2333 |
iShiftKeypressMonitor->Cancel(); |
|
2334 |
// Long press of shift key timer is activated. |
|
2335 |
iShiftKeypressMonitor->Start(EShiftKeyRepeatDelay, EShiftKeyRepeatDelay, |
|
2336 |
TCallBack(ResetShiftKeyMonitorCallback, this)); |
|
2337 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2338 |
// Shift kkey hack for GQF implementation. Need to check |
|
2339 |
// if it has any side effect. |
|
2340 |
if((iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyLock) |
|
2341 |
&& (iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyForced) |
|
2342 |
&& (iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyDown) |
|
2343 |
&& (iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyNext)) |
|
2344 |
#endif |
|
2345 |
UpdateIndicators(); |
|
2346 |
} |
|
2347 |
} |
|
2348 |
else if (aEventCode == EEventKeyUp) |
|
2349 |
{ |
|
2350 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2351 |
#ifdef __HALF_QWERTY_KEYPAD |
|
2352 |
if( ( EPtiKeyboardHalfQwerty == KeyboardLayout() && FepUI() ) && |
|
2353 |
iPtiEngine ) |
|
2354 |
{ |
|
2355 |
ClearCcpuFlag(ECcpuStateHashDown |
|
2356 |
| ECcpuStateHashKeyDeleteDone |
|
2357 |
| ECcpuStateChangeToPredictionMode); |
|
2358 |
if (IsCcpuFlagSet(ECcpuStateEdwinInSelectionMode)) |
|
2359 |
{ |
|
2360 |
SetCcpuFlag(ECcpuStateSelectionEventPosted); |
|
2361 |
ClearCcpuFlag(ECcpuStateEdwinInSelectionMode); |
|
2362 |
SetFlag(EFlagLongShiftKeyPress); |
|
2363 |
||
2364 |
TKeyEvent ccpuStart = {0, EStdKeyLeftShift, 0, 0}; |
|
2365 |
CCoeEnv::Static()->SimulateKeyEventL(ccpuStart, aEventCode); |
|
2366 |
} |
|
2367 |
if( CAknFepFnKeyManager::EFnKeyNone != FnKeyState()) |
|
2368 |
{ |
|
2369 |
ClearFlag(EFlagQwertyShiftMode); |
|
2370 |
} |
|
2371 |
// iFnCharInsertedForShift = EFalse; |
|
2372 |
} |
|
2373 |
||
2374 |
#endif // Half Qwerty flag |
|
2375 |
#endif // ITI flag |
|
2376 |
||
2377 |
ClearFlag(EFlagShiftKeyDepressed); |
|
2378 |
ClearCcpuFlag(ECcpuStateCbaShown); |
|
2379 |
if ( !IsFlagSet(EFlagNoActionDuringShiftKeyPress) || |
|
2380 |
(IsFlagSet(EFlagNoActionDuringShiftKeyPress) && IsFlagSet(EFlagLongShiftKeyPress)) ) |
|
2381 |
{ |
|
2382 |
ClearFlag(EFlagQwertyShiftMode); |
|
2383 |
} |
|
2384 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2385 |
#ifdef __HALF_QWERTY_KEYPAD |
|
2386 |
if( IsFlagSet(EFlagQwertyChrKeyDepressed) && IsFlagSet(EFlagNoActionDuringShiftKeyPress)) |
|
2387 |
{ |
|
2388 |
#ifdef FF_DUAL_LANGUAGE_SUPPORT |
|
2389 |
// Currently dual language feature would work correctly for ITUT and Half Qwerty products |
|
2390 |
// Hence the dual language settings should also be displayed only for ITUT and Halfqwerty products |
|
2391 |
if(iKeyboardType == EPtiKeyboardHalfQwerty ) |
|
2392 |
LaunchDualLanguageSettingDialogL(); |
|
2393 |
else |
|
2394 |
#endif //FF_DUAL_LANGUAGE_SUPPORT |
|
2395 |
LaunchLanguagesPopupListL(); |
|
2396 |
ClearFlag(EFlagQwertyChrKeyDepressed|EFlagNoActionDuringChrKeyPress|EFlagNoActionDuringShiftKeyPress); |
|
2397 |
} |
|
2398 |
||
2399 |
#ifdef __SHIFT_KEY_LOOP |
|
2400 |
if( KeyboardLayout() == EPtiKeyboardHalfQwerty && |
|
2401 |
// looping does not happen for long key press |
|
2402 |
!IsFlagSet(EFlagLongShiftKeyPress) && |
|
2403 |
// looping does not happen in functionized state |
|
2404 |
iFnKeyManager->FnKeyState() == CAknFepFnKeyManager::EFnKeyNone && |
|
2405 |
// looping happens only when no action |
|
2406 |
// has happened when the shift key has been pressed |
|
2407 |
IsFlagSet(EFlagNoActionDuringShiftKeyPress) && !iFnCharInsertedForShift ) |
|
2408 |
{ |
|
2409 |
HandleKeyEventL( EStdKeyLeftShift, EShortKeyPress ); |
|
2410 |
ClearFlag(EFlagQwertyShiftMode); |
|
2411 |
} |
|
2412 |
iFnCharInsertedForShift = EFalse; |
|
2413 |
#endif //__SHIFT_KEY_LOOP |
|
2414 |
#endif //__HALF_QWERTY_KEYPAD |
|
2415 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
2416 |
if (IsFlagSet(EFlagLongShiftKeyPress)) //long keypress up |
|
2417 |
{ |
|
2418 |
ClearFlag(EFlagLongShiftKeyPress); |
|
2419 |
} |
|
2420 |
else // short keypress up |
|
2421 |
{ |
|
2422 |
iShiftKeypressMonitor->Cancel(); |
|
2423 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2424 |
#ifdef __HALF_QWERTY_KEYPAD |
|
2425 |
#ifdef __SHIFT_KEY_LOOP |
|
2426 |
// Cancel multitap timer |
|
2427 |
||
2428 |
if( iPtiEngine != NULL ) |
|
2429 |
{ |
|
2430 |
iPtiEngine->CancelTimerActivity(); |
|
2431 |
} |
|
2432 |
#endif //__SHIFT_KEY_LOOP |
|
2433 |
#endif //__HALF_QWERTY_KEYPAD |
|
2434 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
2435 |
} |
|
2436 |
ClearFlag( EFlagNoActionDuringShiftKeyPress ); |
|
2437 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2438 |
// Shift kkey hack for GQF implementation. Need to check |
|
2439 |
// if it has any side effect. |
|
2440 |
if((iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyLock) |
|
2441 |
&& (iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyForced) |
|
2442 |
&& (iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyDown) |
|
2443 |
&&(iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyNext)) |
|
2444 |
#endif |
|
2445 |
UpdateIndicators(); |
|
2446 |
} |
|
2447 |
} |
|
2448 |
else |
|
2449 |
{ |
|
2450 |
if ( !iInputCapabilities.FepAwareTextEditor() && (!iCandidatePopup)) |
|
2451 |
{ |
|
2452 |
response = EKeyWasNotConsumed; |
|
2453 |
} |
|
2454 |
else if (aEventCode == EEventKeyDown) |
|
2455 |
{ |
|
2456 |
if (Japanese() && iInputCapabilities.FepAwareTextEditor()) |
|
2457 |
{ |
|
2458 |
if (!(iCurrentFepUI->IsValidShiftKeyPress())) |
|
2459 |
{ |
|
2460 |
return EKeyWasConsumed; |
|
2461 |
} |
|
2462 |
TryCloseUiL(); |
|
2463 |
} |
|
2464 |
||
2465 |
// Shift key is pressed down but no any other key is pressed. |
|
2466 |
ClearCcpuFlag(ECcpuSupressEditMenuFromShiftUp); |
|
2467 |
SetFlag(EFlagShiftKeyDepressed | EFlagNoActionDuringShiftKeyPress); |
|
2468 |
if ( !(iAknEditorFlags & EAknEditorFlagNoLRNavigation)) |
|
2469 |
{ |
|
2470 |
// Cancel the timer first if active. |
|
2471 |
// EEventKeyUp is not sent always for shift key during debugging on emulator. |
|
2472 |
iShiftKeypressMonitor->Cancel(); |
|
2473 |
// Long press of shift key timer is activated. |
|
2474 |
iShiftKeypressMonitor->Start(EShiftKeyRepeatDelay, EShiftKeyRepeatDelay, |
|
2475 |
TCallBack(ResetShiftKeyMonitorCallback, this)); |
|
2476 |
} |
|
2477 |
if ( IsFlagSet(EFlagInsideInlineEditingTransaction) && |
|
2478 |
WesternPredictive() && iFepManState == EAknFepStateUIActive ) |
|
2479 |
{ |
|
2480 |
TryRemoveNoMatchesIndicatorL(); |
|
2481 |
UpdateCbaL(NULL); |
|
2482 |
} |
|
2483 |
} |
|
2484 |
else if (aEventCode == EEventKeyUp) |
|
2485 |
{ |
|
2486 |
ClearFlag(EFlagShiftKeyDepressed); |
|
2487 |
ClearCcpuFlag(ECcpuStateCbaShown); |
|
2488 |
if (IsFlagSet(EFlagLongShiftKeyPress)) //long keypress up |
|
2489 |
{ |
|
2490 |
ClearFlag(EFlagLongShiftKeyPress | EFlagNoActionDuringShiftKeyPress); |
|
2491 |
// Shift long key press timer started, in between release of |
|
2492 |
// Shift key should cancel active long shift key timer. |
|
2493 |
iShiftKeypressMonitor->Cancel(); |
|
2494 |
if (!iInputCapabilities.FepAwareTextEditor()) |
|
2495 |
{ |
|
2496 |
TKeyEvent ccpuStart = {0, EStdKeyLeftShift, 0, 0}; |
|
2497 |
CCoeEnv::Static()->SimulateKeyEventL(ccpuStart, EEventKeyUp); |
|
2498 |
} |
|
2499 |
} |
|
2500 |
else // short keypress up |
|
2501 |
{ |
|
2502 |
iShiftKeypressMonitor->Cancel(); |
|
2503 |
if (!(iAknEditorFlags & EAknEditorFlagSupressShiftMenu) && |
|
2504 |
IsFlagSet(EFlagNoActionDuringShiftKeyPress) && //iCurrentFepUI->IsValidShiftKeyPress() && |
|
2505 |
!IsCcpuFlagSet(ECcpuSupressEditMenuFromShiftUp)) |
|
2506 |
{ |
|
2507 |
// Shift key is released before any other key is pressed. |
|
2508 |
// Edit menu is launched if it is allowed. |
|
2509 |
ClearFlag(EFlagNoActionDuringShiftKeyPress); |
|
2510 |
//Check if pointer event drag is not there before launch of edit menu. |
|
2511 |
if( !IsExtendedFlagSet(EExtendedFlagPointerEventTypeEDrag)) |
|
2512 |
{ |
|
2513 |
LaunchSelectModeMenuL(); |
|
2514 |
} |
|
2515 |
||
2516 |
if (iInputCapabilities.FepAwareTextEditor()) |
|
2517 |
{ |
|
2518 |
response = EKeyWasConsumed; |
|
2519 |
} |
|
2520 |
} |
|
2521 |
} |
|
2522 |
} |
|
2523 |
} |
|
2524 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2525 |
if (aEventCode == EEventKeyUp && |
|
2526 |
EPtiKeyboardQwerty4x10 == KeyboardLayout() && FepUI()) |
|
2527 |
{ |
|
2528 |
FepUI()->HandleKeyL(EKeyLeftShift, EShortKeyPress); |
|
2529 |
} |
|
2530 |
#endif |
|
2531 |
return response; |
|
2532 |
} |
|
2533 |
||
2534 |
TKeyResponse CAknFepManager::HandleThai0KeyEvent(TEventCode aEventCode, TKeyPressLength aLength, |
|
2535 |
TBool& aThai0KeyHandling) |
|
2536 |
{ |
|
2537 |
TKeyResponse response = EKeyWasNotConsumed; |
|
2538 |
aThai0KeyHandling = EFalse; |
|
2539 |
if(iQwertyInputMode) |
|
2540 |
{ |
|
2541 |
return response; |
|
2542 |
} |
|
2543 |
||
2544 |
if ( iLanguageCapabilities.iInputLanguageCode == ELangThai && |
|
2545 |
iMode != ENumber && iMode != ENativeNumber ) |
|
2546 |
{ |
|
2547 |
if (!IsPredictive()) |
|
2548 |
{ |
|
2549 |
if (aEventCode != EEventKeyUp) |
|
2550 |
{ |
|
2551 |
response = EKeyWasConsumed; |
|
2552 |
if ( aLength == ELongKeyPress) |
|
2553 |
{ |
|
2554 |
if (!iLongThai0Key) |
|
2555 |
{ |
|
2556 |
iLongThai0Key = ETrue; |
|
2557 |
response = EKeyWasNotConsumed; // 0 to editor |
|
2558 |
aThai0KeyHandling = ETrue; |
|
2559 |
} |
|
2560 |
} |
|
2561 |
} |
|
2562 |
||
2563 |
else if (aEventCode == EEventKeyUp) |
|
2564 |
{ |
|
2565 |
if (iLongThai0Key) |
|
2566 |
{ |
|
2567 |
iLongThai0Key = EFalse; |
|
2568 |
response = EKeyWasConsumed; |
|
2569 |
} |
|
2570 |
else |
|
2571 |
{ |
|
2572 |
response = EKeyWasNotConsumed; // Show Thai 0 key SCT |
|
2573 |
aThai0KeyHandling = ETrue; |
|
2574 |
} |
|
2575 |
} |
|
2576 |
} |
|
2577 |
} |
|
2578 |
return response; |
|
2579 |
} |
|
2580 |
||
2581 |
TBool CAknFepManager::HandleQwertyChrKeyEventL(TEventCode aEventCode) |
|
2582 |
{ |
|
2583 |
TBool response = EFalse; |
|
2584 |
if ( !iQwertyInputMode || !iInputCapabilities.FepAwareTextEditor() ) |
|
2585 |
{ |
|
2586 |
return response; |
|
2587 |
} |
|
2588 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2589 |
if(IsFlagSet(EFlagShiftKeyDepressed)) |
|
2590 |
{ |
|
2591 |
iKeyPressedDuringShift = ETrue; |
|
2592 |
} |
|
2593 |
#ifdef __HALF_QWERTY_KEYPAD |
|
2594 |
||
2595 |
if( (aEventCode == EEventKeyUp) ) |
|
2596 |
{ |
|
2597 |
ClearFlag(EFlagQwertyChrKeyDepressed); |
|
2598 |
} |
|
2599 |
// Handle shift for Half Qwerty seperately |
|
2600 |
if( ( EPtiKeyboardHalfQwerty == KeyboardLayout() && FepUI() ) && |
|
2601 |
iPtiEngine /*&& |
|
2602 |
( aEventCode == EEventKeyDown || aEventCode == EEventKeyUp ) */ && !IsFlagSet(EFlagShiftKeyDepressed)) |
|
2603 |
{ |
|
2604 |
||
2605 |
if( HandleChrKeyForHalfQwertyL(aEventCode) ) |
|
2606 |
{ |
|
2607 |
return ETrue; |
|
2608 |
} |
|
2609 |
} |
|
2610 |
#endif // Half Qwerty flag |
|
2611 |
// This part of code for error fixing. |
|
2612 |
// whenever fep is Fnupper state, press of "CHR" key |
|
2613 |
// always launch SCT table. |
|
2614 |
if( (iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyNone)&& |
|
2615 |
(IsFlagSet(EFlagQwertyShiftMode) || IsFlagSet(EFlagLongShiftKeyPress))) |
|
2616 |
{ |
|
2617 |
ClearFlag(EFlagNoActionDuringShiftKeyPress | EFlagLongShiftKeyPress | EFlagShiftKeyDepressed | EFlagQwertyShiftMode); |
|
2618 |
iShiftKeypressMonitor->Cancel(); |
|
2619 |
SetFlag(EFlagQwertyChrKeyDepressed | EFlagNoActionDuringChrKeyPress); |
|
2620 |
return response; |
|
2621 |
} |
|
2622 |
||
2623 |
||
2624 |
#endif // ITI flag |
|
2625 |
if (aEventCode == EEventKeyDown) |
|
2626 |
{ |
|
2627 |
SetFlag(EFlagQwertyChrKeyDepressed | EFlagNoActionDuringChrKeyPress); |
|
2628 |
response = EFalse; |
|
2629 |
||
2630 |
if (IsFeatureSupportedJapanese() || |
|
2631 |
( IsChineseInputLanguage() |
|
2632 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2633 |
&& KeyboardLayout() == EPtiKeyboardHalfQwerty |
|
2634 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
2635 |
) ) |
|
2636 |
{ |
|
2637 |
// start timer for Chr key long pressing |
|
2638 |
iChrKeypressMonitor->Start(EChrKeyRepeatDelay, EChrKeyRepeatDelay, |
|
2639 |
TCallBack(HandleChrKeyMonitorCallback, this)); |
|
2640 |
} |
|
2641 |
} |
|
2642 |
else if (aEventCode == EEventKeyUp) |
|
2643 |
{ |
|
2644 |
if (iChrKeypressMonitor->IsActive()) |
|
2645 |
{ |
|
2646 |
iChrKeypressMonitor->Cancel(); |
|
2647 |
} |
|
2648 |
||
2649 |
if (IsFlagSet(EFlagShiftKeyDepressed) && IsFlagSet(EFlagNoActionDuringChrKeyPress) |
|
2650 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2651 |
|| |
|
2652 |
IsFlagSet(EFlagQwertyShiftMode) |
|
2653 |
#endif |
|
2654 |
) |
|
2655 |
{ |
|
2656 |
ClearFlag(EFlagNoActionDuringShiftKeyPress | EFlagLongShiftKeyPress | |
|
2657 |
EFlagShiftKeyDepressed | EFlagQwertyShiftMode |EFlagQwertyChrKeyDepressed); |
|
2658 |
iShiftKeypressMonitor->Cancel(); |
|
2659 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2660 |
iKeyPressedDuringShift = EFalse; |
|
2661 |
#endif |
|
2662 |
UpdateIndicators(); |
|
2663 |
// In Japanese variant, the selecting input language is unnecessary. |
|
2664 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2665 |
if (EPtiKeyboardQwerty4x10 == KeyboardLayout() || EPtiKeyboardHalfQwerty == KeyboardLayout()) |
|
2666 |
{ |
|
2667 |
if (!IsFeatureSupportedJapanese() && iCurrentFepUI->IsValidShiftKeyPress()) |
|
2668 |
{ |
|
2669 |
#ifdef FF_DUAL_LANGUAGE_SUPPORT |
|
2670 |
// Currently dual language feature would work correctly for ITUT and Half Qwerty products |
|
2671 |
// Hence the dual language settings should also be displayed only for ITUT and Halfqwerty products |
|
2672 |
if(iKeyboardType == EPtiKeyboard12Key || iKeyboardType == EPtiKeyboardHalfQwerty ) |
|
2673 |
LaunchDualLanguageSettingDialogL(); |
|
2674 |
else |
|
2675 |
#endif //FF_DUAL_LANGUAGE_SUPPORT |
|
2676 |
LaunchLanguagesPopupListL(); |
|
2677 |
} |
|
2678 |
} |
|
2679 |
else |
|
2680 |
{ |
|
2681 |
#endif |
|
2682 |
if (!IsFeatureSupportedJapanese() && iCurrentFepUI->IsValidShiftKeyPress()) |
|
2683 |
{ |
|
2684 |
LaunchLanguagesPopupListL(); |
|
2685 |
} |
|
2686 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2687 |
} |
|
2688 |
#endif |
|
2689 |
} |
|
2690 |
else if (IsFlagSet(EFlagNoActionDuringChrKeyPress)) |
|
2691 |
{ |
|
2692 |
// pass key to Chinese UI manager in Chinese qwerty input for sct table |
|
2693 |
if(IsChineseInputLanguage() && iMode != ELatin) |
|
2694 |
{ |
|
2695 |
FepUI()->HandleKeyL(EStdKeyLeftFunc, EShortKeyPress); |
|
2696 |
ClearFlag( EFlagQwertyChrKeyDepressed | EFlagNoActionDuringChrKeyPress ); |
|
2697 |
} |
|
2698 |
else if (Japanese()) |
|
2699 |
{ |
|
2700 |
if (iMode != EHiragana) |
|
2701 |
{ |
|
2702 |
// Commit characters |
|
2703 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2704 |
// Set the iSupressCursorMoveToEndChrKeyPressed when cursor is in |
|
2705 |
// between two words and SCT is launched |
|
2706 |
iSupressCursorMoveToEndChrKeyPressed = ETrue; |
|
2707 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
2708 |
HandleChangeInFocus(); |
|
2709 |
LaunchSpecialCharacterTableL(); |
|
2710 |
} |
|
2711 |
} |
|
2712 |
else if ( IsAbleToLaunchSCT() ) |
|
2713 |
{ |
|
2714 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2715 |
// Set the iSupressCursorMoveToEndChrKeyPressed when cursor is in |
|
2716 |
// between two words and SCT is launched |
|
2717 |
iSupressCursorMoveToEndChrKeyPressed = ETrue; |
|
2718 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
2719 |
HandleChangeInFocus(); |
|
2720 |
LaunchSpecialCharacterTableL(); |
|
2721 |
} |
|
2722 |
else if(IsFlagSet(EFlagQwertyChrKeyDepressed)) |
|
2723 |
{ |
|
2724 |
ClearFlag(EFlagQwertyChrKeyDepressed); |
|
2725 |
} |
|
2726 |
} |
|
2727 |
else |
|
2728 |
{ |
|
2729 |
FepUI()->ExpireMultitapTimer(); |
|
2730 |
ClearFlag(EFlagQwertyChrKeyDepressed | EFlagNoActionDuringChrKeyPress); |
|
2731 |
||
2732 |
response = ETrue; |
|
2733 |
} |
|
2734 |
} |
|
2735 |
return response; |
|
2736 |
} |
|
2737 |
||
2738 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2739 |
#ifdef __HALF_QWERTY_KEYPAD |
|
2740 |
TKeyResponse CAknFepManager::HandleChrKeyForHalfQwertyL( TEventCode aEventCode) |
|
2741 |
{ |
|
2742 |
if ((IsFlagSet(CAknFepManager::EFlagInsideMultitapInlineEditingTransaction)) && !(EPtiCaseFnUpper == iPtiEngine->Case() || EPtiCaseFnLower == iPtiEngine->Case())) |
|
2743 |
{ |
|
2744 |
iPtiEngine->CancelTimerActivity(); |
|
2745 |
} |
|
2746 |
// in functionized mode the chr key is mapped to specific chars |
|
2747 |
// and should therefore be handled by the states |
|
2748 |
if ( EPtiCaseFnUpper == iPtiEngine->Case() || EPtiCaseFnLower == iPtiEngine->Case() || IsReverseFnkeyInput()) |
|
2749 |
{ |
|
2750 |
if( aEventCode == EEventKeyDown && ( EditorHasFreeSpace() || |
|
2751 |
IsFlagSet( EFlagInsideMultitapInlineEditingTransaction ))) |
|
2752 |
{ |
|
2753 |
FepUI()->HandleKeyL( EStdKeyLeftFunc, |
|
2754 |
EShortKeyPress ); |
|
2755 |
} |
|
2756 |
return EKeyWasConsumed; |
|
2757 |
} |
|
2758 |
// in non-functionized predictive mode, |
|
2759 |
// a long key press of the chr key should produce the SCT |
|
2760 |
// a short key press should produce the candidate list |
|
2761 |
if ( ( iWesternPredictive || IsChineseInputLanguage() ) /*&& |
|
2762 |
( iMode != EPinyin && iMode != EStroke && iMode != EZhuyin )*/ ) |
|
2763 |
{ |
|
2764 |
||
2765 |
if(!iChrKeypressMonitor->IsActive()) |
|
2766 |
{ |
|
2767 |
// this monitors long key presses of chr key |
|
2768 |
// the framework does not give us the iRepeats info |
|
2769 |
// for chr key for some reason |
|
2770 |
iChrKeypressMonitor->Start(EHalfQwertyChrKeyRepeatDelay, EHalfQwertyChrKeyRepeatDelay, |
|
2771 |
TCallBack(HandleChrKeyMonitorCallback, this)); |
|
2772 |
} |
|
2773 |
||
2774 |
if( aEventCode != EEventKeyUp ) |
|
2775 |
{ |
|
2776 |
SetFlag( EFlagQwertyChrKeyDepressed | EFlagNoActionDuringChrKeyPress); |
|
2777 |
return EKeyWasConsumed; |
|
2778 |
} |
|
2779 |
||
2780 |
if ( aEventCode == EEventKeyUp && IsFlagSet(EFlagNoActionDuringChrKeyPress) ) |
|
2781 |
{ |
|
2782 |
if(!iChrLongKeyPress ) |
|
2783 |
{ |
|
2784 |
// if we have come here it's a short press |
|
2785 |
// the flag EFlagNoActionDuringChrKeyPress is cleared in the timer callback |
|
2786 |
if(!IsFlagSet(CAknFepManager::EFlagInsideInlineEditingTransaction) || IsFlagSet(CAknFepManager::EFlagInsideMultitapInlineEditingTransaction)) |
|
2787 |
{ |
|
2788 |
// when not in inline editing mode, |
|
2789 |
// chr key should produce the SCT |
|
2790 |
if ( !IsChineseInputLanguage() ) |
|
2791 |
{ |
|
2792 |
LaunchSpecialCharacterTableL(); |
|
2793 |
} |
|
2794 |
else |
|
2795 |
{ |
|
2796 |
FepUI()->HandleKeyL( EStdKeyLeftFunc, |
|
2797 |
EShortKeyPress ); |
|
2798 |
} |
|
2799 |
} |
|
2800 |
ClearFlag( EFlagQwertyChrKeyDepressed | EFlagNoActionDuringChrKeyPress); |
|
2801 |
||
2802 |
iChrKeypressMonitor->Cancel(); |
|
2803 |
||
2804 |
TInt wordToFocus = KWordToFocusInCandidateList; |
|
2805 |
TInt numberOfCandidates = iPtiEngine->NumberOfCandidates(); |
|
2806 |
if (numberOfCandidates > 1) |
|
2807 |
{ |
|
2808 |
wordToFocus = KWordToFocusInCandidateList; |
|
2809 |
} |
|
2810 |
LaunchCandidatePopupListL(wordToFocus); |
|
2811 |
||
2812 |
return EKeyWasConsumed; |
|
2813 |
} |
|
2814 |
else |
|
2815 |
{ |
|
2816 |
||
2817 |
||
2818 |
// Cancel the timer |
|
2819 |
iChrKeypressMonitor->Cancel(); |
|
2820 |
||
2821 |
// commit the characters |
|
2822 |
HandleChangeInFocus(); |
|
2823 |
||
2824 |
// Clear the chr key depressed flag |
|
2825 |
ClearFlag( EFlagQwertyChrKeyDepressed | EFlagNoActionDuringChrKeyPress); |
|
2826 |
// launch the special character table |
|
2827 |
iChrLongKeyPress = EFalse; |
|
2828 |
||
2829 |
if ( IsAbleToLaunchSCT() ) |
|
2830 |
{ |
|
2831 |
LaunchSpecialCharacterTableL(); |
|
2832 |
} |
|
2833 |
||
2834 |
return EKeyWasConsumed; |
|
2835 |
} |
|
2836 |
} |
|
2837 |
else |
|
2838 |
{ |
|
2839 |
return EKeyWasNotConsumed; |
|
2840 |
} |
|
2841 |
} |
|
2842 |
return EKeyWasNotConsumed; |
|
2843 |
} |
|
2844 |
#endif //__HALF_QWERTY_KEYPAD |
|
2845 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
2846 |
||
2847 |
TKeyResponse CAknFepManager::HandleQwertyControlKeyEventL(const TKeyEvent& aKeyEvent, |
|
2848 |
TEventCode aEventCode) |
|
2849 |
{ |
|
2850 |
TKeyResponse response = EKeyWasConsumed; |
|
2851 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2852 |
if (EPtiKeyboardQwerty4x10 == KeyboardLayout()) |
|
2853 |
{ |
|
2854 |
if( iCurrentFepUI && !iCurrentFepUI->IsValidShiftKeyPress() && aEventCode == EEventKeyUp ) |
|
2855 |
{ |
|
2856 |
FepUI()->HandleKeyL(EKeyLeftCtrl, EShortKeyPress); |
|
2857 |
return EKeyWasConsumed; |
|
2858 |
} |
|
2859 |
} |
|
2860 |
#endif |
|
2861 |
||
2862 |
// need to ignore [Ctrl] + the following simbol keys |
|
2863 |
// because FEP doesn't consume [Ctrl] combination keys. |
|
2864 |
if (Japanese() && aEventCode == EEventKey) |
|
2865 |
{ |
|
2866 |
TBool comsume = EFalse; |
|
2867 |
switch (aKeyEvent.iScanCode) |
|
2868 |
{ |
|
2869 |
case EStdKeyNkpPlus: |
|
2870 |
case EPtiKeyQwertyPlus: |
|
2871 |
case EPtiKeyQwertyMinus: |
|
2872 |
case EPtiKeyQwertyComma: |
|
2873 |
case EPtiKeyQwertySemicolon: |
|
2874 |
case EPtiKeyQwertyFullstop: |
|
2875 |
case EPtiKeyQwertyHash: |
|
2876 |
case EPtiKeyQwertySlash: |
|
2877 |
case EPtiKeyQwertyApostrophe: |
|
2878 |
case EPtiKeyQwertySpace: |
|
2879 |
comsume = ETrue; |
|
2880 |
break; |
|
2881 |
default: |
|
2882 |
break; |
|
2883 |
} |
|
2884 |
if (comsume) |
|
2885 |
{ |
|
2886 |
return EKeyWasConsumed; |
|
2887 |
} |
|
2888 |
} |
|
2889 |
||
2890 |
#ifdef RD_SCALABLE_UI_V2 |
|
2891 |
if (aKeyEvent.iModifiers & EModifierCtrl |
|
2892 |
&& (aKeyEvent.iScanCode == EPtiKeyQwertyC || aKeyEvent.iScanCode == EPtiKeyQwertyV || |
|
2893 |
aKeyEvent.iScanCode == EPtiKeyQwertyX)) |
|
2894 |
{ |
|
2895 |
SendEventsToPluginManL( EPluginSyncFepAwareText ); |
|
2896 |
// Let copy / cut / paste events to flow through. |
|
2897 |
response = EKeyWasNotConsumed; |
|
2898 |
} |
|
2899 |
#endif |
|
2900 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2901 |
// Predictive QWERTY (XT9) changes ----> |
|
2902 |
// Ctrl combinations which affect the editor state, must commit the current inline edit. |
|
2903 |
// Otherwise the currently active inline word might be lost. |
|
2904 |
if ( iWesternPredictive && iQwertyInputMode && IsFlagSet(EFlagInsideInlineEditingTransaction) ) |
|
2905 |
{ |
|
2906 |
switch (aKeyEvent.iScanCode) |
|
2907 |
{ |
|
2908 |
case EStdKeyUpArrow: |
|
2909 |
case EStdKeyDownArrow: |
|
2910 |
case EStdKeyLeftArrow: |
|
2911 |
case EStdKeyRightArrow: |
|
2912 |
case EPtiKeyQwertyC: |
|
2913 |
case EPtiKeyQwertyV: |
|
2914 |
case EPtiKeyQwertyX: |
|
2915 |
case EPtiKeyQwertyA: |
|
2916 |
iPtiEngine->CommitCurrentWord(); |
|
2917 |
TryCloseUiL(); |
|
2918 |
break; |
|
2919 |
default: |
|
2920 |
break; |
|
2921 |
} |
|
2922 |
} |
|
2923 |
// Predictive QWERTY (XT9) changes <---- |
|
2924 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
2925 |
||
2926 |
if (aEventCode != EEventKeyUp) |
|
2927 |
{ |
|
2928 |
return EKeyWasNotConsumed; |
|
2929 |
} |
|
2930 |
||
2931 |
if(iQwertyInputMode) |
|
2932 |
{ |
|
2933 |
||
2934 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2935 |
// Query ptiEngine to know if the scancode maps to EPtiKeyQwertyC, |
|
2936 |
// EPtiKeyQwertyV or EPtiKeyQwertyX. |
|
2937 |
// we should not always rely on scancode as products may change it, while |
|
2938 |
// still having the 'C', 'V' and 'X' mappings |
|
2939 |
||
2940 |
TBuf<32> mapData; |
|
2941 |
iPtiEngine->MappingDataForKey((TPtiKey)aKeyEvent.iScanCode, mapData, EPtiCaseUpper); |
|
2942 |
||
2943 |
if( mapData.Length() > 0 ) |
|
2944 |
{ |
|
2945 |
if( mapData[0] == EPtiKeyQwertyC || mapData[0] == EPtiKeyQwertyV || |
|
2946 |
mapData[0] == EPtiKeyQwertyX ) |
|
2947 |
{ |
|
2948 |
// Let copy / cut / paste events to flow through. |
|
2949 |
response = EKeyWasNotConsumed; |
|
2950 |
} |
|
2951 |
} |
|
2952 |
#else |
|
2953 |
if (aKeyEvent.iScanCode == EPtiKeyQwertyC || aKeyEvent.iScanCode == EPtiKeyQwertyV || |
|
2954 |
aKeyEvent.iScanCode == EPtiKeyQwertyX) |
|
2955 |
{ |
|
2956 |
// Let copy / cut / paste events to flow through. |
|
2957 |
response = EKeyWasNotConsumed; |
|
2958 |
} |
|
2959 |
#endif |
|
2960 |
||
2961 |
||
2962 |
if (aKeyEvent.iScanCode == EStdKeyRightShift || aKeyEvent.iScanCode == EStdKeyLeftShift |
|
2963 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
2964 |
|| |
|
2965 |
IsFlagSet(EFlagQwertyShiftMode) |
|
2966 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
2967 |
) |
|
2968 |
{ |
|
2969 |
if(!iInputCapabilities.FepAwareTextEditor()) |
|
2970 |
{ |
|
2971 |
response = EKeyWasNotConsumed; |
|
2972 |
} |
|
2973 |
else |
|
2974 |
{ |
|
2975 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
2976 |
if ( iMode != ENumber && iMode!= ENativeNumber ) |
|
2977 |
{ |
|
2978 |
iModeBefore = iMode; |
|
2979 |
} |
|
2980 |
#ifdef RD_HINDI_PHONETIC_INPUT |
|
2981 |
||
2982 |
if(iSharedDataInterface->InputTextLanguage() == KLangHindiPhonetic) |
|
2983 |
{ |
|
2984 |
TryChangePhoneticModeL(); |
|
2985 |
} |
|
2986 |
else |
|
2987 |
{ |
|
2988 |
#endif |
|
2989 |
if((!(IsOnlyNumericPermitted() || |
|
2990 |
(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly))) && |
|
2991 |
TAknFepUiIndicInputManager::IsIndicLangauge( |
|
2992 |
(TLanguage)iSharedDataInterface->InputTextLanguage())) |
|
2993 |
{ |
|
2994 |
if(iLanguageCapabilities.iInputLanguageCode == ELangEnglish) |
|
2995 |
{ |
|
2996 |
ChangeInputLanguageL(iSharedDataInterface->InputTextLanguage()); |
|
2997 |
} |
|
2998 |
else |
|
2999 |
{ |
|
3000 |
ChangeInputLanguageL(ELangEnglish); |
|
3001 |
} |
|
3002 |
} |
|
3003 |
else |
|
3004 |
{ |
|
3005 |
TryIncrementModeChineseQwertyL(iMode); |
|
3006 |
} |
|
3007 |
#ifdef RD_HINDI_PHONETIC_INPUT |
|
3008 |
} |
|
3009 |
#endif |
|
3010 |
} |
|
3011 |
ClearFlag(EFlagShiftKeyDepressed); |
|
3012 |
if ( !IsFlagSet(EFlagNoActionDuringShiftKeyPress) || |
|
3013 |
(IsFlagSet(EFlagNoActionDuringShiftKeyPress) && IsFlagSet(EFlagLongShiftKeyPress)) ) |
|
3014 |
{ |
|
3015 |
ClearFlag(EFlagQwertyShiftMode); |
|
3016 |
} |
|
3017 |
if (IsFlagSet(EFlagLongShiftKeyPress)) //long keypress up |
|
3018 |
{ |
|
3019 |
ClearFlag(EFlagLongShiftKeyPress); |
|
3020 |
} |
|
3021 |
else // short keypress up |
|
3022 |
{ |
|
3023 |
iShiftKeypressMonitor->Cancel(); |
|
3024 |
} |
|
3025 |
ClearFlag( EFlagNoActionDuringShiftKeyPress ); |
|
3026 |
UpdateIndicators(); |
|
3027 |
} |
|
3028 |
else if(aKeyEvent.iScanCode == EStdKeySpace) // switch between last used Chinese input mode and English |
|
3029 |
{ |
|
3030 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3031 |
// Predictive QWERTY (XT9) changes ----> |
|
3032 |
// Toggle the predictive mode with ctrl+space |
|
3033 |
if ( (iPermittedInputModes & EAknEditorTextInputMode) && |
|
3034 |
!(iAknEditorFlags & EAknEditorFlagNoT9) && |
|
3035 |
iMode == ELatin && |
|
3036 |
iLanguageCapabilities.iSupportsWesternQwertyPredictive ) |
|
3037 |
{ |
|
3038 |
if (iWesternPredictive) |
|
3039 |
{ |
|
3040 |
//ProcessCommandL(EAknCmdT9PredictiveT9Off); |
|
3041 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
3042 |
//HandleChangeInFocus(); |
|
3043 |
if (iMode != ELatin) |
|
3044 |
{ |
|
3045 |
TryChangeModeL(ELatin); |
|
3046 |
} |
|
3047 |
else |
|
3048 |
{ |
|
3049 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3050 |
RemoveSuggestedAdvanceCompletionL(); |
|
3051 |
#endif // RD_INTELLIGENT_TEXT_INPUT |
|
3052 |
CommitInlineEditL(); |
|
3053 |
} |
|
3054 |
SetCcpuFlag(ECcpuStataCommitPredictiveWord); |
|
3055 |
SetWesternPredictive(EFalse); |
|
3056 |
HandleChangeInFocus(); |
|
3057 |
} |
|
3058 |
else |
|
3059 |
{ |
|
3060 |
//ProcessCommandL(EAknCmdMultitapPredictiveT9On); |
|
3061 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
3062 |
//HandleChangeInFocus(); |
|
3063 |
SetWesternPredictive(ETrue); |
|
3064 |
TryCloseUiL(); |
|
3065 |
TryChangeModeL(ELatin); |
|
3066 |
} |
|
3067 |
// Reset the function key state,if predictive mode is cahnged. |
|
3068 |
if (iFnKeyManager) |
|
3069 |
{ |
|
3070 |
iFnKeyManager->ClearFnKeyState(); |
|
3071 |
} |
|
3072 |
} |
|
3073 |
else // Predictive QWERTY (XT9) changes <---- |
|
3074 |
{ |
|
3075 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
3076 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
3077 |
if(iMode != iModeBefore && iMode != ENumber && iMode != ENativeNumber ) |
|
3078 |
{ |
|
3079 |
TInt mode = iMode; |
|
3080 |
if(iMode != ELatin && iModeBefore != ELatin) // more than one Chinese input modes |
|
3081 |
{ |
|
3082 |
TryChangeModeL(ELatin); |
|
3083 |
} |
|
3084 |
else |
|
3085 |
{ |
|
3086 |
TryChangeToModeBeforeL(); |
|
3087 |
} |
|
3088 |
iModeBefore = mode; // deposit previous input mode |
|
3089 |
} |
|
3090 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3091 |
} |
|
3092 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
3093 |
} |
|
3094 |
#ifdef RD_INTELLIGENT_TEXT_INPUT //// Predictive QWERTY (XT9) changes: open the edit menu with Fn+space ----> |
|
3095 |
else if (aKeyEvent.iScanCode == EStdKeyLeftFunc) |
|
3096 |
{ |
|
3097 |
LaunchSelectModeMenuL(); |
|
3098 |
} // Predictive QWERTY (XT9) changes <---- |
|
3099 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
3100 |
} |
|
3101 |
||
3102 |
if (IsCcpuFlagSet(ECcpuStatePosted)) |
|
3103 |
{ |
|
3104 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3105 |
// Query ptiEngine to know if the scancode maps to EPtiKeyQwertyC, |
|
3106 |
// EPtiKeyQwertyV or EPtiKeyQwertyX. |
|
3107 |
// we should not always rely on scancode as products may change it, while |
|
3108 |
// still having the 'C', 'V' and 'X' mappings |
|
3109 |
||
3110 |
TBuf<32> mapData; |
|
3111 |
iPtiEngine->MappingDataForKey((TPtiKey)aKeyEvent.iScanCode, mapData, EPtiCaseUpper); |
|
3112 |
||
3113 |
if( mapData.Length() > 0 ) |
|
3114 |
{ |
|
3115 |
if( mapData[0] == EPtiKeyQwertyC || mapData[0] == EPtiKeyQwertyX ) |
|
3116 |
{ |
|
3117 |
// Let copy / cut events to flow through. |
|
3118 |
response = EKeyWasNotConsumed; |
|
3119 |
} |
|
3120 |
} |
|
3121 |
#else |
|
3122 |
if (aKeyEvent.iScanCode == EPtiKeyQwertyC || aKeyEvent.iScanCode == EPtiKeyQwertyX) |
|
3123 |
{ |
|
3124 |
// Let copy / cut events to flow through. |
|
3125 |
response = EKeyWasNotConsumed; |
|
3126 |
} |
|
3127 |
#endif |
|
3128 |
ResetCcpuFlags(); |
|
3129 |
} |
|
3130 |
||
3131 |
/* if (EPtiKeyboardQwerty4x10 == KeyboardLayout()) |
|
3132 |
{ |
|
3133 |
FepUI()->HandleKeyL(EKeyLeftCtrl, EShortKeyPress); |
|
3134 |
}*/ |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3135 |
|
44 | 3136 |
//The default value of response is EKeyWasConsumed. So in some case, fep don¡¯t |
3137 |
//do anything, but it return Consumed. |
|
3138 |
//This make app miss the event EEventKeyUp. |
|
3139 |
//As per the logic of the function, the combine about ctrl key including: |
|
3140 |
// Ctrl key + C; Ctrl key + V; Ctrl + X |
|
3141 |
// Ctrl key + Shift key |
|
3142 |
// Ctrl key + space |
|
3143 |
// Ctrl key + Function key |
|
3144 |
//In above cases, it return EKeyWasConsumed, it is correct. |
|
3145 |
//The function for Ctrl Key as pressing the only one key ctrl at one time is to |
|
3146 |
//do something if the flag EFlagQwertyShiftMode is set |
|
3147 |
//In this case, it return EKeyWasConsumed, it is correct. |
|
3148 |
//In other case, it should return EKeyWasNotConsumed |
|
3149 |
if( ( aKeyEvent.iScanCode == EStdKeyRightCtrl || aKeyEvent.iScanCode==EStdKeyLeftCtrl ) |
|
3150 |
&& !IsFlagSet(EFlagQwertyShiftMode) ) |
|
3151 |
{ |
|
3152 |
response = EKeyWasNotConsumed; |
|
3153 |
} |
|
3154 |
||
3155 |
return response; |
|
3156 |
} |
|
3157 |
||
3158 |
TBool CAknFepManager::HandleQwertyKeyEventL(const TKeyEvent& aKeyEvent, TKeyResponse& aResponse) |
|
3159 |
{ |
|
3160 |
TBool keyHandled = EFalse; |
|
3161 |
aResponse = EKeyWasNotConsumed; |
|
3162 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3163 |
if(iKeyBackSpaceHit && (EKeyBackspace != aKeyEvent.iCode || EStdKeyBackspace != aKeyEvent.iScanCode)) |
|
3164 |
iKeyBackSpaceHit = 0; |
|
3165 |
||
3166 |
if(IsMfneEditor()) |
|
3167 |
{ |
|
3168 |
// multi-field editors need the key event to be sent to them directly |
|
3169 |
// therefore not consuming it here |
|
3170 |
return EFalse; |
|
3171 |
} |
|
3172 |
||
3173 |
if(IsFlagSet(EFlagShiftKeyDepressed)) |
|
3174 |
{ |
|
3175 |
iKeyPressedDuringShift = ETrue; |
|
3176 |
} |
|
3177 |
// This part of code for error fixing |
|
3178 |
// After short pressing of Fn/shift, if user press enter key, delete key |
|
3179 |
// it will reset the shift key and Fn key state. |
|
3180 |
if( EKeyEnter == aKeyEvent.iCode || EStdKeyEnter == aKeyEvent.iScanCode|| |
|
3181 |
EKeyBackspace == aKeyEvent.iCode || EStdKeyBackspace == aKeyEvent.iScanCode) |
|
3182 |
{ |
|
3183 |
// if the shift key is still depressed, |
|
3184 |
// don't clear the qwerty shift mode |
|
3185 |
if(!IsFlagSet(EFlagShiftKeyDepressed)) |
|
3186 |
ClearFlag(EFlagQwertyShiftMode); |
|
3187 |
if( iFnKeyManager->FnKeyState() == CAknFepFnKeyManager::EFnKeyNext ) |
|
3188 |
{ |
|
3189 |
iFnKeyManager->ClearFnKeyState(); |
|
3190 |
} |
|
3191 |
} |
|
3192 |
#endif |
|
3193 |
||
3194 |
if ( iQwertyInputMode && |
|
3195 |
( EditorHasFreeSpace() || |
|
3196 |
#ifdef __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__ |
|
3197 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3198 |
KeyEventWillReplaceCharacter( aKeyEvent ) || |
|
3199 |
#endif // RD_INTELLIGENT_TEXT_INPUT |
|
3200 |
#endif // __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__ |
|
3201 |
( Japanese() && iFepManState == EAknFepStateUIActive ) ) ) |
|
3202 |
{ |
|
3203 |
if (IsFlagSet(EFlagPassNextKey)) |
|
3204 |
{ |
|
3205 |
#ifdef __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__ |
|
3206 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3207 |
// Don't clear the pass next flag yet on the simulated "rollback key" |
|
3208 |
// used with secret editors, the actual key code to be entered to the |
|
3209 |
// editor will follow next. |
|
3210 |
if ( aKeyEvent.iCode != EKeyF20 ) |
|
3211 |
#endif // RD_INTELLIGENT_TEXT_INPUT |
|
3212 |
#endif // __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__ |
|
3213 |
ClearFlag(EFlagPassNextKey); |
|
3214 |
return ETrue; |
|
3215 |
} |
|
3216 |
||
3217 |
TInt keyScanCode = aKeyEvent.iScanCode; |
|
3218 |
#if defined(__WINS__) |
|
3219 |
if ( keyScanCode == EStdKeyNkpPlus ) |
|
3220 |
{ |
|
3221 |
// Workaround solution for the qwerty '+' key in emulator environment. |
|
3222 |
// I did not find a way how to to configure epoc_352x416_Qwerty.ini to send '+' keyevent. |
|
3223 |
keyScanCode = 0x2b; // '+' key. |
|
3224 |
} |
|
3225 |
#endif |
|
3226 |
TBool phoneIdle = (EditorType() == CAknExtendedInputCapabilities::EPhoneNumberEditor); |
|
3227 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3228 |
TInt keyLayout =iSharedDataInterface->KeyboardLayout(); |
|
3229 |
if (IsOnlyNumericPermitted() && phoneIdle && |
|
3230 |
#ifdef __REVERSE_FN_KEY_SUPPORTED |
|
3231 |
!iIsReverseFnkeyInput && |
|
3232 |
#endif |
|
3233 |
(keyLayout != EPtiKeyboardHalfQwerty )) |
|
3234 |
#else |
|
3235 |
if (IsOnlyNumericPermitted() && phoneIdle) |
|
3236 |
#endif |
|
3237 |
{ |
|
3238 |
return ETrue; |
|
3239 |
} |
|
3240 |
//if this SpecialNumeric editor, do not consume event. |
|
3241 |
if (IsOnlyNumericPermitted() && IsSpecialNumericEditor()) |
|
3242 |
{ |
|
3243 |
return EFalse; |
|
3244 |
} |
|
3245 |
||
3246 |
||
3247 |
#ifdef FF_HOME_SCREEN_EASY_DIALING |
|
3248 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3249 |
||
3250 |
// This piece of code part of error fixing |
|
3251 |
// The Fep will insert the char, if Phone application launch the |
|
3252 |
// Phone number acquire editor in idle mode |
|
3253 |
// Specially Fep does not maintain Fn key state for non Fepware editor. |
|
3254 |
// So, Intermediate state of FnKey like FnNext will not work |
|
3255 |
// Hold on Fn key modify the modifier of of key event. |
|
3256 |
const TBool fnDown = (aKeyEvent.iModifiers & EModifierRightFunc); |
|
3257 |
if( phoneIdle && fnDown && iFnKeyManager ) |
|
3258 |
{ |
|
3259 |
iFnKeyManager->SetFnKeyState(CAknFepFnKeyManager::EFnKeyDown); |
|
3260 |
SetCase((TCase)EFnKeyLowerCase); |
|
3261 |
} |
|
3262 |
#endif // RD_INTELLIGENT_TEXT_INPUT |
|
3263 |
#endif // FF_HOME_SCREEN_EASY_DIALING |
|
3264 |
||
3265 |
||
3266 |
const TBool shifted = (aKeyEvent.iModifiers & (EModifierLeftShift | |
|
3267 |
EModifierRightShift | EModifierShift)); |
|
3268 |
||
3269 |
// This is needed for forcing shif state if this is the first key press in |
|
3270 |
// phone idle. |
|
3271 |
if (shifted && phoneIdle) |
|
3272 |
{ |
|
3273 |
SetFlag(EFlagQwertyShiftMode); |
|
3274 |
} |
|
3275 |
||
3276 |
||
3277 |
if (aKeyEvent.iRepeats == 1) |
|
3278 |
{ |
|
3279 |
iKeyRepeat = ELongKeyPress; |
|
3280 |
} |
|
3281 |
else |
|
3282 |
{ |
|
3283 |
iKeyRepeat = EShortKeyPress; |
|
3284 |
} |
|
3285 |
||
3286 |
if ( IsFlagSet(EFlagShiftKeyDepressed) && |
|
3287 |
IsChineseInputLanguage() && |
|
3288 |
keyScanCode == EPtiKeyQwertySpace) |
|
3289 |
{ |
|
3290 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
3291 |
ClearFlag(EFlagQwertyShiftMode); |
|
3292 |
ClearFlag(EFlagLongShiftKeyPress); |
|
3293 |
SetChangeModeByShiftAndSpace( ETrue ); |
|
3294 |
TryIncrementChineseModeForQwertyL(iMode); |
|
3295 |
keyHandled = ETrue; |
|
3296 |
} |
|
3297 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3298 |
else |
|
3299 |
{ |
|
3300 |
if(iKeyRepeat == ELongKeyPress && iPtiEngine->CurrentWord().Length() == EMaximumFepWordLength) |
|
3301 |
{ |
|
3302 |
keyHandled = ETrue; |
|
3303 |
} |
|
3304 |
else |
|
3305 |
{ |
|
3306 |
keyHandled = FepUI()->HandleKeyL(keyScanCode, iKeyRepeat); |
|
3307 |
if( EPtiKeyboardHalfQwerty == KeyboardLayout() |
|
3308 |
&& iWesternPredictive |
|
3309 |
&& iCaseMan->CurrentCase() != EAknEditorUpperCase ) |
|
3310 |
{ |
|
3311 |
ClearFlag(CAknFepManager::EFlagChangeInputMode); |
|
3312 |
} |
|
3313 |
if ( keyHandled && iFepManState == EAknFepStateUIActive |
|
3314 |
&& (iMode == EPinyin || iMode == EZhuyin || iMode == EStroke || iMode == ECangJie) ) |
|
3315 |
{ |
|
3316 |
if ( EditorState() ) |
|
3317 |
{ |
|
3318 |
EditorState()->SetFlags( EditorState()->Flags() | EAknEditorFlagChinesePopup ); |
|
3319 |
} |
|
3320 |
} |
|
3321 |
} |
|
3322 |
} |
|
3323 |
#else |
|
3324 |
if (IsChineseInputLanguage() && keyScanCode == EStdKeyBackspace) |
|
3325 |
{ |
|
3326 |
keyHandled = FepUI()->HandleKeyL(keyScanCode, iKeyRepeat); |
|
3327 |
} |
|
3328 |
else |
|
3329 |
{ |
|
3330 |
keyHandled = FepUI()->HandleKeyL(keyScanCode, EShortKeyPress); |
|
3331 |
} |
|
3332 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
3333 |
||
3334 |
if (keyHandled) |
|
3335 |
{ |
|
3336 |
aResponse = EKeyWasConsumed; |
|
3337 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3338 |
// Predictive QWERTY changes ----> |
|
3339 |
if ( iLangMan->IsSplitView() || ( iFepPluginManager && !iFepPluginManager->EnableITIOnFSQ())) |
|
3340 |
{ |
|
3341 |
ShowExactWordPopupIfNecessaryL(); |
|
3342 |
} |
|
3343 |
// Predictive QWERTY changes <---- |
|
3344 |
} |
|
3345 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
3346 |
||
3347 |
// The indicators should be updated only if the key was handled. Otherwise |
|
3348 |
// the shift-copy-pasting will mess up the indicators. |
|
3349 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3350 |
TInt language = iSharedDataInterface->InputTextLanguage(); |
|
3351 |
TBool IsChineseInput = language == ELangTaiwanChinese|| |
|
3352 |
language == ELangHongKongChinese || |
|
3353 |
language == ELangPrcChinese; |
|
3354 |
#endif |
|
3355 |
if ( !shifted ) |
|
3356 |
{ |
|
3357 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3358 |
if(IsChineseInput && (iKeyboardType!= EPtiKeyboardHalfQwerty)) |
|
3359 |
{ |
|
3360 |
ClearFlag(EFlagQwertyShiftMode); |
|
3361 |
UpdateIndicators(); |
|
3362 |
} |
|
3363 |
else if( keyHandled ) |
|
3364 |
{ |
|
3365 |
#endif |
|
3366 |
ClearFlag(EFlagQwertyShiftMode); |
|
3367 |
UpdateIndicators(); |
|
3368 |
||
3369 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3370 |
} |
|
3371 |
#endif |
|
3372 |
} |
|
3373 |
||
3374 |
#ifdef RD_SCALABLE_UI_V2 |
|
3375 |
if ( ( (keyScanCode >= EPtiKeyQwertyA && keyScanCode <= EPtiKeyQwertyZ) || |
|
3376 |
(keyScanCode >= EPtiKeyQwerty0 && keyScanCode <= EPtiKeyQwerty9) || |
|
3377 |
(keyScanCode == EStdKeyEnter) || |
|
3378 |
(keyScanCode == EPtiKeyQwertyPlus) || |
|
3379 |
(keyScanCode == EPtiKeyQwertyMinus) || |
|
3380 |
(keyScanCode == EPtiKeyQwertyComma) || |
|
3381 |
(keyScanCode == EPtiKeyQwertySemicolon) || |
|
3382 |
(keyScanCode == EPtiKeyQwertyFullstop) || |
|
3383 |
(keyScanCode == EPtiKeyQwertyHash) || |
|
3384 |
(keyScanCode == EPtiKeyQwertySlash) || |
|
3385 |
(keyScanCode == EPtiKeyQwertyApostrophe) ) |
|
3386 |
&& !( iFepPluginManager && iFepPluginManager->EnableITIOnFSQ() ) ) |
|
3387 |
{ |
|
3388 |
//SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
3389 |
//iFepPluginManager->ClosePluginInputModeL(ETrue); |
|
3390 |
} |
|
3391 |
else if( keyHandled ) |
|
3392 |
{ |
|
3393 |
//for QWERTY, number only, the number is send to editor |
|
3394 |
//bypass FEP |
|
3395 |
SendEventsToPluginManL( EPluginSyncFepAwareText ); |
|
3396 |
//iFepPluginManager->SyncFepAwareText(); |
|
3397 |
} |
|
3398 |
#endif |
|
3399 |
} |
|
3400 |
||
3401 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
3402 |
||
3403 |
TInt lang = iSharedDataInterface->InputTextLanguage(); |
|
3404 |
||
3405 |
if(lang == ELangTaiwanChinese|| |
|
3406 |
lang == ELangHongKongChinese || |
|
3407 |
lang == ELangPrcChinese) |
|
3408 |
{ |
|
3409 |
if( CurrentInputLangCode() == ELangEnglish |
|
3410 |
&& IsFlagSet(EFlagQwertyShiftMode) |
|
3411 |
&& !IsFlagSet(EFlagLongShiftKeyPress)) |
|
3412 |
{ |
|
3413 |
ClearFlag(EFlagQwertyShiftMode); |
|
3414 |
UpdateIndicators(); |
|
3415 |
} |
|
3416 |
} |
|
3417 |
#endif // RD_INTELLIGENT_TEXT_INPUT |
|
3418 |
iKeyRepeat = EShortKeyPress; |
|
3419 |
return keyHandled; |
|
3420 |
} |
|
3421 |
||
3422 |
||
3423 |
||
3424 |
void CAknFepManager::CancelTransaction() |
|
3425 |
{ |
|
3426 |
if (iInputCapabilities.FepAwareTextEditor() && IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
3427 |
{ |
|
3428 |
CancelInlineEdit(); |
|
3429 |
} |
|
3430 |
} |
|
3431 |
||
3432 |
void CAknFepManager::IsOnHasChangedState() |
|
3433 |
{ |
|
3434 |
} |
|
3435 |
||
3436 |
void CAknFepManager::OfferKeyEventL(TEventResponse& /*aEventResponse*/, |
|
3437 |
const TKeyEvent& /*aKeyEvent*/, |
|
3438 |
TEventCode /*aEventCode*/) |
|
3439 |
{ |
|
3440 |
} |
|
3441 |
||
3442 |
void CAknFepManager::OfferPointerEventL(TEventResponse& /*aEventResponse*/, |
|
3443 |
const TPointerEvent& /*aPointerEvent*/, |
|
3444 |
const CCoeControl* /*aWindowOwningControl*/) |
|
3445 |
{ |
|
3446 |
} |
|
3447 |
||
3448 |
void CAknFepManager::OfferPointerBufferReadyEventL(TEventResponse& /*aEventResponse*/, |
|
3449 |
const CCoeControl* /*aWindowOwningControl*/) |
|
3450 |
{ |
|
3451 |
} |
|
3452 |
||
3453 |
TInt CAknFepManager::NumberOfAttributes() const |
|
3454 |
{ |
|
3455 |
return 0; |
|
3456 |
} |
|
3457 |
||
3458 |
TUid CAknFepManager::AttributeAtIndex(TInt /*aIndex*/) const |
|
3459 |
{ |
|
3460 |
return KNullUid; |
|
3461 |
} |
|
3462 |
||
3463 |
void CAknFepManager::WriteAttributeDataToStreamL(TUid /*aAttributeUid*/, RWriteStream& /*aStream*/) const |
|
3464 |
{ |
|
3465 |
} |
|
3466 |
||
3467 |
void CAknFepManager::ReadAttributeDataFromStreamL(TUid /*aAttributeUid*/, RReadStream& /*aStream*/) |
|
3468 |
{ |
|
3469 |
} |
|
3470 |
||
3471 |
void CAknFepManager::HandleGainingForeground() |
|
3472 |
{ |
|
3473 |
if (iFepFullyConstructed) |
|
3474 |
{ |
|
3475 |
ClearFlag(EFlagRemoveMatchesMenuItem); |
|
3476 |
ClearCcpuFlag(ECcpuStateHashDown | ECcpuStateSelectionEventPosted | |
|
3477 |
ECcpuStateEdwinInSelectionMode); |
|
3478 |
TRAPD(err, iPtiEngine->HandleCommandL(EPtiCommandReloadLearningInfo)); |
|
3479 |
if (err != KErrNone) |
|
3480 |
{ |
|
3481 |
CleanUpFep(); |
|
3482 |
} |
|
3483 |
} |
|
3484 |
||
3485 |
#ifdef RD_SCALABLE_UI_V2 |
|
3486 |
CCoeControl* focusCtrl = static_cast<const CCoeAppUi*>(CCoeEnv::Static()->AppUi())->TopFocusedControl(); |
|
3487 |
iGainForeground = ETrue; |
|
3488 |
/*if( iLoseForeAndGainFocus ) |
|
3489 |
{ |
|
3490 |
SendEventsToPluginManL( EPluginFocusChanged, iGainForeground ); |
|
3491 |
}*/ |
|
3492 |
if(focusCtrl && focusCtrl->IsFocused()) |
|
3493 |
{ |
|
3494 |
if(GetForegroundTaskAppWgId() == CCoeEnv::Static()->RootWin().Identifier()) |
|
3495 |
//SendEventsToPluginManL( EPluginFocusChanged, iGainForeground ); |
|
3496 |
TRAP_IGNORE(SendEventsToPluginManL( EPluginForegroundChanged, ETrue)); |
|
3497 |
} |
|
3498 |
else |
|
3499 |
{ |
|
3500 |
if (iFepPluginManager) |
|
3501 |
{ |
|
3502 |
iFepPluginManager->HandleiDimGainForeground(ETrue); |
|
3503 |
} |
|
3504 |
} |
|
3505 |
#endif // RD_SCALABLE_UI_V2 |
|
3506 |
} |
|
3507 |
||
3508 |
void CAknFepManager::HandleLosingForeground() |
|
3509 |
{ |
|
3510 |
if (iFepFullyConstructed) |
|
3511 |
{ |
|
3512 |
// Forget the shift state on FEP switch (i.e. when application goes to background) |
|
3513 |
ClearFlag(EFlagQwertyShiftMode | EFlagShiftKeyDepressed | |
|
3514 |
EFlagLongShiftKeyPress | EFlagNoActionDuringShiftKeyPress); |
|
3515 |
} |
|
3516 |
if (Japanese()) |
|
3517 |
{ |
|
3518 |
TRAP_IGNORE(TryCloseUiL()); |
|
3519 |
} |
|
3520 |
if (IsChineseInputLanguage()) |
|
3521 |
{ |
|
3522 |
TRAP_IGNORE(TryCloseUiL()); |
|
3523 |
} |
|
3524 |
||
3525 |
#ifdef RD_SCALABLE_UI_V2 |
|
3526 |
iGainForeground = EFalse; |
|
3527 |
//SendEventsToPluginManL( EPluginFocusChanged, iGainForeground ); |
|
3528 |
TRAP_IGNORE(SendEventsToPluginManL( EPluginForegroundChanged, EFalse)); |
|
3529 |
#endif // RD_SCALABLE_UI_V2 |
|
3530 |
} |
|
3531 |
||
3532 |
void CAknFepManager::HandleChangeInFocus() |
|
3533 |
{ |
|
3534 |
TRAPD(err, HandleChangeInFocusL()); |
|
3535 |
if (err != KErrNone) |
|
3536 |
{ |
|
3537 |
CleanUpFep(); |
|
3538 |
} |
|
3539 |
} |
|
3540 |
||
3541 |
void CAknFepManager::HandleChangeInFocusForSettingFep() |
|
3542 |
{ |
|
3543 |
HandleChangeInFocus(); |
|
3544 |
} |
|
3545 |
||
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3546 |
// ----------------------------------------------------------------------------- |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3547 |
// CAknFepManager::InitRectForSplitCandL |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3548 |
// Returns initial rectangle used for the top-left point of split candidate. |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3549 |
// ----------------------------------------------------------------------------- |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3550 |
// |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3551 |
TRect CAknFepManager::InitRectForSplitCandL() |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3552 |
{ |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3553 |
// Popup Position was not right for RTL |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3554 |
TInt documentOffset = iLanguageCapabilities.iRightToLeftLanguage ? |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3555 |
0 : iPtiEngine->CurrentWord().Length(); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3556 |
|
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3557 |
// Determine the place where to spawn the candidate popup. |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3558 |
TPoint inlineEditorTl; |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3559 |
TPoint inlineEditorBr; |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3560 |
TInt height; |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3561 |
TInt ascent; |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3562 |
GetScreenCoordinatesL( inlineEditorTl, height, ascent, documentOffset ); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3563 |
GetScreenCoordinatesL( inlineEditorBr, height, ascent ); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3564 |
|
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3565 |
// move 4 pixeles down to show underline when pops up candidate. |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3566 |
inlineEditorTl.iY += KUnderlineHeight; |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3567 |
inlineEditorBr.iY += KUnderlineHeight; |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3568 |
|
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3569 |
return TRect( inlineEditorTl, inlineEditorBr ); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3570 |
} |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3571 |
|
44 | 3572 |
void CAknFepManager::HandleDestructionOfFocusedItem() |
3573 |
{ |
|
3574 |
if (iInputCapabilities.FepAwareTextEditor()) |
|
3575 |
{ |
|
3576 |
iFocusedItemDestroy = ETrue; |
|
3577 |
if ( iFepManState == EAknFepStateUIActive ) |
|
3578 |
{ |
|
3579 |
TRAP_IGNORE(SendEventsToPluginManL( EPluginFocusItemDestroy )); |
|
3580 |
if (Japanese() && iAknEditorFlags & EAknEditorFlagFindPane) |
|
3581 |
{ |
|
3582 |
// In case of Find pane while inputting japanese characters, |
|
3583 |
// No update or commit characters. |
|
3584 |
iPtiEngine->ClearCurrentWord(); |
|
3585 |
} |
|
3586 |
||
3587 |
#ifdef RD_SCALABLE_UI_V2 |
|
3588 |
// For addition of ITI features on FSQ, |
|
3589 |
// need to restore some values stored before opening FSQ |
|
3590 |
// When go into this section, |
|
3591 |
// touch ui won't be closed by ClosePluginInputUiL, |
|
3592 |
// but need to restore fep state here |
|
3593 |
if ( iFepPluginManager ) |
|
3594 |
{ |
|
3595 |
TRAP_IGNORE(iFepPluginManager->ResetItiStateL()); |
|
3596 |
} |
|
3597 |
#endif |
|
3598 |
// Close UI |
|
3599 |
if ( FepUI()) |
|
3600 |
{ |
|
3601 |
FepUI()->CloseUI(); |
|
3602 |
} |
|
3603 |
} |
|
3604 |
else |
|
3605 |
{ |
|
3606 |
TRAP_IGNORE(SendEventsToPluginManL( EPluginFocusItemDestroy, ETrue )); |
|
3607 |
} |
|
3608 |
iFocusedItemDestroy = EFalse; |
|
3609 |
} |
|
3610 |
||
3611 |
if ( !(IsFlagSet(EFlagForegroundUIComponentVisible) || |
|
3612 |
IsFlagSet(EFlagMenuPaneVisible)) ) |
|
3613 |
{ |
|
3614 |
iLanguageCapabilities.iNumericEditorDigitType = EDigitTypeUnknown; |
|
3615 |
//UpdateLocalDigitMode(); |
|
3616 |
} |
|
3617 |
if(IsFlagSet(EFlagForegroundUIComponentVisible)) |
|
3618 |
{ |
|
3619 |
ClearFlag(EFlagForegroundUIComponentVisible); |
|
3620 |
} |
|
3621 |
||
3622 |
ClearFlag( EFlagInsideInlineEditingTransaction | |
|
3623 |
EFlagInsideMultitapInlineEditingTransaction | |
|
3624 |
EFlagLineFeedCharacter | EFlagNoMatches ); |
|
3625 |
||
3626 |
iInputCapabilities = NULL; |
|
3627 |
} |
|
3628 |
||
3629 |
void CAknFepManager::HandleAknEdwinStateEventL(CAknEdwinState* aAknEdwinState, |
|
3630 |
EAknEdwinStateEvent aEventType) |
|
3631 |
{ |
|
3632 |
if(aEventType == EAknEdwinDestroy) |
|
3633 |
{ |
|
3634 |
// Reset the last focus editor when destroy it. |
|
3635 |
if ( aAknEdwinState == iLastFocusedEditor ) |
|
3636 |
{ |
|
3637 |
iLastFocusedEditor->SetObserver( NULL ); |
|
3638 |
iLastFocusedEditor = NULL; |
|
3639 |
} |
|
3640 |
||
3641 |
// Whenever the editor is destroyed, we destroy all the UI components we launched |
|
3642 |
if(iFepAwareDialogParentEditor == NULL || |
|
3643 |
iFepAwareDialogParentEditor == aAknEdwinState) |
|
3644 |
{ |
|
3645 |
// EExtendedFlagEdwinEditorDestroyed flag is used to leave once the dialog is closed. |
|
3646 |
SetExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
3647 |
// Delete any candidate popup is launched |
|
3648 |
if(iCandidatePopup) |
|
3649 |
{ |
|
3650 |
delete iCandidatePopup; |
|
3651 |
iCandidatePopup = NULL; |
|
3652 |
} |
|
3653 |
// Delete anu UI components launched by Fep. |
|
3654 |
iUiInterface->DeleteDialogs(); |
|
3655 |
} |
|
3656 |
||
3657 |
if ( iFepPluginManager ) |
|
3658 |
{ |
|
3659 |
// Check whether the destroyed editor is the editor that stored in fep |
|
3660 |
// according to the editor state |
|
3661 |
if ( aAknEdwinState == iFepPluginManager->EdwinState()) |
|
3662 |
{ |
|
3663 |
// Set the editor pointer to NULL to avoid wild pointer exist |
|
3664 |
iFepPluginManager->ClearDestroyedEditorPointer(); |
|
3665 |
} |
|
3666 |
} |
|
3667 |
} |
|
3668 |
if ( IsFepAwareTextEditor() ) |
|
3669 |
{ |
|
3670 |
CAknEdwinState* editorState = EditorState(); |
|
3671 |
if ( editorState != aAknEdwinState || !iFepFullyConstructed ) |
|
3672 |
{ |
|
3673 |
// FEP state update is not needed because editor state of non-focused |
|
3674 |
// editor was changed. |
|
3675 |
return; |
|
3676 |
} |
|
3677 |
||
3678 |
switch (aEventType) |
|
3679 |
{ |
|
3680 |
case EAknEdwinStateInputModeUpdate: |
|
3681 |
{ |
|
3682 |
TUint currentInputMode = editorState->CurrentInputMode(); |
|
3683 |
if ( EditorModeFromFepMode(iMode) != currentInputMode ) |
|
3684 |
{ |
|
3685 |
if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
3686 |
{ |
|
3687 |
TryRemoveNoMatchesIndicatorL(); |
|
3688 |
} |
|
3689 |
UpdateCbaL(NULL); |
|
3690 |
TryCloseUiL(); |
|
3691 |
ConfigureFEPFromEditorStateL(); |
|
3692 |
} |
|
3693 |
} |
|
3694 |
break; |
|
3695 |
case EAknEdwinStateCaseModeUpdate: |
|
3696 |
{ |
|
3697 |
TInt currentCaseMode = editorState->CurrentCase(); |
|
3698 |
if ( currentCaseMode != iCaseMan->CurrentCase() ) |
|
3699 |
{ |
|
3700 |
iCaseMan->SetCurrentCase(currentCaseMode); |
|
3701 |
} |
|
3702 |
} |
|
3703 |
break; |
|
3704 |
case EAknEdwinStateLocalLanguageUpdate: |
|
3705 |
{ |
|
3706 |
TLanguage localLanguage = ELangTest; |
|
3707 |
if (GetLocalLanguage( localLanguage ) ) |
|
3708 |
{ |
|
3709 |
iLanguageCapabilities.iLocalInputLanguageInUse = ETrue; |
|
3710 |
if ( localLanguage != iLanguageCapabilities.iInputLanguageCode ) |
|
3711 |
{ |
|
3712 |
ChangeInputLanguageL(localLanguage); |
|
3713 |
} |
|
3714 |
} |
|
3715 |
} |
|
3716 |
break; |
|
3717 |
case EAknEdwinStateFlagsUpdate: |
|
3718 |
{ |
|
3719 |
TInt oldEditorFlags = iAknEditorFlags; |
|
3720 |
if(iAknEditorFlags != editorState->Flags()) |
|
3721 |
{ |
|
3722 |
iAknEditorFlags = editorState->Flags(); |
|
3723 |
UpdateLocalDigitMode(); |
|
3724 |
} |
|
3725 |
if ( iAknEditorFlags != oldEditorFlags ) |
|
3726 |
{ |
|
3727 |
if ( (iAknEditorFlags & EAknEditorFlagNoT9) != |
|
3728 |
(oldEditorFlags & EAknEditorFlagNoT9)) |
|
3729 |
{ |
|
3730 |
if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
3731 |
{ |
|
3732 |
TryRemoveNoMatchesIndicatorL(); |
|
3733 |
} |
|
3734 |
UpdateCbaL(NULL); |
|
3735 |
TryCloseUiL(); |
|
3736 |
ConfigureFEPFromEditorStateL(); |
|
3737 |
} |
|
3738 |
||
3739 |
if ( (iAknEditorFlags & EAknEditorFlagNoEditIndicators) != |
|
3740 |
(oldEditorFlags & EAknEditorFlagNoEditIndicators)) |
|
3741 |
{ |
|
3742 |
// We only need to update indicators when EAknEditorFlagNoEditIndicators was modified. |
|
3743 |
// Current Fep state is not lost. |
|
3744 |
UpdateIndicators(); |
|
3745 |
} |
|
3746 |
||
3747 |
if ( (iAknEditorFlags & EAknEditorFlagFixedCase) != |
|
3748 |
(oldEditorFlags & EAknEditorFlagFixedCase)) |
|
3749 |
{ |
|
3750 |
// We only need to update EFlagSupressAutoUpdate flag when the |
|
3751 |
// EAknEditorFlagFixedCase was modified. |
|
3752 |
// Current Fep state is not lost. |
|
3753 |
if (iAknEditorFlags & EAknEditorFlagFixedCase) |
|
3754 |
{ |
|
3755 |
SetFlag(EFlagSupressAutoUpdate); |
|
3756 |
} |
|
3757 |
else |
|
3758 |
{ |
|
3759 |
ClearFlag(EFlagSupressAutoUpdate); |
|
3760 |
} |
|
3761 |
} |
|
3762 |
} |
|
3763 |
} |
|
3764 |
break; |
|
3765 |
case EAknEdwinStateEventStateUpdate: |
|
3766 |
{ |
|
3767 |
// Feps state is reseted and new state is fetched completelly from editor state. |
|
3768 |
if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
3769 |
{ |
|
3770 |
TryRemoveNoMatchesIndicatorL(); |
|
3771 |
} |
|
3772 |
UpdateCbaL(NULL); |
|
3773 |
TryCloseUiL(); |
|
3774 |
ConfigureFEPFromEditorStateL(); |
|
3775 |
} |
|
3776 |
break; |
|
3777 |
case EAknSyncEdwinState: |
|
3778 |
#ifdef RD_SCALABLE_UI_V2 |
|
3779 |
if ( !IsCcpuFlagSet(ECcpuStateIgnoreNextEdwinSyncEvent) && iFepPluginManager && |
|
3780 |
iFepPluginManager->PluginInputMode() == EPluginInputModeNone ) |
|
3781 |
#else |
|
3782 |
if ( !IsCcpuFlagSet(ECcpuStateIgnoreNextEdwinSyncEvent) ) |
|
3783 |
#endif |
|
3784 |
{ |
|
3785 |
HandleChangeInFocusL(); |
|
3786 |
} |
|
3787 |
else |
|
3788 |
{ |
|
3789 |
ClearCcpuFlag(ECcpuStateIgnoreNextEdwinSyncEvent); |
|
3790 |
} |
|
3791 |
break; |
|
3792 |
||
3793 |
#ifdef RD_SCALABLE_UI_V2 |
|
3794 |
case EAknActivatePenInputRequest: |
|
3795 |
SendEventsToPluginManL( EPluginEditorActivate ); |
|
3796 |
break; |
|
3797 |
case EAknClosePenInputRequest: |
|
3798 |
if ( iFepPluginManager ) |
|
3799 |
{ |
|
3800 |
iFepPluginManager->ClosePluginInputModeL( EFalse ); |
|
3801 |
} |
|
3802 |
break; |
|
3803 |
case EAknEdwinStatePromptUpdate: |
|
3804 |
SendEventsToPluginManL( EPluginPromptChanged ); |
|
3805 |
break; |
|
3806 |
#endif // RD_SCALABLE_UI_V2 |
|
3807 |
case EAknCursorPositionChanged: |
|
3808 |
#ifdef RD_SCALABLE_UI_V2 |
|
3809 |
SendEventsToPluginManL( EPluginSyncFepAwareText ); |
|
3810 |
HandleCopyCutStateL(); |
|
3811 |
#endif |
|
3812 |
// whenever focus cahnged happen, internally |
|
3813 |
// editor treat cursorposition change. |
|
3814 |
// In between, if editor context not in inline edit state. |
|
3815 |
// Try to update the case editor gets the focus, and editor |
|
3816 |
// context come in inline state. |
|
3817 |
iCaseMan->UpdateCase( ENullNaviEvent ); |
|
3818 |
break; |
|
3819 |
||
3820 |
default: |
|
3821 |
break; |
|
3822 |
} |
|
3823 |
} |
|
3824 |
#ifdef RD_SCALABLE_UI_V2 |
|
3825 |
else |
|
3826 |
{ |
|
3827 |
// Close touch input when inMenu is opened. When inMenu is opened, |
|
3828 |
// editor loses focus, and inMenu gets focus. After touch input has |
|
3829 |
// been force closed, menu state should be restored and last focused |
|
3830 |
// window ,which launches touch input, should be removed. |
|
3831 |
if( aEventType == EAknClosePenInputRequest |
|
3832 |
&& iFepPluginManager |
|
3833 |
&& iFepPluginManager->IsInMenuOpen() ) |
|
3834 |
{ |
|
3835 |
CCoeEnv* env = CCoeEnv::Static(); |
|
3836 |
TKeyEvent keyEvent = {EKeyCBA2, EStdKeyNull, 0, 0}; |
|
3837 |
env->SimulateKeyEventL(keyEvent,EEventKey); |
|
3838 |
iFepPluginManager->ResetMenuState(); |
|
3839 |
iFepPluginManager->RemoveLastFocusedWinFromOpenList(); |
|
3840 |
iFepPluginManager->ClosePluginInputModeL( EFalse ); |
|
3841 |
} |
|
3842 |
} |
|
3843 |
#endif // RD_SCALABLE_UI_V2 |
|
3844 |
} |
|
3845 |
||
3846 |
||
3847 |
CAknExtendedInputCapabilities::TEditorType CAknFepManager::EditorType() const |
|
3848 |
{ |
|
3849 |
MObjectProvider* mop = iInputCapabilities.ObjectProvider(); |
|
3850 |
||
3851 |
if ( mop ) |
|
3852 |
{ |
|
3853 |
CAknExtendedInputCapabilities* extendedInputCapabilities = |
|
3854 |
mop->MopGetObject( extendedInputCapabilities ); |
|
3855 |
||
3856 |
if ( extendedInputCapabilities && iInputCapabilities.FepAwareTextEditor() ) |
|
3857 |
{ |
|
3858 |
TInt type = extendedInputCapabilities->EditorType(); |
|
3859 |
return static_cast<CAknExtendedInputCapabilities::TEditorType>( type ); |
|
3860 |
} |
|
3861 |
} |
|
3862 |
||
3863 |
return CAknExtendedInputCapabilities::EUndefined; |
|
3864 |
} |
|
3865 |
||
3866 |
TUint CAknFepManager::MIDPConstraint() const |
|
3867 |
{ |
|
3868 |
TUint ConstraintValue=0xFFFFFFFF; |
|
3869 |
MObjectProvider* mop = iInputCapabilities.ObjectProvider(); |
|
3870 |
||
3871 |
if ( mop ) |
|
3872 |
{ |
|
3873 |
CAknExtendedInputCapabilities* extendedInputCapabilities = |
|
3874 |
mop->MopGetObject( extendedInputCapabilities ); |
|
3875 |
if ( extendedInputCapabilities && iInputCapabilities.FepAwareTextEditor() ) |
|
3876 |
{ |
|
3877 |
ConstraintValue = extendedInputCapabilities->MIDPConstrainst(); |
|
3878 |
} |
|
3879 |
} |
|
3880 |
return ConstraintValue; |
|
3881 |
} |
|
3882 |
||
3883 |
TBool CAknFepManager::IsSpecialNumericEditor() |
|
3884 |
{ |
|
3885 |
TBool JavaNumericEditor = EFalse; |
|
3886 |
TUint ConstraintValue = MIDPConstraint(); |
|
3887 |
if((ConstraintValue & ESplConstraintMask) == ESplNumeric ) |
|
3888 |
JavaNumericEditor = ETrue; |
|
3889 |
||
3890 |
return JavaNumericEditor; |
|
3891 |
||
3892 |
} |
|
3893 |
#ifdef RD_SCALABLE_UI_V2 |
|
3894 |
void CAknFepManager::HandleInputCapabilitiesEventL( TInt aEvent, TAny* /*aParams*/ ) |
|
3895 |
{ |
|
3896 |
switch (aEvent) |
|
3897 |
{ |
|
3898 |
case CAknExtendedInputCapabilities::MAknEventObserver::EActivatePenInputRequest: |
|
3899 |
SendEventsToPluginManL( EPluginEditorActivate ); |
|
3900 |
break; |
|
3901 |
case CAknExtendedInputCapabilities::MAknEventObserver::EClosePenInputRequest: |
|
3902 |
if ( iFepPluginManager ) |
|
3903 |
{ |
|
3904 |
iFepPluginManager->ClosePluginInputModeL( EFalse ); |
|
3905 |
} |
|
3906 |
break; |
|
3907 |
case CAknExtendedInputCapabilities::MAknEventObserver::EPointerEventReceived: |
|
3908 |
||
3909 |
/* |
|
3910 |
#ifdef RD_TACTILE_FEEDBACK |
|
3911 |
CAknExtendedInputCapabilities:: |
|
3912 |
MAknEventObserver::TPointerEventReceivedParams* params = |
|
3913 |
static_cast<CAknExtendedInputCapabilities:: |
|
3914 |
MAknEventObserver::TPointerEventReceivedParams*>(aParams); |
|
3915 |
if (params->iPointerEvent.iType == TPointerEvent::EButton1Down) |
|
3916 |
{ |
|
3917 |
||
3918 |
MTouchFeedback* feedback = MTouchFeedback::Instance(); |
|
3919 |
if (feedback && iFepPluginManager && !iFepPluginManager->VKBIsOpened()) |
|
3920 |
{ |
|
3921 |
feedback->InstantFeedback( ETouchFeedbackBasic ); |
|
3922 |
} |
|
3923 |
} |
|
3924 |
#endif // RD_TACTILE_FEEDBACK |
|
3925 |
*/ |
|
3926 |
if( IsFlagSet( EFlagInsideInlineEditingTransaction ) ) |
|
3927 |
{ |
|
3928 |
if (IsFeatureSupportedJapanese()) |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3929 |
{ |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3930 |
TryCloseUiL(); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3931 |
} |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3932 |
else |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3933 |
{ |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3934 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3935 |
iPtiEngine->CommitCurrentWord(); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3936 |
CommitInlineEditL(); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3937 |
TryCloseUiL(); |
44 | 3938 |
|
3939 |
#else |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3940 |
CommitInlineEditL(); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3941 |
#endif |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3942 |
} |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3943 |
} |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3944 |
|
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3945 |
// The flag should be removed when touch input is not launched. |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3946 |
if ( IsExtendedFlagSet( EExtendedFlagPointInNoMatchEditor ) ) |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3947 |
{ |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3948 |
ClearExtendedFlag( EExtendedFlagPointInNoMatchEditor ); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3949 |
} |
44 | 3950 |
break; |
3951 |
case CAknExtendedInputCapabilities::MAknEventObserver::EControlContentUpdatedInternally: |
|
3952 |
SendEventsToPluginManL( EPluginSyncFepAwareText, EPluginSyncAll ); |
|
3953 |
break; |
|
3954 |
case CAknExtendedInputCapabilities::MAknEventObserver::EOpenStylusMenuCcpu: |
|
3955 |
// User has highlighted text and editor requests stylus ccpu popup menu |
|
3956 |
// to be displayed. |
|
3957 |
LaunchStylusCcpuMenuL(iClickPoint); |
|
3958 |
break; |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3959 |
default: |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
3960 |
break; |
44 | 3961 |
} |
3962 |
} |
|
3963 |
||
3964 |
void CAknFepManager::SubmitInlineTextL( const TDesC& aData ) |
|
3965 |
{ |
|
3966 |
if(TextIsValidInEditor(aData)) |
|
3967 |
{ |
|
3968 |
StartInlineEditL(aData); |
|
3969 |
CommitInlineEditL(); |
|
3970 |
} |
|
3971 |
} |
|
3972 |
||
3973 |
// for japanese |
|
3974 |
void CAknFepManager::NotifyJapaneseSetting() |
|
3975 |
{ |
|
3976 |
TInt param = 0; |
|
3977 |
// Deleting direction ON(right side) / OFF(left side) |
|
3978 |
if (iSharedDataInterface->ClearDirection() == EClearDirectionRight) |
|
3979 |
{ |
|
3980 |
param |= EPenInputJapaneseSettingDeletingDirection; |
|
3981 |
} |
|
3982 |
// Japanese predictive ON(predictive on) / OFF(predictive off) |
|
3983 |
if (iJapanesePredictive) |
|
3984 |
{ |
|
3985 |
param |= EPenInputJapaneseSettingPredictive; |
|
3986 |
} |
|
3987 |
// Japanese HWR conversion ON / OFF |
|
3988 |
if (iSharedDataInterface->JapaneseHwrConversion() == EJapaneseConversionOn) |
|
3989 |
{ |
|
3990 |
param |= EPenInputJapaneseSettingConversion; |
|
3991 |
} |
|
3992 |
// Japanese HWR conversion ON / OFF |
|
3993 |
if (iCharWidth == EFullWidthChar) |
|
3994 |
{ |
|
3995 |
param |= EPenInputJapaneseSettingCharacterWidth; |
|
3996 |
} |
|
3997 |
// Japanese qwerty setting flag |
|
3998 |
TInt qwertflag = iSharedDataInterface->JapaneseQwertyFlags(); |
|
3999 |
// Qwerty Comma |
|
4000 |
if (qwertflag & EJapQwertySettingComma) |
|
4001 |
{ |
|
4002 |
param |= EPenInputJapaneseSettingQwertyComma; |
|
4003 |
} |
|
4004 |
// Qwerty Period |
|
4005 |
if (qwertflag & EJapQwertySettingPeriod) |
|
4006 |
{ |
|
4007 |
param |= EPenInputJapaneseSettingQwertyPeriod; |
|
4008 |
} |
|
4009 |
// Qwerty Width Of Space |
|
4010 |
if (qwertflag & EJapQwertySettingSpaceFullWidth) |
|
4011 |
{ |
|
4012 |
param |= EPenInputJapaneseSettingQwertyWidthOfSpace; |
|
4013 |
} |
|
4014 |
// Lunch SCT |
|
4015 |
if (IsAbleToLaunchSCT()) |
|
4016 |
{ |
|
4017 |
param |= EPenInputJapaneseSettingLunchSCT; |
|
4018 |
} |
|
4019 |
#ifdef RD_SCALABLE_UI_V2 |
|
4020 |
// Set Japanese setting |
|
4021 |
if(iFepPluginManager->CurrentPluginInputFepUI()) |
|
4022 |
{ |
|
4023 |
TRAP_IGNORE(iFepPluginManager->CurrentPluginInputFepUI()->HandleCommandL( |
|
4024 |
ECmdPenInputJapaneseSetting, param)); |
|
4025 |
} |
|
4026 |
#endif //RD_SCALABLE_UI_V2 |
|
4027 |
} |
|
4028 |
||
4029 |
TBool CAknFepManager::FullyFepAwareTextEditor() const |
|
4030 |
{ |
|
4031 |
if ( iInputCapabilities.FepAwareTextEditor() ) |
|
4032 |
{ |
|
4033 |
if ( EditorType() != CAknExtendedInputCapabilities::EMFNEBased ) |
|
4034 |
{ |
|
4035 |
return ETrue; |
|
4036 |
} |
|
4037 |
} |
|
4038 |
||
4039 |
return EFalse; |
|
4040 |
} |
|
4041 |
||
4042 |
TBool CAknFepManager::SemiFepAwareTextEditor( TBool aAtLeast ) const |
|
4043 |
{ |
|
4044 |
if ( aAtLeast ) |
|
4045 |
{ |
|
4046 |
switch ( EditorType() ) |
|
4047 |
{ |
|
4048 |
case CAknExtendedInputCapabilities::EEdwinBased: |
|
4049 |
case CAknExtendedInputCapabilities::EMFNEBased: |
|
4050 |
return ETrue; |
|
4051 |
||
4052 |
default: |
|
4053 |
return EFalse; |
|
4054 |
} |
|
4055 |
} |
|
4056 |
else |
|
4057 |
{ |
|
4058 |
return EditorType() == CAknExtendedInputCapabilities::EMFNEBased; |
|
4059 |
} |
|
4060 |
} |
|
4061 |
||
4062 |
void CAknFepManager::ProcessEditorMenuCommand(TInt aCommand) |
|
4063 |
{ |
|
4064 |
TRAP_IGNORE(ProcessCommandL(aCommand)); |
|
4065 |
} |
|
4066 |
||
4067 |
TInt CAknFepManager::GetPermittedEditorMenu(TBool aOnlyCount) |
|
4068 |
{ |
|
4069 |
TInt count = 0; |
|
4070 |
TRAP_IGNORE(count = GetPermittedEditorMenuL(aOnlyCount)); |
|
4071 |
return count; |
|
4072 |
} |
|
4073 |
||
4074 |
TInt CAknFepManager::GetPermittedEditorMenuL(TBool aOnlyCount) |
|
4075 |
{ |
|
4076 |
||
4077 |
CAknEdwinState* editorState = NULL; |
|
4078 |
if (iInputCapabilities.FepAwareTextEditor()) |
|
4079 |
{ |
|
4080 |
editorState = EditorState(); |
|
4081 |
} |
|
4082 |
||
4083 |
CAknFepUiInterfaceMenuBar* menuBar = NULL; |
|
4084 |
||
4085 |
RPointerArray<CEikMenuPaneItem> editorMenuItemList; |
|
4086 |
||
4087 |
CEikMenuPane* editorMenuPane = new (ELeave) CEikMenuPane((MEikMenuObserver*)(this)); |
|
4088 |
CleanupDeletePushL( editorMenuPane ); |
|
4089 |
||
4090 |
editorMenuPane->SetItemArrayOwnedExternally(EFalse); |
|
4091 |
TResourceReader reader; |
|
4092 |
CCoeEnv::Static()->CreateResourceReaderLC(reader, R_AVKON_TOUCH_INDICATOR_EDIT_MODE_MENU);// |
|
4093 |
||
4094 |
const TInt menuCount=reader.ReadInt16(); |
|
4095 |
for ( TInt ii=0; ii<menuCount; ++ii ) |
|
4096 |
{ |
|
4097 |
CEikMenuPaneItem* item = new(ELeave) CEikMenuPaneItem(); |
|
4098 |
CleanupStack::PushL( item ); |
|
4099 |
item->iData.iCommandId = reader.ReadInt32(); |
|
4100 |
item->iData.iCascadeId = reader.ReadInt32(); |
|
4101 |
item->iData.iFlags = reader.ReadInt32(); |
|
4102 |
TPtrC txtptr = reader.ReadTPtrC(); |
|
4103 |
item->SetScaleableTextL( txtptr ); |
|
4104 |
TPtrC extratxtptr = reader.ReadTPtrC(); |
|
4105 |
item->iData.iExtraText = extratxtptr; |
|
4106 |
TPtrC bitmapFile = reader.ReadTPtrC(); |
|
4107 |
TInt bitmapId = reader.ReadInt16(); |
|
4108 |
TInt bitmapMaskId = reader.ReadInt16(); |
|
4109 |
CleanupStack::Pop(); // pop first, since additem pushes again |
|
4110 |
editorMenuPane->AddMenuItemL( item->iData ); |
|
4111 |
editorMenuItemList.Append(item); |
|
4112 |
reader.ReadInt32(); // extension link |
|
4113 |
} |
|
4114 |
||
4115 |
CleanupStack::PopAndDestroy(); //reader |
|
4116 |
||
4117 |
||
4118 |
if (editorState) |
|
4119 |
{ |
|
4120 |
menuBar = iUiInterface->EditorStateMenuBar(editorState); |
|
4121 |
} |
|
4122 |
||
4123 |
TInt count = 0; |
|
4124 |
||
4125 |
if ( menuBar ) |
|
4126 |
{ |
|
4127 |
CAknFepUiInterfaceMenuPane* menuPane = menuBar->MenuPane(); |
|
4128 |
||
4129 |
CEikMenuPane* oldMenuPane = menuPane->GetMenuPane(); |
|
4130 |
||
4131 |
menuPane->SetMenuPane(editorMenuPane); |
|
4132 |
||
4133 |
DynInitTouchMenuPaneL(menuPane); |
|
4134 |
||
4135 |
menuPane->SetMenuPane(oldMenuPane); |
|
4136 |
||
4137 |
||
4138 |
for (TInt ii = 0; ii < KMaxMenuSize; ii++) |
|
4139 |
{ |
|
4140 |
CEikMenuPaneItem::SData& itemdata = |
|
4141 |
editorMenuPane->ItemData(KEditorMenuPermitedSend[ii]); |
|
4142 |
if ( !(itemdata.iFlags & EEikMenuItemDimmed ) ) |
|
4143 |
{ |
|
4144 |
count = count + 1; |
|
4145 |
iEditorCommandList[count] = itemdata.iCommandId; |
|
4146 |
} |
|
4147 |
} |
|
4148 |
iEditorCommandList[0] = count; |
|
4149 |
if (!aOnlyCount && iFepPluginManager->CurrentPluginInputFepUI()) |
|
4150 |
{ |
|
4151 |
iFepPluginManager->CurrentPluginInputFepUI()->HandleCommandL( |
|
4152 |
ECmdPenInputSendEditMenuData, reinterpret_cast<TInt>(iEditorCommandList)); |
|
4153 |
} |
|
4154 |
} |
|
4155 |
||
4156 |
editorMenuItemList.ResetAndDestroy(); |
|
4157 |
CleanupStack::PopAndDestroy(editorMenuPane); |
|
4158 |
||
4159 |
return count; |
|
4160 |
} |
|
4161 |
#endif // RD_SCALABLE_UI_V2 |
|
4162 |
||
4163 |
void CAknFepManager::ExitPluginSpellModeByOk() |
|
4164 |
{ |
|
4165 |
TRAP_IGNORE(ExitPluginSpellModeByOkL()); |
|
4166 |
} |
|
4167 |
||
4168 |
void CAknFepManager::ExitPluginSpellModeByOkL() |
|
4169 |
{ |
|
4170 |
#ifdef RD_SCALABLE_UI_V2 |
|
4171 |
if (iFepPluginManager->IsSpellVisible()) |
|
4172 |
{ |
|
4173 |
CommitInlineEditL(); |
|
4174 |
HBufC* spell = iFepPluginManager->SpellTextInput(); |
|
4175 |
||
4176 |
iFepPluginManager->SetITUTSpellingStateL(EFalse); |
|
4177 |
iFepPluginManager->HideSpellEditor(); |
|
4178 |
||
4179 |
if (spell) |
|
4180 |
{ |
|
4181 |
CleanupStack::PushL(spell); |
|
4182 |
TPtr text = spell->Des(); |
|
4183 |
FepUI()->AddTextToUserDictionaryL(text); |
|
4184 |
InsertTextFromDialogL(text, iFepPluginManager->CursorSelection()); |
|
4185 |
CleanupStack::PopAndDestroy(spell); |
|
4186 |
} |
|
4187 |
||
4188 |
UpdateCbaL(NULL); |
|
4189 |
if (iFepPluginManager->CaseUpdatesSupressed()) |
|
4190 |
{ |
|
4191 |
SetFlag(EFlagSupressAutoUpdate); |
|
4192 |
} |
|
4193 |
else |
|
4194 |
{ |
|
4195 |
ClearFlag(EFlagSupressAutoUpdate); |
|
4196 |
} |
|
4197 |
ClearFlag(EFlagSupressAutoUpdateAtEditorStart); |
|
4198 |
} |
|
4199 |
#endif |
|
4200 |
} |
|
4201 |
||
4202 |
void CAknFepManager::ExitPluginSpellModeByCancel() |
|
4203 |
{ |
|
4204 |
/* |
|
4205 |
#ifdef RD_SCALABLE_UI_V2 |
|
4206 |
if (iFepPluginManager->IsSpellVisible()) |
|
4207 |
{ |
|
4208 |
iFepPluginManager->SetITUTSpellingStateL(EFalse); |
|
4209 |
iFepPluginManager->DestroySpellEditor(); |
|
4210 |
UpdateCbaL(NULL); |
|
4211 |
HandleChangeInFocus(); |
|
4212 |
if (iFepPluginManager->CursorSelection().Length()) |
|
4213 |
{ |
|
4214 |
EditorState()->SetInlineEditSpan(iFepPluginManager->CursorSelection()); |
|
4215 |
ConfigureFEPFromEditorStateL(); |
|
4216 |
} |
|
4217 |
TransferFepStateToEditorL(); |
|
4218 |
||
4219 |
if (iFepPluginManager->CaseUpdatesSupressed()) |
|
4220 |
{ |
|
4221 |
SetFlag(EFlagSupressAutoUpdate); |
|
4222 |
} |
|
4223 |
else |
|
4224 |
{ |
|
4225 |
ClearFlag(EFlagSupressAutoUpdate); |
|
4226 |
} |
|
4227 |
ClearFlag(EFlagSupressAutoUpdateAtEditorStart); |
|
4228 |
iFepPluginManager->SetBeforeSpell(ETrue); |
|
4229 |
} |
|
4230 |
#endif |
|
4231 |
*/ |
|
4232 |
#ifdef RD_SCALABLE_UI_V2 |
|
4233 |
if (iFepPluginManager->IsSpellVisible()) |
|
4234 |
{ |
|
4235 |
TRAP_IGNORE(iFepPluginManager->SetITUTSpellingStateL(EFalse)); |
|
4236 |
iFepPluginManager->HideSpellEditor(); |
|
4237 |
||
4238 |
TRAP_IGNORE(UpdateCbaL(NULL)); |
|
4239 |
if (iFepPluginManager->CaseUpdatesSupressed()) |
|
4240 |
{ |
|
4241 |
SetFlag(EFlagSupressAutoUpdate); |
|
4242 |
} |
|
4243 |
else |
|
4244 |
{ |
|
4245 |
ClearFlag(EFlagSupressAutoUpdate); |
|
4246 |
} |
|
4247 |
ClearFlag(EFlagSupressAutoUpdateAtEditorStart); |
|
4248 |
} |
|
4249 |
#endif |
|
4250 |
} |
|
4251 |
||
4252 |
void CAknFepManager::ProcessCommandL(TInt aCommandId) |
|
4253 |
{ |
|
4254 |
//ProcessCommandL() is called before HandleChangeInFocus() for the editor to insert the |
|
4255 |
//number into, so have to force a call |
|
4256 |
||
4257 |
//Process pen input menu if avaliable |
|
4258 |
#ifdef RD_SCALABLE_UI_V2 |
|
4259 |
||
4260 |
if (iFepPluginManager && |
|
4261 |
(iFepPluginManager->PluginInputMode() == EPluginInputModeItut)) |
|
4262 |
{ |
|
4263 |
switch(aCommandId) |
|
4264 |
{ |
|
4265 |
case EAknSoftkeyOptions: |
|
4266 |
{ |
|
4267 |
LaunchSelectModeMenuL(); |
|
4268 |
} |
|
4269 |
return; |
|
4270 |
case EAknSoftkeyOk: |
|
4271 |
{ |
|
4272 |
iFepPluginManager->ClosePluginInputModeL(ETrue); |
|
4273 |
} |
|
4274 |
return; |
|
4275 |
default: |
|
4276 |
{ |
|
4277 |
break; |
|
4278 |
} |
|
4279 |
} |
|
4280 |
} |
|
4281 |
||
4282 |
SendEventsToPluginManL( EPluginMenuCmd, aCommandId ); |
|
4283 |
||
4284 |
#endif //RD_SCALABLE_UI_V2 |
|
4285 |
MAknFepManagerInterface* currentFepUI=NULL; |
|
4286 |
switch (aCommandId) |
|
4287 |
{ |
|
4288 |
// Edit mode menu commands |
|
4289 |
//The soft CBA event from touch screen. |
|
4290 |
case EAknSoftkeyCancel: |
|
4291 |
case EAknSoftkeySelect: |
|
4292 |
currentFepUI = FepUI(); |
|
4293 |
if (currentFepUI) |
|
4294 |
currentFepUI->HandleCommandL( aCommandId ); |
|
4295 |
break; |
|
4296 |
// --- commands for Japanese --- |
|
4297 |
case EJapanFepCmdModeHiragana: |
|
4298 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4299 |
HandleChangeInFocus(); |
|
4300 |
TryChangeModeL(EHiraganaKanji); |
|
4301 |
break; |
|
4302 |
case EJapanFepCmdModeKatakana: |
|
4303 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4304 |
HandleChangeInFocus(); |
|
4305 |
TryChangeModeL(EKatakana); |
|
4306 |
break; |
|
4307 |
case EAknCmdEditInsertPictograph: |
|
4308 |
SetStopProcessFocus(ETrue); |
|
4309 |
HandleChangeInFocus(); |
|
4310 |
LaunchPictographCharacterTableL(); |
|
4311 |
SetStopProcessFocus(EFalse); |
|
4312 |
break; |
|
4313 |
case EJapanFepCmdModeFullWidth: |
|
4314 |
case EPenInputJpCmdFullWidth: |
|
4315 |
case EJapanFepCmdModeHalfWidth: |
|
4316 |
case EPenInputJpCmdHalfWidth: |
|
4317 |
{ |
|
4318 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4319 |
HandleChangeInFocus(); |
|
4320 |
if (aCommandId == EJapanFepCmdModeFullWidth |
|
4321 |
|| aCommandId == EPenInputJpCmdFullWidth) |
|
4322 |
{ |
|
4323 |
iCharWidth = EFullWidthChar; |
|
4324 |
} |
|
4325 |
else |
|
4326 |
{ |
|
4327 |
iCharWidth = EHalfWidthChar; |
|
4328 |
} |
|
4329 |
UpdateIndicators(); |
|
4330 |
TryChangeModeL(iMode); |
|
4331 |
#ifdef RD_SCALABLE_UI_V2 |
|
4332 |
if (aCommandId == EPenInputJpCmdFullWidth |
|
4333 |
|| aCommandId == EPenInputJpCmdHalfWidth) |
|
4334 |
{ |
|
4335 |
// Re-open pen input window |
|
4336 |
SendEventsToPluginManL( EPluginActivate ); |
|
4337 |
} |
|
4338 |
#endif //RD_SCALABLE_UI_V2 |
|
4339 |
} |
|
4340 |
break; |
|
4341 |
case EJapanFepCmdModeUserDic: |
|
4342 |
case EPenInputJpCmdSaveWord: |
|
4343 |
{ |
|
4344 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4345 |
// User dictionary |
|
4346 |
#ifdef RD_PF_SEC_APPARC |
|
4347 |
// Launch settings app |
|
4348 |
if ( iNullService ) |
|
4349 |
{ |
|
4350 |
delete iNullService; |
|
4351 |
iNullService = NULL; |
|
4352 |
} |
|
4353 |
iNullService = CAknNullService::NewL( KUidUserDictApp, this ); |
|
4354 |
#else |
|
4355 |
CEikProcess* process = CEikonEnv::Static()->Process(); |
|
4356 |
if (iEmbedded) |
|
4357 |
{ |
|
4358 |
process->DestroyDocument(iEmbedded); |
|
4359 |
} |
|
4360 |
#if (defined(SYMBIAN_SUPPORT_UI_FRAMEWORKS_V1) || defined(__SERIES60_27__) || defined(__SERIES60_28__)) |
|
4361 |
iEmbedded = process->AddNewDocumentL(_L("User Dictionary"), KUidUserDictApp); |
|
4362 |
#else |
|
4363 |
iEmbedded = process->AddNewDocumentL(KUidUserDictApp); |
|
4364 |
#endif |
|
4365 |
iEmbedded->NewDocumentL(); |
|
4366 |
iEmbedded->EditL(NULL); |
|
4367 |
#endif //RD_PF_SEC_APPARC |
|
4368 |
} |
|
4369 |
break; |
|
4370 |
case EPenInputJpCmdKutenCode: |
|
4371 |
case EJapanFepCmdModeKutenCodeInput: |
|
4372 |
{ |
|
4373 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4374 |
LaunchKutenCodeQueryL(); |
|
4375 |
#ifdef RD_SCALABLE_UI_V2 |
|
4376 |
if (aCommandId == EPenInputJpCmdKutenCode) |
|
4377 |
{ |
|
4378 |
// Re-open pen input window |
|
4379 |
SendEventsToPluginManL( EPluginActivate ); |
|
4380 |
} |
|
4381 |
#endif //RD_SCALABLE_UI_V2 |
|
4382 |
} |
|
4383 |
break; |
|
4384 |
case EAknCmdEditClearDirectionLeft: |
|
4385 |
case EAknCmdEditClearDirectionRight: |
|
4386 |
{ |
|
4387 |
TInt value = EClearDirectionLeft; |
|
4388 |
if (aCommandId == EAknCmdEditClearDirectionRight) |
|
4389 |
{ |
|
4390 |
value = EClearDirectionRight; |
|
4391 |
} |
|
4392 |
iSharedDataInterface->SetClearDirection(value); |
|
4393 |
} |
|
4394 |
break; |
|
4395 |
case EAknFepSoftkeyCloseWindow: |
|
4396 |
if(IsChineseInputLanguage()) |
|
4397 |
{ |
|
4398 |
TryCloseUiL(); |
|
4399 |
} |
|
4400 |
if (iCcpuMode != ECcpuStateNone) |
|
4401 |
{ |
|
4402 |
ResetCcpuFlags(); |
|
4403 |
||
4404 |
// reset select mode indicators |
|
4405 |
iIndicator->SetCopyMode(EFalse); |
|
4406 |
// update view |
|
4407 |
iPreviousEditingState = EStateNone; |
|
4408 |
UpdateIndicators(); |
|
4409 |
||
4410 |
iUiInterface->DeleteSoftkeys(); |
|
4411 |
break; |
|
4412 |
} |
|
4413 |
case EAknFepSoftkeyCommit: |
|
4414 |
case EAknFepSoftkeySelectCandidate: |
|
4415 |
case EAknFepSoftkeyConvert: |
|
4416 |
case EAknFepSoftkeyOtherModes: |
|
4417 |
case EAknFepSoftkeyRetroActiveHalf: |
|
4418 |
case EAknFepSoftkeyRetroActiveFull: |
|
4419 |
{ |
|
4420 |
FepUI()->HandleCommandL(aCommandId); |
|
4421 |
} |
|
4422 |
break; |
|
4423 |
case EAknFepSoftkeyPredictiveOn: |
|
4424 |
{ |
|
4425 |
iJapanesePredictive = ETrue; |
|
4426 |
iSharedDataInterface->SetJapanesePredictiveTextOn(); |
|
4427 |
iHashKeyMan->SetMode(iMode, ETrue); |
|
4428 |
UpdateIndicators(); |
|
4429 |
FepUI()->HandleCommandL(aCommandId); |
|
4430 |
} |
|
4431 |
break; |
|
4432 |
case EJapanFepCmdModePredictiveOn: |
|
4433 |
{ |
|
4434 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4435 |
HandleChangeInFocus(); |
|
4436 |
if (!iJapanesePredictive) |
|
4437 |
{ |
|
4438 |
LaunchConfirmationNoteL(R_AVKON_JAPANESE_PREDICTIVE_ACTIVATED_NOTE); |
|
4439 |
} |
|
4440 |
iJapanesePredictive = ETrue; |
|
4441 |
TryChangeModeL(EHiraganaKanji); |
|
4442 |
iSharedDataInterface->SetJapanesePredictiveTextOn(); |
|
4443 |
} |
|
4444 |
break; |
|
4445 |
case EJapanFepCmdModePredictiveOff: |
|
4446 |
{ |
|
4447 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4448 |
HandleChangeInFocus(); |
|
4449 |
if (iJapanesePredictive) |
|
4450 |
{ |
|
4451 |
LaunchConfirmationNoteL(R_AVKON_JAPANESE_PREDICTIVE_DEACTIVATED_NOTE); |
|
4452 |
} |
|
4453 |
iJapanesePredictive = EFalse; |
|
4454 |
TryChangeModeL(EHiraganaKanji); |
|
4455 |
iSharedDataInterface->ResetJapanesePredictiveTextOn(); |
|
4456 |
} |
|
4457 |
break; |
|
4458 |
#ifdef RD_SCALABLE_UI_V2 |
|
4459 |
case EPenInputJpCmdPredictiveOn: |
|
4460 |
{ |
|
4461 |
iJapanesePredictive = ETrue; |
|
4462 |
iSharedDataInterface->SetJapanesePredictiveTextOn(); |
|
4463 |
if (iFepPluginManager->PluginInputMode() == EPluginInputModeHwr) |
|
4464 |
{ |
|
4465 |
iSharedDataInterface->SetJapaneseHwrConversion(EJapaneseConversionOn); |
|
4466 |
} |
|
4467 |
} |
|
4468 |
break; |
|
4469 |
case EPenInputJpCmdPredictiveOff: |
|
4470 |
{ |
|
4471 |
iJapanesePredictive = EFalse; |
|
4472 |
iSharedDataInterface->ResetJapanesePredictiveTextOn(); |
|
4473 |
} |
|
4474 |
break; |
|
4475 |
case EPenInputJpCmdConversionOn: |
|
4476 |
{ |
|
4477 |
iSharedDataInterface->SetJapaneseHwrConversion(EJapaneseConversionOn); |
|
4478 |
} |
|
4479 |
break; |
|
4480 |
case EPenInputJpCmdConversionOff: |
|
4481 |
{ |
|
4482 |
iSharedDataInterface->SetJapaneseHwrConversion(EJapaneseConversionOff); |
|
4483 |
} |
|
4484 |
break; |
|
4485 |
#endif //RD_SCALABLE_UI_V2 |
|
4486 |
||
4487 |
// --- commands for Chinese --- |
|
4488 |
case EChinFepCmdModePinyin: |
|
4489 |
case EChinFepCmdModePinyinPhrase: |
|
4490 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4491 |
HandleChangeInFocus(); |
|
4492 |
TryChangeModeL(EPinyin); |
|
4493 |
break; |
|
4494 |
case EChinFepCmdModeZhuyin: |
|
4495 |
case EChinFepCmdModeZhuyinPhrase: |
|
4496 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4497 |
HandleChangeInFocus(); |
|
4498 |
TryChangeModeL(EZhuyin); |
|
4499 |
break; |
|
4500 |
case EChinFepCmdModeStroke: |
|
4501 |
case EChinFepCmdModeStrokePhrase: |
|
4502 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4503 |
HandleChangeInFocus(); |
|
4504 |
TryChangeModeL(EStroke); |
|
4505 |
break; |
|
4506 |
case EChinFepCmdModeCangJie: |
|
4507 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4508 |
HandleChangeInFocus(); |
|
4509 |
TryChangeModeL(ECangJie); |
|
4510 |
break; |
|
4511 |
case EChinFepCmdModeCangJieOption: |
|
4512 |
// Launch CangJie option dialog |
|
4513 |
{ |
|
4514 |
SetStopProcessFocus(ETrue); |
|
4515 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4516 |
TInt newMode = LaunchCangJieOptionDlgL(); |
|
4517 |
SetStopProcessFocus(EFalse); |
|
4518 |
UpdateCangJieState( newMode ); |
|
4519 |
} |
|
4520 |
break; |
|
4521 |
case EChinFepCmdModeLatinUpper: |
|
4522 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4523 |
HandleChangeInFocus(); |
|
4524 |
TryChangeModeL(ELatinUpper); |
|
4525 |
// delete it for support auto update to text-case |
|
4526 |
//SetFlag(EFlagSupressAutoUpdate); |
|
4527 |
iCaseMan->SetCurrentCase(EAknEditorUpperCase); |
|
4528 |
break; |
|
4529 |
case EAknCmdEditModeKorean: |
|
4530 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4531 |
HandleChangeInFocus(); |
|
4532 |
TryChangeModeL(EHangul); |
|
4533 |
// delete it for support auto update to text-case |
|
4534 |
//SetFlag(EFlagSupressAutoUpdate); |
|
4535 |
iCaseMan->SetCurrentCase(EAknEditorUpperCase); |
|
4536 |
break; |
|
4537 |
case EChinFepCmdModeLatinLower: |
|
4538 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4539 |
HandleChangeInFocus(); |
|
4540 |
TryChangeModeL(ELatinLower); |
|
4541 |
// delete it for support auto update to text-case |
|
4542 |
//SetFlag(EFlagSupressAutoUpdate); |
|
4543 |
iCaseMan->SetCurrentCase(EAknEditorLowerCase); |
|
4544 |
break; |
|
4545 |
case EAknCmdEditModeNumber: |
|
4546 |
//if current input is arabic finger hwr, then change the default |
|
4547 |
//number mode. |
|
4548 |
if(iSharedDataInterface->InputTextLanguage() == ELangArabic |
|
4549 |
&& iFepPluginManager->PluginInputMode() == EPluginInputModeFingerHwr) |
|
4550 |
{ |
|
4551 |
iSharedDataInterface->SetDefaultArabicNumberMode(0); |
|
4552 |
HandleChangeInFocus(); |
|
4553 |
SendEventsToPluginManL(EPluginArabicNumModeChanged, 0); |
|
4554 |
break; |
|
4555 |
} |
|
4556 |
case EJapanFepCmdEditModeNumber: |
|
4557 |
case EChinFepCmdModeNumber: |
|
4558 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4559 |
HandleChangeInFocus(); |
|
4560 |
if ( iLanguageCapabilities.iArabicIndicDigitsAllowed |
|
4561 |
|| iLanguageCapabilities.iEasternArabicIndicDigitsAllowed |
|
4562 |
|| iLanguageCapabilities.iIndicDigitsAllowed ) |
|
4563 |
{ |
|
4564 |
iLanguageCapabilities.iLocalDigitType = EDigitTypeWestern; |
|
4565 |
} |
|
4566 |
TryChangeModeL(ENumber); |
|
4567 |
break; |
|
4568 |
case EAknCmdEditModeArabicIndicNumber: |
|
4569 |
//if current input is arabic finger hwr, then change the default |
|
4570 |
//number mode. |
|
4571 |
if(iSharedDataInterface->InputTextLanguage() == ELangArabic |
|
4572 |
&& iFepPluginManager->PluginInputMode() == EPluginInputModeFingerHwr) |
|
4573 |
{ |
|
4574 |
iSharedDataInterface->SetDefaultArabicNumberMode(1); |
|
4575 |
SendEventsToPluginManL(EPluginArabicNumModeChanged, 1); |
|
4576 |
HandleChangeInFocus(); |
|
4577 |
} |
|
4578 |
else |
|
4579 |
{ |
|
4580 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4581 |
HandleChangeInFocus(); |
|
4582 |
iLanguageCapabilities.iLocalDigitType = EDigitTypeArabicIndic; |
|
4583 |
TryChangeModeL(ENativeNumber); |
|
4584 |
} |
|
4585 |
break; |
|
4586 |
/*For Eastern Arabic Numeric*/ |
|
4587 |
case EAknCmdEditModeEasternArabicIndicNumber: |
|
4588 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4589 |
HandleChangeInFocus(); |
|
4590 |
iLanguageCapabilities.iLocalDigitType = EDigitTypeEasternArabicIndic; |
|
4591 |
TryChangeModeL(ENativeNumber); |
|
4592 |
break; |
|
4593 |
/*for Hindi*/ |
|
4594 |
case EAknCmdEditModeIndicNumber: |
|
4595 |
HandleChangeInFocus(); |
|
4596 |
iLanguageCapabilities.iLocalDigitType = EDigitTypeDevanagari; |
|
4597 |
TryChangeModeL(ENativeNumber); |
|
4598 |
break; |
|
4599 |
case EChinFepCmdInstructions: |
|
4600 |
SetStopProcessFocus(ETrue); |
|
4601 |
HandleChangeInFocus(); |
|
4602 |
LaunchHelpTextQueryL(); |
|
4603 |
SetStopProcessFocus(EFalse); |
|
4604 |
break; |
|
4605 |
case EChinFepCmdModeZhuyinFind: |
|
4606 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4607 |
HandleChangeInFocus(); |
|
4608 |
TryChangeModeL(EZhuyinFind); |
|
4609 |
break; |
|
4610 |
case EChinFepCmdModeStrokeFind: |
|
4611 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4612 |
HandleChangeInFocus(); |
|
4613 |
TryChangeModeL(EStrokeFind); |
|
4614 |
break; |
|
4615 |
||
4616 |
// commands for western or common |
|
4617 |
case EJapanFepCmdMultitapPredictiveT9On: |
|
4618 |
case EAknCmdMultitapPredictiveT9On: |
|
4619 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
4620 |
case EAknFepCmdPredActivate: |
|
4621 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
4622 |
SetStopProcessFocus(ETrue, EFalse); |
|
4623 |
HandleChangeInFocus(); |
|
4624 |
#ifdef RD_SCALABLE_UI_V2 |
|
4625 |
if( iFepFullyConstructed && iFepPluginManager) |
|
4626 |
{ |
|
4627 |
iFepPluginManager->SetMenuState(); |
|
4628 |
} |
|
4629 |
#endif |
|
4630 |
if ( !iWesternPredictive ) |
|
4631 |
{ |
|
4632 |
LaunchConfirmationNoteL(R_AVKON_T9_ACTIVATED_NOTE); |
|
4633 |
} |
|
4634 |
SetWesternPredictive(ETrue); |
|
4635 |
SetStopProcessFocus(EFalse); |
|
4636 |
TryChangeModeL(ELatin); |
|
4637 |
break; |
|
4638 |
case EAknCmdT9PredictiveT9Off: |
|
4639 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
4640 |
case EAknFepCmdPredDeactivate: |
|
4641 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
4642 |
SetStopProcessFocus(ETrue, EFalse); |
|
4643 |
HandleChangeInFocus(); |
|
4644 |
#ifdef RD_SCALABLE_UI_V2 |
|
4645 |
if( iFepFullyConstructed && iFepPluginManager) |
|
4646 |
{ |
|
4647 |
iFepPluginManager->SetMenuState(); |
|
4648 |
} |
|
4649 |
#endif |
|
4650 |
if (iMode != ELatin) |
|
4651 |
{ |
|
4652 |
TryChangeModeL(ELatin); |
|
4653 |
} |
|
4654 |
else |
|
4655 |
{ |
|
4656 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
4657 |
RemoveSuggestedAdvanceCompletionL(); |
|
4658 |
#endif // RD_INTELLIGENT_TEXT_INPUT |
|
4659 |
CommitInlineEditL(); |
|
4660 |
} |
|
4661 |
if ( iWesternPredictive ) |
|
4662 |
{ |
|
4663 |
LaunchConfirmationNoteL(R_AVKON_T9_DEACTIVATED_NOTE); |
|
4664 |
} |
|
4665 |
SetWesternPredictive(EFalse); |
|
4666 |
SetStopProcessFocus(EFalse); |
|
4667 |
break; |
|
4668 |
case EAknCmdEditModeEnglish: |
|
4669 |
case EAknCmdEditModeAlpha: |
|
4670 |
case EJapanFepCmdEditModeAlpha: |
|
4671 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4672 |
HandleChangeInFocus(); |
|
4673 |
TryChangeModeL(ELatin); |
|
4674 |
iCaseMan->UpdateCase( ENullNaviEvent ); |
|
4675 |
ClearFlag(EFlagSupressAutoUpdate); |
|
4676 |
break; |
|
4677 |
case EAknCmdEditModeLatinText: |
|
4678 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4679 |
HandleChangeInFocus(); |
|
4680 |
TryChangeModeL(ELatinText); |
|
4681 |
ClearFlag(EFlagSupressAutoUpdate); |
|
4682 |
iCaseMan->SetCurrentCase(EAknEditorTextCase); |
|
4683 |
break; |
|
4684 |
case EAknCmdEditInsertSymbol: |
|
4685 |
case EAknCmdEditInsertSymbolJp: |
|
4686 |
case EAknFepSoftkeySymbol: |
|
4687 |
case EAknCmdEditInsertSmiley: |
|
4688 |
SetCcpuFlag(ECcpuStateSupressCursorMoveToEnd); |
|
4689 |
#ifdef RD_SCALABLE_UI_V2 |
|
4690 |
if (iFepPluginManager && |
|
4691 |
(iFepPluginManager->PluginInputMode() == EPluginInputModeItut || |
|
4692 |
iFepPluginManager->PluginInputMode() == EPluginInputModeFSQ || |
|
4693 |
iFepPluginManager->PluginInputMode() == EPluginInputModeFingerHwr || |
|
4694 |
iFepPluginManager->PluginInputMode() == EPluginInputModePortraitFSQ ) ) |
|
4695 |
{ |
|
4696 |
iFepPluginManager->SetMenuState(); |
|
4697 |
} |
|
4698 |
||
4699 |
#endif //RD_SCALABLE_UI_V2 |
|
4700 |
SetStopProcessFocus(ETrue, EFalse); |
|
4701 |
HandleChangeInFocus(); |
|
4702 |
if (aCommandId == EAknFepSoftkeySymbol) |
|
4703 |
{ |
|
4704 |
SetCcpuFlag(ECcpuStateCbaSymbol); |
|
4705 |
} |
|
4706 |
// Show Thai specific SCT with Thai vowels and tonemarks |
|
4707 |
if ( (iLanguageCapabilities.iInputLanguageCode == ELangThai ) && |
|
4708 |
(iMode!=ENumber && iMode != ENativeNumber ) ) |
|
4709 |
{ |
|
4710 |
TInt resourceId = 0; |
|
4711 |
if (iAknFepThaiSCTSelector) |
|
4712 |
{ |
|
4713 |
resourceId = iAknFepThaiSCTSelector->ThaiSCRResourceId(PreviousChar(),EPtiKeyStar); |
|
4714 |
} |
|
4715 |
LaunchSpecialCharacterTableL(resourceId, |
|
4716 |
aCommandId==EAknCmdEditInsertSymbol, |
|
4717 |
aCommandId==EAknCmdEditInsertSmiley); |
|
4718 |
} |
|
4719 |
else |
|
4720 |
{ |
|
4721 |
LaunchSpecialCharacterTableL(0, |
|
4722 |
aCommandId==EAknCmdEditInsertSymbol, |
|
4723 |
aCommandId==EAknCmdEditInsertSmiley); |
|
4724 |
} |
|
4725 |
SetStopProcessFocus(EFalse); |
|
4726 |
ClearCcpuFlag(ECcpuStateCbaSymbol); |
|
4727 |
break; |
|
4728 |
case EAknFepSoftkeyPrevious: |
|
4729 |
FepUI()->HandleCommandL(aCommandId); |
|
4730 |
break; |
|
4731 |
case EAknFepSoftkeySpell: |
|
4732 |
LaunchEditWordQueryL(); |
|
4733 |
break; |
|
4734 |
case EAknCmdT9PredictiveInsertWord: |
|
4735 |
SetStopProcessFocus(ETrue, EFalse); |
|
4736 |
HandleChangeInFocus(); |
|
4737 |
LaunchInsertWordQueryL(KNullDesC, TCursorSelection(0,0)); |
|
4738 |
SetStopProcessFocus(EFalse); |
|
4739 |
#ifdef RD_SCALABLE_UI_V2 |
|
4740 |
if( iFepFullyConstructed && iFepPluginManager) |
|
4741 |
{ |
|
4742 |
iFepPluginManager->ResetMenuState(); |
|
4743 |
} |
|
4744 |
#endif |
|
4745 |
break; |
|
4746 |
case EAknCmdT9PredictiveEditWord: |
|
4747 |
SetStopProcessFocus( ETrue, EFalse ); |
|
4748 |
HandleChangeInFocus(); |
|
4749 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
4750 |
RemoveSuggestedAdvanceCompletionL(); |
|
4751 |
#endif // RD_INTELLIGENT_TEXT_INPUT |
|
4752 |
LaunchEditWordQueryL(); |
|
4753 |
SetStopProcessFocus(EFalse); |
|
4754 |
#ifdef RD_SCALABLE_UI_V2 |
|
4755 |
if( iFepFullyConstructed && iFepPluginManager ) |
|
4756 |
{ |
|
4757 |
iFepPluginManager->ResetMenuState(); |
|
4758 |
} |
|
4759 |
#endif |
|
4760 |
break; |
|
4761 |
case EAknCmdT9PredictiveMatches: |
|
4762 |
SetStopProcessFocus(ETrue,EFalse); |
|
4763 |
LaunchMatchesPopupListL(); |
|
4764 |
SetStopProcessFocus(EFalse); |
|
4765 |
break; |
|
4766 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
4767 |
case EAknCmdPredictiveAutoWord: |
|
4768 |
if ( !iIsAutoCompleteOn ) |
|
4769 |
{ |
|
4770 |
SetStopProcessFocus(ETrue); |
|
4771 |
LaunchConfirmationNoteL(R_AVKON_PREDICTIVE_AUTOCOMPLETION_ACTIVATED_NOTE); |
|
4772 |
SetStopProcessFocus(EFalse); |
|
4773 |
} |
|
4774 |
iIsAutoCompleteOn = ETrue; |
|
4775 |
iSharedDataInterface->SetPredictiveTextAutoCompleteOn(); |
|
4776 |
#ifdef RD_SCALABLE_UI_V2 |
|
4777 |
if(iFepPluginManager->PluginInputMode() == EPluginInputModeItut) |
|
4778 |
{ |
|
4779 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
4780 |
HandleChangeInFocus(); |
|
4781 |
} |
|
4782 |
#endif |
|
4783 |
UpdateIndicators(); |
|
4784 |
break; |
|
4785 |
case EAknCmdPredictiveNormal: |
|
4786 |
if ( iIsAutoCompleteOn ) |
|
4787 |
{ |
|
4788 |
SetStopProcessFocus(ETrue); |
|
4789 |
LaunchConfirmationNoteL(R_AVKON_PREDICTIVE_AUTOCOMPLETION_DEACTIVATED_NOTE); |
|
4790 |
SetStopProcessFocus(EFalse); |
|
4791 |
} |
|
4792 |
iIsAutoCompleteOn = EFalse; |
|
4793 |
iSharedDataInterface->ResetPredictiveTextAutoCompleteOn(); |
|
4794 |
UpdateIndicators(); |
|
4795 |
break; |
|
4796 |
#endif |
|
4797 |
case EAknCmdInputLanguage: |
|
4798 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
4799 |
case EAknFepCmdPredInputLanguage: |
|
4800 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
4801 |
SetStopProcessFocus(ETrue, EFalse); |
|
4802 |
HandleChangeInFocus(); |
|
4803 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
4804 |
#ifdef FF_DUAL_LANGUAGE_SUPPORT |
|
4805 |
// Currently dual language feature would work correctly for ITUT and Half Qwerty products |
|
4806 |
// Hence the dual language settings should also be displayed only for ITUT and Halfqwerty products |
|
4807 |
if(iKeyboardType == EPtiKeyboard12Key || iKeyboardType == EPtiKeyboardHalfQwerty ) |
|
4808 |
LaunchDualLanguageSettingDialogL(); |
|
4809 |
else |
|
4810 |
{ |
|
4811 |
LaunchLanguagesPopupListL(aCommandId == EAknCmdInputLanguage); |
|
4812 |
iStopProcessFocus = EFalse; |
|
4813 |
} |
|
4814 |
#else // FF_DUAL_LANGUAGE_SUPPORT |
|
4815 |
LaunchLanguagesPopupListL(aCommandId == EAknCmdInputLanguage); |
|
4816 |
//HandleChangeInFocus(); |
|
4817 |
iStopProcessFocus = EFalse; |
|
4818 |
#endif // FF_DUAL_LANGUAGE_SUPPORT |
|
4819 |
#else |
|
4820 |
LaunchLanguagesPopupListL(aCommandId == EAknCmdInputLanguage); |
|
4821 |
HandleChangeInFocus(); |
|
4822 |
iStopProcessFocus = EFalse; |
|
4823 |
#endif |
|
4824 |
break; |
|
4825 |
case EAknEditMenuCmdCutText: |
|
4826 |
StartCcpuModeL(EFalse); |
|
4827 |
if (WesternPredictive()) |
|
4828 |
{ |
|
4829 |
// Remove underlining from predicted word when focus is re-gained. |
|
4830 |
SetCcpuFlag(ECcpuStateUncommitWhenFocused); |
|
4831 |
} |
|
4832 |
SetCcpuFlag(ECcpuStateIgnoreNextFocusChange); |
|
4833 |
SetCcpuFlag(ECcpuStateEdwinInSelectionMode); |
|
4834 |
break; |
|
4835 |
case EAknEditMenuCmdCopyText: |
|
4836 |
StartCcpuModeL(ETrue); |
|
4837 |
if (WesternPredictive()) |
|
4838 |
{ |
|
4839 |
// Remove underlining from predicted word when focus is re-gained. |
|
4840 |
SetCcpuFlag(ECcpuStateUncommitWhenFocused); |
|
4841 |
} |
|
4842 |
SetCcpuFlag(ECcpuStateIgnoreNextFocusChange); |
|
4843 |
SetCcpuFlag(ECcpuStateEdwinInSelectionMode); |
|
4844 |
break; |
|
4845 |
case EAknFepSoftkeyStartCopy: |
|
4846 |
case EAknFepSoftkeyStartCut: |
|
4847 |
{ |
|
4848 |
ResetCcpuFlags(); |
|
4849 |
if (aCommandId == EAknFepSoftkeyStartCopy) |
|
4850 |
{ |
|
4851 |
SetCcpuFlag(ECcpuStateCopy); |
|
4852 |
} |
|
4853 |
else |
|
4854 |
{ |
|
4855 |
SetCcpuFlag(ECcpuStateCut); |
|
4856 |
} |
|
4857 |
||
4858 |
__ASSERT_DEBUG(iUiInterface->SoftkeysExist(), |
|
4859 |
AknFepPanic(EAknFepPanicNoHandleToFepAwareTextEditor)); |
|
4860 |
||
4861 |
TBool update = UpdateCBALabelL(ELeftSoftkeyIndex, KNullCommandId, R_TEXT_SOFTKEY_EMPTY); |
|
4862 |
update |= UpdateCBALabelL(ERightSoftkeyIndex, EAknFepSoftkeyCloseWindow, |
|
4863 |
R_AKNFEP_SOFTKEY_CCPU_CANCEL); |
|
4864 |
update |= UpdateCBALabelL( EMiddleSoftkeyIndex, KNullCommandId, R_TEXT_SOFTKEY_EMPTY ); |
|
4865 |
if (update) |
|
4866 |
{ |
|
4867 |
iUiInterface->DrawSoftkeysNow(); |
|
4868 |
} |
|
4869 |
} |
|
4870 |
break; |
|
4871 |
case EEikCmdEditCopy: |
|
4872 |
case EEikCmdEditCut: |
|
4873 |
{ |
|
4874 |
#ifdef RD_SCALABLE_UI_V2 |
|
4875 |
if (iFepPluginManager && |
|
4876 |
(iFepPluginManager->PluginInputMode() == EPluginInputModeItut || |
|
4877 |
iFepPluginManager->PluginInputMode() == EPluginInputModeFSQ || |
|
4878 |
iFepPluginManager->PluginInputMode() == EPluginInputModeFingerHwr || |
|
4879 |
iFepPluginManager->PluginInputMode() == EPluginInputModePortraitFSQ ) ) |
|
4880 |
{ |
|
4881 |
iFepPluginManager->SetMenuState(EFalse); |
|
4882 |
} |
|
4883 |
||
4884 |
#endif //RD_SCALABLE_UI_V2 |
|
4885 |
SetStopProcessFocus(ETrue, EFalse); |
|
4886 |
HandleCopyCutEventL(aCommandId); |
|
4887 |
SetStopProcessFocus(EFalse); |
|
4888 |
} |
|
4889 |
break; |
|
4890 |
case EEikCmdEditPaste: |
|
4891 |
{ |
|
4892 |
// We have a hindi character in clipboard which can form ligature with the existing text |
|
4893 |
// if pasted. While the input language is English, the cursor aligmment check would not happen. |
|
4894 |
// When selecting Options->Paste, the Fep context at this point is for the menu. |
|
4895 |
// iInputCapabilities for editor context is retrived from CCoeEnv and is restored back |
|
4896 |
// after doing the operation, else FepAwareTextEditor will be true in menu context. |
|
4897 |
if ( (!BidiCursorRequired()) && (!WesternPredictive()) ) |
|
4898 |
{ |
|
4899 |
TCoeInputCapabilities origInputCapabilities = iInputCapabilities; |
|
4900 |
||
4901 |
CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
4902 |
iInputCapabilities = static_cast<const CCoeAppUi*>(coeEnv->AppUi())->InputCapabilities(); |
|
4903 |
||
4904 |
if( !(iInputCapabilities.SupportsSecretText()) ) |
|
4905 |
{ |
|
4906 |
DoCursorDirectionCheckL(); |
|
4907 |
} |
|
4908 |
iInputCapabilities = origInputCapabilities; |
|
4909 |
} |
|
4910 |
} |
|
4911 |
break; |
|
4912 |
||
4913 |
case EAknCmdEditMenuSctSelected: |
|
4914 |
{ |
|
4915 |
SetCcpuFlag(ECcpuStateSupressCursorMoveToEnd); |
|
4916 |
HandleChangeInFocus(); // to re-establish contact with editor |
|
4917 |
||
4918 |
TBuf<ESingleCharacter> charAsDesc(ESingleCharacter); |
|
4919 |
for ( TInt ii = 0; ii < iSctEditChars->Length(); ii++) |
|
4920 |
{ |
|
4921 |
charAsDesc[0]=(TText) (*iSctEditChars)[ii]; |
|
4922 |
if (charAsDesc[0] == TText(0x000A) // 0x000A is line feed |
|
4923 |
|| charAsDesc[0] == CEditableText::EParagraphDelimiter) |
|
4924 |
{ |
|
4925 |
// This is line feed character. Post it to editor and let it decide |
|
4926 |
// if it is valid. |
|
4927 |
if (!(iAknEditorFlags & EAknEditorFlagFindPane) && iSctEditChars->Length() == 1) |
|
4928 |
{ |
|
4929 |
SimulateKeyEventL(EKeyEnter); |
|
4930 |
SimulateKeyEventL(EKeyF19); // Asyncronous case update |
|
4931 |
} |
|
4932 |
} |
|
4933 |
else |
|
4934 |
{ |
|
4935 |
if (CharIsValidInEditor(charAsDesc[0])) |
|
4936 |
{ |
|
4937 |
TCursorSelection cursorSelection(0,0); |
|
4938 |
if ((iAknEditorFlags & EAknEditorFlagMTAutoOverwrite) && |
|
4939 |
iMode == ELatin && !WesternPredictive()) |
|
4940 |
{ |
|
4941 |
TInt edSize = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
4942 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
4943 |
if (iUncommittedText.iCursorPos < edSize && iUncommittedText.Length() == 0) |
|
4944 |
{ |
|
4945 |
cursorSelection = TCursorSelection(iUncommittedText.iCursorPos + 1, |
|
4946 |
iUncommittedText.iAnchorPos); |
|
4947 |
} |
|
4948 |
} |
|
4949 |
||
4950 |
if (EditorHasFreeSpace()) |
|
4951 |
{ |
|
4952 |
InsertTextFromDialogL(charAsDesc, cursorSelection); |
|
4953 |
} |
|
4954 |
||
4955 |
} |
|
4956 |
} |
|
4957 |
||
4958 |
} |
|
4959 |
} |
|
4960 |
break; |
|
4961 |
case EAknCmdTaskSwapper: |
|
4962 |
SendEventsToPluginManL( EPluginFaseSwap, ETrue ); |
|
4963 |
break; |
|
4964 |
||
4965 |
case EAknCmdEditMenuClose: |
|
4966 |
{ |
|
4967 |
// Handle destruction of menu |
|
4968 |
StopDisplayingMenuBar(); |
|
4969 |
} |
|
4970 |
break; |
|
4971 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
4972 |
// Predictive QWERTY (XT9) changes ----> |
|
4973 |
case EAknFepCmdPredMatches: |
|
4974 |
{ |
|
4975 |
HandleChangeInFocus(); // to re-establish contact with editor |
|
4976 |
// Focus current active word in list ----> |
|
4977 |
TInt wordToFocus; |
|
4978 |
iPtiEngine->HandleCommandL( EPtiCommandUserActionGetCurrentIndexOfCandidates, &wordToFocus ); |
|
4979 |
iSListLaunchedFromMenu = ETrue; |
|
4980 |
TKeyEvent candLaunch = {EKeyDownArrow, EStdKeyDownArrow, 0, 0}; |
|
4981 |
CEikonEnv::Static()->WsSession().SimulateKeyEvent(candLaunch); |
|
4982 |
//LaunchCandidatePopupListL( wordToFocus ); |
|
4983 |
} |
|
4984 |
break; |
|
4985 |
case EAknFepCmdPredSettings: |
|
4986 |
LaunchPredictiveSettingDialogL(); |
|
4987 |
break; |
|
4988 |
/* |
|
4989 |
This code is the part of fixing TSW Error |
|
4990 |
"Matches" and "insert word" options are not available under Edit Menu. |
|
4991 |
This is For Insert Word Functionality*/ |
|
4992 |
case EAknEditMenuCmdInsertWord: |
|
4993 |
HandleChangeInFocus(); |
|
4994 |
LaunchInsertWordQueryL(KNullDesC, TCursorSelection(0,0)); |
|
4995 |
break; |
|
4996 |
#ifdef __USER_DICTIONARY_EDITING__ |
|
4997 |
case EAknFepCmdPredEditUserDictionary: |
|
4998 |
if ( IsAutoCompleteOn() ) |
|
4999 |
{ |
|
5000 |
HandleChangeInFocus(); |
|
5001 |
RemoveSuggestedAdvanceCompletionL(); |
|
5002 |
} |
|
5003 |
UiInterface()->LaunchUserDictEditDialogL(); |
|
5004 |
break; |
|
5005 |
#endif //__USER_DICTIONARY_EDITING__ |
|
5006 |
||
5007 |
case EAknFepCmdPredHelp: |
|
5008 |
// Help ID:PREDINPUT_HLP_INPUT |
|
5009 |
{ |
|
5010 |
const TInt KArrayGranularity = 3; |
|
5011 |
CArrayFix<TCoeHelpContext>* contexts = |
|
5012 |
new (ELeave) CArrayFixFlat<TCoeHelpContext>( KArrayGranularity ); |
|
5013 |
CleanupStack::PushL ( contexts ); |
|
5014 |
TUid appuid = { 0x100058EC }; |
|
5015 |
contexts->AppendL( TCoeHelpContext( appuid, KPREDINPUT_HLP_INPUT ) ); |
|
5016 |
CleanupStack::Pop( contexts ); |
|
5017 |
HlpLauncher::LaunchHelpApplicationL( CEikonEnv::Static()->WsSession(), contexts ); |
|
5018 |
} |
|
5019 |
break; |
|
5020 |
// Predictive QWERTY (XT9) changes <---- |
|
5021 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
5022 |
// add for phrase creation user db view. |
|
5023 |
case EAknCmdUserDBDlg: |
|
5024 |
{ |
|
5025 |
HandleChangeInFocus(); |
|
5026 |
LaunchUserDBDlgL(); |
|
5027 |
} |
|
5028 |
break; |
|
5029 |
case EPenInputCmdPreviewOn: |
|
5030 |
{ |
|
5031 |
iSharedDataInterface->SetFepShowVkbPreviewStatus(KTouchInputPreviewOn); |
|
5032 |
SendEventsToPluginManL(EPluginPreview, KTouchInputPreviewOn); |
|
5033 |
} |
|
5034 |
break; |
|
5035 |
case EPenInputCmdPreviewOff: |
|
5036 |
{ |
|
5037 |
iSharedDataInterface->SetFepShowVkbPreviewStatus(KTouchInputPreviewOff); |
|
5038 |
SendEventsToPluginManL(EPluginPreview, KTouchInputPreviewOff); |
|
5039 |
} |
|
5040 |
break; |
|
5041 |
case EPenInputCmdRecognitionWithDictionary: |
|
5042 |
{ |
|
5043 |
SetStopProcessFocus(ETrue); |
|
5044 |
HandleChangeInFocus(); |
|
5045 |
LaunchRecognitionWithDictionaryPopupListL(); |
|
5046 |
HandleChangeInFocus(); |
|
5047 |
iStopProcessFocus = EFalse; |
|
5048 |
} |
|
5049 |
break; |
|
5050 |
case EPenInputCmdHwrInputToPortrait: |
|
5051 |
{ |
|
5052 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
5053 |
HandleChangeInFocus(); |
|
5054 |
SendEventsToPluginManL( EPluginSwitchToPortrait); |
|
5055 |
} |
|
5056 |
break; |
|
5057 |
case EPenInputCmdHwrInputToLandscape: |
|
5058 |
{ |
|
5059 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
5060 |
HandleChangeInFocus(); |
|
5061 |
SendEventsToPluginManL( EPluginSwitchToLandscape); |
|
5062 |
} |
|
5063 |
break; |
|
5064 |
/*case EPenInputCmdSwitchToVkeyBasedInput: |
|
5065 |
{ |
|
5066 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
5067 |
HandleChangeInFocus(); |
|
5068 |
SendEventsToPluginManL( EPluginSwitchMode); |
|
5069 |
} |
|
5070 |
break;*/ |
|
5071 |
case EPenInputCmdWritingSpeed: |
|
5072 |
{ |
|
5073 |
SetStopProcessFocus(ETrue,EFalse); |
|
5074 |
LaunchWritingSpeedPopupListL(); |
|
5075 |
SetStopProcessFocus(EFalse); |
|
5076 |
} |
|
5077 |
break; |
|
5078 |
case EPenInputCmdGuidingLine: |
|
5079 |
{ |
|
5080 |
SetStopProcessFocus(ETrue,EFalse); |
|
5081 |
LaunchGuidingLinePopupListL(); |
|
5082 |
SetStopProcessFocus(EFalse); |
|
5083 |
} |
|
5084 |
break; |
|
5085 |
default: |
|
5086 |
break; |
|
5087 |
} |
|
5088 |
||
5089 |
||
5090 |
StopDisplayingMenuBar(); |
|
5091 |
} |
|
5092 |
||
5093 |
void CAknFepManager::SetEmphasis(CBase* /*aMenuControl*/,TBool aEmphasis) |
|
5094 |
{ |
|
5095 |
if (aEmphasis) |
|
5096 |
{ // opening main menu pane |
|
5097 |
SetFlag(EFlagMenuPaneVisible); |
|
5098 |
if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
5099 |
{ |
|
5100 |
SetFlag(EFlagInlineEditInBackground); |
|
5101 |
} |
|
5102 |
} |
|
5103 |
else |
|
5104 |
{ |
|
5105 |
// The pointer to be cleared when the callback is received on leaving the focus from the menu pane. |
|
5106 |
#ifdef __ITI_VIRTUAL_TOUCH_FIRST_GENERATION_SUPPORT__ |
|
5107 |
iOptionsMenuBar = NULL; |
|
5108 |
#endif |
|
5109 |
ClearFlag(EFlagMenuPaneVisible | EFlagRemoveMatchesMenuItem | EFlagInlineEditInBackground); |
|
5110 |
} |
|
5111 |
} |
|
5112 |
||
5113 |
void CAknFepManager::DynInitMenuBarL(TInt aResourceId, CAknFepUiInterfaceMenuBar* aMenuBar) |
|
5114 |
{ |
|
5115 |
if (iFepFullyConstructed && IsFlagSet(EFlagLaunchEditMenu)) |
|
5116 |
{ |
|
5117 |
aMenuBar->ReplaceAllMenuPanes(R_AVKON_EDIT_MODE_MENU); |
|
5118 |
} |
|
5119 |
||
5120 |
#ifdef RD_SCALABLE_UI_V2 |
|
5121 |
if (iFepFullyConstructed && |
|
5122 |
aResourceId == R_AVKON_PENINPUT_OPTION_MENU_BAR) |
|
5123 |
{ |
|
5124 |
aMenuBar->ReplaceAllMenuPanes(R_AVKON_TOUCH_TOUCHINPUT_MENU); |
|
5125 |
} |
|
5126 |
#endif //RD_SCALABLE_UI_V2 |
|
5127 |
||
5128 |
} |
|
5129 |
||
5130 |
#ifdef RD_SCALABLE_UI_V2 |
|
5131 |
void CAknFepManager::DynInitTouchMenuPaneL(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
5132 |
{ |
|
5133 |
if ( !iFepFullyConstructed ) |
|
5134 |
{ |
|
5135 |
return; |
|
5136 |
} |
|
5137 |
||
5138 |
||
5139 |
if (iFepManState != EAknFepStateNull && |
|
5140 |
iInputCapabilities.FepAwareTextEditor() && |
|
5141 |
!(iAknEditorFlags & EAknEditorFlagFindPane)) |
|
5142 |
{ |
|
5143 |
// 'Input language' menu item on option menu isn't supported in Japanese variant. |
|
5144 |
if (!IsFeatureSupportedJapanese()) |
|
5145 |
{ |
|
5146 |
// Insert 'Input language' item to incoming menu if editor is active on screen and |
|
5147 |
// menu contains 'Help' or 'Exit' item. |
|
5148 |
if (!IsOnlyNumericPermitted()) |
|
5149 |
{ |
|
5150 |
TInt helpIndex; |
|
5151 |
if (aMenuPane->MenuItemExists(EAknCmdHelp, helpIndex) || |
|
5152 |
aMenuPane->MenuItemExists(EAknCmdExit, helpIndex)) |
|
5153 |
{ |
|
5154 |
AddInputLanguageItemL(aMenuPane, helpIndex); |
|
5155 |
} |
|
5156 |
} |
|
5157 |
} |
|
5158 |
} |
|
5159 |
||
5160 |
TInt index; |
|
5161 |
if(aMenuPane->MenuItemExists(EAknCmdEditItemPlaceHolder, index)) |
|
5162 |
{ |
|
5163 |
aMenuPane->DeleteMenuItem(EAknCmdEditItemPlaceHolder); |
|
5164 |
} |
|
5165 |
||
5166 |
ClearFlag(EFlagLaunchEditMenu); |
|
5167 |
||
5168 |
DimInputmodeTouchMenuItems(aMenuPane); |
|
5169 |
} |
|
5170 |
#endif //RD_SCALABLE_UI_V2 |
|
5171 |
void CAknFepManager::DynInitMenuPaneL(TInt aResourceId, CAknFepUiInterfaceMenuPane* aMenuPane) |
|
5172 |
{ |
|
5173 |
if ( !iFepFullyConstructed ) |
|
5174 |
{ |
|
5175 |
return; |
|
5176 |
} |
|
5177 |
||
5178 |
#ifdef __ITI_VIRTUAL_TOUCH_FIRST_GENERATION_SUPPORT__ |
|
5179 |
CAknEdwinState* editorState = NULL; |
|
5180 |
if (iInputCapabilities.FepAwareTextEditor()) |
|
5181 |
{ |
|
5182 |
editorState = EditorState(); |
|
5183 |
} |
|
5184 |
||
5185 |
if (editorState) |
|
5186 |
{ |
|
5187 |
iOptionsMenuBar = iUiInterface->EditorStateMenuBar(editorState); |
|
5188 |
} |
|
5189 |
#endif |
|
5190 |
||
5191 |
SetCcpuFlag(ECcpuStateIgnoreNextEdwinSyncEvent); |
|
5192 |
||
5193 |
if (iFepManState != EAknFepStateNull && |
|
5194 |
iInputCapabilities.FepAwareTextEditor() && |
|
5195 |
!(iAknEditorFlags & EAknEditorFlagFindPane)) |
|
5196 |
{ |
|
5197 |
// 'Input language' menu item on option menu isn't supported in Japanese variant. |
|
5198 |
if (!IsFeatureSupportedJapanese()) |
|
5199 |
{ |
|
5200 |
// Insert 'Input language' item to incoming menu if editor is active on screen and |
|
5201 |
// menu contains 'Help' or 'Exit' item. |
|
5202 |
//Also, no need for writing language/ITI options in telephony's dialer |
|
5203 |
if ( (RProcess().SecureId().iId != KPhoneSecureId) && !IsOnlyNumericPermitted() ) |
|
5204 |
{ |
|
5205 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
5206 |
//This method gets called multiple times - first before the help and exit |
|
5207 |
//commands are populated and finally after these items are added. |
|
5208 |
//So if we have already added the input options menu and/or writing language menu, |
|
5209 |
//remove it. It will get added again to the correct place with the below code. |
|
5210 |
//No need to handle following menu types here. |
|
5211 |
if ( !( R_AVKON_EDIT_MODE_MENU == aResourceId || |
|
5212 |
R_AKNFEP_PRED_INPUT_OPTIONS_SUBMENU == aResourceId || |
|
5213 |
R_AVKON_PREDICTIVE_TEXT_MENU_T9 == aResourceId || |
|
5214 |
R_AVKON_INPUT_MODE_SUB_MENU == aResourceId || |
|
5215 |
R_AKNFEP_EDIT_SUBMENU == aResourceId || |
|
5216 |
R_AVKON_TOUCH_TOUCHINPUT_MENU == aResourceId ) |
|
5217 |
// Add this condition for adding "input options" into the option menu of FSQ. |
|
5218 |
|| ( R_AVKON_TOUCH_TOUCHINPUT_MENU == aResourceId |
|
5219 |
&& iFepPluginManager |
|
5220 |
&& iFepPluginManager->IsSupportITIOnFSQ() ) |
|
5221 |
) |
|
5222 |
{ |
|
5223 |
FindAndRemoveInputOptionsMenuItemL( aMenuPane ); |
|
5224 |
FindAndRemoveEditSubMenuItemL (aMenuPane); |
|
5225 |
AddInputOptionsMenuItemL( aMenuPane ); |
|
5226 |
} |
|
5227 |
#else |
|
5228 |
TInt helpIndex; |
|
5229 |
if ( aMenuPane->MenuItemExists(EAknCmdHelp, helpIndex) || |
|
5230 |
aMenuPane->MenuItemExists(EAknCmdExit, helpIndex) ) |
|
5231 |
{ |
|
5232 |
AddInputLanguageItemL(aMenuPane, helpIndex); |
|
5233 |
} |
|
5234 |
||
5235 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
5236 |
} |
|
5237 |
} |
|
5238 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
5239 |
if ( IsChineseInputLanguage() && |
|
5240 |
( iKeyboardType == EPtiKeyboardQwerty4x10 || |
|
5241 |
iKeyboardType == EPtiKeyboardQwerty3x11 ) ) |
|
5242 |
{ |
|
5243 |
// the follow added for phrase creation |
|
5244 |
TInt iptlanguage; |
|
5245 |
if ( !iIsUserdbdlgActive ) |
|
5246 |
{ |
|
5247 |
aMenuPane->MenuItemExists( EAknCmdInputLanguage, iptlanguage ); |
|
5248 |
AddUserDBDlgItemL( aMenuPane, iptlanguage ); |
|
5249 |
} |
|
5250 |
} |
|
5251 |
#endif |
|
5252 |
||
5253 |
if (!(aResourceId == R_AVKON_EDIT_MODE_MENU || |
|
5254 |
aResourceId == R_AVKON_TOUCH_TOUCHINPUT_MENU || |
|
5255 |
aResourceId == R_AVKON_TOUCH_INDICATOR_EDIT_MODE_MENU)) |
|
5256 |
{ |
|
5257 |
AddEditSubmenuL(aMenuPane); |
|
5258 |
} |
|
5259 |
} |
|
5260 |
||
5261 |
//HWR Hindi, Training application is not available, |
|
5262 |
//Disable Menu option |
|
5263 |
if(aResourceId == R_AVKON_TOUCH_TOUCHINPUT_MENU && |
|
5264 |
iLanguageCapabilities.iInputLanguageCode == ELangHindi) |
|
5265 |
{ |
|
5266 |
aMenuPane->SetItemDimmed(EPenInputCmdHwrTraining, ETrue); |
|
5267 |
} |
|
5268 |
TInt index; |
|
5269 |
if(aMenuPane->MenuItemExists(EAknCmdEditItemPlaceHolder, index)) |
|
5270 |
{ |
|
5271 |
aMenuPane->DeleteMenuItem(EAknCmdEditItemPlaceHolder); |
|
5272 |
} |
|
5273 |
#ifdef RD_SCALABLE_UI_V2 |
|
5274 |
TInt oldPermitModes = -1; |
|
5275 |
if (R_AVKON_TOUCH_TOUCHINPUT_MENU == aResourceId ) |
|
5276 |
{ |
|
5277 |
oldPermitModes = iPermittedInputModes; |
|
5278 |
||
5279 |
if( iFepPluginManager != NULL ) |
|
5280 |
{ |
|
5281 |
iPermittedInputModes = iFepPluginManager->PreviousPermitMode(); |
|
5282 |
} |
|
5283 |
} |
|
5284 |
if( iFepPluginManager != NULL ) |
|
5285 |
{ |
|
5286 |
iFepPluginManager->InitMenuPaneL( iRememberEditorState, aMenuPane, aResourceId ); |
|
5287 |
} |
|
5288 |
if (oldPermitModes != -1) |
|
5289 |
{ |
|
5290 |
iPermittedInputModes = oldPermitModes; |
|
5291 |
} |
|
5292 |
#endif // RD_SCALABLE_UI_V2 |
|
5293 |
switch (aResourceId) |
|
5294 |
{ |
|
5295 |
case R_AVKON_TOUCHINPUT_PREVIEW: |
|
5296 |
{ |
|
5297 |
InitPreviewMenuPane(aMenuPane); |
|
5298 |
} |
|
5299 |
break; |
|
5300 |
case R_AVKON_EDIT_MODE_MENU: |
|
5301 |
case R_AVKON_TOUCH_INDICATOR_EDIT_MODE_MENU: |
|
5302 |
{ |
|
5303 |
ClearFlag(EFlagLaunchEditMenu); |
|
5304 |
||
5305 |
//call comes here when edit key or '*' is pressed and displays avkon edit menu |
|
5306 |
//moving only the essential condition checks in EditSubmenuInUse() here |
|
5307 |
//no need of checking iSharedDataInterface->EditSubmenuInUse() because for devices with edit key |
|
5308 |
//this would return 0 and would not populate CUT and COPY option |
|
5309 |
||
5310 |
TBool tempFlag = ETrue; |
|
5311 |
if ( ( ( RProcess().SecureId().iId == KPhoneSecureId ) && (iQwertyInputMode) ) || |
|
5312 |
( ExtendedInputCapabilities() & |
|
5313 |
CAknExtendedInputCapabilities::EForceEditSubmenuStatusFlagOff) |
|
5314 |
||
5315 |
) |
|
5316 |
{ |
|
5317 |
tempFlag = EFalse; |
|
5318 |
} |
|
5319 |
||
5320 |
if (tempFlag) |
|
5321 |
{ |
|
5322 |
TInt posit(0); |
|
5323 |
||
5324 |
if (!(iAknEditorFlags & EAknEditorFlagFindPane) && |
|
5325 |
iInputCapabilities.FepAwareTextEditor() && |
|
5326 |
aMenuPane->MenuItemExists(EEikCmdEditCut, posit) && |
|
5327 |
!IsOnlyNumericPermitted() |
|
5328 |
) |
|
5329 |
{ |
|
5330 |
if (iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep() > 0 ) |
|
5331 |
{ |
|
5332 |
if (iRememberEditorState && iRememberEditorState->CcpuState() && |
|
5333 |
!iRememberEditorState->CcpuState()->CcpuCanCopy()&& |
|
5334 |
PluginInputMode() != EPluginInputModeItut ) |
|
5335 |
{ |
|
5336 |
TBuf<KMaxFileName> titleStr; |
|
5337 |
StringLoader::Load(titleStr, R_AKNFEP_OPTIONS_EDIT_MENU_CUT_TEXT); |
|
5338 |
||
5339 |
CAknFepUiInterfaceMenuPane::SItemData itemData; |
|
5340 |
||
5341 |
itemData.iCommandId = EAknEditMenuCmdCutText; |
|
5342 |
itemData.iCascadeId = 0; |
|
5343 |
if (titleStr.Length()) |
|
5344 |
{ |
|
5345 |
itemData.iText.Copy(titleStr.Mid(1, titleStr.Length() - 1)); |
|
5346 |
} |
|
5347 |
itemData.iFlags = 0; |
|
5348 |
aMenuPane->InsertMenuItemL(itemData, posit); |
|
5349 |
||
5350 |
titleStr.Zero(); |
|
5351 |
itemData.iText.Zero(); |
|
5352 |
StringLoader::Load(titleStr, R_AKNFEP_OPTIONS_EDIT_MENU_COPY_TEXT); |
|
5353 |
||
5354 |
itemData.iCommandId = EAknEditMenuCmdCopyText; |
|
5355 |
if (titleStr.Length()) |
|
5356 |
{ |
|
5357 |
itemData.iText.Copy(titleStr.Mid(1, titleStr.Length() - 1)); |
|
5358 |
} |
|
5359 |
aMenuPane->InsertMenuItemL(itemData, posit); |
|
5360 |
} |
|
5361 |
else //Hack for browser in case there are some text already selected |
|
5362 |
{ |
|
5363 |
if (iRememberEditorState && iRememberEditorState->CcpuState() ) |
|
5364 |
{ |
|
5365 |
if(iRememberEditorState->CcpuState()->CcpuCanPaste()) |
|
5366 |
aMenuPane->SetItemDimmed(EEikCmdEditPaste,EFalse); |
|
5367 |
if(iRememberEditorState->CcpuState()->CcpuCanCopy()) |
|
5368 |
aMenuPane->SetItemDimmed(EEikCmdEditCopy,EFalse); |
|
5369 |
if(iRememberEditorState->CcpuState()->CcpuCanCut()) |
|
5370 |
aMenuPane->SetItemDimmed(EEikCmdEditCut,EFalse); |
|
5371 |
} |
|
5372 |
} |
|
5373 |
} |
|
5374 |
//if the document size is 0 and there are items in clipboard then dislay Paste item |
|
5375 |
if ( iRememberEditorState && iRememberEditorState->CcpuState() && |
|
5376 |
iRememberEditorState->CcpuState()->CcpuCanPaste()) |
|
5377 |
aMenuPane->SetItemDimmed(EEikCmdEditPaste,EFalse); |
|
5378 |
||
5379 |
} |
|
5380 |
||
5381 |
} |
|
5382 |
||
5383 |
DimInputmodeMenuItems(aMenuPane); |
|
5384 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
5385 |
//Is this an edit menu launched for a western language? |
|
5386 |
if ( R_AVKON_EDIT_MODE_MENU == aResourceId && !IsChineseInputLanguage() |
|
5387 |
&& ELangJapanese != iLanguageCapabilities.iInputLanguageCode ) |
|
5388 |
{ |
|
5389 |
//If this is edit menu (launched from '*' or edit key) and predictive input is allowed, |
|
5390 |
//we need to remove "Input language" and add "Input options" menu item. |
|
5391 |
if (!IsOnlyNumericPermitted() && IsLanguageSupportPrediction() && !(iAknEditorFlags & EAknEditorFlagNoT9)) |
|
5392 |
{ |
|
5393 |
TInt menuitemPos(0); |
|
5394 |
if(aMenuPane->MenuItemExists(EAknCmdEditInsertSmiley,menuitemPos)) // insert after smiley if exist |
|
5395 |
{ |
|
5396 |
AddPredictiveModeEditMenuL(aMenuPane,menuitemPos+1); |
|
5397 |
} |
|
5398 |
else if(aMenuPane->MenuItemExists(EAknCmdEditInsertSymbol,menuitemPos)) // insert after smybol if exist |
|
5399 |
{ |
|
5400 |
AddPredictiveModeEditMenuL(aMenuPane,menuitemPos+1); |
|
5401 |
} |
|
5402 |
} |
|
5403 |
} |
|
5404 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
5405 |
||
5406 |
} |
|
5407 |
break; |
|
5408 |
||
5409 |
case R_AVKON_PREDICTIVE_TEXT_MENU_T9: |
|
5410 |
{ |
|
5411 |
if( (iPtiEngine->NumberOfCandidates() <= 1) && !IsFlagSet(EFlagRemoveMatchesMenuItem ) ) |
|
5412 |
{ |
|
5413 |
SetFlag( EFlagRemoveMatchesMenuItem ); |
|
5414 |
} |
|
5415 |
||
5416 |
if (iMode != ELatin) |
|
5417 |
{ |
|
5418 |
aMenuPane->SetItemDimmed(EAknCmdT9PredictiveInsertWord, ETrue); |
|
5419 |
} |
|
5420 |
if (!IsFlagSet(EFlagInlineEditInBackground)) |
|
5421 |
{ |
|
5422 |
aMenuPane->SetItemDimmed(EAknCmdT9PredictiveMatches, ETrue); |
|
5423 |
aMenuPane->SetItemDimmed(EAknCmdT9PredictiveEditWord, ETrue); |
|
5424 |
} |
|
5425 |
else if (IsFlagSet(EFlagRemoveMatchesMenuItem)) |
|
5426 |
{ |
|
5427 |
aMenuPane->SetItemDimmed(EAknCmdT9PredictiveMatches, ETrue); |
|
5428 |
} |
|
5429 |
break; |
|
5430 |
} |
|
5431 |
case R_AVKON_INPUT_MODE_SUB_MENU: |
|
5432 |
{ |
|
5433 |
if (IsChineseInputLanguage()) |
|
5434 |
{ |
|
5435 |
DoChineseSubMenu(aMenuPane); |
|
5436 |
} |
|
5437 |
break; |
|
5438 |
case R_AKNFEP_EDIT_SUBMENU: |
|
5439 |
DisableEditSubmenuItems(aMenuPane); |
|
5440 |
break; |
|
5441 |
} |
|
5442 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
5443 |
// Predictive QWERTY (XT9) changes ----> |
|
5444 |
case R_AKNFEP_PRED_INPUT_OPTIONS_SUBMENU: |
|
5445 |
{ |
|
5446 |
// This part of code fixing TSW Errors |
|
5447 |
// "Edit word" option is not available under edit menu in ITU-T mode. |
|
5448 |
// "Insert word" Should not be available QWERTY mode. |
|
5449 |
if (IsKoreanInputLanguage() || |
|
5450 |
CurrentInputLangCode() == ELangPrcChinese || |
|
5451 |
CurrentInputLangCode() == ELangTaiwanChinese || |
|
5452 |
CurrentInputLangCode() == ELangHongKongChinese ) |
|
5453 |
{ |
|
5454 |
// No text prediction for korean. |
|
5455 |
aMenuPane->SetItemDimmed(EAknFepCmdPredActivate, ETrue ); |
|
5456 |
aMenuPane->SetItemDimmed(EAknFepCmdPredDeactivate,ETrue ); |
|
5457 |
aMenuPane->SetItemDimmed( EAknFepCmdPredSettings, ETrue ); |
|
5458 |
} |
|
5459 |
else |
|
5460 |
{ |
|
5461 |
aMenuPane->SetItemDimmed( EAknFepCmdPredSettings, EFalse ); |
|
5462 |
if(iSharedDataInterface->PredictiveTextOn()) |
|
5463 |
{ |
|
5464 |
aMenuPane->SetItemDimmed( EAknFepCmdPredActivate, ETrue ); |
|
5465 |
} |
|
5466 |
else |
|
5467 |
{ |
|
5468 |
aMenuPane->SetItemDimmed(EAknFepCmdPredDeactivate,ETrue ); |
|
5469 |
} |
|
5470 |
} |
|
5471 |
} |
|
5472 |
break; |
|
5473 |
||
5474 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
5475 |
default: |
|
5476 |
break; |
|
5477 |
} |
|
5478 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
5479 |
/* |
|
5480 |
This code is the part of fixing TSW Error Edit Menu : |
|
5481 |
"Matches" and "insert word" options are not available under Edit Menu. |
|
5482 |
This is To make visible/invisible the Insert Word in Optios menu & Edit Menu*/ |
|
5483 |
iIsLastResourceEditMenu = aResourceId; |
|
5484 |
#endif |
|
5485 |
} |
|
5486 |
||
5487 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
5488 |
void CAknFepManager::FindAndRemoveInputOptionsMenuItemL( CAknFepUiInterfaceMenuPane* aMenuPane ) |
|
5489 |
{ |
|
5490 |
//Logic : |
|
5491 |
//Loop through each item in menu pane and check if the data |
|
5492 |
//CEikMenuPaneItem::SData::iCascadeId == R_AKNFEP_PRED_INPUT_OPTIONS_SUBMENU |
|
5493 |
//or if CEikMenuPaneItem::SData::iCommandId == EAknCmdInputLanguage |
|
5494 |
//If so, delete that item. |
|
5495 |
TInt numOfMenuItems = aMenuPane->NumberOfItemsInPane(); |
|
5496 |
CEikMenuPane* menuPane = aMenuPane->GetMenuPane(); |
|
5497 |
for (TInt index(0); index < numOfMenuItems ; ++index ) |
|
5498 |
{ |
|
5499 |
CEikMenuPaneItem::SData itemData = menuPane->ItemDataByIndexL( index ); |
|
5500 |
if ( itemData.iCascadeId == R_AKNFEP_PRED_INPUT_OPTIONS_SUBMENU || |
|
5501 |
itemData.iCommandId == EAknCmdInputLanguage || |
|
5502 |
itemData.iCascadeId == R_AVKON_INPUT_MODE_SUB_MENU || |
|
5503 |
( IsChineseInputLanguage() && iSharedDataInterface->QwertyInputMode() && |
|
5504 |
itemData.iCommandId == EChinFepCmdModeCangJieOption ) ) |
|
5505 |
{ |
|
5506 |
menuPane->DeleteBetweenMenuItems( index, index ); |
|
5507 |
//Assumption - there can only be one such item in the menu pane |
|
5508 |
//Hence we can return without going through the remaining items |
|
5509 |
numOfMenuItems = aMenuPane->NumberOfItemsInPane(); |
|
5510 |
index--; |
|
5511 |
} |
|
5512 |
} |
|
5513 |
} |
|
5514 |
||
5515 |
void CAknFepManager::FindAndRemoveEditSubMenuItemL( CAknFepUiInterfaceMenuPane* aMenuPane ) |
|
5516 |
{ |
|
5517 |
//Logic : |
|
5518 |
//Loop through each item in menu pane and check if the data |
|
5519 |
//CEikMenuPaneItem::SData::iCascadeId == R_AKNFEP_EDIT_SUBMENU |
|
5520 |
//If so, delete that item. |
|
5521 |
TInt numOfMenuItems = aMenuPane->NumberOfItemsInPane(); |
|
5522 |
CEikMenuPane* menuPane = aMenuPane->GetMenuPane(); |
|
5523 |
for (TInt index(0); index < numOfMenuItems ; ++index ) |
|
5524 |
{ |
|
5525 |
CEikMenuPaneItem::SData itemData = menuPane->ItemDataByIndexL( index ); |
|
5526 |
if ( itemData.iCascadeId == R_AKNFEP_EDIT_SUBMENU ) |
|
5527 |
{ |
|
5528 |
menuPane->DeleteBetweenMenuItems( index, index ); |
|
5529 |
//Assumption - there can only be one such item in the menu pane |
|
5530 |
//Hence we can return without going through the remaining items |
|
5531 |
return; |
|
5532 |
} |
|
5533 |
} |
|
5534 |
} |
|
5535 |
||
5536 |
void CAknFepManager::AddInputOptionsMenuItemL( CAknFepUiInterfaceMenuPane* aMenuPane ) |
|
5537 |
{ |
|
5538 |
//Logic: |
|
5539 |
//Appropriate location is : |
|
5540 |
// if Avkon Help command exists, then immediately above it |
|
5541 |
// else if Avkon Exit command exists, then immediately above it |
|
5542 |
// else if there are 3 or more items in the Options menu, then 3rd from last |
|
5543 |
// else it is the last item. |
|
5544 |
TInt posToInsertItem( 0 ); |
|
5545 |
//MenuItemExists() will return the index of the item in 2nd parameter |
|
5546 |
//But if item is not found, it is returning the total number of items. |
|
5547 |
if ( ( aMenuPane->MenuItemExists(EAknCmdHelp, posToInsertItem) ) || |
|
5548 |
( aMenuPane->MenuItemExists(EAknCmdExit, posToInsertItem) ) ) |
|
5549 |
{ |
|
5550 |
//do nothing - we already have posToInsertItem with required value |
|
5551 |
} |
|
5552 |
else |
|
5553 |
{ |
|
5554 |
TInt numOfMenuItems = aMenuPane->NumberOfItemsInPane(); |
|
5555 |
if ( numOfMenuItems > 2 ) |
|
5556 |
{ |
|
5557 |
//We should add the new item as third from last, after ignoring |
|
5558 |
//any dimmed items in the menu pane |
|
5559 |
TInt numOfUnDimmedItems(0); |
|
5560 |
//loop from bottom for better performance |
|
5561 |
for (TInt index(numOfMenuItems-1); index >= 0 ; --index ) |
|
5562 |
{ |
|
5563 |
CEikMenuPaneItem::SData itemData = aMenuPane->GetMenuPane()->ItemDataByIndexL( index ); |
|
5564 |
if ( !(itemData.iFlags & EEikMenuItemDimmed) ) |
|
5565 |
{ |
|
5566 |
++numOfUnDimmedItems; |
|
5567 |
} |
|
5568 |
if ( numOfUnDimmedItems == 2 ) |
|
5569 |
{ |
|
5570 |
//We have our position - save it and break from this loop |
|
5571 |
if ( index > 1 ) |
|
5572 |
{ |
|
5573 |
posToInsertItem = index; |
|
5574 |
} |
|
5575 |
else |
|
5576 |
{ |
|
5577 |
//There are two or less items on this menu that will be displayed |
|
5578 |
//Hence, push ITI options to the end of the list: |
|
5579 |
posToInsertItem = numOfMenuItems; |
|
5580 |
} |
|
5581 |
break; |
|
5582 |
} |
|
5583 |
} |
|
5584 |
} |
|
5585 |
else |
|
5586 |
{ |
|
5587 |
posToInsertItem = numOfMenuItems; |
|
5588 |
} |
|
5589 |
} |
|
5590 |
TInt inputOptionsPos = 0; |
|
5591 |
TInt pastePos = 0; |
|
5592 |
||
5593 |
if ( aMenuPane->MenuItemExists( EEikCmdEditPaste, pastePos ) ) |
|
5594 |
{ |
|
5595 |
CEikMenuPaneItem::SData& itemData = aMenuPane->GetMenuPane()->ItemDataByIndexL( pastePos ); |
|
5596 |
if ( !( itemData.iFlags & EEikMenuItemDimmed ) ) |
|
5597 |
{ |
|
5598 |
inputOptionsPos = pastePos + 1; |
|
5599 |
} |
|
5600 |
} |
|
5601 |
||
5602 |
//Now we have the position at which we need to insert the menu item. |
|
5603 |
if ( |
|
5604 |
#ifdef __ITI_VIRTUAL_TOUCH_FIRST_GENERATION_SUPPORT__ |
|
5605 |
iQwertyInputMode && |
|
5606 |
#endif |
|
5607 |
IsLanguageSupportPrediction() && !(iAknEditorFlags & EAknEditorFlagNoT9)) |
|
5608 |
{ |
|
5609 |
AddPredictiveModeOptionsL( aMenuPane, inputOptionsPos ); |
|
5610 |
} |
|
5611 |
else |
|
5612 |
{ |
|
5613 |
AddInputLanguageItemL(aMenuPane, posToInsertItem); |
|
5614 |
} |
|
5615 |
} |
|
5616 |
#endif // RD_INTELLIGENT_TEXT_INPUT |
|
5617 |
||
5618 |
||
5619 |
void CAknFepManager::AddEditSubmenuL(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
5620 |
{ |
|
5621 |
// Adds edit-submenu to options menu when required contidions are met. |
|
5622 |
// Edit-submenu is added if: |
|
5623 |
// 1. There is active editor on screen |
|
5624 |
// 2. Editor contains text or there is text in clipboard. |
|
5625 |
// 3. Editor is not in Find Pane. |
|
5626 |
// |
|
5627 |
// Since menu will have focus, we also need to remeber certain values |
|
5628 |
// to be able to access undelying editor attributes. |
|
5629 |
||
5630 |
CAknEdwinState* editorState = EditorState(); |
|
5631 |
iEditorCcpuStatus = 0; |
|
5632 |
if (editorState && editorState->CcpuState()) |
|
5633 |
{ |
|
5634 |
iEditorCcpuStatus = EditorCcpuStatus(editorState); |
|
5635 |
} |
|
5636 |
else |
|
5637 |
{ |
|
5638 |
// The editor doesn't have ccpu-capability, doen't display the menu. |
|
5639 |
return; |
|
5640 |
} |
|
5641 |
TInt index; |
|
5642 |
if (aMenuPane->MenuItemExists(EAknCmdEditTextMenu, index)) |
|
5643 |
{ |
|
5644 |
return; |
|
5645 |
} |
|
5646 |
||
5647 |
iRememberLength = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
5648 |
||
5649 |
if (iRememberLength > 0 || (iEditorCcpuStatus & ECcpuStatusFlagCanPaste)) |
|
5650 |
{ |
|
5651 |
if (aMenuPane->MenuItemExists(EAknCmdEditItemPlaceHolder, index) || |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
5652 |
aMenuPane->MenuItemExists(EAknCmdInputLanguage, index) || |
44 | 5653 |
aMenuPane->MenuItemExists(EAknCmdHelp, index) || |
5654 |
aMenuPane->MenuItemExists(EAknCmdExit, index)) |
|
5655 |
{ |
|
5656 |
TBuf<KMaxFileName> titleStr; |
|
5657 |
StringLoader::Load(titleStr, R_AKNFEP_OPTIONS_EDIT_SUBMENU_TITLE); |
|
5658 |
||
5659 |
CAknFepUiInterfaceMenuPane::SItemData mData; |
|
5660 |
||
5661 |
mData.iCommandId = EAknCmdEditTextMenu; |
|
5662 |
mData.iCascadeId = R_AKNFEP_EDIT_SUBMENU; |
|
5663 |
mData.iFlags = 0; |
|
5664 |
mData.iText.Copy(titleStr.Mid(1, titleStr.Length() - 1).Left( |
|
5665 |
CAknFepUiInterfaceMenuPane::SItemData::ENominalTextLength)); |
|
5666 |
||
5667 |
aMenuPane->InsertMenuItemL(mData, index); |
|
5668 |
||
5669 |
if(aMenuPane->MenuItemExists(EAknCmdEditItemPlaceHolder, index)) |
|
5670 |
{ |
|
5671 |
aMenuPane->DeleteMenuItem(EAknCmdEditItemPlaceHolder); |
|
5672 |
||
5673 |
} |
|
5674 |
// Remember editor state, because there is no access to it while |
|
5675 |
// menu is on screen. |
|
5676 |
iRememberEditorState = editorState; |
|
5677 |
} |
|
5678 |
} |
|
5679 |
} |
|
5680 |
||
5681 |
||
5682 |
void CAknFepManager::DisableEditSubmenuItems(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
5683 |
{ |
|
5684 |
aMenuPane->SetItemDimmed(EAknEditMenuCmdCopyText, ETrue); |
|
5685 |
aMenuPane->SetItemDimmed(EEikCmdEditCopy, ETrue); |
|
5686 |
aMenuPane->SetItemDimmed(EAknEditMenuCmdCutText, ETrue); |
|
5687 |
aMenuPane->SetItemDimmed(EEikCmdEditCut, ETrue); |
|
5688 |
aMenuPane->SetItemDimmed(EEikCmdEditPaste, ETrue); |
|
5689 |
||
5690 |
if (iRememberLength > 0) |
|
5691 |
{ |
|
5692 |
if (iEditorCcpuStatus & ECcpuStatusFlagCanCopy) |
|
5693 |
{ |
|
5694 |
aMenuPane->SetItemDimmed(EEikCmdEditCopy, EFalse); |
|
5695 |
} |
|
5696 |
else |
|
5697 |
{ |
|
5698 |
aMenuPane->SetItemDimmed(EAknEditMenuCmdCopyText, EFalse); |
|
5699 |
} |
|
5700 |
||
5701 |
if (iEditorCcpuStatus & ECcpuStatusFlagCanCut) |
|
5702 |
{ |
|
5703 |
aMenuPane->SetItemDimmed(EEikCmdEditCut, EFalse); |
|
5704 |
} |
|
5705 |
else |
|
5706 |
{ |
|
5707 |
aMenuPane->SetItemDimmed(EAknEditMenuCmdCutText, EFalse); |
|
5708 |
} |
|
5709 |
} |
|
5710 |
||
5711 |
if (iEditorCcpuStatus & ECcpuStatusFlagCanPaste) |
|
5712 |
{ |
|
5713 |
aMenuPane->SetItemDimmed(EEikCmdEditPaste, EFalse); |
|
5714 |
} |
|
5715 |
} |
|
5716 |
||
5717 |
||
5718 |
void CAknFepManager::StartCcpuModeL(TBool aCopyMode) |
|
5719 |
{ |
|
5720 |
ResetCcpuFlags(); |
|
5721 |
if (!iUiInterface->SoftkeysExist()) |
|
5722 |
{ |
|
5723 |
iUiInterface->CreateSoftkeys(R_AVKON_SOFTKEYS_EMPTY, this); |
|
5724 |
} |
|
5725 |
||
5726 |
TBool update = EFalse; |
|
5727 |
if (aCopyMode) |
|
5728 |
{ |
|
5729 |
SetCcpuFlag(ECcpuStateStartCopy); |
|
5730 |
update = UpdateCBALabelL(ELeftSoftkeyIndex, EAknFepSoftkeyStartCopy, |
|
5731 |
R_AKNFEP_SOFTKEY_CCPU_START); |
|
5732 |
update |= UpdateCBALabelL( EMiddleSoftkeyIndex, EAknFepSoftkeyStartCopy, |
|
5733 |
R_AVKON_SOFTKEY_SELECT_TEXT ); |
|
5734 |
} |
|
5735 |
else |
|
5736 |
{ |
|
5737 |
SetCcpuFlag(ECcpuStateStartCut); |
|
5738 |
update = UpdateCBALabelL(ELeftSoftkeyIndex, EAknFepSoftkeyStartCut, |
|
5739 |
R_AKNFEP_SOFTKEY_CCPU_START); |
|
5740 |
update |= UpdateCBALabelL( EMiddleSoftkeyIndex, EAknFepSoftkeyStartCut, |
|
5741 |
R_AVKON_SOFTKEY_SELECT_TEXT ); |
|
5742 |
} |
|
5743 |
||
5744 |
update |= UpdateCBALabelL(ERightSoftkeyIndex, EAknFepSoftkeyCloseWindow, |
|
5745 |
R_AKNFEP_SOFTKEY_CCPU_CANCEL); |
|
5746 |
||
5747 |
if (update) |
|
5748 |
{ |
|
5749 |
iUiInterface->DrawSoftkeysNow(); |
|
5750 |
} |
|
5751 |
||
5752 |
iIndicator->SetCopyMode(ETrue); |
|
5753 |
UpdateIndicators(); // updates status of indicators |
|
5754 |
} |
|
5755 |
||
5756 |
||
5757 |
TBool CAknFepManager::OkToActivateSelectionMode() const |
|
5758 |
{ |
|
5759 |
if (iFepManState != EAknFepStateNull && |
|
5760 |
iInputCapabilities.FepAwareTextEditor() && |
|
5761 |
!(iAknEditorFlags & EAknEditorFlagFindPane)) |
|
5762 |
{ |
|
5763 |
return ETrue; |
|
5764 |
} |
|
5765 |
||
5766 |
return EFalse; |
|
5767 |
} |
|
5768 |
||
5769 |
||
5770 |
TBool CAknFepManager::HandleCcpuModeKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aEventCode, |
|
5771 |
TKeyResponse& aRetCode, TBool aLongPressFlag) |
|
5772 |
{ |
|
5773 |
TKeyPressLength length = aKeyEvent.iRepeats ? ELongKeyPress : EShortKeyPress; |
|
5774 |
TBool indicLang = TAknFepUiIndicInputManager :: IsIndicLangauge(TLanguage( |
|
5775 |
iLanguageCapabilities.iInputLanguageCode)) |
|
5776 |
#ifdef RD_HINDI_PHONETIC_INPUT |
|
5777 |
|| TAknFepUiIndicInputManager :: IsIndicPhoneticLanguage(TLanguage( |
|
5778 |
iLanguageCapabilities.iInputLanguageCode)) |
|
5779 |
#endif |
|
5780 |
; |
|
5781 |
if(aKeyEvent.iCode == EKeyEscape) |
|
5782 |
return EFalse; |
|
5783 |
if (aEventCode == EEventKey && aKeyEvent.iCode == '*') |
|
5784 |
{ |
|
5785 |
iStarScan = aKeyEvent.iScanCode; |
|
5786 |
} |
|
5787 |
||
5788 |
if ((aKeyEvent.iScanCode == EStdKeyDevice0) |
|
5789 |
|| (aKeyEvent.iScanCode == EStdKeyDevice1)) |
|
5790 |
{ |
|
5791 |
if (HashKeySelectionInUse() |
|
5792 |
&& IsCcpuFlagSet(ECcpuStateHashDown)) |
|
5793 |
{ |
|
5794 |
if (IsCcpuFlagSet(ECcpuStateChangeToPredictionMode)) |
|
5795 |
{ |
|
5796 |
ClearCcpuFlag(ECcpuStateChangeToPredictionMode); |
|
5797 |
if (iModeBefore == ELatin |
|
5798 |
|| iModeBefore == EHiraganaKanji) |
|
5799 |
{ |
|
5800 |
TBool preFlag = IsPredictive(); |
|
5801 |
TryChangePredictiveInputModeL(!preFlag); |
|
5802 |
} |
|
5803 |
else |
|
5804 |
{ |
|
5805 |
TryChangeToModeBeforeL(); |
|
5806 |
} |
|
5807 |
} |
|
5808 |
} |
|
5809 |
// Always let sofkeys fall through. |
|
5810 |
return EFalse; |
|
5811 |
} |
|
5812 |
||
5813 |
if (IsCcpuFlagSet(ECcpuStateSelectionEventPosted)) |
|
5814 |
{ |
|
5815 |
ClearCcpuFlag(ECcpuStateSelectionEventPosted); |
|
5816 |
return EFalse; |
|
5817 |
} |
|
5818 |
||
5819 |
if (HashKeySelectionInUse()) |
|
5820 |
{ |
|
5821 |
if (aKeyEvent.iScanCode == EStdKeyHash && aEventCode == EEventKeyDown |
|
5822 |
&& iInputCapabilities.FepAwareTextEditor()) |
|
5823 |
{ |
|
5824 |
SetCcpuFlag(ECcpuStateHashDown); |
|
5825 |
iHashKeyMan->ResetPreviousSelectionStyleMode(); |
|
5826 |
return EFalse; |
|
5827 |
} |
|
5828 |
||
5829 |
if (!IsOnlyNumericPermitted()) |
|
5830 |
{ |
|
5831 |
if (IsFeatureSupportedJapanese()) |
|
5832 |
{ |
|
5833 |
if (FepUI()->IsValidShiftKeyPress() |
|
5834 |
&& aKeyEvent.iScanCode == iStarScan |
|
5835 |
&& !iQwertyInputMode |
|
5836 |
&& !(iMode == EKatakana && iFepManState == EAknFepStateUIActive)) |
|
5837 |
{ |
|
5838 |
if ( aEventCode == EEventKeyUp && !aLongPressFlag |
|
5839 |
&& !(iMode == ELatin && WesternPredictive() |
|
5840 |
&& iFepManState == EAknFepStateUIActive)) |
|
5841 |
{ |
|
5842 |
if (!IsCcpuFlagSet(ECcpuStateIgnoreStarUp)) |
|
5843 |
{ |
|
5844 |
LaunchSpecialCharacterTableL(); |
|
5845 |
} |
|
5846 |
return EFalse; |
|
5847 |
} |
|
5848 |
else if ( aEventCode == EEventKey |
|
5849 |
&& !aLongPressFlag |
|
5850 |
&& length == ELongKeyPress ) |
|
5851 |
{ |
|
5852 |
LaunchSelectModeMenuL(); |
|
5853 |
aRetCode = EKeyWasConsumed; |
|
5854 |
return ETrue; |
|
5855 |
} |
|
5856 |
} |
|
5857 |
} |
|
5858 |
else |
|
5859 |
{ |
|
5860 |
if ((aKeyEvent.iScanCode == iStarScan && aEventCode == EEventKeyUp && |
|
5861 |
!aLongPressFlag && !iQwertyInputMode) && |
|
5862 |
(!indicLang || WesternPredictive() || (iMode == ENumber || iMode == ENativeNumber) )) |
|
5863 |
{ |
|
5864 |
// Disables *-key on korean multitapping mode |
|
5865 |
if(IsKoreanInputLanguage() && iMode == EHangul) |
|
5866 |
{ |
|
5867 |
SetCcpuFlag(ECcpuStateIgnoreStarUp); |
|
5868 |
} |
|
5869 |
||
5870 |
if (!IsCcpuFlagSet(ECcpuStateIgnoreStarUp)) |
|
5871 |
{ |
|
5872 |
#ifdef RD_SCALABLE_UI_V2 |
|
5873 |
if (iFepPluginManager->CurrentFepInputUI()) |
|
5874 |
{ |
|
5875 |
if (iFepPluginManager->CurrentFepInputUI()->HandleKeyL(EStdKeyNull, EShortKeyPress)) |
|
5876 |
{ |
|
5877 |
return EFalse; |
|
5878 |
} |
|
5879 |
} |
|
5880 |
#endif |
|
5881 |
LaunchSelectModeMenuL(); |
|
5882 |
aRetCode = EKeyWasConsumed; |
|
5883 |
return ETrue; |
|
5884 |
} |
|
5885 |
return EFalse; |
|
5886 |
} |
|
5887 |
else if((aKeyEvent.iScanCode == iStarScan && aEventCode == EEventKey |
|
5888 |
&& !aLongPressFlag && !iQwertyInputMode) |
|
5889 |
&& (indicLang) |
|
5890 |
&& (! WesternPredictive()) |
|
5891 |
&& (length == ELongKeyPress) |
|
5892 |
&& (iMode != ENumber && iMode != ENativeNumber )) |
|
5893 |
{ |
|
5894 |
LaunchSelectModeMenuL(); |
|
5895 |
return EFalse; |
|
5896 |
} |
|
5897 |
} |
|
5898 |
} |
|
5899 |
} |
|
5900 |
||
5901 |
if (IsCcpuFlagSet(ECcpuStateHashDown)) |
|
5902 |
{ |
|
5903 |
if (aEventCode == EEventKey) |
|
5904 |
{ |
|
5905 |
if (aKeyEvent.iScanCode == EStdKeyDownArrow |
|
5906 |
|| aKeyEvent.iScanCode == EStdKeyRightArrow |
|
5907 |
|| aKeyEvent.iScanCode == EStdKeyLeftArrow |
|
5908 |
|| aKeyEvent.iScanCode == EStdKeyUpArrow) |
|
5909 |
{ |
|
5910 |
if (IsFlagSet(EFlagInsideInlineEditingTransaction) && iMode == EHangul) |
|
5911 |
{ |
|
5912 |
CommitInlineEditL(); |
|
5913 |
iPtiEngine->ClearCurrentWord(); |
|
5914 |
} |
|
5915 |
||
5916 |
if ((IsCcpuFlagSet(ECcpuStateStartCopy)) || |
|
5917 |
(IsCcpuFlagSet(ECcpuStateStartCut))) |
|
5918 |
{ |
|
5919 |
aRetCode = EKeyWasConsumed; |
|
5920 |
return ETrue; |
|
5921 |
} |
|
5922 |
||
5923 |
if (!IsCcpuFlagSet(ECcpuStateEdwinInSelectionMode)) |
|
5924 |
{ |
|
5925 |
// User wants to select and not to change mode, so cancel the mode change |
|
5926 |
// caused by initial hash key press. |
|
5927 |
if(!(iAknEditorFlags & EAknEditorFlagFindPane)) |
|
5928 |
{ |
|
5929 |
iHashKeyMan->SetPreviousSelectionStyleModeL(); |
|
5930 |
SetCcpuFlag(ECcpuStateEdwinInSelectionMode); |
|
5931 |
TKeyEvent ccpuStart = {EKeyF21, EStdKeyF21, 0, 0}; |
|
5932 |
// to enable copy/paste support on cba. We simulate via CCoeEnv |
|
5933 |
// to avoid fep SimulateKeyEventL adding shift modifiers |
|
5934 |
CCoeEnv::Static()->SimulateKeyEventL(ccpuStart, EEventKey); |
|
5935 |
} |
|
5936 |
} |
|
5937 |
||
5938 |
// If prediction is changed while pressing hash-key, |
|
5939 |
// it go back previous prediction state. |
|
5940 |
if (IsCcpuFlagSet(ECcpuStateChangeToPredictionMode)) |
|
5941 |
{ |
|
5942 |
ClearCcpuFlag(ECcpuStateChangeToPredictionMode); |
|
5943 |
if (iModeBefore == ELatin |
|
5944 |
|| iModeBefore == EHiraganaKanji) |
|
5945 |
{ |
|
5946 |
TBool preFlag = IsPredictive(); |
|
5947 |
TryChangePredictiveInputModeL(!preFlag); |
|
5948 |
} |
|
5949 |
else |
|
5950 |
{ |
|
5951 |
TryChangeToModeBeforeL(); |
|
5952 |
} |
|
5953 |
} |
|
5954 |
||
5955 |
if (WesternPredictive() && IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
5956 |
{ |
|
5957 |
// This will commit inline edit if it is active for predictive mode. |
|
5958 |
return EFalse; |
|
5959 |
} |
|
5960 |
||
5961 |
aRetCode = EKeyWasNotConsumed; |
|
5962 |
return ETrue; |
|
5963 |
} |
|
5964 |
else if (aKeyEvent.iScanCode == EStdKeyBackspace) |
|
5965 |
{ |
|
5966 |
if (!(aKeyEvent.iModifiers & EStdKeyLeftShift)) |
|
5967 |
{ |
|
5968 |
// Simulate edit key + clear key functionality via hash key in no-edit-key device. |
|
5969 |
TKeyEvent ccpuStart = {127, EStdKeyBackspace, EStdKeyLeftShift, 0}; |
|
5970 |
CCoeEnv::Static()->SimulateKeyEventL(ccpuStart, aEventCode); |
|
5971 |
||
5972 |
aRetCode = EKeyWasConsumed; |
|
5973 |
return ETrue; |
|
5974 |
} |
|
5975 |
else if (!IsCcpuFlagSet(ECcpuStateHashKeyDeleteDone)) |
|
5976 |
{ |
|
5977 |
// Hash key + clear key was pressed, but hash key was released before |
|
5978 |
// changing to selection mode. Need to return to previous mode, because |
|
5979 |
// user didn't want to change input mode. |
|
5980 |
iHashKeyMan->SetPreviousSelectionStyleModeL(); |
|
5981 |
SetCcpuFlag(ECcpuStateHashKeyDeleteDone); |
|
5982 |
} |
|
5983 |
||
5984 |
// If prediction is changed while pressing hash-key, |
|
5985 |
// it go back previous prediction state. |
|
5986 |
if (IsCcpuFlagSet(ECcpuStateChangeToPredictionMode)) |
|
5987 |
{ |
|
5988 |
ClearCcpuFlag(ECcpuStateChangeToPredictionMode); |
|
5989 |
if (iModeBefore == ELatin |
|
5990 |
|| iModeBefore == EHiraganaKanji) |
|
5991 |
{ |
|
5992 |
TBool preFlag = IsPredictive(); |
|
5993 |
TryChangePredictiveInputModeL(!preFlag); |
|
5994 |
} |
|
5995 |
else |
|
5996 |
{ |
|
5997 |
TryChangeToModeBeforeL(); |
|
5998 |
} |
|
5999 |
} |
|
6000 |
||
6001 |
} |
|
6002 |
} |
|
6003 |
else if (aKeyEvent.iScanCode == EStdKeyHash && aEventCode == EEventKeyUp) |
|
6004 |
{ |
|
6005 |
ClearCcpuFlag(ECcpuStateHashDown |
|
6006 |
| ECcpuStateHashKeyDeleteDone |
|
6007 |
| ECcpuStateChangeToPredictionMode); |
|
6008 |
if (IsCcpuFlagSet(ECcpuStateEdwinInSelectionMode)) |
|
6009 |
{ |
|
6010 |
SetCcpuFlag(ECcpuStateSelectionEventPosted); |
|
6011 |
ClearCcpuFlag(ECcpuStateEdwinInSelectionMode); |
|
6012 |
SetFlag(EFlagLongShiftKeyPress); |
|
6013 |
||
6014 |
TKeyEvent ccpuStart = {0, EStdKeyLeftShift, 0, 0}; |
|
6015 |
CCoeEnv::Static()->SimulateKeyEventL(ccpuStart, aEventCode); |
|
6016 |
} |
|
6017 |
||
6018 |
return EFalse; |
|
6019 |
} |
|
6020 |
} |
|
6021 |
||
6022 |
if (IsCcpuFlagSet(ECcpuStateStartCopy | ECcpuStateStartCut)) |
|
6023 |
{ |
|
6024 |
if (aKeyEvent.iScanCode == EStdKeyDevice3 && aEventCode == EEventKey) |
|
6025 |
{ |
|
6026 |
aRetCode = EKeyWasConsumed; |
|
6027 |
if (IsCcpuFlagSet(ECcpuStateStartCopy)) |
|
6028 |
{ |
|
6029 |
ProcessCommandL(EAknFepSoftkeyStartCopy); |
|
6030 |
} |
|
6031 |
else |
|
6032 |
{ |
|
6033 |
ProcessCommandL(EAknFepSoftkeyStartCut); |
|
6034 |
} |
|
6035 |
return ETrue; |
|
6036 |
} |
|
6037 |
else if (aKeyEvent.iScanCode < EStdKeyLeftArrow || |
|
6038 |
aKeyEvent.iScanCode > EStdKeyDownArrow) |
|
6039 |
{ |
|
6040 |
aRetCode = EKeyWasConsumed; |
|
6041 |
return ETrue; |
|
6042 |
} |
|
6043 |
} |
|
6044 |
else if (IsCcpuFlagSet(ECcpuStateCopy | ECcpuStateCut)) |
|
6045 |
{ |
|
6046 |
if ((aKeyEvent.iScanCode >= EStdKeyLeftArrow) && (aKeyEvent.iScanCode <= EStdKeyDownArrow)) |
|
6047 |
{ |
|
6048 |
if (!(aKeyEvent.iModifiers & EModifierShift)) |
|
6049 |
{ |
|
6050 |
TKeyEvent ccpuStart = aKeyEvent; |
|
6051 |
ccpuStart.iModifiers |= EModifierShift; |
|
6052 |
ccpuStart.iModifiers |= EModifierRightShift; |
|
6053 |
CCoeEnv::Static()->SimulateKeyEventL(ccpuStart, aEventCode); |
|
6054 |
||
6055 |
aRetCode = EKeyWasConsumed; |
|
6056 |
return ETrue; |
|
6057 |
} |
|
6058 |
else |
|
6059 |
{ |
|
6060 |
aRetCode = EKeyWasNotConsumed; |
|
6061 |
return ETrue; |
|
6062 |
} |
|
6063 |
} |
|
6064 |
||
6065 |
TCursorSelection cursorSelection; |
|
6066 |
if( iInputCapabilities.FepAwareTextEditor() ) |
|
6067 |
{ |
|
6068 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(cursorSelection); |
|
6069 |
if( (aEventCode == EEventKeyUp) && (cursorSelection.Length() == 0) |
|
6070 |
&& ((aKeyEvent.iScanCode == EStdKeyBackspace) || (aKeyEvent.iCode == EKeyBackspace) |
|
6071 |
|| (aKeyEvent.iScanCode == EStdKeyDelete) || (aKeyEvent.iCode == EKeyDelete))) |
|
6072 |
{ |
|
6073 |
ClearCcpuFlag(ECcpuStateButton); |
|
6074 |
} |
|
6075 |
} |
|
6076 |
if (aKeyEvent.iScanCode != EStdKeyBackspace && aKeyEvent.iCode != EKeyOK) |
|
6077 |
{ |
|
6078 |
aRetCode = EKeyWasConsumed; |
|
6079 |
return ETrue; |
|
6080 |
} |
|
6081 |
else |
|
6082 |
{ |
|
6083 |
if (iInputCapabilities.FepAwareTextEditor()) |
|
6084 |
{ |
|
6085 |
TCursorSelection cursorSelection; |
|
6086 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(cursorSelection); |
|
6087 |
if (cursorSelection.Length() == 0) |
|
6088 |
{ |
|
6089 |
aRetCode = EKeyWasConsumed; |
|
6090 |
return ETrue; |
|
6091 |
} |
|
6092 |
else if (aKeyEvent.iScanCode == EStdKeyBackspace) |
|
6093 |
{ |
|
6094 |
// Selection will be removed, handle cba button state accordingly |
|
6095 |
if (iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep() == |
|
6096 |
cursorSelection.Length()) |
|
6097 |
{ |
|
6098 |
// Whole text was selected and will be removed. Cancel the ccpu mode. |
|
6099 |
ProcessCommandL(EAknFepSoftkeyCloseWindow); |
|
6100 |
} |
|
6101 |
else |
|
6102 |
{ |
|
6103 |
// Part of the text will be removed. Set Cba-buttons to initial ccpu-mode status. |
|
6104 |
__ASSERT_DEBUG(iUiInterface->SoftkeysExist(), |
|
6105 |
AknFepPanic(EAknFepPanicNoHandleToFepAwareTextEditor)); |
|
6106 |
||
6107 |
TBool update = UpdateCBALabelL(ELeftSoftkeyIndex, KNullCommandId, R_TEXT_SOFTKEY_EMPTY); |
|
6108 |
update |= UpdateCBALabelL(ERightSoftkeyIndex, EAknFepSoftkeyCloseWindow, R_AKNFEP_SOFTKEY_CCPU_CANCEL); |
|
6109 |
update |= UpdateCBALabelL( EMiddleSoftkeyIndex, KNullCommandId, R_TEXT_SOFTKEY_EMPTY ); |
|
6110 |
if (update) |
|
6111 |
{ |
|
6112 |
iUiInterface->DrawSoftkeysNow(); |
|
6113 |
} |
|
6114 |
} |
|
6115 |
} |
|
6116 |
} |
|
6117 |
} |
|
6118 |
} |
|
6119 |
||
6120 |
return EFalse; |
|
6121 |
} |
|
6122 |
||
6123 |
||
6124 |
||
6125 |
void CAknFepManager::AddInputLanguageItemL(CAknFepUiInterfaceMenuPane* aMenuPane, TInt aIndex) |
|
6126 |
{ |
|
6127 |
CAknFepUiInterfaceMenuPane::SItemData mData; |
|
6128 |
||
6129 |
TBuf<KMaxFileName> langStr; |
|
6130 |
TInt Inputlangindex; |
|
6131 |
if(!aMenuPane->MenuItemExists(EAknCmdInputLanguage, Inputlangindex)) |
|
6132 |
{ |
|
6133 |
StringLoader::Load(langStr, R_AKNFEP_OPTIONS_INPUT_LANGUAGE); |
|
6134 |
||
6135 |
mData.iCommandId = EAknCmdInputLanguage; |
|
6136 |
mData.iCascadeId = 0; |
|
6137 |
mData.iFlags = 0; |
|
6138 |
mData.iText.Copy(langStr.Mid(1, langStr.Length() - 1).Left(CAknFepUiInterfaceMenuPane::SItemData::ENominalTextLength)); |
|
6139 |
||
6140 |
aMenuPane->InsertMenuItemL(mData, aIndex); |
|
6141 |
} |
|
6142 |
||
6143 |
// Chinese input mode switching from the option menu |
|
6144 |
if (IsChineseInputLanguage() && iSharedDataInterface->QwertyInputMode()) |
|
6145 |
{ |
|
6146 |
// Add Chinese language items |
|
6147 |
langStr.Zero(); |
|
6148 |
||
6149 |
StringLoader::Load(langStr, R_AKNFEP_OPTIONS_INPUT_MODE_CHI); |
|
6150 |
||
6151 |
mData.iCommandId = EAknCmdInputMethod; |
|
6152 |
mData.iCascadeId = R_AVKON_INPUT_MODE_SUB_MENU; |
|
6153 |
mData.iFlags = 0; |
|
6154 |
mData.iText.Copy(langStr.Mid(1, langStr.Length() - 1).Left(CAknFepUiInterfaceMenuPane::SItemData::ENominalTextLength)); |
|
6155 |
||
6156 |
aMenuPane->InsertMenuItemL(mData, ++aIndex); |
|
6157 |
||
6158 |
// Check if the current engine has CangJie feature or not, if not |
|
6159 |
// then CangJie mode becomes invisible, similar impl in IsInputModeAvailable |
|
6160 |
// and DoChineseSubMenu |
|
6161 |
TBool isCangJieSupported = EFalse; |
|
6162 |
MPtiCoreInfo* ptiCoreInfo = iPtiEngine->CoreInfo(EPtiEngineNormalCangjieQwerty); |
|
6163 |
if ( ptiCoreInfo ) |
|
6164 |
{ |
|
6165 |
isCangJieSupported = ptiCoreInfo->CapsBits() & ESupportCangjieInput; |
|
6166 |
} |
|
6167 |
||
6168 |
// Add Hong Kong CangJie option, option available only in HK variant and qwerty mode |
|
6169 |
if ( iLanguageCapabilities.iInputLanguageCode == |
|
6170 |
ELangHongKongChinese && isCangJieSupported ) |
|
6171 |
{ |
|
6172 |
langStr.Zero(); |
|
6173 |
||
6174 |
StringLoader::Load(langStr, R_AKNFEP_OPTIONS_CANGJIE_MODE); |
|
6175 |
||
6176 |
mData.iCommandId = EChinFepCmdModeCangJieOption; |
|
6177 |
mData.iCascadeId = 0; |
|
6178 |
mData.iFlags = 0; |
|
6179 |
mData.iText.Copy(langStr.Mid(1, langStr.Length() - 1).Left(CAknFepUiInterfaceMenuPane::SItemData::ENominalTextLength)); |
|
6180 |
||
6181 |
aMenuPane->InsertMenuItemL(mData, ++aIndex); |
|
6182 |
} |
|
6183 |
} |
|
6184 |
} |
|
6185 |
||
6186 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
6187 |
// Predictive QWERTY (XT9) changes ----> |
|
6188 |
void CAknFepManager::AddPredictiveModeOptionsL(CAknFepUiInterfaceMenuPane* aMenuPane, |
|
6189 |
TInt aIndex ) const |
|
6190 |
{ |
|
6191 |
CAknFepUiInterfaceMenuPane::SItemData mData; |
|
6192 |
||
6193 |
HBufC* inputMenuStr = StringLoader::LoadLC(R_AKNFEP_PRED_OPTIONS_INPUT_OPTIONS); |
|
6194 |
||
6195 |
mData.iCommandId = 0; |
|
6196 |
mData.iCascadeId = R_AKNFEP_PRED_INPUT_OPTIONS_SUBMENU; |
|
6197 |
mData.iFlags = 0; |
|
6198 |
mData.iText.Copy(inputMenuStr->Left(CAknFepUiInterfaceMenuPane::SItemData::ENominalTextLength)); |
|
6199 |
||
6200 |
CleanupStack::PopAndDestroy(inputMenuStr); |
|
6201 |
||
6202 |
aMenuPane->InsertMenuItemL(mData, aIndex); |
|
6203 |
||
6204 |
// Chinese input mode switching from the option menu |
|
6205 |
if (IsChineseInputLanguage() && iSharedDataInterface->QwertyInputMode()) |
|
6206 |
{ |
|
6207 |
// Add Chinese language items |
|
6208 |
TBuf<KMaxFileName> langStr; |
|
6209 |
||
6210 |
langStr.Zero(); |
|
6211 |
||
6212 |
StringLoader::Load(langStr, R_AKNFEP_OPTIONS_INPUT_MODE_CHI); |
|
6213 |
||
6214 |
mData.iCommandId = EAknCmdInputMethod; |
|
6215 |
mData.iCascadeId = R_AVKON_INPUT_MODE_SUB_MENU; |
|
6216 |
mData.iFlags = 0; |
|
6217 |
mData.iText.Copy(langStr.Mid(1, langStr.Length() - 1).Left(CAknFepUiInterfaceMenuPane::SItemData::ENominalTextLength)); |
|
6218 |
||
6219 |
aMenuPane->InsertMenuItemL(mData, ++aIndex); |
|
6220 |
||
6221 |
// Check if the current engine has CangJie feature or not, if not |
|
6222 |
// then CangJie mode becomes invisible, similar impl in IsInputModeAvailable |
|
6223 |
// and DoChineseSubMenu |
|
6224 |
TBool isCangJieSupported = EFalse; |
|
6225 |
MPtiCoreInfo* ptiCoreInfo = iPtiEngine->CoreInfo(EPtiEngineNormalCangjieQwerty); |
|
6226 |
if ( ptiCoreInfo != NULL) |
|
6227 |
{ |
|
6228 |
isCangJieSupported = ptiCoreInfo->CapsBits() & ESupportCangjieInput; |
|
6229 |
} |
|
6230 |
#ifdef __HALF_QWERTY_KEYPAD |
|
6231 |
isCangJieSupported = isCangJieSupported && (iKeyboardType != EPtiKeyboardHalfQwerty); |
|
6232 |
#endif //__HALF_QWERTY_KEYPAD |
|
6233 |
||
6234 |
// Add Hong Kong CangJie option, option available only in HK variant and qwerty mode |
|
6235 |
if ( iLanguageCapabilities.iInputLanguageCode == ELangHongKongChinese && isCangJieSupported ) |
|
6236 |
{ |
|
6237 |
langStr.Zero(); |
|
6238 |
||
6239 |
StringLoader::Load(langStr, R_AKNFEP_OPTIONS_CANGJIE_MODE); |
|
6240 |
||
6241 |
mData.iCommandId = EChinFepCmdModeCangJieOption; |
|
6242 |
mData.iCascadeId = 0; |
|
6243 |
mData.iFlags = 0; |
|
6244 |
mData.iText.Copy(langStr.Mid(1, langStr.Length() - 1).Left(CAknFepUiInterfaceMenuPane::SItemData::ENominalTextLength)); |
|
6245 |
||
6246 |
aMenuPane->InsertMenuItemL(mData, ++aIndex); |
|
6247 |
} |
|
6248 |
} |
|
6249 |
} |
|
6250 |
||
6251 |
void CAknFepManager::AddPredictiveModeEditMenuL(CAknFepUiInterfaceMenuPane* aMenuPane, |
|
6252 |
TInt aIndex ) const |
|
6253 |
{ |
|
6254 |
// Remove Predictive Edit menu option if XT9 options are there ---> |
|
6255 |
aMenuPane->SetItemDimmed(EAknCmdPredictiveTextCascade, ETrue); |
|
6256 |
aMenuPane->SetItemDimmed(EAknCmdMultitapPredictiveT9On, ETrue); |
|
6257 |
// Remove Predictive Edit menu option if XT9 options are there <--- |
|
6258 |
//if current writing language supports prediction then display input options settings --> |
|
6259 |
//if current writing language does not supports prediction then display only input language |
|
6260 |
//option to modify the writing language, when user wants to modify when edit query is launched. <-- |
|
6261 |
TBool isLanguagugeSupportsPrediction = EFalse; |
|
6262 |
switch(iKeyboardType) |
|
6263 |
{ |
|
6264 |
case EPtiKeyboardHalfQwerty: |
|
6265 |
#ifdef __HALF_QWERTY_KEYPAD |
|
6266 |
isLanguagugeSupportsPrediction = (iQwertyInputMode) & (iLanguageCapabilities.iSupportsWesternHalfQwertyPredictive); |
|
6267 |
#endif //__HALF_QWERTY_KEYPAD |
|
6268 |
break; |
|
6269 |
case EPtiKeyboardQwerty4x12: |
|
6270 |
case EPtiKeyboardQwerty4x10: |
|
6271 |
case EPtiKeyboardQwerty3x11: |
|
6272 |
case EPtiKeyboardCustomQwerty: |
|
6273 |
isLanguagugeSupportsPrediction = (iQwertyInputMode) & (iLanguageCapabilities.iSupportsWesternQwertyPredictive); |
|
6274 |
break; |
|
6275 |
case EPtiKeyboardNone: |
|
6276 |
case EPtiKeyboard12Key: |
|
6277 |
isLanguagugeSupportsPrediction = (!iQwertyInputMode) & (iLanguageCapabilities.iSupportsWesternPredictive); |
|
6278 |
break; |
|
6279 |
default: |
|
6280 |
isLanguagugeSupportsPrediction = (!iQwertyInputMode) & (iLanguageCapabilities.iSupportsWesternPredictive); |
|
6281 |
break; |
|
6282 |
} |
|
6283 |
if (isLanguagugeSupportsPrediction && !(iAknEditorFlags & EAknEditorFlagNoT9)) |
|
6284 |
{ |
|
6285 |
aMenuPane->SetItemDimmed(EAknCmdInputLanguage, ETrue); |
|
6286 |
AddPredictiveModeOptionsL(aMenuPane, aIndex); |
|
6287 |
} |
|
6288 |
} |
|
6289 |
// Predictive QWERTY (XT9) changes <---- |
|
6290 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
6291 |
void CAknFepManager::DoChineseSubMenu(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
6292 |
{ |
|
6293 |
// ZhuyinFind & StrokeFind ONLY available for FindEditors |
|
6294 |
if (iAknEditorFlags & EAknEditorFlagForceTransparentFepModes) |
|
6295 |
{ |
|
6296 |
if (iMode == EZhuyinFind) |
|
6297 |
{ |
|
6298 |
aMenuPane->SetItemDimmed(EChinFepCmdModeZhuyinFind, ETrue); |
|
6299 |
} |
|
6300 |
||
6301 |
if (iMode == EStrokeFind) |
|
6302 |
{ |
|
6303 |
aMenuPane->SetItemDimmed(EChinFepCmdModeStrokeFind, ETrue); |
|
6304 |
} |
|
6305 |
} |
|
6306 |
else |
|
6307 |
{ |
|
6308 |
aMenuPane->SetItemDimmed(EChinFepCmdModeZhuyinFind, ETrue); |
|
6309 |
aMenuPane->SetItemDimmed(EChinFepCmdModeStrokeFind, ETrue); |
|
6310 |
} |
|
6311 |
||
6312 |
// Customize menu item for Chinese mainland |
|
6313 |
if (iLanguageCapabilities.iInputLanguageCode == ELangPrcChinese) |
|
6314 |
{ |
|
6315 |
aMenuPane->SetItemDimmed(EChinFepCmdModeCangJie, ETrue); |
|
6316 |
aMenuPane->SetItemDimmed(EChinFepCmdModeZhuyin, ETrue); |
|
6317 |
aMenuPane->SetItemDimmed(EChinFepCmdModeZhuyinFind, ETrue); |
|
6318 |
||
6319 |
if (iMode == EPinyin) |
|
6320 |
{ |
|
6321 |
aMenuPane->SetItemDimmed(EChinFepCmdModePinyin, ETrue); |
|
6322 |
} |
|
6323 |
else if (iMode == EStroke) |
|
6324 |
{ |
|
6325 |
aMenuPane->SetItemDimmed(EChinFepCmdModeStroke, ETrue); |
|
6326 |
} |
|
6327 |
else if (iMode == ELatin) |
|
6328 |
{ |
|
6329 |
aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6330 |
} |
|
6331 |
else |
|
6332 |
return; |
|
6333 |
} |
|
6334 |
// Customize menu item for HongKong |
|
6335 |
else if (iLanguageCapabilities.iInputLanguageCode == ELangHongKongChinese) |
|
6336 |
{ |
|
6337 |
aMenuPane->SetItemDimmed(EChinFepCmdModePinyin, ETrue); |
|
6338 |
aMenuPane->SetItemDimmed(EChinFepCmdModeZhuyin, ETrue); |
|
6339 |
aMenuPane->SetItemDimmed(EChinFepCmdModeZhuyinFind, ETrue); |
|
6340 |
||
6341 |
TBool isCangJieSupported = EFalse; |
|
6342 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
46
bd83ceabce89
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
6343 |
if ( EPtiKeyboardQwerty3x11 == KeyboardLayout() || |
bd83ceabce89
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
6344 |
EPtiKeyboardQwerty4x10 == KeyboardLayout()) |
44 | 6345 |
{ |
6346 |
isCangJieSupported = ETrue; |
|
6347 |
} |
|
6348 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
6349 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
6350 |
#ifdef __HALF_QWERTY_KEYPAD |
|
6351 |
isCangJieSupported = isCangJieSupported && (iKeyboardType != EPtiKeyboardHalfQwerty); |
|
6352 |
#endif //__HALF_QWERTY_KEYPAD |
|
6353 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
6354 |
||
6355 |
// CangJie is only for qwerty mode |
|
6356 |
if ( !iSharedDataInterface->QwertyInputMode() || !isCangJieSupported ) |
|
6357 |
aMenuPane->SetItemDimmed(EChinFepCmdModeCangJie, ETrue); |
|
6358 |
||
6359 |
if (iMode == EStroke) |
|
6360 |
{ |
|
6361 |
aMenuPane->SetItemDimmed(EChinFepCmdModeStroke, ETrue); |
|
6362 |
} |
|
6363 |
else if (iMode == ECangJie) |
|
6364 |
{ |
|
6365 |
aMenuPane->SetItemDimmed(EChinFepCmdModeCangJie, ETrue); |
|
6366 |
} |
|
6367 |
else if (iMode == ELatin) |
|
6368 |
{ |
|
6369 |
aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6370 |
} |
|
6371 |
else |
|
6372 |
return; |
|
6373 |
} |
|
6374 |
// Customize menu item for TaiWan |
|
6375 |
else if (iLanguageCapabilities.iInputLanguageCode == ELangTaiwanChinese) |
|
6376 |
{ |
|
6377 |
aMenuPane->SetItemDimmed(EChinFepCmdModePinyin, ETrue); |
|
6378 |
aMenuPane->SetItemDimmed(EChinFepCmdModeCangJie, ETrue); |
|
6379 |
||
6380 |
if (iMode == EStroke) |
|
6381 |
{ |
|
6382 |
aMenuPane->SetItemDimmed(EChinFepCmdModeStroke, ETrue); |
|
6383 |
} |
|
6384 |
else if (iMode == EZhuyin) |
|
6385 |
{ |
|
6386 |
aMenuPane->SetItemDimmed(EChinFepCmdModeZhuyin, ETrue); |
|
6387 |
} |
|
6388 |
else if (iMode == ELatin) |
|
6389 |
{ |
|
6390 |
aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6391 |
} |
|
6392 |
else |
|
6393 |
return; |
|
6394 |
} |
|
6395 |
else |
|
6396 |
return; |
|
6397 |
} |
|
6398 |
#ifdef RD_SCALABLE_UI_V2 |
|
6399 |
||
6400 |
void CAknFepManager::DoWesternTouchMenu(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
6401 |
{ |
|
6402 |
const TInt inputLanguage = iLanguageCapabilities.iInputLanguageCode; |
|
6403 |
// if mode is already hangul or language is not korean dim korean mode menu item |
|
6404 |
TInt index; |
|
6405 |
||
6406 |
if( iMode == EHangul || inputLanguage != ELangKorean || !(IsModePermitted(EHangul))) |
|
6407 |
{ |
|
6408 |
if ( aMenuPane->MenuItemExists( EAknCmdEditModeKorean, index) ) |
|
6409 |
{ |
|
6410 |
aMenuPane->SetItemDimmed(EAknCmdEditModeKorean, ETrue); |
|
6411 |
} |
|
6412 |
} |
|
6413 |
else |
|
6414 |
{ |
|
6415 |
if ( aMenuPane->MenuItemExists( EAknCmdEditModeKorean, index ) ) |
|
6416 |
{ |
|
6417 |
aMenuPane->SetItemDimmed(EAknCmdEditModeKorean, EFalse); |
|
6418 |
} |
|
6419 |
} |
|
6420 |
// remove Chinese specific items from menu |
|
6421 |
aMenuPane->SetItemDimmed(EAknCmdEditModeAlpha, ETrue); |
|
6422 |
||
6423 |
if (aMenuPane->MenuItemExists(EJapanFepCmdModeUserDic, index)) |
|
6424 |
{ |
|
6425 |
aMenuPane->SetItemDimmed(EJapanFepCmdModeUserDic, ETrue); |
|
6426 |
} |
|
6427 |
||
6428 |
// T9 stuff |
|
6429 |
if (WesternPredictive()) |
|
6430 |
{ |
|
6431 |
aMenuPane->SetItemDimmed(EAknCmdPredictiveTextCascade, EFalse); |
|
6432 |
if(iPtiEngine->CurrentLanguage()->HasInputMode(EPtiEngineWordCompletion)) |
|
6433 |
{ |
|
6434 |
// Disable Autoword Completion feature for Touch Input |
|
6435 |
#ifndef RD_SCALABLE_UI_V2 |
|
6436 |
aMenuPane->SetItemDimmed(EAknCmdPredictiveModeCascade, EFalse); |
|
6437 |
#endif // RD_SCALABLE_UI_V2 |
|
6438 |
} |
|
6439 |
||
6440 |
if (aMenuPane->MenuItemExists(EAknCmdT9PredictiveT9Off, index)) |
|
6441 |
{ |
|
6442 |
aMenuPane->SetItemDimmed(EAknCmdT9PredictiveT9Off, EFalse); |
|
6443 |
} |
|
6444 |
} |
|
6445 |
else |
|
6446 |
{ |
|
6447 |
if ( (iPermittedInputModes & EAknEditorTextInputMode) && |
|
6448 |
!(iAknEditorFlags & EAknEditorFlagNoT9) && |
|
6449 |
iMode == ELatin && |
|
6450 |
!IsKoreanInputLanguage() && |
|
6451 |
iLanguageCapabilities.iSupportsWesternPredictive) |
|
6452 |
{ |
|
6453 |
aMenuPane->SetItemDimmed(EAknCmdMultitapPredictiveT9On, EFalse); |
|
6454 |
} |
|
6455 |
} |
|
6456 |
||
6457 |
if ( ( iMode == ENumber || iMode == ENativeNumber ) && |
|
6458 |
(iPermittedInputModes & (EAknEditorTextInputMode | EAknEditorSecretAlphaInputMode)) ) |
|
6459 |
{ |
|
6460 |
aMenuPane->SetItemDimmed(EAknCmdEditModeAlpha, EFalse); |
|
6461 |
aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6462 |
aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); |
|
6463 |
aMenuPane->SetItemDimmed(EChinFepCmdModeLatinLower, ETrue); |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
6464 |
if( iMode == EHangul || inputLanguage == ELangKorean) |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
6465 |
{ |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
6466 |
TInt index; |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
6467 |
if ( aMenuPane->MenuItemExists( EAknCmdEditModeKorean, index ) ) |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
6468 |
{ |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
6469 |
aMenuPane->SetItemDimmed(EAknCmdEditModeKorean, EFalse); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
6470 |
} |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
6471 |
} |
44 | 6472 |
} |
6473 |
||
6474 |
if ( IsModePermitted(ENumber) ) |
|
6475 |
{ |
|
6476 |
if (( iMode != ENumber || |
|
6477 |
iMode == ENumber && iLanguageCapabilities.iArabicIndicDigitsAllowed && |
|
6478 |
!(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) && |
|
6479 |
(iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic)) |
|
6480 |
|| ( iMode != ENumber || |
|
6481 |
iMode == ENumber && iLanguageCapabilities.iEasternArabicIndicDigitsAllowed && |
|
6482 |
!(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) && |
|
6483 |
(iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic)) |
|
6484 |
||( iMode != ENumber || |
|
6485 |
iMode == ENumber && iLanguageCapabilities.iIndicDigitsAllowed && |
|
6486 |
!(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) && |
|
6487 |
(iLanguageCapabilities.iLocalDigitType == EDigitTypeDevanagari)) && |
|
6488 |
(!(iPermittedInputModes==EAknEditorNumericInputMode))) // hide the menu if number editor |
|
6489 |
||
6490 |
{ |
|
6491 |
aMenuPane->SetItemDimmed(EAknCmdEditModeNumber, EFalse); |
|
6492 |
} |
|
6493 |
} |
|
6494 |
||
6495 |
if ( IsModePermitted( ENativeNumber ) ) |
|
6496 |
{ |
|
6497 |
if ( iLanguageCapabilities.iArabicIndicDigitsAllowed && |
|
6498 |
!(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) && |
|
6499 |
iMode != ENativeNumber ) |
|
6500 |
{ |
|
6501 |
aMenuPane->SetItemDimmed(EAknCmdEditModeArabicIndicNumber, EFalse); |
|
6502 |
} |
|
6503 |
else if ( iLanguageCapabilities.iEasternArabicIndicDigitsAllowed && |
|
6504 |
!(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) && |
|
6505 |
iMode != ENativeNumber ) |
|
6506 |
{ |
|
6507 |
aMenuPane->SetItemDimmed(EAknCmdEditModeEasternArabicIndicNumber, EFalse); |
|
6508 |
} |
|
6509 |
else if( iLanguageCapabilities.iIndicDigitsAllowed && |
|
6510 |
!( iAknEditorFlags & EAknEditorFlagLatinInputModesOnly ) && |
|
6511 |
||
6512 |
iMode != ENativeNumber ) |
|
6513 |
{ |
|
6514 |
aMenuPane->SetItemDimmed(EAknCmdEditModeIndicNumber, EFalse); |
|
6515 |
} |
|
6516 |
} |
|
6517 |
||
6518 |
if (IsAbleToLaunchSCT()) |
|
6519 |
{ |
|
6520 |
if (aMenuPane->MenuItemExists(EAknCmdEditInsertSymbol, index)) |
|
6521 |
{ |
|
6522 |
aMenuPane->SetItemDimmed(EAknCmdEditInsertSymbol, EFalse); |
|
6523 |
} |
|
6524 |
} |
|
6525 |
||
6526 |
if ( iMode != ENumber && iMode != ENativeNumber && |
|
6527 |
iPtiEngine->NumberOfLanguages() > 1 && |
|
6528 |
!(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly)) |
|
6529 |
{ |
|
6530 |
aMenuPane->SetItemDimmed(EAknCmdInputLanguage, EFalse); |
|
6531 |
} |
|
6532 |
||
6533 |
if (iPermittedInputModes == EAknEditorNumericInputMode) |
|
6534 |
{ |
|
6535 |
aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6536 |
aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); |
|
6537 |
aMenuPane->SetItemDimmed(EChinFepCmdModeLatinLower, ETrue); |
|
6538 |
} |
|
6539 |
else if ( (iMode == ELatin || iMode == ENumber || iMode == ENativeNumber ) && |
|
6540 |
(iPermittedInputModes & EAknEditorSecretAlphaInputMode) && |
|
6541 |
!(iPermittedInputModes & EAknEditorTextInputMode)) |
|
6542 |
{ |
|
6543 |
// Text case mode is not available in secret editors. |
|
6544 |
aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6545 |
} |
|
6546 |
||
6547 |
if (iAknEditorFlags & EAknEditorFlagForceTransparentFepModes) |
|
6548 |
{ |
|
6549 |
aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6550 |
aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); |
|
6551 |
} |
|
6552 |
||
6553 |
if (iCaseMan->CurrentCase() == EAknEditorUpperCase) |
|
6554 |
{ |
|
6555 |
aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); |
|
6556 |
} |
|
6557 |
else if (iCaseMan->CurrentCase() == EAknEditorLowerCase) |
|
6558 |
{ |
|
6559 |
aMenuPane->SetItemDimmed(EChinFepCmdModeLatinLower, ETrue); |
|
6560 |
} |
|
6561 |
||
6562 |
aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6563 |
||
6564 |
if (!(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) |
|
6565 |
&& iFepPluginManager->IsNonLatinLanguage(TLanguage(iSharedDataInterface->InputTextLanguage()))) |
|
6566 |
{ |
|
6567 |
aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6568 |
aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); |
|
6569 |
aMenuPane->SetItemDimmed(EChinFepCmdModeLatinLower, ETrue); |
|
6570 |
} |
|
6571 |
if( iMode == EHangul ) |
|
6572 |
{ |
|
6573 |
//aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, EFalse); |
|
6574 |
//aMenuPane->SetItemDimmed(EAknCmdEditModeAlpha, EFalse); |
|
6575 |
||
6576 |
aMenuPane->SetItemDimmed(EAknCmdEditModeEnglish, EFalse); |
|
6577 |
aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); |
|
6578 |
aMenuPane->SetItemDimmed(EChinFepCmdModeLatinLower, ETrue); |
|
6579 |
||
6580 |
} |
|
6581 |
else |
|
6582 |
{ |
|
6583 |
aMenuPane->SetItemDimmed(EAknCmdEditModeEnglish, ETrue); |
|
6584 |
} |
|
6585 |
} |
|
6586 |
||
6587 |
void CAknFepManager::DoChineseTouchMenu(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
6588 |
{ |
|
6589 |
TInt index; |
|
6590 |
if (aMenuPane->MenuItemExists(EAknCmdEditInsertSymbol, index) |
|
6591 |
&& aMenuPane->MenuItemExists(EJapanFepCmdModeUserDic, index)) |
|
6592 |
{ |
|
6593 |
aMenuPane->SetItemDimmed(EJapanFepCmdModeUserDic, ETrue); |
|
6594 |
} |
|
6595 |
||
6596 |
if (WesternPredictive()) |
|
6597 |
{ |
|
6598 |
aMenuPane->SetItemDimmed(EAknCmdPredictiveTextCascade, EFalse); |
|
6599 |
if(iPtiEngine->CurrentLanguage()->HasInputMode(EPtiEngineWordCompletion)) |
|
6600 |
{ |
|
6601 |
// Disable Autoword Completion feature for Touch Input |
|
6602 |
#ifndef RD_SCALABLE_UI_V2 |
|
6603 |
aMenuPane->SetItemDimmed(EAknCmdPredictiveModeCascade, EFalse); |
|
6604 |
#endif // RD_SCALABLE_UI_V2 |
|
6605 |
} |
|
6606 |
||
6607 |
if (aMenuPane->MenuItemExists(EAknCmdT9PredictiveT9Off, index)) |
|
6608 |
{ |
|
6609 |
aMenuPane->SetItemDimmed(EAknCmdT9PredictiveT9Off, EFalse); |
|
6610 |
} |
|
6611 |
} |
|
6612 |
else |
|
6613 |
{ |
|
6614 |
if ( (iPermittedInputModes & EAknEditorTextInputMode) && |
|
6615 |
!(iAknEditorFlags & EAknEditorFlagNoT9) && |
|
6616 |
iMode == ELatin) |
|
6617 |
{ |
|
6618 |
aMenuPane->SetItemDimmed(EAknCmdMultitapPredictiveT9On, EFalse); |
|
6619 |
} |
|
6620 |
} |
|
6621 |
if (IsAbleToLaunchSCT() && |
|
6622 |
aMenuPane->MenuItemExists(EAknCmdEditInsertSymbol, index)) |
|
6623 |
{ |
|
6624 |
aMenuPane->SetItemDimmed(EAknCmdEditInsertSymbol, EFalse); |
|
6625 |
} |
|
6626 |
if( (iFepPluginManager && (iFepPluginManager->PluginInputMode() != EPluginInputModeItut ) ) |
|
6627 |
&& aMenuPane->MenuItemExists(EChinFepCmdInstructions, index) ) |
|
6628 |
{ |
|
6629 |
aMenuPane->SetItemDimmed(EChinFepCmdInstructions, ETrue); |
|
6630 |
} |
|
6631 |
else if ( !(iPermittedInputModes == EAknEditorNumericInputMode || |
|
6632 |
iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) ) |
|
6633 |
{ |
|
6634 |
if (aMenuPane->MenuItemExists(EAknCmdEditInsertSymbol, index)) |
|
6635 |
{ |
|
6636 |
aMenuPane->SetItemDimmed(EChinFepCmdInstructions, EFalse); |
|
6637 |
} |
|
6638 |
} |
|
6639 |
||
6640 |
if ( iMode != ENumber && iPtiEngine->NumberOfLanguages() > 1 && |
|
6641 |
!(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly)) |
|
6642 |
{ |
|
6643 |
aMenuPane->SetItemDimmed(EAknCmdInputLanguage, EFalse); |
|
6644 |
} |
|
6645 |
||
6646 |
if (iPermittedInputModes == EAknEditorNumericInputMode) |
|
6647 |
{ |
|
6648 |
aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6649 |
aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); |
|
6650 |
aMenuPane->SetItemDimmed(EChinFepCmdModeLatinLower, ETrue); |
|
6651 |
} |
|
6652 |
else if ( (iMode == ELatin || iMode == ENumber) && |
|
6653 |
(iPermittedInputModes & EAknEditorSecretAlphaInputMode) && |
|
6654 |
!(iPermittedInputModes & EAknEditorTextInputMode)) |
|
6655 |
{ |
|
6656 |
// Text case mode is not available in secret editors. |
|
6657 |
aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6658 |
} |
|
6659 |
if (iAknEditorFlags & EAknEditorFlagForceTransparentFepModes) |
|
6660 |
{ |
|
6661 |
aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6662 |
aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); |
|
6663 |
} |
|
6664 |
||
6665 |
if ( IsModePermitted(ENumber) && iMode != ENumber ) |
|
6666 |
{ |
|
6667 |
//aMenuPane->SetItemDimmed(EChinFepCmdModeNumber, EFalse); // original statement |
|
6668 |
aMenuPane->SetItemDimmed(EAknCmdEditModeNumber, EFalse); |
|
6669 |
// end modifying |
|
6670 |
} |
|
6671 |
} |
|
6672 |
TBool CAknFepManager::IsChineseInputMode( TInt aMode ) |
|
6673 |
{ |
|
6674 |
return aMode == EPRCFind || aMode == ECangJie || aMode == EZhuyinFind |
|
6675 |
|| aMode == EStrokeFind || aMode == EPinyin || aMode == EZhuyin |
|
6676 |
|| aMode == EStroke; |
|
6677 |
} |
|
6678 |
||
6679 |
#endif //RD_SCALABLE_UI_V2 |
|
6680 |
void CAknFepManager::DoWesternMenu(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
6681 |
{ |
|
6682 |
// remove Chinese specific items from menu |
|
6683 |
aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); |
|
6684 |
aMenuPane->SetItemDimmed(EChinFepCmdModeLatinLower, ETrue); |
|
6685 |
aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6686 |
const TInt inputLanguage = iLanguageCapabilities.iInputLanguageCode; |
|
6687 |
||
6688 |
||
6689 |
TInt pos=-1; |
|
6690 |
||
6691 |
if( aMenuPane->MenuItemExists( EAknCmdEditModeKorean, pos ) ) |
|
6692 |
{ |
|
6693 |
// if mode is already hangul or language is not korean dim korean mode menu item |
|
6694 |
if( iMode == EHangul || inputLanguage != ELangKorean || !(IsModePermitted(EHangul))) |
|
6695 |
{ |
|
6696 |
||
6697 |
aMenuPane->SetItemDimmed(EAknCmdEditModeKorean, ETrue); |
|
6698 |
} |
|
6699 |
else |
|
6700 |
{ |
|
6701 |
aMenuPane->SetItemDimmed(EAknCmdEditModeKorean, EFalse); |
|
6702 |
} |
|
6703 |
} |
|
6704 |
||
6705 |
TInt index; |
|
6706 |
||
6707 |
if (aMenuPane->MenuItemExists(EJapanFepCmdModeUserDic, index)) |
|
6708 |
{ |
|
6709 |
aMenuPane->SetItemDimmed(EJapanFepCmdModeUserDic, ETrue); |
|
6710 |
} |
|
6711 |
||
6712 |
// T9 stuff |
|
6713 |
if (WesternPredictive()) |
|
6714 |
{ |
|
6715 |
aMenuPane->SetItemDimmed(EAknCmdPredictiveTextCascade, EFalse); |
|
6716 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
6717 |
if(iPtiEngine->CurrentLanguage()->HasInputMode(EPtiEngineWordCompletion)) |
|
6718 |
{ |
|
6719 |
// Disable Autoword Completion feature for Touch Input |
|
6720 |
#ifndef RD_SCALABLE_UI_V2 |
|
6721 |
aMenuPane->SetItemDimmed(EAknCmdPredictiveModeCascade, EFalse); |
|
6722 |
#endif // RD_SCALABLE_UI_V2 |
|
6723 |
} |
|
6724 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
6725 |
} |
|
6726 |
else |
|
6727 |
{ |
|
6728 |
if ( (iPermittedInputModes & EAknEditorTextInputMode) && |
|
6729 |
!(iAknEditorFlags & EAknEditorFlagNoT9) && |
|
6730 |
iMode == ELatin && |
|
6731 |
!IsKoreanInputLanguage() && |
|
6732 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
6733 |
// Predictive QWERTY (XT9) changes ----> |
|
6734 |
(( |
|
6735 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
6736 |
iLanguageCapabilities.iSupportsWesternPredictive && !IsKoreanInputLanguage() |
|
6737 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
6738 |
&& !iQwertyInputMode) || |
|
6739 |
(iLanguageCapabilities.iSupportsWesternQwertyPredictive && iQwertyInputMode) |
|
6740 |
) |
|
6741 |
// Predictive QWERTY (XT9) changes <---- |
|
6742 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
6743 |
) |
|
6744 |
{ |
|
6745 |
aMenuPane->SetItemDimmed(EAknCmdMultitapPredictiveT9On, EFalse); |
|
6746 |
} |
|
6747 |
} |
|
6748 |
||
6749 |
if ( ( iMode == ENumber || iMode == ENativeNumber || iMode == EHangul ) && |
|
6750 |
(iPermittedInputModes & (EAknEditorTextInputMode | EAknEditorSecretAlphaInputMode)) ) |
|
6751 |
{ |
|
6752 |
aMenuPane->SetItemDimmed(EAknCmdEditModeAlpha, EFalse); |
|
6753 |
} |
|
6754 |
||
6755 |
if ( IsModePermitted(ENumber) ) |
|
6756 |
{ |
|
6757 |
if ( iMode != ENumber ) // hide the menu if number editor |
|
6758 |
{ |
|
6759 |
aMenuPane->SetItemDimmed(EAknCmdEditModeNumber, EFalse); |
|
6760 |
} |
|
6761 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
6762 |
// Predictive QWERTY (XT9) changes ----> |
|
6763 |
// There's no need for numeric mode when full qwerty keyboard is in use (like in MAXI) |
|
6764 |
if (iQwertyInputMode) |
|
6765 |
{ |
|
6766 |
aMenuPane->SetItemDimmed(EAknCmdEditModeNumber, ETrue); |
|
6767 |
} |
|
6768 |
// Predictive QWERTY (XT9) changes <---- |
|
6769 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
6770 |
} |
|
6771 |
||
6772 |
if ( IsModePermitted(ENativeNumber) && iMode != ENativeNumber) |
|
6773 |
{ |
|
6774 |
if ( iLanguageCapabilities.iArabicIndicDigitsAllowed ) // hide the menu if number editor) |
|
6775 |
{ |
|
6776 |
aMenuPane->SetItemDimmed(EAknCmdEditModeArabicIndicNumber, EFalse); |
|
6777 |
} |
|
6778 |
else if ( iLanguageCapabilities.iEasternArabicIndicDigitsAllowed ) // hide the menu if number editor) |
|
6779 |
{ |
|
6780 |
aMenuPane->SetItemDimmed(EAknCmdEditModeEasternArabicIndicNumber, EFalse); |
|
6781 |
} |
|
6782 |
else if( iLanguageCapabilities.iIndicDigitsAllowed ) // hide the menu if number editor) |
|
6783 |
{ |
|
6784 |
aMenuPane->SetItemDimmed(EAknCmdEditModeIndicNumber, EFalse); |
|
6785 |
} |
|
6786 |
} |
|
6787 |
||
6788 |
if (IsAbleToLaunchSCT()) |
|
6789 |
{ |
|
6790 |
if (aMenuPane->MenuItemExists(EAknCmdEditInsertSymbol, index)) |
|
6791 |
{ |
|
6792 |
aMenuPane->SetItemDimmed(EAknCmdEditInsertSymbol, EFalse); |
|
6793 |
} |
|
6794 |
} |
|
6795 |
TInt writtingLanguage = 0; |
|
6796 |
if ( iMode != ENumber && iMode != ENativeNumber && iPtiEngine->NumberOfLanguages() > 1 && |
|
6797 |
!(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) |
|
6798 |
&& aMenuPane->MenuItemExists( EAknCmdInputLanguage, writtingLanguage ) ) |
|
6799 |
{ |
|
6800 |
aMenuPane->SetItemDimmed(EAknCmdInputLanguage, EFalse); |
|
6801 |
} |
|
6802 |
} |
|
6803 |
||
6804 |
void CAknFepManager::DoChineseMenu(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
6805 |
{ |
|
6806 |
TInt index; |
|
6807 |
if (aMenuPane->MenuItemExists(EAknCmdEditInsertSymbol, index) |
|
6808 |
&& aMenuPane->MenuItemExists(EJapanFepCmdModeUserDic, index)) |
|
6809 |
{ |
|
6810 |
aMenuPane->SetItemDimmed(EJapanFepCmdModeUserDic, ETrue); |
|
6811 |
} |
|
6812 |
||
6813 |
if (WesternPredictive()) |
|
6814 |
{ |
|
6815 |
aMenuPane->SetItemDimmed(EAknCmdPredictiveTextCascade, EFalse); |
|
6816 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
6817 |
if(iPtiEngine->CurrentLanguage()->HasInputMode(EPtiEngineWordCompletion)) |
|
6818 |
{ |
|
6819 |
// Disable Autoword Completion feature for Touch Input |
|
6820 |
#ifndef RD_SCALABLE_UI_V2 |
|
6821 |
aMenuPane->SetItemDimmed(EAknCmdPredictiveModeCascade, EFalse); |
|
6822 |
#endif // RD_SCALABLE_UI_V2 |
|
6823 |
} |
|
6824 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
6825 |
} |
|
6826 |
else |
|
6827 |
{ |
|
6828 |
if ( (iPermittedInputModes & EAknEditorTextInputMode) && |
|
6829 |
!(iAknEditorFlags & EAknEditorFlagNoT9) && |
|
6830 |
iMode == ELatin) |
|
6831 |
{ |
|
6832 |
aMenuPane->SetItemDimmed(EAknCmdMultitapPredictiveT9On, EFalse); |
|
6833 |
} |
|
6834 |
} |
|
6835 |
if (IsAbleToLaunchSCT() && |
|
6836 |
aMenuPane->MenuItemExists(EAknCmdEditInsertSymbol, index)) |
|
6837 |
{ |
|
6838 |
aMenuPane->SetItemDimmed(EAknCmdEditInsertSymbol, EFalse); |
|
6839 |
} |
|
6840 |
if( iQwertyInputMode && aMenuPane->MenuItemExists(EChinFepCmdInstructions, index) ) |
|
6841 |
{ |
|
6842 |
aMenuPane->SetItemDimmed(EChinFepCmdInstructions, ETrue); |
|
6843 |
} |
|
6844 |
else if ( !(iPermittedInputModes == EAknEditorNumericInputMode || |
|
6845 |
iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) ) |
|
6846 |
{ |
|
6847 |
if (aMenuPane->MenuItemExists(EAknCmdEditInsertSymbol, index) |
|
6848 |
&& aMenuPane->MenuItemExists(EChinFepCmdInstructions, index)) |
|
6849 |
{ |
|
6850 |
aMenuPane->SetItemDimmed(EChinFepCmdInstructions, EFalse); |
|
6851 |
} |
|
6852 |
} |
|
6853 |
||
6854 |
if ( (!IsOnlyNumericPermitted()) && iPtiEngine->NumberOfLanguages() > 1 && |
|
6855 |
!(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly)) |
|
6856 |
{ |
|
6857 |
aMenuPane->SetItemDimmed(EAknCmdInputLanguage, EFalse); |
|
6858 |
// the follow added for phrase creation |
|
6859 |
TInt iptlanguage; |
|
6860 |
if ( !iIsUserdbdlgActive |
|
6861 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
6862 |
&& EPtiKeyboardHalfQwerty != KeyboardLayout() |
|
6863 |
#endif |
|
6864 |
&& IsChineseInputLanguage() ) |
|
6865 |
{ |
|
6866 |
aMenuPane->MenuItemExists( EAknCmdInputLanguage, iptlanguage ); |
|
6867 |
MPtiLanguage* ptilang = iPtiEngine->CurrentLanguage(); |
|
6868 |
TInt inputLanguage = (ptilang)? ptilang->LanguageCode() : 0; |
|
6869 |
if (iQwertyInputMode && (inputLanguage == ELangPrcChinese || |
|
6870 |
inputLanguage == ELangHongKongChinese || |
|
6871 |
inputLanguage == ELangTaiwanChinese)) |
|
6872 |
{ |
|
6873 |
TRAP_IGNORE(AddUserDBDlgItemL( aMenuPane, iptlanguage )); |
|
6874 |
} |
|
6875 |
} |
|
6876 |
} |
|
6877 |
||
6878 |
if (iPermittedInputModes == EAknEditorNumericInputMode) |
|
6879 |
{ |
|
6880 |
aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6881 |
aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); |
|
6882 |
aMenuPane->SetItemDimmed(EChinFepCmdModeLatinLower, ETrue); |
|
6883 |
} |
|
6884 |
else if ( (iMode == ELatin || iMode == ENumber) && |
|
6885 |
(iPermittedInputModes & EAknEditorSecretAlphaInputMode) && |
|
6886 |
!(iPermittedInputModes & EAknEditorTextInputMode)) |
|
6887 |
{ |
|
6888 |
// Text case mode is not available in secret editors. |
|
6889 |
aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6890 |
} |
|
6891 |
if (iAknEditorFlags & EAknEditorFlagForceTransparentFepModes) |
|
6892 |
{ |
|
6893 |
aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6894 |
aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); |
|
6895 |
} |
|
6896 |
||
6897 |
if ( IsModePermitted(ENumber) && iMode != ENumber ) |
|
6898 |
{ |
|
6899 |
//aMenuPane->SetItemDimmed(EChinFepCmdModeNumber, EFalse); // original statement |
|
6900 |
aMenuPane->SetItemDimmed(EAknCmdEditModeNumber, EFalse); |
|
6901 |
// end modifying |
|
6902 |
} |
|
6903 |
} |
|
6904 |
||
6905 |
void CAknFepManager::DoJapaneseMenu(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
6906 |
{ |
|
6907 |
// remove Chinese specific items from menu |
|
6908 |
TInt index; |
|
6909 |
if (aMenuPane->MenuItemExists(EAknCmdEditInsertSymbol, index)) |
|
6910 |
{ |
|
6911 |
aMenuPane->SetItemDimmed(EAknCmdEditInsertSymbol, ETrue); |
|
6912 |
} |
|
6913 |
||
6914 |
aMenuPane->SetItemDimmed(EChinFepCmdModeLatinUpper, ETrue); |
|
6915 |
aMenuPane->SetItemDimmed(EChinFepCmdModeLatinLower, ETrue); |
|
6916 |
aMenuPane->SetItemDimmed(EAknCmdEditModeLatinText, ETrue); |
|
6917 |
||
6918 |
if (IsAbleToLaunchSCT() |
|
6919 |
&& !iSharedDataInterface->QwertyInputMode()) |
|
6920 |
{ |
|
6921 |
aMenuPane->SetItemDimmed(EAknCmdEditInsertSymbolJp, EFalse); |
|
6922 |
} |
|
6923 |
||
6924 |
if (IsAbleToLaunchPCT() |
|
6925 |
&& !iSharedDataInterface->QwertyInputMode()) |
|
6926 |
{ |
|
6927 |
aMenuPane->SetItemDimmed(EAknCmdEditInsertPictograph, EFalse); |
|
6928 |
} |
|
6929 |
||
6930 |
if (!(iPermittedInputModes & EAknEditorHiraganaKanjiInputMode) && |
|
6931 |
aMenuPane->MenuItemExists(EJapanFepCmdModeUserDic, index) |
|
6932 |
) |
|
6933 |
{ |
|
6934 |
aMenuPane->SetItemDimmed(EJapanFepCmdModeUserDic, ETrue); |
|
6935 |
} |
|
6936 |
||
6937 |
if (iPermittedInputModes == (EAknEditorSecretAlphaInputMode | EAknEditorNumericInputMode)) |
|
6938 |
{ |
|
6939 |
if (iMode == ELatin) |
|
6940 |
{ |
|
6941 |
aMenuPane->SetItemDimmed(EJapanFepCmdEditModeNumber, EFalse); |
|
6942 |
} |
|
6943 |
else if (iMode == ENumber) |
|
6944 |
{ |
|
6945 |
aMenuPane->SetItemDimmed(EJapanFepCmdEditModeAlpha, EFalse); |
|
6946 |
} |
|
6947 |
} |
|
6948 |
else |
|
6949 |
{ |
|
6950 |
// If the fep is running on the Janapnse User Dictionary Application, |
|
6951 |
// "User Dictionary" in editting options menu is hidden. |
|
6952 |
if (CEikonEnv::Static()->EikAppUi()->Application()) |
|
6953 |
{ |
|
6954 |
if (CEikonEnv::Static()->EikAppUi()->Application()->AppDllUid() == KUidUserDictApp) |
|
6955 |
{ |
|
6956 |
aMenuPane->SetItemDimmed(EJapanFepCmdModeUserDic, ETrue); |
|
6957 |
} |
|
6958 |
} |
|
6959 |
||
6960 |
if (iPermittedInputModes & EAknEditorHiraganaKanjiInputMode) |
|
6961 |
{ |
|
6962 |
aMenuPane->SetItemDimmed(EJapanFepCmdModeKutenCodeInput, EFalse); |
|
6963 |
} |
|
6964 |
||
6965 |
TInt value = iSharedDataInterface->ClearDirection(); |
|
6966 |
if (value == EClearDirectionRight) |
|
6967 |
{ |
|
6968 |
aMenuPane->SetItemDimmed(EAknCmdEditClearDirectionLeft, EFalse); |
|
6969 |
} |
|
6970 |
else |
|
6971 |
{ |
|
6972 |
aMenuPane->SetItemDimmed(EAknCmdEditClearDirectionRight, EFalse); |
|
6973 |
} |
|
6974 |
||
6975 |
if (!iSharedDataInterface->QwertyInputMode()) |
|
6976 |
{ |
|
6977 |
if (IsPredictive(ELatin)) |
|
6978 |
{ |
|
6979 |
aMenuPane->SetItemDimmed(EJapanFepCmdPredictiveTextCascade, EFalse); |
|
6980 |
} |
|
6981 |
else if ((iPermittedInputModes & EAknEditorHalfWidthTextInputMode) |
|
6982 |
&& !(iAknEditorFlags & EAknEditorFlagNoT9)) |
|
6983 |
{ |
|
6984 |
aMenuPane->SetItemDimmed(EJapanFepCmdMultitapPredictiveT9On, EFalse); |
|
6985 |
} |
|
6986 |
} |
|
6987 |
||
6988 |
if (IsPredictive(EHiraganaKanji)) |
|
6989 |
{ |
|
6990 |
aMenuPane->SetItemDimmed(EJapanFepCmdModePredictiveOff, EFalse); |
|
6991 |
} |
|
6992 |
else if((iPermittedInputModes & EAknEditorHiraganaKanjiInputMode) |
|
6993 |
&& !(iAknEditorFlags & EAknEditorFlagNoT9)) |
|
6994 |
{ |
|
6995 |
aMenuPane->SetItemDimmed(EJapanFepCmdModePredictiveOn, EFalse); |
|
6996 |
} |
|
6997 |
||
6998 |
if (iMode != EHiraganaKanji && iPermittedInputModes & EAknEditorHiraganaKanjiInputMode) |
|
6999 |
{ |
|
7000 |
aMenuPane->SetItemDimmed(EJapanFepCmdModeHiragana, EFalse); |
|
7001 |
} |
|
7002 |
||
7003 |
if (iCharWidth == EHalfWidthChar) |
|
7004 |
{ |
|
7005 |
if (iPermittedInputModes & EAknEditorKatakanaInputMode && iMode != EKatakana) |
|
7006 |
{ |
|
7007 |
aMenuPane->SetItemDimmed(EJapanFepCmdModeKatakana, EFalse); |
|
7008 |
} |
|
7009 |
||
7010 |
if (iMode != ELatin && (iPermittedInputModes & EAknEditorHalfWidthTextInputMode |
|
7011 |
|| iPermittedInputModes & EAknEditorSecretAlphaInputMode)) |
|
7012 |
{ |
|
7013 |
aMenuPane->SetItemDimmed(EJapanFepCmdEditModeAlpha, EFalse); |
|
7014 |
} |
|
7015 |
||
7016 |
if (iMode != ENumber |
|
7017 |
&& iPermittedInputModes & EAknEditorNumericInputMode |
|
7018 |
&& !iSharedDataInterface->QwertyInputMode()) |
|
7019 |
{ |
|
7020 |
aMenuPane->SetItemDimmed(EJapanFepCmdEditModeNumber, EFalse); |
|
7021 |
} |
|
7022 |
||
7023 |
if (iMode == EKatakana && iPermittedInputModes & EAknEditorFullWidthKatakanaInputMode) |
|
7024 |
{ |
|
7025 |
aMenuPane->SetItemDimmed(EJapanFepCmdModeFullWidth, EFalse); |
|
7026 |
} |
|
7027 |
||
7028 |
if (iMode == ELatin && !iWesternPredictive |
|
7029 |
&& iPermittedInputModes & EAknEditorFullWidthTextInputMode) |
|
7030 |
{ |
|
7031 |
aMenuPane->SetItemDimmed(EJapanFepCmdModeFullWidth, EFalse); |
|
7032 |
} |
|
7033 |
||
7034 |
if (iMode == ENumber |
|
7035 |
&& iPermittedInputModes & EAknEditorFullWidthNumericInputMode) |
|
7036 |
{ |
|
7037 |
aMenuPane->SetItemDimmed(EJapanFepCmdModeFullWidth, EFalse); |
|
7038 |
} |
|
7039 |
} |
|
7040 |
else // Full width Character |
|
7041 |
{ |
|
7042 |
if (iMode != EKatakana && iPermittedInputModes & EAknEditorFullWidthKatakanaInputMode) |
|
7043 |
{ |
|
7044 |
aMenuPane->SetItemDimmed(EJapanFepCmdModeKatakana, EFalse); |
|
7045 |
} |
|
7046 |
||
7047 |
if (iMode != ELatin && iPermittedInputModes & EAknEditorFullWidthTextInputMode) |
|
7048 |
{ |
|
7049 |
aMenuPane->SetItemDimmed(EJapanFepCmdEditModeAlpha, EFalse); |
|
7050 |
} |
|
7051 |
||
7052 |
if (iMode != ENumber |
|
7053 |
&& iPermittedInputModes & EAknEditorFullWidthNumericInputMode |
|
7054 |
&& !iSharedDataInterface->QwertyInputMode()) |
|
7055 |
{ |
|
7056 |
aMenuPane->SetItemDimmed(EJapanFepCmdEditModeNumber, EFalse); |
|
7057 |
} |
|
7058 |
||
7059 |
if (iMode == EKatakana && iPermittedInputModes & EAknEditorKatakanaInputMode) |
|
7060 |
{ |
|
7061 |
aMenuPane->SetItemDimmed(EJapanFepCmdModeHalfWidth, EFalse); |
|
7062 |
} |
|
7063 |
||
7064 |
if (iMode == ELatin && iPermittedInputModes & EAknEditorFullWidthTextInputMode) |
|
7065 |
{ |
|
7066 |
aMenuPane->SetItemDimmed(EJapanFepCmdModeHalfWidth, EFalse); |
|
7067 |
} |
|
7068 |
||
7069 |
if (iMode == ENumber |
|
7070 |
&& iPermittedInputModes & EAknEditorFullWidthNumericInputMode) |
|
7071 |
{ |
|
7072 |
aMenuPane->SetItemDimmed(EJapanFepCmdModeHalfWidth, EFalse); |
|
7073 |
} |
|
7074 |
} |
|
7075 |
} |
|
7076 |
} |
|
7077 |
||
7078 |
void CAknFepManager::HandlePointerEventInInlineTextL(TPointerEvent::TType /*aType*/, TUint /*aModifiers*/, TInt /*aPositionInInlineText*/) |
|
7079 |
{ |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7080 |
if( iFepPluginManager && iLangMan && iLangMan->IsSplitView() ) |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7081 |
{ |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7082 |
switch ( iFepPluginManager->PluginInputMode() ) |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7083 |
{ |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7084 |
case EPluginInputModeFSQ: |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7085 |
//case EPluginInputModePortraitFSQ: |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7086 |
{ |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7087 |
if ( iExactWordPopupContent ) |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7088 |
{ |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7089 |
iExactWordPopupContent->HidePopUp(); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7090 |
} |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7091 |
|
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7092 |
iFepPluginManager->HandleServerEventL( ESignalShowCandidate ); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7093 |
} |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7094 |
break; |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7095 |
case EPluginInputModeItut: |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7096 |
{ |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7097 |
if( IsExtendedFlagSet( EExtendedFlagPointInNoMatchEditor ) ) |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7098 |
{ |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7099 |
ClearExtendedFlag( EExtendedFlagPointInNoMatchEditor ); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7100 |
iFepPluginManager->HandleServerEventL( ESignalEnterSpellMode ); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7101 |
} |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7102 |
else |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7103 |
{ |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7104 |
iFepPluginManager->EnterMatchSelectionState(); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7105 |
} |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7106 |
} |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7107 |
break; |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7108 |
default: |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7109 |
break; |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7110 |
} |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
7111 |
} |
44 | 7112 |
} |
7113 |
||
7114 |
void CAknFepManager::GetFormatOfFepInlineText(TCharFormat& aFormat, |
|
7115 |
TInt& aNumberOfCharactersWithSameFormat, |
|
7116 |
TInt aPositionOfCharacter) const |
|
7117 |
{ |
|
7118 |
if ( FepUI() ) |
|
7119 |
{ |
|
7120 |
FepUI()->GetFormatOfFepInlineText(aFormat, aNumberOfCharactersWithSameFormat, |
|
7121 |
aPositionOfCharacter); |
|
7122 |
} |
|
7123 |
} |
|
7124 |
||
7125 |
void CAknFepManager::NumberModeChangeGSNotification() |
|
7126 |
{ |
|
7127 |
iLanguageCapabilities.iNumericEditorDigitType = EDigitTypeUnknown; |
|
7128 |
UpdateNumericEditorDigitType(); |
|
7129 |
UpdateLocalDigitMode(); |
|
7130 |
} |
|
7131 |
||
7132 |
void CAknFepManager::HandleChangeInFocusL() |
|
7133 |
{ |
|
7134 |
// Closing SCT has done focus change, so here just reset the flag. |
|
7135 |
// dim state changed, need fetch it again. |
|
7136 |
SendEventsToPluginManL(EPluginEnableFetchDimState); |
|
7137 |
||
7138 |
//The CCPU flag ECcpuStateShiftkeyWasPressedBeforeLosingFocus suggests that the candidate list was closed |
|
7139 |
//with a long key press of shift key. If so then, FEP needs to set the EFlagShiftKeyDepressed for the CCPU mode to work |
|
7140 |
//correctly. The state of the shift state is copied to local variable isToSetShiftKeyStateDown because as a function of change |
|
7141 |
//of focus the FEP clears all the CCPU flags which would reset ECcpuStateShiftkeyWasPressedBeforeLosingFocus also. |
|
7142 |
TBool isToSetShiftKeyStateDown = IsCcpuFlagSet(ECcpuStateShiftkeyWasPressedBeforeLosingFocus); |
|
7143 |
if (!Japanese() || iFepManState != EAknFepStateUIActive) |
|
7144 |
{ |
|
7145 |
if (IsCcpuFlagSet(ECcpuStateIgnoreNextFocusChange)) |
|
7146 |
{ |
|
7147 |
// The focus event was caused by menu selection, don't clear all ccpu flags. |
|
7148 |
ClearCcpuFlag(ECcpuStateIgnoreNextFocusChange); |
|
7149 |
} |
|
7150 |
else |
|
7151 |
{ |
|
7152 |
if((HashKeySelectionInUse() && IsCcpuFlagSet(ECcpuStateHashDown) |
|
7153 |
&& IsCcpuFlagSet(ECcpuStateEdwinInSelectionMode))) |
|
7154 |
{ |
|
7155 |
ClearCcpuFlag(ECcpuStateHashDown); |
|
7156 |
SetCcpuFlag(ECcpuStateSelectionEventPosted); |
|
7157 |
ClearCcpuFlag(ECcpuStateEdwinInSelectionMode); |
|
7158 |
SetFlag(EFlagLongShiftKeyPress); |
|
7159 |
TKeyEvent ccpuStart = {0, EStdKeyLeftShift, 0, 0}; |
|
7160 |
CCoeEnv::Static()->SimulateKeyEventL(ccpuStart, EEventKeyUp); |
|
7161 |
} |
|
7162 |
else |
|
7163 |
{ |
|
7164 |
TBool isToSupressCursorMove = IsCcpuFlagSet(ECcpuStateSupressCursorMoveToEnd); |
|
7165 |
TBool isCommitPredictiveWord = IsCcpuFlagSet(ECcpuStataCommitPredictiveWord); |
|
7166 |
CancelCcpuMode(); |
|
7167 |
if(isToSupressCursorMove) |
|
7168 |
SetCcpuFlag(ECcpuStateSupressCursorMoveToEnd); |
|
7169 |
if(isCommitPredictiveWord) |
|
7170 |
SetCcpuFlag(ECcpuStataCommitPredictiveWord); |
|
7171 |
} |
|
7172 |
||
7173 |
} |
|
7174 |
SetCcpuFlag(ECcpuSupressEditMenuFromShiftUp); |
|
7175 |
iPreviousEditingState = EStateNone; |
|
7176 |
iEditIndicatorAtLastUpdate = NULL; |
|
7177 |
ClearFlag( EFlagBidiCursorIsInitialized ); |
|
7178 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
7179 |
// removing the no match indicator is not necessary for ITI |
|
7180 |
if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
7181 |
{ |
|
7182 |
TryRemoveNoMatchesIndicatorL(); |
|
7183 |
} |
|
7184 |
#endif |
|
7185 |
UpdateCbaL(NULL); |
|
7186 |
||
7187 |
if (iFepFullyConstructed) |
|
7188 |
{ |
|
7189 |
SetCcpuFlag(ECcpuStateLosingFocus); // CommitInlineEditL needs to now we're losing focus (for cursor handling): |
|
7190 |
CancelAllTimerActivity(); |
|
7191 |
FepUI()->ExpireMultitapTimer(); |
|
7192 |
ClearCcpuFlag(ECcpuStateLosingFocus); // Cleared right away to make sure nothing else is affected. |
|
7193 |
} |
|
7194 |
// Forget shift key and chr key press if application or UI component is |
|
7195 |
// changed during shiftkey press. |
|
7196 |
ClearFlag(EFlagQwertyChrKeyDepressed); |
|
7197 |
//If candidate list was closed by long keypress of shift key, set the flag EFlagShiftKeyDepressed for CCPU mode |
|
7198 |
//to work correctly once it re-focuses on the editor. |
|
7199 |
if(isToSetShiftKeyStateDown) |
|
7200 |
{ |
|
7201 |
SetFlag(EFlagShiftKeyDepressed); |
|
7202 |
ClearCcpuFlag(ECcpuStateShiftkeyWasPressedBeforeLosingFocus); |
|
7203 |
} |
|
7204 |
else |
|
7205 |
{ |
|
7206 |
ClearFlag(EFlagShiftKeyDepressed); |
|
7207 |
} |
|
7208 |
if ( iFepFullyConstructed && IsFepAwareTextEditor() ) |
|
7209 |
{ |
|
7210 |
//save state of old item |
|
7211 |
TransferFepStateToEditorL(); |
|
7212 |
||
7213 |
if ( WesternPredictive() ) |
|
7214 |
{ |
|
7215 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
7216 |
// To rip off suggested word completion when there is a change in focus |
|
7217 |
if(IsAutoCompleteOn()) |
|
7218 |
{ |
|
7219 |
RemoveSuggestedCompletionL(); |
|
7220 |
||
7221 |
} |
|
7222 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
7223 |
SetCcpuFlag(ECcpuStateLosingFocus); // CommitInlineEditL needs to now we're losing focus (for cursor handling): |
|
7224 |
CommitInlineEditL(); |
|
7225 |
ClearCcpuFlag(ECcpuStateLosingFocus); // Cleared right away to make sure nothing else is affected. |
|
7226 |
} |
|
7227 |
else |
|
7228 |
{ |
|
7229 |
TryCloseUiL(); |
|
7230 |
} |
|
7231 |
||
7232 |
iRememberLength = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
7233 |
if (iLastFocusedEditor && !IsExtendedFlagSet(EExtendedFlagFepAwareDialogLaunched)) |
|
7234 |
{ |
|
7235 |
iLastFocusedEditor->SetObserver(NULL); |
|
7236 |
iLastFocusedEditor = NULL; |
|
7237 |
} |
|
7238 |
// When editor launches a non-fep aware dialog, then we |
|
7239 |
// should not set the observer to Null. Because if the dialog is |
|
7240 |
// destroyed we will not know and the dialog will remain orphaned. |
|
7241 |
// Also we need to know the fep editor pointer. |
|
7242 |
iLastFocusedEditor = EditorState(); |
|
7243 |
iEditorCcpuStatus = EditorCcpuStatus(iLastFocusedEditor); |
|
7244 |
//iLastFocusedEditor->SetObserver(NULL); |
|
7245 |
#ifdef RD_SCALABLE_UI_V2 |
|
7246 |
UnregisterObserver(); |
|
7247 |
#endif // RD_SCALABLE_UI_V2 |
|
7248 |
} |
|
7249 |
||
7250 |
if (iPermittedInputModes & EAknEditorSecretAlphaInputMode && |
|
7251 |
!(iPermittedInputModes & EAknEditorTextInputMode)) |
|
7252 |
{ |
|
7253 |
// For password editors. |
|
7254 |
ClearFlag(EFlagSupressAutoUpdate); |
|
7255 |
} |
|
7256 |
||
7257 |
// Losing focus is over, from this point on we are gaining focus. |
|
7258 |
ClearCcpuFlag(ECcpuStateLosingFocus); |
|
7259 |
||
7260 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
7261 |
if(iFnKeyManager) |
|
7262 |
iFnKeyManager->ClearFnKeyState(); |
|
7263 |
||
7264 |
if(iResourceString) |
|
7265 |
{ |
|
7266 |
delete iResourceString; |
|
7267 |
iResourceString = NULL; |
|
7268 |
} |
|
7269 |
#endif // RD_INTELLIGENT_TEXT_INPUT |
|
7270 |
||
7271 |
// get input capabilities from newly focused item |
|
7272 |
CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
7273 |
iInputCapabilities = static_cast<const CCoeAppUi*>(coeEnv->AppUi())->InputCapabilities(); |
|
7274 |
SetQwertyModeToInputcapbility(); |
|
7275 |
if ( IsFepAwareTextEditor() ) |
|
7276 |
{ |
|
7277 |
// Now at the launch of non-fep aware dialogs we do not set the editor observer to NULL, |
|
7278 |
// and retain the editor pointer in iLastFocusedEditor. |
|
7279 |
// So in case the editor is back in focus, we set iLastFocusedEditor to NULL |
|
7280 |
// and set the editor observer again. |
|
7281 |
||
7282 |
// At launch of fep aware dialog on a fep aware editor say spell query launched on messaging editor, |
|
7283 |
// we have the flag EExtendedFlagFepAwareDialogLaunched set. |
|
7284 |
// So in this scenario we retain the observer for both the editor as we need to close the spell query |
|
7285 |
// on close of messaging editor. |
|
7286 |
// Specific scenario is explained, the same is applicable for all general scenarios, for any |
|
7287 |
// fep aware dialog launched on any other fep aware editor. |
|
7288 |
if (iLastFocusedEditor && !IsExtendedFlagSet(EExtendedFlagFepAwareDialogLaunched)) |
|
7289 |
{ |
|
7290 |
iLastFocusedEditor->SetObserver(NULL); |
|
7291 |
iLastFocusedEditor = NULL; |
|
7292 |
} |
|
7293 |
if( EditorState() ) |
|
7294 |
{ |
|
7295 |
EditorState()->SetObserver(this); |
|
7296 |
} |
|
7297 |
ConfigureFEPFromEditorStateL(); |
|
7298 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
7299 |
if( PtiEngine() ) |
|
7300 |
{ |
|
7301 |
if(!IsAutoCompleteOn()) |
|
7302 |
{ |
|
7303 |
TInt tailLength = 0; |
|
7304 |
TRAP_IGNORE( PtiEngine()->HandleCommandL( |
|
7305 |
EPtiCommandGetAutoCompletionTailLength, |
|
7306 |
&tailLength )); |
|
7307 |
if(tailLength) |
|
7308 |
{ |
|
7309 |
RemoveSuggestedAdvanceCompletionL(); |
|
7310 |
} |
|
7311 |
} |
|
7312 |
} |
|
7313 |
#endif |
|
7314 |
if (!iWesternPredictive && iMode == ELatin) |
|
7315 |
{ |
|
7316 |
// It is possible to cause situation (by ill-acting client |
|
7317 |
// app) where focus handling goes out of sync and there actually |
|
7318 |
// is uncomitted inline edit operation going on in to-be-focused |
|
7319 |
// editor. Multitapping mode doesn't like that, so we make sure here |
|
7320 |
// that it won't happen. |
|
7321 |
CancelInlineEdit(); |
|
7322 |
} |
|
7323 |
AdjustCursorTypeForCurrentPosition(); |
|
7324 |
||
7325 |
if (IsCcpuFlagSet(ECcpuStateUncommitWhenFocused)) |
|
7326 |
{ |
|
7327 |
// One of the ccpu editing options mode was started from |
|
7328 |
// options menu. If there is active predictive word it |
|
7329 |
// needs to be deactivated. |
|
7330 |
ClearCcpuFlag(ECcpuStateUncommitWhenFocused); |
|
7331 |
DeactivatePredicitveWordAndMoveCursorL(); |
|
7332 |
} |
|
7333 |
#ifdef RD_SCALABLE_UI_V2 |
|
7334 |
RegisterObserver(); |
|
7335 |
#endif // RD_SCALABLE_UI_V2 |
|
7336 |
} |
|
7337 |
else // no FepAwareTextEditor |
|
7338 |
{ |
|
7339 |
#ifdef RD_SCALABLE_UI_V2 |
|
7340 |
// register to receive TInputCapabilitiesEvent events |
|
7341 |
if ( SemiFepAwareTextEditor() ) |
|
7342 |
{ |
|
7343 |
RegisterObserver(); |
|
7344 |
TLanguage localLanguage = ELangTest; |
|
7345 |
if (GetLocalLanguage( localLanguage ) ) |
|
7346 |
{ |
|
7347 |
iLanguageCapabilities.iLocalInputLanguageInUse = ETrue; |
|
7348 |
if ( localLanguage != iLanguageCapabilities.iInputLanguageCode ) |
|
7349 |
{ |
|
7350 |
ChangeInputLanguageL(localLanguage); |
|
7351 |
} |
|
7352 |
} |
|
7353 |
else if (iLanguageCapabilities.iLocalInputLanguageInUse) |
|
7354 |
{ |
|
7355 |
iLanguageCapabilities.iLocalInputLanguageInUse = EFalse; |
|
7356 |
ChangeInputLanguageL(iSharedDataInterface->InputTextLanguage()); |
|
7357 |
} |
|
7358 |
||
7359 |
if (IsFlagSet(EFlagNewSharedDataInputLanguage) ) |
|
7360 |
{ |
|
7361 |
//Global mode or input language has been changed in general settings |
|
7362 |
if ( !iLanguageCapabilities.iLocalInputLanguageInUse) |
|
7363 |
{ |
|
7364 |
ChangeInputLanguageL(iSharedDataInterface->InputTextLanguage()); |
|
7365 |
} |
|
7366 |
ClearFlag(EFlagNewSharedDataInputLanguage); |
|
7367 |
} |
|
7368 |
} |
|
7369 |
#endif // RD_SCALABLE_UI_V2 |
|
7370 |
// Check for non Edwin derived editors (eg mfne, tel no editor etc) |
|
7371 |
if (iInputCapabilities.SupportsWesternNumericIntegerPositive() || |
|
7372 |
iInputCapabilities.SupportsWesternNumericIntegerNegative() || |
|
7373 |
iInputCapabilities.SupportsWesternNumericReal() ) |
|
7374 |
{ |
|
7375 |
SyncStates(EAknFepStateInitial); |
|
7376 |
iPermittedInputModes = EAknEditorNumericInputMode; |
|
7377 |
iAknEditorNumericKeymap = EAknEditorNativeKeysNumberModeKeymap; |
|
7378 |
iAknEditorFlags = 0; |
|
7379 |
iCharWidth = EHalfWidthChar; |
|
7380 |
UpdateNumericEditorDigitType(); |
|
7381 |
||
7382 |
if ( IsMfneEditor() ) |
|
7383 |
{ |
|
7384 |
UpdateLocalDigitMode(); |
|
7385 |
} |
|
7386 |
||
7387 |
if( IsInputModeAvailable(ENativeNumber) && |
|
7388 |
( iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic || |
|
7389 |
iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic || |
|
7390 |
iLanguageCapabilities.iLocalDigitType == EDigitTypeDevanagari ) ) |
|
7391 |
{ |
|
7392 |
TryChangeModeL( ENativeNumber ); |
|
7393 |
} |
|
7394 |
else |
|
7395 |
{ |
|
7396 |
TryChangeModeL( ENumber ); |
|
7397 |
} |
|
7398 |
} |
|
7399 |
else //we don't have a valid editor |
|
7400 |
{ |
|
7401 |
SyncStates(EAknFepStateNull); |
|
7402 |
||
7403 |
// Reset the qwerty shift case mode when we do not have a valis editor. |
|
7404 |
ClearFlag(IsFlagSet( EFlagQwertyShiftMode )); |
|
7405 |
if (!IsFlagSet(EFlagForegroundUIComponentVisible | EFlagMenuPaneVisible) && |
|
7406 |
iIndicator) |
|
7407 |
{ |
|
7408 |
iIndicator->SetState(EStateNone); |
|
7409 |
iHybridAplphaChangedToAlphanumeric = EFalse; |
|
7410 |
} |
|
7411 |
ClearFlag(EFlagForegroundUIComponentVisible); |
|
7412 |
iPermittedInputModes = EAknEditorNullInputMode; |
|
7413 |
||
7414 |
#ifdef RD_SCALABLE_UI_V2 |
|
7415 |
RegisterObserver(); |
|
7416 |
#endif // RD_SCALABLE_UI_V2 |
|
7417 |
} |
|
7418 |
} |
|
7419 |
} |
|
7420 |
else if (Japanese() && iFepManState == EAknFepStateUIActive) |
|
7421 |
{ |
|
7422 |
if (iInputCapabilities.FepAwareTextEditor()) |
|
7423 |
{ |
|
7424 |
TryCloseUiL(); |
|
7425 |
} |
|
7426 |
} |
|
7427 |
||
7428 |
#ifdef RD_SCALABLE_UI_V2 |
|
7429 |
{ |
|
7430 |
/* |
|
7431 |
if( iGainForeground ) |
|
7432 |
{ |
|
7433 |
iLoseForeAndGainFocus = EFalse; |
|
7434 |
} |
|
7435 |
else |
|
7436 |
{ |
|
7437 |
iLoseForeAndGainFocus = ETrue; |
|
7438 |
} |
|
7439 |
SendEventsToPluginManL( EPluginFocusChanged, iGainForeground ); |
|
7440 |
*/ |
|
7441 |
CCoeControl* focusCtrl = static_cast<const CCoeAppUi*>(CCoeEnv::Static()->AppUi())->TopFocusedControl(); |
|
7442 |
CAknAppUi* aui = static_cast<CAknAppUi*>(CEikonEnv::Static()->AppUi()); |
|
7443 |
TBool bForeGround = aui->IsForeground(); |
|
7444 |
if(iGainForeground && ! bForeGround) |
|
7445 |
{ |
|
7446 |
iGainForeground = EFalse; |
|
7447 |
} |
|
7448 |
||
7449 |
if(iGainForeground && iNotifyPlugin) |
|
7450 |
{ |
|
7451 |
SendEventsToPluginManL( EPluginFocusChanged, |
|
7452 |
iGainForeground && focusCtrl!=0 && focusCtrl->IsFocused()); |
|
7453 |
} |
|
7454 |
iNotifyPlugin = ETrue; |
|
7455 |
} |
|
7456 |
#endif // RD_SCALABLE_UI_V2 |
|
7457 |
if( PtiEngine() && FepAwareTextEditor() ) |
|
7458 |
{ |
|
7459 |
if( FepAwareTextEditor()->DocumentLengthForFep() == 0 && |
|
7460 |
IsFlagSet(EFlagInsideInlineEditingTransaction)&& |
|
7461 |
iFepManState == EAknFepStateUIActive ) |
|
7462 |
{ |
|
7463 |
PtiEngine()->ClearCurrentWord(); |
|
7464 |
TryCloseUiL(); |
|
7465 |
} |
|
7466 |
} |
|
7467 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
7468 |
// Predictive QWERTY (XT9) changes ----> |
|
7469 |
ShowExactWordPopupIfNecessaryL(); |
|
7470 |
// Predictive QWERTY (XT9) changes <---- |
|
7471 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
7472 |
} |
|
7473 |
||
7474 |
void CAknFepManager::CleanUpFep() |
|
7475 |
{ |
|
7476 |
if (iFepFullyConstructed) |
|
7477 |
{ |
|
7478 |
CancelAllTimerActivity(); |
|
7479 |
iInputCapabilities.FepAwareTextEditor()->CancelFepInlineEdit(); |
|
7480 |
} |
|
7481 |
else |
|
7482 |
{ |
|
7483 |
CommonDestroyFep(); |
|
7484 |
} |
|
7485 |
} |
|
7486 |
||
7487 |
#ifdef RD_SCALABLE_UI_V2 |
|
7488 |
void CAknFepManager::UnregisterObserver() |
|
7489 |
{ |
|
7490 |
||
7491 |
MObjectProvider* mop = iInputCapabilities.ObjectProvider(); |
|
7492 |
||
7493 |
if ( mop ) |
|
7494 |
{ |
|
7495 |
CAknExtendedInputCapabilities* extendedInputCapabilities = |
|
7496 |
mop->MopGetObject( extendedInputCapabilities ); |
|
7497 |
||
7498 |
if ( extendedInputCapabilities ) |
|
7499 |
{ |
|
7500 |
extendedInputCapabilities->UnregisterObserver( this ); |
|
7501 |
} |
|
7502 |
} |
|
7503 |
} |
|
7504 |
||
7505 |
void CAknFepManager::RegisterObserver() |
|
7506 |
{ |
|
7507 |
||
7508 |
MObjectProvider* mop = iInputCapabilities.ObjectProvider(); |
|
7509 |
||
7510 |
if ( mop ) |
|
7511 |
{ |
|
7512 |
CAknExtendedInputCapabilities* extendedInputCapabilities = |
|
7513 |
mop->MopGetObject( extendedInputCapabilities ); |
|
7514 |
||
7515 |
if ( extendedInputCapabilities ) |
|
7516 |
{ |
|
7517 |
extendedInputCapabilities->RegisterObserver( this ); |
|
7518 |
} |
|
7519 |
} |
|
7520 |
} |
|
7521 |
||
7522 |
#endif // RD_SCALABLE_UI_V2 |
|
7523 |
||
7524 |
void CAknFepManager::SimulateKeyEventL(TUint aKeyCode, TBool aActiveObj) |
|
7525 |
{ |
|
7526 |
if (aActiveObj) |
|
7527 |
{ |
|
7528 |
iSimulateKey = aKeyCode; |
|
7529 |
iAsyncOwnSimulateKey.CallBack(); |
|
7530 |
} |
|
7531 |
else |
|
7532 |
{ |
|
7533 |
CArrayFix<TUint>* simCharArray = new(ELeave) CArrayFixFlat<TUint>(1); |
|
7534 |
CleanupStack::PushL(simCharArray); |
|
7535 |
simCharArray->AppendL(aKeyCode); |
|
7536 |
SimulateKeyEventsL(simCharArray->Array()); |
|
7537 |
CleanupStack::PopAndDestroy(); // simCharArray |
|
7538 |
} |
|
7539 |
} |
|
7540 |
||
7541 |
TInt CAknFepManager::ResetShiftKeyMonitorCallback(TAny* aObj) |
|
7542 |
{ |
|
7543 |
TRAPD(err, static_cast<CAknFepManager*>(aObj)->ResetShiftKeyMonitorL()); |
|
7544 |
if (err) |
|
7545 |
{ |
|
7546 |
static_cast<CAknFepManager*>(aObj)->CleanUpFep(); |
|
7547 |
return KErrDied; |
|
7548 |
} |
|
7549 |
return KErrNone; |
|
7550 |
} |
|
7551 |
||
7552 |
void CAknFepManager::ResetShiftKeyMonitorL() |
|
7553 |
{ |
|
7554 |
TBool phoneIdle = (EditorType() == CAknExtendedInputCapabilities::EPhoneNumberEditor); |
|
7555 |
if(phoneIdle) |
|
7556 |
{ |
|
7557 |
iShiftKeypressMonitor->Cancel(); |
|
7558 |
return; |
|
7559 |
} |
|
7560 |
||
7561 |
SetFlag(EFlagLongShiftKeyPress); |
|
7562 |
#ifdef __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__ |
|
7563 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
7564 |
// Copy-paste with shift+SKs is always available on ITU-T. On QWERTY, |
|
7565 |
// it's available if activated in the Central Repository. |
|
7566 |
if ( (!iQwertyInputMode || iSharedDataInterface->ShiftCopyPastingOnQwerty()) && |
|
7567 |
!(iAknEditorFlags & EAknEditorFlagFindPane) ) |
|
7568 |
#endif // RD_INTELLIGENT_TEXT_INPUT |
|
7569 |
#else |
|
7570 |
if (!iQwertyInputMode && !(iAknEditorFlags & EAknEditorFlagFindPane)) |
|
7571 |
#endif // __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__ |
|
7572 |
{ |
|
7573 |
if (HashKeySelectionInUse() && IsCcpuFlagSet(ECcpuStateHashDown)) |
|
7574 |
{ |
|
7575 |
SetCcpuFlag(ECcpuStateEdwinInSelectionMode); |
|
7576 |
iHashKeyMan->SetPreviousSelectionStyleModeL(); |
|
7577 |
} |
|
7578 |
if(iCandidatePopup) |
|
7579 |
{ // if candidate list is launched and then a long key press of shift key is done, destroy the candidate list first |
|
7580 |
iCandidatePopup->AttemptExitL(EFalse); |
|
7581 |
HandleChangeInFocusL(); |
|
7582 |
} |
|
7583 |
if(!IsCcpuFlagSet(ECcpuStateCbaShown)) |
|
7584 |
{ |
|
7585 |
TKeyEvent ccpuStart = {EKeyF21, EStdKeyF21, 0, 0}; |
|
7586 |
// to enable copy/paste support on cba. We simulate via CCoeEnv |
|
7587 |
// to avoid fep SimulateKeyEventL adding shift modifiers |
|
7588 |
CCoeEnv::Static()->SimulateKeyEventL(ccpuStart, EEventKey); |
|
7589 |
SetCcpuFlag(ECcpuStateCbaShown); |
|
7590 |
} |
|
7591 |
} |
|
7592 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
7593 |
#ifdef __HALF_QWERTY_KEYPAD |
|
7594 |
// we should not enter the copy-paste mode in find pane editors |
|
7595 |
if( EPtiKeyboardHalfQwerty == KeyboardLayout() && !(iAknEditorFlags & EAknEditorFlagFindPane)) |
|
7596 |
{ |
|
7597 |
CAknFepFnKeyManager::TFnKeyState fnState = FnKeyState(); |
|
7598 |
||
7599 |
if( CAknFepFnKeyManager::EFnKeyNone != fnState |
|
7600 |
|| iFnCharInsertedForShift ) |
|
7601 |
{ |
|
7602 |
TText prevCh = PreviousChar(); |
|
7603 |
if (prevCh == '#' || prevCh == '/') |
|
7604 |
{ |
|
7605 |
RemovePreviousCharacterL(); |
|
7606 |
} |
|
7607 |
// reset the fn state if it is FnNext |
|
7608 |
if( fnState == CAknFepFnKeyManager::EFnKeyNext ) |
|
7609 |
{ |
|
7610 |
SetFnKeyState( CAknFepFnKeyManager::EFnKeyNone ); |
|
7611 |
} |
|
7612 |
} |
|
7613 |
SetCcpuFlag( CAknFepManager::ECcpuStateEdwinInSelectionMode ); |
|
7614 |
if(!IsCcpuFlagSet(ECcpuStateCbaShown)) |
|
7615 |
{ |
|
7616 |
TKeyEvent ccpuStart = {EKeyF21, EStdKeyF21, 0, 0}; |
|
7617 |
||
7618 |
// to enable copy/paste support on cba. We simulate via CCoeEnv |
|
7619 |
// to avoid fep SimulateKeyEventL adding shift modifiers |
|
7620 |
CCoeEnv::Static()->SimulateKeyEventL(ccpuStart, EEventKey); |
|
7621 |
SetCcpuFlag(ECcpuStateCbaShown); |
|
7622 |
} |
|
7623 |
} |
|
7624 |
#endif //__HALF_QWERTY_KEYPAD |
|
7625 |
||
7626 |
#endif//RD_INTELLIGENT_TEXT_INPUT |
|
7627 |
iShiftKeypressMonitor->Cancel(); |
|
7628 |
} |
|
7629 |
||
7630 |
void CAknFepManager::CancelAllTimerActivity() |
|
7631 |
{ |
|
7632 |
if (iShiftKeypressMonitor->IsActive()) |
|
7633 |
{ |
|
7634 |
iShiftKeypressMonitor->Cancel(); |
|
7635 |
} |
|
7636 |
if (iConcatenationTimer->IsActive()) |
|
7637 |
{ |
|
7638 |
iConcatenationTimer->Cancel(); |
|
7639 |
} |
|
7640 |
if (iChrKeypressMonitor->IsActive()) |
|
7641 |
{ |
|
7642 |
iChrKeypressMonitor->Cancel(); |
|
7643 |
} |
|
7644 |
if (iPostEventCheck->IsActive()) |
|
7645 |
{ |
|
7646 |
iPostEventCheck->Cancel(); |
|
7647 |
} |
|
7648 |
if ( iHashKeyMan ) |
|
7649 |
{ |
|
7650 |
iHashKeyMan->CancelHashKeyTimer(); |
|
7651 |
} |
|
7652 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
7653 |
if( iNumericResourceTimer ) |
|
7654 |
{ |
|
7655 |
TRAP_IGNORE( NumericResourceMultiTapTimerTimeoutL()); |
|
7656 |
} |
|
7657 |
#endif |
|
7658 |
DeactivateFnkeyPressMonitor(); |
|
7659 |
} |
|
7660 |
||
7661 |
TBool CAknFepManager::IsModePermitted(TInt aMode, TWidthChar aWidth) const |
|
7662 |
{ |
|
7663 |
if (aWidth == ENoneWidthChar) |
|
7664 |
{ |
|
7665 |
aWidth = iCharWidth; |
|
7666 |
} |
|
7667 |
||
7668 |
TBool isModePermitted = ETrue; |
|
7669 |
const TInt inputLanguage = iLanguageCapabilities.iInputLanguageCode; |
|
7670 |
||
7671 |
if ( aMode == ENativeNumber && !IsInputModeAvailable( aMode ) ) |
|
7672 |
{ |
|
7673 |
if ( inputLanguage == ELangThai && iFepPluginManager && |
|
7674 |
iFepPluginManager->PluginInputMode() != EPluginInputModeItut && |
|
7675 |
!iQwertyInputMode) |
|
7676 |
{ |
|
7677 |
return ETrue; |
|
7678 |
} |
|
7679 |
return EFalse; |
|
7680 |
} |
|
7681 |
||
7682 |
TUint editorMode = EditorMode(aMode, aWidth); |
|
7683 |
||
7684 |
//Support Boxcn default Chinese inputmode when defaul inputmode is Cangjie Hongkong |
|
7685 |
//only if Chinese input is permitted in the editor |
|
7686 |
if (!( (iVariantPermittedModes | ELatinText | ELatinUpper | ELatinLower | EHiragana) & aMode) ) |
|
7687 |
{ |
|
7688 |
//the mode is never valid in this variant |
|
7689 |
isModePermitted = EFalse; |
|
7690 |
} |
|
7691 |
else if( aMode == ECangJie && !(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly)) |
|
7692 |
{ |
|
7693 |
if (iQwertyInputMode || iFepPluginManager->PluginInputMode() == EPluginInputModeVkb |
|
7694 |
|| iFepPluginManager->PluginInputMode() == EPluginInputModeFSQ) |
|
7695 |
{ |
|
7696 |
isModePermitted = ETrue; |
|
7697 |
} |
|
7698 |
else |
|
7699 |
{ |
|
7700 |
isModePermitted = EFalse; |
|
7701 |
} |
|
7702 |
} |
|
7703 |
else if (!(iPermittedInputModes & editorMode)) |
|
7704 |
{ |
|
7705 |
isModePermitted = EFalse; |
|
7706 |
} |
|
7707 |
else if (((aMode == EPinyin) || (aMode == EZhuyin) || (aMode == EStroke) || (aMode == ECangJie) |
|
7708 |
|| (aMode == EHiraganaKanji) || (aMode == EKatakana) || ( aMode == EHangul ) |
|
7709 |
|| (((aMode == ELatin) || (aMode == ENumber) || iMode == ENativeNumber ) && (iCharWidth == EFullWidthChar))) |
|
7710 |
&& (iAknEditorFlags & EAknEditorFlagLatinInputModesOnly)) |
|
7711 |
{ |
|
7712 |
//the editor does not allow Chinese modes |
|
7713 |
isModePermitted = EFalse; |
|
7714 |
} |
|
7715 |
else if (((aMode == EStrokeFind) || (aMode == EZhuyinFind)) |
|
7716 |
&& (!(iAknEditorFlags & EAknEditorFlagForceTransparentFepModes))) |
|
7717 |
{ |
|
7718 |
//StrokeFind and ZhuyinFind modes are only valid in a chinese find pane |
|
7719 |
isModePermitted = EFalse; |
|
7720 |
} |
|
7721 |
else |
|
7722 |
{ |
|
7723 |
TUint editorsWhichAllowThisMode; |
|
7724 |
if (aMode == ENumber || aMode == ENativeNumber ) |
|
7725 |
{ |
|
7726 |
//The FEP's ENumber mode has a direct mapping to EAknEditorNumericInputMode |
|
7727 |
// or EAknEditorFullWidthNumericInputMode |
|
7728 |
editorsWhichAllowThisMode = EAknEditorNumericInputMode; |
|
7729 |
if (aWidth == EFullWidthChar) |
|
7730 |
{ |
|
7731 |
editorsWhichAllowThisMode = EAknEditorFullWidthNumericInputMode; |
|
7732 |
} |
|
7733 |
} |
|
7734 |
else if (aMode == EHiragana) |
|
7735 |
{ |
|
7736 |
editorsWhichAllowThisMode = EAknEditorHiraganaInputMode; |
|
7737 |
} |
|
7738 |
else if (aMode == EKatakana || (aMode == ELatin && aWidth == EFullWidthChar)) |
|
7739 |
{ |
|
7740 |
editorsWhichAllowThisMode = EditorMode(aMode, aWidth); |
|
7741 |
} |
|
7742 |
else if (aMode == EHiraganaKanji) |
|
7743 |
{ |
|
7744 |
// HiraganaKanji mode allows all input mode. |
|
7745 |
editorsWhichAllowThisMode = EAknEditorAllInputModes; |
|
7746 |
} |
|
7747 |
else if (aMode == EHangul) |
|
7748 |
{ |
|
7749 |
editorsWhichAllowThisMode =(EAknEditorTextInputMode | EAknEditorSecretAlphaInputMode | EAknEditorHalfWidthTextInputMode); |
|
7750 |
} |
|
7751 |
else |
|
7752 |
{ |
|
7753 |
//if the editor allows Text Input or Secret Alpha Mode, |
|
7754 |
//we infer that Chinese Modes are valid |
|
7755 |
editorsWhichAllowThisMode =(EAknEditorTextInputMode | |
|
7756 |
EAknEditorSecretAlphaInputMode | |
|
7757 |
EAknEditorHalfWidthTextInputMode); |
|
7758 |
} |
|
7759 |
isModePermitted = iPermittedInputModes & editorsWhichAllowThisMode; |
|
7760 |
} |
|
7761 |
||
7762 |
return isModePermitted; |
|
7763 |
} |
|
7764 |
||
7765 |
TInt CAknFepManager::SyncStates(TAknFepManagerState aState) |
|
7766 |
{ |
|
7767 |
TInt ret = KErrNone; |
|
7768 |
||
7769 |
if (!iFepFullyConstructed) |
|
7770 |
{ |
|
7771 |
if (aState == EAknFepStateNull) |
|
7772 |
{ |
|
7773 |
return KErrNone; |
|
7774 |
} |
|
7775 |
||
7776 |
TRAP(ret, ConstructFullyL()); |
|
7777 |
} |
|
7778 |
if (iFepFullyConstructed) |
|
7779 |
{ |
|
7780 |
iFepManState = aState; |
|
7781 |
iKeyCatcher->SetState(aState); |
|
7782 |
} |
|
7783 |
||
7784 |
return ret; |
|
7785 |
} |
|
7786 |
||
7787 |
TUint CAknFepManager::EditorMode(TInt aMode, TWidthChar aWidth) const |
|
7788 |
{ |
|
7789 |
TInt editorMode = 0; |
|
7790 |
switch(aMode) |
|
7791 |
{ |
|
7792 |
case EPinyin: |
|
7793 |
case EZhuyin: |
|
7794 |
case EStroke: |
|
7795 |
case ECangJie: |
|
7796 |
case EPRCFind: |
|
7797 |
case EZhuyinFind: |
|
7798 |
case EStrokeFind: |
|
7799 |
case EHangul: |
|
7800 |
{ |
|
7801 |
editorMode = EAknEditorTextInputMode; |
|
7802 |
} |
|
7803 |
break; |
|
7804 |
case EHindi: |
|
7805 |
case ELatin: |
|
7806 |
case ELatinText: |
|
7807 |
case ELatinUpper: |
|
7808 |
case ELatinLower: |
|
7809 |
{ |
|
7810 |
if (iPermittedInputModes & EAknEditorTextInputMode) |
|
7811 |
{ |
|
7812 |
editorMode = EAknEditorTextInputMode; |
|
7813 |
} |
|
7814 |
else if (iPermittedInputModes & EAknEditorHalfWidthTextInputMode) |
|
7815 |
{ |
|
7816 |
if (IsFeatureSupportedJapanese()) |
|
7817 |
{ |
|
7818 |
editorMode = EAknEditorHalfWidthTextInputMode; |
|
7819 |
} |
|
7820 |
else |
|
7821 |
{ |
|
7822 |
editorMode = EAknEditorTextInputMode; |
|
7823 |
} |
|
7824 |
} |
|
7825 |
else |
|
7826 |
{ |
|
7827 |
editorMode = EAknEditorSecretAlphaInputMode; |
|
7828 |
} |
|
7829 |
if (aWidth == EFullWidthChar) |
|
7830 |
{ |
|
7831 |
editorMode = EAknEditorFullWidthTextInputMode; |
|
7832 |
} |
|
7833 |
} |
|
7834 |
break; |
|
7835 |
case EHiragana: |
|
7836 |
{ |
|
7837 |
editorMode = EAknEditorHiraganaInputMode; |
|
7838 |
} |
|
7839 |
break; |
|
7840 |
case EHiraganaKanji: |
|
7841 |
{ |
|
7842 |
editorMode = EAknEditorHiraganaKanjiInputMode; |
|
7843 |
} |
|
7844 |
break; |
|
7845 |
case EKatakana: |
|
7846 |
{ |
|
7847 |
editorMode = EAknEditorKatakanaInputMode; |
|
7848 |
if (aWidth == EFullWidthChar) |
|
7849 |
{ |
|
7850 |
editorMode = EAknEditorFullWidthKatakanaInputMode; |
|
7851 |
} |
|
7852 |
} |
|
7853 |
break; |
|
7854 |
case ENumber: |
|
7855 |
case ENativeNumber: |
|
7856 |
{ |
|
7857 |
editorMode = EAknEditorNumericInputMode; |
|
7858 |
if (aWidth == EFullWidthChar) |
|
7859 |
{ |
|
7860 |
editorMode = EAknEditorFullWidthNumericInputMode; |
|
7861 |
} |
|
7862 |
} |
|
7863 |
break; |
|
7864 |
default: |
|
7865 |
break; |
|
7866 |
} |
|
7867 |
||
7868 |
return editorMode; |
|
7869 |
} |
|
7870 |
||
7871 |
void CAknFepManager::LaunchPenSupportMenuL() |
|
7872 |
{ |
|
7873 |
if (HashKeySelectionInUse() && IsCcpuFlagSet(ECcpuStateHashDown)) |
|
7874 |
{ |
|
7875 |
return; |
|
7876 |
} |
|
7877 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
7878 |
if(iCandidatePopup) |
|
7879 |
{ |
|
7880 |
iCandidatePopup->AttemptExitL(EFalse); |
|
7881 |
HandleChangeInFocusL(); |
|
7882 |
} |
|
7883 |
#endif |
|
7884 |
||
7885 |
if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
7886 |
{ |
|
7887 |
TryRemoveNoMatchesIndicatorL(); |
|
7888 |
/* |
|
7889 |
This code is the part of fixing TSW Error Edit Menu : |
|
7890 |
"Matches" and "insert word" options are not available under Edit Menu. |
|
7891 |
When we launch Edit Menu.the word which in Inline Editing in the BackGorund |
|
7892 |
Should not Commit*/ |
|
7893 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
7894 |
CommitInlineEditL(); |
|
7895 |
#endif |
|
7896 |
/* |
|
7897 |
This code is the part of fixing TSW ErrorEdit Menu : |
|
7898 |
"Matches" and "insert word" options are not available under Edit Menu. |
|
7899 |
This Flag is useful for deciding whether "Matches" Menu Item can Visible |
|
7900 |
or not*/ |
|
7901 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
7902 |
SetFlag(EFlagInlineEditInBackground); |
|
7903 |
#endif |
|
7904 |
/* |
|
7905 |
This code is the part of fixing TSW Error Edit Menu : |
|
7906 |
"Matches" and "insert word" options are not available under Edit Menu.*/ |
|
7907 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
7908 |
ClearFlag(EFlagInsideInlineEditingTransaction); |
|
7909 |
#endif |
|
7910 |
} |
|
7911 |
||
7912 |
CAknEdwinState* editorState = NULL; |
|
7913 |
if (iInputCapabilities.FepAwareTextEditor()) |
|
7914 |
{ |
|
7915 |
editorState = EditorState(); |
|
7916 |
} |
|
7917 |
||
7918 |
iEditMenuBar = NULL; |
|
7919 |
if (editorState) |
|
7920 |
{ |
|
7921 |
iEditMenuBar = iUiInterface->EditorStateMenuBar(editorState); |
|
7922 |
} |
|
7923 |
||
7924 |
if (iEditMenuBar && |
|
7925 |
!iEditMenuBar->IsDisplayed()) |
|
7926 |
{ |
|
7927 |
||
7928 |
iPenSupportMenu = ETrue; |
|
7929 |
// SetFlag(EFlagLaunchEditMenu); |
|
7930 |
CAknFepUiInterfaceMenuPane* menuPane = iEditMenuBar->MenuPane(); |
|
7931 |
||
7932 |
CEikMenuPane* oldMenuPane = menuPane->GetMenuPane(); |
|
7933 |
if (!oldMenuPane) |
|
7934 |
{ |
|
7935 |
menuPane = NULL; |
|
7936 |
} |
|
7937 |
||
7938 |
iRememberEditorState = EditorState(); |
|
7939 |
||
7940 |
iEditMenuBar->SetMenuType(CAknFepUiInterfaceMenuBar::EMenuEdit); |
|
7941 |
// It is unnecessary to add ROW SCT in Editting option menu. |
|
7942 |
iEditMenuBar->TryDisplayMenuBarL(); |
|
7943 |
if (menuPane && menuPane->NumberOfItemsInPane() == 0) |
|
7944 |
{ |
|
7945 |
// Edit menu do not contain any items. |
|
7946 |
iEditMenuBar->StopDisplayingMenuBar(); |
|
7947 |
} |
|
7948 |
else |
|
7949 |
{ |
|
7950 |
//adjust menu position to the front of dialog to |
|
7951 |
//avoid input capability is wrongly got |
|
7952 |
CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
7953 |
CCoeAppUi* appUi = (CCoeAppUi*)(coeEnv->AppUi()); |
|
7954 |
if( appUi->IsDisplayingDialog() ) |
|
7955 |
{ |
|
7956 |
iEditMenuBar->RemoveFromStack(); |
|
7957 |
iEditMenuBar->AddToStackL(ECoeStackPriorityDialog + 1, ECoeStackFlagStandard); |
|
7958 |
} |
|
7959 |
} |
|
7960 |
||
7961 |
iEditMenuBar->SetMenuType(CAknFepUiInterfaceMenuBar::EMenuOptions); |
|
7962 |
} |
|
7963 |
iPenSupportMenu = EFalse; |
|
7964 |
} |
|
7965 |
||
7966 |
void CAknFepManager::LaunchSelectModeMenuL() |
|
7967 |
{ |
|
7968 |
if (HashKeySelectionInUse() && IsCcpuFlagSet(ECcpuStateHashDown)) |
|
7969 |
{ |
|
7970 |
return; |
|
7971 |
} |
|
7972 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
7973 |
if(iCandidatePopup) |
|
7974 |
{ |
|
7975 |
iCandidatePopup->AttemptExitL(EFalse); |
|
7976 |
HandleChangeInFocusL(); |
|
7977 |
} |
|
7978 |
#endif |
|
7979 |
||
7980 |
if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
7981 |
{ |
|
7982 |
TryRemoveNoMatchesIndicatorL(); |
|
7983 |
/* |
|
7984 |
This code is the part of fixing TSW Error : Edit Menu : |
|
7985 |
"Matches" and "insert word" options are not available under Edit Menu. |
|
7986 |
When we launch Edit Menu.the word which in Inline Editing in the BackGorund |
|
7987 |
Should not Commit*/ |
|
7988 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
7989 |
CommitInlineEditL(); |
|
7990 |
#endif |
|
7991 |
/* |
|
7992 |
This code is the part of fixing TSW Error : Edit Menu : |
|
7993 |
"Matches" and "insert word" options are not available under Edit Menu. |
|
7994 |
This Flag is useful for deciding whether "Matches" Menu Item can Visible |
|
7995 |
or not*/ |
|
7996 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
7997 |
SetFlag(EFlagInlineEditInBackground); |
|
7998 |
#endif |
|
7999 |
/* |
|
8000 |
This code is the part of fixing TSW Error : Edit Menu : |
|
8001 |
"Matches" and "insert word" options are not available under Edit Menu.*/ |
|
8002 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
8003 |
ClearFlag(EFlagInsideInlineEditingTransaction); |
|
8004 |
#endif |
|
8005 |
} |
|
8006 |
||
8007 |
CAknEdwinState* editorState = NULL; |
|
8008 |
if (iInputCapabilities.FepAwareTextEditor()) |
|
8009 |
{ |
|
8010 |
editorState = EditorState(); |
|
8011 |
} |
|
8012 |
||
8013 |
iEditMenuBar = NULL; |
|
8014 |
if (editorState) |
|
8015 |
{ |
|
8016 |
iEditMenuBar = iUiInterface->EditorStateMenuBar(editorState); |
|
8017 |
} |
|
8018 |
||
8019 |
if (iEditMenuBar && |
|
8020 |
!iEditMenuBar->IsDisplayed()) |
|
8021 |
{ |
|
8022 |
// SetFlag(EFlagLaunchEditMenu); |
|
8023 |
CAknFepUiInterfaceMenuPane* menuPane = iEditMenuBar->MenuPane(); |
|
8024 |
CEikMenuPane* oldMenuPane = menuPane->GetMenuPane(); |
|
8025 |
if (!oldMenuPane) |
|
8026 |
{ |
|
8027 |
menuPane = NULL; |
|
8028 |
} |
|
8029 |
if(menuPane) |
|
8030 |
SetFlag(EFlagLaunchEditMenu); |
|
8031 |
||
8032 |
iRememberEditorState = EditorState(); |
|
8033 |
||
8034 |
// It is unnecessary to add ROW SCT in Editting option menu. |
|
8035 |
if (!IsFeatureSupportedJapanese()) |
|
8036 |
{ |
|
8037 |
iEditCharsPtr.Copy(KNullDesC); |
|
8038 |
iEditCharsPtr.Set( iSctEditChars->Des() ); |
|
8039 |
||
8040 |
// get the SCT resource id from editor default settings |
|
8041 |
TInt currentEditorSCTResId = GetCurrentEditorSCTResId(); |
|
8042 |
TInt charResourceId = ENoCharacters; |
|
8043 |
if ( currentEditorSCTResId == EDefaultNumericCharMapResId) |
|
8044 |
{ |
|
8045 |
charResourceId = NumericModeSCTResourceId(); |
|
8046 |
if ( charResourceId != ENoCharacters && IsAbleToLaunchSCT()&& |
|
8047 |
EditorType() != CAknExtendedInputCapabilities::EEikSecretEditorBased) |
|
8048 |
{ |
|
8049 |
||
8050 |
if( menuPane != NULL ) |
|
8051 |
{ |
|
8052 |
menuPane->ConstructMenuSctRowL( iEditCharsPtr, charResourceId ); |
|
8053 |
} |
|
8054 |
} |
|
8055 |
else |
|
8056 |
{ |
|
8057 |
currentEditorSCTResId = charResourceId; |
|
8058 |
} |
|
8059 |
} |
|
8060 |
else |
|
8061 |
{ |
|
8062 |
TInt sctChars = EAknSCTChiChineseInputModes; |
|
8063 |
if (iCharWidth == EFullWidthChar) |
|
8064 |
{ |
|
8065 |
sctChars = EAknSCTFullCase; |
|
8066 |
} |
|
8067 |
else |
|
8068 |
{ |
|
8069 |
if (iMode == ELatin) |
|
8070 |
{ |
|
8071 |
if ( FeatureManager::FeatureSupported(KFeatureIdChinese) ) |
|
8072 |
{ |
|
8073 |
sctChars = EAknSCTChiLatinInputModes; |
|
8074 |
} |
|
8075 |
else |
|
8076 |
{ |
|
8077 |
if (iQwertyInputMode) |
|
8078 |
{ |
|
8079 |
sctChars = EAknSCTQwerty; |
|
8080 |
} |
|
8081 |
else |
|
8082 |
{ |
|
8083 |
sctChars = EAknSCTUpperCase; |
|
8084 |
if (iCaseMan->CurrentCase() == EAknEditorLowerCase) |
|
8085 |
{ |
|
8086 |
sctChars = EAknSCTLowerCase; |
|
8087 |
} |
|
8088 |
} |
|
8089 |
} |
|
8090 |
} |
|
8091 |
else if (iMode == ENumber || iMode == ENativeNumber) |
|
8092 |
{ |
|
8093 |
sctChars = EAknSCTNumeric; |
|
8094 |
if ( ((iAknEditorFlags & EAknEditorFlagUseSCTNumericCharmap) || |
|
8095 |
(iAknEditorNumericKeymap == EAknEditorAlphanumericNumberModeKeymap)) && |
|
8096 |
!IsOnlyHalfWidthCharacterPermitted() ) |
|
8097 |
{ |
|
8098 |
sctChars = EAknSCTLowerCase; |
|
8099 |
} |
|
8100 |
} |
|
8101 |
//delete for phrase creation |
|
8102 |
// else if (iMode == EStroke && iFepManState == EAknFepStateUIActive) |
|
8103 |
// { |
|
8104 |
// return; |
|
8105 |
// } |
|
8106 |
else if (iMode == EHiraganaKanji) |
|
8107 |
{ |
|
8108 |
sctChars = EAknSCTFullCase; |
|
8109 |
} |
|
8110 |
else if(iMode == EKatakana) |
|
8111 |
{ |
|
8112 |
sctChars = EAknSCTHalfCase; |
|
8113 |
} |
|
8114 |
} |
|
8115 |
||
8116 |
if (!(ExtendedInputCapabilities() & CAknExtendedInputCapabilities::EDisableSCT)) |
|
8117 |
{ |
|
8118 |
if( menuPane && (EditorType() != CAknExtendedInputCapabilities::EEikSecretEditorBased)) |
|
8119 |
{ |
|
8120 |
if(IsAbleToLaunchSmiley()) |
|
8121 |
{ |
|
8122 |
sctChars |= EAknCharMapEmotionUse; |
|
8123 |
} |
|
8124 |
||
8125 |
menuPane->ConstructMenuSctRowFromDialogL( sctChars, iEditCharsPtr, |
|
8126 |
currentEditorSCTResId ); |
|
8127 |
} |
|
8128 |
} |
|
8129 |
} |
|
8130 |
} |
|
8131 |
iEditMenuBar->SetMenuType(CAknFepUiInterfaceMenuBar::EMenuEdit); |
|
8132 |
iFepPluginManager->SetMenuState( ETrue ); |
|
8133 |
iEditMenuBar->TryDisplayMenuBarL(); |
|
8134 |
if (menuPane && menuPane->NumberOfItemsInPane() == 0) |
|
8135 |
{ |
|
8136 |
// Edit menu do not contain any items. |
|
8137 |
iEditMenuBar->StopDisplayingMenuBar(); |
|
8138 |
iFepPluginManager->ResetMenuState( ETrue ); |
|
8139 |
} |
|
8140 |
else |
|
8141 |
{ |
|
8142 |
//adjust menu position to the front of dialog to |
|
8143 |
//avoid input capability is wrongly got |
|
8144 |
CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
8145 |
CCoeAppUi* appUi = (CCoeAppUi*)(coeEnv->AppUi()); |
|
8146 |
if( appUi->IsDisplayingDialog() ) |
|
8147 |
{ |
|
8148 |
iEditMenuBar->RemoveFromStack(); |
|
8149 |
// Set the MenuBar not focused, the later add to stack operation could unfocus other control correctly |
|
8150 |
iEditMenuBar->SetFocus(EFalse); |
|
8151 |
iEditMenuBar->AddToStackL(ECoeStackPriorityDialog + 1, ECoeStackFlagStandard); |
|
8152 |
} |
|
8153 |
} |
|
8154 |
||
8155 |
iEditMenuBar->SetMenuType(CAknFepUiInterfaceMenuBar::EMenuOptions); |
|
8156 |
} |
|
8157 |
} |
|
8158 |
||
8159 |
void CAknFepManager::LaunchMatchesPopupListL() |
|
8160 |
{ |
|
8161 |
TInt noOfMatches = iPtiEngine->NumberOfCandidates(); |
|
8162 |
if (noOfMatches > 1) // 1 => only current match available, 0 => not in inline edit |
|
8163 |
{ |
|
8164 |
// Create a list to pass to the dialog |
|
8165 |
CDesCArrayFlat* matchesList=new(ELeave)CDesCArrayFlat(1); |
|
8166 |
CleanupStack::PushL(matchesList); |
|
8167 |
iPtiEngine->GetCandidateListL(*matchesList); |
|
8168 |
TBuf<EMaximumFepWordLength> matchListDesc; |
|
8169 |
TInt matchListItemCount = matchesList->MdcaCount(); |
|
8170 |
TInt currentIndex = ResolveCurrentCandidateListIndex(matchesList); |
|
8171 |
for ( TInt ii=0; ii < matchListItemCount ; ii++) |
|
8172 |
{ |
|
8173 |
matchListDesc = matchesList->MdcaPoint(ii); |
|
8174 |
TChar tempChar = matchListDesc[0]; |
|
8175 |
if(tempChar.IsDigit()) |
|
8176 |
{ |
|
8177 |
AknTextUtils::ConvertDigitsTo(matchListDesc,iLanguageCapabilities.iLocalDigitType); |
|
8178 |
matchesList->Delete(ii); |
|
8179 |
matchesList->InsertL(ii,matchListDesc); |
|
8180 |
} |
|
8181 |
} |
|
8182 |
||
8183 |
// add 'Spell' to the bottom of the list |
|
8184 |
TResourceReader reader; |
|
8185 |
CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
8186 |
coeEnv->CreateResourceReaderLC(reader, R_AVKON_T9_MATCHES_QUERY_SPELL_ITEM); |
|
8187 |
matchesList->AppendL(reader.ReadTPtrC()); |
|
8188 |
CleanupStack::PopAndDestroy(); // reader |
|
8189 |
||
8190 |
TInt index = 0; |
|
8191 |
SetFlag(EFlagForegroundUIComponentVisible); |
|
8192 |
||
8193 |
TUid fepUid = CCoeEnv::Static()->FepUid(); |
|
8194 |
ClearExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
8195 |
SendEventsToPluginManL(EPluginEnablePriorityChangeOnOriChange,EFalse); |
|
8196 |
// Fire up the dialog |
|
8197 |
iMatchesListLaunched = ETrue; |
|
8198 |
TInt returnValue = iUiInterface->LaunchListPopupL(R_AVKON_T9_MATCHES_QUERY, index, |
|
8199 |
currentIndex, matchesList, NULL); |
|
8200 |
iMatchesListLaunched = EFalse; |
|
8201 |
PrepareFepAfterDialogExitL(fepUid); |
|
8202 |
SendEventsToPluginManL(EPluginEnablePriorityChangeOnOriChange,ETrue); |
|
8203 |
if(returnValue == EAknSoftkeyOk) |
|
8204 |
{// Selected item 'index' from the matches array |
|
8205 |
HandleChangeInFocusL(); |
|
8206 |
TBuf<EMaximumFepWordLength> newText; |
|
8207 |
// Get current match from editor and show it as a default text in 'insert word' query. |
|
8208 |
iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(newText, |
|
8209 |
iUncommittedText.iAnchorPos, iUncommittedText.Length()); |
|
8210 |
||
8211 |
if (index==noOfMatches) // => 'spell' item at the bottom of the list |
|
8212 |
{ |
|
8213 |
LaunchInsertWordQueryL(newText, iUncommittedText); |
|
8214 |
#ifdef RD_SCALABLE_UI_V2 |
|
8215 |
if( iFepFullyConstructed && iFepPluginManager ) |
|
8216 |
{ |
|
8217 |
iFepPluginManager->ResetMenuState(); |
|
8218 |
} |
|
8219 |
#endif |
|
8220 |
} |
|
8221 |
else |
|
8222 |
{ // insert word at index into text |
|
8223 |
TBuf<EMaximumFepWordLength> modifiedMatch; |
|
8224 |
modifiedMatch.Copy(matchesList->MdcaPoint(index)); |
|
8225 |
TChar first(newText[0]); |
|
8226 |
if (first.IsUpper()) |
|
8227 |
{ |
|
8228 |
TChar converted(modifiedMatch[0]); |
|
8229 |
converted.UpperCase(); |
|
8230 |
modifiedMatch[0] = converted; |
|
8231 |
} |
|
8232 |
InsertTextFromDialogL(modifiedMatch, iUncommittedText); |
|
8233 |
} |
|
8234 |
} |
|
8235 |
CleanupStack::PopAndDestroy(); // matchesList |
|
8236 |
} |
|
8237 |
} |
|
8238 |
||
8239 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
8240 |
// Predictive QWERTY (XT9) changes ----> |
|
8241 |
void CAknFepManager::LaunchCandidatePopupListL( TInt aFocusedIndex ) |
|
8242 |
{ |
|
8243 |
iKeyBackSpaceHit = 1; |
|
8244 |
//CPtiEngine* ptiEngine = iPtiEngine; |
|
8245 |
||
8246 |
// Addition for ITI features on FSQ. |
|
8247 |
// Before open candidate list, if FSQ is opened, |
|
8248 |
// also need to check and close tooltip on it. |
|
8249 |
SendEventsToPluginManL( EPluginHideTooltip ); |
|
8250 |
||
8251 |
// Before open candidate list, if touch ui is opened, |
|
8252 |
// also need to close touch ui firstly. |
|
8253 |
if ( iFepPluginManager->PluginInputMode() != EPluginInputModeNone ) |
|
8254 |
{ |
|
8255 |
iFepPluginManager->ClosePluginInputUiL( ETrue ); |
|
8256 |
} |
|
8257 |
||
8258 |
iExactWordPopupContent->HidePopUp(); |
|
8259 |
||
8260 |
TBool isShiftKeyDepressedAfterCandidateListLaunched = EFalse; |
|
8261 |
// Retrieve active index for QWERTY keypad when Best Prediction is Set |
|
8262 |
TInt activeIndex = KErrNotFound; |
|
8263 |
||
8264 |
if(iPrimaryCandidate && IsQwerty() && ( KeyboardLayout() != EPtiKeyboardHalfQwerty)) |
|
8265 |
{ |
|
8266 |
iPtiEngine->HandleCommandL( EPtiCommandUserActionGetCurrentIndexOfCandidates, &activeIndex ); |
|
8267 |
} |
|
8268 |
||
8269 |
TInt noOfMatches = iPtiEngine->NumberOfCandidates(); |
|
8270 |
if (noOfMatches > 0) |
|
8271 |
{ |
|
8272 |
//! The compact candidate popup that opens with when arrow down pressed while inline editing |
|
8273 |
//MAknFepCandidatePopup *candidatePopup; |
|
8274 |
||
8275 |
//Predictive QWERTY (XT9) changes for new Architecture ----> |
|
8276 |
iCandidatePopup = UiInterface()->NewCandidatePopupL(*this); |
|
8277 |
//Predictive QWERTY (XT9) changes for new Architecture <---- |
|
8278 |
||
8279 |
// Determine the place where to spawn the candidate popup. |
|
8280 |
TPoint inlineEditorTl; |
|
8281 |
TPoint inlineEditorBr; |
|
8282 |
TInt height; |
|
8283 |
TInt ascent; |
|
8284 |
TInt documentOffset = iPtiEngine->CurrentWord().Length(); |
|
8285 |
||
8286 |
// Popup Position was not right for RTL ----> |
|
8287 |
if(iLanguageCapabilities.iRightToLeftLanguage) |
|
8288 |
documentOffset = 0; |
|
8289 |
// Popup Position was not right for RTL <---- |
|
8290 |
GetScreenCoordinatesL(inlineEditorTl, height, ascent, documentOffset); |
|
8291 |
||
8292 |
inlineEditorTl.iY -= height; |
|
8293 |
GetScreenCoordinatesL(inlineEditorBr, height, ascent); |
|
8294 |
||
8295 |
// Focus next word in list ----> |
|
8296 |
// To fix the bug Candidate list opens with the highlight on 3rd candidate when Exact typing is use. |
|
8297 |
// Show the popup. |
|
8298 |
TInt selectedIdx = aFocusedIndex; |
|
8299 |
TKeyEvent lastKeyEvent; |
|
8300 |
||
8301 |
if(selectedIdx == KErrNotFound) |
|
8302 |
{ |
|
8303 |
if (noOfMatches > 1) |
|
8304 |
{ |
|
8305 |
selectedIdx = KWordToFocusInCandidateList; |
|
8306 |
} |
|
8307 |
// Focus next word in list <---- |
|
8308 |
if(iSListLaunchedFromMenu) |
|
8309 |
{ |
|
8310 |
iPtiEngine->HandleCommandL( EPtiCommandUserActionGetCurrentIndexOfCandidates, &selectedIdx ); |
|
8311 |
iSListLaunchedFromMenu = EFalse; |
|
8312 |
} |
|
8313 |
} |
|
8314 |
TUid fepUid = CCoeEnv::Static()->FepUid(); |
|
8315 |
ClearExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
8316 |
TInt popupCmd = iCandidatePopup->ExecutePopupL( TRect(inlineEditorTl, inlineEditorBr), |
|
8317 |
selectedIdx, lastKeyEvent, iLanguageCapabilities.iRightToLeftLanguage, |
|
8318 |
(TInt)KeyboardLayout() ); |
|
8319 |
PrepareFepAfterDialogExitL(fepUid); |
|
8320 |
||
8321 |
if((lastKeyEvent.iScanCode == EStdKeyDevice3 ) || |
|
8322 |
((lastKeyEvent.iScanCode == KAknFEPZeroKey)&& ((KeyboardLayout()== EPtiKeyboard12Key)||(KeyboardLayout()==EPtiKeyboardHalfQwerty))) |
|
8323 |
|| lastKeyEvent.iCode == EKeySpace ) |
|
8324 |
{ |
|
8325 |
SetExtendedFlag(EExtendedFlagOkKeyPressOnCandidatePopup); |
|
8326 |
} |
|
8327 |
||
8328 |
||
8329 |
TBool needToExecute(EFalse); |
|
8330 |
//The candidate list was closed by long key press of shift key |
|
8331 |
isShiftKeyDepressedAfterCandidateListLaunched = IsFlagSet(EFlagShiftKeyDepressed) && (KeyboardLayout()== EPtiKeyboard12Key); |
|
8332 |
if (popupCmd != EAknSoftkeyCancel) |
|
8333 |
{ |
|
8334 |
HandleChangeInFocusL(); |
|
8335 |
||
8336 |
if (popupCmd == EAknFepSoftkeySpell) |
|
8337 |
{ |
|
8338 |
// For QWERTY Input Mode |
|
8339 |
if (iQwertyInputMode && EPtiKeyboardHalfQwerty != iKeyboardType) |
|
8340 |
{ |
|
8341 |
TInt activeIdx = KErrNotFound; |
|
8342 |
TInt secondaryIdx = KErrNotFound; |
|
8343 |
||
8344 |
iPtiEngine->HandleCommandL( EPtiCommandUserActionGetCurrentIndexOfCandidates, |
|
8345 |
&activeIdx ); |
|
8346 |
iPtiEngine->HandleCommandL( EPtiCommandUserActionGetIndexOfSecondaryCandidate, |
|
8347 |
&secondaryIdx ); |
|
8348 |
||
8349 |
if(activeIdx != secondaryIdx) |
|
8350 |
{ |
|
8351 |
iPtiEngine->HandleCommandL( |
|
8352 |
EPtiCommandUserActionSetCurrentIndexOfCandidates, &secondaryIdx ); |
|
8353 |
} |
|
8354 |
else |
|
8355 |
{ |
|
8356 |
secondaryIdx = 0; |
|
8357 |
iPtiEngine->HandleCommandL( |
|
8358 |
EPtiCommandUserActionSetCurrentIndexOfCandidates, &secondaryIdx ); |
|
8359 |
} |
|
8360 |
TPtrC selectedWord = iPtiEngine->CurrentWord(); |
|
8361 |
if(!IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
8362 |
{ |
|
8363 |
StartInlineEditingWithSelectedWord(selectedWord); |
|
8364 |
} |
|
8365 |
UpdateInlineEditL( selectedWord, selectedWord.Length() ); |
|
8366 |
||
8367 |
} |
|
8368 |
// For ITUT Keypad, remove autocompletion part before launching Query Dialog |
|
8369 |
else |
|
8370 |
{ |
|
8371 |
RemoveSuggestedAdvanceCompletionL(); |
|
8372 |
} |
|
8373 |
||
8374 |
// delete the candidate popup before launching the edit word dialog |
|
8375 |
// as the candidate list has already been closed. |
|
8376 |
if(iCandidatePopup) |
|
8377 |
{ |
|
8378 |
delete iCandidatePopup; |
|
8379 |
iCandidatePopup = NULL; |
|
8380 |
} |
|
8381 |
||
8382 |
LaunchEditWordQueryL(); |
|
8383 |
} |
|
8384 |
||
8385 |
// Close with space or selection key: Commit and add space or move cursor ahead one |
|
8386 |
// character if next character already is space |
|
8387 |
else if ( ( lastKeyEvent.iScanCode == EStdKeyDevice3 || lastKeyEvent.iScanCode == KAknFEPZeroKey ) |
|
8388 |
&& ( KeyboardLayout() == EPtiKeyboard12Key || KeyboardLayout() == EPtiKeyboardHalfQwerty ) ) |
|
8389 |
{ |
|
8390 |
iPtiEngine->HandleCommandL( EPtiCommandUserActionSetCurrentIndexOfCandidates, |
|
8391 |
&selectedIdx ); |
|
8392 |
TPtrC selectedWord = iPtiEngine->CurrentWord(); |
|
8393 |
if(!IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
8394 |
{ |
|
8395 |
StartInlineEditingWithSelectedWord(selectedWord); |
|
8396 |
} |
|
8397 |
UpdateInlineEditL( selectedWord, selectedWord.Length() ); |
|
8398 |
iPtiEngine->CommitCurrentWord(); |
|
8399 |
CommitInlineEditL(); |
|
8400 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
8401 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
8402 |
#endif |
|
8403 |
||
8404 |
AddOneSpaceOrMoveCursorL(); |
|
8405 |
} |
|
8406 |
// Close with right arrow commits the word, does not add space |
|
8407 |
else if ( lastKeyEvent.iScanCode == EStdKeyRightArrow ) |
|
8408 |
{ |
|
8409 |
// Change of UI Spec |
|
8410 |
/* |
|
8411 |
* The following codde change is a part of bug fix for improper |
|
8412 |
* behavior of right arrow key when the candidate list is open. The |
|
8413 |
* right arrow key according to the UI specs should not the selected |
|
8414 |
* candicdate and cursor should be end of the word. |
|
8415 |
*/ |
|
8416 |
iPtiEngine->HandleCommandL( EPtiCommandUserActionSetCurrentIndexOfCandidates, |
|
8417 |
&selectedIdx ); |
|
8418 |
TPtrC selectedWord = iPtiEngine->CurrentWord(); |
|
8419 |
if(!IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
8420 |
{ |
|
8421 |
StartInlineEditingWithSelectedWord(selectedWord); |
|
8422 |
} |
|
8423 |
UpdateInlineEditL( selectedWord, selectedWord.Length() ); //selection.iAnchorPosition |
|
8424 |
iPtiEngine->CommitCurrentWord(); |
|
8425 |
CommitInlineEditL(); |
|
8426 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
8427 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
8428 |
#endif |
|
8429 |
||
8430 |
SimulateKeyEventL(EKeyF19); |
|
8431 |
} |
|
8432 |
else if(popupCmd == EAknSoftkeyOk) |
|
8433 |
{ |
|
8434 |
iPtiEngine->HandleCommandL( EPtiCommandUserActionSetCurrentIndexOfCandidates, |
|
8435 |
&selectedIdx ); |
|
8436 |
TPtrC selectedWord = iPtiEngine->CurrentWord(); |
|
8437 |
if(!IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
8438 |
{ |
|
8439 |
StartInlineEditingWithSelectedWord(selectedWord); |
|
8440 |
} |
|
8441 |
UpdateInlineEditL( selectedWord, selectedWord.Length() ); |
|
8442 |
iPtiEngine->CommitCurrentWord(); |
|
8443 |
CommitInlineEditL(); |
|
8444 |
AddOneSpaceOrMoveCursorL(); |
|
8445 |
} |
|
8446 |
else |
|
8447 |
{ |
|
8448 |
iPtiEngine->HandleCommandL( EPtiCommandUserActionSetCurrentIndexOfCandidates, |
|
8449 |
&selectedIdx ); |
|
8450 |
TPtrC selectedWord = iPtiEngine->CurrentWord(); |
|
8451 |
if(!IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
8452 |
{ |
|
8453 |
StartInlineEditingWithSelectedWord(selectedWord); |
|
8454 |
} |
|
8455 |
UpdateInlineEditL( selectedWord, selectedWord.Length() ); |
|
8456 |
needToExecute = ETrue; |
|
8457 |
} |
|
8458 |
} |
|
8459 |
else if (popupCmd == EAknSoftkeyCancel && iPrimaryCandidate && IsQwerty() |
|
8460 |
&& ( KeyboardLayout() != EPtiKeyboardHalfQwerty ) ) |
|
8461 |
{ |
|
8462 |
iPtiEngine->HandleCommandL( EPtiCommandUserActionSetIndexOfActiveCandidate, &activeIndex ); |
|
8463 |
iKeyBackSpaceHit = 0; |
|
8464 |
} |
|
8465 |
else if(lastKeyEvent.iCode == EKeyPhoneEnd ) |
|
8466 |
{ |
|
8467 |
HandleChangeInFocusL(); |
|
8468 |
CCoeEnv::Static()->SimulateKeyEventL( lastKeyEvent, EEventKey ); |
|
8469 |
} |
|
8470 |
else if (popupCmd == EAknSoftkeyCancel && IsQwerty() && ( KeyboardLayout() != EPtiKeyboardHalfQwerty ) ) |
|
8471 |
iKeyBackSpaceHit = 0; |
|
8472 |
||
8473 |
// If the dialog is not closed by pressing softkeys, escape, or right arrow |
|
8474 |
// then the pressed key is handled also by Fep. This way the user can keep typing when the popup is open. |
|
8475 |
||
8476 |
//=============== Error fixing and simplify the condition ========================================== |
|
8477 |
// The following piece of code should be excuted, if focus word |
|
8478 |
// in the candidate list is accept, otherwise word sholud remain as it is. |
|
8479 |
// If user does not accept the word,popupCmd always be EAknSoftkeyCancel. |
|
8480 |
// Insetead of earlier lengthy condition, makes it simple. |
|
8481 |
||
8482 |
if( needToExecute ) |
|
8483 |
{ |
|
8484 |
const TBool shifted = (lastKeyEvent.iModifiers & (EModifierLeftShift | |
|
8485 |
EModifierRightShift | EModifierShift)); |
|
8486 |
const TBool chrDown = (lastKeyEvent.iModifiers & (EModifierLeftFunc)); |
|
8487 |
||
8488 |
const TBool fnDown = (lastKeyEvent.iModifiers & (EModifierRightFunc)); |
|
8489 |
if(fnDown ) |
|
8490 |
iFnKeyManager->SetFnKeyState(CAknFepFnKeyManager::EFnKeyDown) ; |
|
8491 |
||
8492 |
if (shifted) |
|
8493 |
{ |
|
8494 |
SetFlag(EFlagQwertyShiftMode|EFlagNoActionDuringShiftKeyPress); |
|
8495 |
} |
|
8496 |
else |
|
8497 |
{ |
|
8498 |
ClearFlag(EFlagQwertyShiftMode|EFlagNoActionDuringShiftKeyPress); |
|
8499 |
} |
|
8500 |
||
8501 |
if (chrDown) |
|
8502 |
{ |
|
8503 |
SetFlag(EFlagQwertyChrKeyDepressed|EFlagNoActionDuringChrKeyPress); |
|
8504 |
} |
|
8505 |
else |
|
8506 |
{ |
|
8507 |
ClearFlag(EFlagQwertyChrKeyDepressed|EFlagNoActionDuringChrKeyPress); |
|
8508 |
} |
|
8509 |
if ( lastKeyEvent.iScanCode == EStdKeyDevice3 ) |
|
8510 |
{ |
|
8511 |
CCoeEnv::Static()->SimulateKeyEventL( lastKeyEvent, EEventKey ); |
|
8512 |
} |
|
8513 |
if (! ( lastKeyEvent.iScanCode == EStdKeyDevice3 || |
|
8514 |
lastKeyEvent.iScanCode == EStdKeyRightArrow ) ) |
|
8515 |
{ |
|
8516 |
/* |
|
8517 |
* The following code change is a part of bug fix for improper |
|
8518 |
* behavior of any keypress when the candidate list is open. The |
|
8519 |
* keypress according to the UI specs should lock the selected |
|
8520 |
* candidate to editor and the inserted letter is appended to it. |
|
8521 |
*/ |
|
8522 |
iPtiEngine->HandleCommandL( EPtiCommandLockCurrentCandidate); |
|
8523 |
TPtrC selectedWord = iPtiEngine->CurrentWord(); |
|
8524 |
if(!IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
8525 |
{ |
|
8526 |
StartInlineEditingWithSelectedWord(selectedWord); |
|
8527 |
} |
|
8528 |
UpdateInlineEditL( selectedWord, selectedWord.Length() ); //selection.iAnchorPosition |
|
8529 |
// For QWERTY input mode, scanCode is used |
|
8530 |
#ifdef __HALF_QWERTY_KEYPAD |
|
8531 |
if( KeyboardLayout() == EPtiKeyboardHalfQwerty) |
|
8532 |
{ |
|
8533 |
iHalfQwertyLastKeyEvent = lastKeyEvent; |
|
8534 |
iAsyncOwnSimulateKey.CallBack(); |
|
8535 |
} |
|
8536 |
else |
|
8537 |
#endif //__HALF_QWERTY_KEYPAD |
|
8538 |
if (iQwertyInputMode) |
|
8539 |
{ |
|
8540 |
CCoeEnv::Static()->SimulateKeyEventL( lastKeyEvent, EEventKey ); |
|
8541 |
} |
|
8542 |
// For ITUT input Mode, keyCode is used |
|
8543 |
else |
|
8544 |
{ |
|
8545 |
SimulateKeyEventL( lastKeyEvent.iCode); |
|
8546 |
} |
|
8547 |
} |
|
8548 |
} |
|
8549 |
||
8550 |
ShowExactWordPopupIfNecessaryL(); |
|
8551 |
if(iCandidatePopup) |
|
8552 |
{ |
|
8553 |
delete iCandidatePopup; |
|
8554 |
iCandidatePopup = NULL; |
|
8555 |
} |
|
8556 |
} |
|
8557 |
//The flag ECcpuStateShiftkeyWasPressedBeforeLosingFocus suggests that the candidate list was closed with a |
|
8558 |
//long key press of edit key (shift key). There are multiple calls to HandleChangedInFocusL() one manually and the other through |
|
8559 |
//CONE focus change notifier. We want the flag to be set for CONE's focus handler. |
|
8560 |
if(isShiftKeyDepressedAfterCandidateListLaunched) |
|
8561 |
{ |
|
8562 |
SetCcpuFlag(ECcpuStateShiftkeyWasPressedBeforeLosingFocus); |
|
8563 |
} |
|
8564 |
} |
|
8565 |
void CAknFepManager::StartInlineEditingWithSelectedWord(TDesC& aTextToUncommit) |
|
8566 |
{ |
|
8567 |
if(iConcatenationTimer->IsActive()) |
|
8568 |
iConcatenationTimer->Cancel(); |
|
8569 |
||
8570 |
TInt docLenFep=iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
8571 |
if (iUncommittedText.iCursorPos>docLenFep) |
|
8572 |
iUncommittedText.iCursorPos=docLenFep; |
|
8573 |
if (iUncommittedText.iAnchorPos>docLenFep) |
|
8574 |
iUncommittedText.iAnchorPos=docLenFep; |
|
8575 |
// Activates western predictive UI to an inline editing state. |
|
8576 |
FepUI()->ActivateUI(); |
|
8577 |
SyncStates(EAknFepStateUIActive); |
|
8578 |
// Predictive QWERTY (XT9) changes <---- |
|
8579 |
TRAP_IGNORE(StartInlineEditL(iUncommittedText, aTextToUncommit, |
|
8580 |
aTextToUncommit.Length(), EFalse)); |
|
8581 |
||
8582 |
} |
|
8583 |
void CAknFepManager::GetCandidatesWithIndexL(CDesCArray* aArray, |
|
8584 |
TInt& aActiveIdx, TInt& aSecondaryIdx) |
|
8585 |
{ |
|
8586 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
8587 |
return; |
|
8588 |
#endif |
|
8589 |
aActiveIdx = -1; |
|
8590 |
aSecondaryIdx = -1; |
|
8591 |
iPtiEngine->HandleCommandL( |
|
8592 |
EPtiCommandUserActionGetCurrentIndexOfCandidates, &aActiveIdx); |
|
8593 |
||
8594 |
if (iKeyBackSpaceHit) |
|
8595 |
aSecondaryIdx = aActiveIdx; |
|
8596 |
else |
|
8597 |
iPtiEngine->HandleCommandL( |
|
8598 |
EPtiCommandUserActionGetIndexOfSecondaryCandidate, |
|
8599 |
&aSecondaryIdx); |
|
8600 |
||
8601 |
if (aArray == NULL || aActiveIdx == aSecondaryIdx) |
|
8602 |
return; |
|
8603 |
||
8604 |
iPtiEngine->GetCandidateListL(*aArray); |
|
8605 |
iPtiEngine->HandleCommandL( |
|
8606 |
EPtiCommandUserActionGetCurrentIndexOfCandidates, &aActiveIdx); |
|
8607 |
iPtiEngine->HandleCommandL( |
|
8608 |
EPtiCommandUserActionGetIndexOfSecondaryCandidate, &aSecondaryIdx); |
|
8609 |
} |
|
8610 |
||
8611 |
void CAknFepManager::ShowExactWordPopupIfNecessaryL() |
|
8612 |
{ |
|
8613 |
// Ok, I have to do it here, same logics are in |
|
8614 |
// TryPopExactWordInICFL and ShowExactWordPopupIfNecessaryL. |
|
8615 |
// the code follows the old code's logic: this is a |
|
8616 |
// equivalent of the OLD ShowExactWordPopupIfNecessaryL; but |
|
8617 |
// now I can call TryPopExactWordInICFL and |
|
8618 |
// TryPopExactWordInOtherPlaceL directly after extracting them from |
|
8619 |
// the OLD ShowExactWordPopupIfNecessaryL. |
|
8620 |
iExactWordPopupContent->HidePopUp(); |
|
8621 |
// SendEventsToPluginManL(EPluginHideTooltip); |
|
8622 |
if (!iWesternPredictive || !IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
8623 |
return; |
|
8624 |
||
8625 |
if (EPtiKeyboardHalfQwerty == KeyboardLayout()) |
|
8626 |
{ |
|
8627 |
if (IsFlagSet(CAknFepManager::EFlagNoMatches)) |
|
8628 |
UpdateCbaL(R_AKNFEP_SOFTKEYS_SPELL_EMPTY); |
|
8629 |
return; |
|
8630 |
} |
|
8631 |
||
8632 |
//TryPopExactWordInICFL(); |
|
8633 |
if (iFepPluginManager && !iFepPluginManager->IsTooltipOpenOnFSQ()) |
|
8634 |
TryPopExactWordInOtherPlaceL(); |
|
8635 |
} |
|
8636 |
||
8637 |
void CAknFepManager::TryPopExactWordInICFL() |
|
8638 |
{ |
|
8639 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
8640 |
return; |
|
8641 |
#endif |
|
8642 |
||
8643 |
// Before open tooltip, |
|
8644 |
// also need to check and close tooltip on it. |
|
8645 |
// SendEventsToPluginManL(EPluginHideTooltip); |
|
8646 |
if (!iWesternPredictive || !IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
8647 |
{ |
|
8648 |
SendEventsToPluginManL(EPluginHideTooltip); |
|
8649 |
return; |
|
8650 |
} |
|
8651 |
||
8652 |
TInt activeIdx, secondaryIdx; |
|
8653 |
GetCandidatesWithIndexL(NULL, activeIdx, secondaryIdx); |
|
8654 |
if (activeIdx == secondaryIdx) |
|
8655 |
{ |
|
8656 |
SendEventsToPluginManL(EPluginHideTooltip); |
|
8657 |
return; |
|
8658 |
} |
|
8659 |
||
8660 |
CDesCArray* candidates = new (ELeave) CDesCArrayFlat(16); |
|
8661 |
CleanupStack::PushL(candidates); |
|
8662 |
GetCandidatesWithIndexL(candidates, activeIdx, secondaryIdx); |
|
8663 |
CleanupStack::PopAndDestroy(candidates); |
|
8664 |
if (activeIdx == secondaryIdx) |
|
8665 |
{ |
|
8666 |
SendEventsToPluginManL(EPluginHideTooltip); |
|
8667 |
return; |
|
8668 |
} |
|
8669 |
||
8670 |
if (iFepPluginManager) |
|
8671 |
SendEventsToPluginManL(EPluginShowTooltip, secondaryIdx); |
|
8672 |
} |
|
8673 |
||
8674 |
void CAknFepManager::TryPopExactWordInOtherPlaceL() |
|
8675 |
{ |
|
8676 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
8677 |
return; |
|
8678 |
#endif |
|
8679 |
||
8680 |
iExactWordPopupContent->HidePopUp(); |
|
8681 |
if (!iWesternPredictive || !IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
8682 |
return; |
|
8683 |
// In the proactive mode this popup is used to show the exact input if it differs from the |
|
8684 |
// default candidate shown inline. |
|
8685 |
// In the reactive mode it is used to show the best guess candidate if it differs from the |
|
8686 |
// exact word shown inline. |
|
8687 |
||
8688 |
TBool popupBelowInline = EFalse; // ETrue -> popup is above inline editor |
|
8689 |
TInt activeIdx, secondaryIdx; |
|
8690 |
GetCandidatesWithIndexL(NULL, activeIdx, secondaryIdx); |
|
8691 |
if (activeIdx == secondaryIdx) |
|
8692 |
return; |
|
8693 |
||
8694 |
CDesCArray* candidates = new (ELeave) CDesCArrayFlat(16); |
|
8695 |
CleanupStack::PushL(candidates); |
|
8696 |
GetCandidatesWithIndexL(candidates, activeIdx, secondaryIdx); |
|
8697 |
||
8698 |
// In case the active index and the secondary index is same, |
|
8699 |
// then we do not need to display the popup |
|
8700 |
if (activeIdx == secondaryIdx) |
|
8701 |
{ |
|
8702 |
CleanupStack::PopAndDestroy(candidates); |
|
8703 |
return; |
|
8704 |
} |
|
8705 |
||
8706 |
TPtrC secondaryWord = (*candidates)[secondaryIdx]; |
|
8707 |
iExactWordPopupContent->SetTextL(secondaryWord); |
|
8708 |
iExactWordPopupContent->SetArrowDirection( |
|
8709 |
MAknFepUiWordPopupContent::EUpwards); |
|
8710 |
CleanupStack::PopAndDestroy(candidates); |
|
8711 |
||
8712 |
TPoint popupTopRight; |
|
8713 |
TInt height; |
|
8714 |
TInt ascent; |
|
8715 |
TInt documentOffset = iPtiEngine->CurrentWord().Length(); |
|
8716 |
||
8717 |
GetScreenCoordinatesL(popupTopRight, height, ascent, documentOffset); |
|
8718 |
iExactWordPopupContent->UpdateContentSize(); |
|
8719 |
||
8720 |
TBool rightToLeftLang = IsRightToLeftParagraph(DocPos()); |
|
8721 |
if (!rightToLeftLang) |
|
8722 |
{ |
|
8723 |
popupTopRight.iX += iExactWordPopupContent->Size().iWidth; |
|
8724 |
} |
|
8725 |
||
8726 |
if (popupBelowInline) |
|
8727 |
{ |
|
8728 |
popupTopRight.iY += ascent / 2; |
|
8729 |
} |
|
8730 |
else |
|
8731 |
{ |
|
8732 |
popupTopRight.iY -= height + iExactWordPopupContent->Size().iHeight; |
|
8733 |
} |
|
8734 |
||
8735 |
iExactWordPopupContent->SetPosition(popupTopRight); |
|
8736 |
iExactWordPopupContent->ShowPopUp(); |
|
8737 |
} |
|
8738 |
||
8739 |
void CAknFepManager::LaunchPredictiveSettingDialogL() |
|
8740 |
{ |
|
8741 |
#ifdef RD_SCALABLE_UI_V2 |
|
8742 |
// Addtion of ITI features on FSQ. |
|
8743 |
if ( iFepPluginManager |
|
8744 |
&& iFepPluginManager->IsSupportITIOnFSQ() ) |
|
8745 |
{ |
|
8746 |
// Hide touch input ui firstly, |
|
8747 |
// otherwise, touch ui can hide status pane. |
|
8748 |
// Let CAknFepPluginManager know this setting dialog will be opened. |
|
8749 |
iFepPluginManager->ITISettingDialogOpen( ETrue ); |
|
8750 |
iFepPluginManager->ClosePluginInputUiL( ETrue ); |
|
8751 |
SendEventsToPluginManL( ELostForeground ); |
|
8752 |
} |
|
8753 |
#endif // RD_SCALABLE_UI_V2 |
|
8754 |
||
8755 |
// Hide fixed toolbar just before launching predictive settings dialog |
|
8756 |
CEikAppUiFactory * appUiFactory = NULL; |
|
8757 |
appUiFactory = static_cast<CEikAppUiFactory*>(CEikonEnv::Static()->AppUiFactory()); |
|
8758 |
||
8759 |
CAknToolbar * fixedToolbar = NULL; |
|
8760 |
if(appUiFactory) |
|
8761 |
fixedToolbar = appUiFactory->CurrentFixedToolbar(); |
|
8762 |
||
8763 |
// If fixedtoolbar is not there in the current editor, we don't need to hide it before launching settings dialog |
|
8764 |
// and unhide it after settings dialog is done. |
|
8765 |
if( fixedToolbar && !( fixedToolbar->IsShown() && fixedToolbar->CountComponentControls()>0 ) ) |
|
8766 |
fixedToolbar = NULL; |
|
8767 |
||
8768 |
if(fixedToolbar) |
|
8769 |
{ |
|
8770 |
fixedToolbar->SetDimmed(ETrue); |
|
8771 |
fixedToolbar->DrawDeferred(); |
|
8772 |
} |
|
8773 |
TUid fepUid = CCoeEnv::Static()->FepUid(); |
|
8774 |
ClearExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
8775 |
||
8776 |
if ( iFepPluginManager && iFepPluginManager->IsSupportITIOnFSQ() ) |
|
8777 |
{ |
|
8778 |
RProperty::Set( KPSUidAknFep, KAknFepSettingDialogState, 2 ); |
|
8779 |
} |
|
8780 |
else |
|
8781 |
{ |
|
8782 |
RProperty::Set( KPSUidAknFep, KAknFepSettingDialogState, 1 ); |
|
8783 |
} |
|
8784 |
||
8785 |
UiInterface()->LaunchPredictiveSettingDialogL(R_PREDICTIVESETTING_DIALOG, |
|
8786 |
R_PREDICTIVESETTINGDIALOG_MENUBAR, |
|
8787 |
R_PREDICTIVETEXTOFF_CONFIRMATION_QUERY, |
|
8788 |
R_AKNFEP_PRED_INPUT_SETTINGS_TITLE); |
|
8789 |
PrepareFepAfterDialogExitL(fepUid); |
|
8790 |
RProperty::Set(KPSUidAknFep,KAknFepSettingDialogState,0); |
|
8791 |
#ifdef RD_SCALABLE_UI_V2 |
|
8792 |
// // Addtion of ITI features on FSQ. |
|
8793 |
if ( iFepPluginManager |
|
8794 |
&& iFepPluginManager->IsSupportITIOnFSQ() ) |
|
8795 |
{ |
|
8796 |
// Let CAknFepPluginManager know this setting dialog will be opened. |
|
8797 |
iFepPluginManager->ITISettingDialogOpen( EFalse ); |
|
8798 |
} |
|
8799 |
#endif // RD_SCALABLE_UI_V2 |
|
8800 |
||
8801 |
// Enables fixed toolbar after predictive settings dialog is closed |
|
8802 |
if(fixedToolbar) |
|
8803 |
{ |
|
8804 |
fixedToolbar->SetDimmed(EFalse); |
|
8805 |
fixedToolbar->DrawDeferred(); |
|
8806 |
} |
|
8807 |
} |
|
8808 |
#ifdef FF_DUAL_LANGUAGE_SUPPORT |
|
8809 |
void CAknFepManager::LaunchWritingLanguageSettingDialogL() |
|
8810 |
{ |
|
8811 |
TUid fepUid = CCoeEnv::Static()->FepUid(); |
|
8812 |
ClearExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
8813 |
UiInterface()->LaunchWritingLanguageSettingDialogL(R_INPUTLANGUAGE_DIALOG, R_PREDICTIVESETTINGDIALOG_MENUBAR, R_INPUT_LANGUAGE_SETTINGS_TITLE); |
|
8814 |
PrepareFepAfterDialogExitL(fepUid); |
|
8815 |
} |
|
8816 |
||
8817 |
void CAknFepManager:: LaunchDualLanguageSettingDialogL() |
|
8818 |
{ |
|
8819 |
/* In Chinese language variant,if there are more than one languages supporting dual language feature, |
|
8820 |
display writing language setting view in which Primary and Secondary Languages can be selected from the list. |
|
8821 |
||
8822 |
In Chinese language variant,if there is only one language supporting dual language feature, |
|
8823 |
no need to display the Writing language view which contains Primary and Secondary Language. |
|
8824 |
Instead we can display the Writing language list directly to the user;from which the user can select the writing language*/ |
|
8825 |
||
8826 |
if( FeatureManager::FeatureSupported( KFeatureIdChinese ) || FeatureManager::FeatureSupported( KFeatureIdJapanese )) |
|
8827 |
{ |
|
8828 |
CArrayFixFlat<TInt>* languages = new( ELeave )CArrayFixFlat<TInt>( ELanguageArrayGranularity ); |
|
8829 |
CleanupStack::PushL( languages ); |
|
8830 |
iPtiEngine->GetAvailableLanguagesL( languages ); |
|
8831 |
||
8832 |
TInt count = languages->Count(); |
|
8833 |
TInt noLangSupportWesternPred = count; |
|
8834 |
for (TInt index = 0; index < count; index++) |
|
8835 |
{ |
|
8836 |
TInt langCode = languages->At(index); |
|
8837 |
||
8838 |
if (langCode == ELangTaiwanChinese || |
|
8839 |
langCode == ELangHongKongChinese || |
|
8840 |
langCode == ELangPrcChinese || |
|
8841 |
langCode == ELangJapanese || |
|
8842 |
langCode == ELangKorean ) |
|
8843 |
{ |
|
8844 |
noLangSupportWesternPred--; |
|
8845 |
} |
|
8846 |
} |
|
8847 |
CleanupStack::PopAndDestroy(languages); |
|
8848 |
||
8849 |
if( noLangSupportWesternPred > 1 ) |
|
8850 |
{ |
|
8851 |
SetFlag(CAknFepManager::EFlagNewSharedDataInputMode); |
|
8852 |
LaunchWritingLanguageSettingDialogL(); |
|
8853 |
if(IsFlagSet(CAknFepManager::EFlagNewSharedDataInputLanguage)) |
|
8854 |
{ |
|
8855 |
ClearFlag(CAknFepManager::EFlagNewSharedDataInputLanguage); |
|
8856 |
HandleChangeInFocusL(); |
|
8857 |
ChangeInputLanguageL(iSharedDataInterface->InputTextLanguage()); |
|
8858 |
} |
|
8859 |
} |
|
8860 |
else |
|
8861 |
LaunchLanguagesPopupListL(); |
|
8862 |
} |
|
8863 |
else |
|
8864 |
{ |
|
8865 |
LaunchWritingLanguageSettingDialogL(); |
|
8866 |
if(IsFlagSet(CAknFepManager::EFlagNewSharedDataInputLanguage)) |
|
8867 |
{ |
|
8868 |
ClearFlag(CAknFepManager::EFlagNewSharedDataInputLanguage); |
|
8869 |
HandleChangeInFocusL(); |
|
8870 |
ChangeInputLanguageL(iSharedDataInterface->InputTextLanguage()); |
|
8871 |
} |
|
8872 |
} |
|
8873 |
||
8874 |
} |
|
8875 |
#endif //FF_DUAL_LANGUAGE_SUPPORT |
|
8876 |
// Predictive QWERTY (XT9) changes <---- |
|
8877 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
8878 |
void CAknFepManager::LaunchInsertWordQueryL(const TDesC& aInitialText, |
|
8879 |
TCursorSelection aTextSpanToReplace) |
|
8880 |
{ |
|
8881 |
TInt recourceId = R_AVKON_INSERT_WORD_QUERY; |
|
8882 |
LaunchFepQueryDialogL(recourceId, aInitialText, aTextSpanToReplace); |
|
8883 |
} |
|
8884 |
||
8885 |
void CAknFepManager::LaunchEditWordQueryL() |
|
8886 |
{ |
|
8887 |
||
8888 |
TBuf<EMaximumFepWordLength> newText; |
|
8889 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
8890 |
if(IsAutoCompleteOn()) |
|
8891 |
{ |
|
8892 |
RemoveSuggestedCompletionL(); |
|
8893 |
} |
|
8894 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
8895 |
iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(newText, |
|
8896 |
iUncommittedText.iAnchorPos, |
|
8897 |
iUncommittedText.Length()); |
|
8898 |
||
8899 |
TInt recourceId = R_AVKON_INSERT_WORD_QUERY; |
|
8900 |
LaunchFepQueryDialogL(recourceId, newText, iUncommittedText); |
|
8901 |
} |
|
8902 |
||
8903 |
void CAknFepManager::LaunchFepQueryDialogL(TInt aResourceId, const TDesC& aInitialText, |
|
8904 |
TCursorSelection aTextSpanToReplace) |
|
8905 |
{ |
|
8906 |
HBufC* textBuf = HBufC::NewLC(EQueryBufferLength); // buffer for inserted text |
|
8907 |
TPtr text = textBuf->Des(); |
|
8908 |
||
8909 |
if (aInitialText.Length() <= EQueryBufferLength) |
|
8910 |
text.Copy(aInitialText); |
|
8911 |
else // truncate the incoming text to EQueryBufferLength before copying |
|
8912 |
{ |
|
8913 |
TPtrC truncatedText = aInitialText.Left(EQueryBufferLength); |
|
8914 |
text.Copy(truncatedText); |
|
8915 |
} |
|
8916 |
||
8917 |
if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
8918 |
{ |
|
8919 |
TryRemoveNoMatchesIndicatorL(); |
|
8920 |
CommitInlineEditL(); |
|
8921 |
} |
|
8922 |
UpdateCbaL(NULL); |
|
8923 |
||
8924 |
TInt underlyingCase = iCaseMan->CurrentCase(); |
|
8925 |
TBool isCaseUpdatesSupressed = IsFlagSet(EFlagSupressAutoUpdateAtEditorStart); |
|
8926 |
||
8927 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
8928 |
if (aInitialText.Length()) |
|
8929 |
{ |
|
8930 |
iCaseMan->SetCurrentCase(EAknEditorLowerCase); |
|
8931 |
if (aInitialText.Length() == 1) |
|
8932 |
{ |
|
8933 |
if (STATIC_CAST(TChar, aInitialText[0]).IsUpper()) |
|
8934 |
iCaseMan->SetCurrentCase(EAknEditorTextCase); |
|
8935 |
} |
|
8936 |
else // length of initial text > 1 |
|
8937 |
{ |
|
8938 |
if (STATIC_CAST(TChar, aInitialText[0]).IsUpper()) |
|
8939 |
{ |
|
8940 |
if (STATIC_CAST(TChar, aInitialText[1]).IsLower()) |
|
8941 |
iCaseMan->SetCurrentCase(EAknEditorTextCase); |
|
8942 |
else // 2nd character is upper case |
|
8943 |
iCaseMan->SetCurrentCase(EAknEditorUpperCase); |
|
8944 |
} |
|
8945 |
} |
|
8946 |
} |
|
8947 |
#endif // RD_INTELLIGENT_TEXT_INPUT |
|
8948 |
||
8949 |
if (iCaseMan->CurrentCase() == EAknEditorLowerCase |
|
8950 |
|| iCaseMan->CurrentCase() == EAknEditorUpperCase) |
|
8951 |
{ |
|
8952 |
SetFlag(EFlagSupressAutoUpdateAtEditorStart); |
|
8953 |
} |
|
8954 |
||
8955 |
TransferFepStateToEditorL(); |
|
8956 |
||
8957 |
SetFlag(EFlagForegroundUIComponentVisible); |
|
8958 |
||
8959 |
TInt textQueryEditorFlag = 0; |
|
8960 |
if ((aResourceId == R_AVKON_INSERT_WORD_QUERY || |
|
8961 |
aResourceId == R_AVKON_EDIT_WORD_QUERY ) && |
|
8962 |
FeatureManager::FeatureSupported( KFeatureIdChinese )) |
|
8963 |
{ |
|
8964 |
textQueryEditorFlag = EAknEditorFlagLatinInputModesOnly; |
|
8965 |
} |
|
8966 |
#ifdef RD_SCALABLE_UI_V2 |
|
8967 |
if (iFepFullyConstructed && |
|
8968 |
iFepPluginManager->PluginInputMode() == EPluginInputModeItut ) |
|
8969 |
// if ( iFepFullyConstructed && |
|
8970 |
// (( iFepPluginManager->PluginInputMode() == EPluginInputModeItut ) && IsChineseInputLanguage())) |
|
8971 |
{ |
|
8972 |
iFepPluginManager->SpellText(textBuf); |
|
8973 |
iFepPluginManager->DisplaySpellEditor(textQueryEditorFlag, aInitialText, |
|
8974 |
TCursorSelection(aInitialText.Length(), 0)); |
|
8975 |
||
8976 |
delete iSpellInitText; |
|
8977 |
iSpellInitText = NULL; |
|
8978 |
iSpellInitText = aInitialText.AllocL(); |
|
8979 |
iSpellInitCurSel = aTextSpanToReplace; |
|
8980 |
||
8981 |
iFepPluginManager->SetCaseUpdatesSupressed(isCaseUpdatesSupressed); |
|
8982 |
//add to avoid text update late when open spell. |
|
8983 |
//iFepPluginManager->SetITUTSpellingStateL(ETrue); |
|
8984 |
iFepPluginManager->SetCursorSelection(aTextSpanToReplace); |
|
8985 |
CleanupStack::PopAndDestroy(); |
|
8986 |
||
8987 |
return; |
|
8988 |
} |
|
8989 |
#endif |
|
8990 |
||
8991 |
if(iFepPluginManager) |
|
8992 |
{ |
|
8993 |
iFepPluginManager->SetInEditWordQueryFlag(ETrue); |
|
8994 |
} |
|
8995 |
||
8996 |
PrepareFepForFepAwareDialogLaunch(); |
|
8997 |
TUid fepUid = CCoeEnv::Static()->FepUid(); |
|
8998 |
ClearExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
8999 |
TInt id = iUiInterface->TextQueryDialogL(text, *EditorState(), |
|
9000 |
textQueryEditorFlag, aResourceId); |
|
9001 |
PrepareFepAfterFepAwareDialogExitL(fepUid); |
|
9002 |
PrepareFepAfterDialogExitL(fepUid); |
|
9003 |
||
9004 |
if(iFepPluginManager) |
|
9005 |
{ |
|
9006 |
iFepPluginManager->SetInEditWordQueryFlag(EFalse); |
|
9007 |
} |
|
9008 |
if (id == EAknSoftkeyOk) |
|
9009 |
{ |
|
9010 |
// Insert the character into the edwin. |
|
9011 |
InsertTextFromDialogL(text, aTextSpanToReplace); |
|
9012 |
// Add the word to the user dictionary (except for single character) after it has been added to the editor. |
|
9013 |
// FepUI of the main editor is used. Different FepUI is used in multitap |
|
9014 |
// query and predictive mode 'main' editor at least in Japanese variant. |
|
9015 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
9016 |
if(text.Length() > 1) |
|
9017 |
FepUI()->AddTextToUserDictionaryL(text); |
|
9018 |
#else |
|
9019 |
FepUI()->AddTextToUserDictionaryL(text); |
|
9020 |
#endif // RD_INTELLIGENT_TEXT_INPUT |
|
9021 |
||
9022 |
} |
|
9023 |
else // restore original case and inline text |
|
9024 |
{ |
|
9025 |
HandleChangeInFocus(); |
|
9026 |
if (aTextSpanToReplace.Length()) |
|
9027 |
{ |
|
9028 |
EditorState()->SetInlineEditSpan(aTextSpanToReplace); |
|
9029 |
ConfigureFEPFromEditorStateL(); |
|
9030 |
} |
|
9031 |
iCaseMan->SetCurrentCase(underlyingCase); |
|
9032 |
TransferFepStateToEditorL(); |
|
9033 |
} |
|
9034 |
||
9035 |
if (isCaseUpdatesSupressed) |
|
9036 |
{ |
|
9037 |
SetFlag(EFlagSupressAutoUpdate); |
|
9038 |
} |
|
9039 |
else |
|
9040 |
{ |
|
9041 |
ClearFlag(EFlagSupressAutoUpdate); |
|
9042 |
} |
|
9043 |
ClearFlag(EFlagSupressAutoUpdateAtEditorStart); |
|
9044 |
CleanupStack::PopAndDestroy(); // text |
|
9045 |
} |
|
9046 |
||
9047 |
void CAknFepManager::InsertTextFromDialogL(const TDesC& aTextFromDialog, |
|
9048 |
TCursorSelection aExtentOfTextToReplace) |
|
9049 |
{ |
|
9050 |
SetCcpuFlag(ECcpuStateSupressCursorMoveToEnd); |
|
9051 |
// ensure we're back on the correct editor |
|
9052 |
||
9053 |
#ifdef RD_SCALABLE_UI_V2 |
|
9054 |
iNotifyPlugin = EFalse; // not really focus change |
|
9055 |
HandleChangeInFocus(); |
|
9056 |
iNotifyPlugin = ETrue; |
|
9057 |
#else |
|
9058 |
HandleChangeInFocus(); |
|
9059 |
#endif |
|
9060 |
// need to commit if the editor was previously performing an inline edit |
|
9061 |
if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
9062 |
CommitInlineEditL(); |
|
9063 |
||
9064 |
TInt addedTextLength=0; |
|
9065 |
||
9066 |
TCursorSelection currentSelection; |
|
9067 |
// In case input capabilities goes null leaving with an error code and allowing application to handle.. |
|
9068 |
if (NULL == iInputCapabilities.FepAwareTextEditor()) |
|
9069 |
User::Leave(KErrCorrupt); |
|
9070 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(currentSelection); |
|
9071 |
// Prepare for the edit |
|
9072 |
TInt docLength = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
9073 |
TInt maxLength = iInputCapabilities.FepAwareTextEditor()->DocumentMaximumLengthForFep(); |
|
9074 |
||
9075 |
if (aExtentOfTextToReplace.Length()) |
|
9076 |
{ |
|
9077 |
if (currentSelection.Length()) |
|
9078 |
// Want to 'cancel' the selection so move cursor & anchor to the end of |
|
9079 |
// the selection and then to the end of the current word |
|
9080 |
{ |
|
9081 |
TInt endOfSelection=currentSelection.HigherPos(); |
|
9082 |
iUncommittedText.SetSelection(endOfSelection, endOfSelection); |
|
9083 |
if (CursorInsideWord()) |
|
9084 |
MoveCursorToEndOfWordL(); |
|
9085 |
} |
|
9086 |
iUncommittedText = aExtentOfTextToReplace; |
|
9087 |
iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(iUncommittedText); |
|
9088 |
addedTextLength = aTextFromDialog.Length(); |
|
9089 |
if (maxLength != 0) |
|
9090 |
{ |
|
9091 |
addedTextLength = Min(addedTextLength, |
|
9092 |
(maxLength - docLength + iUncommittedText.Length())); |
|
9093 |
} |
|
9094 |
} |
|
9095 |
else |
|
9096 |
{ |
|
9097 |
addedTextLength = aTextFromDialog.Length(); |
|
9098 |
||
9099 |
//maxLength of 0 means the editor has no limit |
|
9100 |
if (maxLength != 0) |
|
9101 |
{ |
|
9102 |
addedTextLength = Min(addedTextLength, |
|
9103 |
(maxLength - docLength + currentSelection.Length())); |
|
9104 |
} |
|
9105 |
if (currentSelection.Length()) |
|
9106 |
{ |
|
9107 |
iUncommittedText.SetSelection(currentSelection.HigherPos(), |
|
9108 |
currentSelection.LowerPos()); |
|
9109 |
iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(iUncommittedText); |
|
9110 |
} |
|
9111 |
else // do this in order for editor to get the correct number of chars to format from GetFormatOfFepInlineText() |
|
9112 |
iUncommittedText.iCursorPos+=addedTextLength; |
|
9113 |
} |
|
9114 |
// if necessary trim text to fit into available space in the editor & perform the edit |
|
9115 |
TPtrC textToEditor = aTextFromDialog.Left(addedTextLength); |
|
9116 |
||
9117 |
StartInlineEditL(textToEditor); |
|
9118 |
CommitInlineEditL(); |
|
9119 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
9120 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
9121 |
#endif |
|
9122 |
||
9123 |
EditorState()->SetInlineEditSpan(iUncommittedText); |
|
9124 |
} |
|
9125 |
||
9126 |
void CAknFepManager::LaunchKutenCodeQueryL() |
|
9127 |
{ |
|
9128 |
TInt code; |
|
9129 |
TUid fepUid = CCoeEnv::Static()->FepUid(); |
|
9130 |
ClearExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
9131 |
UiInterface()->JapaneseKutenQueryDialogL(R_AKNFEPUICTRLJAPANESEKUTEN_QUERY, code, 0); |
|
9132 |
||
9133 |
PrepareFepAfterDialogExitL(fepUid); |
|
9134 |
||
9135 |
HandleChangeInFocus(); // to re-establish contact with editor under KutenCode Query |
|
9136 |
||
9137 |
if (code > 0 && EditorHasFreeSpace()) |
|
9138 |
{ |
|
9139 |
TBuf<ESingleCharacter> text; |
|
9140 |
text.Append((TText)code); |
|
9141 |
SetFlag(EFlagInsideInlineEditingTransaction); |
|
9142 |
iInputCapabilities.FepAwareTextEditor()->StartFepInlineEditL(text, ESingleCharacter, |
|
9143 |
ETrue, NULL, *this, *this); |
|
9144 |
CommitInlineEditL(); |
|
9145 |
} |
|
9146 |
} |
|
9147 |
||
9148 |
TInt CAknFepManager::NumericModeSCTResourceId() const |
|
9149 |
{ |
|
9150 |
TInt charMapResId = EDefaultNumericCharMapResId; |
|
9151 |
TBool phoneIdle = (EditorType() == CAknExtendedInputCapabilities::EPhoneNumberEditor); |
|
9152 |
||
9153 |
if( phoneIdle ) |
|
9154 |
{ |
|
9155 |
charMapResId=R_AKNFEP_SCT_NUMERIC_MODE_CHARS_STANDARD; |
|
9156 |
return charMapResId; |
|
9157 |
} |
|
9158 |
||
9159 |
switch (iAknEditorNumericKeymap) |
|
9160 |
{ |
|
9161 |
case EAknEditorStandardNumberModeKeymap: |
|
9162 |
charMapResId = R_AKNFEP_SCT_NUMERIC_MODE_CHARS_STANDARD; |
|
9163 |
break; |
|
9164 |
case EAknEditorCalculatorNumberModeKeymap: |
|
9165 |
charMapResId = R_AKNFEP_SCT_NUMERIC_MODE_CHARS_CALCULATOR; |
|
9166 |
break; |
|
9167 |
case EAknEditorConverterNumberModeKeymap: |
|
9168 |
charMapResId = R_AKNFEP_SCT_NUMERIC_MODE_CHARS_CONVERTER; |
|
9169 |
break; |
|
9170 |
case EAknEditorFixedDiallingNumberModeKeymap: |
|
9171 |
charMapResId = R_AKNFEP_SCT_NUMERIC_MODE_CHARS_FIXED_DIALLING; |
|
9172 |
break; |
|
9173 |
case EAknEditorSATNumberModeKeymap: |
|
9174 |
charMapResId = R_AKNFEP_SCT_NUMERIC_MODE_CHARS_SAT; |
|
9175 |
break; |
|
9176 |
case EAknEditorToFieldNumberModeKeymap: |
|
9177 |
charMapResId = R_AKNFEP_SCT_NUMERIC_MODE_CHARS_TO_FIELD; |
|
9178 |
break; |
|
9179 |
case EAknEditorPlainNumberModeKeymap: |
|
9180 |
charMapResId = R_AKNFEP_SCT_NUMERIC_MODE_CHARS_PLAIN; |
|
9181 |
break; |
|
9182 |
case EAknEditorNativeKeysNumberModeKeymap: |
|
9183 |
//currently this is not in use |
|
9184 |
break; |
|
9185 |
case EAknEditorSATHiddenNumberModeKeymap: |
|
9186 |
charMapResId = R_AKNFEP_SCT_NUMERIC_MODE_CHARS_SAT_HIDDEN; |
|
9187 |
break; |
|
9188 |
default: |
|
9189 |
//We reach here because there is no valid SCT resource ID set |
|
9190 |
//by the current editor. So best we can do now is set the |
|
9191 |
//default mode for numeric editors. |
|
9192 |
charMapResId = R_AKNFEP_SCT_NUMERIC_MODE_CHARS_STANDARD; |
|
9193 |
break; |
|
9194 |
} |
|
9195 |
if(IsHybridAplhaEditor() && !IsHybridAlphaModeChangedtoAplhanumeric()) |
|
9196 |
{ |
|
9197 |
charMapResId = R_AKNFEP_SCT_NUMERIC_MODE_CHARS_STANDARD; |
|
9198 |
} |
|
9199 |
return charMapResId; |
|
9200 |
} |
|
9201 |
||
9202 |
||
9203 |
TBool CAknFepManager::HashKeyModeChangeBlockedInSearchField() const |
|
9204 |
{ |
|
9205 |
if ((iAknEditorFlags & EAknEditorFlagFindPane) && |
|
9206 |
iSharedDataInterface->HashKeySelectionInUse() && |
|
9207 |
!IsChineseInputLanguage() && |
|
9208 |
!IsKoreanInputLanguage() && |
|
9209 |
iLanguageCapabilities.iInputLanguageCode != ELangVietnamese && |
|
9210 |
!FeatureManager::FeatureSupported(KFeatureIdJapanese)) |
|
9211 |
{ |
|
9212 |
if (iMode == ELatin || iMode == ENumber || iMode == ENativeNumber ) |
|
9213 |
{ |
|
9214 |
return ETrue; |
|
9215 |
} |
|
9216 |
} |
|
9217 |
||
9218 |
return EFalse; |
|
9219 |
} |
|
9220 |
||
9221 |
||
9222 |
TKeyResponse CAknFepManager::HandleHashKeyL(TKeyPressLength aLength) |
|
9223 |
{ |
|
9224 |
TKeyResponse response = EKeyWasNotConsumed; |
|
9225 |
if (IsFlagSet(EFlagPassNextKey)) |
|
9226 |
{ |
|
9227 |
ClearFlag(EFlagPassNextKey); |
|
9228 |
} |
|
9229 |
else if (IsFlagSet(EFlagShiftKeyDepressed)) |
|
9230 |
{ |
|
9231 |
response = EKeyWasConsumed; |
|
9232 |
} |
|
9233 |
else if (HashKeyModeChangeBlockedInSearchField()) |
|
9234 |
{ |
|
9235 |
// Do not allow case changes for latin languages in search field |
|
9236 |
// if hash key selection is active. |
|
9237 |
response = EKeyWasConsumed; |
|
9238 |
} |
|
9239 |
else |
|
9240 |
{ |
|
9241 |
if ( IsFlagSet(EFlagInsideMultitapInlineEditingTransaction) ) |
|
9242 |
{ |
|
9243 |
#ifdef RD_HINDI_PHONETIC_INPUT |
|
9244 |
if(iSharedDataInterface->InputTextLanguage() != KLangHindiPhonetic) |
|
9245 |
#endif |
|
9246 |
FepUI()->ExpireMultitapTimer(); |
|
9247 |
// For Japanese, send backspace key event in case hash key |
|
9248 |
// is pressed while secret text input. |
|
9249 |
if (IsFeatureSupportedJapanese()) |
|
9250 |
{ |
|
9251 |
if (iInputCapabilities.SupportsSecretText()) |
|
9252 |
{ |
|
9253 |
SimulateKeyEventL(EKeyF20); //backspace |
|
9254 |
} |
|
9255 |
} |
|
9256 |
#ifdef RD_HINDI_PHONETIC_INPUT |
|
9257 |
if(iSharedDataInterface->InputTextLanguage() != KLangHindiPhonetic) |
|
9258 |
#endif |
|
9259 |
ClearFlag(EFlagInsideMultitapInlineEditingTransaction); |
|
9260 |
iCaseMan->UpdateCase(ENullNaviEvent); |
|
9261 |
} |
|
9262 |
if (aLength == EShortKeyPress) |
|
9263 |
{ |
|
9264 |
if ( iMode != ENumber && iMode != ENativeNumber ) |
|
9265 |
{ |
|
9266 |
iModeBefore = iMode; |
|
9267 |
if (iModeBefore == ELatin) |
|
9268 |
{ |
|
9269 |
iCaseBefore = iCaseMan->CurrentCase(); |
|
9270 |
} |
|
9271 |
} |
|
9272 |
} |
|
9273 |
||
9274 |
// always keep previous input mode for Japanese input |
|
9275 |
if (IsFeatureSupportedJapanese()) |
|
9276 |
{ |
|
9277 |
iModeBefore = iMode; |
|
9278 |
if (iModeBefore == ELatin) |
|
9279 |
{ |
|
9280 |
iCaseBefore = iCaseMan->CurrentCase(); |
|
9281 |
} |
|
9282 |
} |
|
9283 |
if (iMode == EHangul && aLength == ELongKeyPress) |
|
9284 |
{ |
|
9285 |
if (IsFlagSet(CAknFepManager::EFlagInsideInlineEditingTransaction)) |
|
9286 |
{ |
|
9287 |
TPtrC text = iPtiEngine->CurrentWord(); |
|
9288 |
if (text.Length() > 0) |
|
9289 |
{ |
|
9290 |
CancelInlineEdit(); |
|
9291 |
StartInlineEditL(); |
|
9292 |
UpdateInlineEditL(iPtiEngine->PreviousCandidate(), iPtiEngine->PreviousCandidate().Length()); |
|
9293 |
CommitInlineEditL(); |
|
9294 |
} |
|
9295 |
else |
|
9296 |
{ |
|
9297 |
CancelInlineEdit(); |
|
9298 |
} |
|
9299 |
iPtiEngine->ClearCurrentWord(); |
|
9300 |
} |
|
9301 |
} |
|
9302 |
||
9303 |
response = iHashKeyMan->HandleKeyEventL(aLength); |
|
9304 |
if (response == EKeyWasNotConsumed) |
|
9305 |
{ |
|
9306 |
switch (iAknEditorNumericKeymap) |
|
9307 |
{ |
|
9308 |
case EAknEditorStandardNumberModeKeymap: //fall through |
|
9309 |
case EAknEditorFixedDiallingNumberModeKeymap: |
|
9310 |
case EAknEditorSATNumberModeKeymap: |
|
9311 |
case EAknEditorSATHiddenNumberModeKeymap: |
|
9312 |
case EAknEditorAlphanumericNumberModeKeymap: |
|
9313 |
if (!EditorHasFreeSpace()) |
|
9314 |
{ |
|
9315 |
response=EKeyWasConsumed; |
|
9316 |
} |
|
9317 |
break; |
|
9318 |
case EAknEditorCalculatorNumberModeKeymap: //fall through |
|
9319 |
case EAknEditorConverterNumberModeKeymap: |
|
9320 |
SimulateKeyEventL(CurrentDecimalSeparator()); |
|
9321 |
if (EditorHasFreeSpace()) |
|
9322 |
{ |
|
9323 |
SetFlag(EFlagCharacterAdded); |
|
9324 |
} |
|
9325 |
response=EKeyWasConsumed; |
|
9326 |
break; |
|
9327 |
case EAknEditorToFieldNumberModeKeymap: |
|
9328 |
SimulateKeyEventL(text_to_field_mode_hash_key); |
|
9329 |
if (EditorHasFreeSpace()) |
|
9330 |
{ |
|
9331 |
SetFlag(EFlagCharacterAdded); |
|
9332 |
} |
|
9333 |
response=EKeyWasConsumed; |
|
9334 |
break; |
|
9335 |
case EAknEditorPlainNumberModeKeymap: |
|
9336 |
response=EKeyWasConsumed; |
|
9337 |
break; |
|
9338 |
case EAknEditorNativeKeysNumberModeKeymap: |
|
9339 |
break; |
|
9340 |
default: |
|
9341 |
break; |
|
9342 |
} |
|
9343 |
} |
|
9344 |
} |
|
9345 |
return response; |
|
9346 |
} |
|
9347 |
||
9348 |
TInt CAknFepManager::EditorNumericKeymap() const |
|
9349 |
{ |
|
9350 |
return iAknEditorNumericKeymap; |
|
9351 |
} |
|
9352 |
||
9353 |
||
9354 |
TBool CAknFepManager::HashKeySelectionInUse() const |
|
9355 |
{ |
|
9356 |
if (ExtendedInputCapabilities() |
|
9357 |
& CAknExtendedInputCapabilities::EForceHashKeySelectionStatusFlagOff) |
|
9358 |
{ |
|
9359 |
return EFalse; |
|
9360 |
} |
|
9361 |
||
9362 |
return iSharedDataInterface->HashKeySelectionInUse(); |
|
9363 |
} |
|
9364 |
||
9365 |
||
9366 |
TBool CAknFepManager::EditSubmenuInUse() const |
|
9367 |
{ |
|
9368 |
if (RProcess().SecureId().iId == KPhoneSecureId) |
|
9369 |
{ |
|
9370 |
if (iQwertyInputMode) |
|
9371 |
{ |
|
9372 |
return EFalse; |
|
9373 |
} |
|
9374 |
} |
|
9375 |
||
9376 |
if (ExtendedInputCapabilities() & CAknExtendedInputCapabilities::EForceEditSubmenuStatusFlagOff) |
|
9377 |
{ |
|
9378 |
return EFalse; |
|
9379 |
} |
|
9380 |
||
9381 |
return iSharedDataInterface->EditSubmenuInUse(); |
|
9382 |
} |
|
9383 |
||
9384 |
||
9385 |
void CAknFepManager::DimEditMenuModeItems(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
9386 |
{ |
|
9387 |
// current item |
|
9388 |
DimMenuItem(aMenuPane, iMode); |
|
9389 |
||
9390 |
// dim menu items for Chinese input modes that aren't valid in the current editor |
|
9391 |
// or the device subvariant |
|
9392 |
for (TInt mode = KFirstMode; mode <= KLastMode; mode = mode << 1) |
|
9393 |
{ |
|
9394 |
if (!IsModePermitted(mode)) |
|
9395 |
{ |
|
9396 |
DimMenuItem(aMenuPane, mode); |
|
9397 |
} |
|
9398 |
} |
|
9399 |
||
9400 |
// Switch menu whether input language is supported related chinese phrase |
|
9401 |
MPtiLanguage* ptilang = iPtiEngine->GetLanguage( |
|
9402 |
iLanguageCapabilities.iInputLanguageCode ); |
|
9403 |
if ( ptilang ) |
|
9404 |
{ |
|
9405 |
if( iMode != EPinyin && IsModePermitted( EPinyin ) ) |
|
9406 |
{ |
|
9407 |
if( ptilang->HasInputMode( EPtiEnginePinyinByPhrase ) ) |
|
9408 |
{ |
|
9409 |
aMenuPane->SetItemDimmed( EChinFepCmdModePinyin, ETrue ); |
|
9410 |
aMenuPane->SetItemDimmed( EChinFepCmdModePinyinPhrase, EFalse ); |
|
9411 |
} |
|
9412 |
} |
|
9413 |
||
9414 |
if( iMode != EZhuyin && IsModePermitted( EZhuyin ) ) |
|
9415 |
{ |
|
9416 |
if( ptilang->HasInputMode( EPtiEngineZhuyinByPhrase ) ) |
|
9417 |
{ |
|
9418 |
aMenuPane->SetItemDimmed( EChinFepCmdModeZhuyin, ETrue ); |
|
9419 |
aMenuPane->SetItemDimmed( EChinFepCmdModeZhuyinPhrase, EFalse ); |
|
9420 |
} |
|
9421 |
} |
|
9422 |
||
9423 |
if( iMode != EStroke && IsModePermitted( EStroke ) ) |
|
9424 |
{ |
|
9425 |
if( ptilang->HasInputMode( EPtiEngineStrokeByPhrase ) ) |
|
9426 |
{ |
|
9427 |
aMenuPane->SetItemDimmed( EChinFepCmdModeStroke, ETrue ); |
|
9428 |
aMenuPane->SetItemDimmed( EChinFepCmdModeStrokePhrase, EFalse ); |
|
9429 |
} |
|
9430 |
} |
|
9431 |
} |
|
9432 |
||
9433 |
if (IsAbleToLaunchSmiley()) |
|
9434 |
{ |
|
9435 |
TInt index; |
|
9436 |
if (aMenuPane->MenuItemExists(EAknCmdEditInsertSmiley, index)) |
|
9437 |
{ |
|
9438 |
aMenuPane->SetItemDimmed(EAknCmdEditInsertSmiley, EFalse); |
|
9439 |
} |
|
9440 |
} |
|
9441 |
} |
|
9442 |
||
9443 |
void CAknFepManager::DimMenuItem(CAknFepUiInterfaceMenuPane* aMenuPane, TInt aMode) |
|
9444 |
{ |
|
9445 |
TInt dimmedMenuItem = 0; |
|
9446 |
switch (aMode) |
|
9447 |
{ |
|
9448 |
case EPinyin: |
|
9449 |
dimmedMenuItem = EChinFepCmdModePinyin; |
|
9450 |
break; |
|
9451 |
case EZhuyin: |
|
9452 |
dimmedMenuItem = EChinFepCmdModeZhuyin; |
|
9453 |
break; |
|
9454 |
case EStroke: |
|
9455 |
dimmedMenuItem = EChinFepCmdModeStroke; |
|
9456 |
break; |
|
9457 |
case ECangJie: |
|
9458 |
dimmedMenuItem = EChinFepCmdModeCangJie; |
|
9459 |
break; |
|
9460 |
case EZhuyinFind: |
|
9461 |
dimmedMenuItem = EChinFepCmdModeZhuyinFind; |
|
9462 |
break; |
|
9463 |
case EStrokeFind: |
|
9464 |
dimmedMenuItem = EChinFepCmdModeStrokeFind; |
|
9465 |
break; |
|
9466 |
case ELatin: |
|
9467 |
if ( iLanguageCapabilities.iInputLanguageCode != ELangJapanese) |
|
9468 |
{ |
|
9469 |
// According Katja's info, dim the current case item in the |
|
9470 |
// indicator menu. |
|
9471 |
if ( iCaseMan->CurrentCase() == EAknEditorUpperCase ) |
|
9472 |
{ |
|
9473 |
dimmedMenuItem = EChinFepCmdModeLatinUpper; |
|
9474 |
} |
|
9475 |
else if(iCaseMan->CurrentCase() == EAknEditorLowerCase) |
|
9476 |
{ |
|
9477 |
dimmedMenuItem = EChinFepCmdModeLatinLower; |
|
9478 |
} |
|
9479 |
else if(iCaseMan->CurrentCase() == EAknEditorTextCase) |
|
9480 |
{ |
|
9481 |
dimmedMenuItem = EAknCmdEditModeLatinText; |
|
9482 |
} |
|
9483 |
} |
|
9484 |
break; |
|
9485 |
case ENativeNumber: |
|
9486 |
{ |
|
9487 |
aMenuPane->SetItemDimmed(EAknCmdEditModeArabicIndicNumber, ETrue); |
|
9488 |
aMenuPane->SetItemDimmed(EAknCmdEditModeEasternArabicIndicNumber, ETrue); |
|
9489 |
aMenuPane->SetItemDimmed(EAknCmdEditModeIndicNumber, ETrue); |
|
9490 |
} |
|
9491 |
break; |
|
9492 |
default: |
|
9493 |
break; |
|
9494 |
} |
|
9495 |
TInt index; |
|
9496 |
if (dimmedMenuItem && aMenuPane->MenuItemExists(dimmedMenuItem, index)) |
|
9497 |
{ |
|
9498 |
aMenuPane->SetItemDimmed(dimmedMenuItem, ETrue); |
|
9499 |
} |
|
9500 |
} |
|
9501 |
||
9502 |
void CAknFepManager::LaunchConfirmationNoteL(TInt aResourceId) |
|
9503 |
{ |
|
9504 |
SetFlag(EFlagForegroundUIComponentVisible); |
|
9505 |
iUiInterface->LaunchConfirmationNoteL(aResourceId); |
|
9506 |
} |
|
9507 |
||
9508 |
void CAknFepManager::NewCharacterL(const TDesC& aChar) |
|
9509 |
{ |
|
9510 |
if ( aChar.Length() == 0 ) |
|
9511 |
{ |
|
9512 |
return; |
|
9513 |
} |
|
9514 |
TChar ch = aChar[0]; |
|
9515 |
||
9516 |
TBool validNewCandidate = CharIsValidInEditor(ch); |
|
9517 |
// Check if the character is valid for the editor. |
|
9518 |
if ( !validNewCandidate ) |
|
9519 |
{ |
|
9520 |
TChar firstNewCandidate = ch; |
|
9521 |
TBool goneThroughAllCandidates(EFalse); |
|
9522 |
TPtrC8 sequence = iPtiEngine->CurrentInputSequence(); |
|
9523 |
||
9524 |
if ( sequence.Length() ) |
|
9525 |
{ |
|
9526 |
TPtiKey key = (TPtiKey)sequence[0]; |
|
9527 |
||
9528 |
TBuf<20> mapData; |
|
9529 |
iPtiEngine->MappingDataForKey(key, mapData, iPtiEngine->Case()); |
|
9530 |
// If the character was not coming from ptiengine mappings, fail instantly. |
|
9531 |
if (mapData.Locate(firstNewCandidate) != KErrNotFound) |
|
9532 |
{ |
|
9533 |
// If there is an ivalid character in chr-loop, try to jump to next valid one. |
|
9534 |
for (TInt jj = 0; jj < mapData.Length(); jj++) |
|
9535 |
{ |
|
9536 |
TPtrC text = iPtiEngine->AppendKeyPress(key); |
|
9537 |
if ( text.Length() == 0 ) |
|
9538 |
{ |
|
9539 |
continue; |
|
9540 |
} |
|
9541 |
ch = text[0]; |
|
9542 |
goneThroughAllCandidates = (ch == firstNewCandidate); |
|
9543 |
validNewCandidate = CharIsValidInEditor(ch); |
|
9544 |
if (validNewCandidate || goneThroughAllCandidates) |
|
9545 |
{ |
|
9546 |
break; |
|
9547 |
} |
|
9548 |
} |
|
9549 |
} |
|
9550 |
} |
|
9551 |
} |
|
9552 |
if (!validNewCandidate) |
|
9553 |
{ |
|
9554 |
// No valid characters at all. |
|
9555 |
CancelInlineEdit(); |
|
9556 |
return; |
|
9557 |
} |
|
9558 |
||
9559 |
if ( (ch == KAknFEPLineFeedSymbol || |
|
9560 |
ch == KAknFEPMirroredLineFeedSymbol) && |
|
9561 |
(EditorHasFreeSpace() || IsFlagSet(EFlagLastCharacterInEditor))) |
|
9562 |
{ |
|
9563 |
SetFlag(EFlagLineFeedCharacter); |
|
9564 |
} |
|
9565 |
else |
|
9566 |
{ |
|
9567 |
ClearFlag(EFlagLineFeedCharacter); |
|
9568 |
} |
|
9569 |
||
9570 |
if ( (ch == EKeySpace) && |
|
9571 |
(EditorHasFreeSpace() || IsFlagSet(EFlagLastCharacterInEditor))) |
|
9572 |
{ |
|
9573 |
SetFlag(EFlagSpaceCharacter); |
|
9574 |
} |
|
9575 |
else |
|
9576 |
{ |
|
9577 |
ClearFlag(EFlagSpaceCharacter); |
|
9578 |
} |
|
9579 |
||
9580 |
||
9581 |
if (iInputCapabilities.SupportsSecretText()) |
|
9582 |
{ |
|
9583 |
if (IsFlagSet(EFlagInsideMultitapInlineEditingTransaction)) |
|
9584 |
{ |
|
9585 |
SimulateKeyEventL(EKeyF20); // to delete previous char in secret text editor |
|
9586 |
} |
|
9587 |
//we receive an extra key press if we simulate a key that is also a device key |
|
9588 |
if (ch.IsDigit() || TUint(ch) == EStarKeyUnicodeValue || TUint(ch) == EHashKeyUnicodeValue) |
|
9589 |
{ |
|
9590 |
SetFlag(EFlagPassNextKey); |
|
9591 |
} |
|
9592 |
if ( ch.IsDigit() && iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic ) |
|
9593 |
{ |
|
9594 |
ClearFlag(EFlagPassNextKey); |
|
9595 |
SimulateKeyEventL(ch + (TChar)KLatinToArabicIndicDigitsDelta ); |
|
9596 |
} |
|
9597 |
else if ( ch.IsDigit() |
|
9598 |
&& iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic ) |
|
9599 |
{ |
|
9600 |
ClearFlag(EFlagPassNextKey); |
|
9601 |
if(iLanguageCapabilities.iInputLanguageCode == ELangUrdu |
|
9602 |
|| iLanguageCapabilities.iInputLanguageCode == ELangFarsi) |
|
9603 |
{ |
|
9604 |
SimulateKeyEventL(ch + (TChar)KLatinToEasternArabicIndicDigitsDelta ); |
|
9605 |
} |
|
9606 |
} |
|
9607 |
else if ( ch.IsDigit() && iLanguageCapabilities.iLocalDigitType == EDigitTypeDevanagari ) |
|
9608 |
{ |
|
9609 |
ClearFlag(EFlagPassNextKey); |
|
9610 |
SimulateKeyEventL(ch + (TChar)KLatinToDevanagariDigitsDelta); |
|
9611 |
} |
|
9612 |
else |
|
9613 |
{ |
|
9614 |
SimulateKeyEventL(ch); |
|
9615 |
} |
|
9616 |
SetFlag(EFlagInsideMultitapInlineEditingTransaction | EFlagInsideInlineEditingTransaction); |
|
9617 |
} |
|
9618 |
else if (EditorHasFreeSpace() || IsFlagSet(EFlagInsideMultitapInlineEditingTransaction)) |
|
9619 |
{ |
|
9620 |
TBuf<1> buf; |
|
9621 |
if ( ch.IsDigit() && iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic ) |
|
9622 |
{ |
|
9623 |
buf.Append( ch + (TChar)KLatinToArabicIndicDigitsDelta ); |
|
9624 |
} |
|
9625 |
else if ( ch.IsDigit() |
|
9626 |
&& iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic ) |
|
9627 |
{ |
|
9628 |
if(iLanguageCapabilities.iInputLanguageCode == ELangUrdu |
|
9629 |
|| iLanguageCapabilities.iInputLanguageCode == ELangFarsi) |
|
9630 |
{ |
|
9631 |
buf.Append( ch + (TChar)KLatinToEasternArabicIndicDigitsDelta ); |
|
9632 |
} |
|
9633 |
} |
|
9634 |
else if ( ch.IsDigit() && iLanguageCapabilities.iLocalDigitType == EDigitTypeDevanagari ) |
|
9635 |
{ |
|
9636 |
buf.Append( ch + (TChar)KLatinToDevanagariDigitsDelta ); |
|
9637 |
} |
|
9638 |
else |
|
9639 |
{ |
|
9640 |
buf.Append( ch ); |
|
9641 |
} |
|
9642 |
||
9643 |
if (iFepManState == EAknFepStateInitial) //multitapping |
|
9644 |
{ |
|
9645 |
if (!IsFlagSet(EFlagInsideMultitapInlineEditingTransaction)) |
|
9646 |
{ |
|
9647 |
TInt edSize = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
9648 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
9649 |
if (iAknEditorFlags & EAknEditorFlagMTAutoOverwrite && iMode == ELatin |
|
9650 |
&& !WesternPredictive() |
|
9651 |
&& iUncommittedText.iCursorPos < edSize |
|
9652 |
&& iUncommittedText.Length() == 0) |
|
9653 |
{ |
|
9654 |
// If the cursor is at the beginning or in the middle of the text, |
|
9655 |
// existing characters are replaced with new ones in latin multitap input. |
|
9656 |
iUncommittedText.iCursorPos++; |
|
9657 |
StartInlineEditL(iUncommittedText, buf, ESingleCharacter, EFalse); |
|
9658 |
SetFlag(EFlagInsideMultitapInlineEditingTransaction); |
|
9659 |
UpdateInlineEditL(buf, ESingleCharacter); |
|
9660 |
} |
|
9661 |
else |
|
9662 |
{ |
|
9663 |
StartInlineEditL(buf); |
|
9664 |
SetFlag(EFlagInsideMultitapInlineEditingTransaction); |
|
9665 |
} |
|
9666 |
} |
|
9667 |
else |
|
9668 |
{ |
|
9669 |
UpdateInlineEditL(buf, ESingleCharacter); |
|
9670 |
} |
|
9671 |
||
9672 |
if(!EditorHasFreeSpace()) |
|
9673 |
{ |
|
9674 |
SetFlag(EFlagLastCharacterInEditor); |
|
9675 |
} |
|
9676 |
} |
|
9677 |
else |
|
9678 |
{ |
|
9679 |
iInputCapabilities.FepAwareTextEditor()->StartFepInlineEditL(buf, ESingleCharacter, |
|
9680 |
ETrue, NULL, *this, *this); |
|
9681 |
} |
|
9682 |
SetFlag(EFlagInsideInlineEditingTransaction); |
|
9683 |
} |
|
9684 |
} |
|
9685 |
||
9686 |
void CAknFepManager::NewTextL(const TDesC& aText) |
|
9687 |
{ |
|
9688 |
ClearFlag(EFlagLineFeedCharacter); |
|
9689 |
TBool unlimit = EFalse; |
|
9690 |
TInt freeSpace = EditorFreeSpace(unlimit); |
|
9691 |
||
9692 |
if (IsFlagSet(EFlagInsideMultitapInlineEditingTransaction) || |
|
9693 |
unlimit || freeSpace > 0 ) // |
|
9694 |
{ |
|
9695 |
if( unlimit || freeSpace > aText.Length() ) |
|
9696 |
{ |
|
9697 |
iInputCapabilities.FepAwareTextEditor()->StartFepInlineEditL(aText, aText.Length(), ETrue, |
|
9698 |
NULL, *this, *this); |
|
9699 |
} |
|
9700 |
else |
|
9701 |
{ |
|
9702 |
iInputCapabilities.FepAwareTextEditor()->StartFepInlineEditL(aText.Left(freeSpace), freeSpace, ETrue, |
|
9703 |
NULL, *this, *this); |
|
9704 |
} |
|
9705 |
||
9706 |
SetFlag(EFlagInsideInlineEditingTransaction); |
|
9707 |
} |
|
9708 |
} |
|
9709 |
||
9710 |
||
9711 |
void CAknFepManager::NewCharacterSequenceL(const TDesC& aText, TIndicInputResponse aResponse) |
|
9712 |
{ |
|
9713 |
TChar zws((ZERO_WIDTH_SPACE)); |
|
9714 |
TChar virama((TAknFepUiIndicInputManager::Virama(TLanguage( |
|
9715 |
iLanguageCapabilities.iInputLanguageCode)))); |
|
9716 |
TBool ret = ETrue; |
|
9717 |
TBuf<CAknFepManager::EMaximumFepWordLength> buf; |
|
9718 |
buf.Zero(); |
|
9719 |
TBool isTextLayoutPresent = (AknFepDocumentNavigation() || TextLayout()) ? ETrue : EFalse; |
|
9720 |
switch( aResponse ) |
|
9721 |
{ |
|
9722 |
case EIndicInputResponseNone: |
|
9723 |
{ |
|
9724 |
NewCharacterL(aText); |
|
9725 |
} |
|
9726 |
break; |
|
9727 |
case EIndicInputResponseNumber: |
|
9728 |
{ |
|
9729 |
NewCharacterL(aText); |
|
9730 |
CommitInlineEditL(); |
|
9731 |
} |
|
9732 |
break; |
|
9733 |
case EIndicInputResponseZWSandCharacter: |
|
9734 |
{ |
|
9735 |
if (! iInputCapabilities.SupportsSecretText() && isTextLayoutPresent) |
|
9736 |
{ |
|
9737 |
buf.Append(zws); |
|
9738 |
NewCharacterL(buf); |
|
9739 |
CommitInlineEditL(); |
|
9740 |
} |
|
9741 |
NewCharacterL(aText); |
|
9742 |
} |
|
9743 |
break; |
|
9744 |
case EIndicInputResponseInsertZWS: |
|
9745 |
{ |
|
9746 |
buf.Append(virama); |
|
9747 |
if(isTextLayoutPresent) |
|
9748 |
buf.Append(zws); |
|
9749 |
ret = EFalse; |
|
9750 |
} |
|
9751 |
break; |
|
9752 |
case EIndicInputResponseInsertZWSandLigature: |
|
9753 |
{ |
|
9754 |
buf.Append(virama); |
|
9755 |
if(isTextLayoutPresent) |
|
9756 |
buf.Append(zws); |
|
9757 |
if ( iInputCapabilities.SupportsSecretText() ) |
|
9758 |
{ |
|
9759 |
buf.Append(aText); |
|
9760 |
} |
|
9761 |
ret = EFalse; |
|
9762 |
} |
|
9763 |
break; |
|
9764 |
||
9765 |
case EIndicInputResponseInsertRepha: |
|
9766 |
{ |
|
9767 |
MCoeFepAwareTextEditor* fepAwareTextEditor = |
|
9768 |
iInputCapabilities.FepAwareTextEditor(); |
|
9769 |
||
9770 |
if( fepAwareTextEditor ) |
|
9771 |
{ |
|
9772 |
TInt nextCharPos = 0; |
|
9773 |
TCursorSelection curSel; |
|
9774 |
||
9775 |
fepAwareTextEditor->GetCursorSelectionForFep( curSel ); |
|
9776 |
||
9777 |
// Insert Repha before the desired syllable. |
|
9778 |
TBool leftFlag = GetNextVisualLeftCharacter( nextCharPos ); |
|
9779 |
if( leftFlag ) |
|
9780 |
{ |
|
9781 |
curSel.iCursorPos = nextCharPos; |
|
9782 |
curSel.iAnchorPos = nextCharPos; |
|
9783 |
||
9784 |
fepAwareTextEditor->SetCursorSelectionForFepL( curSel ); |
|
9785 |
||
9786 |
TAknFepUiIndicInputManager::GetRepha( buf, |
|
9787 |
TLanguage( iLanguageCapabilities.iInputLanguageCode ) ); |
|
9788 |
||
9789 |
ret = EFalse; |
|
9790 |
} |
|
9791 |
} |
|
9792 |
break; |
|
9793 |
} |
|
9794 |
||
9795 |
case EIndicInputResponseInsertRakar: |
|
9796 |
{ |
|
9797 |
TAknFepUiIndicInputManager::GetRakar( buf, |
|
9798 |
TLanguage( iLanguageCapabilities.iInputLanguageCode ) ); |
|
9799 |
ret = EFalse; |
|
9800 |
} |
|
9801 |
break; |
|
9802 |
#ifdef RD_HINDI_PHONETIC_INPUT |
|
9803 |
case EIndicInputResponsePhoneticMultitapText: |
|
9804 |
{ |
|
9805 |
buf.Append(aText); |
|
9806 |
ret = EFalse; |
|
9807 |
} |
|
9808 |
break; |
|
9809 |
case EIndicInputResponsePhoneticQwertyText: |
|
9810 |
{ |
|
9811 |
buf.Append(aText); |
|
9812 |
ret = EFalse; |
|
9813 |
} |
|
9814 |
break; |
|
9815 |
#endif |
|
9816 |
||
9817 |
case EIndicInputResponseInsertDirectLigature: |
|
9818 |
{ |
|
9819 |
// In key-0, the new line character preceeds the Ksha. |
|
9820 |
// First clear the new line flag. |
|
9821 |
ClearFlag( EFlagLineFeedCharacter ); |
|
9822 |
||
9823 |
buf.Append( aText ); |
|
9824 |
ret = EFalse; |
|
9825 |
} |
|
9826 |
break; |
|
9827 |
||
9828 |
case EIndicInputResponseInsertViramaZWSandDirectLigature: |
|
9829 |
{ |
|
9830 |
// This case handles the insertion of Virama when star key |
|
9831 |
// is pressed. |
|
9832 |
||
9833 |
// In key-0, the new line character preceeds the Ksha. |
|
9834 |
// First clear the new line flag. |
|
9835 |
ClearFlag( EFlagLineFeedCharacter ); |
|
9836 |
||
9837 |
buf.Append(virama); |
|
9838 |
if(isTextLayoutPresent) |
|
9839 |
buf.Append(zws); |
|
9840 |
if ( iInputCapabilities.SupportsSecretText() ) |
|
9841 |
{ |
|
9842 |
buf.Append(aText); |
|
9843 |
} |
|
9844 |
ret = EFalse; |
|
9845 |
} |
|
9846 |
break; |
|
9847 |
||
9848 |
case EIndicInputResponseZWSandDirectLigature: |
|
9849 |
{ |
|
9850 |
if (! iInputCapabilities.SupportsSecretText() && isTextLayoutPresent) |
|
9851 |
{ |
|
9852 |
buf.Append(zws); |
|
9853 |
NewCharacterL(buf); |
|
9854 |
CommitInlineEditL(); |
|
9855 |
} |
|
9856 |
buf.Zero(); |
|
9857 |
buf.Append( aText ); |
|
9858 |
ret = EFalse; |
|
9859 |
} |
|
9860 |
break; |
|
9861 |
||
9862 |
#ifdef RD_MARATHI |
|
9863 |
case EIndicInputResponseInsertEyeLashRa: |
|
9864 |
{ |
|
9865 |
TAknFepUiIndicInputManager::GetEyeLashRa( buf, |
|
9866 |
(TLanguage)iLanguageCapabilities.iInputLanguageCode ); |
|
9867 |
ret = EFalse; |
|
9868 |
} |
|
9869 |
break; |
|
9870 |
||
9871 |
case EIndicInputResponseInsertChandraA: |
|
9872 |
{ |
|
9873 |
TAknFepUiIndicInputManager::GetChandraA( buf ); |
|
9874 |
ret = EFalse; |
|
9875 |
} |
|
9876 |
break; |
|
9877 |
#endif // RD_MARATHI |
|
9878 |
||
9879 |
default: |
|
9880 |
break; |
|
9881 |
} |
|
9882 |
||
9883 |
if(ret) |
|
9884 |
return; |
|
9885 |
||
9886 |
if ( iInputCapabilities.SupportsSecretText() ) |
|
9887 |
{ |
|
9888 |
if ( IsFlagSet(EFlagInsideMultitapInlineEditingTransaction) ) |
|
9889 |
{ |
|
9890 |
SimulateKeyEventL(EKeyF20); // to delete previous char in secret text editor |
|
9891 |
} |
|
9892 |
for( TInt counter=0; counter<buf.Length(); counter++ ) |
|
9893 |
{ |
|
9894 |
if( (buf[counter] != ZERO_WIDTH_SPACE) ) |
|
9895 |
SimulateKeyEventL(buf[counter]); |
|
9896 |
} |
|
9897 |
SetFlag(EFlagInsideMultitapInlineEditingTransaction | EFlagInsideInlineEditingTransaction); |
|
9898 |
} |
|
9899 |
else if ( EditorHasFreeSpace() || IsFlagSet(EFlagInsideMultitapInlineEditingTransaction) ) |
|
9900 |
{ |
|
9901 |
if ( iFepManState == EAknFepStateInitial ) //multitapping |
|
9902 |
{ |
|
9903 |
if ( !IsFlagSet(EFlagInsideMultitapInlineEditingTransaction) ) |
|
9904 |
{ |
|
9905 |
TInt edSize = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
9906 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
9907 |
if (iAknEditorFlags & EAknEditorFlagMTAutoOverwrite && iMode == ELatin |
|
9908 |
&& !WesternPredictive() |
|
9909 |
&& iUncommittedText.iCursorPos < edSize |
|
9910 |
&& iUncommittedText.Length() == 0) |
|
9911 |
{ |
|
9912 |
// If the cursor is at the beginning or in the middle of the text, |
|
9913 |
// existing characters are replaced with new ones in latin multitap input. |
|
9914 |
iUncommittedText.iCursorPos++; |
|
9915 |
StartInlineEditL(iUncommittedText, buf, ESingleCharacter, EFalse); |
|
9916 |
} |
|
9917 |
else |
|
9918 |
{ |
|
9919 |
StartInlineEditL(); |
|
9920 |
} |
|
9921 |
SetFlag(EFlagInsideMultitapInlineEditingTransaction); |
|
9922 |
} |
|
9923 |
UpdateInlineEditL(buf, buf.Length()); |
|
9924 |
||
9925 |
if( !EditorHasFreeSpace() ) |
|
9926 |
{ |
|
9927 |
SetFlag(EFlagLastCharacterInEditor); |
|
9928 |
} |
|
9929 |
} |
|
9930 |
SetFlag(EFlagInsideInlineEditingTransaction); |
|
9931 |
||
9932 |
// Check if text needs to be committed |
|
9933 |
if( ( TAknFepUiIndicInputManager::IsToCommitCharSeq( aResponse ) ) ) |
|
9934 |
{ |
|
9935 |
CommitInlineEditL(); |
|
9936 |
} |
|
9937 |
if( aResponse == EIndicInputResponseInsertZWSandLigature ) |
|
9938 |
{ |
|
9939 |
NewCharacterL(aText); |
|
9940 |
} |
|
9941 |
else if( aResponse == EIndicInputResponseInsertViramaZWSandDirectLigature ) |
|
9942 |
{ |
|
9943 |
// Doing this here because we first commit the virama |
|
9944 |
// and ZWS and keep the ligature in the inline buffer. |
|
9945 |
NewLigatureL( aText ); |
|
9946 |
} |
|
9947 |
} |
|
9948 |
} |
|
9949 |
||
9950 |
void CAknFepManager::CommitInlineEditL() |
|
9951 |
{ |
|
9952 |
if ( !IsFlagSet( CAknFepManager::EFlagInsideInlineEditingTransaction ) ) |
|
9953 |
{ |
|
9954 |
return; |
|
9955 |
} |
|
9956 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
9957 |
// Before commit inline, check and close |
|
9958 |
// tooltip on FSQ first. |
|
9959 |
SendEventsToPluginManL( EPluginHideTooltip ); |
|
9960 |
||
9961 |
// Predictive QWERTY (XT9) changes ----> |
|
9962 |
// Exact word popup is hidden when the inline editor is closed |
|
9963 |
iExactWordPopupContent->HidePopUp(); |
|
9964 |
// Predictive QWERTY (XT9) changes <---- |
|
9965 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
9966 |
if (iInputCapabilities.FepAwareTextEditor()) |
|
9967 |
{ |
|
9968 |
if (IsFlagSet(EFlagLineFeedCharacter)) |
|
9969 |
{ |
|
9970 |
if (iInputCapabilities.SupportsSecretText()) |
|
9971 |
{ |
|
9972 |
SimulateKeyEventL(EKeyF20); // backspace to delete previous char in secret text editor |
|
9973 |
SimulateKeyEventL(EKeyEnter); |
|
9974 |
SimulateKeyEventL(EKeyF19); // Asyncronous case update |
|
9975 |
} |
|
9976 |
else |
|
9977 |
{ |
|
9978 |
__ASSERT_DEBUG(iInputCapabilities.FepAwareTextEditor(), |
|
9979 |
AknFepPanic(EAknFepPanicNoHandleToFepAwareTextEditor)); |
|
9980 |
iInputCapabilities.FepAwareTextEditor()->SetInlineEditingCursorVisibilityL(ETrue); |
|
9981 |
iInputCapabilities.FepAwareTextEditor()->CancelFepInlineEdit(); |
|
9982 |
||
9983 |
// Multitapping enter event is not posted for find pane. |
|
9984 |
// It would never accept it anyway but the event causes problems in gallery's find. |
|
9985 |
// Allow real enter from qwerty keyboard though. |
|
9986 |
if (!(iAknEditorFlags & EAknEditorFlagFindPane) || iQwertyInputMode) |
|
9987 |
{ |
|
9988 |
SimulateKeyEventL(EKeyEnter); |
|
9989 |
SimulateKeyEventL(EKeyF19); // Asyncronous case update |
|
9990 |
} |
|
9991 |
} |
|
9992 |
} |
|
9993 |
else if (IsFlagSet(EFlagSpaceCharacter | EFlagFullWidthSpaceCharacter)) |
|
9994 |
{ |
|
9995 |
TBuf<ESingleCharacter> charAsDesc(ESingleCharacter); |
|
9996 |
||
9997 |
if (IsFlagSet(EFlagSpaceCharacter)) |
|
9998 |
{ |
|
9999 |
charAsDesc[0] = TText(0x0020); // 0x0020 is space |
|
10000 |
} |
|
10001 |
else |
|
10002 |
{ |
|
10003 |
charAsDesc[0] = TText(0x3000); // 0x3000 is full-width space |
|
10004 |
} |
|
10005 |
||
10006 |
if (iInputCapabilities.SupportsSecretText()) |
|
10007 |
{ |
|
10008 |
SimulateKeyEventL(EKeyF20); // backspace to delete previous char in secret text editor |
|
10009 |
SimulateKeyEventL(charAsDesc[0]); |
|
10010 |
SimulateKeyEventL(EKeyF19); // Asyncronous case update |
|
10011 |
} |
|
10012 |
else |
|
10013 |
{ |
|
10014 |
iInputCapabilities.FepAwareTextEditor()->UpdateFepInlineTextL(charAsDesc, 1); |
|
10015 |
iInputCapabilities.FepAwareTextEditor()->SetInlineEditingCursorVisibilityL(ETrue); |
|
10016 |
CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
10017 |
iInputCapabilities.FepAwareTextEditor()->CommitFepInlineEditL(*coeEnv); |
|
10018 |
iCaseMan->UpdateCase(ENullNaviEvent); |
|
10019 |
if (!EditorHasFreeSpace()) |
|
10020 |
{ |
|
10021 |
SetFlag(EFlagEditorFull); |
|
10022 |
} |
|
10023 |
else |
|
10024 |
{ |
|
10025 |
ClearFlag(EFlagEditorFull); |
|
10026 |
} |
|
10027 |
} |
|
10028 |
} |
|
10029 |
else if (IsFlagSet(EFlagInsideInlineEditingTransaction) |
|
10030 |
&& !iInputCapabilities.SupportsSecretText()) |
|
10031 |
{ |
|
10032 |
// Chinese languages seem not to support this |
|
10033 |
if ( !IsChineseInputLanguage() && |
|
10034 |
(iUncommittedText.Length() == 0 || |
|
10035 |
( |
|
10036 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
10037 |
!IsAutoCompleteOn() && |
|
10038 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
10039 |
!EditorSupportsNeutralProtection() |
|
10040 |
) |
|
10041 |
) |
|
10042 |
) |
|
10043 |
||
10044 |
{ // empty insertions need no resolution. |
|
10045 |
/*Hindi*/ |
|
10046 |
if( (TAknFepUiIndicInputManager :: IsIndicLangauge( |
|
10047 |
TLanguage(iLanguageCapabilities.iInputLanguageCode))) |
|
10048 |
#ifdef RD_HINDI_PHONETIC_INPUT |
|
10049 |
|| ( TAknFepUiIndicInputManager :: IsIndicPhoneticLanguage( |
|
10050 |
TLanguage(iLanguageCapabilities.iInputLanguageCode)) ) |
|
10051 |
#endif |
|
10052 |
) |
|
10053 |
{ |
|
10054 |
// NOTE! Need to get cursor visibility information from some where. |
|
10055 |
CommitInlineEditWithoutResolutionL( *(iInputCapabilities.FepAwareTextEditor()), |
|
10056 |
ETrue, EFalse); |
|
10057 |
} |
|
10058 |
else |
|
10059 |
{ |
|
10060 |
// NOTE! Need to get cursor visibility information from some where. |
|
10061 |
CommitInlineEditWithoutResolutionL( *(iInputCapabilities.FepAwareTextEditor()), |
|
10062 |
ETrue); |
|
10063 |
} |
|
10064 |
} |
|
10065 |
else |
|
10066 |
{ |
|
10067 |
||
10068 |
//note secret text editors do not use the MCoeFepAwareTextEditor interface, |
|
10069 |
//we only need to clear the flags to 'commit' a character |
|
10070 |
||
10071 |
__ASSERT_DEBUG(iInputCapabilities.FepAwareTextEditor(), |
|
10072 |
AknFepPanic(EAknFepPanicNoHandleToFepAwareTextEditor)); |
|
10073 |
CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
10074 |
||
10075 |
TBool showCursor = ETrue; |
|
10076 |
if (IsFlagSet(EFlagInsideMultitapInlineEditingTransaction) || |
|
10077 |
IsCcpuFlagSet(ECcpuStateLosingFocus)) |
|
10078 |
{ |
|
10079 |
showCursor = EFalse; |
|
10080 |
} |
|
10081 |
else |
|
10082 |
{ |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
10083 |
if(IsKoreanInputLanguage( ) && IsFlagSet(CAknFepManager::EFlagInsideInlineEditingTransaction)) |
44 | 10084 |
{ |
10085 |
showCursor = EFalse; |
|
10086 |
} |
|
10087 |
} |
|
10088 |
||
10089 |
iInputCapabilities.FepAwareTextEditor()->SetInlineEditingCursorVisibilityL(showCursor); |
|
10090 |
ClearFlag(EFlagInsideInlineEditingTransaction); |
|
10091 |
iInputCapabilities.FepAwareTextEditor()->CommitFepInlineEditL(*coeEnv); |
|
10092 |
||
10093 |
// Arabic & Hebrew required functionality added ----> |
|
10094 |
if (IsFlagSet(EFlagInsideMultitapInlineEditingTransaction)) // Condition added for AknFep. |
|
10095 |
{ |
|
10096 |
// 3 * as each original character can potentially take 2 markers |
|
10097 |
HBufC* decoratedTextBuf = HBufC::NewLC(KMaxInlineEditSize + 2); // +2 to accommodate previous and next charcaters |
|
10098 |
TPtr decoratedText = decoratedTextBuf->Des(); |
|
10099 |
// Resolve in a slightly wider range than the new text. Attempt to expand 1 character in each direction |
|
10100 |
TCursorSelection resolveSpan(iUncommittedText.HigherPos(), |
|
10101 |
iUncommittedText.LowerPos()); |
|
10102 |
TInt decCursor = 0; |
|
10103 |
||
10104 |
// Gets the CPlainText object from the focused editor if it exists. |
|
10105 |
CPlainText* plainText = PlainText(); |
|
10106 |
TBool containsTextField = EFalse; |
|
10107 |
if (resolveSpan.iAnchorPos > 0) |
|
10108 |
{ |
|
10109 |
if (plainText) |
|
10110 |
{ |
|
10111 |
// Check if surrounding document position contains text field. |
|
10112 |
containsTextField = plainText->FindFields(resolveSpan.iAnchorPos - 1); |
|
10113 |
} |
|
10114 |
TBuf<ESingleCharacter> chDes; |
|
10115 |
iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep( chDes, |
|
10116 |
resolveSpan.iAnchorPos - 1, ESingleCharacter); |
|
10117 |
if ( chDes.Length() != 0 && chDes[0] != CEditableText::EPictureCharacter && !containsTextField) |
|
10118 |
{ |
|
10119 |
// Resolve span is not extended if surrounding character is picture character or it |
|
10120 |
// contains text field. Text field data would be lost when FEP replaces existing editor |
|
10121 |
// content with new text buffer content that does not have text field data. |
|
10122 |
// ResolveDecoratedText() call does not handle these special cases which can has some |
|
10123 |
// effects to Arabic & Hebrew text rendering. |
|
10124 |
resolveSpan.iAnchorPos--; |
|
10125 |
} |
|
10126 |
} |
|
10127 |
if (resolveSpan.iCursorPos < |
|
10128 |
iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep()) |
|
10129 |
{ |
|
10130 |
containsTextField = EFalse; |
|
10131 |
if (plainText) |
|
10132 |
{ |
|
10133 |
// Check if surrounding document position contains text fields. |
|
10134 |
containsTextField = plainText->FindFields(resolveSpan.iCursorPos); |
|
10135 |
} |
|
10136 |
TBuf<ESingleCharacter> chDes; |
|
10137 |
iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep( chDes, |
|
10138 |
resolveSpan.iCursorPos, ESingleCharacter); |
|
10139 |
if ( chDes.Length() != 0 && chDes[0] != CEditableText::EPictureCharacter && !containsTextField) |
|
10140 |
{ |
|
10141 |
// Resolve span is not extended if surrounding character is picture character or it |
|
10142 |
// contains text field. Text field data would be lost when FEP replaces existing editor |
|
10143 |
// content with new text buffer content that does not have text field data. |
|
10144 |
// ResolveDecoratedText() call does not handle these special cases which can has some |
|
10145 |
// effect to Arabic & Hebrew text rendering. |
|
10146 |
resolveSpan.iCursorPos++; |
|
10147 |
decCursor++; |
|
10148 |
} |
|
10149 |
} |
|
10150 |
||
10151 |
// resolveSpan has been widened. Now go get the text for that span. |
|
10152 |
iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(decoratedText, |
|
10153 |
resolveSpan.iAnchorPos, resolveSpan.Length()); |
|
10154 |
||
10155 |
if ( decoratedText.Length() != resolveSpan.Length() ) |
|
10156 |
{ |
|
10157 |
// This assert checks is we have failed to retrieve enough text. Should not happen |
|
10158 |
// __ASSERT_DEBUG( decoratedText.Length() == resolveSpan.Length(), Panic(EEikPanicT9CharPosOutOfRange) ); |
|
10159 |
// Abondon the resolution. |
|
10160 |
||
10161 |
iInputCapabilities.FepAwareTextEditor()->SetInlineEditingCursorVisibilityL( ETrue ); |
|
10162 |
} |
|
10163 |
else |
|
10164 |
{ |
|
10165 |
TInt lowerOffset = iUncommittedText.LowerPos() - resolveSpan.LowerPos(); |
|
10166 |
||
10167 |
TBool needsResolving = iInlineTextDecorator->ResolveDecoratedText(decoratedText, |
|
10168 |
TCursorSelection(lowerOffset, lowerOffset + iUncommittedText.Length())); |
|
10169 |
||
10170 |
if ( needsResolving ) |
|
10171 |
{ |
|
10172 |
TBool setToTrue=EFalse; |
|
10173 |
iInputCapabilities.FepAwareTextEditor()->Extension1()->StartFepInlineEditL( |
|
10174 |
setToTrue, |
|
10175 |
resolveSpan, |
|
10176 |
decoratedText, |
|
10177 |
decoratedText.Length() - decCursor, |
|
10178 |
EFalse, |
|
10179 |
0, // MFormCustomDrawer* |
|
10180 |
*this, |
|
10181 |
*this); |
|
10182 |
||
10183 |
iInputCapabilities.FepAwareTextEditor()->SetInlineEditingCursorVisibilityL( ETrue ); |
|
10184 |
if (IsFeatureSupportedJapanese()) |
|
10185 |
{ |
|
10186 |
// need to call clear buffer of PtiEngine for Japanese varint |
|
10187 |
// before calling second CommitFepInlineEditL(). |
|
10188 |
// because the committed string is set as reading string twice |
|
10189 |
iPtiEngine->ClearCurrentWord(); |
|
10190 |
} |
|
10191 |
iInputCapabilities.FepAwareTextEditor()->CommitFepInlineEditL(*coeEnv); |
|
10192 |
} |
|
10193 |
else |
|
10194 |
{ |
|
10195 |
// Line cursor is made invisible here. There is no line cursor in S60 LAF, even though there is |
|
10196 |
// an Edwin flag which govern this. See CEikEdwin::SetCursorVisibilityL(TBool) |
|
10197 |
// Cursor is not set if this CommitInlineEditL call was prompted when losing focus. |
|
10198 |
MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
10199 |
||
10200 |
// Use FepAwareTextEditor to judge, not use TextView() |
|
10201 |
if ( (docNavi || FepAwareTextEditor()) && !IsCcpuFlagSet(ECcpuStateLosingFocus) ) |
|
10202 |
{ |
|
10203 |
if (docNavi) |
|
10204 |
{ |
|
10205 |
docNavi->SetCursorVisibilityL( TCursor::EFCursorInvisible, |
|
10206 |
TCursor::EFCursorFlashing ); |
|
10207 |
} |
|
10208 |
else |
|
10209 |
{ |
|
10210 |
//Use Edwin (FepAwareTextEditor) to set cursor visibility |
|
10211 |
FepAwareTextEditor()->SetInlineEditingCursorVisibilityL( ETrue ); |
|
10212 |
} |
|
10213 |
} |
|
10214 |
} |
|
10215 |
} |
|
10216 |
// iMatchState=EWordMatchFirst; |
|
10217 |
||
10218 |
CleanupStack::PopAndDestroy(); // decoratedTextBuf |
|
10219 |
} |
|
10220 |
if (iInputCapabilities.FepAwareTextEditor()) |
|
10221 |
{ |
|
10222 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
10223 |
} |
|
10224 |
||
10225 |
iCaseMan->UpdateCase(ENullNaviEvent); |
|
10226 |
// <---- Arabic & Hebrew required functionality added |
|
10227 |
if (!EditorHasFreeSpace()) |
|
10228 |
{ |
|
10229 |
SetFlag(EFlagEditorFull); |
|
10230 |
} |
|
10231 |
else |
|
10232 |
{ |
|
10233 |
ClearFlag(EFlagEditorFull); |
|
10234 |
} |
|
10235 |
} |
|
10236 |
} |
|
10237 |
else if (IsFlagSet(EFlagInsideInlineEditingTransaction) |
|
10238 |
&& iInputCapabilities.SupportsSecretText()) |
|
10239 |
{ |
|
10240 |
CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
10241 |
iInputCapabilities.FepAwareTextEditor()->CommitFepInlineEditL(*coeEnv); |
|
10242 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
10243 |
||
10244 |
if (iQwertyInputMode) |
|
10245 |
{ |
|
10246 |
// Case may need to updated automatically in case of qwerty secret text editor |
|
10247 |
// beause of the sticky shift feature. |
|
10248 |
if (iCaseMan->CurrentCase() == EAknEditorLowerCase) |
|
10249 |
{ |
|
10250 |
SetCase(ELowerCase); |
|
10251 |
} |
|
10252 |
else |
|
10253 |
{ |
|
10254 |
SetCase(EUpperCase); |
|
10255 |
} |
|
10256 |
UpdateIndicators(); |
|
10257 |
} |
|
10258 |
} |
|
10259 |
} |
|
10260 |
||
10261 |
// SendEventsToPluginManL( EPluginSyncFepAwareText, EPluginSyncUpdatedText ); |
|
10262 |
||
10263 |
ClearFlag(EFlagInsideMultitapInlineEditingTransaction | EFlagInsideInlineEditingTransaction | |
|
10264 |
EFlagLineFeedCharacter | EFlagLastCharacterInEditor | EFlagSpaceCharacter | |
|
10265 |
EFlagFullWidthSpaceCharacter); |
|
10266 |
||
10267 |
// No-edit_key devices: Inline editing ending, allow edit-menu again. |
|
10268 |
ClearCcpuFlag(ECcpuStateIgnoreStarUp | ECcpuStateNewPredictiveWord); |
|
10269 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
10270 |
iUncommittedText.iCursorPos=0; |
|
10271 |
iUncommittedText.iAnchorPos=0; |
|
10272 |
#endif |
|
10273 |
if (!iInputCapabilities.FepAwareTextEditor()) |
|
10274 |
{ |
|
10275 |
// In case while updating the inline edit, 3rd party app removes the focus out of editor before the transaction |
|
10276 |
// completes, we return with an error. |
|
10277 |
User::Leave(KErrCorrupt); |
|
10278 |
} |
|
10279 |
||
10280 |
} |
|
10281 |
||
10282 |
void CAknFepManager::CommitInlineEditL(const TDesC& aText, TInt aUncommitedTextChange) |
|
10283 |
{ |
|
10284 |
if (iMode == EHiraganaKanji) |
|
10285 |
{ |
|
10286 |
// When there is not enough editing space to enter the selected candidate, |
|
10287 |
// the error tone is played. |
|
10288 |
if ((iFreeSpaceOfEditor > 0) && (iFreeSpaceOfEditor < aText.Length())) |
|
10289 |
{ |
|
10290 |
PlaySound(EAvkonSIDErrorTone); |
|
10291 |
} |
|
10292 |
} |
|
10293 |
||
10294 |
//maxLength of 0 means the editor has no limit |
|
10295 |
TInt maxEdSize = iInputCapabilities.FepAwareTextEditor()->DocumentMaximumLengthForFep(); |
|
10296 |
if ( maxEdSize != 0 && iFreeSpaceOfEditor < aText.Length()) |
|
10297 |
{ |
|
10298 |
TPtrC charbuf = aText.Left(iFreeSpaceOfEditor); |
|
10299 |
TInt uncommitedTextChange = charbuf.Length(); |
|
10300 |
UpdateInlineEditL(charbuf, uncommitedTextChange); |
|
10301 |
} |
|
10302 |
else |
|
10303 |
{ |
|
10304 |
UpdateInlineEditL(aText, aUncommitedTextChange); |
|
10305 |
} |
|
10306 |
||
10307 |
ClearFlag(EFlagInsideMultitapInlineEditingTransaction); |
|
10308 |
CommitInlineEditL(); |
|
10309 |
} |
|
10310 |
||
10311 |
void CAknFepManager::CancelInlineEdit() |
|
10312 |
{ |
|
10313 |
if( !EditorState()->CurrentInlineEditSpan().Length() ) |
|
10314 |
{ |
|
10315 |
ClearFlag(EFlagInsideInlineEditingTransaction); |
|
10316 |
if(IsFlagSet(CAknFepManager::EFlagNoMatches)) |
|
10317 |
{ |
|
10318 |
ClearFlag(CAknFepManager::EFlagNoMatches); |
|
10319 |
} |
|
10320 |
} |
|
10321 |
if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
10322 |
{ |
|
10323 |
TRAP_IGNORE(TryRemoveNoMatchesIndicatorL()); |
|
10324 |
||
10325 |
if (iInputCapabilities.SupportsSecretText()) |
|
10326 |
{ |
|
10327 |
TRAP_IGNORE(SimulateKeyEventL(EKeyF20)); // backspace to delete previous char in secret text editor |
|
10328 |
} |
|
10329 |
else if (IsFeatureSupportedJapanese() |
|
10330 |
&& iFepManState == EAknFepStateUIActive) |
|
10331 |
{ |
|
10332 |
FepUI()->CloseUI(); |
|
10333 |
FepUI()->ExpireMultitapTimer(); |
|
10334 |
iPtiEngine->ClearCurrentWord(); |
|
10335 |
SyncStates(EAknFepStateInitial); |
|
10336 |
} |
|
10337 |
} |
|
10338 |
||
10339 |
iUncommittedText.iCursorPos=0; |
|
10340 |
||
10341 |
iUncommittedText.iAnchorPos=0; |
|
10342 |
||
10343 |
iInputCapabilities.FepAwareTextEditor()->CancelFepInlineEdit(); |
|
10344 |
ClearFlag(EFlagInsideMultitapInlineEditingTransaction | EFlagInsideInlineEditingTransaction |
|
10345 |
| EFlagLineFeedCharacter | EFlagSpaceCharacter | EFlagFullWidthSpaceCharacter); |
|
10346 |
ClearCcpuFlag(ECcpuStateNewPredictiveWord); |
|
10347 |
} |
|
10348 |
||
10349 |
void CAknFepManager::GetScreenCoordinatesL(TPoint& aLeftSideOfBaseLine, TInt& aHeight, |
|
10350 |
TInt& aAscent, TInt aDocumentOffset) |
|
10351 |
{ |
|
10352 |
TCursorSelection cursorSelection; |
|
10353 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(cursorSelection); |
|
10354 |
TInt documentPosition = cursorSelection.LowerPos() - aDocumentOffset; |
|
10355 |
if (documentPosition < 0) |
|
10356 |
documentPosition = 0; |
|
10357 |
iInputCapabilities.FepAwareTextEditor()->GetScreenCoordinatesForFepL(aLeftSideOfBaseLine, |
|
10358 |
aHeight, aAscent, documentPosition); |
|
10359 |
} |
|
10360 |
||
10361 |
void CAknFepManager::GetScreenCoordinatesL(TPoint& aLeftSideOfBaseLine, |
|
10362 |
TInt& aHeight, TInt& aAscent) |
|
10363 |
{ |
|
10364 |
TCursorSelection cursorSelection; |
|
10365 |
MCoeFepAwareTextEditor* fepAwareTextEditor = iInputCapabilities.FepAwareTextEditor(); |
|
10366 |
||
10367 |
fepAwareTextEditor->GetCursorSelectionForFep(cursorSelection); |
|
10368 |
fepAwareTextEditor->GetScreenCoordinatesForFepL(aLeftSideOfBaseLine, aHeight, aAscent, |
|
10369 |
cursorSelection.LowerPos()); |
|
10370 |
} |
|
10371 |
||
10372 |
TBool CAknFepManager::EditorHasFreeSpace( TInt aRequiredNumberOfCharacter ) const |
|
10373 |
{ |
|
10374 |
TBool unlimit = EFalse; |
|
10375 |
TInt freeSpace = 0; |
|
10376 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
10377 |
if(WesternPredictive()) |
|
10378 |
{ |
|
10379 |
freeSpace = EditorFreeSpaceForAutoWordCompletion(unlimit); |
|
10380 |
} |
|
10381 |
else |
|
10382 |
{ |
|
10383 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
10384 |
freeSpace = EditorFreeSpace(unlimit); |
|
10385 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
10386 |
} |
|
10387 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
10388 |
if( unlimit || freeSpace > aRequiredNumberOfCharacter ) |
|
10389 |
{ |
|
10390 |
return ETrue; |
|
10391 |
} |
|
10392 |
return EFalse; |
|
10393 |
} |
|
10394 |
||
10395 |
// ----------------------------------------------------------------------------- |
|
10396 |
// check whether the current editor is a Java secret editor |
|
10397 |
// ----------------------------------------------------------------------------- |
|
10398 |
TBool CAknFepManager::IsJavaSecretEditor() |
|
10399 |
{ |
|
10400 |
TBool JavaSecretEditor = EFalse; |
|
10401 |
||
10402 |
TUint ConstraintValue = 0; |
|
10403 |
MObjectProvider* mop = iInputCapabilities.ObjectProvider(); |
|
10404 |
||
10405 |
if ( mop ) |
|
10406 |
{ |
|
10407 |
CAknExtendedInputCapabilities* extendedInputCapabilities = |
|
10408 |
mop->MopGetObject( extendedInputCapabilities ); |
|
10409 |
if ( extendedInputCapabilities && iInputCapabilities.FepAwareTextEditor() ) |
|
10410 |
{ |
|
10411 |
ConstraintValue = extendedInputCapabilities->MIDPConstrainst(); |
|
10412 |
} |
|
10413 |
} |
|
10414 |
if( ConstraintValue & 0x10000 ) |
|
10415 |
{ |
|
10416 |
JavaSecretEditor = ETrue; |
|
10417 |
} |
|
10418 |
||
10419 |
return JavaSecretEditor; |
|
10420 |
} |
|
10421 |
||
10422 |
TBool CAknFepManager::IsEditorHasFreeSpace() const |
|
10423 |
{ |
|
10424 |
TBool unlimit = EFalse; |
|
10425 |
TInt freeSpace = 0; |
|
10426 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
10427 |
if(WesternPredictive()) |
|
10428 |
{ |
|
10429 |
freeSpace = EditorFreeSpaceForAutoWordCompletion(unlimit); |
|
10430 |
} |
|
10431 |
else |
|
10432 |
{ |
|
10433 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
10434 |
freeSpace = EditorFreeSpace(unlimit); |
|
10435 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
10436 |
} |
|
10437 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
10438 |
if( unlimit || freeSpace > 0 ) |
|
10439 |
{ |
|
10440 |
return ETrue; |
|
10441 |
} |
|
10442 |
return EFalse; |
|
10443 |
} |
|
10444 |
||
10445 |
TInt CAknFepManager::EditorFreeSpace(TBool& aUnlimit, |
|
10446 |
TBool isToCountUncommittedTextLength /*= EFalse */) const |
|
10447 |
{ |
|
10448 |
aUnlimit = EFalse; |
|
10449 |
||
10450 |
if (!iInputCapabilities.FepAwareTextEditor()) |
|
10451 |
{ |
|
10452 |
//no handle to MCoeFepAwareTextEditor in non Edwin derived editors |
|
10453 |
return 0; |
|
10454 |
} |
|
10455 |
||
10456 |
//maxLength of 0 means the editor has no limit |
|
10457 |
TInt maxEdSize = iInputCapabilities.FepAwareTextEditor()->DocumentMaximumLengthForFep(); |
|
10458 |
TCursorSelection currentSelection; |
|
10459 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(currentSelection); |
|
10460 |
||
10461 |
aUnlimit = (maxEdSize == 0 || ((iAknEditorFlags & EAknEditorFlagMTAutoOverwrite) && |
|
10462 |
(currentSelection.iCursorPos >= 0 && |
|
10463 |
currentSelection.iCursorPos < maxEdSize) )); |
|
10464 |
if(aUnlimit) |
|
10465 |
{ |
|
10466 |
return 0; |
|
10467 |
} |
|
10468 |
||
10469 |
TInt edSize = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
10470 |
||
10471 |
if( isToCountUncommittedTextLength ) |
|
10472 |
{ |
|
10473 |
return ( maxEdSize - edSize + |
|
10474 |
currentSelection.Length() + UncommittedText().Length() ); |
|
10475 |
} |
|
10476 |
||
10477 |
return (maxEdSize - edSize + currentSelection.Length()); |
|
10478 |
||
10479 |
} |
|
10480 |
||
10481 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
10482 |
TInt CAknFepManager::EditorFreeSpaceForAutoWordCompletion(TBool& aUnlimit, |
|
10483 |
TBool /* isToCountUncommittedTextLength = EFalse*/ ) const |
|
10484 |
{ |
|
10485 |
aUnlimit = EFalse; |
|
10486 |
||
10487 |
if (!iInputCapabilities.FepAwareTextEditor()) |
|
10488 |
{ |
|
10489 |
//no handle to MCoeFepAwareTextEditor in non Edwin derived editors |
|
10490 |
return 0; |
|
10491 |
} |
|
10492 |
||
10493 |
//maxLength of 0 means the editor has no limit |
|
10494 |
TInt maxEdSize = iInputCapabilities.FepAwareTextEditor()->DocumentMaximumLengthForFep(); |
|
10495 |
TInt edSize = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
10496 |
TInt keySequenceLength = iPtiEngine->CurrentInputSequence().Length(); |
|
10497 |
TCursorSelection currentSelectionOrUncommitted; |
|
10498 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(currentSelectionOrUncommitted); |
|
10499 |
||
10500 |
aUnlimit = (maxEdSize == 0 || ((iAknEditorFlags & EAknEditorFlagMTAutoOverwrite) && |
|
10501 |
(currentSelectionOrUncommitted.iCursorPos >= 0 && |
|
10502 |
currentSelectionOrUncommitted.iCursorPos < maxEdSize) )); |
|
10503 |
if(aUnlimit) |
|
10504 |
{ |
|
10505 |
return 0; |
|
10506 |
} |
|
10507 |
else |
|
10508 |
{ |
|
10509 |
||
10510 |
if ( !iQwertyInputMode ) |
|
10511 |
{ |
|
10512 |
return ( maxEdSize - edSize + currentSelectionOrUncommitted.Length() ); |
|
10513 |
} |
|
10514 |
else |
|
10515 |
{ |
|
10516 |
// In the predictive QWERTY mode, the keySequenceLength doesn't necessarily have anything |
|
10517 |
// to do with the amount of characters on screen. At least entering accented characters with |
|
10518 |
// Chr-multitapping will increase the key sequence length although number of characters |
|
10519 |
// doesn't change (this is either bug or feature of ZiCore). Ask the auto-completion |
|
10520 |
// length directly from PtiEngine instead of trying to calculate it on our own. |
|
10521 |
TInt tailLength = 0; |
|
10522 |
TRAP_IGNORE(iPtiEngine->HandleCommandL( EPtiCommandGetAutoCompletionTailLength, &tailLength )); |
|
10523 |
if( tailLength < 0 ) |
|
10524 |
{ |
|
10525 |
tailLength = 0; |
|
10526 |
} |
|
10527 |
return (maxEdSize - edSize + currentSelectionOrUncommitted.Length() + tailLength); |
|
10528 |
} |
|
10529 |
} |
|
10530 |
} |
|
10531 |
#endif |
|
10532 |
#ifdef __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__ |
|
10533 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
10534 |
||
10535 |
TInt CAknFepManager::DocumentLength() const |
|
10536 |
{ |
|
10537 |
TInt ret = 0; |
|
10538 |
if ( iInputCapabilities.FepAwareTextEditor() ) |
|
10539 |
{ |
|
10540 |
ret = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
10541 |
} |
|
10542 |
return ret; |
|
10543 |
} |
|
10544 |
||
10545 |
TBool CAknFepManager::KeyEventWillReplaceCharacter( const TKeyEvent& aKeyEvent ) |
|
10546 |
{ |
|
10547 |
// The function is currently used only in QWERTY mode. It might not work correctly |
|
10548 |
// with ITU-T input. |
|
10549 |
TBool ret = EFalse; |
|
10550 |
if ( IsFlagSet(EFlagInsideMultitapInlineEditingTransaction) ) |
|
10551 |
{ |
|
10552 |
// Multitapping |
|
10553 |
ret = ETrue; |
|
10554 |
} |
|
10555 |
else if ( aKeyEvent.iRepeats && |
|
10556 |
LongPressNumberEntryOnQwerty() && |
|
10557 |
FnKeyState() == CAknFepFnKeyManager::EFnKeyNone && |
|
10558 |
KeyMapsDifferentCharacterWithFn( (TPtiKey)aKeyEvent.iScanCode ) ) |
|
10559 |
{ |
|
10560 |
// QWERTY key long press producing another charcter |
|
10561 |
ret = ETrue; |
|
10562 |
} |
|
10563 |
return ret; |
|
10564 |
} |
|
10565 |
#endif |
|
10566 |
#endif |
|
10567 |
TChar CAknFepManager::CurrentDecimalSeparator() const |
|
10568 |
{ |
|
10569 |
TLocale tLoc; |
|
10570 |
return tLoc.DecimalSeparator(); |
|
10571 |
} |
|
10572 |
||
10573 |
void CAknFepManager::ConfigureFEPFromEditorStateL() |
|
10574 |
{ |
|
10575 |
User::LeaveIfError(SyncStates(EAknFepStateInitial)); |
|
10576 |
||
10577 |
CAknEdwinState* editorState = EditorState(); |
|
10578 |
TInt editorMode = editorState->CurrentInputMode(); |
|
10579 |
TInt sharedDataMode = iSharedDataInterface->InputMode(); |
|
10580 |
TBool latinCaseSet = EFalse; |
|
10581 |
iPermittedInputModes = editorState->PermittedInputModes(); |
|
10582 |
TInt defaultInputMode = editorState->DefaultInputMode(); |
|
10583 |
if(iAknEditorFlags != editorState->Flags()) |
|
10584 |
{ |
|
10585 |
iAknEditorFlags = editorState->Flags(); |
|
10586 |
UpdateLocalDigitMode(); |
|
10587 |
} |
|
10588 |
iAknEditorNumericKeymap = editorState->NumericKeymap(); |
|
10589 |
||
10590 |
TLanguage localLanguage = ELangTest; |
|
10591 |
if (GetLocalLanguage( localLanguage ) ) |
|
10592 |
{ |
|
10593 |
iLanguageCapabilities.iLocalInputLanguageInUse = ETrue; |
|
10594 |
if ( localLanguage != iLanguageCapabilities.iInputLanguageCode ) |
|
10595 |
{ |
|
10596 |
ChangeInputLanguageL(localLanguage); |
|
10597 |
} |
|
10598 |
} |
|
10599 |
else if (iLanguageCapabilities.iLocalInputLanguageInUse) |
|
10600 |
{ |
|
10601 |
ChangeInputLanguageL(iSharedDataInterface->InputTextLanguage()); |
|
10602 |
iLanguageCapabilities.iLocalInputLanguageInUse = EFalse; |
|
10603 |
ClearFlag(EFlagNewSharedDataInputMode); |
|
10604 |
} |
|
10605 |
||
10606 |
if (IsFlagSet(EFlagNewSharedDataInputLanguage) ) |
|
10607 |
{ |
|
10608 |
//Global mode or input language has been changed in general settings |
|
10609 |
if ( !iLanguageCapabilities.iLocalInputLanguageInUse) |
|
10610 |
{ |
|
10611 |
ChangeInputLanguageL(iSharedDataInterface->InputTextLanguage()); |
|
10612 |
} |
|
10613 |
ClearFlag(EFlagNewSharedDataInputLanguage); |
|
10614 |
} |
|
10615 |
||
10616 |
if (IsFeatureSupportedJapanese()) |
|
10617 |
{ |
|
10618 |
// set Japanese predicitve ON/OFF |
|
10619 |
if (iAknEditorFlags & EAknEditorFlagNoT9) |
|
10620 |
{ |
|
10621 |
iJapanesePredictive = EFalse; |
|
10622 |
} |
|
10623 |
else |
|
10624 |
{ |
|
10625 |
// Is it supported Japanese predictive input |
|
10626 |
if (HasJapanesePredictionInputMode()) |
|
10627 |
{ |
|
10628 |
iJapanesePredictive = iSharedDataInterface->PredictiveTextJapaneseOn(); |
|
10629 |
} |
|
10630 |
else |
|
10631 |
{ |
|
10632 |
// if Predictive Japanese input isn't supported in PtiEngine, set to OFF. |
|
10633 |
iJapanesePredictive = EFalse; |
|
10634 |
iSharedDataInterface->ResetJapanesePredictiveTextOn(); |
|
10635 |
} |
|
10636 |
} |
|
10637 |
||
10638 |
// In Japanese variant, EAknEditorTextInputMode of allow input mode |
|
10639 |
// means all input mode. |
|
10640 |
if (iPermittedInputModes & EAknEditorTextInputMode) |
|
10641 |
{ |
|
10642 |
iPermittedInputModes |= (EAknEditorKatakanaInputMode | |
|
10643 |
EAknEditorHalfWidthTextInputMode | |
|
10644 |
EAknEditorFullWidthTextInputMode | |
|
10645 |
EAknEditorFullWidthNumericInputMode | |
|
10646 |
EAknEditorFullWidthKatakanaInputMode | |
|
10647 |
EAknEditorHiraganaKanjiInputMode | |
|
10648 |
EAknEditorHiraganaInputMode); |
|
10649 |
} |
|
10650 |
||
10651 |
if (iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) |
|
10652 |
{ |
|
10653 |
if (iPermittedInputModes == EAknEditorNumericInputMode) |
|
10654 |
{ |
|
10655 |
iPermittedInputModes = EAknEditorNumericInputMode; |
|
10656 |
} |
|
10657 |
else if (iPermittedInputModes & EAknEditorNumericInputMode) |
|
10658 |
{ |
|
10659 |
iPermittedInputModes = (EAknEditorHalfWidthTextInputMode |
|
10660 |
| EAknEditorNumericInputMode); |
|
10661 |
} |
|
10662 |
else |
|
10663 |
{ |
|
10664 |
iPermittedInputModes = EAknEditorHalfWidthTextInputMode; |
|
10665 |
} |
|
10666 |
} |
|
10667 |
||
10668 |
if (editorMode) |
|
10669 |
{ |
|
10670 |
editorMode = ConfigureFepModeFromEditorMode(editorMode); |
|
10671 |
} |
|
10672 |
else // for new editors |
|
10673 |
{ |
|
10674 |
iCharWidth = EHalfWidthChar; |
|
10675 |
sharedDataMode = EHiraganaKanji; |
|
10676 |
// First input mode is changed to Latin from Hiragana/Kanji |
|
10677 |
// if display language is English. |
|
10678 |
TInt dispLang = iSharedDataInterface->DisplayLanguage(); |
|
10679 |
// ELangTest means Automatic as display language in GS |
|
10680 |
if (dispLang == ELangTest) |
|
10681 |
{ |
|
10682 |
// UiLanguage isn't Japanese, Latin is set. |
|
10683 |
if (iUiLanguage != ELangJapanese) |
|
10684 |
{ |
|
10685 |
sharedDataMode = ELatin; |
|
10686 |
} |
|
10687 |
} |
|
10688 |
else if (dispLang != ELangJapanese) |
|
10689 |
{ |
|
10690 |
// Display language isn't Japanese, Latin is set. |
|
10691 |
sharedDataMode = ELatin; |
|
10692 |
} |
|
10693 |
||
10694 |
if (!(iPermittedInputModes & EAknEditorHiraganaKanjiInputMode)) |
|
10695 |
{ |
|
10696 |
if (IsOnlyFullWidthCharacterPermitted()) |
|
10697 |
{ |
|
10698 |
iCharWidth = EFullWidthChar; |
|
10699 |
} |
|
10700 |
else if (IsOnlyHalfWidthCharacterPermitted()) |
|
10701 |
{ |
|
10702 |
iCharWidth = EHalfWidthChar; |
|
10703 |
} |
|
10704 |
||
10705 |
if (iPermittedInputModes & (EAknEditorKatakanaInputMode | |
|
10706 |
EAknEditorFullWidthKatakanaInputMode)) |
|
10707 |
{ |
|
10708 |
// In case setting Latin as above, Latin is used preferentially. |
|
10709 |
if (sharedDataMode == ELatin |
|
10710 |
&& (iPermittedInputModes & |
|
10711 |
(EAknEditorHalfWidthTextInputMode | EAknEditorFullWidthTextInputMode))) |
|
10712 |
{ |
|
10713 |
sharedDataMode = ELatin; |
|
10714 |
} |
|
10715 |
else |
|
10716 |
{ |
|
10717 |
sharedDataMode = EKatakana; |
|
10718 |
} |
|
10719 |
} |
|
10720 |
else if (iPermittedInputModes & (EAknEditorHalfWidthTextInputMode | |
|
10721 |
EAknEditorFullWidthTextInputMode)) |
|
10722 |
{ |
|
10723 |
sharedDataMode = ELatin; |
|
10724 |
} |
|
10725 |
else if (iPermittedInputModes & (EAknEditorNumericInputMode | |
|
10726 |
EAknEditorFullWidthNumericInputMode)) |
|
10727 |
{ |
|
10728 |
sharedDataMode = ENumber; |
|
10729 |
} |
|
10730 |
// First input mode is changed to latin from katakana |
|
10731 |
// if display language is English. |
|
10732 |
if (!(dispLang == ELangTest || dispLang == ELangJapanese)) |
|
10733 |
{ |
|
10734 |
if ((iPermittedInputModes & EAknEditorKatakanaInputMode) && |
|
10735 |
(iPermittedInputModes & EAknEditorHalfWidthTextInputMode)) |
|
10736 |
{ |
|
10737 |
sharedDataMode = ELatin; |
|
10738 |
} |
|
10739 |
||
10740 |
if ((iPermittedInputModes & EAknEditorKatakanaInputMode) && |
|
10741 |
(iPermittedInputModes & EAknEditorFullWidthTextInputMode)) |
|
10742 |
{ |
|
10743 |
sharedDataMode = ELatin; |
|
10744 |
} |
|
10745 |
} |
|
10746 |
} |
|
10747 |
} |
|
10748 |
} |
|
10749 |
else // for other variants (western or chinese) |
|
10750 |
{ |
|
10751 |
if (!(iPermittedInputModes & (EAknEditorTextInputMode | EAknEditorNumericInputMode |
|
10752 |
| EAknEditorSecretAlphaInputMode))) |
|
10753 |
{ |
|
10754 |
// Any latin input mode is not permitted by the editor. |
|
10755 |
// For compatibility permitted japanese input modes are checked and |
|
10756 |
// corresponding latin input modes are allowed. |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
10757 |
if ( iPermittedInputModes & (EAknEditorKatakanaInputMode | |
44 | 10758 |
EAknEditorHalfWidthTextInputMode | |
10759 |
EAknEditorFullWidthTextInputMode | |
|
10760 |
EAknEditorFullWidthKatakanaInputMode | |
|
10761 |
EAknEditorHiraganaKanjiInputMode | |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
10762 |
EAknEditorHiraganaInputMode)) |
44 | 10763 |
{ |
10764 |
iPermittedInputModes |= EAknEditorTextInputMode; |
|
10765 |
} |
|
10766 |
if ( iPermittedInputModes & EAknEditorFullWidthNumericInputMode ) |
|
10767 |
{ |
|
10768 |
iPermittedInputModes |= EAknEditorNumericInputMode; |
|
10769 |
} |
|
10770 |
||
10771 |
if ( !(defaultInputMode & (EAknEditorTextInputMode | EAknEditorNumericInputMode))) |
|
10772 |
{ |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
10773 |
if (defaultInputMode & (EAknEditorKatakanaInputMode | |
44 | 10774 |
EAknEditorHalfWidthTextInputMode| |
10775 |
EAknEditorFullWidthTextInputMode | |
|
10776 |
EAknEditorFullWidthKatakanaInputMode | |
|
10777 |
EAknEditorHiraganaKanjiInputMode | |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
10778 |
EAknEditorHiraganaInputMode)) |
44 | 10779 |
{ |
10780 |
defaultInputMode = EAknEditorTextInputMode; |
|
10781 |
} |
|
10782 |
else if (defaultInputMode & EAknEditorFullWidthNumericInputMode) |
|
10783 |
{ |
|
10784 |
defaultInputMode = EAknEditorNumericInputMode; |
|
10785 |
} |
|
10786 |
} |
|
10787 |
} |
|
10788 |
} |
|
10789 |
||
10790 |
// object provider items |
|
10791 |
iEditMenuBar = NULL; |
|
10792 |
editorState->SetMenu(); |
|
10793 |
editorState->SetCba(); |
|
10794 |
||
10795 |
#ifdef __ITI_VIRTUAL_TOUCH_FIRST_GENERATION_SUPPORT__ |
|
10796 |
iOptionsMenuBar = NULL; |
|
10797 |
#endif |
|
10798 |
||
10799 |
SetWesternPredictive(iSharedDataInterface->PredictiveTextOn()); |
|
10800 |
//check that we don't have a Chinese find mode saved to an editor that is |
|
10801 |
//not a Chinese find pane |
|
10802 |
__ASSERT_DEBUG( !((editorMode == EZhuyinFind || editorMode == EStrokeFind) && |
|
10803 |
!(iAknEditorFlags & EAknEditorFlagForceTransparentFepModes)) |
|
10804 |
, AknFepPanic(EAknFepPanicFindModeSavedToNonFindEditor)); |
|
10805 |
||
10806 |
ReadHashKeyLoopL(); |
|
10807 |
||
10808 |
UpdateNumericEditorDigitType(); |
|
10809 |
if ( IsMfneEditor() ) |
|
10810 |
{ |
|
10811 |
UpdateLocalDigitMode(); |
|
10812 |
} |
|
10813 |
||
10814 |
if (editorMode) //should be an editor that has been used before |
|
10815 |
{ |
|
10816 |
if (IsFlagSet(EFlagNewSharedDataInputMode) && (IsModePermitted(sharedDataMode)) && !IsKoreanInputLanguage() |
|
10817 |
&& (!(iAknEditorFlags & EAknEditorFlagForceTransparentFepModes))) |
|
10818 |
{ |
|
10819 |
||
10820 |
{ |
|
10821 |
//change to global mode, except in Find Pane, where we ignore |
|
10822 |
//GS setting |
|
10823 |
TryChangeModeL(sharedDataMode); |
|
10824 |
ClearFlag(EFlagNewSharedDataInputMode); |
|
10825 |
latinCaseSet = sharedDataMode & (ELatinUpper | ELatinLower); |
|
10826 |
if (sharedDataMode == ELatinText) |
|
10827 |
{ |
|
10828 |
editorState->SetFlags( editorState->Flags() & ~EFlagSupressAutoUpdate ); |
|
10829 |
} |
|
10830 |
} |
|
10831 |
} |
|
10832 |
||
10833 |
// Next two cases are apps/UI intitialinsg their editors in the |
|
10834 |
// with the modes defined in uikon.hrh, change these to an appropriate |
|
10835 |
// FEP mode |
|
10836 |
else if (editorMode == EAknEditorNumericInputMode) |
|
10837 |
{ |
|
10838 |
iCharWidth = EHalfWidthChar; |
|
10839 |
if ( (iMode == ENumber || iMode == ENativeNumber) && |
|
10840 |
IsModePermitted(iMode)) |
|
10841 |
{ |
|
10842 |
TryChangeModeL( iMode ); |
|
10843 |
} |
|
10844 |
else if ( IsInputModeAvailable(ENativeNumber) && |
|
10845 |
( iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic || |
|
10846 |
iLanguageCapabilities.iLocalDigitType == EDigitTypeDevanagari || |
|
10847 |
iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic ) ) |
|
10848 |
{ |
|
10849 |
TryChangeModeL( ENativeNumber ); |
|
10850 |
} |
|
10851 |
else |
|
10852 |
{ |
|
10853 |
TryChangeModeL( ENumber ); |
|
10854 |
} |
|
10855 |
} |
|
10856 |
else if (editorMode == EAknEditorSecretAlphaInputMode) |
|
10857 |
{ |
|
10858 |
//this is safe default as it is currently allowed in all FEPs |
|
10859 |
SetWesternPredictive(EFalse); |
|
10860 |
TryChangeModeL(ELatin); |
|
10861 |
} |
|
10862 |
else if (editorMode == EAknEditorTextInputMode) |
|
10863 |
{ |
|
10864 |
if (IsKoreanInputLanguage()) |
|
10865 |
{ |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
10866 |
if(iMode == EHangul || iMode == ENumber || iMode == EAknEditorNullInputMode ) |
44 | 10867 |
{ |
10868 |
SetWesternPredictive(EFalse); |
|
10869 |
TryChangeModeL(EHangul); |
|
10870 |
} |
|
10871 |
else |
|
10872 |
{ |
|
10873 |
TryChangeModeL(ELatin); |
|
10874 |
} |
|
10875 |
} |
|
10876 |
else |
|
10877 |
{ |
|
10878 |
//this is safe default as it is currently allowed in all FEPs |
|
10879 |
TryChangeModeL(ELatin); |
|
10880 |
} |
|
10881 |
} |
|
10882 |
else if (!iStrokeUsedInQWERTY) |
|
10883 |
{ |
|
10884 |
if (editorMode == EStroke && sharedDataMode == ECangJie) |
|
10885 |
{ |
|
10886 |
TryChangeModeL(sharedDataMode); |
|
10887 |
} |
|
10888 |
else |
|
10889 |
{ |
|
10890 |
TryChangeModeL(editorMode); |
|
10891 |
} |
|
10892 |
} |
|
10893 |
else //normal case, use locally stored mode |
|
10894 |
{ |
|
10895 |
if (editorMode == ECangJie && sharedDataMode == ECangJie && iQwertyInputMode) |
|
10896 |
{ |
|
10897 |
TryChangeModeL(EStroke); |
|
10898 |
} |
|
10899 |
else |
|
10900 |
{ |
|
10901 |
TryChangeModeL(editorMode); |
|
10902 |
} |
|
10903 |
} |
|
10904 |
} |
|
10905 |
else if ((iAknEditorFlags & EAknEditorFlagForceTransparentFepModes) |
|
10906 |
&& !IsFeatureSupportedJapanese()) //new find pane |
|
10907 |
{ |
|
10908 |
// the default chinese find mode is the first mode in the hash key loop, except PrcChinese |
|
10909 |
if( iLanguageCapabilities.iInputLanguageCode == ELangPrcChinese) |
|
10910 |
{ |
|
10911 |
// Default searching language shall be ELatin |
|
10912 |
// Changed from EPinyin to ELatin here |
|
10913 |
TryChangeModeL(ELatin); |
|
10914 |
} |
|
10915 |
else |
|
10916 |
{ |
|
10917 |
TryChangeModeL(iHashKeyLoop[0]); |
|
10918 |
} |
|
10919 |
} |
|
10920 |
else //new editor |
|
10921 |
{ |
|
10922 |
if (defaultInputMode == EAknEditorNumericInputMode) |
|
10923 |
{ |
|
10924 |
//numeric mode is not saved to/retreived from shared data |
|
10925 |
iCharWidth = EHalfWidthChar; |
|
10926 |
||
10927 |
if( IsInputModeAvailable(ENativeNumber) && |
|
10928 |
( iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic || |
|
10929 |
iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic || |
|
10930 |
iLanguageCapabilities.iLocalDigitType == EDigitTypeDevanagari ) ) |
|
10931 |
{ |
|
10932 |
TryChangeModeL( ENativeNumber ); |
|
10933 |
} |
|
10934 |
else |
|
10935 |
{ |
|
10936 |
TryChangeModeL( ENumber ); |
|
10937 |
} |
|
10938 |
} |
|
10939 |
else if ((defaultInputMode == EAknEditorTextInputMode) && |
|
10940 |
((iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) || |
|
10941 |
(iAknEditorFlags & EAknEditorFlagNoT9))) |
|
10942 |
{ |
|
10943 |
//Chinese Modes or Western Predictive mode not allowed. |
|
10944 |
//See if we are ok going to the current shared data mode, |
|
10945 |
//otherwise go for a safe default |
|
10946 |
if (TryChangeModeL(sharedDataMode)) |
|
10947 |
{ |
|
10948 |
latinCaseSet = sharedDataMode & (ELatinUpper | ELatinLower); |
|
10949 |
} |
|
10950 |
else |
|
10951 |
{ |
|
10952 |
TryChangeModeL(ELatin); |
|
10953 |
} |
|
10954 |
} |
|
10955 |
else if (defaultInputMode == EAknEditorHalfWidthTextInputMode) |
|
10956 |
{ |
|
10957 |
iCharWidth = EHalfWidthChar; |
|
10958 |
TryChangeModeL(ELatin); |
|
10959 |
} |
|
10960 |
else if (defaultInputMode == EAknEditorHiraganaInputMode) |
|
10961 |
{ |
|
10962 |
TryChangeModeL(EHiragana); |
|
10963 |
} |
|
10964 |
else if ( iLanguageCapabilities.iInputLanguageCode == ELangJapanese |
|
10965 |
&& (defaultInputMode == EAknEditorKatakanaInputMode |
|
10966 |
|| defaultInputMode == EAknEditorFullWidthKatakanaInputMode)) |
|
10967 |
{ |
|
10968 |
iCharWidth = (defaultInputMode == EAknEditorKatakanaInputMode)? |
|
10969 |
EHalfWidthChar : EFullWidthChar; |
|
10970 |
TryChangeModeL(EKatakana); |
|
10971 |
} |
|
10972 |
else if (defaultInputMode == EAknEditorFullWidthTextInputMode) |
|
10973 |
{ |
|
10974 |
iCharWidth = EFullWidthChar; |
|
10975 |
TryChangeModeL(ELatin); |
|
10976 |
} |
|
10977 |
else if (defaultInputMode == EAknEditorFullWidthNumericInputMode) |
|
10978 |
{ |
|
10979 |
iCharWidth = EFullWidthChar; |
|
10980 |
if( IsInputModeAvailable(ENativeNumber) && |
|
10981 |
( iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic || |
|
10982 |
iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic || |
|
10983 |
iLanguageCapabilities.iLocalDigitType == EDigitTypeDevanagari ) ) |
|
10984 |
{ |
|
10985 |
TryChangeModeL( ENativeNumber ); |
|
10986 |
} |
|
10987 |
else |
|
10988 |
{ |
|
10989 |
TryChangeModeL( ENumber ); |
|
10990 |
} |
|
10991 |
} |
|
10992 |
else if (defaultInputMode == EAknEditorTextInputMode |
|
10993 |
&& iLanguageCapabilities.iInputLanguageCode == ELangHindi ) |
|
10994 |
{ |
|
10995 |
TryChangeModeL( EHindi ); |
|
10996 |
} |
|
10997 |
else // Default input mode is EAknEditorTextInputMode |
|
10998 |
{ |
|
10999 |
// Check possibility move this section on else if |
|
11000 |
if (IsKoreanInputLanguage()) |
|
11001 |
{ |
|
11002 |
TryChangeModeL(EHangul); |
|
11003 |
} |
|
11004 |
else if (TryChangeModeL(sharedDataMode)) |
|
11005 |
{ |
|
11006 |
latinCaseSet = sharedDataMode & (ELatinUpper | ELatinLower); |
|
11007 |
} |
|
11008 |
else |
|
11009 |
{ |
|
11010 |
TryChangeModeL(ELatin); |
|
11011 |
} |
|
11012 |
||
11013 |
} |
|
11014 |
} |
|
11015 |
||
11016 |
if (!iMode) |
|
11017 |
{ |
|
11018 |
// If mode change wasn't successful, try latin mode as fallback. |
|
11019 |
TryChangeModeL(ELatin); |
|
11020 |
} |
|
11021 |
||
11022 |
// if also fallback fails, panic. |
|
11023 |
__ASSERT_DEBUG(iMode, AknFepPanic(EAknFepPanicNoPermittedEditorModesAvailable)); |
|
11024 |
||
11025 |
if (iCaseMan && !latinCaseSet) |
|
11026 |
{ |
|
11027 |
iCaseMan->ConfigureCaseStateFromEditorState(); |
|
11028 |
if ( (editorState->Flags() & EFlagSupressAutoUpdate) || |
|
11029 |
editorMode == EAknEditorSecretAlphaInputMode ) |
|
11030 |
{ |
|
11031 |
SetFlag(EFlagSupressAutoUpdate); |
|
11032 |
} |
|
11033 |
else |
|
11034 |
{ |
|
11035 |
ClearFlag(EFlagSupressAutoUpdate); |
|
11036 |
} |
|
11037 |
} |
|
11038 |
if ((iAknEditorFlags & EAknEditorFlagForceTransparentFepModes) && |
|
11039 |
IsChineseInputLanguage() && iCaseMan != NULL ) |
|
11040 |
{ |
|
11041 |
SetFlag(EFlagSupressAutoUpdate); |
|
11042 |
iCaseMan->SetCurrentCase(EAknEditorLowerCase); |
|
11043 |
} |
|
11044 |
||
11045 |
UpdateEditorContext(); |
|
11046 |
||
11047 |
// Check if this editor was previously inline editing |
|
11048 |
if ( WesternPredictive() && editorState->CurrentInlineEditSpan().Length()) |
|
11049 |
{ // restore the fep to an inline editing state |
|
11050 |
iUncommittedText = editorState->CurrentInlineEditSpan(); |
|
11051 |
TInt docLenFep=iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
11052 |
if (iUncommittedText.iCursorPos>docLenFep) |
|
11053 |
iUncommittedText.iCursorPos=docLenFep; |
|
11054 |
if (iUncommittedText.iAnchorPos>docLenFep) |
|
11055 |
iUncommittedText.iAnchorPos=docLenFep; |
|
11056 |
||
11057 |
TBuf<EMaximumFepWordLength> textToUncommit; |
|
11058 |
iInputCapabilities.FepAwareTextEditor()-> |
|
11059 |
GetEditorContentForFep(textToUncommit, iUncommittedText.iAnchorPos, |
|
11060 |
Min(iUncommittedText.Length(), EMaximumFepWordLength)); |
|
11061 |
||
11062 |
// Activates western predictive UI to an inline editing state. |
|
11063 |
FepUI()->ActivateUI(); |
|
11064 |
SyncStates(EAknFepStateUIActive); |
|
11065 |
TInt err = iPtiEngine->SetCurrentWord(textToUncommit); |
|
11066 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
11067 |
// Predictive QWERTY (XT9) changes (TEST) ----> |
|
11068 |
// The PtiXt9Core may choose to ignore the SetCurrentInputSequence() call. |
|
11069 |
// Make sure our text buffer is in sync with the one in PtiEngine. |
|
11070 |
if(KErrNone != err) |
|
11071 |
textToUncommit = iPtiEngine->CurrentWord(); |
|
11072 |
TInt maxEdSize = iInputCapabilities.FepAwareTextEditor()->DocumentMaximumLengthForFep(); |
|
11073 |
if((maxEdSize > 0) && (iUncommittedText.iAnchorPos + textToUncommit.Length() > maxEdSize)) |
|
11074 |
{ |
|
11075 |
textToUncommit.SetLength(maxEdSize - iUncommittedText.iAnchorPos); |
|
11076 |
iUncommittedText.iCursorPos = maxEdSize; |
|
11077 |
} |
|
11078 |
// Predictive QWERTY (XT9) changes <---- |
|
11079 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
11080 |
StartInlineEditL(iUncommittedText, textToUncommit, textToUncommit.Length(), EFalse); |
|
11081 |
||
11082 |
// Make sure editor character case in sync |
|
11083 |
if( iUncommittedText.iAnchorPos == 0 ) |
|
11084 |
iCaseMan->UpdateCase(ENullNaviEvent); |
|
11085 |
||
11086 |
} |
|
11087 |
||
11088 |
if (editorState != iPreviousEditorState) |
|
11089 |
{ |
|
11090 |
// we have changed editor, time to update local digits mode |
|
11091 |
UpdateLocalDigitMode(); |
|
11092 |
iPreviousEditorState = editorState; |
|
11093 |
} |
|
11094 |
||
11095 |
if(IsExtendedFlagSet(EExtendedFlagShiftReleasedOnPopup) && !(iAknEditorFlags & EAknEditorFlagFindPane) ) |
|
11096 |
{ |
|
11097 |
// If in FEP context, shift is released on a non fep aware dialog |
|
11098 |
// like "text copied to clipboard", then release the shift |
|
11099 |
// when the editor comes in focus by simulating shift up event. |
|
11100 |
ClearExtendedFlag(EExtendedFlagShiftReleasedOnPopup); |
|
11101 |
TKeyEvent shiftUp = {0, EStdKeyLeftShift, 0, 0}; |
|
11102 |
CCoeEnv::Static()->SimulateKeyEventL(shiftUp, EEventKeyUp); |
|
11103 |
} |
|
11104 |
else if (IsFlagSet(EFlagLongShiftKeyPress) && !(iAknEditorFlags & EAknEditorFlagFindPane)) |
|
11105 |
{ |
|
11106 |
// Find pane editor does not require any shift simulation |
|
11107 |
||
11108 |
// After the "text copied" note and if the shift key was not released |
|
11109 |
// then simulate shift down event. |
|
11110 |
TKeyEvent shiftDown = {0, EStdKeyLeftShift, 0, 0}; |
|
11111 |
CCoeEnv::Static()->SimulateKeyEventL(shiftDown, EEventKeyDown); |
|
11112 |
if((!iCandidatePopup) && (KeyboardLayout() != EPtiKeyboard12Key )) |
|
11113 |
ResetShiftKeyMonitorL(); |
|
11114 |
} |
|
11115 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
11116 |
TransferFepStateToEditorL(EFalse); // ensure editor has up to date state |
|
11117 |
#else |
|
11118 |
TransferFepStateToEditorL(); // ensure editor has up to date state |
|
11119 |
#endif |
|
11120 |
||
11121 |
iHashKeyMan->ResetIndicHashKeyStateL(); |
|
11122 |
ClearExtendedFlag(EExtendedFlagShortPressHashKey); |
|
11123 |
} |
|
11124 |
||
11125 |
TInt CAknFepManager::ConfigureFepModeFromEditorMode(TInt aEditorMode) |
|
11126 |
{ |
|
11127 |
TInt fepMode(aEditorMode); |
|
11128 |
||
11129 |
switch (aEditorMode) |
|
11130 |
{ |
|
11131 |
case EAknEditorNumericInputMode: |
|
11132 |
if( IsInputModeAvailable(ENativeNumber) && |
|
11133 |
( iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic || |
|
11134 |
iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic || |
|
11135 |
iLanguageCapabilities.iLocalDigitType == EDigitTypeDevanagari ) ) |
|
11136 |
{ |
|
11137 |
fepMode = ENativeNumber; |
|
11138 |
} |
|
11139 |
else |
|
11140 |
{ |
|
11141 |
fepMode = ENumber; |
|
11142 |
} |
|
11143 |
iCharWidth = EHalfWidthChar; |
|
11144 |
break; |
|
11145 |
case EAknEditorSecretAlphaInputMode: |
|
11146 |
case EAknEditorTextInputMode: |
|
11147 |
case EAknEditorHalfWidthTextInputMode: |
|
11148 |
fepMode = ELatin; |
|
11149 |
iCharWidth = EHalfWidthChar; |
|
11150 |
break; |
|
11151 |
case EAknEditorKatakanaInputMode: |
|
11152 |
fepMode = EKatakana; |
|
11153 |
iCharWidth = EHalfWidthChar; |
|
11154 |
break; |
|
11155 |
case EAknEditorFullWidthTextInputMode: |
|
11156 |
fepMode = ELatin; |
|
11157 |
iCharWidth = EFullWidthChar; |
|
11158 |
break; |
|
11159 |
case EAknEditorFullWidthKatakanaInputMode: |
|
11160 |
fepMode = EKatakana; |
|
11161 |
iCharWidth = EFullWidthChar; |
|
11162 |
break; |
|
11163 |
case EAknEditorFullWidthNumericInputMode: |
|
11164 |
if( IsInputModeAvailable(ENativeNumber) && |
|
11165 |
( iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic || |
|
11166 |
iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic || |
|
11167 |
iLanguageCapabilities.iLocalDigitType == EDigitTypeDevanagari ) ) |
|
11168 |
{ |
|
11169 |
fepMode = ENativeNumber; |
|
11170 |
} |
|
11171 |
else |
|
11172 |
{ |
|
11173 |
fepMode = ENumber; |
|
11174 |
} |
|
11175 |
iCharWidth = EFullWidthChar; |
|
11176 |
break; |
|
11177 |
case EAknEditorHiraganaKanjiInputMode: |
|
11178 |
fepMode = EHiraganaKanji; |
|
11179 |
break; |
|
11180 |
case EAknEditorHiraganaInputMode: |
|
11181 |
fepMode = EHiragana; |
|
11182 |
break; |
|
11183 |
default: |
|
11184 |
break; |
|
11185 |
} |
|
11186 |
return fepMode; |
|
11187 |
} |
|
11188 |
||
11189 |
void CAknFepManager::LaunchHelpTextQueryL() |
|
11190 |
{ |
|
11191 |
TUid fepUid = CCoeEnv::Static()->FepUid(); |
|
11192 |
ClearExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
11193 |
iUiInterface->LaunchHelpTextQueryL(R_AKNFEP_HELP_TEXT); |
|
11194 |
PrepareFepAfterDialogExitL(fepUid); |
|
11195 |
} |
|
11196 |
||
11197 |
void CAknFepManager::UpdateEditorContext() const |
|
11198 |
{ |
|
11199 |
if(EditingStateIndicator()) |
|
11200 |
{ |
|
11201 |
iUiInterface->UpdateEditorContext(*EditingStateIndicator(), *FepUI()); |
|
11202 |
} |
|
11203 |
} |
|
11204 |
||
11205 |
TBool CAknFepManager::TextIsValidInEditor(const TDesC& aText) |
|
11206 |
{ |
|
11207 |
TBool ret = ETrue; |
|
11208 |
TUint length = aText.Length(); |
|
11209 |
TCoeInputCapabilities::MCoeFepSpecificExtensions* ipCapExt = |
|
11210 |
iInputCapabilities.FepSpecificExtensions(TUid::Uid(EAknFepUid)); |
|
11211 |
if (ipCapExt) |
|
11212 |
{ |
|
11213 |
while(length--) |
|
11214 |
{ |
|
11215 |
if (!ipCapExt->IsValidCharacter(aText[length])) |
|
11216 |
{ |
|
11217 |
ret = EFalse; |
|
11218 |
} |
|
11219 |
} |
|
11220 |
} |
|
11221 |
return ret; |
|
11222 |
} |
|
11223 |
||
11224 |
TBool CAknFepManager::CharIsValidInEditor(TChar aChar) |
|
11225 |
{ |
|
11226 |
TBool ret = ETrue; |
|
11227 |
TCoeInputCapabilities::MCoeFepSpecificExtensions* ipCapExt = |
|
11228 |
iInputCapabilities.FepSpecificExtensions(TUid::Uid(EAknFepUid)); |
|
11229 |
if (ipCapExt) |
|
11230 |
{ |
|
11231 |
if (!ipCapExt->IsValidCharacter(aChar)) |
|
11232 |
{ |
|
11233 |
ret = EFalse; |
|
11234 |
} |
|
11235 |
} |
|
11236 |
return ret; |
|
11237 |
} |
|
11238 |
||
11239 |
void CAknFepManager::SetCursorType(TChineseFepCursorType aType) |
|
11240 |
{ |
|
11241 |
TBool setToTrue = ETrue; |
|
11242 |
TTextCursor newCursor; |
|
11243 |
||
11244 |
newCursor.iType=TTextCursor::ETypeRectangle; |
|
11245 |
if (aType == EPassive) |
|
11246 |
{ |
|
11247 |
newCursor.iType=TTextCursor::ETypeHollowRectangle; |
|
11248 |
} |
|
11249 |
if ( IsFepAwareTextEditor() ) |
|
11250 |
{ |
|
11251 |
iInputCapabilities.FepAwareTextEditor()->Extension1()->SetCursorType(setToTrue, newCursor); |
|
11252 |
} |
|
11253 |
} |
|
11254 |
||
11255 |
MAknEditingStateIndicator* CAknFepManager::EditingStateIndicator() const |
|
11256 |
{ |
|
11257 |
MAknEditingStateIndicator* indicator = NULL; |
|
11258 |
||
11259 |
// First ask indicator from controls owning the editor. |
|
11260 |
// For example CAknQueryControl and CAknSearchField implement |
|
11261 |
// their own indicators. |
|
11262 |
||
11263 |
MObjectProvider* objectProvider = NULL; |
|
11264 |
||
11265 |
// First try through CAknEdwinState object. |
|
11266 |
// It exists with CEikEdwin-derived editors. |
|
11267 |
||
11268 |
MCoeFepAwareTextEditor* editor = NULL; |
|
11269 |
MCoeFepAwareTextEditor_Extension1* ext1 = NULL; |
|
11270 |
CAknEdwinState* state = NULL; |
|
11271 |
||
11272 |
editor = iInputCapabilities.FepAwareTextEditor(); |
|
11273 |
||
11274 |
if(editor) |
|
11275 |
ext1 = editor->Extension1() ; |
|
11276 |
if(ext1) |
|
11277 |
state = (CAknEdwinState*)ext1->State( KNullUid ) ; |
|
11278 |
||
11279 |
if ( IsFepAwareTextEditor() && ( editor ) && ( ext1) && ( state )) |
|
11280 |
{ |
|
11281 |
objectProvider = state->ObjectProvider(); |
|
11282 |
} |
|
11283 |
||
11284 |
// If not found, try to get object provider from input capabilities. |
|
11285 |
// It is set there with CEikMfne-derived editors. |
|
11286 |
||
11287 |
if ( !objectProvider ) |
|
11288 |
{ |
|
11289 |
objectProvider = iInputCapabilities.ObjectProvider(); |
|
11290 |
} |
|
11291 |
||
11292 |
if ( objectProvider ) |
|
11293 |
{ |
|
11294 |
indicator = objectProvider->MopGetObject( indicator ); |
|
11295 |
} |
|
11296 |
||
11297 |
// If no indicator was supplied, get one from CAknEnv. |
|
11298 |
// By default, this one is FEP's own indicator. |
|
11299 |
||
11300 |
if ( !indicator ) |
|
11301 |
{ |
|
11302 |
indicator = CAknEnv::Static()->EditingStateIndicator(); |
|
11303 |
if (indicator != iIndicator) |
|
11304 |
{ |
|
11305 |
CAknEnv::Static()->SwapEditingStateIndicator(iIndicator); |
|
11306 |
indicator = iIndicator; |
|
11307 |
} |
|
11308 |
} |
|
11309 |
||
11310 |
return indicator; |
|
11311 |
} |
|
11312 |
||
11313 |
TBool CAknFepManager::TryHandleArrowRightEventL(TInt aDokumentLength) |
|
11314 |
{ |
|
11315 |
TBool ret = EFalse; |
|
11316 |
TBool thai = (iLanguageCapabilities.iInputLanguageCode == ELangThai); |
|
11317 |
if ( iInputCapabilities.FepAwareTextEditor() && |
|
11318 |
(iSharedDataInterface->SpaceWithScrollRight() || thai ) && |
|
11319 |
(!(iAknEditorFlags & EAknEditorFlagNoLRNavigation)) && |
|
11320 |
iFepManState == EAknFepStateInitial && |
|
11321 |
(!IsFlagSet(EFlagInsideInlineEditingTransaction) ) && |
|
11322 |
(!IsFlagSet(EFlagShiftKeyDepressed)) && |
|
11323 |
iMode != EHiragana ) // Not supported in only Hiragana input mode |
|
11324 |
{ |
|
11325 |
TInt cursorPos = DocPos().iPos; |
|
11326 |
TCursorSelection cursorSel; |
|
11327 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(cursorSel); |
|
11328 |
if (( cursorPos == aDokumentLength) |
|
11329 |
&& !cursorSel.Length() |
|
11330 |
&& (IsFeatureSupportedJapanese() || (PreviousChar() != 0x0020)) ) |
|
11331 |
{ |
|
11332 |
// set to half-width space or full-width space by current input mode. |
|
11333 |
// 0x0020 is unicode for half-width space |
|
11334 |
// 0x3000 is unicode for full-width space |
|
11335 |
TUint code(0); |
|
11336 |
switch (iMode) |
|
11337 |
{ |
|
11338 |
case EHiraganaKanji: |
|
11339 |
code = 0x3000; |
|
11340 |
break; |
|
11341 |
case ELatin: |
|
11342 |
code = (!WesternPredictive() && iCharWidth == EFullWidthChar)? |
|
11343 |
0x3000 : 0x0020; |
|
11344 |
break; |
|
11345 |
case EHiragana: |
|
11346 |
// Not supported in only Hiragana input mode |
|
11347 |
break; |
|
11348 |
case EHangul: |
|
11349 |
code = 0x0020; |
|
11350 |
break; |
|
11351 |
case ENumber: |
|
11352 |
case ENativeNumber: |
|
11353 |
case EKatakana: |
|
11354 |
default: |
|
11355 |
code = (iCharWidth == EFullWidthChar)? 0x3000 : 0x0020; |
|
11356 |
break; |
|
11357 |
} |
|
11358 |
if (code) |
|
11359 |
{ |
|
11360 |
SimulateKeyEventL(code); // add a space |
|
11361 |
SimulateKeyEventL(EKeyF19); // Asyncronous case update |
|
11362 |
ret = ETrue; |
|
11363 |
} |
|
11364 |
} |
|
11365 |
} |
|
11366 |
return ret; |
|
11367 |
} |
|
11368 |
||
11369 |
TBool CAknFepManager::TryHandleArrowLeftEventL(TInt aDokumentLength) |
|
11370 |
{ |
|
11371 |
TBool ret = EFalse; |
|
11372 |
if (iInputCapabilities.FepAwareTextEditor() && |
|
11373 |
iSharedDataInterface->SpaceWithScrollRight() && |
|
11374 |
(!(iAknEditorFlags & EAknEditorFlagNoLRNavigation)) && |
|
11375 |
iFepManState == EAknFepStateInitial && |
|
11376 |
(!IsFlagSet(EFlagInsideInlineEditingTransaction) ) && |
|
11377 |
(!IsFlagSet(EFlagShiftKeyDepressed)) && |
|
11378 |
iMode != EHiragana ) // Not supported in only Hiragana input mode |
|
11379 |
{ |
|
11380 |
TInt cursorPos = DocPos().iPos; |
|
11381 |
TCursorSelection cursorSel; |
|
11382 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(cursorSel); |
|
11383 |
TText previousChar = PreviousChar(); |
|
11384 |
if (( cursorPos == aDokumentLength) |
|
11385 |
&& !cursorSel.Length() |
|
11386 |
&& (IsFeatureSupportedJapanese() |
|
11387 |
&& (previousChar == 0x3000 || previousChar == 0x0020) )) // full width or half-width space. |
|
11388 |
{ |
|
11389 |
SimulateKeyEventL(EKeyBackspace); |
|
11390 |
SimulateKeyEventL(EKeyF19); // Asyncronous case update |
|
11391 |
ret = ETrue; |
|
11392 |
} |
|
11393 |
} |
|
11394 |
return ret; |
|
11395 |
} |
|
11396 |
||
11397 |
TBool CAknFepManager::TryHandleArrowDownEventL(TInt aDokumentLength) |
|
11398 |
{ |
|
11399 |
TBool ret = EFalse; |
|
11400 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
11401 |
// Predictive QWERTY (XT9) changes ----> |
|
11402 |
if ( iWesternPredictive && |
|
11403 |
IsFlagSet(CAknFepManager::EFlagInsideInlineEditingTransaction) && !(iAknEditorFlags & EAknEditorFlagNoT9) |
|
11404 |
&& !IsFlagSet(EFlagInsideMultitapInlineEditingTransaction) && !IsFlagSet(EFlagNoMatches)) |
|
11405 |
{ |
|
11406 |
LaunchCandidatePopupListL(); |
|
11407 |
ret = ETrue; |
|
11408 |
} |
|
11409 |
// Predictive QWERTY (XT9) changes <---- |
|
11410 |
else |
|
11411 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
11412 |
if ( ( iAknEditorFlags & EAknEditorFlagAllowEntersWithScrollDown ) && |
|
11413 |
iInputCapabilities.FepAwareTextEditor() && |
|
11414 |
( iSharedDataInterface->EntersWithScrollDown() ) && |
|
11415 |
iFepManState == EAknFepStateInitial && |
|
11416 |
!IsFlagSet(EFlagInsideInlineEditingTransaction) && |
|
11417 |
!IsFlagSet(EFlagShiftKeyDepressed) ) |
|
11418 |
{ |
|
11419 |
TInt cursorPos = DocPos().iPos; |
|
11420 |
TCursorSelection cursorSel; |
|
11421 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(cursorSel); |
|
11422 |
if ( cursorPos == aDokumentLength && |
|
11423 |
!cursorSel.Length() ) |
|
11424 |
{ |
|
11425 |
SimulateKeyEventL(EKeyEnter); // add line feed |
|
11426 |
SimulateKeyEventL(EKeyF19); // Asyncronous case update |
|
11427 |
ret = ETrue; |
|
11428 |
} |
|
11429 |
} |
|
11430 |
return ret; |
|
11431 |
} |
|
11432 |
||
11433 |
TUint CAknFepManager::EditorModeFromFepMode(TInt aFepMode) |
|
11434 |
{ |
|
11435 |
TUint editorMode(aFepMode); |
|
11436 |
switch (aFepMode) |
|
11437 |
{ |
|
11438 |
case ELatin: |
|
11439 |
if (iPermittedInputModes & EAknEditorTextInputMode) |
|
11440 |
{ |
|
11441 |
editorMode = EAknEditorTextInputMode; |
|
11442 |
if (IsFeatureSupportedJapanese()) |
|
11443 |
{ |
|
11444 |
if (iCharWidth == EHalfWidthChar |
|
11445 |
&& (iPermittedInputModes & EAknEditorHalfWidthTextInputMode)) |
|
11446 |
{ |
|
11447 |
editorMode = EAknEditorHalfWidthTextInputMode; |
|
11448 |
} |
|
11449 |
else if (iCharWidth == EFullWidthChar |
|
11450 |
&& (iPermittedInputModes & EAknEditorFullWidthTextInputMode)) |
|
11451 |
{ |
|
11452 |
editorMode = EAknEditorFullWidthTextInputMode; |
|
11453 |
} |
|
11454 |
} |
|
11455 |
} |
|
11456 |
else if (iPermittedInputModes & EAknEditorHalfWidthTextInputMode) |
|
11457 |
{ |
|
11458 |
editorMode = EAknEditorTextInputMode; |
|
11459 |
if (IsFeatureSupportedJapanese()) |
|
11460 |
{ |
|
11461 |
editorMode = EAknEditorHalfWidthTextInputMode; |
|
11462 |
if (iCharWidth == EFullWidthChar |
|
11463 |
&&(iPermittedInputModes & EAknEditorFullWidthTextInputMode)) |
|
11464 |
{ |
|
11465 |
editorMode = EAknEditorFullWidthTextInputMode; |
|
11466 |
} |
|
11467 |
} |
|
11468 |
} |
|
11469 |
else if (iPermittedInputModes & EAknEditorFullWidthTextInputMode) |
|
11470 |
{ |
|
11471 |
editorMode = EAknEditorTextInputMode; |
|
11472 |
if (IsFeatureSupportedJapanese()) |
|
11473 |
{ |
|
11474 |
editorMode = EAknEditorFullWidthTextInputMode; |
|
11475 |
} |
|
11476 |
} |
|
11477 |
else |
|
11478 |
{ |
|
11479 |
editorMode = EAknEditorSecretAlphaInputMode; |
|
11480 |
} |
|
11481 |
break; |
|
11482 |
case ENumber: |
|
11483 |
case ENativeNumber: |
|
11484 |
editorMode = EAknEditorNumericInputMode; |
|
11485 |
if (iCharWidth == EFullWidthChar |
|
11486 |
&& (iPermittedInputModes & EAknEditorFullWidthNumericInputMode)) |
|
11487 |
{ |
|
11488 |
editorMode = EAknEditorFullWidthNumericInputMode; |
|
11489 |
} |
|
11490 |
break; |
|
11491 |
case EHangul: |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
11492 |
editorMode = EAknEditorTextInputMode; |
44 | 11493 |
break; |
11494 |
default: |
|
11495 |
if (IsFeatureSupportedJapanese()) |
|
11496 |
{ |
|
11497 |
editorMode = EditorMode(aFepMode, iCharWidth); |
|
11498 |
} |
|
11499 |
break; |
|
11500 |
} |
|
11501 |
return editorMode; |
|
11502 |
} |
|
11503 |
||
11504 |
CAknKeySoundSystem* CAknFepManager::SoundSystem() const |
|
11505 |
{ |
|
11506 |
CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
11507 |
if (coeEnv->AppUi()) |
|
11508 |
{ |
|
11509 |
return iAvkonAppUiBase->KeySounds(); |
|
11510 |
} |
|
11511 |
return NULL; |
|
11512 |
} |
|
11513 |
||
11514 |
void CAknFepManager::SetHashKeyStyle() |
|
11515 |
{ |
|
11516 |
CAknFepHashKeyManager::THashKeyStyle style = CAknFepHashKeyManager::EHashKeyStyleWestern; |
|
11517 |
||
11518 |
switch (iLanguageCapabilities.iInputLanguageCode) |
|
11519 |
{ |
|
11520 |
case ELangPrcChinese: |
|
11521 |
case ELangHongKongChinese: |
|
11522 |
case ELangTaiwanChinese: |
|
11523 |
style = CAknFepHashKeyManager::EHashKeyStyleChineseWithWestern; |
|
11524 |
break; |
|
11525 |
case ELangJapanese: |
|
11526 |
style = CAknFepHashKeyManager::EHashKeyStyleJapanese; |
|
11527 |
break; |
|
11528 |
case ELangKorean: |
|
11529 |
style = CAknFepHashKeyManager::EHashKeyStyleKoreanWithWestern; |
|
11530 |
break; |
|
11531 |
default: |
|
11532 |
break; |
|
11533 |
} |
|
11534 |
||
11535 |
iHashKeyMan->SetHashKeyStyle( style ); |
|
11536 |
} |
|
11537 |
||
11538 |
void CAknFepManager::ReadHashKeyLoopL() |
|
11539 |
{ |
|
11540 |
iHashKeyLoop.Reset(); |
|
11541 |
||
11542 |
CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
11543 |
TResourceReader reader; |
|
11544 |
coeEnv->CreateResourceReaderLC(reader, R_HASH_KEY_LOOP_ALL_INPUT_MODES); |
|
11545 |
||
11546 |
iVariantPermittedModes = 0; |
|
11547 |
const TInt count = reader.ReadInt16(); |
|
11548 |
for (TInt ii=0; ii<count; ii++) |
|
11549 |
{ |
|
11550 |
TInt mode = reader.ReadInt32(); |
|
11551 |
if ( IsInputModeAvailable(mode) ) |
|
11552 |
{ |
|
11553 |
if ( mode == EPRCFind) |
|
11554 |
{ |
|
11555 |
mode = ELatin; |
|
11556 |
} |
|
11557 |
iHashKeyLoop.Append(mode); |
|
11558 |
iVariantPermittedModes |= mode; |
|
11559 |
} |
|
11560 |
} |
|
11561 |
CleanupStack::PopAndDestroy(); //reader |
|
11562 |
} |
|
11563 |
||
11564 |
TBool CAknFepManager::IsValidInLineCharacter(TChar aCharacter) const |
|
11565 |
{ |
|
11566 |
TBool validInlineCharacter = ETrue; |
|
11567 |
TChar::TCategory category = aCharacter.GetCategory(); |
|
11568 |
TChar::TBdCategory bdCategory = aCharacter.GetBdCategory(); |
|
11569 |
switch (iLanguageCapabilities.iInputLanguageCode) |
|
11570 |
{ |
|
11571 |
case ELangArabic: |
|
11572 |
{ |
|
11573 |
// Needs more specific category |
|
11574 |
validInlineCharacter = ( (category & TChar::ELetterOtherGroup) && |
|
11575 |
(bdCategory == TChar::ERightToLeftArabic) ); |
|
11576 |
break; |
|
11577 |
} |
|
11578 |
case ELangHebrew: |
|
11579 |
{ |
|
11580 |
// Needs more specific category |
|
11581 |
validInlineCharacter = ( (category & TChar::ELetterOtherGroup) && |
|
11582 |
(bdCategory == TChar::ERightToLeft) ); |
|
11583 |
break; |
|
11584 |
} |
|
11585 |
case ELangFarsi: |
|
11586 |
case ELangUrdu: |
|
11587 |
{ |
|
11588 |
// Needs more specific category |
|
11589 |
validInlineCharacter = ( (category & TChar::ELetterOtherGroup) && |
|
11590 |
(bdCategory == TChar::ERightToLeftArabic) ); |
|
11591 |
break; |
|
11592 |
} |
|
11593 |
/*Hindi*/ |
|
11594 |
case ELangHindi: |
|
11595 |
#ifdef RD_MARATHI |
|
11596 |
/* Same for Marathi */ |
|
11597 |
case ELangMarathi: |
|
11598 |
#endif |
|
11599 |
{ |
|
11600 |
// Needs more specific category |
|
11601 |
validInlineCharacter = IsValidInlineIndicCharacter(aCharacter); |
|
11602 |
||
11603 |
break; |
|
11604 |
} |
|
11605 |
case ELangVietnamese: |
|
11606 |
{ |
|
11607 |
// For full screen qwerty, validInlineCharacter is true |
|
11608 |
if( !( iFepPluginManager && iFepPluginManager->EnableITIOnFSQ() ) ) |
|
11609 |
{ |
|
11610 |
validInlineCharacter = (aCharacter.IsAlpha() && |
|
11611 |
!((category & TChar::ELetterOtherGroup))) || |
|
11612 |
((category == TChar::EMarkGroup) && |
|
11613 |
(bdCategory == TChar::ENonSpacingMark)); |
|
11614 |
} |
|
11615 |
break; |
|
11616 |
} |
|
11617 |
case ELangThai: |
|
11618 |
{ |
|
11619 |
validInlineCharacter = (!(aCharacter.IsSpace() || (aCharacter == 0x2029))) && |
|
11620 |
((aCharacter.IsAlpha() && |
|
11621 |
!(category & TChar::ELetterOtherGroup)) || |
|
11622 |
((category & TChar::EMarkGroup) && |
|
11623 |
(bdCategory == TChar::ENonSpacingMark)) || |
|
11624 |
((category & TChar::ELetterModifierGroup) && |
|
11625 |
(bdCategory == TChar::ELeftToRight)) || |
|
11626 |
((category & TChar::ESeparatorGroup ) && |
|
11627 |
(bdCategory == TChar::EWhitespace))|| |
|
11628 |
((category & TChar::EMcCategory) && |
|
11629 |
(bdCategory == TChar::ELeftToRight))); |
|
11630 |
break; |
|
11631 |
} |
|
11632 |
case ELangTaiwanChinese: |
|
11633 |
case ELangHongKongChinese: |
|
11634 |
case ELangPrcChinese: |
|
11635 |
case ELangEnglish: |
|
11636 |
{ |
|
11637 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
11638 |
// for qwerty special characters should not break the word |
|
11639 |
if( iQwertyInputMode && ( KeyboardLayout() !=EPtiKeyboardHalfQwerty )) |
|
11640 |
{ |
|
11641 |
validInlineCharacter = (!( aCharacter.IsSpace() || (aCharacter == 0x2029) || |
|
11642 |
( aCharacter.IsAlpha() && |
|
11643 |
(category & TChar::ELetterOtherGroup))|| |
|
11644 |
((category & TChar::EMarkGroup) && |
|
11645 |
(bdCategory == TChar::ENonSpacingMark)) || |
|
11646 |
((category & TChar::ELetterModifierGroup) && |
|
11647 |
(bdCategory == TChar::ELeftToRight)) || |
|
11648 |
((category & TChar::ESeparatorGroup ) && |
|
11649 |
(bdCategory == TChar::EWhitespace)))); |
|
11650 |
} |
|
11651 |
else |
|
11652 |
#endif // whereas for ITUT and Half Qwerty they should |
|
11653 |
{ |
|
11654 |
validInlineCharacter = ( aCharacter.IsAlpha() && !(category & TChar::ELetterOtherGroup) ); |
|
11655 |
} |
|
11656 |
break; |
|
11657 |
} |
|
11658 |
default: |
|
11659 |
{ |
|
11660 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
11661 |
// for qwerty special characters should not break the word |
|
11662 |
||
11663 |
if( iQwertyInputMode && ( KeyboardLayout() !=EPtiKeyboardHalfQwerty ) ) |
|
11664 |
{ |
|
11665 |
validInlineCharacter = (!(aCharacter.IsSpace() || (aCharacter == 0x2029))); |
|
11666 |
} |
|
11667 |
else |
|
11668 |
#endif // whereas for ITUT and Half Qwerty they should |
|
11669 |
{ |
|
11670 |
validInlineCharacter = ( aCharacter.IsAlpha() && !(category & TChar::ELetterOtherGroup) ); |
|
11671 |
} |
|
11672 |
||
11673 |
||
11674 |
break; |
|
11675 |
} |
|
11676 |
} |
|
11677 |
||
11678 |
TUint16 key = 0; |
|
11679 |
if(validInlineCharacter) |
|
11680 |
{ |
|
11681 |
validInlineCharacter = EFalse; |
|
11682 |
ConvertCharToKey(aCharacter, key); |
|
11683 |
if(0 != key) |
|
11684 |
{ |
|
11685 |
validInlineCharacter = ETrue; |
|
11686 |
} |
|
11687 |
} |
|
11688 |
||
11689 |
return validInlineCharacter; |
|
11690 |
} |
|
11691 |
TBool CAknFepManager::IsValidInlineIndicCharacter(TChar aCharacter) const |
|
11692 |
{ |
|
11693 |
TBool validInlineCharacter = ETrue; |
|
11694 |
TChar::TCategory category = aCharacter.GetCategory(); |
|
11695 |
TChar::TBdCategory bdCategory = aCharacter.GetBdCategory(); |
|
11696 |
||
11697 |
if(!((category == TChar::EPoCategory) || aCharacter == 0x0950 || aCharacter == 0x093D)) |
|
11698 |
{ |
|
11699 |
validInlineCharacter = ((( (category & TChar::ELetterOtherGroup) |
|
11700 |
&& (bdCategory == TChar::ELeftToRight) ) |
|
11701 |
||( (category & TChar::EMcCategory) |
|
11702 |
&& (bdCategory == TChar::ELeftToRight) ) |
|
11703 |
||( (category & TChar::EMarkGroup) |
|
11704 |
&& (bdCategory == TChar::ENonSpacingMark)) ) |
|
11705 |
&&( ! ( aCharacter.IsAlpha() |
|
11706 |
&& !(category & TChar::ELetterOtherGroup) ))); |
|
11707 |
} |
|
11708 |
else |
|
11709 |
{ |
|
11710 |
validInlineCharacter = EFalse; |
|
11711 |
} |
|
11712 |
return validInlineCharacter; |
|
11713 |
} |
|
11714 |
||
11715 |
TInt CAknFepManager::WordConcatenationTimerTimeoutCallback(TAny* aObj) |
|
11716 |
{ |
|
11717 |
TRAPD(err, static_cast<CAknFepManager*>(aObj)->WordConcatenationTimerTimeoutL()); |
|
11718 |
if (err) |
|
11719 |
{ |
|
11720 |
static_cast<CAknFepManager*>(aObj)->CleanUpFep(); |
|
11721 |
return KErrNoMemory; |
|
11722 |
} |
|
11723 |
return KErrNone; |
|
11724 |
} |
|
11725 |
||
11726 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
11727 |
||
11728 |
TBool CAknFepManager::IsHybridAplhaEditor() const |
|
11729 |
{ |
|
11730 |
TBool phoneIdle = (EditorType() == CAknExtendedInputCapabilities::EHybridAlphaNumericEditor); |
|
11731 |
return phoneIdle; |
|
11732 |
} |
|
11733 |
||
11734 |
TBool CAknFepManager::IsHybridAlphaModeChangedtoAplhanumeric() const |
|
11735 |
{ |
|
11736 |
return iHybridAplphaChangedToAlphanumeric; |
|
11737 |
} |
|
11738 |
||
11739 |
TBool CAknFepManager::IsPhoneNumberEditor() const |
|
11740 |
{ |
|
11741 |
TBool phoneEditor = (EditorType() == CAknExtendedInputCapabilities::EPhoneNumberEditor); |
|
11742 |
return phoneEditor; |
|
11743 |
} |
|
11744 |
CAknFepFnKeyManager::TFnKeyState CAknFepManager::FnKeyState() |
|
11745 |
{ |
|
11746 |
return iFnKeyManager->FnKeyState(); |
|
11747 |
} |
|
11748 |
void CAknFepManager::SetFnKeyState(CAknFepFnKeyManager::TFnKeyState aState) |
|
11749 |
{ |
|
11750 |
iFnKeyManager->SetFnKeyState(aState); |
|
11751 |
} |
|
11752 |
#ifdef __REVERSE_FN_KEY_SUPPORTED |
|
11753 |
TBool CAknFepManager::IsReverseFnkeyInput() |
|
11754 |
{ |
|
11755 |
return iIsReverseFnkeyInput; |
|
11756 |
} |
|
11757 |
void CAknFepManager::SetReverseFnkeyInputMode(TBool iIsOn) |
|
11758 |
{ |
|
11759 |
iIsReverseFnkeyInput = iIsOn; |
|
11760 |
} |
|
11761 |
TBool CAknFepManager::IsValidCharInNumericEditorL( TChar aChar ) const |
|
11762 |
{ |
|
11763 |
if(!EditorState()) |
|
11764 |
{ |
|
11765 |
return EFalse; |
|
11766 |
} |
|
11767 |
TBool validChar = EFalse; |
|
11768 |
if( aChar.IsDigit() ) |
|
11769 |
{ |
|
11770 |
return ETrue; |
|
11771 |
} |
|
11772 |
TBool phoneIdle = (EditorType() == CAknExtendedInputCapabilities::EPhoneNumberEditor); |
|
11773 |
if( (phoneIdle || (IsHybridAplhaEditor() && !IsHybridAlphaModeChangedtoAplhanumeric())) |
|
11774 |
&& aChar == '#') |
|
11775 |
{ |
|
11776 |
return ETrue; |
|
11777 |
} |
|
11778 |
if( aChar == '.' && EAknEditorConverterNumberModeKeymap == iAknEditorNumericKeymap) |
|
11779 |
{ |
|
11780 |
return ETrue; |
|
11781 |
} |
|
11782 |
if( IsAllowedKeymappingForNumberMode(aChar) ) |
|
11783 |
{ |
|
11784 |
return ETrue; |
|
11785 |
} |
|
11786 |
||
11787 |
TInt resourceSCTId = EditorState()->SpecialCharacterTableResourceId(); |
|
11788 |
// No SCT table use default SCT |
|
11789 |
if( resourceSCTId == KErrNotFound || !resourceSCTId || |
|
11790 |
(IsHybridAplhaEditor()&& !IsHybridAlphaModeChangedtoAplhanumeric())) |
|
11791 |
{ |
|
11792 |
resourceSCTId = NumericModeSCTResourceId(); |
|
11793 |
} |
|
11794 |
||
11795 |
if( resourceSCTId ) |
|
11796 |
{ |
|
11797 |
TResourceReader reader; |
|
11798 |
CEikonEnv::Static()->CreateResourceReaderLC(reader,resourceSCTId); |
|
11799 |
reader.ReadInt32(); // skip sct id |
|
11800 |
TPtrC chars=reader.ReadTPtrC(); // read special char |
|
11801 |
validChar = ( chars.Locate(aChar)>=0 ); |
|
11802 |
CleanupStack::PopAndDestroy(); |
|
11803 |
} |
|
11804 |
return validChar; |
|
11805 |
||
11806 |
} |
|
11807 |
TInt CAknFepManager::GetNumericSCTResID() |
|
11808 |
{ |
|
11809 |
if(!EditorState()) |
|
11810 |
{ |
|
11811 |
return NumericModeSCTResourceId(); |
|
11812 |
} |
|
11813 |
TInt resourceSCTId = EditorState()->SpecialCharacterTableResourceId(); |
|
11814 |
if(resourceSCTId == KErrNotFound || !resourceSCTId ) |
|
11815 |
{ |
|
11816 |
resourceSCTId = NumericModeSCTResourceId(); |
|
11817 |
} |
|
11818 |
return resourceSCTId; |
|
11819 |
} |
|
11820 |
||
11821 |
TBool CAknFepManager::IsValidCharForNumericInFnReverseL(TInt aKey, TPtiTextCase aCase) |
|
11822 |
{ |
|
11823 |
if(!EditorState()) |
|
11824 |
{ |
|
11825 |
return EFalse; |
|
11826 |
} |
|
11827 |
TBuf<32> keyMaps; |
|
11828 |
iPtiEngine->MappingDataForKey( (TPtiKey)aKey, keyMaps, aCase); |
|
11829 |
||
11830 |
TBool validKey(EFalse); |
|
11831 |
if( keyMaps.Length()<= 0 ) |
|
11832 |
{ |
|
11833 |
return validKey; |
|
11834 |
} |
|
11835 |
TChar chr =keyMaps[0]; |
|
11836 |
if( chr.IsDigit() ) |
|
11837 |
{ |
|
11838 |
return ETrue; |
|
11839 |
} |
|
11840 |
||
11841 |
TInt resourceSCTId = EditorState()->SpecialCharacterTableResourceId(); |
|
11842 |
// No SCT table use default SCT |
|
11843 |
if( resourceSCTId == KErrNotFound || !resourceSCTId ) |
|
11844 |
{ |
|
11845 |
resourceSCTId = NumericModeSCTResourceId(); |
|
11846 |
} |
|
11847 |
||
11848 |
if( resourceSCTId ) |
|
11849 |
{ |
|
11850 |
TResourceReader reader; |
|
11851 |
CEikonEnv::Static()->CreateResourceReaderLC(reader,resourceSCTId); |
|
11852 |
reader.ReadInt32(); // skip sct id |
|
11853 |
TPtrC chars=reader.ReadTPtrC(); // read special char |
|
11854 |
||
11855 |
validKey = (chars.Locate(chr)>=0 ); |
|
11856 |
if(chr.IsAlpha()) |
|
11857 |
{ |
|
11858 |
chr.UpperCase(); |
|
11859 |
validKey |= (chars.Locate(chr)>=0 ) ; |
|
11860 |
} |
|
11861 |
||
11862 |
CleanupStack::PopAndDestroy(); |
|
11863 |
} |
|
11864 |
||
11865 |
return validKey; |
|
11866 |
||
11867 |
} |
|
11868 |
#endif //__REVERSE_FN_KEY_SUPPORTED |
|
11869 |
void CAknFepManager::AddOneSpaceOrMoveCursorL() |
|
11870 |
{ |
|
11871 |
if(static_cast<TChar>(NextChar()).IsSpace()) |
|
11872 |
{ |
|
11873 |
TCursorSelection sel; |
|
11874 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(sel); |
|
11875 |
sel.iCursorPos++; |
|
11876 |
sel.iAnchorPos++; |
|
11877 |
iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(sel); |
|
11878 |
} |
|
11879 |
else if(IsEditorHasFreeSpace()) |
|
11880 |
{ |
|
11881 |
SimulateKeyEventL(EKeySpace); |
|
11882 |
} |
|
11883 |
SimulateKeyEventL(EKeyF19); |
|
11884 |
} |
|
11885 |
#endif |
|
11886 |
TBool CAknFepManager::IsOnlyNumericPermitted() const |
|
11887 |
{ |
|
11888 |
if (IsFeatureSupportedJapanese()) |
|
11889 |
{ |
|
11890 |
return !(iPermittedInputModes & ~(EAknEditorNumericInputMode |
|
11891 |
| EAknEditorFullWidthNumericInputMode) ); |
|
11892 |
} |
|
11893 |
else |
|
11894 |
{ |
|
11895 |
// Only non-japanese modes are considered. |
|
11896 |
return !( iPermittedInputModes & |
|
11897 |
(EAknEditorTextInputMode | EAknEditorSecretAlphaInputMode) ); |
|
11898 |
} |
|
11899 |
} |
|
11900 |
||
11901 |
void CAknFepManager::TryIncrementModeL(TInt aCurrentMode) |
|
11902 |
{ |
|
11903 |
//check that we are currently in the correct mode |
|
11904 |
__ASSERT_DEBUG(IsModePermitted(iMode), |
|
11905 |
AknFepPanic(EAknFepPanicNonPermittedEditorMode)); |
|
11906 |
__ASSERT_DEBUG(iInputCapabilities.FepAwareTextEditor(), |
|
11907 |
AknFepPanic(EAknFepPanicNoHandleToFepAwareTextEditor)); |
|
11908 |
||
11909 |
const TInt lastModePos = iHashKeyLoop.Count()-1 ; |
|
11910 |
const TInt currentModePos = iHashKeyLoop.Find(aCurrentMode); |
|
11911 |
TInt newModePos = currentModePos; |
|
11912 |
||
11913 |
__ASSERT_DEBUG(currentModePos != KErrNotFound , |
|
11914 |
AknFepPanic(EAknFepPanicNonPermittedEditorMode)); |
|
11915 |
||
11916 |
do { |
|
11917 |
if (newModePos == lastModePos) |
|
11918 |
{ |
|
11919 |
//we've got to the end of the hash key loop, go back to the beginning |
|
11920 |
newModePos = 0; |
|
11921 |
} |
|
11922 |
else |
|
11923 |
{ |
|
11924 |
newModePos++; |
|
11925 |
} |
|
11926 |
||
11927 |
if (TryChangeModeL(iHashKeyLoop[newModePos])) |
|
11928 |
{ |
|
11929 |
return; //succeeded to move to next available mode |
|
11930 |
} |
|
11931 |
} |
|
11932 |
while (newModePos != currentModePos); |
|
11933 |
} |
|
11934 |
||
11935 |
void CAknFepManager::TryIncrementModeChineseQwertyL(TInt aCurrentMode) |
|
11936 |
{ |
|
11937 |
__ASSERT_DEBUG(IsModePermitted(aCurrentMode),AknFepPanic(EAknFepPanicNonPermittedEditorMode)); |
|
11938 |
||
11939 |
const TInt lastModePos = iHashKeyLoop.Count() - 1 ; |
|
11940 |
const TInt currentModePos = iHashKeyLoop.Find(aCurrentMode); |
|
11941 |
TInt newModePos = currentModePos; |
|
11942 |
||
11943 |
__ASSERT_DEBUG(currentModePos != KErrNotFound , |
|
11944 |
AknFepPanic(EAknFepPanicNonPermittedEditorMode)); |
|
11945 |
||
11946 |
do |
|
11947 |
{ |
|
11948 |
if (newModePos == lastModePos) |
|
11949 |
{ |
|
11950 |
//we've got to the end of the hash key loop, go back to the beginning |
|
11951 |
newModePos = 0; |
|
11952 |
} |
|
11953 |
else |
|
11954 |
{ |
|
11955 |
newModePos++; |
|
11956 |
} |
|
11957 |
}while(iHashKeyLoop[newModePos] == ENumber && !IsOnlyNumericPermitted()); // no number mode in Chinese qwerty input, except those editors which only support number |
|
11958 |
||
11959 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
11960 |
if(TryChangeModeL(iHashKeyLoop[newModePos])) |
|
11961 |
{ |
|
11962 |
return; //succeeded to move to next available mode |
|
11963 |
} |
|
11964 |
} |
|
11965 |
||
11966 |
void CAknFepManager::TryIncrementChineseModeForQwertyL( TInt aCurrentMode ) |
|
11967 |
{ |
|
11968 |
__ASSERT_DEBUG(IsModePermitted(aCurrentMode),AknFepPanic(EAknFepPanicNonPermittedEditorMode)); |
|
11969 |
||
11970 |
const TInt lastModePos = iHashKeyLoop.Count() - 1; |
|
11971 |
const TInt currentModePos = iHashKeyLoop.Find( aCurrentMode ); |
|
11972 |
TInt newModePos = currentModePos; |
|
11973 |
||
11974 |
__ASSERT_DEBUG(currentModePos != KErrNotFound , |
|
11975 |
AknFepPanic(EAknFepPanicNonPermittedEditorMode)); |
|
11976 |
||
11977 |
do |
|
11978 |
{ |
|
11979 |
if ( newModePos == lastModePos ) |
|
11980 |
{ |
|
11981 |
//we've got to the end of the hash key loop, go back to the beginning |
|
11982 |
newModePos = 0; |
|
11983 |
} |
|
11984 |
else |
|
11985 |
{ |
|
11986 |
newModePos++; |
|
11987 |
} |
|
11988 |
} |
|
11989 |
while ( (iHashKeyLoop[newModePos] == ENumber |
|
11990 |
&& !IsOnlyNumericPermitted()) || (iHashKeyLoop[newModePos] == ELatin |
|
11991 |
&& IsChangeModeByShiftAndSpace() ) ); // no number mode and latin in Chinese qwerty input, except those editors which only support number |
|
11992 |
||
11993 |
SendEventsToPluginManL( EPluginCloseMode, EFalse ); |
|
11994 |
if ( TryChangeModeL( iHashKeyLoop[newModePos] ) ) |
|
11995 |
{ |
|
11996 |
return; //succeeded to move to next available mode |
|
11997 |
} |
|
11998 |
} |
|
11999 |
||
12000 |
void CAknFepManager::TryChangeToSharedDataModeL() |
|
12001 |
{ |
|
12002 |
TInt sharedDataMode = iSharedDataInterface->InputMode(); |
|
12003 |
TryChangeModeL(sharedDataMode); |
|
12004 |
} |
|
12005 |
||
12006 |
void CAknFepManager::TryChangeToModeBeforeL() |
|
12007 |
{ |
|
12008 |
if (TryChangeModeL(iModeBefore)) |
|
12009 |
{ |
|
12010 |
if (iModeBefore==ELatin) |
|
12011 |
{ |
|
12012 |
if ( iCaseBefore ) |
|
12013 |
{ |
|
12014 |
iCaseMan->SetCurrentCase(iCaseBefore); |
|
12015 |
} |
|
12016 |
else |
|
12017 |
{ |
|
12018 |
iCaseMan->UpdateCase(ENullNaviEvent); |
|
12019 |
} |
|
12020 |
} |
|
12021 |
} |
|
12022 |
} |
|
12023 |
||
12024 |
#ifdef RD_HINDI_PHONETIC_INPUT |
|
12025 |
||
12026 |
TBool CAknFepManager::IsIndicPhoneticInputLanguage() const |
|
12027 |
{ |
|
12028 |
MPtiLanguage* ptilang = iPtiEngine->CurrentLanguage(); |
|
12029 |
TInt currentPtiLang = (ptilang)? ptilang->LanguageCode() : 0; |
|
12030 |
return (TAknFepUiIndicInputManager::IsIndicPhoneticLanguage(TLanguage(currentPtiLang))); |
|
12031 |
} |
|
12032 |
||
12033 |
void CAknFepManager::TryChangePhoneticModeL() |
|
12034 |
{ |
|
12035 |
MPtiLanguage* ptilang = iPtiEngine->CurrentLanguage(); |
|
12036 |
TInt currentPtiLang = (ptilang)? ptilang->LanguageCode() : 0; |
|
12037 |
TInt lang = 0; |
|
12038 |
||
12039 |
(TAknFepUiIndicInputManager :: IsIndicPhoneticLanguage(TLanguage(currentPtiLang)))? |
|
12040 |
lang = ELangEnglish : lang = iLanguageCapabilities.iInputLanguageCode; |
|
12041 |
||
12042 |
iPtiEngine->ActivateLanguageL(lang); |
|
12043 |
iLangMan->SetInputLanguageL(lang); |
|
12044 |
InternalFepUI()->SetMode(iMode, EFalse, iQwertyInputMode); |
|
12045 |
iCaseMan->UpdateCase(ENullNaviEvent); |
|
12046 |
UpdateIndicators(); |
|
12047 |
CommitInlineEditL(); |
|
12048 |
} |
|
12049 |
||
12050 |
TInt CAknFepManager::SetPhoneticIndicator(TLanguage aInputLanguage) |
|
12051 |
{ |
|
12052 |
TInt newState = 0; |
|
12053 |
TInt currentCase = iCaseMan->CurrentCase(); |
|
12054 |
||
12055 |
switch(aInputLanguage) |
|
12056 |
{ |
|
12057 |
case KLangHindiPhonetic: |
|
12058 |
if(currentCase == EAknEditorUpperCase) |
|
12059 |
{ |
|
12060 |
newState = EIndicatorStateHindiPhoneticUpper; |
|
12061 |
} |
|
12062 |
else |
|
12063 |
{ |
|
12064 |
newState = EIndicatorStateHindiPhoneticLower; |
|
12065 |
} |
|
12066 |
break; |
|
12067 |
default: |
|
12068 |
break; |
|
12069 |
} |
|
12070 |
return newState; |
|
12071 |
} |
|
12072 |
#endif |
|
12073 |
TBool CAknFepManager::TryChangeModeL(TInt aMode) |
|
12074 |
{ |
|
12075 |
CAknEdwinState* editorState = EditorState(); |
|
12076 |
TInt sharedDataMode = iSharedDataInterface->InputMode(); |
|
12077 |
||
12078 |
if (aMode == EStroke && iQwertyInputMode && sharedDataMode == ECangJie) |
|
12079 |
{ |
|
12080 |
iEditorStateStrokeUsed = editorState; |
|
12081 |
iStrokeUsedInQWERTY = ETrue; |
|
12082 |
} |
|
12083 |
else if (iEditorStateStrokeUsed == editorState) |
|
12084 |
{ |
|
12085 |
iStrokeUsedInQWERTY = EFalse; |
|
12086 |
} |
|
12087 |
||
12088 |
if (aMode == ECangJie && !iQwertyInputMode && |
|
12089 |
(iFepPluginManager->PluginInputMode() != EPluginInputModeVkb |
|
12090 |
|| iFepPluginManager->PluginInputMode() != EPluginInputModeFSQ)) |
|
12091 |
{ |
|
12092 |
aMode = EStroke; |
|
12093 |
} |
|
12094 |
||
12095 |
if (aMode == ELatinText ||aMode == ELatinUpper || aMode == ELatinLower) |
|
12096 |
{ |
|
12097 |
if (TryChangeModeL(ELatin)) |
|
12098 |
{ |
|
12099 |
if ( !(iAknEditorFlags & EAknEditorFlagFixedCase) ) |
|
12100 |
{ |
|
12101 |
if (aMode == ELatinText) |
|
12102 |
{ |
|
12103 |
ClearFlag(EFlagSupressAutoUpdate); |
|
12104 |
} |
|
12105 |
else if (aMode == ELatinUpper) |
|
12106 |
{ |
|
12107 |
//Modify for allow text case after entering a dot and space |
|
12108 |
ClearFlag(EFlagSupressAutoUpdate); |
|
12109 |
//Modify for allow text case after entering a dot and space |
|
12110 |
iCaseMan->SetCurrentCase(EAknEditorUpperCase); |
|
12111 |
} |
|
12112 |
else //lower |
|
12113 |
{ |
|
12114 |
//Modify for allow text case after entering a dot and space |
|
12115 |
ClearFlag(EFlagSupressAutoUpdate); |
|
12116 |
//Modify for allow text case after entering a dot and space |
|
12117 |
iCaseMan->SetCurrentCase(EAknEditorLowerCase); |
|
12118 |
} |
|
12119 |
UpdateIndicators(); |
|
12120 |
} |
|
12121 |
return ETrue; |
|
12122 |
} |
|
12123 |
return EFalse; |
|
12124 |
} |
|
12125 |
||
12126 |
if ( iQwertyInputMode && ( aMode == ENumber || aMode == ENativeNumber ) && |
|
12127 |
!IsOnlyNumericPermitted() |
|
12128 |
// Add this condition to exclude all touch inputmethods. |
|
12129 |
// When change to number range on touch inputmethods, fn key state can't be locked. |
|
12130 |
&& iFepPluginManager |
|
12131 |
&& iFepPluginManager->PluginInputMode() == EPluginInputModeNone ) |
|
12132 |
{ |
|
12133 |
if (TryChangeModeL(ELatin)) |
|
12134 |
{ |
|
12135 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
12136 |
// If editor should be launched in FnLock state, because in case of QWERTY keypad |
|
12137 |
// Current numeric mode converted to alphanumeric mode. |
|
12138 |
if( iFnKeyManager ) |
|
12139 |
{ |
|
12140 |
iFnKeyManager->SetFnKeyState(CAknFepFnKeyManager::EFnKeyLock); |
|
12141 |
SetCase((TCase)EFnKeyLowerCase); |
|
12142 |
} |
|
12143 |
#endif // RD_INTELLIGENT_TEXT_INPUT |
|
12144 |
return ETrue; |
|
12145 |
} |
|
12146 |
} |
|
12147 |
||
12148 |
if (IsModePermitted(aMode)) |
|
12149 |
{ |
|
12150 |
if (aMode == ELatin) |
|
12151 |
{ |
|
12152 |
if (iAknEditorFlags & EAknEditorFlagNoT9) |
|
12153 |
{ |
|
12154 |
SetWesternPredictive(EFalse); |
|
12155 |
} |
|
12156 |
||
12157 |
if (iAknEditorFlags & EAknEditorFlagFixedCase) |
|
12158 |
{ |
|
12159 |
iCaseMan->ConfigureCaseStateFromEditorState(); |
|
12160 |
} |
|
12161 |
} |
|
12162 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
12163 |
if (!iQwertyInputMode && WesternPredictive() && iFepManState == EAknFepStateUIActive) |
|
12164 |
#else |
|
12165 |
if (WesternPredictive() && iFepManState == EAknFepStateUIActive) |
|
12166 |
#endif |
|
12167 |
{ |
|
12168 |
TryRemoveNoMatchesIndicatorL(); |
|
12169 |
UpdateCbaL(NULL); |
|
12170 |
} |
|
12171 |
TryCloseUiL(); |
|
12172 |
||
12173 |
// getting a new ui manager object corresponded in aMode. |
|
12174 |
MAknFepManagerInterface* fepUI = iLangMan->GetFepUI(aMode, iCharWidth, |
|
12175 |
IsPredictive(aMode)); |
|
12176 |
// getting the currect language id from ptiengine. |
|
12177 |
MPtiLanguage* ptilang = iPtiEngine->CurrentLanguage(); |
|
12178 |
TInt currentPtiLang = (ptilang)? ptilang->LanguageCode() : 0; |
|
12179 |
// getting the supported language id in current ui manager. |
|
12180 |
TInt currentUiLang = fepUI->SupportLanguage(aMode); |
|
12181 |
||
12182 |
// changing language id both ptiengine and ui manager |
|
12183 |
// 1. check the currect ui manager for input mode |
|
12184 |
// 2. check the current ptiengine and ui manager |
|
12185 |
if (iCurrentFepUI != fepUI |
|
12186 |
|| currentPtiLang != currentUiLang) |
|
12187 |
{ |
|
12188 |
iCurrentFepUI = fepUI; |
|
12189 |
TInt err = iPtiEngine->ActivateLanguageL(currentUiLang); |
|
12190 |
if (err != KErrNone) |
|
12191 |
{ |
|
12192 |
#ifdef _DEBUG |
|
12193 |
RDebug::Print(_L("ActivateLanguageL error return code=[%d] language id=[%d]"), |
|
12194 |
err, iLanguageCapabilities.iInputLanguageCode); |
|
12195 |
#endif |
|
12196 |
ChangeInputLanguageL(ELangEnglish); |
|
12197 |
return ETrue; |
|
12198 |
} |
|
12199 |
} |
|
12200 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
12201 |
#ifdef FF_DUAL_LANGUAGE_SUPPORT |
|
12202 |
// Change secondary input |
|
12203 |
iPtiEngine->SetSecondaryInputL(iSharedDataInterface->InputTextLanguageSecondary()); |
|
12204 |
#endif //FF_DUAL_LANGUAGE_SUPPORT |
|
12205 |
#endif |
|
12206 |
||
12207 |
//#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
12208 |
TBuf<50> mapData; |
|
12209 |
//Init Data |
|
12210 |
for (TInt i = 0; i < 50; i++) |
|
12211 |
{ |
|
12212 |
mapData.Append(0); |
|
12213 |
} |
|
12214 |
||
12215 |
//Backup original input mode |
|
12216 |
TPtiEngineInputMode oriMode = iPtiEngine->InputMode(); |
|
12217 |
||
12218 |
//Change current input mode, since MappingDataForKey I/F only worked |
|
12219 |
//when in EPtiEngineMultitapping mode |
|
12220 |
iPtiEngine->SetInputMode(EPtiEngineMultitapping); |
|
12221 |
iPtiEngine->MappingDataForKey(EPtiKey1, mapData, iPtiEngine->Case()); |
|
12222 |
||
12223 |
//Restore |
|
12224 |
iPtiEngine->SetInputMode(oriMode); |
|
12225 |
||
12226 |
//Get first three symbols |
|
12227 |
if(mapData.Length() > 0) |
|
12228 |
{ |
|
12229 |
iSymbolData.iSymbol1 = mapData[0]; |
|
12230 |
||
12231 |
if (mapData.Length() > 1) |
|
12232 |
iSymbolData.iSymbol2 = mapData[1]; |
|
12233 |
if (mapData.Length() > 2) |
|
12234 |
iSymbolData.iSymbol3 = mapData[2]; |
|
12235 |
} |
|
12236 |
||
12237 |
//Write data to stream |
|
12238 |
if (iFepPluginManager && iFepPluginManager->CurrentPluginInputFepUI()) |
|
12239 |
{ |
|
12240 |
iFepPluginManager->CurrentPluginInputFepUI()->HandleCommandL( |
|
12241 |
ECmdPenInputSymbolOfHardKeyOne, reinterpret_cast<TInt>(&iSymbolData)); |
|
12242 |
} |
|
12243 |
//#endif |
|
12244 |
iMode = aMode; |
|
12245 |
||
12246 |
#ifdef RD_SCALABLE_UI_V2 |
|
12247 |
if ( IsChineseInputMode( aMode ) ) |
|
12248 |
{ |
|
12249 |
iLastChineseInputMode = aMode; |
|
12250 |
} |
|
12251 |
#endif // RD_SCALABLE_UI_V2 |
|
12252 |
if(iMode == ENumber || iMode == ENativeNumber ) |
|
12253 |
{ |
|
12254 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
12255 |
ClearFlag(CAknFepManager::EFlagNewSharedDataInputLanguage); |
|
12256 |
ClearFlag(CAknFepManager::EFlagNewSharedDataInputMode); |
|
12257 |
#endif // RD_INTELLIGENT_TEXT_INPUT |
|
12258 |
InternalFepUI()->SetNumberModeKeyMappingL(iAknEditorNumericKeymap); |
|
12259 |
} |
|
12260 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
12261 |
InternalFepUI()->SetMode(iMode, IsPredictive(), iQwertyInputMode, KeyboardLayout()); |
|
12262 |
#else |
|
12263 |
InternalFepUI()->SetMode(iMode, IsPredictive(), iQwertyInputMode); |
|
12264 |
#endif |
|
12265 |
iHashKeyMan->SetMode(iMode, IsPredictive()); |
|
12266 |
// ensure editor is aware of new fep mode |
|
12267 |
TCursorSelection curSel; |
|
12268 |
if ( IsFepAwareTextEditor() ) |
|
12269 |
{ |
|
12270 |
EditorState()->SetCurrentInputMode(EditorModeFromFepMode(aMode)); |
|
12271 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(curSel); |
|
12272 |
AdjustCursorTypeForCurrentPosition(); |
|
12273 |
} |
|
12274 |
||
12275 |
// when cursor is in between two words and SCT is launched and |
|
12276 |
// cancel key is pressed, dont move the cursor at the end of |
|
12277 |
// second word. |
|
12278 |
if (WesternPredictive(aMode) && !curSel.Length() |
|
12279 |
&& CursorInsideWord() && !IsCcpuFlagSet(ECcpuStateSupressCursorMoveToEnd) |
|
12280 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
12281 |
&& (!iSupressCursorMoveToEndChrKeyPressed) |
|
12282 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
12283 |
) |
|
12284 |
{ |
|
12285 |
MoveCursorToEndOfWordL(); |
|
12286 |
} |
|
12287 |
else |
|
12288 |
{ |
|
12289 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
12290 |
iSupressCursorMoveToEndChrKeyPressed = EFalse; |
|
12291 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
12292 |
ClearCcpuFlag(ECcpuStateSupressCursorMoveToEnd); |
|
12293 |
} |
|
12294 |
||
12295 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
12296 |
// Ensure that autocompletion state is updated |
|
12297 |
if (WesternPredictive()) |
|
12298 |
{ |
|
12299 |
SetAutoCompletionState(iSharedDataInterface->PredictiveTextAutoCompleteOn()); |
|
12300 |
} |
|
12301 |
#endif |
|
12302 |
// Set multitap timer to PtiEngine for Japanese variant only |
|
12303 |
if (IsFeatureSupportedJapanese()) |
|
12304 |
{ |
|
12305 |
TInt timeout = (iInputCapabilities.SupportsSecretText())? |
|
12306 |
KSyncPasswdTimeout : iMultiTapTimer; |
|
12307 |
iPtiEngine->HandleCommandL(EPtiCommandSetMultitapTimer, &timeout); |
|
12308 |
iPtiEngine->HandleCommandL(EPtiCommandSetJapaneseQwertyFlags, &iJapaneseQwertyFlags); |
|
12309 |
TInt clear = iSharedDataInterface->ClearDirection(); |
|
12310 |
iPtiEngine->HandleCommandL(EPtiCommandSetClearFunction, &clear); |
|
12311 |
// Send PtiEngine the command whether Pictograph is allowed in Candidate list |
|
12312 |
TInt allow = IsAbleToLaunchPCT(); |
|
12313 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
12314 |
iPtiEngine->HandleCommandL(EPtiCommandAllowPictographCandidate, &allow); |
|
12315 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
12316 |
} |
|
12317 |
||
12318 |
UpdateIndicators(); // moved to bottom to avoid extra indicator updates |
|
12319 |
||
12320 |
return ETrue; |
|
12321 |
} |
|
12322 |
return EFalse; |
|
12323 |
} |
|
12324 |
||
12325 |
void CAknFepManager::ChangeInputLanguageL(TInt aInputLanguage) |
|
12326 |
{ |
|
12327 |
if(iLangMan) |
|
12328 |
{ |
|
12329 |
iLangMan->SetInputLanguageL(aInputLanguage); |
|
12330 |
||
12331 |
SetInputLanguageCapabilities(aInputLanguage); |
|
12332 |
||
12333 |
ReadHashKeyLoopL(); |
|
12334 |
// we need to make sure that we commit the word to ptiengine, |
|
12335 |
// so that the word gets added to the UWD |
|
12336 |
SetCcpuFlag(ECcpuStataCommitPredictiveWord); |
|
12337 |
// Addition for ITI on FSQ |
|
12338 |
// When FSQ is opened with the ITI-supported input language, |
|
12339 |
// if switch to another language which doesn't support ITI, such as Korean, |
|
12340 |
// need to restore the previous configuration on FEP |
|
12341 |
if ( iFepPluginManager && !iFepPluginManager->IsSupportITIOnFSQ() ) |
|
12342 |
{ |
|
12343 |
iFepPluginManager->ResetItiStateL(); |
|
12344 |
} |
|
12345 |
if ( !TryChangeModeL(NewInputModeAfterLanguageChange()) ) |
|
12346 |
{ |
|
12347 |
if ( !TryChangeModeL(ELatin) ) |
|
12348 |
{ |
|
12349 |
// If the editor does not support text input mode, we try number mode. |
|
12350 |
if( IsInputModeAvailable(ENativeNumber) && |
|
12351 |
( iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic || |
|
12352 |
iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic || |
|
12353 |
iLanguageCapabilities.iLocalDigitType == EDigitTypeDevanagari ) ) |
|
12354 |
{ |
|
12355 |
TryChangeModeL(ENativeNumber);; |
|
12356 |
} |
|
12357 |
else |
|
12358 |
{ |
|
12359 |
TryChangeModeL(ENumber); |
|
12360 |
} |
|
12361 |
} |
|
12362 |
} |
|
12363 |
||
12364 |
if (!iLanguageCapabilities.iLocalInputLanguageInUse) |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
12365 |
{ |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
12366 |
switch (iSharedDataInterface->InputTextLanguage()) |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
12367 |
{ |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
12368 |
case ELangPrcChinese: |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
12369 |
{ |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
12370 |
iSharedDataInterface->SetInputMode(EPinyin); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
12371 |
SetFlag(EFlagNewSharedDataInputMode); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
12372 |
break; |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
12373 |
} |
44 | 12374 |
case ELangTaiwanChinese: |
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
12375 |
{ |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
12376 |
iSharedDataInterface->SetInputMode(EZhuyin); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
12377 |
SetFlag(EFlagNewSharedDataInputMode); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
12378 |
break; |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
12379 |
} |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
12380 |
case ELangHongKongChinese: |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
12381 |
{ |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
12382 |
iSharedDataInterface->SetInputMode(EStroke); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
12383 |
iSharedDataInterface->SetCangJieMode(ECangJieNormal); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
12384 |
SetFlag(EFlagNewSharedDataInputMode); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
12385 |
break; |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
12386 |
} |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
12387 |
default: |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
12388 |
break; |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
12389 |
} |
44 | 12390 |
} |
12391 |
||
12392 |
SetHashKeyStyle(); |
|
12393 |
UpdateEditorContext(); |
|
12394 |
} |
|
12395 |
//add notify to phrase creation udbmanagement view |
|
12396 |
||
12397 |
if(iUserdbdlg) |
|
12398 |
{ |
|
12399 |
iUserdbdlg->OnChangeLanguageL( aInputLanguage ); |
|
12400 |
if ( aInputLanguage != ELangPrcChinese && |
|
12401 |
aInputLanguage != ELangTaiwanChinese && |
|
12402 |
aInputLanguage != ELangHongKongChinese ) |
|
12403 |
{ |
|
12404 |
iUserdbdlg = NULL; |
|
12405 |
} |
|
12406 |
} |
|
12407 |
} |
|
12408 |
||
12409 |
void CAknFepManager::RemovePreviousCharacterL() |
|
12410 |
{ |
|
12411 |
if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
12412 |
{ |
|
12413 |
CommitInlineEditL(); |
|
12414 |
} |
|
12415 |
||
12416 |
// Set cursor span on previous character |
|
12417 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
12418 |
if (iUncommittedText.iAnchorPos > 0) |
|
12419 |
{ |
|
12420 |
iUncommittedText.iAnchorPos--; |
|
12421 |
} |
|
12422 |
||
12423 |
||
12424 |
// get text to replace |
|
12425 |
TBuf<ESingleCharacter> charToReplace; |
|
12426 |
iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(charToReplace, |
|
12427 |
iUncommittedText.iAnchorPos, |
|
12428 |
ESingleCharacter); |
|
12429 |
||
12430 |
// delete the character with an inline edit |
|
12431 |
StartInlineEditL(iUncommittedText, charToReplace, ESingleCharacter, EFalse); |
|
12432 |
UpdateInlineEditL(KNullDesC, 0); |
|
12433 |
CommitInlineEditL(); |
|
12434 |
} |
|
12435 |
||
12436 |
void CAknFepManager::RemoveZWSCharacterL( TBool aIsViramaInputted, |
|
12437 |
TBool aIsInMultitappingHalant, |
|
12438 |
TBool aIsCharModifier, |
|
12439 |
TBool aIsLigaturePresent /*= EFalse*/) |
|
12440 |
{ |
|
12441 |
CTextLayout* textLayout = TextLayout(); |
|
12442 |
MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
12443 |
if(!textLayout && !docNavi) |
|
12444 |
return; |
|
12445 |
||
12446 |
if( aIsLigaturePresent ) |
|
12447 |
{ |
|
12448 |
TTmDocPosSpec pos = DocPos(); |
|
12449 |
TTmPosInfo2 info; |
|
12450 |
TTmLineInfo lineInfo; |
|
12451 |
if (docNavi) |
|
12452 |
{ |
|
12453 |
docNavi->FindDocPos(pos, info, lineInfo); |
|
12454 |
} |
|
12455 |
else |
|
12456 |
{ |
|
12457 |
textLayout->TagmaTextLayout().FindDocPos(pos, info, lineInfo); |
|
12458 |
} |
|
12459 |
||
12460 |
if( IsZWSCharacterPresent( ETrue ) ) |
|
12461 |
{ |
|
12462 |
TInt commitPoint = pos.iPos - 2; |
|
12463 |
if( IsFlagSet( EFlagInsideInlineEditingTransaction ) ) |
|
12464 |
{ |
|
12465 |
CommitInlineEditL(); |
|
12466 |
} |
|
12467 |
||
12468 |
TCursorSelection sel( commitPoint, commitPoint ); |
|
12469 |
iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(sel); |
|
12470 |
} |
|
12471 |
} |
|
12472 |
else |
|
12473 |
{ |
|
12474 |
if ( IsFlagSet(EFlagInsideInlineEditingTransaction) && IsZWSCharacterPresent()) |
|
12475 |
{ |
|
12476 |
CommitInlineEditL(); |
|
12477 |
} |
|
12478 |
} |
|
12479 |
||
12480 |
TTmDocPosSpec pos = DocPos(); |
|
12481 |
pos.iType = TTmDocPosSpec::ETrailing; |
|
12482 |
TTmPosInfo2 info; |
|
12483 |
TTmLineInfo lineInfo; |
|
12484 |
if ( ! iInputCapabilities.SupportsSecretText() ) |
|
12485 |
{ |
|
12486 |
if (docNavi) |
|
12487 |
{ |
|
12488 |
docNavi->FindDocPos(pos, info, lineInfo); |
|
12489 |
} |
|
12490 |
else |
|
12491 |
{ |
|
12492 |
textLayout->TagmaTextLayout().FindDocPos(pos, info, lineInfo); |
|
12493 |
} |
|
12494 |
TBuf<2> previousCharacter; |
|
12495 |
TBuf<1> zwsPrevChar; |
|
12496 |
previousCharacter.FillZ(); |
|
12497 |
zwsPrevChar.FillZ(); |
|
12498 |
TBool found = EFalse; |
|
12499 |
||
12500 |
TCursorSelection curSel; |
|
12501 |
if ( IsFepAwareTextEditor() ) |
|
12502 |
{ |
|
12503 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(curSel); |
|
12504 |
TInt lowerpos = curSel.LowerPos(); |
|
12505 |
if( lowerpos > 0) |
|
12506 |
{ |
|
12507 |
if(lowerpos > 1) |
|
12508 |
iInputCapabilities.FepAwareTextEditor()-> |
|
12509 |
GetEditorContentForFep(previousCharacter, lowerpos - 2, 2); |
|
12510 |
else |
|
12511 |
iInputCapabilities.FepAwareTextEditor()-> |
|
12512 |
GetEditorContentForFep(previousCharacter, lowerpos - 1, 1); |
|
12513 |
||
12514 |
if( lowerpos > 1 ) |
|
12515 |
{ |
|
12516 |
if(previousCharacter[1] == ZERO_WIDTH_SPACE) |
|
12517 |
{ |
|
12518 |
zwsPrevChar.Append(previousCharacter[1]); |
|
12519 |
if( aIsInMultitappingHalant ) |
|
12520 |
{ |
|
12521 |
curSel.iAnchorPos = lowerpos - 2; |
|
12522 |
} |
|
12523 |
else |
|
12524 |
{ |
|
12525 |
curSel.iAnchorPos = lowerpos - 1; |
|
12526 |
} |
|
12527 |
found = ETrue; |
|
12528 |
} |
|
12529 |
else if( previousCharacter[0] == ZERO_WIDTH_SPACE ) |
|
12530 |
{ |
|
12531 |
zwsPrevChar.Append(previousCharacter[0]); |
|
12532 |
curSel.iAnchorPos = lowerpos - 2; |
|
12533 |
curSel.iCursorPos = lowerpos - 1; |
|
12534 |
found = ETrue; |
|
12535 |
} |
|
12536 |
} |
|
12537 |
else |
|
12538 |
{ |
|
12539 |
if(previousCharacter[0] == ZERO_WIDTH_SPACE) |
|
12540 |
{ |
|
12541 |
zwsPrevChar.Append(previousCharacter[0]); |
|
12542 |
if( aIsInMultitappingHalant ) |
|
12543 |
{ |
|
12544 |
curSel.iAnchorPos = lowerpos - 2; |
|
12545 |
} |
|
12546 |
else |
|
12547 |
{ |
|
12548 |
curSel.iAnchorPos = lowerpos - 1; |
|
12549 |
} |
|
12550 |
found = ETrue; |
|
12551 |
} |
|
12552 |
} |
|
12553 |
||
12554 |
} |
|
12555 |
} |
|
12556 |
if( found ) |
|
12557 |
{ |
|
12558 |
StartInlineEditL(curSel, zwsPrevChar, ESingleCharacter, ETrue); |
|
12559 |
UpdateInlineEditL(KNullDesC, 0); |
|
12560 |
CommitInlineEditL(); |
|
12561 |
if ( !aIsInMultitappingHalant && ! iInputCapabilities.SupportsSecretText() ) |
|
12562 |
{ |
|
12563 |
if ( aIsViramaInputted ) |
|
12564 |
{ |
|
12565 |
TTmDocPosSpec pos = DocPos(); |
|
12566 |
TTmPosInfo2 infotemp; |
|
12567 |
if (docNavi) |
|
12568 |
{ |
|
12569 |
docNavi->FindDocPos(pos, info, lineInfo); |
|
12570 |
} |
|
12571 |
else |
|
12572 |
{ |
|
12573 |
textLayout->TagmaTextLayout().FindDocPos(pos, info, lineInfo); |
|
12574 |
} |
|
12575 |
if(NextChar() && TAknFepUiIndicInputManager::IsCharBaseConsonant(NextChar(), |
|
12576 |
TLanguage(iLanguageCapabilities.iInputLanguageCode))) |
|
12577 |
{ |
|
12578 |
TInt nextPos; |
|
12579 |
if (docNavi) |
|
12580 |
{ |
|
12581 |
nextPos = docNavi->FindNextPos(pos.iPos); |
|
12582 |
} |
|
12583 |
else |
|
12584 |
{ |
|
12585 |
nextPos = textLayout->TagmaTextLayout().FindNextPos(pos.iPos); |
|
12586 |
} |
|
12587 |
info.iDocPos.iPos = nextPos; |
|
12588 |
} |
|
12589 |
else if((TAknFepUiIndicInputManager::IsCharAnVowel(NextChar(), |
|
12590 |
TLanguage(iLanguageCapabilities.iInputLanguageCode))) |
|
12591 |
&&(aIsCharModifier && TAknFepUiIndicInputManager::IsCharVirama( |
|
12592 |
PreviousChar(), TLanguage(iLanguageCapabilities.iInputLanguageCode)))) |
|
12593 |
{ |
|
12594 |
bool posFound; |
|
12595 |
if (docNavi) |
|
12596 |
{ |
|
12597 |
posFound = docNavi->GetNextVisualCursorPos(pos, infotemp, EFalse); |
|
12598 |
} |
|
12599 |
else |
|
12600 |
{ |
|
12601 |
posFound = textLayout->TagmaTextLayout().GetNextVisualCursorPos(pos, |
|
12602 |
infotemp, |
|
12603 |
EFalse); |
|
12604 |
} |
|
12605 |
||
12606 |
if (posFound) |
|
12607 |
{ |
|
12608 |
info.iDocPos.iPos = infotemp.iDocPos.iPos; |
|
12609 |
} |
|
12610 |
} |
|
12611 |
TCursorSelection sel(info.iDocPos.iPos ,info.iDocPos.iPos ); |
|
12612 |
iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(sel); |
|
12613 |
} |
|
12614 |
else |
|
12615 |
{ |
|
12616 |
TCursorSelection sel(info.iDocPos.iPos - 1,info.iDocPos.iPos - 1); |
|
12617 |
iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(sel); |
|
12618 |
} |
|
12619 |
||
12620 |
SendEventsToPluginManL( EPluginSyncFepAwareText ); |
|
12621 |
} |
|
12622 |
} |
|
12623 |
} |
|
12624 |
} |
|
12625 |
||
12626 |
void CAknFepManager::TryChangePredictiveInputModeL(TBool aFlag) |
|
12627 |
{ |
|
12628 |
if(Japanese() && iMode != ELatin) |
|
12629 |
{ |
|
12630 |
if(aFlag) |
|
12631 |
{ |
|
12632 |
if (!(iAknEditorFlags & EAknEditorFlagNoT9) |
|
12633 |
&& HasJapanesePredictionInputMode()) |
|
12634 |
{ |
|
12635 |
iJapanesePredictive = aFlag; |
|
12636 |
iSharedDataInterface->SetJapanesePredictiveTextOn(); |
|
12637 |
} |
|
12638 |
} |
|
12639 |
else |
|
12640 |
{ |
|
12641 |
iJapanesePredictive = aFlag; |
|
12642 |
iSharedDataInterface->ResetJapanesePredictiveTextOn(); |
|
12643 |
} |
|
12644 |
} |
|
12645 |
else |
|
12646 |
{ |
|
12647 |
SetWesternPredictive(aFlag); |
|
12648 |
} |
|
12649 |
TryChangeModeL(iMode); |
|
12650 |
} |
|
12651 |
||
12652 |
MCoeFepAwareTextEditor* CAknFepManager::FepAwareTextEditor() const |
|
12653 |
{ |
|
12654 |
return iInputCapabilities.FepAwareTextEditor(); |
|
12655 |
} |
|
12656 |
||
12657 |
TBool CAknFepManager::IsFepAwareTextEditor() const |
|
12658 |
{ |
|
12659 |
#ifdef RD_SCALABLE_UI_V2 |
|
12660 |
return FullyFepAwareTextEditor(); |
|
12661 |
#else |
|
12662 |
return ( iInputCapabilities.FepAwareTextEditor() ? ETrue : EFalse ); |
|
12663 |
#endif |
|
12664 |
} |
|
12665 |
||
12666 |
TCursorSelection CAknFepManager::UncommittedText() const |
|
12667 |
{ |
|
12668 |
return iUncommittedText; |
|
12669 |
} |
|
12670 |
||
12671 |
void CAknFepManager::SetCase(TCase aCase) |
|
12672 |
{ |
|
12673 |
// For QWERTY only keypad, extended input state like FnLock is applicable. |
|
12674 |
// In case of ITU-T keypad, this flag should not be part of editor flag. |
|
12675 |
// In case of numeric only editor Only FnReverse state is valid and editor will be on EFnReverse |
|
12676 |
// State if FnKey is hold on state. |
|
12677 |
||
12678 |
//TODO: In case of other functionized input state like (FnNext), it should be stored in editor |
|
12679 |
||
12680 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
12681 |
if(EditorState()) |
|
12682 |
{ |
|
12683 |
if( iFnKeyManager && ( iFnKeyManager->FnKeyState()== CAknFepFnKeyManager::EFnKeyLock ) ) |
|
12684 |
{ |
|
12685 |
EditorState()->SetFlags( EditorState()->Flags() | EAknEditorFlagFnLock ); |
|
12686 |
} |
|
12687 |
else |
|
12688 |
{ |
|
12689 |
EditorState()->SetFlags( EditorState()->Flags() & ~EAknEditorFlagFnLock ); |
|
12690 |
} |
|
12691 |
} |
|
12692 |
#endif |
|
12693 |
||
12694 |
InternalFepUI()->SetCase(aCase); |
|
12695 |
} |
|
12696 |
||
12697 |
CAknEdwinState* CAknFepManager::EditorState() const |
|
12698 |
{ |
|
12699 |
if ( IsFepAwareTextEditor() ) |
|
12700 |
{ |
|
12701 |
MCoeFepAwareTextEditor* fepAvareTextEditor = iInputCapabilities.FepAwareTextEditor(); |
|
12702 |
||
12703 |
if ( fepAvareTextEditor && fepAvareTextEditor->Extension1() ) |
|
12704 |
{ |
|
12705 |
return static_cast<CAknEdwinState*>( fepAvareTextEditor->Extension1()->State( KNullUid ) ); |
|
12706 |
} |
|
12707 |
} |
|
12708 |
return NULL; |
|
12709 |
} |
|
12710 |
||
12711 |
void CAknFepManager::SetPredictiveIndicatorState(TAknEditingState& aState) |
|
12712 |
{ |
|
12713 |
||
12714 |
TInt currentCase = iCaseMan->CurrentCase(); |
|
12715 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
12716 |
if(iIsAutoCompleteOn && iLanguageCapabilities.iInputLanguageCode != ELangThai) |
|
12717 |
{ |
|
12718 |
if (iLanguageCapabilities.iInputLanguageCode == ELangArabic) |
|
12719 |
aState=EAutoCompleteArabic; |
|
12720 |
||
12721 |
else if (iLanguageCapabilities.iInputLanguageCode == ELangHebrew) |
|
12722 |
aState=EAutoCompleteHebrew; |
|
12723 |
||
12724 |
else if (iLanguageCapabilities.iInputLanguageCode == ELangFarsi || |
|
12725 |
iLanguageCapabilities.iInputLanguageCode == ELangUrdu) |
|
12726 |
aState=EAutoCompleteFarsiAndUrdu; |
|
12727 |
/*Hindi*/ |
|
12728 |
else if ( (iLanguageCapabilities.iInputLanguageCode == ELangHindi) || (iLanguageCapabilities.iInputLanguageCode == ELangMarathi)) |
|
12729 |
aState = EAutoCompleteHindi; |
|
12730 |
||
12731 |
else if(iLanguageCapabilities.iInputLanguageCode == ELangVietnamese) |
|
12732 |
{ |
|
12733 |
switch (currentCase) |
|
12734 |
{ |
|
12735 |
case EAknEditorUpperCase: |
|
12736 |
aState = EAutoCompleteUpperVietnamese; |
|
12737 |
break; |
|
12738 |
case EAknEditorLowerCase: |
|
12739 |
aState = EAutoCompleteLowerVietnamese; |
|
12740 |
break; |
|
12741 |
case EAknEditorTextCase: |
|
12742 |
aState = EAutoCompleteShiftedVietnamese; |
|
12743 |
break; |
|
12744 |
default: |
|
12745 |
break; |
|
12746 |
} |
|
12747 |
} |
|
12748 |
else |
|
12749 |
{ |
|
12750 |
switch (currentCase) |
|
12751 |
{ |
|
12752 |
case EAknEditorUpperCase: |
|
12753 |
aState = EAutoCompleteUpper; |
|
12754 |
break; |
|
12755 |
case EAknEditorLowerCase: |
|
12756 |
aState = EAutoCompleteLower; |
|
12757 |
break; |
|
12758 |
case EAknEditorTextCase: |
|
12759 |
aState = EAutoCompleteShifted; |
|
12760 |
break; |
|
12761 |
default: |
|
12762 |
break; |
|
12763 |
} |
|
12764 |
} |
|
12765 |
||
12766 |
} |
|
12767 |
else |
|
12768 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
12769 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
12770 |
if(iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyNone) |
|
12771 |
{ |
|
12772 |
aState = EFnKeyPressed; |
|
12773 |
if(iFnKeyManager->FnKeyState() == CAknFepFnKeyManager::EFnKeyLock) |
|
12774 |
aState = EFnKeyLocked; |
|
12775 |
} |
|
12776 |
else |
|
12777 |
#endif |
|
12778 |
{ |
|
12779 |
if (iLanguageCapabilities.iInputLanguageCode == ELangArabic) |
|
12780 |
aState = ET9Arabic; |
|
12781 |
||
12782 |
else if (iLanguageCapabilities.iInputLanguageCode == ELangHebrew) |
|
12783 |
aState = ET9Hebrew; |
|
12784 |
||
12785 |
else if (iLanguageCapabilities.iInputLanguageCode == ELangFarsi || |
|
12786 |
iLanguageCapabilities.iInputLanguageCode == ELangUrdu) |
|
12787 |
aState = ET9FarsiAndUrdu; |
|
12788 |
||
12789 |
else if (iLanguageCapabilities.iInputLanguageCode == ELangThai) |
|
12790 |
aState = ET9Thai; |
|
12791 |
||
12792 |
/*Hindi*/ |
|
12793 |
#ifdef RD_MARATHI |
|
12794 |
/*Marathi*/ |
|
12795 |
else if ( iLanguageCapabilities.iInputLanguageCode == ELangMarathi ) |
|
12796 |
aState = EIndicatorStatePredictiveMarathi; |
|
12797 |
#endif // RD_MARATHI |
|
12798 |
||
12799 |
else if(iLanguageCapabilities.iInputLanguageCode == ELangVietnamese) |
|
12800 |
{ |
|
12801 |
switch (currentCase) |
|
12802 |
{ |
|
12803 |
case EAknEditorUpperCase: |
|
12804 |
aState = ET9UpperVietnamese; |
|
12805 |
break; |
|
12806 |
case EAknEditorLowerCase: |
|
12807 |
aState = ET9LowerVietnamese; |
|
12808 |
break; |
|
12809 |
case EAknEditorTextCase: |
|
12810 |
aState = ET9ShiftedVietnamese; |
|
12811 |
break; |
|
12812 |
default: |
|
12813 |
break; |
|
12814 |
} |
|
12815 |
} |
|
12816 |
||
12817 |
else if(iLanguageCapabilities.iInputLanguageCode == ELangGreek) |
|
12818 |
{ |
|
12819 |
switch (currentCase) |
|
12820 |
{ |
|
12821 |
case EAknEditorUpperCase: |
|
12822 |
aState = ET9UpperGreek; |
|
12823 |
break; |
|
12824 |
case EAknEditorLowerCase: |
|
12825 |
aState = ET9LowerGreek; |
|
12826 |
break; |
|
12827 |
case EAknEditorTextCase: |
|
12828 |
aState = ET9ShiftedGreek; |
|
12829 |
break; |
|
12830 |
default: |
|
12831 |
break; |
|
12832 |
} |
|
12833 |
} |
|
12834 |
||
12835 |
//Cyrillic alphabet is used for Russian, Bulgarian and |
|
12836 |
//Ukranian languages |
|
12837 |
else if(iLanguageCapabilities.iInputLanguageCode == ELangRussian || |
|
12838 |
iLanguageCapabilities.iInputLanguageCode == ELangBulgarian || |
|
12839 |
iLanguageCapabilities.iInputLanguageCode == ELangUkrainian ) |
|
12840 |
{ |
|
12841 |
switch (currentCase) |
|
12842 |
{ |
|
12843 |
case EAknEditorUpperCase: |
|
12844 |
aState = ET9UpperCyrillic; |
|
12845 |
break; |
|
12846 |
case EAknEditorLowerCase: |
|
12847 |
aState = ET9LowerCyrillic; |
|
12848 |
break; |
|
12849 |
case EAknEditorTextCase: |
|
12850 |
aState = ET9ShiftedCyrillic; |
|
12851 |
break; |
|
12852 |
default: |
|
12853 |
break; |
|
12854 |
} |
|
12855 |
} |
|
12856 |
else |
|
12857 |
{ |
|
12858 |
switch (currentCase) |
|
12859 |
{ |
|
12860 |
case EAknEditorUpperCase: |
|
12861 |
aState = ET9Upper; |
|
12862 |
break; |
|
12863 |
case EAknEditorLowerCase: |
|
12864 |
aState = ET9Lower; |
|
12865 |
break; |
|
12866 |
case EAknEditorTextCase: |
|
12867 |
aState = ET9Shifted; |
|
12868 |
break; |
|
12869 |
default: |
|
12870 |
break; |
|
12871 |
} |
|
12872 |
} |
|
12873 |
||
12874 |
} |
|
12875 |
} |
|
12876 |
void CAknFepManager::UpdateIndicators() |
|
12877 |
{ |
|
12878 |
if(ELongKeyPress == iKeyRepeat) |
|
12879 |
return; |
|
12880 |
// If it is fepware editor update the Indicators |
|
12881 |
// otherwise not need excute remainig part of code. |
|
12882 |
if( !iInputCapabilities.FepAwareTextEditor() || !iFepFullyConstructed ) |
|
12883 |
{ |
|
12884 |
//Ensure, If no idicator is require, make indicator state None |
|
12885 |
if (!IsFlagSet(EFlagForegroundUIComponentVisible | EFlagMenuPaneVisible)) |
|
12886 |
iIndicator->SetState(EStateNone); |
|
12887 |
return; |
|
12888 |
} |
|
12889 |
||
12890 |
TAknEditingState newState = EStateNone; |
|
12891 |
MPtiLanguage* ptiLang = PtiEngine()->CurrentLanguage(); |
|
12892 |
MAknEditingStateIndicator* editingStateIndicator = EditingStateIndicator(); |
|
12893 |
||
12894 |
TBool findPaneIndicator( |
|
12895 |
iAknEditorFlags & EAknEditorFlagNoEditIndicators && |
|
12896 |
iAknEditorFlags & EAknEditorFlagForceTransparentFepModes && |
|
12897 |
editingStateIndicator != (MAknEditingStateIndicator*)iIndicator ); |
|
12898 |
||
12899 |
#ifdef RD_SCALABLE_UI_V2 |
|
12900 |
TBool fingerItutIndicator = ( iFepPluginManager && |
|
12901 |
iFepPluginManager->PluginInputMode() == EPluginInputModeItut ); |
|
12902 |
// Portrait FSQ is added. |
|
12903 |
TBool fingerFSQIndicator = ( iFepPluginManager && |
|
12904 |
( iFepPluginManager->PluginInputMode() == EPluginInputModeFSQ || |
|
12905 |
iFepPluginManager->PluginInputMode() == EPluginInputModePortraitFSQ ) ); |
|
12906 |
#else |
|
12907 |
TBool fingerItutIndicator = EFalse; |
|
12908 |
TBool fingerFSQIndicator = EFalse; |
|
12909 |
||
12910 |
#endif |
|
12911 |
if ( IsHybridAplhaEditor() && !iHybridAplphaChangedToAlphanumeric ) |
|
12912 |
{ |
|
12913 |
newState = EHybridModeLatin; |
|
12914 |
} |
|
12915 |
//else if (!(iAknEditorFlags & EAknEditorFlagNoEditIndicators) |
|
12916 |
// || findPaneIndicator || fingerItutIndicator) |
|
12917 |
else if (!(iAknEditorFlags & EAknEditorFlagNoEditIndicators) |
|
12918 |
|| findPaneIndicator || fingerItutIndicator || fingerFSQIndicator) |
|
12919 |
{ |
|
12920 |
||
12921 |
#ifdef RD_SCALABLE_UI_V2 |
|
12922 |
if ( ( IsFlagSet(EFlagQwertyShiftMode) || IsFlagSet(EFlagLongShiftKeyPress)) && |
|
12923 |
((iFepPluginManager && iFepPluginManager->PluginInputMode() == EPluginInputModeVkb) || |
|
12924 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
12925 |
iQwertyInputMode |
|
12926 |
#else |
|
12927 |
( iQwertyInputMode && (IsFlagSet(EFlagQwertyShiftMode) ||IsFlagSet(EFlagLongShiftKeyPress)) |
|
12928 |
&& (iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyNext) |
|
12929 |
&& (iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyLock) |
|
12930 |
&& (iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyForced) |
|
12931 |
) |
|
12932 |
#endif |
|
12933 |
)) |
|
12934 |
#else |
|
12935 |
if ( iQwertyInputMode && IsFlagSet(EFlagQwertyShiftMode)) |
|
12936 |
||
12937 |
#endif |
|
12938 |
{ |
|
12939 |
newState = EQwertyShift; |
|
12940 |
||
12941 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
12942 |
// To keep the shift key indicator in |
|
12943 |
// Check if fn/shift both key are pressed |
|
12944 |
if((iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyNone) && |
|
12945 |
(IsFlagSet(EFlagQwertyShiftMode) || IsFlagSet(EFlagLongShiftKeyPress))) |
|
12946 |
{ |
|
12947 |
newState = EFnKeyPressed; |
|
12948 |
} |
|
12949 |
#endif |
|
12950 |
||
12951 |
} |
|
12952 |
else |
|
12953 |
{ |
|
12954 |
switch (iMode) |
|
12955 |
{ |
|
12956 |
case EHiraganaKanji: |
|
12957 |
if (IsPredictive()) |
|
12958 |
{ |
|
12959 |
newState = EIndicatorStateJapanesePredictive; |
|
12960 |
} |
|
12961 |
else |
|
12962 |
{ |
|
12963 |
newState = EIndicatorStateHiraganaKanji; |
|
12964 |
} |
|
12965 |
break; |
|
12966 |
case EKatakana: |
|
12967 |
if (iCharWidth == EHalfWidthChar) |
|
12968 |
{ |
|
12969 |
newState = EIndicatorStateHalfKatakana; |
|
12970 |
} |
|
12971 |
else if (iCharWidth == EFullWidthChar) |
|
12972 |
{ |
|
12973 |
newState = EIndicatorStateFullKatakana; |
|
12974 |
} |
|
12975 |
break; |
|
12976 |
case EHiragana: |
|
12977 |
{ |
|
12978 |
newState = EIndicatorStateHiragana; |
|
12979 |
} |
|
12980 |
break; |
|
12981 |
case EPinyin: |
|
12982 |
if (ptiLang->HasInputMode(EPtiEnginePinyinByPhrase)) |
|
12983 |
{ |
|
12984 |
newState = EIndicatorStatePinyinPhrase; |
|
12985 |
} |
|
12986 |
else |
|
12987 |
{ |
|
12988 |
newState = EIndicatorStatePinyin; |
|
12989 |
} |
|
12990 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
12991 |
if ( iFnKeyManager->FnKeyState() |
|
12992 |
== CAknFepFnKeyManager::EFnKeyLock ) |
|
12993 |
newState = EFnKeyLocked; |
|
12994 |
else if ( iFnKeyManager->FnKeyState() |
|
12995 |
!= CAknFepFnKeyManager::EFnKeyNone ) |
|
12996 |
newState = EFnKeyPressed; |
|
12997 |
#endif |
|
12998 |
break; |
|
12999 |
case EZhuyin: |
|
13000 |
if (ptiLang->HasInputMode(EPtiEngineZhuyinByPhrase)) |
|
13001 |
{ |
|
13002 |
newState = EIndicatorStateZhuyinPhrase; |
|
13003 |
} |
|
13004 |
else |
|
13005 |
{ |
|
13006 |
newState = EIndicatorStateZhuyin; |
|
13007 |
} |
|
13008 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
13009 |
if ( iFnKeyManager->FnKeyState() |
|
13010 |
== CAknFepFnKeyManager::EFnKeyLock ) |
|
13011 |
newState = EFnKeyLocked; |
|
13012 |
else if ( iFnKeyManager->FnKeyState() |
|
13013 |
!= CAknFepFnKeyManager::EFnKeyNone ) |
|
13014 |
newState = EFnKeyPressed; |
|
13015 |
#endif |
|
13016 |
break; |
|
13017 |
case EStroke: |
|
13018 |
{ |
|
13019 |
TBool flag = ptiLang->HasInputMode(EPtiEngineStrokeByPhrase); |
|
13020 |
if (iLanguageCapabilities.iInputLanguageCode == ELangPrcChinese) |
|
13021 |
{ |
|
13022 |
if (flag) |
|
13023 |
{ |
|
13024 |
newState = EIndicatorStateStrokePhrase; |
|
13025 |
} |
|
13026 |
else |
|
13027 |
{ |
|
13028 |
newState = EIndicatorStateStroke; |
|
13029 |
} |
|
13030 |
} |
|
13031 |
else |
|
13032 |
{ |
|
13033 |
if (flag) |
|
13034 |
{ |
|
13035 |
newState = EIndicatorStateStrokeTradPhrase; |
|
13036 |
} |
|
13037 |
else |
|
13038 |
{ |
|
13039 |
newState = EIndicatorStateStrokeTrad; |
|
13040 |
} |
|
13041 |
} |
|
13042 |
} |
|
13043 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
13044 |
if ( iFnKeyManager->FnKeyState() |
|
13045 |
== CAknFepFnKeyManager::EFnKeyLock ) |
|
13046 |
newState = EFnKeyLocked; |
|
13047 |
else if ( iFnKeyManager->FnKeyState() |
|
13048 |
!= CAknFepFnKeyManager::EFnKeyNone ) |
|
13049 |
newState = EFnKeyPressed; |
|
13050 |
#endif |
|
13051 |
break; |
|
13052 |
case ECangJie: |
|
13053 |
newState = EIndicatorStateCangJie; |
|
13054 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
13055 |
if ( iFnKeyManager->FnKeyState() |
|
13056 |
== CAknFepFnKeyManager::EFnKeyLock ) |
|
13057 |
newState = EFnKeyLocked; |
|
13058 |
else if ( iFnKeyManager->FnKeyState() |
|
13059 |
!= CAknFepFnKeyManager::EFnKeyNone ) |
|
13060 |
newState = EFnKeyPressed; |
|
13061 |
#endif |
|
13062 |
break; |
|
13063 |
case EZhuyinFind: |
|
13064 |
newState = EIndicatorStateZhuyinFind; |
|
13065 |
break; |
|
13066 |
case EStrokeFind: |
|
13067 |
newState = EIndicatorStateStrokeFind; |
|
13068 |
break; |
|
13069 |
case ENumber: |
|
13070 |
{ |
|
13071 |
newState = ENumeric; |
|
13072 |
//iLanguageCapabilities.iLocalDigitType = EDigitTypeWestern; |
|
13073 |
} |
|
13074 |
break; |
|
13075 |
case ENativeNumber: |
|
13076 |
{ |
|
13077 |
UpdateNumberIndicator( newState ); |
|
13078 |
} |
|
13079 |
break; |
|
13080 |
case EHangul: |
|
13081 |
{ |
|
13082 |
newState = EIndicatorStateHangul; |
|
13083 |
} |
|
13084 |
break; |
|
13085 |
case ELatin: |
|
13086 |
{ |
|
13087 |
UpdateLatinIndicator( newState ); |
|
13088 |
} |
|
13089 |
break; |
|
13090 |
case EHindi: |
|
13091 |
{ |
|
13092 |
UpdateHindiIndicator( newState ); |
|
13093 |
} |
|
13094 |
break; |
|
13095 |
default: |
|
13096 |
break; |
|
13097 |
} |
|
13098 |
} |
|
13099 |
} |
|
13100 |
||
13101 |
if ( iFepPluginManager && iFepPluginManager->PluginInputMode() == EPluginInputModeVkb ) |
|
13102 |
{ |
|
13103 |
newState = iFepPluginManager->VKBIndicatorState( newState ); |
|
13104 |
} |
|
13105 |
||
13106 |
// Update indicators only if the state has been changed, or if the indicator has swapped |
|
13107 |
if ((iPreviousEditingState != newState) || (editingStateIndicator != iEditIndicatorAtLastUpdate)) |
|
13108 |
{ |
|
13109 |
if (editingStateIndicator) |
|
13110 |
{ |
|
13111 |
// because current avkon have not find chinese phrase indicator, |
|
13112 |
// so change back to no-phrase |
|
13113 |
if (findPaneIndicator || iAknEditorFlags & EAknEditorFlagFindPane ) |
|
13114 |
{ |
|
13115 |
switch(newState) |
|
13116 |
{ |
|
13117 |
case EIndicatorStateStrokePhrase: |
|
13118 |
{ |
|
13119 |
newState = EIndicatorStateStroke; |
|
13120 |
} |
|
13121 |
break; |
|
13122 |
case EIndicatorStateStrokeTradPhrase: |
|
13123 |
{ |
|
13124 |
newState = EIndicatorStateStrokeTrad; |
|
13125 |
} |
|
13126 |
break; |
|
13127 |
case EIndicatorStatePinyinPhrase: |
|
13128 |
{ |
|
13129 |
newState = EIndicatorStatePinyin; |
|
13130 |
} |
|
13131 |
break; |
|
13132 |
case EIndicatorStateZhuyinPhrase: |
|
13133 |
{ |
|
13134 |
newState = EIndicatorStateZhuyin; |
|
13135 |
} |
|
13136 |
break; |
|
13137 |
default: |
|
13138 |
{ |
|
13139 |
break; |
|
13140 |
} |
|
13141 |
} |
|
13142 |
} |
|
13143 |
// Add This condition for Phonebook, ReTe, PF52.50_2008_wk32: |
|
13144 |
// Navigation bar disappears after tapping find pane and then returning back to Names list view. |
|
13145 |
// Portrait FSQ is added. |
|
13146 |
if (!(editingStateIndicator == (MAknEditingStateIndicator*)iIndicator && |
|
13147 |
( iFepPluginManager && |
|
13148 |
( iFepPluginManager->PluginInputMode() == EPluginInputModeItut |
|
13149 |
|| iFepPluginManager->PluginInputMode() == EPluginInputModeFSQ |
|
13150 |
|| iFepPluginManager->PluginInputMode() == EPluginInputModePortraitFSQ ) ) && |
|
13151 |
IsFindPaneEditor())) |
|
13152 |
{ |
|
13153 |
editingStateIndicator->SetState(newState); |
|
13154 |
} |
|
13155 |
||
13156 |
// Ensure that no indicator is shown in navi pane when other |
|
13157 |
// indicator is changed in use. |
|
13158 |
if ( editingStateIndicator != (MAknEditingStateIndicator*)iIndicator && |
|
13159 |
iPreviousEditingState == EStateNone && |
|
13160 |
(!IsFlagSet(EFlagForegroundUIComponentVisible | EFlagMenuPaneVisible)) ) |
|
13161 |
||
13162 |
{ |
|
13163 |
iIndicator->SetState( EStateNone ); |
|
13164 |
} |
|
13165 |
||
13166 |
iPreviousEditingState = newState; |
|
13167 |
iEditIndicatorAtLastUpdate=editingStateIndicator; |
|
13168 |
} |
|
13169 |
} |
|
13170 |
} |
|
13171 |
||
13172 |
void CAknFepManager::UpdateNumberIndicator( TAknEditingState& aNewState ) |
|
13173 |
{ |
|
13174 |
||
13175 |
// The fix is made only for Hindi |
|
13176 |
UpdateNumericEditorDigitType(); |
|
13177 |
TBool supportsWesternNumericIntegerOrReal = |
|
13178 |
( iInputCapabilities.SupportsWesternNumericIntegerPositive() || |
|
13179 |
iInputCapabilities.SupportsWesternNumericIntegerNegative() || |
|
13180 |
iInputCapabilities.SupportsWesternNumericReal() ); |
|
13181 |
||
13182 |
#ifdef RD_SCALABLE_UI_V2 |
|
13183 |
iFepPluginManager->SetPluginNativeRange( ETrue ); |
|
13184 |
#endif // RD_SCALABLE_UI_V2 |
|
13185 |
// In usual case digit mode is Arabic-Indic digits if local digit mode is |
|
13186 |
// Arabic-Indic and current input language is Arabic. |
|
13187 |
if ( (!supportsWesternNumericIntegerOrReal && |
|
13188 |
iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic /* && |
|
13189 |
iLanguageCapabilities.iInputLanguageCode == ELangArabic*/ |
|
13190 |
) |
|
13191 |
|| |
|
13192 |
// But digit mode is Arabic-Indic digit in MFNE and real number |
|
13193 |
// editors if UI language is Arabic and global digit setting is |
|
13194 |
// Arabic-Indic digits. |
|
13195 |
( !(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) && |
|
13196 |
iLanguageCapabilities.iNumericEditorDigitType == EDigitTypeArabicIndic && // AknTextUtils::DigitModeQuery(AknTextUtils::EDigitModeShownToUser) && |
|
13197 |
supportsWesternNumericIntegerOrReal && |
|
13198 |
iUiLanguage == ELangArabic |
|
13199 |
) |
|
13200 |
) |
|
13201 |
{ |
|
13202 |
aNewState=EArabicIndicNumeric; |
|
13203 |
||
13204 |
} |
|
13205 |
else if ( (!supportsWesternNumericIntegerOrReal && |
|
13206 |
iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic /* && |
|
13207 |
iLanguageCapabilities.iInputLanguageCode == ELangUrdu,Farasi*/ |
|
13208 |
) |
|
13209 |
|| |
|
13210 |
// But digit mode is Arabic-Indic digit in MFNE and real number |
|
13211 |
// editors if UI language is Arabic and global digit setting is |
|
13212 |
// Arabic-Indic digits. |
|
13213 |
( !(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) && |
|
13214 |
iLanguageCapabilities.iNumericEditorDigitType == EDigitTypeEasternArabicIndic && // AknTextUtils::DigitModeQuery(AknTextUtils::EDigitModeShownToUser) && |
|
13215 |
supportsWesternNumericIntegerOrReal && |
|
13216 |
(iUiLanguage == ELangUrdu || iUiLanguage == ELangFarsi))) |
|
13217 |
{ |
|
13218 |
aNewState=EArabicIndicNumeric; |
|
13219 |
} |
|
13220 |
/* Devanagari Scripts */ |
|
13221 |
else if ( (!supportsWesternNumericIntegerOrReal && |
|
13222 |
iLanguageCapabilities.iLocalDigitType == EDigitTypeDevanagari //&& |
|
13223 |
//iLanguageCapabilities.iInputLanguageCode == ELangHindi |
|
13224 |
) |
|
13225 |
|| |
|
13226 |
( !(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) && |
|
13227 |
iLanguageCapabilities.iNumericEditorDigitType == EDigitTypeDevanagari && // AknTextUtils::DigitModeQuery(AknTextUtils::EDigitModeShownToUser) && |
|
13228 |
supportsWesternNumericIntegerOrReal && |
|
13229 |
TAknFepUiIndicInputManager::IsScriptDevanagari( iUiLanguage ) |
|
13230 |
) |
|
13231 |
) |
|
13232 |
{ |
|
13233 |
aNewState= EDevanagariIndicNumeric; |
|
13234 |
} |
|
13235 |
else |
|
13236 |
{ |
|
13237 |
if ( iLanguageCapabilities.iInputLanguageCode == ELangArabic ) |
|
13238 |
{ |
|
13239 |
iLanguageCapabilities.iLocalDigitType = EDigitTypeArabicIndic; |
|
13240 |
aNewState=EArabicIndicNumeric; |
|
13241 |
} |
|
13242 |
else if ( iLanguageCapabilities.iInputLanguageCode == ELangFarsi |
|
13243 |
|| iLanguageCapabilities.iInputLanguageCode == ELangUrdu ) |
|
13244 |
{ |
|
13245 |
iLanguageCapabilities.iLocalDigitType = EDigitTypeEasternArabicIndic; |
|
13246 |
aNewState=EArabicIndicNumeric; |
|
13247 |
} |
|
13248 |
else if ( iLanguageCapabilities.iInputLanguageCode == ELangHindi ) |
|
13249 |
{ |
|
13250 |
//iLanguageCapabilities.iLocalDigitType = EDigitTypeDevanagari; |
|
13251 |
aNewState= EDevanagariIndicNumeric; |
|
13252 |
} |
|
13253 |
} |
|
13254 |
} |
|
13255 |
||
13256 |
void CAknFepManager::UpdateLatinIndicator( TAknEditingState& aNewState ) |
|
13257 |
{ |
|
13258 |
if (IsPredictive()) |
|
13259 |
{ |
|
13260 |
//AutoComplete - Begin |
|
13261 |
SetPredictiveIndicatorState( aNewState ); |
|
13262 |
//AutoComplete - End |
|
13263 |
||
13264 |
return; |
|
13265 |
} |
|
13266 |
||
13267 |
TInt currentCase = iCaseMan->CurrentCase(); |
|
13268 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
13269 |
if(iFnKeyManager->FnKeyState() == CAknFepFnKeyManager::EFnKeyLock) |
|
13270 |
aNewState = EFnKeyLocked; |
|
13271 |
else if(iFnKeyManager->FnKeyState() != CAknFepFnKeyManager::EFnKeyNone) |
|
13272 |
aNewState = EFnKeyPressed; |
|
13273 |
else |
|
13274 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
13275 |
{ |
|
13276 |
#ifdef RD_SCALABLE_UI_V2 |
|
13277 |
if( iFepPluginManager && |
|
13278 |
( !iFepPluginManager->SyncWithPluginRange() || iFepPluginManager->PluginNativeRange() ) ) |
|
13279 |
{ |
|
13280 |
iFepPluginManager->SetPluginNativeRange( ETrue ); |
|
13281 |
#endif // RD_SCALABLE_UI_V2 |
|
13282 |
switch ( iLanguageCapabilities.iInputLanguageCode ) |
|
13283 |
{ |
|
13284 |
case ELangArabic: |
|
13285 |
{ |
|
13286 |
aNewState=EMultitapArabic; |
|
13287 |
} |
|
13288 |
return; |
|
13289 |
case ELangHebrew: |
|
13290 |
{ |
|
13291 |
aNewState=EMultitapHebrew; |
|
13292 |
} |
|
13293 |
return; |
|
13294 |
case ELangFarsi: |
|
13295 |
case ELangUrdu: |
|
13296 |
{ |
|
13297 |
aNewState=EMultitapFarsiAndUrdu; |
|
13298 |
} |
|
13299 |
return; |
|
13300 |
case ELangThai: |
|
13301 |
{ |
|
13302 |
aNewState = EMultitapThai; |
|
13303 |
} |
|
13304 |
return; |
|
13305 |
||
13306 |
#ifdef RD_MARATHI |
|
13307 |
case ELangMarathi: |
|
13308 |
{ |
|
13309 |
aNewState = EIndicatorStateMultitapMarathi; |
|
13310 |
} |
|
13311 |
return; |
|
13312 |
#endif // RD_MARATHI |
|
13313 |
||
13314 |
#ifdef RD_HINDI_PHONETIC_INPUT |
|
13315 |
case KLangHindiPhonetic: |
|
13316 |
{ |
|
13317 |
TInt currentPtiLang = (ptiLang)? ptiLang->LanguageCode() : 0; |
|
13318 |
||
13319 |
if(TAknFepUiIndicInputManager::IsIndicPhoneticLanguage(TLanguage(currentPtiLang))) |
|
13320 |
{ |
|
13321 |
aNewState = TAknEditingState(SetPhoneticIndicator(TLanguage(currentPtiLang))); |
|
13322 |
} |
|
13323 |
else |
|
13324 |
{ |
|
13325 |
switch ( currentCase ) |
|
13326 |
{ |
|
13327 |
case EAknEditorUpperCase: |
|
13328 |
aNewState=EMultitapUpper; |
|
13329 |
if (iCharWidth == EFullWidthChar) |
|
13330 |
{ |
|
13331 |
aNewState=EIndicatorStateFullLatinUpper; |
|
13332 |
} |
|
13333 |
break; |
|
13334 |
case EAknEditorLowerCase: |
|
13335 |
aNewState=EMultitapLower; |
|
13336 |
if (iCharWidth == EFullWidthChar) |
|
13337 |
{ |
|
13338 |
aNewState=EIndicatorStateFullLatinLower; |
|
13339 |
} |
|
13340 |
break; |
|
13341 |
case EAknEditorTextCase: |
|
13342 |
aNewState=EMultitapShifted; |
|
13343 |
if (iCharWidth == EFullWidthChar) |
|
13344 |
{ |
|
13345 |
aNewState=EIndicatorStateFullLatinText; |
|
13346 |
} |
|
13347 |
break; |
|
13348 |
default: |
|
13349 |
break; |
|
13350 |
} |
|
13351 |
} |
|
13352 |
||
13353 |
} |
|
13354 |
return; |
|
13355 |
#endif |
|
13356 |
case ELangVietnamese: |
|
13357 |
{ |
|
13358 |
switch (currentCase) |
|
13359 |
{ |
|
13360 |
case EAknEditorUpperCase: |
|
13361 |
aNewState = EMultitapUpperVietnamese; |
|
13362 |
break; |
|
13363 |
case EAknEditorLowerCase: |
|
13364 |
aNewState = EMultitapLowerVietnamese; |
|
13365 |
break; |
|
13366 |
case EAknEditorTextCase: |
|
13367 |
aNewState = EMultitapShiftedVietnamese; |
|
13368 |
break; |
|
13369 |
default: |
|
13370 |
break; |
|
13371 |
} |
|
13372 |
return; |
|
13373 |
} |
|
13374 |
||
13375 |
case ELangGreek: |
|
13376 |
{ |
|
13377 |
switch (currentCase) |
|
13378 |
{ |
|
13379 |
case EAknEditorUpperCase: |
|
13380 |
aNewState = EMultitapUpperGreek; |
|
13381 |
break; |
|
13382 |
case EAknEditorLowerCase: |
|
13383 |
aNewState = EMultitapLowerGreek; |
|
13384 |
break; |
|
13385 |
case EAknEditorTextCase: |
|
13386 |
aNewState = EMultitapShiftedGreek; |
|
13387 |
break; |
|
13388 |
default: |
|
13389 |
break; |
|
13390 |
} |
|
13391 |
return; |
|
13392 |
} |
|
13393 |
||
13394 |
//Cyrillic alphabet is used for Russian, Bulgarian and |
|
13395 |
//Ukranian languages. So fall through for all these languages - |
|
13396 |
case ELangRussian: |
|
13397 |
case ELangBulgarian: |
|
13398 |
case ELangUkrainian: |
|
13399 |
{ |
|
13400 |
switch (currentCase) |
|
13401 |
{ |
|
13402 |
case EAknEditorUpperCase: |
|
13403 |
aNewState = EMultitapUpperCyrillic; |
|
13404 |
break; |
|
13405 |
case EAknEditorLowerCase: |
|
13406 |
aNewState = EMultitapLowerCyrillic; |
|
13407 |
break; |
|
13408 |
case EAknEditorTextCase: |
|
13409 |
aNewState = EMultitapShiftedCyrillic; |
|
13410 |
break; |
|
13411 |
default: |
|
13412 |
break; |
|
13413 |
} |
|
13414 |
return; |
|
13415 |
} |
|
13416 |
} |
|
13417 |
#ifdef RD_SCALABLE_UI_V2 |
|
13418 |
} |
|
13419 |
// if plugin is not native range |
|
13420 |
||
13421 |
if(iFepPluginManager && iLanguageCapabilities.iInputLanguageCode != ELangRussian && |
|
13422 |
iLanguageCapabilities.iInputLanguageCode != ELangBulgarian && |
|
13423 |
iLanguageCapabilities.iInputLanguageCode != ELangUkrainian && |
|
13424 |
iLanguageCapabilities.iInputLanguageCode != ELangGreek ) |
|
13425 |
{ |
|
13426 |
iFepPluginManager->SetPluginNativeRange( EFalse ); |
|
13427 |
} |
|
13428 |
||
13429 |
#endif // RD_SCALABLE_UI_V2 |
|
13430 |
} |
|
13431 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
13432 |
if(FnKeyState() == CAknFepFnKeyManager::EFnKeyNone) |
|
13433 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
13434 |
{ |
|
13435 |
switch (currentCase) |
|
13436 |
{ |
|
13437 |
case EAknEditorUpperCase: |
|
13438 |
aNewState=EMultitapUpper; |
|
13439 |
if (iCharWidth == EFullWidthChar) |
|
13440 |
{ |
|
13441 |
aNewState=EIndicatorStateFullLatinUpper; |
|
13442 |
} |
|
13443 |
break; |
|
13444 |
case EAknEditorLowerCase: |
|
13445 |
aNewState=EMultitapLower; |
|
13446 |
if (iCharWidth == EFullWidthChar) |
|
13447 |
{ |
|
13448 |
aNewState=EIndicatorStateFullLatinLower; |
|
13449 |
} |
|
13450 |
break; |
|
13451 |
case EAknEditorTextCase: |
|
13452 |
aNewState=EMultitapShifted; |
|
13453 |
if (iCharWidth == EFullWidthChar) |
|
13454 |
{ |
|
13455 |
aNewState=EIndicatorStateFullLatinText; |
|
13456 |
} |
|
13457 |
break; |
|
13458 |
default: |
|
13459 |
break; |
|
13460 |
} |
|
13461 |
} |
|
13462 |
} |
|
13463 |
void CAknFepManager::UpdateHindiIndicator( TAknEditingState& aNewState ) |
|
13464 |
{ |
|
13465 |
if ( IsPredictive() ) |
|
13466 |
{ |
|
13467 |
if( iIsAutoCompleteOn ) |
|
13468 |
aNewState = EAutoCompleteHindi; |
|
13469 |
else |
|
13470 |
aNewState = EIndicatorStatePredictiveHindi; |
|
13471 |
} |
|
13472 |
else |
|
13473 |
{ |
|
13474 |
aNewState = EIndicatorStateMultitapHindi; |
|
13475 |
} |
|
13476 |
} |
|
13477 |
||
13478 |
TInt CAknFepManager::CurrentInputLangCode() |
|
13479 |
{ |
|
13480 |
ASSERT(iPtiEngine); |
|
13481 |
||
13482 |
MPtiLanguage* lang = iPtiEngine->CurrentLanguage(); |
|
13483 |
ASSERT(lang); |
|
13484 |
||
13485 |
return lang->LanguageCode(); |
|
13486 |
} |
|
13487 |
||
13488 |
TBool CAknFepManager::GetIndicatorImgID(TInt& aIndicatorImgID, TInt& aIndicatorTextID) |
|
13489 |
{ |
|
13490 |
if (iPreviousEditingState == EStateNone) |
|
13491 |
{ |
|
13492 |
UpdateIndicators(); |
|
13493 |
if (iPreviousEditingState == EStateNone) |
|
13494 |
{ |
|
13495 |
return EFalse; |
|
13496 |
} |
|
13497 |
} |
|
13498 |
||
13499 |
TBool predictiveMode = QueryPredictiveState(iPreviousEditingState); |
|
13500 |
TBool predictiveAutoCompleteMode = EFalse; |
|
13501 |
if(!predictiveMode) |
|
13502 |
{ |
|
13503 |
predictiveAutoCompleteMode = QueryPredictiveAutoCompleteState(iPreviousEditingState); |
|
13504 |
} |
|
13505 |
||
13506 |
if (predictiveMode) |
|
13507 |
{ |
|
13508 |
aIndicatorImgID = EAknNaviPaneEditorIndicatorT9; |
|
13509 |
} |
|
13510 |
else if (predictiveAutoCompleteMode) |
|
13511 |
{ |
|
13512 |
aIndicatorImgID = EAknNaviPaneEditorIndicatorAutoComplete; |
|
13513 |
} |
|
13514 |
else |
|
13515 |
{ |
|
13516 |
aIndicatorImgID = EAknNaviPaneEditorIndicatorQuery; |
|
13517 |
} |
|
13518 |
||
13519 |
aIndicatorTextID = EvaluateState(iPreviousEditingState); |
|
13520 |
||
13521 |
return ETrue; |
|
13522 |
} |
|
13523 |
||
13524 |
TInt CAknFepManager::EvaluateState(const TAknEditingState aState) |
|
13525 |
{ |
|
13526 |
TInt result = 0; |
|
13527 |
switch(aState) |
|
13528 |
{ |
|
13529 |
case EArabicIndicNumeric: |
|
13530 |
result = EAknNaviPaneEditorIndicatorArabicIndicNumberCase; |
|
13531 |
break; |
|
13532 |
||
13533 |
case ET9Thai: |
|
13534 |
case EMultitapThai: |
|
13535 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
13536 |
case EAutoCompleteThai: |
|
13537 |
#endif |
|
13538 |
result = EAknNaviPaneEditorIndicatorThai; |
|
13539 |
break; |
|
13540 |
||
13541 |
case EIndicatorStatePredictiveHindi: |
|
13542 |
case EIndicatorStateMultitapHindi: |
|
13543 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
13544 |
case EAutoCompleteHindi: |
|
13545 |
#endif |
|
13546 |
#ifdef RD_MARATHI |
|
13547 |
case EIndicatorStateMultitapMarathi: |
|
13548 |
case EIndicatorStatePredictiveMarathi: |
|
13549 |
#endif // RD_MARATHI |
|
13550 |
result = EAknNaviPaneEditorIndicatorDevanagariCase; |
|
13551 |
break; |
|
13552 |
||
13553 |
case ET9Arabic: |
|
13554 |
case EMultitapArabic: |
|
13555 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
13556 |
case EAutoCompleteArabic: |
|
13557 |
#endif |
|
13558 |
result = EAknNaviPaneEditorIndicatorArabicCase; |
|
13559 |
break; |
|
13560 |
||
13561 |
case ET9Hebrew: |
|
13562 |
case EMultitapHebrew: |
|
13563 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
13564 |
case EAutoCompleteHebrew: |
|
13565 |
#endif |
|
13566 |
result = EAknNaviPaneEditorIndicatorHebrewCase; |
|
13567 |
break; |
|
13568 |
||
13569 |
case ET9FarsiAndUrdu: |
|
13570 |
case EMultitapFarsiAndUrdu: |
|
13571 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
13572 |
case EAutoCompleteFarsiAndUrdu: |
|
13573 |
#endif |
|
13574 |
result = EAknNaviPaneEditorIndicatorFarsiAndUrduCase; |
|
13575 |
break; |
|
13576 |
||
13577 |
||
13578 |
case ET9Upper: |
|
13579 |
case EMultitapUpper: |
|
13580 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
13581 |
case EAutoCompleteUpper: |
|
13582 |
#endif |
|
13583 |
result = EAknNaviPaneEditorIndicatorUpperCase; |
|
13584 |
break; |
|
13585 |
||
13586 |
case ET9Lower: |
|
13587 |
case EMultitapLower: |
|
13588 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
13589 |
case EAutoCompleteLower: |
|
13590 |
#endif |
|
13591 |
result = EAknNaviPaneEditorIndicatorLowerCase; |
|
13592 |
break; |
|
13593 |
||
13594 |
case ET9Shifted: |
|
13595 |
case EMultitapShifted: |
|
13596 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
13597 |
case EAutoCompleteShifted: |
|
13598 |
#endif |
|
13599 |
result = EAknNaviPaneEditorIndicatorTextCase; |
|
13600 |
break; |
|
13601 |
||
13602 |
case ENumeric: |
|
13603 |
result = EAknNaviPaneEditorIndicatorNumberCase; |
|
13604 |
break; |
|
13605 |
||
13606 |
||
13607 |
case EIndicatorStatePinyin: |
|
13608 |
result = EAknNaviPaneEditorIndicatorPinyin; |
|
13609 |
break; |
|
13610 |
case EIndicatorStatePinyinPhrase: |
|
13611 |
result = EAknNaviPaneEditorIndicatorPinyinPhrase; |
|
13612 |
break; |
|
13613 |
||
13614 |
case EIndicatorStateZhuyin: |
|
13615 |
result = EAknNaviPaneEditorIndicatorZhuyin; |
|
13616 |
break; |
|
13617 |
case EIndicatorStateZhuyinPhrase: |
|
13618 |
result = EAknNaviPaneEditorIndicatorZhuyinPhrase; |
|
13619 |
break; |
|
13620 |
||
13621 |
case EIndicatorStateZhuyinFind: |
|
13622 |
result = EAknNaviPaneEditorIndicatorZhuyinFind; |
|
13623 |
break; |
|
13624 |
||
13625 |
case EDevanagariIndicNumeric : |
|
13626 |
result = EAknNaviPaneEditorIndicatorDevanagariIndicNumberCase; |
|
13627 |
break; |
|
13628 |
||
13629 |
case EIndicatorStateHiraganaKanji: |
|
13630 |
case EIndicatorStateJapanesePredictive: |
|
13631 |
result = EAknNaviPaneEditorIndicatorJapaneseHiraganaKanji; |
|
13632 |
break; |
|
13633 |
||
13634 |
case EIndicatorStateFullKatakana: |
|
13635 |
result = EAknNaviPaneEditorIndicatorJapaneseFullKatakana; |
|
13636 |
break; |
|
13637 |
||
13638 |
case EIndicatorStateHalfKatakana: |
|
13639 |
result = EAknNaviPaneEditorIndicatorJapaneseHalfKatakana; |
|
13640 |
break; |
|
13641 |
||
13642 |
case EIndicatorStateFullLatinText: |
|
13643 |
result = EAknNaviPaneEditorIndicatorJapaneseFullTextAlphabet; |
|
13644 |
break; |
|
13645 |
||
13646 |
case EIndicatorStateFullLatinUpper: |
|
13647 |
result = EAknNaviPaneEditorIndicatorJapaneseFullUpperAlphabet; |
|
13648 |
break; |
|
13649 |
||
13650 |
case EIndicatorStateFullLatinLower: |
|
13651 |
result = EAknNaviPaneEditorIndicatorJapaneseFullLowerAlphabet; |
|
13652 |
break; |
|
13653 |
||
13654 |
case EIndicatorStateFullNumeric: |
|
13655 |
result = EAknNaviPaneEditorIndicatorJapaneseFullNumeric; |
|
13656 |
break; |
|
13657 |
||
13658 |
case EIndicatorStateHiragana: |
|
13659 |
result = EAknNaviPaneEditorIndicatorJapaneseHiragana; |
|
13660 |
break; |
|
13661 |
||
13662 |
case EIndicatorStateStroke: |
|
13663 |
result = EAknNaviPaneEditorIndicatorStroke; |
|
13664 |
break; |
|
13665 |
case EIndicatorStateStrokePhrase: |
|
13666 |
result = EAknNaviPaneEditorIndicatorStrokePhrase; |
|
13667 |
break; |
|
13668 |
||
13669 |
case EIndicatorStateStrokeTrad: |
|
13670 |
result = EAknNaviPaneEditorIndicatorStrokeTrad; |
|
13671 |
break; |
|
13672 |
case EIndicatorStateStrokeTradPhrase: |
|
13673 |
result = EAknNaviPaneEditorIndicatorStrokeTradPhrase; |
|
13674 |
break; |
|
13675 |
||
13676 |
case EQwertyShift: |
|
13677 |
result = EAknNaviPaneEditorIndicatorQwertyShift; |
|
13678 |
break; |
|
13679 |
||
13680 |
case EIndicatorStateStrokeFind: |
|
13681 |
result = EAknNaviPaneEditorIndicatorStrokeFind; |
|
13682 |
break; |
|
13683 |
||
13684 |
case EIndicatorStateCangJie: |
|
13685 |
result = EAknNaviPaneEditorIndicatorCangJie; |
|
13686 |
break; |
|
13687 |
||
13688 |
case ET9UpperVietnamese: |
|
13689 |
case EMultitapUpperVietnamese: |
|
13690 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
13691 |
case EAutoCompleteUpperVietnamese: |
|
13692 |
#endif |
|
13693 |
result = EAknNaviPaneEditorIndicatorVietnameseUpperCase; |
|
13694 |
break; |
|
13695 |
||
13696 |
case ET9LowerVietnamese: |
|
13697 |
case EMultitapLowerVietnamese: |
|
13698 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
13699 |
case EAutoCompleteLowerVietnamese: |
|
13700 |
#endif |
|
13701 |
result = EAknNaviPaneEditorIndicatorVietnameseLowerCase; |
|
13702 |
break; |
|
13703 |
||
13704 |
case ET9ShiftedVietnamese: |
|
13705 |
case EMultitapShiftedVietnamese: |
|
13706 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
13707 |
case EAutoCompleteShiftedVietnamese: |
|
13708 |
#endif |
|
13709 |
result = EAknNaviPaneEditorIndicatorVietnameseTextCase; |
|
13710 |
break; |
|
13711 |
#ifdef RD_HINDI_PHONETIC_INPUT |
|
13712 |
case EIndicatorStateHindiPhoneticUpper: |
|
13713 |
result = EAknNaviPaneEditorIndicatorDevanagariPhoneticUpperCase; |
|
13714 |
break; |
|
13715 |
case EIndicatorStateHindiPhoneticLower: |
|
13716 |
result = EAknNaviPaneEditorIndicatorDevanagariPhoneticLowerCase; |
|
13717 |
break; |
|
13718 |
#endif |
|
13719 |
case ET9UpperGreek: |
|
13720 |
case EMultitapUpperGreek: |
|
13721 |
result = EAknNaviPaneEditorIndicatorGreekUpperCase; |
|
13722 |
break; |
|
13723 |
||
13724 |
case ET9LowerGreek: |
|
13725 |
case EMultitapLowerGreek: |
|
13726 |
result = EAknNaviPaneEditorIndicatorGreekLowerCase; |
|
13727 |
break; |
|
13728 |
||
13729 |
case ET9ShiftedGreek: |
|
13730 |
case EMultitapShiftedGreek: |
|
13731 |
result = EAknNaviPaneEditorIndicatorGreekTextCase; |
|
13732 |
break; |
|
13733 |
||
13734 |
case ET9UpperCyrillic: |
|
13735 |
case EMultitapUpperCyrillic: |
|
13736 |
result = EAknNaviPaneEditorIndicatorCyrillicUpperCase; |
|
13737 |
break; |
|
13738 |
||
13739 |
case ET9LowerCyrillic: |
|
13740 |
case EMultitapLowerCyrillic: |
|
13741 |
result = EAknNaviPaneEditorIndicatorCyrillicLowerCase; |
|
13742 |
break; |
|
13743 |
||
13744 |
case ET9ShiftedCyrillic: |
|
13745 |
case EMultitapShiftedCyrillic: |
|
13746 |
result = EAknNaviPaneEditorIndicatorCyrillicTextCase; |
|
13747 |
break; |
|
13748 |
||
13749 |
case EHybridModeLatin: |
|
13750 |
result = EAknNaviPaneEditorIndicatorHybridLatin; |
|
13751 |
break; |
|
13752 |
case EIndicatorStateHangul: |
|
13753 |
result = EAknNaviPaneEditorIndicatorKoreanHangul; |
|
13754 |
break; |
|
13755 |
||
13756 |
} |
|
13757 |
return result; |
|
13758 |
||
13759 |
} |
|
13760 |
||
13761 |
TBool CAknFepManager::IsAbleToLaunchSCT() const |
|
13762 |
{ |
|
13763 |
TBool ableToLaunchSCT = ETrue; |
|
13764 |
||
13765 |
if (ExtendedInputCapabilities() & CAknExtendedInputCapabilities::EDisableSCT && |
|
13766 |
PluginInputMode() == EPluginInputModeNone ) |
|
13767 |
{ |
|
13768 |
// The editor doesn't allow SCT. |
|
13769 |
return EFalse; |
|
13770 |
} |
|
13771 |
||
13772 |
if (iMode == ENumber || iMode == ENativeNumber) |
|
13773 |
{ |
|
13774 |
if (iPermittedInputModes == EAknEditorNumericInputMode || !NumericModeSCTResourceId()) |
|
13775 |
{ |
|
13776 |
// SCT is not launched if the number mode is the only input mode or |
|
13777 |
// if there is not keymap resource for the current numeric keymap mode. |
|
13778 |
ableToLaunchSCT = EFalse; |
|
13779 |
} |
|
13780 |
if (iAknEditorFlags & EAknEditorFlagUseSCTNumericCharmap || |
|
13781 |
( (iAknEditorNumericKeymap == EAknEditorAlphanumericNumberModeKeymap) && |
|
13782 |
(iPermittedInputModes != EAknEditorNumericInputMode) )) |
|
13783 |
{ |
|
13784 |
// SCT is launched in the number mode if requested by editor flag |
|
13785 |
// EAknEditorFlagUseSCTNumericCharmap or if also text input modes are |
|
13786 |
// allowed and the keymap is EAknEditorAlphanumericNumberModeKeymap. |
|
13787 |
ableToLaunchSCT = ETrue; |
|
13788 |
} |
|
13789 |
} |
|
13790 |
if (!(EditorHasFreeSpace() && EditorState() |
|
13791 |
&& EditorState()->SpecialCharacterTableResourceId())) |
|
13792 |
{ |
|
13793 |
ableToLaunchSCT = EFalse; |
|
13794 |
} |
|
13795 |
||
13796 |
return ableToLaunchSCT; |
|
13797 |
} |
|
13798 |
||
13799 |
TBool CAknFepManager::QueryPredictiveState(const TAknEditingState aState) |
|
13800 |
{ |
|
13801 |
return (( aState == EIndicatorStatePinyin) || |
|
13802 |
( aState == EIndicatorStatePinyinPhrase) || |
|
13803 |
( aState == EIndicatorStateZhuyin) || |
|
13804 |
( aState == EIndicatorStateZhuyinPhrase) || |
|
13805 |
( aState == EIndicatorStateZhuyinFind) || |
|
13806 |
( aState == EIndicatorStateStrokeFind) || |
|
13807 |
( aState == EIndicatorStateStroke) || |
|
13808 |
( aState == EIndicatorStateStrokePhrase) || |
|
13809 |
( aState == EIndicatorStateCangJie) || |
|
13810 |
( aState == EIndicatorStateStrokeTrad) || |
|
13811 |
( aState == EIndicatorStateStrokeTradPhrase) || |
|
13812 |
( aState == ET9Upper) || |
|
13813 |
( aState == ET9Shifted) || |
|
13814 |
( aState == ET9Lower) || |
|
13815 |
( aState == ET9Arabic) || |
|
13816 |
( aState == ET9Hebrew) || |
|
13817 |
( aState == ET9FarsiAndUrdu) || |
|
13818 |
( aState == ET9Thai) || |
|
13819 |
( aState == EIndicatorStatePredictiveHindi) || |
|
13820 |
#ifdef RD_MARATHI |
|
13821 |
( aState == EIndicatorStatePredictiveMarathi) || |
|
13822 |
#endif // RD_MARATHI |
|
13823 |
( aState == EIndicatorStateJapanesePredictive) || |
|
13824 |
( aState == ET9UpperVietnamese) || |
|
13825 |
( aState == ET9LowerVietnamese) || |
|
13826 |
( aState == ET9ShiftedVietnamese) || |
|
13827 |
( aState == ET9UpperGreek) || |
|
13828 |
( aState == ET9LowerGreek) || |
|
13829 |
( aState == ET9ShiftedGreek) || |
|
13830 |
( aState == ET9UpperCyrillic) || |
|
13831 |
( aState == ET9LowerCyrillic) || |
|
13832 |
( aState == ET9ShiftedCyrillic) ); |
|
13833 |
} |
|
13834 |
||
13835 |
TBool CAknFepManager::QueryPredictiveAutoCompleteState(TAknEditingState aState) |
|
13836 |
{ |
|
13837 |
||
13838 |
return (( aState == EAutoCompleteUpper ) || |
|
13839 |
( aState == EAutoCompleteShifted ) || |
|
13840 |
( aState == EAutoCompleteLower ) || |
|
13841 |
( aState == EAutoCompleteHindi ) || |
|
13842 |
( aState == EAutoCompleteArabic ) || |
|
13843 |
( aState == EAutoCompleteHebrew ) || |
|
13844 |
( aState == EAutoCompleteFarsiAndUrdu ) || |
|
13845 |
( aState == EAutoCompleteThai ) || |
|
13846 |
( aState == EAutoCompleteUpperVietnamese ) || |
|
13847 |
( aState == EAutoCompleteLowerVietnamese ) || |
|
13848 |
( aState == EAutoCompleteShiftedVietnamese )); |
|
13849 |
} |
|
13850 |
||
13851 |
void CAknFepManager::LaunchSpecialCharacterTableL(TInt aResourceId, TBool aLaunchedByTouchWin, TBool aSmileyFirst) |
|
13852 |
{ |
|
13853 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
13854 |
// Set the iSupressCursorMoveToEndChrKeyPressed when cursor is in |
|
13855 |
// between two words and SCT is launched |
|
13856 |
iSupressCursorMoveToEndChrKeyPressed = ETrue; |
|
13857 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
13858 |
#ifdef RD_SCALABLE_UI_V2 |
|
13859 |
if ( iStarKeyPressed && iFepPluginManager && |
|
13860 |
iFepPluginManager->PluginInputMode() == EPluginInputModeItut ) |
|
13861 |
{ |
|
13862 |
aLaunchedByTouchWin = ETrue; |
|
13863 |
} |
|
13864 |
iCancelPopupInQwerty = aLaunchedByTouchWin; |
|
13865 |
#endif //RD_SCALABLE_UI_V2 |
|
13866 |
DoLaunchSctAndPctL(aResourceId, aSmileyFirst ? EShowSmileyFirst : EShowSctFirst ); |
|
13867 |
#ifdef RD_SCALABLE_UI_V2 |
|
13868 |
iCancelPopupInQwerty = EFalse; |
|
13869 |
#endif //RD_SCALABLE_UI_V2 |
|
13870 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
13871 |
iSupressCursorMoveToEndChrKeyPressed = ETrue; |
|
13872 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
13873 |
} |
|
13874 |
||
13875 |
TBool CAknFepManager::IsAbleToLaunchPCT() const |
|
13876 |
{ |
|
13877 |
TBool isAbleToLaunch = EFalse; |
|
13878 |
if (FeatureManager::FeatureSupported(KFeatureIdJapanesePicto) |
|
13879 |
&& (iAknEditorFlags & EAknEditorFlagEnablePictographInput)) |
|
13880 |
{ |
|
13881 |
isAbleToLaunch = ETrue; |
|
13882 |
} |
|
13883 |
return isAbleToLaunch; |
|
13884 |
} |
|
13885 |
||
13886 |
TBool CAknFepManager::IsAbleToLaunchSmiley() const |
|
13887 |
{ |
|
13888 |
if(iLanguageCapabilities.iRightToLeftLanguage) |
|
13889 |
{ |
|
13890 |
return EFalse; |
|
13891 |
} |
|
13892 |
||
13893 |
TBool ableToLaunchSmiley(EFalse); |
|
13894 |
||
13895 |
CAknEdwinState* edwinState = EditorState(); |
|
13896 |
if ( edwinState && EditorHasFreeSpace() ) |
|
13897 |
{ |
|
13898 |
CAknEdwinFormAccessor* formAccessor = edwinState->FormAccessor(); |
|
13899 |
if(formAccessor) |
|
13900 |
{ |
|
13901 |
CEikEdwin *edwin = static_cast<CEikEdwin*>(formAccessor->FormClientControl()); |
|
13902 |
if(edwin) |
|
13903 |
{ |
|
13904 |
ableToLaunchSmiley = ((edwin->UserFlags()&CEikEdwin::EAvkonEnableSmileySupport) != 0); |
|
13905 |
} |
|
13906 |
} |
|
13907 |
} |
|
13908 |
||
13909 |
return ableToLaunchSmiley; |
|
13910 |
} |
|
13911 |
||
13912 |
TInt CAknFepManager::GetCurrentEditorSCTResId() const |
|
13913 |
{ |
|
13914 |
if(!EditorState()) |
|
13915 |
{ |
|
13916 |
return NumericModeSCTResourceId(); |
|
13917 |
} |
|
13918 |
TInt currentEditorSCTResId = EditorState()->SpecialCharacterTableResourceId(); |
|
13919 |
if ( FeatureManager::FeatureSupported(KFeatureIdChinese) ) |
|
13920 |
{ |
|
13921 |
if (currentEditorSCTResId == R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG) |
|
13922 |
{ |
|
13923 |
if (iMode == EZhuyin) |
|
13924 |
{ |
|
13925 |
currentEditorSCTResId = |
|
13926 |
R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_FOR_ZHUYIN_SYMBOL_INPUT; |
|
13927 |
} |
|
13928 |
else |
|
13929 |
{ |
|
13930 |
currentEditorSCTResId = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_CHINESE; |
|
13931 |
} |
|
13932 |
} |
|
13933 |
} |
|
13934 |
if (currentEditorSCTResId == EDefaultSCTResourceId) // -1 forces the default in SCT resource definition |
|
13935 |
{ |
|
13936 |
if (iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) |
|
13937 |
{ |
|
13938 |
currentEditorSCTResId = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_LATIN_ONLY; |
|
13939 |
} |
|
13940 |
else |
|
13941 |
{ |
|
13942 |
// only ITU-T and when Bopomofo symbol input mode is supported, we use new sct table |
|
13943 |
TInt supportSCTToneMarks = EFalse; |
|
13944 |
MPtiCoreInfo* ptiCoreInfo = iPtiEngine->CoreInfo(EPtiEngineZhuyin); |
|
13945 |
||
13946 |
if(ptiCoreInfo) |
|
13947 |
{ |
|
13948 |
supportSCTToneMarks = ptiCoreInfo->CapsBits() & ESupportSCTToneMarks; |
|
13949 |
} |
|
13950 |
||
13951 |
ptiCoreInfo = iPtiEngine->CoreInfo(EPtiEngineZhuyinByPhrase); |
|
13952 |
if(ptiCoreInfo) |
|
13953 |
{ |
|
13954 |
supportSCTToneMarks = supportSCTToneMarks || |
|
13955 |
(ptiCoreInfo->CapsBits() & ESupportSCTToneMarks); |
|
13956 |
} |
|
13957 |
||
13958 |
if(!iQwertyInputMode && (iMode == EZhuyin) && supportSCTToneMarks) |
|
13959 |
{ |
|
13960 |
currentEditorSCTResId = |
|
13961 |
R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_FOR_ZHUYIN_SYMBOL_INPUT; |
|
13962 |
} |
|
13963 |
else |
|
13964 |
{ |
|
13965 |
if ( FeatureManager::FeatureSupported(KFeatureIdChinese) ) |
|
13966 |
{ |
|
13967 |
currentEditorSCTResId = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_CHINESE; |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
13968 |
} |
44 | 13969 |
else |
13970 |
{ |
|
13971 |
currentEditorSCTResId = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG; |
|
13972 |
} |
|
13973 |
} |
|
13974 |
} |
|
13975 |
} |
|
13976 |
return currentEditorSCTResId; |
|
13977 |
} |
|
13978 |
||
13979 |
void CAknFepManager::LaunchPictographCharacterTableL() |
|
13980 |
{ |
|
13981 |
DoLaunchSctAndPctL(NULL, EShowPctFirst); |
|
13982 |
} |
|
13983 |
||
13984 |
||
13985 |
void CAknFepManager::UpdateInlineEditL(const TDesC& aNewInlineText, |
|
13986 |
TInt aPositionOfInsertionPointInInlineText) |
|
13987 |
{ |
|
13988 |
if ( ! IsFlagSet ( EFlagInsideInlineEditingTransaction ) ) |
|
13989 |
{ |
|
13990 |
return; |
|
13991 |
} |
|
13992 |
// Japanese implementation needs to be merged with functionality of other languages. Now they are separate. |
|
13993 |
if (iLanguageCapabilities.iInputLanguageCode == ELangJapanese) |
|
13994 |
{ |
|
13995 |
iUncommittedText.iCursorPos = iUncommittedText.iAnchorPos + |
|
13996 |
aPositionOfInsertionPointInInlineText; |
|
13997 |
||
13998 |
if (aNewInlineText.Length() == 1) |
|
13999 |
{ |
|
14000 |
if (aNewInlineText[0] == KAknFEPLineFeedSymbol || |
|
14001 |
aNewInlineText[0] == KAknFEPMirroredLineFeedSymbol) |
|
14002 |
{ |
|
14003 |
SetFlag(EFlagLineFeedCharacter); |
|
14004 |
ClearFlag(EFlagSpaceCharacter | EFlagFullWidthSpaceCharacter); |
|
14005 |
} |
|
14006 |
else if (aNewInlineText[0] == iSpaceCharacterCode) |
|
14007 |
{ |
|
14008 |
SetFlag(EFlagSpaceCharacter); |
|
14009 |
ClearFlag(EFlagLineFeedCharacter | EFlagFullWidthSpaceCharacter); |
|
14010 |
} |
|
14011 |
else if (aNewInlineText[0] == iFullWidthSpaceCharacterCode) |
|
14012 |
{ |
|
14013 |
SetFlag(EFlagFullWidthSpaceCharacter); |
|
14014 |
ClearFlag(EFlagLineFeedCharacter | EFlagSpaceCharacter); |
|
14015 |
} |
|
14016 |
else |
|
14017 |
{ |
|
14018 |
ClearFlag(EFlagLineFeedCharacter |
|
14019 |
| EFlagSpaceCharacter |
|
14020 |
| EFlagFullWidthSpaceCharacter); |
|
14021 |
} |
|
14022 |
if (iInputCapabilities.SupportsSecretText()) |
|
14023 |
{ |
|
14024 |
TBuf<1> buf; |
|
14025 |
buf.Append(aNewInlineText[0]); |
|
14026 |
NewCharacterL(buf); |
|
14027 |
} |
|
14028 |
else |
|
14029 |
{ |
|
14030 |
SetFlag(EFlagInsideMultitapInlineEditingTransaction); |
|
14031 |
iInputCapabilities.FepAwareTextEditor()->UpdateFepInlineTextL(aNewInlineText, |
|
14032 |
aPositionOfInsertionPointInInlineText); |
|
14033 |
} |
|
14034 |
} |
|
14035 |
else |
|
14036 |
{ |
|
14037 |
ClearFlag(EFlagLineFeedCharacter | EFlagSpaceCharacter | EFlagFullWidthSpaceCharacter); |
|
14038 |
iInputCapabilities.FepAwareTextEditor()->UpdateFepInlineTextL(aNewInlineText, |
|
14039 |
aPositionOfInsertionPointInInlineText); |
|
14040 |
} |
|
14041 |
#ifdef _DEBUG |
|
14042 |
RDebug::Print(_L("UpdateInlineEditL text=[%S] len=[%d] CurPos=[%d] AncPos=[%d] change=[%d]"), |
|
14043 |
&aNewInlineText, iUncommittedText.Length(), |
|
14044 |
iUncommittedText.iCursorPos, iUncommittedText.iAnchorPos, |
|
14045 |
aPositionOfInsertionPointInInlineText); |
|
14046 |
#endif |
|
14047 |
} |
|
14048 |
else |
|
14049 |
{ |
|
14050 |
TInt curPos = iUncommittedText.iAnchorPos + aNewInlineText.Length(); |
|
14051 |
||
14052 |
TInt deltaCur = curPos - iUncommittedText.iCursorPos; |
|
14053 |
||
14054 |
TInt maxEdSize = iInputCapabilities.FepAwareTextEditor()->DocumentMaximumLengthForFep(); |
|
14055 |
||
14056 |
TInt docLength = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
14057 |
||
14058 |
HBufC* newInlineText=NULL; |
|
14059 |
||
14060 |
TBool syncLater = ETrue; |
|
14061 |
// we have to restrict to a length that is permissible in the editor |
|
14062 |
// this situation comes when we select the max length condition is reached |
|
14063 |
// in the editor and we navigate to one of the words in the middle |
|
14064 |
// and select a longer word from the candidate list |
|
14065 |
||
14066 |
||
14067 |
if( (maxEdSize > 0) && ( deltaCur > 0 ) |
|
14068 |
&& (( docLength + deltaCur) > maxEdSize ) ) |
|
14069 |
{ |
|
14070 |
newInlineText= aNewInlineText.Left( aNewInlineText.Length() - (docLength + deltaCur - maxEdSize )).AllocLC(); |
|
14071 |
aPositionOfInsertionPointInInlineText=newInlineText->Length(); |
|
14072 |
} |
|
14073 |
else if((maxEdSize > 0) && (curPos > maxEdSize)) |
|
14074 |
{ |
|
14075 |
newInlineText= aNewInlineText.Left(maxEdSize - iUncommittedText.iAnchorPos).AllocLC(); |
|
14076 |
aPositionOfInsertionPointInInlineText=newInlineText->Length(); |
|
14077 |
} |
|
14078 |
else |
|
14079 |
{ |
|
14080 |
newInlineText=aNewInlineText.AllocLC(); |
|
14081 |
syncLater = EFalse; |
|
14082 |
} |
|
14083 |
// The Below code changes are made to sync iTextBuffer and the last word in the editor.When the |
|
14084 |
// cursor position reaches more than the max length of editor, tail length is modified according |
|
14085 |
// to truncated last word and Autocompletion bit length (Element count) value to display last |
|
14086 |
// word in the editor properly. |
|
14087 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
14088 |
if(syncLater) |
|
14089 |
{ |
|
14090 |
TBuf<CAknFepManager::EMaximumFepWordLength> currentText = iPtiEngine->CurrentWord(); |
|
14091 |
currentText.SetLength(newInlineText->Length()); |
|
14092 |
iPtiEngine->HandleCommandL( EPtiCommandSetCursorCrossedMaxLength ); |
|
14093 |
iPtiEngine->SetCurrentWord(currentText); |
|
14094 |
TransferFepStateToEditorL(); |
|
14095 |
iPtiEngine->HandleCommandL( EPtiCommandResetCursorCrossedMaxLength ); |
|
14096 |
} |
|
14097 |
#endif |
|
14098 |
// CleanupStack::PushL(TCleanupItem(ClearFepStateOnLeave,this)); |
|
14099 |
iUncommittedText.iCursorPos = iUncommittedText.iAnchorPos + aPositionOfInsertionPointInInlineText; |
|
14100 |
||
14101 |
HBufC* decoratedInlineEdit = HBufC::NewLC(aNewInlineText.Length()*3); |
|
14102 |
TPtr bufferPtr(decoratedInlineEdit->Des()); |
|
14103 |
||
14104 |
if ( EditorSupportsNeutralProtection() ) |
|
14105 |
{ |
|
14106 |
if ( newInlineText->Length() > 0 ) |
|
14107 |
{ |
|
14108 |
iInlineTextDecorator->DecorateInlineText( |
|
14109 |
newInlineText->Des(), |
|
14110 |
bufferPtr, |
|
14111 |
aPositionOfInsertionPointInInlineText, |
|
14112 |
static_cast<TChar>(PreviousChar()), |
|
14113 |
IsRightToLeftParagraph(DocPos() ), |
|
14114 |
( CurrentInputDirectionality() == TBidiText::ERightToLeft ) ); |
|
14115 |
} |
|
14116 |
||
14117 |
// Because the length of the new inline edit may bear no relation to the old inline edit, |
|
14118 |
// the passed desired position of the cursor (which is hidden in S60 anyway) in the new |
|
14119 |
// inline edit is restricted to its Length(). The input value of parameter |
|
14120 |
// aPositionOfInsertionPointInInlineText is ignored, and its modified value |
|
14121 |
// from the DecorateInlineText routine is also ignored. |
|
14122 |
||
14123 |
aPositionOfInsertionPointInInlineText = decoratedInlineEdit->Length(); |
|
14124 |
||
14125 |
iUncommittedText.iCursorPos = iUncommittedText.iAnchorPos + aPositionOfInsertionPointInInlineText; |
|
14126 |
||
14127 |
iInputCapabilities.FepAwareTextEditor()->UpdateFepInlineTextL( |
|
14128 |
bufferPtr, aPositionOfInsertionPointInInlineText); |
|
14129 |
||
14130 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
14131 |
iUncommittedText.iAnchorPos-=decoratedInlineEdit->Length(); |
|
14132 |
} |
|
14133 |
||
14134 |
else |
|
14135 |
{ |
|
14136 |
// Even without the issue of decoration, the length of the new inline edit may bear no |
|
14137 |
// relation to the old inline edit. It is always set to length (the end) of the new inline edit |
|
14138 |
aPositionOfInsertionPointInInlineText = newInlineText->Length(); |
|
14139 |
||
14140 |
iInputCapabilities.FepAwareTextEditor()->UpdateFepInlineTextL( |
|
14141 |
newInlineText->Des(), aPositionOfInsertionPointInInlineText); |
|
14142 |
||
14143 |
// This is needed here too because we should not insist that the new text is the same length |
|
14144 |
// as the old, and so the iUncommitted text should be reset. |
|
14145 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
14146 |
iUncommittedText.iAnchorPos-=newInlineText->Length(); |
|
14147 |
} |
|
14148 |
||
14149 |
||
14150 |
CleanupStack::PopAndDestroy(decoratedInlineEdit); |
|
14151 |
SendEventsToPluginManL( EPluginSyncFepAwareText, EPluginSyncUpdatedText ); |
|
14152 |
CleanupStack::PopAndDestroy(newInlineText); |
|
14153 |
//Send info to engine to set EPtiXt9FlagAutoCompletionSetOnToOff flag as false |
|
14154 |
TInt value = 0; |
|
14155 |
TRAP_IGNORE(iPtiEngine->HandleCommandL( EPtiCommandAutoCompletionOnToOff,&value)); |
|
14156 |
} |
|
14157 |
} |
|
14158 |
||
14159 |
void CAknFepManager::StartInlineEditL() |
|
14160 |
{ |
|
14161 |
if(iConcatenationTimer->IsActive()) |
|
14162 |
iConcatenationTimer->Cancel(); |
|
14163 |
||
14164 |
//currently western only, would need to sort out flags if this were to be used |
|
14165 |
//in multitap modes |
|
14166 |
switch (iMode) |
|
14167 |
{ |
|
14168 |
case ELatin: |
|
14169 |
case EKatakana: |
|
14170 |
case EHiragana: |
|
14171 |
iInputCapabilities.FepAwareTextEditor()->StartFepInlineEditL(KNullDesC, 0, EFalse, |
|
14172 |
NULL, *this, *this); |
|
14173 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
14174 |
break; |
|
14175 |
default: |
|
14176 |
iInputCapabilities.FepAwareTextEditor()->StartFepInlineEditL(KNullDesC, 0, EFalse, |
|
14177 |
NULL, *this, *this); |
|
14178 |
break; |
|
14179 |
} |
|
14180 |
#ifdef _DEBUG |
|
14181 |
RDebug::Print(_L("StartInlineEditL len=[%d] CurPos=[%d] AncPos=[%d]"), |
|
14182 |
iUncommittedText.Length(), |
|
14183 |
iUncommittedText.iCursorPos, iUncommittedText.iAnchorPos ); |
|
14184 |
#endif |
|
14185 |
||
14186 |
// have to calculate the number of free space on current EDITOR after StartFepInlineEditL(). |
|
14187 |
TInt maxEdSize = iInputCapabilities.FepAwareTextEditor()->DocumentMaximumLengthForFep(); |
|
14188 |
TInt edSize = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
14189 |
iFreeSpaceOfEditor = maxEdSize - edSize; |
|
14190 |
||
14191 |
SetFlag(EFlagInsideInlineEditingTransaction); |
|
14192 |
} |
|
14193 |
||
14194 |
void CAknFepManager::StartInlineEditL(const TDesC& aText) |
|
14195 |
{ |
|
14196 |
if(iConcatenationTimer->IsActive()) |
|
14197 |
iConcatenationTimer->Cancel(); |
|
14198 |
||
14199 |
TInt textLength = aText.Length(); |
|
14200 |
||
14201 |
// CleanupStack::PushL(TCleanupItem(ClearFepStateOnLeave,this)); |
|
14202 |
||
14203 |
HBufC* decoratedInlineEdit = HBufC::NewLC(aText.Length()*3); |
|
14204 |
TPtr bufferPtr(decoratedInlineEdit->Des()); |
|
14205 |
||
14206 |
// decorate the inline edit |
|
14207 |
if( aText.Length() > 0 && EditorSupportsNeutralProtection() ) |
|
14208 |
{ |
|
14209 |
iInlineTextDecorator->DecorateInlineText( |
|
14210 |
aText, |
|
14211 |
bufferPtr, |
|
14212 |
textLength, // aPositionOfInsertionPointInInlineText, |
|
14213 |
static_cast<TChar>(PreviousChar()), |
|
14214 |
IsRightToLeftParagraph( DocPos() ), |
|
14215 |
( CurrentInputDirectionality() == TBidiText::ERightToLeft ) ); |
|
14216 |
} |
|
14217 |
else |
|
14218 |
{ |
|
14219 |
||
14220 |
bufferPtr.Copy(aText); |
|
14221 |
} |
|
14222 |
||
14223 |
// Before starting editor inline, we cancel editor inline if by any chance editor ends up in inline edit and fep does not |
|
14224 |
TBool phoneIdle = (EditorType() == CAknExtendedInputCapabilities::EPhoneNumberEditor); |
|
14225 |
||
14226 |
if(phoneIdle) |
|
14227 |
{ |
|
14228 |
iInputCapabilities.FepAwareTextEditor()->CancelFepInlineEdit(); |
|
14229 |
} |
|
14230 |
||
14231 |
// operates at the current insertion point or selection |
|
14232 |
iInputCapabilities.FepAwareTextEditor()->StartFepInlineEditL( |
|
14233 |
||
14234 |
bufferPtr, |
|
14235 |
textLength, // aPositionOfInsertionPointInInlineText, |
|
14236 |
EFalse, // Cursor visibility |
|
14237 |
0, // MFormCustomDrawer* |
|
14238 |
*this, |
|
14239 |
*this); |
|
14240 |
||
14241 |
// CleanupStack::Pop(); // cleanupitem for FEP state. |
|
14242 |
||
14243 |
if (!iInputCapabilities.FepAwareTextEditor()) |
|
14244 |
{ |
|
14245 |
// In case while starting the inline edit, 3rd party app removes the focus out of editor before the transaction |
|
14246 |
// completes, we return with an error. |
|
14247 |
User::Leave(KErrCorrupt); |
|
14248 |
} |
|
14249 |
// cursor span needs to be updated following potential modification |
|
14250 |
// of the inline edit content before it was started |
|
14251 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
14252 |
iUncommittedText.iAnchorPos-=decoratedInlineEdit->Length(); |
|
14253 |
CleanupStack::PopAndDestroy(decoratedInlineEdit); |
|
14254 |
||
14255 |
SetFlag(EFlagInsideInlineEditingTransaction); |
|
14256 |
} |
|
14257 |
||
14258 |
void CAknFepManager::StartInlineEditL(TCursorSelection aCursorSelection, |
|
14259 |
const TDesC& aInitialInlineText, |
|
14260 |
TInt aPositionOfInsertionPointInInlineText, |
|
14261 |
TBool aCursorVisibility) |
|
14262 |
{ |
|
14263 |
||
14264 |
if(iConcatenationTimer->IsActive()) |
|
14265 |
iConcatenationTimer->Cancel(); |
|
14266 |
||
14267 |
TBool setToTrue=EFalse; |
|
14268 |
||
14269 |
// setToTrue parameter forces use of selection hiding inline edit editor API - |
|
14270 |
// this method also sets the cursor selection to the second parameter |
|
14271 |
// CleanupStack::PushL(TCleanupItem(ClearFepStateOnLeave,this)); |
|
14272 |
iInputCapabilities.FepAwareTextEditor()->Extension1()->StartFepInlineEditL( |
|
14273 |
setToTrue, |
|
14274 |
aCursorSelection, |
|
14275 |
aInitialInlineText, |
|
14276 |
aPositionOfInsertionPointInInlineText, |
|
14277 |
aCursorVisibility, |
|
14278 |
0, // MFormCustomDrawer* ? |
|
14279 |
*this, |
|
14280 |
*this); |
|
14281 |
// CleanupStack::Pop(); // cleanupitem for FEP state. |
|
14282 |
SetFlag(EFlagInsideInlineEditingTransaction); |
|
14283 |
//This will suppress Edit submenu from poping up |
|
14284 |
SetCcpuFlag(ECcpuStateIgnoreStarUp); |
|
14285 |
} |
|
14286 |
||
14287 |
TBool CAknFepManager::CloseUiIfWordDeletedL() |
|
14288 |
{ |
|
14289 |
if (iUncommittedText.Length()==0) |
|
14290 |
{ |
|
14291 |
// word has been totally deleted |
|
14292 |
ClearFlag(EFlagCompoundWord); |
|
14293 |
TryCloseUiL(); |
|
14294 |
return ETrue; |
|
14295 |
} |
|
14296 |
return EFalse; |
|
14297 |
} |
|
14298 |
||
14299 |
TBool CAknFepManager::TryGetTextToUncommitL(TDes& aText, TInt aCode, TBool& aComsumeKey) |
|
14300 |
{ |
|
14301 |
TWesternNaviEvent naviEvent = ENullNaviEvent; |
|
14302 |
if (aCode == EKeyLeftArrow) |
|
14303 |
{ |
|
14304 |
naviEvent = ELeftNaviEvent; |
|
14305 |
} |
|
14306 |
else if (aCode == EKeyRightArrow) |
|
14307 |
{ |
|
14308 |
naviEvent = ERightNaviEvent; |
|
14309 |
} |
|
14310 |
else if (aCode == EKeyBackspace) |
|
14311 |
{ |
|
14312 |
naviEvent = EBackspaceEvent; |
|
14313 |
} |
|
14314 |
||
14315 |
TInt nextCharPos = 0; // Character ordinal in logical memory (0 - n-1) |
|
14316 |
TBool hindibackspace = 0 ; |
|
14317 |
TBool nextPositionFound = EFalse; |
|
14318 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
14319 |
if ( naviEvent == ERightNaviEvent ) |
|
14320 |
{ |
|
14321 |
nextPositionFound = GetNextVisualRightCharacter( nextCharPos ); |
|
14322 |
if( (TAknFepUiIndicInputManager :: IsIndicLangauge(TLanguage(iLanguageCapabilities.iInputLanguageCode))) || |
|
14323 |
(TLanguage(iLanguageCapabilities.iInputLanguageCode) == ELangThai)) |
|
14324 |
{ |
|
14325 |
FindStartOfWord(nextCharPos); |
|
14326 |
||
14327 |
if(nextCharPos < iUncommittedText.LowerPos()) |
|
14328 |
{ |
|
14329 |
nextCharPos = iUncommittedText.LowerPos(); |
|
14330 |
} |
|
14331 |
} |
|
14332 |
} |
|
14333 |
else if ( naviEvent == ELeftNaviEvent ) |
|
14334 |
{ |
|
14335 |
nextPositionFound = GetNextVisualLeftCharacter( nextCharPos ); |
|
14336 |
if( nextPositionFound && (TAknFepUiIndicInputManager :: IsIndicLangauge(TLanguage(iLanguageCapabilities.iInputLanguageCode))) || |
|
14337 |
(nextPositionFound && (TLanguage(iLanguageCapabilities.iInputLanguageCode) == ELangThai))) |
|
14338 |
{ |
|
14339 |
FindEndOfWord(nextCharPos); |
|
14340 |
if(nextCharPos > iUncommittedText.HigherPos()) |
|
14341 |
{ |
|
14342 |
nextCharPos = iUncommittedText.HigherPos(); |
|
14343 |
} |
|
14344 |
} |
|
14345 |
||
14346 |
} |
|
14347 |
else if ( naviEvent == EBackspaceEvent ) |
|
14348 |
{ |
|
14349 |
if (iLanguageCapabilities.iRightToLeftLanguage) |
|
14350 |
{ |
|
14351 |
nextPositionFound = GetNextVisualRightCharacter( nextCharPos ); |
|
14352 |
} |
|
14353 |
else |
|
14354 |
{ |
|
14355 |
if( (TAknFepUiIndicInputManager :: IsIndicLangauge(TLanguage(iLanguageCapabilities.iInputLanguageCode))) || |
|
14356 |
(TLanguage(iLanguageCapabilities.iInputLanguageCode) == ELangThai)) |
|
14357 |
{ |
|
14358 |
TCursorSelection curSel; |
|
14359 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(curSel); |
|
14360 |
nextCharPos = curSel.iCursorPos; |
|
14361 |
hindibackspace = ETrue; |
|
14362 |
} |
|
14363 |
else |
|
14364 |
{ |
|
14365 |
nextPositionFound = GetNextVisualLeftCharacter( nextCharPos ); |
|
14366 |
} |
|
14367 |
} |
|
14368 |
} |
|
14369 |
||
14370 |
if ( !nextPositionFound && !hindibackspace ) |
|
14371 |
{ |
|
14372 |
aComsumeKey = EFalse; |
|
14373 |
return EFalse; |
|
14374 |
} |
|
14375 |
||
14376 |
TInt anchorPos = 0; |
|
14377 |
TInt cursorPos = 0; |
|
14378 |
TTmDocPosSpec pos = DocPos(); |
|
14379 |
CTmTextLayout::TTmChunkDescription leftChunk; |
|
14380 |
CTmTextLayout::TTmChunkDescription rightChunk; |
|
14381 |
FindAdjacentChunks(pos, leftChunk, rightChunk); |
|
14382 |
||
14383 |
if (( naviEvent == ELeftNaviEvent && leftChunk.iRightToLeft ) || |
|
14384 |
( naviEvent == ERightNaviEvent && !rightChunk.iRightToLeft )) |
|
14385 |
{ |
|
14386 |
anchorPos = nextCharPos; |
|
14387 |
cursorPos = nextCharPos; |
|
14388 |
FindEndOfWord(cursorPos); |
|
14389 |
} |
|
14390 |
else |
|
14391 |
{ |
|
14392 |
if( (TAknFepUiIndicInputManager :: IsIndicLangauge(TLanguage(iLanguageCapabilities.iInputLanguageCode))) || |
|
14393 |
(TLanguage(iLanguageCapabilities.iInputLanguageCode) == ELangThai)) |
|
14394 |
{ |
|
14395 |
cursorPos = nextCharPos; |
|
14396 |
} |
|
14397 |
else |
|
14398 |
{ |
|
14399 |
cursorPos = nextCharPos + 1; |
|
14400 |
} |
|
14401 |
anchorPos = nextCharPos; |
|
14402 |
FindStartOfWord(anchorPos); |
|
14403 |
} |
|
14404 |
||
14405 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
14406 |
TCursorSelection curSel; |
|
14407 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(curSel); |
|
14408 |
// if selection happens dont consume the event pass it to editor |
|
14409 |
if((naviEvent == EBackspaceEvent) |
|
14410 |
&& (!IsFlagSet(CAknFepManager::EFlagInsideInlineEditingTransaction)) |
|
14411 |
&& (curSel.iAnchorPos != curSel.iCursorPos)) |
|
14412 |
{ |
|
14413 |
aComsumeKey = EFalse; |
|
14414 |
return EFalse; |
|
14415 |
} |
|
14416 |
#endif |
|
14417 |
||
14418 |
iUncommittedText.SetSelection(cursorPos, anchorPos); |
|
14419 |
||
14420 |
if (iUncommittedText.Length() <= EMaximumFepWordLength) |
|
14421 |
{ |
|
14422 |
iInputCapabilities.FepAwareTextEditor()-> |
|
14423 |
GetEditorContentForFep(aText, iUncommittedText.iAnchorPos, iUncommittedText.Length()); |
|
14424 |
aComsumeKey = ETrue; |
|
14425 |
return ETrue; |
|
14426 |
} |
|
14427 |
else |
|
14428 |
{ |
|
14429 |
if (naviEvent == EBackspaceEvent) |
|
14430 |
{ |
|
14431 |
// delete the last character |
|
14432 |
cursorPos--; |
|
14433 |
iUncommittedText.SetSelection(cursorPos, cursorPos); |
|
14434 |
aComsumeKey = EFalse; |
|
14435 |
} |
|
14436 |
else |
|
14437 |
{ |
|
14438 |
TInt newCursorPosition= (pos.iPos == cursorPos) ? anchorPos : cursorPos; |
|
14439 |
iUncommittedText.SetSelection(newCursorPosition, newCursorPosition); |
|
14440 |
iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(iUncommittedText); |
|
14441 |
aComsumeKey = ETrue; |
|
14442 |
} |
|
14443 |
// The word is longer than EMaximumFepWordLength. Ui is deactivated. |
|
14444 |
TryCloseUiL(); |
|
14445 |
return EFalse; |
|
14446 |
} |
|
14447 |
} |
|
14448 |
||
14449 |
||
14450 |
TBool CAknFepManager::TryGetTextToUncommitL(TDes& aText, TBool& aComsumeKey) |
|
14451 |
{ |
|
14452 |
TInt nextCharRightPos = 0; // Character ordinal in logical memory (0 - n-1) |
|
14453 |
TInt nextCharLeftPos = 0; |
|
14454 |
TBool nextRightPosFound = EFalse; |
|
14455 |
TBool nextLeftPosFound = EFalse; |
|
14456 |
||
14457 |
nextRightPosFound = GetNextVisualRightCharacter( nextCharRightPos ); |
|
14458 |
if( (TAknFepUiIndicInputManager :: IsIndicLangauge(TLanguage(iLanguageCapabilities.iInputLanguageCode))) || |
|
14459 |
(TLanguage(iLanguageCapabilities.iInputLanguageCode) == ELangThai)) |
|
14460 |
{ |
|
14461 |
FindStartOfWord(nextCharRightPos); |
|
14462 |
||
14463 |
if(nextCharRightPos < iUncommittedText.LowerPos()) |
|
14464 |
{ |
|
14465 |
nextCharRightPos = iUncommittedText.LowerPos(); |
|
14466 |
} |
|
14467 |
} |
|
14468 |
||
14469 |
||
14470 |
nextLeftPosFound = GetNextVisualLeftCharacter( nextCharLeftPos ); |
|
14471 |
if( nextLeftPosFound && (TAknFepUiIndicInputManager :: IsIndicLangauge(TLanguage(iLanguageCapabilities.iInputLanguageCode))) || |
|
14472 |
(nextLeftPosFound && (TLanguage(iLanguageCapabilities.iInputLanguageCode) == ELangThai))) |
|
14473 |
{ |
|
14474 |
FindEndOfWord(nextCharLeftPos); |
|
14475 |
if(nextCharLeftPos > iUncommittedText.HigherPos()) |
|
14476 |
{ |
|
14477 |
nextCharLeftPos = iUncommittedText.HigherPos(); |
|
14478 |
} |
|
14479 |
} |
|
14480 |
||
14481 |
||
14482 |
||
14483 |
||
14484 |
if ( !nextRightPosFound && !nextLeftPosFound ) |
|
14485 |
{ |
|
14486 |
aComsumeKey = EFalse; |
|
14487 |
return EFalse; |
|
14488 |
} |
|
14489 |
||
14490 |
TInt anchorPos = 0; |
|
14491 |
TInt cursorPos = 0; |
|
14492 |
||
14493 |
||
14494 |
||
14495 |
TTmDocPosSpec pos = DocPos(); |
|
14496 |
CTmTextLayout::TTmChunkDescription leftChunk; |
|
14497 |
CTmTextLayout::TTmChunkDescription rightChunk; |
|
14498 |
FindAdjacentChunks(pos, leftChunk, rightChunk); |
|
14499 |
||
14500 |
/* |
|
14501 |
if( (TAknFepUiIndicInputManager :: IsIndicLangauge(TLanguage(iLanguageCapabilities.iInputLanguageCode))) || |
|
14502 |
(TLanguage(iLanguageCapabilities.iInputLanguageCode) == ELangThai)) |
|
14503 |
{ |
|
14504 |
cursorPos = pos.iPos; |
|
14505 |
} |
|
14506 |
else |
|
14507 |
{ |
|
14508 |
cursorPos = pos.iPos + 1; |
|
14509 |
} |
|
14510 |
*/ |
|
14511 |
||
14512 |
anchorPos = pos.iPos; |
|
14513 |
cursorPos = pos.iPos; |
|
14514 |
FindEndOfWord(cursorPos); |
|
14515 |
FindStartOfWord(anchorPos); |
|
14516 |
||
14517 |
||
14518 |
if(cursorPos == pos.iPos || anchorPos == pos.iPos) |
|
14519 |
{ |
|
14520 |
iUncommittedText.SetSelection(pos.iPos, pos.iPos); |
|
14521 |
aComsumeKey = ETrue; |
|
14522 |
return EFalse; |
|
14523 |
} |
|
14524 |
else |
|
14525 |
{ |
|
14526 |
iUncommittedText.SetSelection(cursorPos, anchorPos); |
|
14527 |
} |
|
14528 |
||
14529 |
if (iUncommittedText.Length() <= EMaximumFepWordLength) |
|
14530 |
{ |
|
14531 |
iInputCapabilities.FepAwareTextEditor()-> |
|
14532 |
GetEditorContentForFep(aText, iUncommittedText.iAnchorPos, iUncommittedText.Length()); |
|
14533 |
aComsumeKey = ETrue; |
|
14534 |
return ETrue; |
|
14535 |
} |
|
14536 |
else |
|
14537 |
{ |
|
14538 |
/* |
|
14539 |
TInt newCursorPosition= (pos.iPos == cursorPos) ? anchorPos : cursorPos; |
|
14540 |
iUncommittedText.SetSelection(newCursorPosition, newCursorPosition); |
|
14541 |
iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(iUncommittedText); |
|
14542 |
*/ |
|
14543 |
aComsumeKey = ETrue; |
|
14544 |
// The word is longer than EMaximumFepWordLength. Ui is deactivated. |
|
14545 |
TryCloseUiL(); |
|
14546 |
return EFalse; |
|
14547 |
} |
|
14548 |
} |
|
14549 |
||
14550 |
void CAknFepManager::UpdateCbaL(TInt aResourceId) |
|
14551 |
{ |
|
14552 |
if ( !IsFepAwareTextEditor() ) |
|
14553 |
{ |
|
14554 |
return; |
|
14555 |
} |
|
14556 |
||
14557 |
if (IsCcpuFlagSet(ECcpuStateStartCopy | ECcpuStateCopy | ECcpuStateStartCut | ECcpuStateCut)) |
|
14558 |
{ |
|
14559 |
return; |
|
14560 |
} |
|
14561 |
||
14562 |
if((iAknEditorFlags & EAknEditorFlagFindPane)&& IsChineseInputLanguage()&& aResourceId != NULL) |
|
14563 |
{ |
|
14564 |
return; |
|
14565 |
} |
|
14566 |
||
14567 |
iUiInterface->UpdateSoftkeysL(aResourceId, EditorState(), this, |
|
14568 |
iSharedDataInterface->InputMode()); |
|
14569 |
} |
|
14570 |
||
14571 |
||
14572 |
TBool CAknFepManager::TryRemoveNoMatchesIndicatorL() |
|
14573 |
{ |
|
14574 |
__ASSERT_DEBUG(IsFlagSet(EFlagInsideInlineEditingTransaction), |
|
14575 |
AknFepPanic(EAknFepPanicNotInsideInlineEdit)); |
|
14576 |
||
14577 |
if (IsFlagSet(CAknFepManager::EFlagNoMatches)) |
|
14578 |
{ |
|
14579 |
ClearFlag(CAknFepManager::EFlagNoMatches); |
|
14580 |
TBuf<EMaximumFepWordLength> newText; |
|
14581 |
iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(newText, |
|
14582 |
iUncommittedText.iAnchorPos, |
|
14583 |
iUncommittedText.Length()); |
|
14584 |
iInputCapabilities.FepAwareTextEditor()->UpdateFepInlineTextL(newText, |
|
14585 |
iUncommittedText.Length()); |
|
14586 |
SendEventsToPluginManL( EPluginSyncFepAwareText ); |
|
14587 |
return ETrue; |
|
14588 |
} |
|
14589 |
return EFalse; |
|
14590 |
} |
|
14591 |
||
14592 |
TBool CAknFepManager::IsMoreGoodWordsComing(TInt aNewWordLength) const |
|
14593 |
{ |
|
14594 |
return (aNewWordLength == iUncommittedText.Length() + 1); |
|
14595 |
} |
|
14596 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
14597 |
TBool CAknFepManager::IsMoreGoodAutoCompleteWordsComing(TInt aInputMode,TInt aPreviousWordLength, |
|
14598 |
TInt aNewWordLength) const |
|
14599 |
{ |
|
14600 |
return ((aInputMode == EPtiEngineWordCompletion) && (aPreviousWordLength != aNewWordLength )); |
|
14601 |
} |
|
14602 |
#endif |
|
14603 |
||
14604 |
void CAknFepManager::TryStartCompoundWord() |
|
14605 |
{ |
|
14606 |
// check if this word constitutes a 'compound' word |
|
14607 |
// i.e. is either adjacent char is an alphabetic characeter |
|
14608 |
TBuf<ESingleCharacter> ch; |
|
14609 |
// check the previous character |
|
14610 |
if(iUncommittedText.iAnchorPos>0) |
|
14611 |
{ |
|
14612 |
iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(ch, |
|
14613 |
iUncommittedText.iAnchorPos-1, |
|
14614 |
ESingleCharacter); |
|
14615 |
if (ch.Length()>0 && STATIC_CAST(TChar, IsValidInLineCharacter(ch[0]))) |
|
14616 |
{ |
|
14617 |
SetFlag(EFlagCompoundWord); |
|
14618 |
} |
|
14619 |
} |
|
14620 |
||
14621 |
// check the next character |
|
14622 |
TInt edSize = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
14623 |
if (!IsFlagSet(EFlagCompoundWord) && iUncommittedText.iAnchorPos < edSize) |
|
14624 |
{ |
|
14625 |
iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(ch, |
|
14626 |
iUncommittedText.iAnchorPos, |
|
14627 |
ESingleCharacter); |
|
14628 |
if (ch.Length()>0 && STATIC_CAST(TChar, IsValidInLineCharacter(ch[0]))) |
|
14629 |
{ |
|
14630 |
SetFlag(EFlagCompoundWord); |
|
14631 |
} |
|
14632 |
} |
|
14633 |
} |
|
14634 |
||
14635 |
void CAknFepManager::AddCompoundWordToUdbL() |
|
14636 |
{ |
|
14637 |
__ASSERT_DEBUG(WesternPredictive() , AknFepPanic(EAknFepPanicNonPermittedEditorMode)); |
|
14638 |
||
14639 |
HBufC* compoundWordBuf = |
|
14640 |
HBufC::NewLC(iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep()); // buffer for text |
|
14641 |
TPtr compoundWord=compoundWordBuf->Des(); |
|
14642 |
||
14643 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
14644 |
||
14645 |
// reset cursor span on word |
|
14646 |
FindStartOfWord(iUncommittedText.iAnchorPos); |
|
14647 |
FindEndOfWord(iUncommittedText.iCursorPos); |
|
14648 |
||
14649 |
iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(compoundWord, |
|
14650 |
iUncommittedText.iAnchorPos, |
|
14651 |
iUncommittedText.Length()); |
|
14652 |
FepUI()->AddTextToUserDictionaryL(compoundWord); |
|
14653 |
CleanupStack::PopAndDestroy(); // compoundWordBuf |
|
14654 |
} |
|
14655 |
||
14656 |
void CAknFepManager::SetWesternPredictive( const TBool aWesternPredictive ) |
|
14657 |
{ |
|
14658 |
const TInt previousValue = iWesternPredictive; |
|
14659 |
iWesternPredictive = aWesternPredictive && !(iAknEditorFlags & EAknEditorFlagNoT9) && |
|
14660 |
// Predictive QWERTY (XT9) changes ----> |
|
14661 |
( |
|
14662 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
14663 |
( |
|
14664 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
14665 |
iLanguageCapabilities.iSupportsWesternPredictive |
|
14666 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
14667 |
&& !iQwertyInputMode) |
|
14668 |
|| (iLanguageCapabilities.iSupportsWesternQwertyPredictive && iQwertyInputMode) |
|
14669 |
#ifdef __HALF_QWERTY_KEYPAD |
|
14670 |
|| (iLanguageCapabilities.iSupportsWesternHalfQwertyPredictive && iQwertyInputMode) |
|
14671 |
#endif //__HALF_QWERTY_KEYPAD |
|
14672 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
14673 |
); |
|
14674 |
// Predictive QWERTY (XT9) changes <---- |
|
14675 |
if ( (previousValue != iWesternPredictive) && !(iAknEditorFlags & EAknEditorFlagNoT9) ) |
|
14676 |
{ |
|
14677 |
if (iWesternPredictive) |
|
14678 |
{ |
|
14679 |
iSharedDataInterface->SetPredictiveTextOn(); |
|
14680 |
} |
|
14681 |
else |
|
14682 |
{ |
|
14683 |
iSharedDataInterface->ResetPredictiveTextOn(); |
|
14684 |
} |
|
14685 |
if ( iFepPluginManager && iFepPluginManager->IsSupportITIOnFSQ() ) |
|
14686 |
{ |
|
14687 |
TRAP_IGNORE(SendEventsToPluginManL( EPluginUpdatePenInputITIStatus )); |
|
14688 |
} |
|
14689 |
} |
|
14690 |
} |
|
14691 |
||
14692 |
void CAknFepManager::SetWesternAutoComplete( const TBool aWesternAutoComplete ) |
|
14693 |
{ |
|
14694 |
const TInt previousValue = iIsAutoCompleteOn; |
|
14695 |
iIsAutoCompleteOn = aWesternAutoComplete && !(iAknEditorFlags & EAknEditorFlagNoT9); |
|
14696 |
if ( (previousValue != iIsAutoCompleteOn) && !(iAknEditorFlags & EAknEditorFlagNoT9) ) |
|
14697 |
{ |
|
14698 |
if (iIsAutoCompleteOn) |
|
14699 |
{ |
|
14700 |
iSharedDataInterface->SetPredictiveTextAutoCompleteOn(); |
|
14701 |
} |
|
14702 |
else |
|
14703 |
{ |
|
14704 |
iSharedDataInterface->ResetPredictiveTextAutoCompleteOn(); |
|
14705 |
} |
|
14706 |
} |
|
14707 |
} |
|
14708 |
||
14709 |
void CAknFepManager::SetJapanesePredictive(const TBool aJapanesePredictive) |
|
14710 |
{ |
|
14711 |
if (iJapanesePredictive != aJapanesePredictive) |
|
14712 |
{ |
|
14713 |
iJapanesePredictive = aJapanesePredictive; |
|
14714 |
} |
|
14715 |
if (iJapanesePredictive & iSharedDataInterface->PredictiveTextJapaneseOn() |
|
14716 |
|| !iJapanesePredictive & !iSharedDataInterface->PredictiveTextJapaneseOn()) |
|
14717 |
{ |
|
14718 |
if(iJapanesePredictive) |
|
14719 |
{ |
|
14720 |
iSharedDataInterface->SetJapanesePredictiveTextOn(); |
|
14721 |
} |
|
14722 |
else |
|
14723 |
{ |
|
14724 |
iSharedDataInterface->ResetJapanesePredictiveTextOn(); |
|
14725 |
} |
|
14726 |
} |
|
14727 |
} |
|
14728 |
||
14729 |
void CAknFepManager::SetQwertyMode(const TBool aQwertyInputMode) |
|
14730 |
{ |
|
14731 |
#ifdef RD_SCALABLE_UI_V2 |
|
14732 |
if( aQwertyInputMode && iFepPluginManager && |
|
14733 |
iSharedDataInterface->PluginInputMode() != EPluginInputModeNone |
|
14734 |
// Add this condition for addtion of ITI features on FSQ. |
|
14735 |
// iSharedDataInterface->QwertyInputMode() == 1, means that |
|
14736 |
// hw keyboard is slided, then need to close touch inputmethods. |
|
14737 |
&& iSharedDataInterface->QwertyInputMode() ) |
|
14738 |
{ |
|
14739 |
iFepPluginManager->ResetMenuState(EFalse); |
|
14740 |
ExitPluginSpellModeByCancel(); |
|
14741 |
TRAP_IGNORE(iFepPluginManager->ClosePluginInputModeL( ETrue )); |
|
14742 |
if ( iCancelPopupInQwerty ) |
|
14743 |
{ |
|
14744 |
TRAP_IGNORE( SimulateKeyEventL( EKeyCBA2 ) ); |
|
14745 |
} |
|
14746 |
} |
|
14747 |
SetQwertyModeToInputcapbility(); |
|
14748 |
#endif//RD_SCALABLE_UI_V2 |
|
14749 |
if (!COMPARE_BOOLS(aQwertyInputMode, iQwertyInputMode)) |
|
14750 |
{ |
|
14751 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
14752 |
if(IsAutoCompleteOn()) |
|
14753 |
{ |
|
14754 |
TRAP_IGNORE(RemoveSuggestedCompletionL()); |
|
14755 |
} |
|
14756 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
14757 |
iQwertyInputMode = aQwertyInputMode; |
|
14758 |
if (!iQwertyInputMode) |
|
14759 |
{ |
|
14760 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
14761 |
SetTypingCorrectionLevel(EPtiErrorCorrectionLevelHigh); |
|
14762 |
SetNumberCandidateState(ETrue); // ETrue |
|
14763 |
SetPrimaryCandidate(EFalse); // Best prediction |
|
14764 |
#endif |
|
14765 |
ClearFlag(EFlagQwertyShiftMode | EFlagNoActionDuringChrKeyPress); |
|
14766 |
} |
|
14767 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
14768 |
else |
|
14769 |
{ |
|
14770 |
iSharedDataInterface->HandlePredictiveTextNumberCandidateSettingChange(); |
|
14771 |
iSharedDataInterface->HandlePredictiveTextTypingCorrectionLevelChange(); |
|
14772 |
iSharedDataInterface->HandlePredictiveTextPrimaryCandidateChange(); |
|
14773 |
} |
|
14774 |
#endif |
|
14775 |
||
14776 |
if ( iFepManState != EAknFepStateNull && IsFepAwareTextEditor() ) |
|
14777 |
{ |
|
14778 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
14779 |
||
14780 |
// In case of layout remove the auto completion part |
|
14781 |
// Before transfer fep state to editor state. |
|
14782 |
if(IsAutoCompleteOn()) |
|
14783 |
{ |
|
14784 |
#ifdef RD_SCALABLE_UI_V2 |
|
14785 |
if( iFepPluginManager |
|
14786 |
&& iFepPluginManager->IsSupportITIOnFSQ() |
|
14787 |
&& !iQwertyInputMode ) |
|
14788 |
{ |
|
14789 |
TRAP_IGNORE( iPtiEngine->HandleCommandL( EPtiCommandLockCurrentCandidate ) ); |
|
14790 |
} |
|
14791 |
else |
|
14792 |
#endif //RD_SCALABLE_UI_V2 |
|
14793 |
{ |
|
14794 |
TInt tailLength = 0; |
|
14795 |
TRAP_IGNORE(iPtiEngine->HandleCommandL( EPtiCommandGetAutoCompletionTailLength, &tailLength )); |
|
14796 |
if(tailLength > 0) |
|
14797 |
{ |
|
14798 |
TRAP_IGNORE( |
|
14799 |
{ |
|
14800 |
RemoveSuggestedAdvanceCompletionL(); |
|
14801 |
iPtiEngine->HandleCommandL( EPtiCommandLockCurrentCandidate ); |
|
14802 |
}); |
|
14803 |
} |
|
14804 |
} |
|
14805 |
} |
|
14806 |
#endif |
|
14807 |
if ( !iFocusedItemDestroy ) |
|
14808 |
{ |
|
14809 |
TRAP_IGNORE( |
|
14810 |
{ |
|
14811 |
TransferFepStateToEditorL(); |
|
14812 |
TryCloseUiL(); |
|
14813 |
ConfigureFEPFromEditorStateL(); |
|
14814 |
}); |
|
14815 |
} |
|
14816 |
} |
|
14817 |
} |
|
14818 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
14819 |
if(iFnKeyManager) |
|
14820 |
iFnKeyManager->SetQwertyInputMode(aQwertyInputMode); |
|
14821 |
#endif |
|
14822 |
} |
|
14823 |
||
14824 |
TBool CAknFepManager::WesternPredictive(TInt aMode) const |
|
14825 |
{ |
|
14826 |
TInt mode = iMode; |
|
14827 |
if ( aMode ) |
|
14828 |
{ |
|
14829 |
mode = aMode; |
|
14830 |
} |
|
14831 |
return (mode == ELatin && iWesternPredictive && |
|
14832 |
// Predictive QWERTY (XT9) changes ----> |
|
14833 |
||
14834 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
14835 |
(( |
|
14836 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
14837 |
iLanguageCapabilities.iSupportsWesternPredictive |
|
14838 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
14839 |
&& !iQwertyInputMode) |
|
14840 |
|| (iLanguageCapabilities.iSupportsWesternQwertyPredictive && iQwertyInputMode) |
|
14841 |
#ifdef __HALF_QWERTY_KEYPAD |
|
14842 |
|| (iLanguageCapabilities.iSupportsWesternHalfQwertyPredictive && iQwertyInputMode) |
|
14843 |
#endif //__HALF_QWERTY_KEYPAD |
|
14844 |
) |
|
14845 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
14846 |
); |
|
14847 |
// Predictive QWERTY (XT9) changes <---- |
|
14848 |
} |
|
14849 |
||
14850 |
TBool CAknFepManager::IsPredictive(TInt aMode) const |
|
14851 |
{ |
|
14852 |
TBool isPredictive = EFalse; |
|
14853 |
TInt mode = iMode; |
|
14854 |
if ( aMode ) |
|
14855 |
{ |
|
14856 |
mode = aMode; |
|
14857 |
} |
|
14858 |
if (mode == EHiraganaKanji ) |
|
14859 |
{ |
|
14860 |
if ((iPermittedInputModes & EAknEditorHiraganaKanjiInputMode) |
|
14861 |
&& iJapanesePredictive |
|
14862 |
&& !(iAknEditorFlags & EAknEditorFlagNoT9) |
|
14863 |
&& HasJapanesePredictionInputMode()) |
|
14864 |
{ |
|
14865 |
isPredictive = ETrue; |
|
14866 |
// Japanese predictive input is available on both Qwerty and not Qwerty |
|
14867 |
return isPredictive; |
|
14868 |
} |
|
14869 |
} |
|
14870 |
else if (mode == ELatin) |
|
14871 |
{ |
|
14872 |
if ((iPermittedInputModes & (EAknEditorTextInputMode | EAknEditorHalfWidthTextInputMode)) |
|
14873 |
&& !(iAknEditorFlags & EAknEditorFlagNoT9) |
|
14874 |
&& iWesternPredictive && |
|
14875 |
(iLanguageCapabilities.iSupportsWesternPredictive |
|
14876 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
14877 |
||iLanguageCapabilities.iSupportsWesternQwertyPredictive |
|
14878 |
#ifdef __HALF_QWERTY_KEYPAD |
|
14879 |
||iLanguageCapabilities.iSupportsWesternHalfQwertyPredictive |
|
14880 |
#endif //__HALF_QWERTY_KEYPAD |
|
14881 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
14882 |
)) // Predictive QWERTY (XT9) changes |
|
14883 |
{ |
|
14884 |
isPredictive = ETrue; |
|
14885 |
} |
|
14886 |
} |
|
14887 |
#ifdef RD_SCALABLE_UI_V2 |
|
14888 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
14889 |
return isPredictive; //&& (iFepPluginManager->PluginInputMode() == EPluginInputModeNone); |
|
14890 |
#else |
|
14891 |
return isPredictive && !iQwertyInputMode |
|
14892 |
&& ((iFepPluginManager->PluginInputMode() == EPluginInputModeItut) |
|
14893 |
|| (iFepPluginManager->PluginInputMode() == EPluginInputModeNone)); |
|
14894 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
14895 |
#else |
|
14896 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
14897 |
return isPredictive; |
|
14898 |
#else |
|
14899 |
return isPredictive && !iQwertyInputMode; |
|
14900 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
14901 |
#endif //RD_SCALABLE_UI_V2 |
|
14902 |
} |
|
14903 |
||
14904 |
TBool CAknFepManager::Japanese() const |
|
14905 |
{ |
|
14906 |
TBool rtn = EFalse; |
|
14907 |
switch (iMode) |
|
14908 |
{ |
|
14909 |
case EHiraganaKanji: |
|
14910 |
case EKatakana: |
|
14911 |
case EHiragana: |
|
14912 |
rtn = ETrue; |
|
14913 |
break; |
|
14914 |
case ELatin: |
|
14915 |
if ((!WesternPredictive()) && iCharWidth == EFullWidthChar) |
|
14916 |
{ |
|
14917 |
rtn = ETrue; |
|
14918 |
} |
|
14919 |
break; |
|
14920 |
case ENumber: |
|
14921 |
if (iCharWidth == EFullWidthChar) |
|
14922 |
{ |
|
14923 |
rtn = ETrue; |
|
14924 |
} |
|
14925 |
break; |
|
14926 |
default: |
|
14927 |
break; |
|
14928 |
} |
|
14929 |
return rtn; |
|
14930 |
} |
|
14931 |
||
14932 |
TBool CAknFepManager::IsOnlyFullWidthCharacterPermitted() const |
|
14933 |
{ |
|
14934 |
CAknEdwinState* editorState = EditorState(); |
|
14935 |
TUint permittedInputModes = editorState->PermittedInputModes(); |
|
14936 |
TUint fullWidthPermitted = (EAknEditorFullWidthTextInputMode |
|
14937 |
| EAknEditorFullWidthNumericInputMode |
|
14938 |
| EAknEditorFullWidthKatakanaInputMode); |
|
14939 |
TUint fullWidthNotPermitted = ~fullWidthPermitted; |
|
14940 |
TBool isfullchar = ETrue; |
|
14941 |
if (permittedInputModes & fullWidthNotPermitted) |
|
14942 |
{ |
|
14943 |
isfullchar = EFalse; |
|
14944 |
} |
|
14945 |
||
14946 |
if (!(permittedInputModes & fullWidthPermitted)) |
|
14947 |
{ |
|
14948 |
isfullchar = EFalse; |
|
14949 |
} |
|
14950 |
||
14951 |
return isfullchar; |
|
14952 |
} |
|
14953 |
||
14954 |
TBool CAknFepManager::IsOnlyHalfWidthCharacterPermitted() const |
|
14955 |
{ |
|
14956 |
CAknEdwinState* editorState = EditorState(); |
|
14957 |
TUint permittedInputModes; |
|
14958 |
if( editorState ) |
|
14959 |
{ |
|
14960 |
permittedInputModes= editorState->PermittedInputModes(); |
|
14961 |
} |
|
14962 |
else |
|
14963 |
{ |
|
14964 |
permittedInputModes = EAknEditorNumericInputMode; |
|
14965 |
} |
|
14966 |
TUint halfWidthNotPermitted = (EAknEditorFullWidthTextInputMode |
|
14967 |
| EAknEditorFullWidthNumericInputMode |
|
14968 |
| EAknEditorFullWidthKatakanaInputMode |
|
14969 |
| EAknEditorHiraganaKanjiInputMode |
|
14970 |
| EAknEditorHiraganaInputMode); |
|
14971 |
||
14972 |
TUint halfWidthPermitted = ~halfWidthNotPermitted; |
|
14973 |
TBool ishalfchar = ETrue; |
|
14974 |
if (permittedInputModes & halfWidthNotPermitted) |
|
14975 |
{ |
|
14976 |
ishalfchar = EFalse; |
|
14977 |
} |
|
14978 |
||
14979 |
if (!(permittedInputModes & halfWidthPermitted)) |
|
14980 |
{ |
|
14981 |
ishalfchar = EFalse; |
|
14982 |
} |
|
14983 |
if (permittedInputModes & EAknEditorTextInputMode) |
|
14984 |
{ |
|
14985 |
ishalfchar = EFalse; |
|
14986 |
} |
|
14987 |
if (editorState && (editorState->Flags() & EAknEditorFlagLatinInputModesOnly)) |
|
14988 |
{ |
|
14989 |
ishalfchar = ETrue; |
|
14990 |
} |
|
14991 |
return ishalfchar; |
|
14992 |
} |
|
14993 |
||
14994 |
TBool CAknFepManager::IsHalfAndFullKatakanaPermitted() const |
|
14995 |
{ |
|
14996 |
CAknEdwinState* editorState = EditorState(); |
|
14997 |
TUint permittedInputModes = editorState->PermittedInputModes(); |
|
14998 |
TUint katakanaInputMode = (EAknEditorKatakanaInputMode |
|
14999 |
| EAknEditorFullWidthKatakanaInputMode); |
|
15000 |
TBool iskatakana = EFalse; |
|
15001 |
if ((permittedInputModes & katakanaInputMode) == katakanaInputMode) |
|
15002 |
{ |
|
15003 |
iskatakana = ETrue; |
|
15004 |
} |
|
15005 |
return iskatakana; |
|
15006 |
} |
|
15007 |
||
15008 |
TBool CAknFepManager::IsHalfAndFullLatinPermitted() const |
|
15009 |
{ |
|
15010 |
CAknEdwinState* editorState = EditorState(); |
|
15011 |
TUint permittedInputModes = editorState->PermittedInputModes(); |
|
15012 |
TUint latinInputMode = (EAknEditorHalfWidthTextInputMode |
|
15013 |
| EAknEditorFullWidthTextInputMode); |
|
15014 |
TBool islatin = EFalse; |
|
15015 |
||
15016 |
if ((permittedInputModes & latinInputMode) == latinInputMode) |
|
15017 |
{ |
|
15018 |
islatin = ETrue; |
|
15019 |
} |
|
15020 |
return islatin; |
|
15021 |
} |
|
15022 |
||
15023 |
TBool CAknFepManager::IsHalfAndFullNumberPermitted() const |
|
15024 |
{ |
|
15025 |
CAknEdwinState* editorState = EditorState(); |
|
15026 |
TUint permittedInputModes = editorState->PermittedInputModes(); |
|
15027 |
TUint numInputMode = (EAknEditorNumericInputMode |
|
15028 |
| EAknEditorFullWidthNumericInputMode); |
|
15029 |
TBool isnum = EFalse; |
|
15030 |
if ((permittedInputModes & numInputMode) == numInputMode) |
|
15031 |
{ |
|
15032 |
isnum = ETrue; |
|
15033 |
} |
|
15034 |
||
15035 |
return isnum; |
|
15036 |
} |
|
15037 |
||
15038 |
TWidthChar CAknFepManager::CharacterWidth() const |
|
15039 |
{ |
|
15040 |
return iCharWidth; |
|
15041 |
} |
|
15042 |
||
15043 |
CPtiEngine* CAknFepManager::PtiEngine() const |
|
15044 |
{ |
|
15045 |
return iPtiEngine; |
|
15046 |
} |
|
15047 |
||
15048 |
void CAknFepManager::SetInlineEditingCursorVisibilityL(TBool aCursorVisibility) |
|
15049 |
{ |
|
15050 |
#ifdef RD_SCALABLE_UI_V2 |
|
15051 |
if ( SemiFepAwareTextEditor( ETrue ) ) |
|
15052 |
#else |
|
15053 |
if (iInputCapabilities.FepAwareTextEditor()) |
|
15054 |
#endif // RD_SCALABLE_UI_V2 |
|
15055 |
{ |
|
15056 |
iInputCapabilities.FepAwareTextEditor()->SetInlineEditingCursorVisibilityL(aCursorVisibility); |
|
15057 |
} |
|
15058 |
} |
|
15059 |
||
15060 |
TInt CAknFepManager::InputMode() const |
|
15061 |
{ |
|
15062 |
return iMode; |
|
15063 |
} |
|
15064 |
||
15065 |
TInt CAknFepManager::CangJieMode() const |
|
15066 |
{ |
|
15067 |
TInt shareMode = iSharedDataInterface->CangJieMode(); |
|
15068 |
TInt cangjieMode = shareMode + EPtiEngineNormalCangjieQwerty; |
|
15069 |
return cangjieMode; |
|
15070 |
} |
|
15071 |
||
15072 |
TBool CAknFepManager::InputLanguageSupportsCaseChanges() const |
|
15073 |
{ |
|
15074 |
return iLanguageCapabilities.iSupportsCase; |
|
15075 |
} |
|
15076 |
||
15077 |
TBool CAknFepManager::IsAbleScrollLatinPredictive() const |
|
15078 |
{ |
|
15079 |
return iSharedDataInterface->ScrollLatinPredictiveCandidates(); |
|
15080 |
} |
|
15081 |
||
15082 |
TText CAknFepManager::PreviousChar( TBool /*aContextSensitive*/ ) |
|
15083 |
{ |
|
15084 |
TBuf<ESingleCharacter> previousCharacter(ESingleCharacter); |
|
15085 |
previousCharacter.FillZ(); |
|
15086 |
||
15087 |
TCursorSelection curSel; |
|
15088 |
if ( IsFepAwareTextEditor() ) |
|
15089 |
{ |
|
15090 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(curSel); |
|
15091 |
TInt lowerpos = curSel.LowerPos(); |
|
15092 |
if(lowerpos > 0) |
|
15093 |
{ |
|
15094 |
iInputCapabilities.FepAwareTextEditor()-> |
|
15095 |
GetEditorContentForFep(previousCharacter, lowerpos-1, ESingleCharacter); |
|
15096 |
if (previousCharacter.Length()) |
|
15097 |
return previousCharacter[0]; |
|
15098 |
} |
|
15099 |
} |
|
15100 |
return NULL; |
|
15101 |
} |
|
15102 |
||
15103 |
TBool CAknFepManager::IsZWSCharacterPresent( TBool aLigaturePresent /* = EFalse*/ ) |
|
15104 |
{ |
|
15105 |
TBuf<3> previousCharacter; |
|
15106 |
previousCharacter.Zero(); |
|
15107 |
TBool found = EFalse; |
|
15108 |
previousCharacter.FillZ(); |
|
15109 |
||
15110 |
TCursorSelection curSel; |
|
15111 |
if ( IsFepAwareTextEditor() ) |
|
15112 |
{ |
|
15113 |
MCoeFepAwareTextEditor* fepAwareTextEditor = |
|
15114 |
iInputCapabilities.FepAwareTextEditor(); |
|
15115 |
fepAwareTextEditor->GetCursorSelectionForFep(curSel); |
|
15116 |
TInt lowerpos = curSel.LowerPos(); |
|
15117 |
if( lowerpos > 1 ) |
|
15118 |
{ |
|
15119 |
if( aLigaturePresent && lowerpos > 3 ) |
|
15120 |
{ |
|
15121 |
fepAwareTextEditor-> |
|
15122 |
GetEditorContentForFep(previousCharacter, |
|
15123 |
lowerpos - 4, 2); |
|
15124 |
} |
|
15125 |
else |
|
15126 |
{ |
|
15127 |
fepAwareTextEditor-> |
|
15128 |
GetEditorContentForFep(previousCharacter, |
|
15129 |
lowerpos - 2, 2); |
|
15130 |
} |
|
15131 |
if( previousCharacter[0] == ZERO_WIDTH_SPACE |
|
15132 |
|| previousCharacter[1] == ZERO_WIDTH_SPACE ) |
|
15133 |
{ |
|
15134 |
found = ETrue; |
|
15135 |
} |
|
15136 |
} |
|
15137 |
} |
|
15138 |
return found; |
|
15139 |
} |
|
15140 |
||
15141 |
TText CAknFepManager::NextChar() |
|
15142 |
{ |
|
15143 |
TBuf<ESingleCharacter> nextCharacter(ESingleCharacter); |
|
15144 |
nextCharacter.FillZ(); |
|
15145 |
||
15146 |
TCursorSelection curSel; |
|
15147 |
if ( IsFepAwareTextEditor() ) |
|
15148 |
{ |
|
15149 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(curSel); |
|
15150 |
TInt higherpos = curSel.HigherPos(); |
|
15151 |
TInt maxLength = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
15152 |
if ( higherpos >= 0 && higherpos <= maxLength && maxLength >= 1 ) |
|
15153 |
{ |
|
15154 |
iInputCapabilities.FepAwareTextEditor()-> |
|
15155 |
GetEditorContentForFep(nextCharacter, higherpos, ESingleCharacter); |
|
15156 |
if( nextCharacter.Length() ) |
|
15157 |
return nextCharacter[0]; |
|
15158 |
} |
|
15159 |
} |
|
15160 |
return NULL; |
|
15161 |
} |
|
15162 |
||
15163 |
void CAknFepManager::FindStartOfWord(TInt& aAnchorPos) const |
|
15164 |
{ |
|
15165 |
TBuf<ESingleCharacter> characterBuffer; |
|
15166 |
FOREVER |
|
15167 |
{ |
|
15168 |
if (aAnchorPos<=0) |
|
15169 |
{ |
|
15170 |
break; // start of editor |
|
15171 |
} |
|
15172 |
iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(characterBuffer, |
|
15173 |
aAnchorPos-1, |
|
15174 |
ESingleCharacter); |
|
15175 |
if (!IsValidInLineCharacter(characterBuffer[0])) |
|
15176 |
{ |
|
15177 |
break; |
|
15178 |
} |
|
15179 |
aAnchorPos--; |
|
15180 |
} |
|
15181 |
} |
|
15182 |
||
15183 |
void CAknFepManager::FindEndOfWord(TInt& aCursorPos) const |
|
15184 |
{ |
|
15185 |
TBuf<ESingleCharacter> characterBuffer; |
|
15186 |
FOREVER |
|
15187 |
{ |
|
15188 |
if (aCursorPos>=iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep()) |
|
15189 |
{ |
|
15190 |
break; // end of editor |
|
15191 |
} |
|
15192 |
iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(characterBuffer, |
|
15193 |
aCursorPos, |
|
15194 |
ESingleCharacter); |
|
15195 |
if (!IsValidInLineCharacter(characterBuffer[0])) |
|
15196 |
{ |
|
15197 |
break; |
|
15198 |
} |
|
15199 |
aCursorPos++; |
|
15200 |
} |
|
15201 |
} |
|
15202 |
||
15203 |
TBool CAknFepManager::CursorInsideWord() |
|
15204 |
{ |
|
15205 |
TBuf<ESingleCharacter> characterBuffer; |
|
15206 |
TBool insideWord=ETrue; |
|
15207 |
||
15208 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
15209 |
TInt cursorPos=iUncommittedText.iCursorPos; |
|
15210 |
||
15211 |
if (cursorPos) |
|
15212 |
{ |
|
15213 |
// check character before cursor |
|
15214 |
iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(characterBuffer, |
|
15215 |
cursorPos-1, |
|
15216 |
ESingleCharacter); |
|
15217 |
if (characterBuffer.Length()) |
|
15218 |
{ |
|
15219 |
if (!IsValidInLineCharacter(characterBuffer[0])) |
|
15220 |
{ |
|
15221 |
insideWord=EFalse; |
|
15222 |
} |
|
15223 |
} |
|
15224 |
} |
|
15225 |
else // at start of editor |
|
15226 |
{ |
|
15227 |
insideWord=EFalse; |
|
15228 |
} |
|
15229 |
||
15230 |
if (insideWord && cursorPos<iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep()) |
|
15231 |
{ |
|
15232 |
// put character after cursor into buffer |
|
15233 |
iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(characterBuffer, cursorPos, |
|
15234 |
ESingleCharacter); |
|
15235 |
if (characterBuffer.Length()) |
|
15236 |
{ |
|
15237 |
if (!IsValidInLineCharacter(characterBuffer[0])) |
|
15238 |
{ |
|
15239 |
insideWord=EFalse; |
|
15240 |
} |
|
15241 |
} |
|
15242 |
} |
|
15243 |
else // at end of editor |
|
15244 |
{ |
|
15245 |
insideWord=EFalse; |
|
15246 |
} |
|
15247 |
||
15248 |
return insideWord; |
|
15249 |
} |
|
15250 |
||
15251 |
void CAknFepManager::MoveCursorToStartOfWordL() |
|
15252 |
{ |
|
15253 |
TInt anchorPos=iUncommittedText.iAnchorPos; |
|
15254 |
FindStartOfWord(anchorPos); |
|
15255 |
iUncommittedText.SetSelection(anchorPos, anchorPos); |
|
15256 |
iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(iUncommittedText); |
|
15257 |
} |
|
15258 |
||
15259 |
void CAknFepManager::MoveCursorToEndOfWordL() |
|
15260 |
{ |
|
15261 |
TInt cursorPos=iUncommittedText.iCursorPos; |
|
15262 |
||
15263 |
if(!IsExtendedFlagSet(EExtendedFlagOkKeyPressOnCandidatePopup)) |
|
15264 |
FindEndOfWord(cursorPos); |
|
15265 |
iUncommittedText.SetSelection(cursorPos, cursorPos); |
|
15266 |
iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(iUncommittedText); |
|
15267 |
} |
|
15268 |
||
15269 |
TKeyResponse CAknFepManager::HandleNaviEventOutsideInlineEditL(TUint aCode, |
|
15270 |
TKeyPressLength aLength) |
|
15271 |
{ |
|
15272 |
TKeyResponse response = EKeyWasNotConsumed; |
|
15273 |
if ( iFepPluginManager && iFepPluginManager->PluginInputMode() == EPluginInputModeFingerHwr |
|
15274 |
&& aCode == EKeyBackspace ) |
|
15275 |
{ |
|
15276 |
return response; |
|
15277 |
} |
|
15278 |
||
15279 |
if (TryHandleCommonArrowAndBackspaceFunctionalityL(aCode, response)) |
|
15280 |
{ |
|
15281 |
return response; |
|
15282 |
} |
|
15283 |
if (WesternPredictive()) |
|
15284 |
{ |
|
15285 |
response = HandlePredictiveNaviEventOutsideInlineEditL(aCode, aLength); |
|
15286 |
} |
|
15287 |
||
15288 |
return response; |
|
15289 |
} |
|
15290 |
||
15291 |
TKeyResponse CAknFepManager::HandleWesternPredictiveArrowKeyL(TInt aCode, TKeyPressLength aLength) |
|
15292 |
{ |
|
15293 |
TKeyResponse response = EKeyWasNotConsumed; |
|
15294 |
||
15295 |
if (IsFlagSet(EFlagLineFeedCharacter)) |
|
15296 |
{ |
|
15297 |
// This event will stop the multitapping timer for enter chr. |
|
15298 |
// just return. |
|
15299 |
return EKeyWasConsumed; |
|
15300 |
} |
|
15301 |
||
15302 |
TCursorSelection selection; |
|
15303 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(selection); |
|
15304 |
if(!IsMfneEditor() && |
|
15305 |
( iFepPluginManager->PluginInputMode() == EPluginInputModeItut) && |
|
15306 |
selection.Length() > 0) |
|
15307 |
{ |
|
15308 |
// If open virtual ITUT and highlight some chars |
|
15309 |
return EKeyWasConsumed; |
|
15310 |
} |
|
15311 |
if (aCode == EKeyUpArrow || aCode == EKeyDownArrow) |
|
15312 |
{ |
|
15313 |
ClearFlag(EFlagCompoundWord); |
|
15314 |
if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
15315 |
{ |
|
15316 |
// moving out of an inline edit |
|
15317 |
TryRemoveNoMatchesIndicatorL(); |
|
15318 |
UpdateCbaL(NULL); |
|
15319 |
// To rip off suggested word completion when user presses UP / DOWN arrow keys |
|
15320 |
if(IsAutoCompleteOn()) |
|
15321 |
{ |
|
15322 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
15323 |
||
15324 |
RemoveSuggestedCompletionL(); |
|
15325 |
||
15326 |
#else |
|
15327 |
TInt tailLength = 0; |
|
15328 |
iPtiEngine->HandleCommandL( EPtiCommandGetAutoCompletionTailLength, |
|
15329 |
&tailLength ); |
|
15330 |
if(tailLength > 0) |
|
15331 |
{ |
|
15332 |
RemoveSuggestedAdvanceCompletionL(); |
|
15333 |
return EKeyWasConsumed; |
|
15334 |
} |
|
15335 |
#endif |
|
15336 |
} |
|
15337 |
if (IsFlagSet(EFlagShiftKeyDepressed) || IsCcpuFlagSet(ECcpuStateHashDown)) |
|
15338 |
{ |
|
15339 |
CommitInlineEditL(); |
|
15340 |
TryCloseUiL(); |
|
15341 |
SimulateKeyEventL(EKeyF19); // Asyncronous case update |
|
15342 |
// pass to editor for text selection. |
|
15343 |
response=EKeyWasNotConsumed; |
|
15344 |
} |
|
15345 |
} |
|
15346 |
if ((iInputCapabilities.FepAwareTextEditor() && !TryHandleTextSelectedNaviEventL(aCode, response)) && !IsFlagSet(EFlagShiftKeyDepressed)) |
|
15347 |
{ |
|
15348 |
if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
15349 |
{ |
|
15350 |
ClearFlag(CAknFepManager::EFlagNoMatches); |
|
15351 |
TryRemoveNoMatchesIndicatorL(); |
|
15352 |
CommitInlineEditL(); |
|
15353 |
} |
|
15354 |
UpdateCbaL(NULL); |
|
15355 |
||
15356 |
// simulate a designated key event to catch and check if we're inside a word |
|
15357 |
if (aCode == EKeyDownArrow) |
|
15358 |
{ |
|
15359 |
SimulateKeyEventL(EKeyF22); |
|
15360 |
} |
|
15361 |
else |
|
15362 |
{ |
|
15363 |
SimulateKeyEventL(EKeyF23); |
|
15364 |
} |
|
15365 |
// pass to editor for text selection. |
|
15366 |
response=EKeyWasNotConsumed; |
|
15367 |
} |
|
15368 |
else if (IsFlagSet(EFlagShiftKeyDepressed) || IsCcpuFlagSet(ECcpuStateHashDown)) |
|
15369 |
{ |
|
15370 |
// Need to update case indicator if text selection is made upwards. |
|
15371 |
SimulateKeyEventL(EKeyF19); |
|
15372 |
} |
|
15373 |
} |
|
15374 |
else // right or left |
|
15375 |
{ |
|
15376 |
if (IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
15377 |
{ |
|
15378 |
// moving out of an inline edit |
|
15379 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
15380 |
if(IsAutoCompleteOn()) |
|
15381 |
{ |
|
15382 |
if((aCode == EKeyLeftArrow && |
|
15383 |
CurrentInputDirectionality() == TBidiText::ELeftToRight) || |
|
15384 |
(aCode == EKeyRightArrow && |
|
15385 |
CurrentInputDirectionality() == TBidiText::ERightToLeft)) |
|
15386 |
{ |
|
15387 |
RemoveSuggestedCompletionL(); |
|
15388 |
} |
|
15389 |
} |
|
15390 |
#else |
|
15391 |
if(IsAutoCompleteOn()) |
|
15392 |
{ |
|
15393 |
TInt tailLength = 0; |
|
15394 |
iPtiEngine->HandleCommandL( EPtiCommandGetAutoCompletionTailLength, &tailLength ); |
|
15395 |
// In case the inline editing is ongoing and there is a word completion |
|
15396 |
// currently shown, the first backwards tap will remove the suggested |
|
15397 |
// completion. |
|
15398 |
if(tailLength > 0) |
|
15399 |
{ |
|
15400 |
if (((CurrentInputDirectionality()==TBidiText::ERightToLeft) && aCode == EKeyLeftArrow) |
|
15401 |
|| ((CurrentInputDirectionality()==TBidiText::ELeftToRight) && aCode == EKeyRightArrow )) |
|
15402 |
{ |
|
15403 |
iPtiEngine->HandleCommandL( EPtiCommandLockCurrentCandidate); |
|
15404 |
TPtrC selectedWord = iPtiEngine->CurrentWord(); |
|
15405 |
UpdateInlineEditL( selectedWord, selectedWord.Length() ); //selection.iAnchorPosition |
|
15406 |
iPtiEngine->CommitCurrentWord(); |
|
15407 |
TryCloseUiL(); |
|
15408 |
// Asyncronous case update after the editor has handled the key |
|
15409 |
SimulateKeyEventL(EKeyF19); |
|
15410 |
response=EKeyWasConsumed; |
|
15411 |
} |
|
15412 |
else if(((CurrentInputDirectionality()== TBidiText::ERightToLeft ) && aCode == EKeyRightArrow) |
|
15413 |
|| ((CurrentInputDirectionality()== TBidiText::ELeftToRight) && aCode == EKeyLeftArrow )) |
|
15414 |
{ |
|
15415 |
RemoveSuggestedAdvanceCompletionL(); |
|
15416 |
response=EKeyWasConsumed; |
|
15417 |
} |
|
15418 |
return response; |
|
15419 |
} |
|
15420 |
else if (!IsQwerty()) |
|
15421 |
{ |
|
15422 |
iPtiEngine->CommitCurrentWord(); |
|
15423 |
} |
|
15424 |
||
15425 |
} |
|
15426 |
#endif // RD_INTELLIGENT_TEXT_INPUT |
|
15427 |
TryRemoveNoMatchesIndicatorL(); |
|
15428 |
UpdateCbaL(NULL); |
|
15429 |
if (IsFlagSet(EFlagShiftKeyDepressed) || IsCcpuFlagSet(ECcpuStateHashDown)) |
|
15430 |
{ |
|
15431 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
15432 |
if(IsAutoCompleteOn()) // To rip off suggested completion when shift key is pressed |
|
15433 |
{ |
|
15434 |
RemoveSuggestedCompletionL(); |
|
15435 |
} |
|
15436 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
15437 |
CommitInlineEditL(); |
|
15438 |
TryCloseUiL(); |
|
15439 |
SimulateKeyEventL(EKeyF19); // Asyncronous case update |
|
15440 |
// pass to editor for text selection. |
|
15441 |
response=EKeyWasNotConsumed; |
|
15442 |
} |
|
15443 |
else |
|
15444 |
{ |
|
15445 |
TWesternNaviEvent naviEvent = ELeftNaviEvent; |
|
15446 |
if (aCode == EKeyRightArrow) |
|
15447 |
{ |
|
15448 |
naviEvent = ERightNaviEvent; |
|
15449 |
} |
|
15450 |
// Find the visual left/right end of the current word |
|
15451 |
TTmDocPosSpec pos; |
|
15452 |
GetAvkonDefinedVisualLimitsOfSelection( |
|
15453 |
iUncommittedText, naviEvent, pos, NULL ); |
|
15454 |
||
15455 |
if (IsCcpuFlagSet(ECcpuStateNewPredictiveWord)) |
|
15456 |
{ |
|
15457 |
// This is new predictive word which is being committed with arrow |
|
15458 |
// key. Force ::TryCloseUiL to commit PtiEngie word to keep |
|
15459 |
// frequency information in sync. |
|
15460 |
SetCcpuFlag(ECcpuStataCommitPredictiveWord); |
|
15461 |
} |
|
15462 |
||
15463 |
TryCloseUiL(); |
|
15464 |
||
15465 |
// Position should be dis-ambiguated based on last navigation and direction of blocks. |
|
15466 |
AdjustPosSpecForAmbiguityAfterLeftOrRightNavigation( pos, naviEvent ); |
|
15467 |
||
15468 |
SetCursorPositionL( pos ); |
|
15469 |
if (CursorInsideWord() && naviEvent == ERightNaviEvent) |
|
15470 |
{ |
|
15471 |
MoveCursorToEndOfWordL(); |
|
15472 |
} |
|
15473 |
||
15474 |
iCaseMan->UpdateCase(ENullNaviEvent); |
|
15475 |
response=EKeyWasConsumed; |
|
15476 |
} |
|
15477 |
} |
|
15478 |
else |
|
15479 |
{ |
|
15480 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
15481 |
if ( iLanguageCapabilities.iInputLanguageCode == ELangThai ) // Without this, t9 goes inside words |
|
15482 |
{ // That is not allowed in Thai |
|
15483 |
response = EKeyWasNotConsumed; |
|
15484 |
} |
|
15485 |
else |
|
15486 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
15487 |
response = HandleNaviEventOutsideInlineEditL(aCode, aLength); |
|
15488 |
if (response == EKeyWasNotConsumed) |
|
15489 |
{ |
|
15490 |
// moving over a space |
|
15491 |
if (aCode == EKeyLeftArrow && !IsFlagSet(EFlagShiftKeyDepressed)) |
|
15492 |
{ |
|
15493 |
iCaseMan->UpdateCase(ELeftNaviEvent); |
|
15494 |
} |
|
15495 |
else if (!IsFlagSet(EFlagShiftKeyDepressed)) // EKeyRightArrow |
|
15496 |
{ |
|
15497 |
iCaseMan->UpdateCase(ERightNaviEvent); |
|
15498 |
} |
|
15499 |
} |
|
15500 |
else |
|
15501 |
iCaseMan->UpdateCase(ENullNaviEvent); |
|
15502 |
} |
|
15503 |
} |
|
15504 |
return response; |
|
15505 |
} |
|
15506 |
||
15507 |
TBool CAknFepManager::TryHandleTextSelectedNaviEventL(TInt aCode, TKeyResponse& response) |
|
15508 |
{ |
|
15509 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
15510 |
||
15511 |
if (!IsFlagSet(EFlagShiftKeyDepressed) && iUncommittedText.Length()) |
|
15512 |
{ |
|
15513 |
if (aCode == EKeyBackspace) |
|
15514 |
{ |
|
15515 |
iCaseMan->UpdateCase(EBackspaceEvent); |
|
15516 |
response = EKeyWasNotConsumed; |
|
15517 |
} |
|
15518 |
else |
|
15519 |
{ |
|
15520 |
TInt newCursorPos = iUncommittedText.HigherPos(); //default, right or down |
|
15521 |
if (aCode == EKeyLeftArrow || aCode == EKeyUpArrow) |
|
15522 |
{ |
|
15523 |
newCursorPos = iUncommittedText.LowerPos(); |
|
15524 |
} |
|
15525 |
iUncommittedText.SetSelection(newCursorPos, newCursorPos); |
|
15526 |
iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(iUncommittedText); |
|
15527 |
||
15528 |
if (WesternPredictive()) |
|
15529 |
{ |
|
15530 |
if (CursorInsideWord()) |
|
15531 |
{ |
|
15532 |
if (aCode == EKeyLeftArrow || aCode == EKeyUpArrow) |
|
15533 |
{ |
|
15534 |
MoveCursorToStartOfWordL(); |
|
15535 |
} |
|
15536 |
else //right or down |
|
15537 |
{ |
|
15538 |
MoveCursorToEndOfWordL(); |
|
15539 |
} |
|
15540 |
} |
|
15541 |
iCaseMan->UpdateCase(ENullNaviEvent); |
|
15542 |
} |
|
15543 |
response = EKeyWasConsumed; |
|
15544 |
} |
|
15545 |
return ETrue; |
|
15546 |
} |
|
15547 |
return EFalse; |
|
15548 |
} |
|
15549 |
||
15550 |
TBool CAknFepManager::TryHandleCommonArrowAndBackspaceFunctionalityL(TInt aCode, |
|
15551 |
TKeyResponse& aResponse) |
|
15552 |
{ |
|
15553 |
TBool keyHandled = ETrue; |
|
15554 |
if ( !IsFepAwareTextEditor() ) |
|
15555 |
{ |
|
15556 |
aResponse=EKeyWasNotConsumed; |
|
15557 |
return keyHandled; |
|
15558 |
} |
|
15559 |
#ifdef RD_HINDI_PHONETIC_INPUT |
|
15560 |
if(iLanguageCapabilities.iInputLanguageCode == KLangHindiPhonetic) |
|
15561 |
{ |
|
15562 |
if (aCode == EKeyBackspace) |
|
15563 |
{ |
|
15564 |
CommitInlineEditL(); |
|
15565 |
FepUI()->HandleKeyL(aCode, EShortKeyPress); |
|
15566 |
} |
|
15567 |
if(IsFlagSet(CAknFepManager::EFlagNoMatches)) |
|
15568 |
{ |
|
15569 |
if(PreviousChar() == 0x003F && aCode != EKeyBackspace) |
|
15570 |
{ |
|
15571 |
RemovePreviousCharacterL(); |
|
15572 |
} |
|
15573 |
ClearFlag(CAknFepManager::EFlagNoMatches); |
|
15574 |
FepUI()->ExpireMultitapTimer(); |
|
15575 |
} |
|
15576 |
iPtiEngine->HandleCommandL(EPtiCommandBreakSyllable, NULL ); |
|
15577 |
} |
|
15578 |
#endif |
|
15579 |
if (IsFlagSet(EFlagInsideMultitapInlineEditingTransaction)) |
|
15580 |
{ |
|
15581 |
FepUI()->ExpireMultitapTimer(); |
|
15582 |
||
15583 |
if (aCode == EKeyBackspace) |
|
15584 |
{ |
|
15585 |
aResponse = EKeyWasNotConsumed; // let editor handle the move |
|
15586 |
} |
|
15587 |
else |
|
15588 |
{ |
|
15589 |
aResponse = EKeyWasConsumed; |
|
15590 |
} |
|
15591 |
} |
|
15592 |
else |
|
15593 |
{ |
|
15594 |
//selecting text |
|
15595 |
if (IsFlagSet(EFlagShiftKeyDepressed) || IsCcpuFlagSet(ECcpuStateCopy | ECcpuStateCut)) |
|
15596 |
{ |
|
15597 |
if (iShiftKeypressMonitor->IsActive()) |
|
15598 |
{ |
|
15599 |
ResetShiftKeyMonitorL(); //don't want edit menu |
|
15600 |
} |
|
15601 |
ClearFlag(EFlagQwertyShiftMode); |
|
15602 |
SimulateKeyEventL(EKeyF19); // Asyncronous case update |
|
15603 |
aResponse = EKeyWasNotConsumed; |
|
15604 |
return keyHandled; |
|
15605 |
} |
|
15606 |
||
15607 |
TCursorSelection currentEditorSelection; |
|
15608 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(currentEditorSelection); |
|
15609 |
||
15610 |
TWesternNaviEvent naviEvent = ENullNaviEvent; |
|
15611 |
||
15612 |
// Translate key code to internal navi-event |
|
15613 |
switch( aCode ) |
|
15614 |
{ |
|
15615 |
case EKeyUpArrow: |
|
15616 |
naviEvent = EUpNaviEvent; |
|
15617 |
break; |
|
15618 |
case EKeyDownArrow: |
|
15619 |
naviEvent = EDownNaviEvent; |
|
15620 |
break; |
|
15621 |
case EKeyRightArrow: |
|
15622 |
naviEvent = ERightNaviEvent; |
|
15623 |
break; |
|
15624 |
case EKeyLeftArrow: |
|
15625 |
naviEvent = ELeftNaviEvent; |
|
15626 |
break; |
|
15627 |
default: // just leave it as NULL |
|
15628 |
break; |
|
15629 |
} |
|
15630 |
||
15631 |
if (currentEditorSelection.Length()) |
|
15632 |
{ |
|
15633 |
// we have text selected - set cursor to start/end of current selection |
|
15634 |
TTmDocPosSpec newPos; |
|
15635 |
aResponse = NavigateFromSelectionL( currentEditorSelection, naviEvent, newPos ); |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
15636 |
if ( aCode != EKeyBackspace && WesternPredictive() ) |
44 | 15637 |
{ |
15638 |
if (CursorInsideWord()) |
|
15639 |
{ |
|
15640 |
TBool rightToleftParagraph = IsRightToLeftParagraph(newPos); |
|
15641 |
if ( (rightToleftParagraph && naviEvent == ELeftNaviEvent) || |
|
15642 |
(!rightToleftParagraph && naviEvent == ERightNaviEvent) ) |
|
15643 |
{ |
|
15644 |
MoveCursorToEndOfWordL(); |
|
15645 |
} |
|
15646 |
else |
|
15647 |
{ |
|
15648 |
MoveCursorToStartOfWordL(); |
|
15649 |
} |
|
15650 |
} |
|
15651 |
||
15652 |
} |
|
15653 |
} |
|
15654 |
else if (!(EditorState()->Flags() & EAknEditorFlagNoLRNavigation)) |
|
15655 |
{ |
|
15656 |
if ((naviEvent != ENullNaviEvent) && HandleLoopingInNaviEventL(naviEvent)) |
|
15657 |
{ |
|
15658 |
aResponse=EKeyWasConsumed; |
|
15659 |
} |
|
15660 |
else |
|
15661 |
{ |
|
15662 |
if (iMode == ELatin) |
|
15663 |
{ |
|
15664 |
// normal operation of Down/Up scroll keypress action. |
|
15665 |
switch( aCode ) |
|
15666 |
{ |
|
15667 |
case EKeyUpArrow: |
|
15668 |
case EKeyDownArrow: |
|
15669 |
SimulateKeyEventL(EKeyF22); |
|
15670 |
break; |
|
15671 |
case EKeyRightArrow: |
|
15672 |
case EKeyLeftArrow: |
|
15673 |
{ |
|
15674 |
/*Hindi*/ |
|
15675 |
if( (TAknFepUiIndicInputManager :: IsIndicLangauge( |
|
15676 |
TLanguage(iLanguageCapabilities.iInputLanguageCode))) |
|
15677 |
&& IsZWSCharacterPresent() ) |
|
15678 |
{ |
|
15679 |
RemoveZWSCharacterL(EKeyLeftArrow); |
|
15680 |
} |
|
15681 |
} |
|
15682 |
break; |
|
15683 |
default: // nothing |
|
15684 |
break; |
|
15685 |
} |
|
15686 |
} |
|
15687 |
keyHandled = EFalse; |
|
15688 |
} |
|
15689 |
} |
|
15690 |
} |
|
15691 |
||
15692 |
return keyHandled; |
|
15693 |
} |
|
15694 |
||
15695 |
/** |
|
15696 |
* Routine handled navigation and also backspace events at "beginning" of document |
|
15697 |
* |
|
15698 |
*/ |
|
15699 |
TBool CAknFepManager::HandleLoopingInNaviEventL(TWesternNaviEvent aNaviEvent) |
|
15700 |
{ |
|
15701 |
TBool looping = EFalse; |
|
15702 |
TBool eventHandled = EFalse; |
|
15703 |
TTmDocPosSpec newCursorPos; |
|
15704 |
||
15705 |
// This routine may handle Left, Right and Backspace and nothing else |
|
15706 |
// Note that Up and Down cannot do any sort of document looping in FEP |
|
15707 |
if ( aNaviEvent != ELeftNaviEvent |
|
15708 |
&& aNaviEvent != ERightNaviEvent |
|
15709 |
&& aNaviEvent != EBackspaceEvent ) |
|
15710 |
return eventHandled; // not consumed |
|
15711 |
||
15712 |
TTmDocPosSpec pos = DocPos(); |
|
15713 |
TBool rightToLeftParagraph = IsRightToLeftParagraph(pos); |
|
15714 |
||
15715 |
TWesternNaviEvent incrementingNaviEvent = |
|
15716 |
rightToLeftParagraph ? ELeftNaviEvent : ERightNaviEvent; |
|
15717 |
TWesternNaviEvent decrementingNaviEvent = |
|
15718 |
rightToLeftParagraph ? ERightNaviEvent : ELeftNaviEvent; |
|
15719 |
||
15720 |
if (aNaviEvent == decrementingNaviEvent) |
|
15721 |
{ |
|
15722 |
// Abandon early if we are not in the first line. |
|
15723 |
if ( InFirstLineAndFormatted( pos ) ) |
|
15724 |
{ |
|
15725 |
TTmDocPosSpec startPos; |
|
15726 |
GetVisualDocStart( startPos ); |
|
15727 |
if( AtVisualStart( pos, startPos ) ) |
|
15728 |
{ |
|
15729 |
TTmDocPosSpec endPos; |
|
15730 |
if ( !GetVisualDocEnd( endPos ) ) |
|
15731 |
{ |
|
15732 |
// End of document is not formatted. Value returned is just pos at DocLength. |
|
15733 |
// So actually move the cursor there (this is guranteed to format the last line) |
|
15734 |
// and the end End position is found a 2nd time. |
|
15735 |
newCursorPos = endPos; |
|
15736 |
SetCursorPositionL( newCursorPos ); |
|
15737 |
GetVisualDocEnd( endPos ); |
|
15738 |
} |
|
15739 |
newCursorPos = endPos; |
|
15740 |
looping = ETrue; |
|
15741 |
} |
|
15742 |
} |
|
15743 |
} |
|
15744 |
else if (aNaviEvent == incrementingNaviEvent ) |
|
15745 |
{ |
|
15746 |
if ( InLastLineAndFormatted( pos ) ) |
|
15747 |
{ |
|
15748 |
TTmDocPosSpec endPos; |
|
15749 |
GetVisualDocEnd( endPos ); |
|
15750 |
if( AtVisualEnd( pos, endPos, |
|
15751 |
iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep() ) ) |
|
15752 |
{ |
|
15753 |
TTmDocPosSpec startPos; |
|
15754 |
if ( !GetVisualDocStart( startPos ) ) |
|
15755 |
{ |
|
15756 |
// Document was not formatted at docPos(0). So actually move the cursor |
|
15757 |
// to that line at least, and then ask for the start pos again. |
|
15758 |
newCursorPos = startPos; |
|
15759 |
SetCursorPositionL( newCursorPos ); |
|
15760 |
GetVisualDocStart( startPos ); |
|
15761 |
} |
|
15762 |
newCursorPos = startPos; |
|
15763 |
looping = ETrue; |
|
15764 |
} |
|
15765 |
} |
|
15766 |
} |
|
15767 |
else if ( aNaviEvent == EBackspaceEvent ) |
|
15768 |
{ |
|
15769 |
// Deletion is always logical, so the condition is simply to test the logical pos. |
|
15770 |
if ( pos.iPos ==0 ) |
|
15771 |
{ |
|
15772 |
eventHandled = ETrue; |
|
15773 |
} |
|
15774 |
} |
|
15775 |
||
15776 |
if (looping) |
|
15777 |
{ |
|
15778 |
// This takes language issues into account, adjusting the cursor position: |
|
15779 |
AdjustPosSpecForInputLanguageAfterDocumentLoop( newCursorPos, aNaviEvent, |
|
15780 |
(aNaviEvent == incrementingNaviEvent) ); |
|
15781 |
SetCursorPositionL( newCursorPos ); |
|
15782 |
eventHandled = ETrue; |
|
15783 |
} |
|
15784 |
return eventHandled; |
|
15785 |
} |
|
15786 |
||
15787 |
void CAknFepManager::TransferFepStateToEditorL( TBool aFnLockSync ) |
|
15788 |
{ |
|
15789 |
// If editor in Fnlock state, need to set actual input mode |
|
15790 |
// because, in case of qwerty keypad alphanumeric editor there is no numeric mode |
|
15791 |
// numeric mode handle as FnLock |
|
15792 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
15793 |
||
15794 |
if( aFnLockSync && iQwertyInputMode && iFnKeyManager && iFnKeyManager->FnKeyState()==CAknFepFnKeyManager::EFnKeyLock) |
|
15795 |
{ |
|
15796 |
EditorState()->SetCurrentInputMode(EditorModeFromFepMode(ENumber)); |
|
15797 |
// Indicator should not be reset, if menu is displaying from editor. |
|
15798 |
if(!IsFlagSet(EFlagForegroundUIComponentVisible | EFlagMenuPaneVisible)) |
|
15799 |
iFnKeyManager->ClearFnKeyState(); |
|
15800 |
} |
|
15801 |
else |
|
15802 |
{ |
|
15803 |
#endif |
|
15804 |
EditorState()->SetCurrentInputMode(EditorModeFromFepMode(iMode)); |
|
15805 |
||
15806 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
15807 |
} |
|
15808 |
if(iFnKeyManager && iFnKeyManager->FnKeyState()!=CAknFepFnKeyManager::EFnKeyLock) |
|
15809 |
iFnKeyManager->ClearFnKeyState(); |
|
15810 |
||
15811 |
#endif |
|
15812 |
||
15813 |
||
15814 |
if ((iMode == ELatin && iWesternPredictive && |
|
15815 |
IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
15816 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
15817 |
||(IsLanguageSupportPrediction() && IsFlagSet(EFlagInsideInlineEditingTransaction)) |
|
15818 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
15819 |
) |
|
15820 |
{ |
|
15821 |
EditorState()->SetInlineEditSpan(iUncommittedText); |
|
15822 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
15823 |
if (IsFlagSet(CAknFepManager::EFlagNoMatches)) |
|
15824 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
15825 |
TryRemoveNoMatchesIndicatorL(); |
|
15826 |
UpdateCbaL(NULL); |
|
15827 |
} |
|
15828 |
else |
|
15829 |
{ |
|
15830 |
EditorState()->SetInlineEditSpan(TCursorSelection(0,0)); |
|
15831 |
} |
|
15832 |
EditorState()->SetCurrentCaseWithNoInitialisation(iCaseMan->CurrentCase()); |
|
15833 |
if ( IsFlagSet( EFlagSupressAutoUpdate ) ) |
|
15834 |
{ |
|
15835 |
EditorState()->SetFlags( EditorState()->Flags() | EFlagSupressAutoUpdate ); |
|
15836 |
} |
|
15837 |
else |
|
15838 |
{ |
|
15839 |
EditorState()->SetFlags( EditorState()->Flags() & ~EFlagSupressAutoUpdate ); |
|
15840 |
} |
|
15841 |
SetQwertyModeToInputcapbility(); |
|
15842 |
} |
|
15843 |
||
15844 |
MAknFepManagerInterface* CAknFepManager::FepUI() const |
|
15845 |
{ |
|
15846 |
#ifdef RD_SCALABLE_UI_V2 |
|
15847 |
if ( iFepFullyConstructed && ( iFepPluginManager->PluginInputMode() != EPluginInputModeNone ) ) |
|
15848 |
{ |
|
15849 |
if (iFepPluginManager->PluginInputMode() == EPluginInputModeItut) |
|
15850 |
{ |
|
15851 |
return iFepPluginManager->CurrentFepInputUI() ? |
|
15852 |
iFepPluginManager->CurrentFepInputUI() : iCurrentFepUI; |
|
15853 |
} |
|
15854 |
if ( iFepPluginManager->EnableITIOnFSQ() ) |
|
15855 |
{ |
|
15856 |
return iCurrentFepUI; |
|
15857 |
} |
|
15858 |
return iFepPluginManager->CurrentPluginInputFepUI(); |
|
15859 |
} |
|
15860 |
#endif |
|
15861 |
return iCurrentFepUI; |
|
15862 |
} |
|
15863 |
||
15864 |
void CAknFepManager::LaunchLanguagesPopupListL(TBool aLaunchedByTouchWin) |
|
15865 |
{ |
|
15866 |
#ifdef RD_SCALABLE_UI_V2 |
|
15867 |
if( iFepPluginManager->PluginInputMode() != EPluginInputModeNone && |
|
15868 |
iFepPluginManager->PluginInputMode() != EPluginInputModeItut |
|
15869 |
// Add this condition for correction of dim features on FSQ |
|
15870 |
&& iFepPluginManager->PluginInputMode() != EPluginInputModeFSQ |
|
15871 |
&& iFepPluginManager->PluginInputMode() != EPluginInputModePortraitFSQ ) |
|
15872 |
{ |
|
15873 |
iFepPluginManager->LaunchPenInputLanguageSelectionL(aLaunchedByTouchWin); |
|
15874 |
return; |
|
15875 |
} |
|
15876 |
#endif //RD_SCALABLE_UI_V2 |
|
15877 |
||
15878 |
CArrayFixFlat<TInt>* languages = |
|
15879 |
new( ELeave )CArrayFixFlat<TInt>( ELanguageArrayGranularity ); |
|
15880 |
CleanupStack::PushL( languages ); |
|
15881 |
iPtiEngine->GetAvailableLanguagesL( languages ); |
|
15882 |
||
15883 |
// Create a list of languages for the dialog |
|
15884 |
CDesCArrayFlat* languagesList = |
|
15885 |
new( ELeave )CDesCArrayFlat( ELanguageArrayGranularity ); |
|
15886 |
CleanupStack::PushL( languagesList ); |
|
15887 |
||
15888 |
// Item format should be "<icon_index>\t<item_text>" |
|
15889 |
_LIT( KIconIndexSelected, "0\t" ); |
|
15890 |
_LIT( KIconIndexNotSelected, "\t" );// No icon |
|
15891 |
||
15892 |
MPtiLanguage* lang = NULL; |
|
15893 |
TInt currentLanguage = iSharedDataInterface->InputTextLanguage(); |
|
15894 |
TInt selectedLanguageIndex = 0; |
|
15895 |
||
15896 |
for (TInt ii=0; ii < languages->Count(); ii++) |
|
15897 |
{ |
|
15898 |
lang = iPtiEngine->GetLanguage( ( *languages )[ii] ); |
|
15899 |
if (!lang) |
|
15900 |
{ |
|
15901 |
User::Leave( KErrCorrupt ); |
|
15902 |
} |
|
15903 |
// Buffer should contain both tabulator string and localized name: |
|
15904 |
HBufC* langStrBuf = HBufC::NewL( lang->LocalizedName().Length() + 3 ); |
|
15905 |
CleanupStack::PushL( langStrBuf ); |
|
15906 |
||
15907 |
TPtr langStrPtr = langStrBuf->Des(); |
|
15908 |
||
15909 |
// If language is current language - use selected icon in lbx: |
|
15910 |
if( lang->LanguageCode() == currentLanguage ) |
|
15911 |
{ |
|
15912 |
langStrPtr.Append( KIconIndexSelected ); |
|
15913 |
selectedLanguageIndex = ii; |
|
15914 |
} |
|
15915 |
else |
|
15916 |
{ |
|
15917 |
langStrPtr.Append( KIconIndexNotSelected ); |
|
15918 |
} |
|
15919 |
langStrPtr.Append( lang->LocalizedName() ); |
|
15920 |
languagesList->AppendL( langStrPtr ); |
|
15921 |
CleanupStack::PopAndDestroy( langStrBuf ); |
|
15922 |
} |
|
15923 |
||
15924 |
// Add icons to the listbox: |
|
15925 |
CArrayPtr<CGulIcon>* icons = new( ELeave ) CArrayPtrFlat<CGulIcon>(10); |
|
15926 |
CleanupStack::PushL( icons ); |
|
15927 |
LoadIconL( icons, EMbmAvkonQgn_prop_sub_current, |
|
15928 |
EMbmAvkonQgn_prop_sub_current_mask ); |
|
15929 |
||
15930 |
TInt index = 0; |
|
15931 |
SetFlag( EFlagForegroundUIComponentVisible ); |
|
15932 |
CleanupStack::Pop( icons ); // iUiInterface->LaunchListPopupL takes ownership immediately |
|
15933 |
#ifdef RD_SCALABLE_UI_V2 |
|
15934 |
if( iFepFullyConstructed && iFepPluginManager && !iFepPluginManager->IsInMenuOpen() ) |
|
15935 |
{ |
|
15936 |
iFepPluginManager->SetMenuState(); |
|
15937 |
} |
|
15938 |
#endif |
|
15939 |
// Fire up the dialog |
|
15940 |
#ifdef RD_SCALABLE_UI_V2 |
|
15941 |
iCancelPopupInQwerty = aLaunchedByTouchWin; |
|
15942 |
#endif //RD_SCALABLE_UI_V2 |
|
15943 |
TUid fepUid = CCoeEnv::Static()->FepUid(); |
|
15944 |
ClearExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
15945 |
SendEventsToPluginManL(EPluginEnablePriorityChangeOnOriChange,EFalse); |
|
15946 |
TInt returnValue = iUiInterface->LaunchListPopupL(R_AVKON_T9_LANGUAGES_QUERY, index, |
|
15947 |
selectedLanguageIndex, languagesList, icons); |
|
15948 |
#ifdef RD_SCALABLE_UI_V2 |
|
15949 |
iCancelPopupInQwerty = EFalse; |
|
15950 |
#endif //RD_SCALABLE_UI_V2 |
|
15951 |
PrepareFepAfterDialogExitL(fepUid); |
|
15952 |
CleanupStack::PopAndDestroy( languagesList ); |
|
15953 |
||
15954 |
if(returnValue == EAknSoftkeyOk) |
|
15955 |
{ |
|
15956 |
// Selected item index from the languages array |
|
15957 |
HandleChangeInFocusL(); |
|
15958 |
||
15959 |
// The user has changed language and the local language is not used any more. |
|
15960 |
iLanguageCapabilities.iLocalInputLanguageInUse = EFalse; |
|
15961 |
if (EditorState()) |
|
15962 |
{ |
|
15963 |
EditorState()->SetLocalLanguage( ELangTest ); |
|
15964 |
} |
|
15965 |
||
15966 |
TBool westernPredictiveInUse = WesternPredictive(); |
|
15967 |
||
15968 |
// Truncate autocompletion portion on change of writing language |
|
15969 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
15970 |
RemoveSuggestedAdvanceCompletionL(); |
|
15971 |
#endif // RD_INTELLIGENT_TEXT_INPUT |
|
15972 |
//Hindi Change Bug Fix |
|
15973 |
iSharedDataInterface->SetInputTextLanguage(languages->At(index)); |
|
15974 |
CAknEnv::Static()->SettingCache().Update(KEikInputLanguageChange); |
|
15975 |
SetActiveInputLanguage( languages->At(index) ); |
|
15976 |
ChangeInputLanguageL(languages->At(index)); |
|
15977 |
SetFlag( EFlagNewSharedDataInputLanguage | EFlagNewSharedDataInputMode ); |
|
15978 |
// This pice of code TSW Fute error fixing. |
|
15979 |
// Display the confirmation msg if the dictionary is not available for |
|
15980 |
// Current language. |
|
15981 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
15982 |
// Display the confirmation msg only for Western languages |
|
15983 |
if (!IsChineseInputLanguage()) |
|
15984 |
{ |
|
15985 |
if (!IsLanguageSupportPrediction()) |
|
15986 |
{ |
|
15987 |
LaunchConfirmationNoteL(R_AVKON_T9_NOTE_NO_AVAILABLE); |
|
15988 |
} |
|
15989 |
} |
|
15990 |
#endif |
|
15991 |
||
15992 |
||
15993 |
} |
|
15994 |
SendEventsToPluginManL(EPluginEnablePriorityChangeOnOriChange,ETrue); |
|
15995 |
CleanupStack::PopAndDestroy( languages ); |
|
15996 |
} |
|
15997 |
||
15998 |
void CAknFepManager::LaunchRecognitionWithDictionaryPopupListL() |
|
15999 |
{ |
|
16000 |
#ifdef RD_SCALABLE_UI_V2 |
|
16001 |
if( iFepPluginManager && (iFepPluginManager->PluginInputMode() == EPluginInputModeHwr) ) |
|
16002 |
{ |
|
16003 |
iFepPluginManager->LaunchPenInputRecognitionWithDictionarySelectionL(); |
|
16004 |
return; |
|
16005 |
} |
|
16006 |
#endif //RD_SCALABLE_UI_V2 |
|
16007 |
} |
|
16008 |
void CAknFepManager::LaunchWritingSpeedPopupListL() |
|
16009 |
{ |
|
16010 |
#ifdef RD_SCALABLE_UI_V2 |
|
16011 |
if( iFepPluginManager && (iFepPluginManager->PluginInputMode() == EPluginInputModeFingerHwr) ) |
|
16012 |
{ |
|
16013 |
iFepPluginManager->LaunchPenInputWritingSpeedSelectionL(); |
|
16014 |
return; |
|
16015 |
} |
|
16016 |
#endif //RD_SCALABLE_UI_V2 |
|
16017 |
} |
|
16018 |
void CAknFepManager::LaunchGuidingLinePopupListL() |
|
16019 |
{ |
|
16020 |
#ifdef RD_SCALABLE_UI_V2 |
|
16021 |
if( iFepPluginManager && (iFepPluginManager->PluginInputMode() == EPluginInputModeFingerHwr) ) |
|
16022 |
{ |
|
16023 |
iFepPluginManager->LaunchPenInputGuidingLineSelectionL(); |
|
16024 |
return; |
|
16025 |
} |
|
16026 |
#endif //RD_SCALABLE_UI_V2 |
|
16027 |
} |
|
16028 |
void CAknFepManager::LoadIconL( CArrayPtr<CGulIcon>* aIcons, |
|
16029 |
TInt aBitmapId, |
|
16030 |
TInt aMaskId ) |
|
16031 |
{ |
|
16032 |
CGulIcon* icon = CGulIcon::NewLC(); |
|
16033 |
CFbsBitmap* bitmap = 0; |
|
16034 |
CFbsBitmap* mask = 0; |
|
16035 |
AknIconUtils::CreateIconL( bitmap, mask, KAvkonBitmapFile, aBitmapId, aMaskId ); |
|
16036 |
icon->SetBitmap( bitmap ); |
|
16037 |
icon->SetMask( mask ); |
|
16038 |
aIcons->AppendL( icon ); |
|
16039 |
CleanupStack::Pop( icon ); |
|
16040 |
} |
|
16041 |
||
16042 |
||
16043 |
TBool CAknFepManager::IsInputModeAvailable(TInt aMode) const |
|
16044 |
{ |
|
16045 |
TBool isAvailable = ETrue; |
|
16046 |
const TInt inputLanguage = iLanguageCapabilities.iInputLanguageCode; |
|
16047 |
switch (aMode) |
|
16048 |
{ |
|
16049 |
case ELatin: |
|
16050 |
isAvailable = !( ( inputLanguage == ELangPrcChinese ) && |
|
16051 |
(iAknEditorFlags & EAknEditorFlagForceTransparentFepModes)); |
|
16052 |
break; |
|
16053 |
case EPinyin: |
|
16054 |
isAvailable = ( inputLanguage == ELangPrcChinese ); |
|
16055 |
break; |
|
16056 |
case EStroke: |
|
16057 |
isAvailable = ( inputLanguage == ELangPrcChinese || |
|
16058 |
inputLanguage == ELangHongKongChinese || |
|
16059 |
inputLanguage == ELangTaiwanChinese); |
|
16060 |
break; |
|
16061 |
case ECangJie: |
|
16062 |
{ |
|
16063 |
isAvailable = ( ( inputLanguage == ELangHongKongChinese ) && |
|
16064 |
iQwertyInputMode ); |
|
16065 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
16066 |
#ifdef __HALF_QWERTY_KEYPAD |
|
16067 |
isAvailable = isAvailable && (EPtiKeyboardHalfQwerty != KeyboardLayout()); |
|
16068 |
#endif //__HALF_QWERTY_KEYPAD |
|
16069 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
16070 |
} |
|
16071 |
||
16072 |
break; |
|
16073 |
case EZhuyin: |
|
16074 |
isAvailable = ( inputLanguage == ELangTaiwanChinese ); |
|
16075 |
break; |
|
16076 |
case EPRCFind: |
|
16077 |
isAvailable = ( ( inputLanguage == ELangPrcChinese ) && |
|
16078 |
(iAknEditorFlags & EAknEditorFlagForceTransparentFepModes)); |
|
16079 |
break; |
|
16080 |
case EZhuyinFind: |
|
16081 |
isAvailable = ( ( inputLanguage == ELangTaiwanChinese ) && |
|
16082 |
(iAknEditorFlags & EAknEditorFlagForceTransparentFepModes)); |
|
16083 |
break; |
|
16084 |
case EStrokeFind: |
|
16085 |
isAvailable = ( ( inputLanguage == ELangHongKongChinese ) && |
|
16086 |
(iAknEditorFlags & EAknEditorFlagForceTransparentFepModes)); |
|
16087 |
break; |
|
16088 |
case EHiraganaKanji: |
|
16089 |
isAvailable = (inputLanguage == ELangJapanese); |
|
16090 |
break; |
|
16091 |
case EKatakana: |
|
16092 |
isAvailable = (inputLanguage == ELangJapanese ); |
|
16093 |
break; |
|
16094 |
case EHindi: |
|
16095 |
isAvailable = (inputLanguage == ELangHindi ); |
|
16096 |
break; |
|
16097 |
case EHangul: |
|
16098 |
isAvailable = (inputLanguage == ELangKorean ); |
|
16099 |
break; |
|
16100 |
case ENativeNumber: |
|
16101 |
isAvailable = (inputLanguage == ELangHindi |
|
16102 |
|| inputLanguage == ELangArabic |
|
16103 |
|| inputLanguage == ELangUrdu |
|
16104 |
|| inputLanguage == ELangFarsi/* |
|
16105 |
|| ( inputLanguage == ELangThai && iFepPluginManager && |
|
16106 |
iFepPluginManager->PluginInputMode() != EPluginInputModeItut && |
|
16107 |
iFepPluginManager->PluginInputMode() != EPluginInputModeNone)*/ ); |
|
16108 |
default: |
|
16109 |
break; |
|
16110 |
} |
|
16111 |
return isAvailable; |
|
16112 |
} |
|
16113 |
||
16114 |
TInt CAknFepManager::NewInputModeAfterLanguageChange() const |
|
16115 |
{ |
|
16116 |
TInt inputMode = 0; |
|
16117 |
switch (iLanguageCapabilities.iInputLanguageCode) |
|
16118 |
{ |
|
16119 |
case ELangPrcChinese: |
|
16120 |
if ( iAknEditorFlags & EAknEditorFlagForceTransparentFepModes ) |
|
16121 |
{ |
|
16122 |
inputMode = ELatin; // EPRCFind from hashkey loop |
|
16123 |
} |
|
16124 |
else |
|
16125 |
{ |
|
16126 |
inputMode = EPinyin; |
|
16127 |
} |
|
16128 |
break; |
|
16129 |
case ELangHongKongChinese: |
|
16130 |
if ( iAknEditorFlags & EAknEditorFlagForceTransparentFepModes ) |
|
16131 |
{ |
|
16132 |
inputMode = EStrokeFind; |
|
16133 |
} |
|
16134 |
else |
|
16135 |
{ |
|
16136 |
TInt sharedDataMode = iSharedDataInterface->InputMode(); |
|
16137 |
if (iQwertyInputMode && |
|
16138 |
sharedDataMode == ECangJie) |
|
16139 |
{ |
|
16140 |
inputMode = ECangJie; |
|
16141 |
} |
|
16142 |
else |
|
16143 |
{ |
|
16144 |
inputMode = EStroke; |
|
16145 |
} |
|
16146 |
} |
|
16147 |
break; |
|
16148 |
case ELangTaiwanChinese: |
|
16149 |
if ( iAknEditorFlags & EAknEditorFlagForceTransparentFepModes ) |
|
16150 |
{ |
|
16151 |
inputMode = EZhuyinFind; |
|
16152 |
} |
|
16153 |
else |
|
16154 |
{ |
|
16155 |
inputMode = EZhuyin; |
|
16156 |
} |
|
16157 |
break; |
|
16158 |
case ELangJapanese: |
|
16159 |
inputMode = EHiraganaKanji; |
|
16160 |
break; |
|
16161 |
case ELangKorean: |
|
16162 |
inputMode = EHangul; |
|
16163 |
break; |
|
16164 |
default: |
|
16165 |
inputMode = ELatin; |
|
16166 |
break; |
|
16167 |
} |
|
16168 |
return inputMode; |
|
16169 |
} |
|
16170 |
||
16171 |
void CAknFepManager::SetInputLanguageCapabilities(const TInt aInputLanguage) |
|
16172 |
{ |
|
16173 |
iLanguageCapabilities.iInputLanguageCode = aInputLanguage; |
|
16174 |
||
16175 |
if ( aInputLanguage == ELangArabic || aInputLanguage == ELangHebrew || |
|
16176 |
aInputLanguage == ELangFarsi || aInputLanguage == ELangUrdu ) |
|
16177 |
{ |
|
16178 |
iLanguageCapabilities.iSupportsCase = EFalse; |
|
16179 |
iLanguageCapabilities.iRightToLeftLanguage = ETrue; |
|
16180 |
SetCursorTypeForInputDirection(EFalse); |
|
16181 |
} |
|
16182 |
else |
|
16183 |
{ |
|
16184 |
/*Hindi*/ |
|
16185 |
if ( aInputLanguage == ELangThai |
|
16186 |
|| (TAknFepUiIndicInputManager :: IsIndicLangauge(TLanguage(aInputLanguage))) |
|
16187 |
) |
|
16188 |
{ |
|
16189 |
iLanguageCapabilities.iSupportsCase = EFalse; |
|
16190 |
} |
|
16191 |
else |
|
16192 |
{ |
|
16193 |
iLanguageCapabilities.iSupportsCase = ETrue; |
|
16194 |
} |
|
16195 |
iLanguageCapabilities.iRightToLeftLanguage = EFalse; |
|
16196 |
SetCursorTypeForInputDirection(ETrue); |
|
16197 |
} |
|
16198 |
||
16199 |
TLanguage uiLanguage = User::Language(); |
|
16200 |
iLanguageCapabilities.iArabicIndicDigitsAllowed = |
|
16201 |
( aInputLanguage == ELangArabic || uiLanguage == ELangArabic); |
|
16202 |
iLanguageCapabilities.iEasternArabicIndicDigitsAllowed = ( |
|
16203 |
( aInputLanguage == ELangUrdu || uiLanguage == ELangUrdu ) || |
|
16204 |
( aInputLanguage == ELangFarsi|| uiLanguage == ELangFarsi ) ); |
|
16205 |
/*Hindi*/ |
|
16206 |
iLanguageCapabilities.iIndicDigitsAllowed = |
|
16207 |
( (TAknFepUiIndicInputManager :: IsIndicDigitsSupported(TLanguage(aInputLanguage))) ); |
|
16208 |
UpdateLocalDigitMode(); |
|
16209 |
||
16210 |
MAknFepManagerInterface* fepUI = iLangMan->GetFepUI(ELatin, iCharWidth, ETrue); |
|
16211 |
MPtiLanguage* ptiLanguage = iPtiEngine->GetLanguage(fepUI->SupportLanguage(ELatin)); |
|
16212 |
if (ptiLanguage) // can be NULL in some uncommon situations |
|
16213 |
{ |
|
16214 |
iLanguageCapabilities.iSupportsWesternPredictive = |
|
16215 |
ptiLanguage->HasInputMode(EPtiEnginePredictive); |
|
16216 |
// tp teleca change Korean lang does not support predictive |
|
16217 |
// and we want to disable predictive even with local editors |
|
16218 |
if(/*IsKoreanInputLanguage()*/GetInputLanguageFromSharedDataInterface() == ELangKorean ) |
|
16219 |
{ |
|
16220 |
iLanguageCapabilities.iSupportsWesternPredictive = EFalse; |
|
16221 |
} |
|
16222 |
||
16223 |
||
16224 |
// tp teleca change end |
|
16225 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
16226 |
// Predictive QWERTY (XT9) changes ----> |
|
16227 |
iLanguageCapabilities.iSupportsWesternQwertyPredictive = |
|
16228 |
ptiLanguage->HasInputMode(EPtiEngineQwertyPredictive ); |
|
16229 |
if ( GetInputLanguageFromSharedDataInterface() == ELangKorean ) |
|
16230 |
{ |
|
16231 |
iLanguageCapabilities.iSupportsWesternQwertyPredictive = EFalse; |
|
16232 |
} |
|
16233 |
||
16234 |
// Predictive QWERTY (XT9) changes <---- |
|
16235 |
#ifdef __HALF_QWERTY_KEYPAD |
|
16236 |
iLanguageCapabilities.iSupportsWesternHalfQwertyPredictive = ptiLanguage->HasInputMode(EPtiEngineHalfQwertyPredictive ); |
|
16237 |
#endif |
|
16238 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
16239 |
} |
|
16240 |
||
16241 |
if (!iLanguageCapabilities.iSupportsWesternPredictive |
|
16242 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
16243 |
&& !iLanguageCapabilities.iSupportsWesternQwertyPredictive |
|
16244 |
// Predictive QWERTY changes |
|
16245 |
#ifdef __HALF_QWERTY_KEYPAD |
|
16246 |
&& !iLanguageCapabilities.iSupportsWesternHalfQwertyPredictive |
|
16247 |
#endif //__HALF_QWERTY_KEYPAD |
|
16248 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
16249 |
) // Predictive QWERTY changes |
|
16250 |
{ |
|
16251 |
SetWesternPredictive(EFalse); |
|
16252 |
} |
|
16253 |
} |
|
16254 |
||
16255 |
TInt CAknFepManager::SubstituteSublanguageId(const TInt aUiLanguage) const |
|
16256 |
{ |
|
16257 |
return DefaultInputLanguageFromUILanguage(aUiLanguage); |
|
16258 |
} |
|
16259 |
||
16260 |
TTmDocPosSpec CAknFepManager::DocPos() |
|
16261 |
{ |
|
16262 |
TTmDocPosSpec docPos = TTmDocPosSpec(); |
|
16263 |
TTmDocPos rawDocPos; |
|
16264 |
TBool gotPos = EFalse; |
|
16265 |
MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
16266 |
if (docNavi) |
|
16267 |
{ |
|
16268 |
docNavi->GetDocPos(rawDocPos); |
|
16269 |
gotPos = ETrue; |
|
16270 |
} |
|
16271 |
else |
|
16272 |
{ |
|
16273 |
// Use Edwin (FepAwareTextEditor() ) to get the position of document |
|
16274 |
if ( FepAwareTextEditor() ) |
|
16275 |
{ |
|
16276 |
TCursorSelection cursorSel( 0, 0 ); |
|
16277 |
// Get the postion of document |
|
16278 |
FepAwareTextEditor()->GetCursorSelectionForFep( cursorSel ); |
|
16279 |
||
16280 |
// Set the leading edge of the document. |
|
16281 |
rawDocPos.iPos = cursorSel.iCursorPos; |
|
16282 |
CAknEdwinState* state( EditorState() ); |
|
16283 |
rawDocPos.iLeadingEdge = ( state && |
|
16284 |
state->Flags() & EAknEditorFlagCursorLedingEdge ); |
|
16285 |
gotPos = ETrue; |
|
16286 |
} |
|
16287 |
} |
|
16288 |
if (gotPos) |
|
16289 |
{ |
|
16290 |
docPos.iPos = rawDocPos.iPos; |
|
16291 |
TTmDocPosSpec::TType docPosType = |
|
16292 |
rawDocPos.iLeadingEdge ? TTmDocPosSpec::ELeading : TTmDocPosSpec::ETrailing; |
|
16293 |
docPos.iType = docPosType; |
|
16294 |
} |
|
16295 |
return docPos; |
|
16296 |
} |
|
16297 |
||
16298 |
/** |
|
16299 |
* This method needs EditorState() to exist |
|
16300 |
* |
|
16301 |
*/ |
|
16302 |
CTextView* CAknFepManager::TextView() const |
|
16303 |
{ |
|
16304 |
if (EditorState()) |
|
16305 |
{ |
|
16306 |
CAknEdwinFormAccessor* formAccessor = EditorState()->FormAccessor(); |
|
16307 |
if (formAccessor) |
|
16308 |
{ |
|
16309 |
return formAccessor->GetTextView(); |
|
16310 |
} |
|
16311 |
} |
|
16312 |
return NULL; |
|
16313 |
} |
|
16314 |
||
16315 |
CTextLayout* CAknFepManager::TextLayout() const |
|
16316 |
{ |
|
16317 |
if( EditorState() ) |
|
16318 |
{ |
|
16319 |
CAknEdwinFormAccessor* formAccessor = EditorState()->FormAccessor(); |
|
16320 |
if (formAccessor) |
|
16321 |
{ |
|
16322 |
return formAccessor->GetTextLayout(); |
|
16323 |
} |
|
16324 |
} |
|
16325 |
return NULL; |
|
16326 |
} |
|
16327 |
||
16328 |
CPlainText* CAknFepManager::PlainText() const |
|
16329 |
{ |
|
16330 |
return iUiInterface->PlainText(EditorState()); |
|
16331 |
} |
|
16332 |
||
16333 |
/** |
|
16334 |
* Checks if the paragraph containing aPos is Right to left. |
|
16335 |
* This routine will return nonsense if |
|
16336 |
* - TextLayout() does not return a pointer |
|
16337 |
* - the position passed is not in the formatted region |
|
16338 |
* |
|
16339 |
* Note, the return value from FindDocPos is thrown away |
|
16340 |
*/ |
|
16341 |
TBool CAknFepManager::IsRightToLeftParagraph(TTmDocPosSpec aPos) const |
|
16342 |
{ |
|
16343 |
TTmPosInfo2 posInfo; |
|
16344 |
TTmLineInfo lineInfo; |
|
16345 |
MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
16346 |
if (docNavi) |
|
16347 |
{ |
|
16348 |
docNavi->FindDocPos(aPos, posInfo, lineInfo); |
|
16349 |
} |
|
16350 |
else |
|
16351 |
{ |
|
16352 |
CTextLayout* textLayout = TextLayout(); |
|
16353 |
if (textLayout) |
|
16354 |
{ |
|
16355 |
textLayout->TagmaTextLayout().FindDocPos(aPos, posInfo, lineInfo); |
|
16356 |
} |
|
16357 |
} |
|
16358 |
||
16359 |
return lineInfo.iFlags & TTmLineInfo::EParRightToLeft; |
|
16360 |
} |
|
16361 |
||
16362 |
||
16363 |
void CAknFepManager::FindAdjacentChunks(const TTmDocPosSpec& aPos, |
|
16364 |
CTmTextLayout::TTmChunkDescription& aLeft, |
|
16365 |
CTmTextLayout::TTmChunkDescription& aRight) const |
|
16366 |
{ |
|
16367 |
aLeft.iStart = -1; |
|
16368 |
aLeft.iEnd = -1; |
|
16369 |
aLeft.iRightToLeft = EFalse; |
|
16370 |
aRight.iStart = -1; |
|
16371 |
aRight.iEnd = -1; |
|
16372 |
aRight.iRightToLeft = EFalse; |
|
16373 |
||
16374 |
MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
16375 |
if (docNavi) |
|
16376 |
{ |
|
16377 |
docNavi->FindAdjacentChunks(aPos, aLeft, aRight); |
|
16378 |
} |
|
16379 |
else |
|
16380 |
{ |
|
16381 |
CTextLayout* textLayout = TextLayout(); |
|
16382 |
if (textLayout) |
|
16383 |
{ |
|
16384 |
textLayout->TagmaTextLayout().FindAdjacentChunks(aPos, aLeft, aRight); |
|
16385 |
} |
|
16386 |
} |
|
16387 |
} |
|
16388 |
||
16389 |
||
16390 |
TBool CAknFepManager::GetNextVisualRightCharacter( TInt& aPosition ) |
|
16391 |
{ |
|
16392 |
TTmDocPosSpec pos = DocPos(); |
|
16393 |
TTmPosInfo2 info; |
|
16394 |
TBool nextPositionFound = EFalse; |
|
16395 |
MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
16396 |
if (docNavi) |
|
16397 |
{ |
|
16398 |
nextPositionFound = docNavi->GetNextVisualCursorPos(pos, info, EFalse); |
|
16399 |
} |
|
16400 |
else |
|
16401 |
{ |
|
16402 |
CTextLayout* textLayout = TextLayout(); |
|
16403 |
if (textLayout) |
|
16404 |
{ |
|
16405 |
nextPositionFound = textLayout->TagmaTextLayout().GetNextVisualCursorPos(pos, |
|
16406 |
info, |
|
16407 |
EFalse); |
|
16408 |
} |
|
16409 |
} |
|
16410 |
if (nextPositionFound) |
|
16411 |
{ |
|
16412 |
aPosition = info.iDocPos.iPos; |
|
16413 |
||
16414 |
CTmTextLayout::TTmChunkDescription leftChunk; |
|
16415 |
CTmTextLayout::TTmChunkDescription rightChunk; |
|
16416 |
FindAdjacentChunks(pos, leftChunk, rightChunk); |
|
16417 |
||
16418 |
if ( !rightChunk.iRightToLeft ) |
|
16419 |
{ |
|
16420 |
aPosition -= 1; |
|
16421 |
} |
|
16422 |
} |
|
16423 |
return nextPositionFound; |
|
16424 |
} |
|
16425 |
||
16426 |
TBool CAknFepManager::GetNextVisualLeftCharacter( TInt& aPosition ) |
|
16427 |
{ |
|
16428 |
TTmDocPosSpec pos = DocPos(); |
|
16429 |
TTmPosInfo2 info; |
|
16430 |
TBool nextPositionFound = EFalse; |
|
16431 |
MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
16432 |
if (docNavi) |
|
16433 |
{ |
|
16434 |
nextPositionFound = docNavi->GetNextVisualCursorPos(pos, info, ETrue); |
|
16435 |
} |
|
16436 |
else |
|
16437 |
{ |
|
16438 |
CTextLayout* textLayout = TextLayout(); |
|
16439 |
if (textLayout) |
|
16440 |
{ |
|
16441 |
nextPositionFound = TextLayout()->TagmaTextLayout().GetNextVisualCursorPos(pos, |
|
16442 |
info, |
|
16443 |
ETrue); |
|
16444 |
} |
|
16445 |
} |
|
16446 |
if (nextPositionFound) |
|
16447 |
{ |
|
16448 |
aPosition = info.iDocPos.iPos; |
|
16449 |
CTmTextLayout::TTmChunkDescription leftChunk; |
|
16450 |
CTmTextLayout::TTmChunkDescription rightChunk; |
|
16451 |
FindAdjacentChunks(pos, leftChunk, rightChunk); |
|
16452 |
||
16453 |
if ( leftChunk.iRightToLeft ) |
|
16454 |
{ |
|
16455 |
aPosition -= 1; |
|
16456 |
} |
|
16457 |
if (iLanguageCapabilities.iInputLanguageCode == ELangVietnamese) |
|
16458 |
{ |
|
16459 |
aPosition = pos.iPos -1; |
|
16460 |
} |
|
16461 |
} |
|
16462 |
return nextPositionFound; |
|
16463 |
} |
|
16464 |
||
16465 |
void CAknFepManager::FindVisualRightOfWord(TInt& aPosition) |
|
16466 |
{ |
|
16467 |
TTmDocPosSpec pos = DocPos(); |
|
16468 |
CTmTextLayout::TTmChunkDescription leftChunk; |
|
16469 |
CTmTextLayout::TTmChunkDescription rightChunk; |
|
16470 |
FindAdjacentChunks(pos, leftChunk, rightChunk); |
|
16471 |
||
16472 |
if ( rightChunk.iRightToLeft ) |
|
16473 |
{ |
|
16474 |
FindStartOfWord(aPosition); |
|
16475 |
} |
|
16476 |
else |
|
16477 |
{ |
|
16478 |
FindEndOfWord(aPosition); |
|
16479 |
} |
|
16480 |
} |
|
16481 |
||
16482 |
void CAknFepManager::FindVisualLeftOfWord(TInt& aPosition) |
|
16483 |
{ |
|
16484 |
TTmDocPosSpec pos = DocPos(); |
|
16485 |
CTmTextLayout::TTmChunkDescription leftChunk; |
|
16486 |
CTmTextLayout::TTmChunkDescription rightChunk; |
|
16487 |
FindAdjacentChunks(pos, leftChunk, rightChunk); |
|
16488 |
||
16489 |
if ( leftChunk.iRightToLeft) |
|
16490 |
{ |
|
16491 |
FindEndOfWord(aPosition); |
|
16492 |
} |
|
16493 |
else |
|
16494 |
{ |
|
16495 |
FindStartOfWord(aPosition); |
|
16496 |
} |
|
16497 |
} |
|
16498 |
||
16499 |
||
16500 |
||
16501 |
TBool CAknFepManager::GetVisualDocStart( TTmDocPosSpec& aPos) const |
|
16502 |
{ |
|
16503 |
// Set up the initial try as leading to the first logical character |
|
16504 |
// It is a requirement that this position is at least in the first line |
|
16505 |
TTmDocPosSpec pos(0, TTmDocPosSpec::ELeading); |
|
16506 |
||
16507 |
// Need to record if we are in aleft to right paragraph or not |
|
16508 |
TBool leftToRightParagraph = !IsRightToLeftParagraph(pos); |
|
16509 |
||
16510 |
TBool success(EFalse); |
|
16511 |
CTextLayout* textLayout = TextLayout(); |
|
16512 |
TTmDocPosSpec docPos; |
|
16513 |
if (AknFepDocumentNavigation() || textLayout) |
|
16514 |
{ |
|
16515 |
// This was written because Tagma's LineExtreme() method did not seem to work |
|
16516 |
success = GetAknFepLineExtreme( pos, !leftToRightParagraph, docPos ); |
|
16517 |
} |
|
16518 |
||
16519 |
if (success) |
|
16520 |
aPos = docPos; |
|
16521 |
else // Possible cleanup; action for when there is insufficient information |
|
16522 |
{ |
|
16523 |
aPos.iPos = 0; |
|
16524 |
aPos.iType = TTmDocPosSpec::ELeading; |
|
16525 |
} |
|
16526 |
||
16527 |
return success; |
|
16528 |
} |
|
16529 |
||
16530 |
TBool CAknFepManager::GetVisualDocEnd( TTmDocPosSpec& aPos) const |
|
16531 |
{ |
|
16532 |
// Set EAknEditorFlagNeedWholeTextData to Editor State |
|
16533 |
// EAknEditorFlagNeedWholeTextData means needing to get whole document data to editor |
|
16534 |
UpdateEditorStateFlags( EAknEditorFlagNeedWholeTextData ); |
|
16535 |
||
16536 |
TInt docLength = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
16537 |
||
16538 |
// Set up the initial try as trailing after the last logical character |
|
16539 |
// It is a requirement that this position is at least in the last line |
|
16540 |
TTmDocPosSpec pos(docLength, TTmDocPosSpec::ETrailing); |
|
16541 |
||
16542 |
// Need to record if we are in a left to right paragraph or not |
|
16543 |
TBool leftToRightParagraph = !IsRightToLeftParagraph(pos); |
|
16544 |
||
16545 |
TBool success(EFalse); |
|
16546 |
CTextLayout* textLayout = TextLayout(); |
|
16547 |
TTmDocPosSpec docPos; |
|
16548 |
if (AknFepDocumentNavigation() || textLayout) |
|
16549 |
{ |
|
16550 |
// This was written because Tagma's LineExtreme() method did not seem to work |
|
16551 |
success = GetAknFepLineExtreme( pos, leftToRightParagraph, docPos ); |
|
16552 |
} |
|
16553 |
||
16554 |
if (success) |
|
16555 |
aPos = docPos; |
|
16556 |
else // Possible cleanup; action for when there is insufficient information |
|
16557 |
{ |
|
16558 |
aPos.iPos = docLength; |
|
16559 |
aPos.iType = TTmDocPosSpec::ETrailing; |
|
16560 |
} |
|
16561 |
||
16562 |
// Remove EAknEditorFlagNeedWholeTextData fromEditor State |
|
16563 |
UpdateEditorStateFlags( EAknEditorFlagNeedWholeTextData, EFalse ); |
|
16564 |
return success; |
|
16565 |
} |
|
16566 |
||
16567 |
||
16568 |
TBool CAknFepManager::GetAknFepLineExtreme( const TTmDocPosSpec& aPos, TBool aToRight, |
|
16569 |
TTmDocPosSpec& aExtreme) const |
|
16570 |
{ |
|
16571 |
TBool success(EFalse); |
|
16572 |
||
16573 |
TTmPosInfo2 posInfo; |
|
16574 |
TTmLineInfo lineInfo; |
|
16575 |
TBool found = EFalse; |
|
16576 |
MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
16577 |
if (docNavi) |
|
16578 |
{ |
|
16579 |
found = docNavi->FindDocPos(aPos, posInfo, lineInfo); |
|
16580 |
} |
|
16581 |
else |
|
16582 |
{ |
|
16583 |
CTextLayout* textLayout = TextLayout(); |
|
16584 |
if ( textLayout ) |
|
16585 |
{ |
|
16586 |
found = textLayout->TagmaTextLayout().FindDocPos(aPos, posInfo, lineInfo); |
|
16587 |
} |
|
16588 |
} |
|
16589 |
||
16590 |
if ( found ) |
|
16591 |
{ |
|
16592 |
// Make a selection of the line info. Cursor first, Anchar 2nd: |
|
16593 |
TCursorSelection theWholeLine( lineInfo.iEnd-1, lineInfo.iStart ); |
|
16594 |
||
16595 |
TWesternNaviEvent event; |
|
16596 |
if ( aToRight ) |
|
16597 |
event = ERightNaviEvent; |
|
16598 |
else |
|
16599 |
event = ELeftNaviEvent; |
|
16600 |
||
16601 |
GetAvkonDefinedVisualLimitsOfSelection( theWholeLine, event, aExtreme, NULL ); |
|
16602 |
success = ETrue; |
|
16603 |
} |
|
16604 |
||
16605 |
return success; |
|
16606 |
} |
|
16607 |
||
16608 |
||
16609 |
/** |
|
16610 |
* This routine analyses a selection (Does not have to be a real selection, but the datastructure |
|
16611 |
* is used as input) to find its visual start or end, according to the passed parameter |
|
16612 |
* The algo used is: |
|
16613 |
* - First find the top line of the selection. |
|
16614 |
* - Then find the bottom line of the selection. |
|
16615 |
* - Look at the two lines' directionality (from the paragraph they belong to) and decide what the overall |
|
16616 |
* directionality of the selection is. Thus right/left can be translated to increment/decrement. |
|
16617 |
* (Note that Up is always decrement; down is always increment). So that allows the key actions to be |
|
16618 |
* correctly grouped, and allows it to be determined which keys act from the top or the bottom line |
|
16619 |
* (Decrement always acts from the top line; Increment always acts from the bottom line) |
|
16620 |
* |
|
16621 |
* - When the keys are handled, the action is again translated back to right/left according to the key- |
|
16622 |
* grouping and whether you are acting from the top line or from the bottom line. Eg, decrement in RTL |
|
16623 |
* line is visually to the Right. |
|
16624 |
* - the appropriate "ExtremePos" API is called passing in the position on the line in which we are acting |
|
16625 |
* |
|
16626 |
*/ |
|
16627 |
void CAknFepManager::GetAvkonDefinedVisualLimitsOfSelection( |
|
16628 |
const TCursorSelection& aSelection, |
|
16629 |
TWesternNaviEvent aEvent, |
|
16630 |
TTmDocPosSpec& aLimitPos, |
|
16631 |
TWesternNaviEvent* aEffectiveRightOrLeftEvent ) const |
|
16632 |
{ |
|
16633 |
// in case an irrelvant event is sent, initialize aLimitPos to something safe |
|
16634 |
aLimitPos.iPos = 0; |
|
16635 |
aLimitPos.iType = TTmDocPosSpec::ELeading; |
|
16636 |
||
16637 |
TTmDocPosSpec lowLogicalPos( aSelection.LowerPos(), TTmDocPosSpec::ELeading ); |
|
16638 |
TTmDocPosSpec highLogicalPos( aSelection.HigherPos(), TTmDocPosSpec::ETrailing ); |
|
16639 |
||
16640 |
// this records what the resulting Right/left direction (for optional return) |
|
16641 |
TWesternNaviEvent effectiveEvent = aEvent; |
|
16642 |
||
16643 |
// Get line and paragraph of the lower limit of the selection: |
|
16644 |
TTmPosInfo2 posInfo; |
|
16645 |
TTmLineInfo lineInfo; |
|
16646 |
TBool lowIsRightToLeft; |
|
16647 |
TBool highIsRightToLeft; |
|
16648 |
TBool layoutExists = EFalse; |
|
16649 |
||
16650 |
MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
16651 |
if (docNavi) |
|
16652 |
{ |
|
16653 |
docNavi->FindDocPos(lowLogicalPos, posInfo, lineInfo); |
|
16654 |
lowIsRightToLeft = lineInfo.iFlags & TTmLineInfo::EParRightToLeft; |
|
16655 |
docNavi->FindDocPos(highLogicalPos, posInfo, lineInfo); |
|
16656 |
highIsRightToLeft = lineInfo.iFlags & TTmLineInfo::EParRightToLeft; |
|
16657 |
layoutExists = ETrue; |
|
16658 |
} |
|
16659 |
else |
|
16660 |
{ |
|
16661 |
CTextLayout* textLayout = TextLayout(); |
|
16662 |
if (textLayout) |
|
16663 |
{ |
|
16664 |
textLayout->TagmaTextLayout().FindDocPos(lowLogicalPos, posInfo, lineInfo); |
|
16665 |
lowIsRightToLeft = lineInfo.iFlags & TTmLineInfo::EParRightToLeft; |
|
16666 |
textLayout->TagmaTextLayout().FindDocPos(highLogicalPos, posInfo, lineInfo); |
|
16667 |
highIsRightToLeft = lineInfo.iFlags & TTmLineInfo::EParRightToLeft; |
|
16668 |
layoutExists = ETrue; |
|
16669 |
} |
|
16670 |
} |
|
16671 |
||
16672 |
if (layoutExists) |
|
16673 |
{ |
|
16674 |
// Decide on the net directionality. This if looks a bit laboured, but it |
|
16675 |
// exhibits the Averell policy. |
|
16676 |
TBool netDirectionIsRightToLeft(EFalse); |
|
16677 |
if ( lowIsRightToLeft == highIsRightToLeft ) |
|
16678 |
netDirectionIsRightToLeft = lowIsRightToLeft; |
|
16679 |
else |
|
16680 |
netDirectionIsRightToLeft = lowIsRightToLeft;// ambiguous - Take first paragraph |
|
16681 |
||
16682 |
if ( netDirectionIsRightToLeft ) |
|
16683 |
switch ( aEvent ) |
|
16684 |
{ |
|
16685 |
case ELeftNaviEvent: |
|
16686 |
case EDownNaviEvent: |
|
16687 |
effectiveEvent = ELeftNaviEvent; |
|
16688 |
aLimitPos = LeftVisualExtremePos( highLogicalPos, lowLogicalPos.iPos, |
|
16689 |
highLogicalPos.iPos ); |
|
16690 |
break; |
|
16691 |
case ERightNaviEvent: |
|
16692 |
case EUpNaviEvent: |
|
16693 |
effectiveEvent = ERightNaviEvent; |
|
16694 |
aLimitPos = RightVisualExtremePos(lowLogicalPos, lowLogicalPos.iPos, |
|
16695 |
highLogicalPos.iPos ); |
|
16696 |
break; |
|
16697 |
default: |
|
16698 |
// No action. Only the events above are handled. |
|
16699 |
break; |
|
16700 |
} |
|
16701 |
else |
|
16702 |
switch (aEvent) |
|
16703 |
{ |
|
16704 |
case ELeftNaviEvent: |
|
16705 |
case EUpNaviEvent: |
|
16706 |
effectiveEvent = ELeftNaviEvent; |
|
16707 |
aLimitPos = LeftVisualExtremePos( lowLogicalPos, lowLogicalPos.iPos, |
|
16708 |
highLogicalPos.iPos); |
|
16709 |
break; |
|
16710 |
case ERightNaviEvent: |
|
16711 |
case EDownNaviEvent: |
|
16712 |
effectiveEvent = ERightNaviEvent; |
|
16713 |
aLimitPos = RightVisualExtremePos( highLogicalPos, lowLogicalPos.iPos, |
|
16714 |
highLogicalPos.iPos ); |
|
16715 |
break; |
|
16716 |
default: |
|
16717 |
// No action. Only the events above are handled. |
|
16718 |
break; |
|
16719 |
} |
|
16720 |
} |
|
16721 |
||
16722 |
else |
|
16723 |
{ |
|
16724 |
// No text layout: Left or Up naviEvent gives low end; Right or down give high end |
|
16725 |
switch ( aEvent ) |
|
16726 |
{ |
|
16727 |
case ELeftNaviEvent: |
|
16728 |
case EUpNaviEvent: |
|
16729 |
effectiveEvent = ELeftNaviEvent; |
|
16730 |
aLimitPos = lowLogicalPos; |
|
16731 |
break; |
|
16732 |
case ERightNaviEvent: |
|
16733 |
case EDownNaviEvent: |
|
16734 |
effectiveEvent = ERightNaviEvent; |
|
16735 |
aLimitPos = highLogicalPos; |
|
16736 |
break; |
|
16737 |
default: |
|
16738 |
// No action. Only the events above are handled. |
|
16739 |
break; |
|
16740 |
} |
|
16741 |
} |
|
16742 |
// return the effective direction (Right or Left) |
|
16743 |
if ( aEffectiveRightOrLeftEvent ) |
|
16744 |
*aEffectiveRightOrLeftEvent = effectiveEvent; |
|
16745 |
||
16746 |
} |
|
16747 |
||
16748 |
||
16749 |
TTmDocPosSpec CAknFepManager::LeftVisualExtremePos( const TTmDocPosSpec& aStartPos, |
|
16750 |
TInt aMinPos, TInt aMaxPos ) const |
|
16751 |
{ |
|
16752 |
// Start at start and find adjacent left chunks repeatedly until we find no more chunks, or our max or min |
|
16753 |
// is within a chunk |
|
16754 |
TTmDocPosSpec currentPos = aStartPos; |
|
16755 |
CTextLayout* textLayout = TextLayout(); |
|
16756 |
if (AknFepDocumentNavigation() || textLayout) |
|
16757 |
{ |
|
16758 |
CTmTextLayout::TTmChunkDescription leftChunk; |
|
16759 |
CTmTextLayout::TTmChunkDescription rightChunk; |
|
16760 |
||
16761 |
TInt iterations(0); |
|
16762 |
TBool endFound(EFalse); |
|
16763 |
||
16764 |
while( !endFound && iterations < KMaxChunkWalkIterations ) |
|
16765 |
{ |
|
16766 |
iterations++; |
|
16767 |
FindAdjacentChunks(currentPos, leftChunk, rightChunk); |
|
16768 |
// Try to move to left end of left chunk |
|
16769 |
endFound = LeftEndOfChunkWithinRange( leftChunk, aMinPos, aMaxPos, currentPos ); |
|
16770 |
} |
|
16771 |
} |
|
16772 |
return currentPos; |
|
16773 |
} |
|
16774 |
||
16775 |
TTmDocPosSpec CAknFepManager::RightVisualExtremePos( const TTmDocPosSpec& aStartPos, |
|
16776 |
TInt aMinPos, TInt aMaxPos ) const |
|
16777 |
{ |
|
16778 |
// Start at start and find adjacent right chunks repeatedly until we find no more chunks, or our max or min |
|
16779 |
// is within a chunk |
|
16780 |
TTmDocPosSpec currentPos = aStartPos; |
|
16781 |
CTextLayout* textLayout = TextLayout(); |
|
16782 |
if (AknFepDocumentNavigation() || textLayout) |
|
16783 |
{ |
|
16784 |
CTmTextLayout::TTmChunkDescription leftChunk; |
|
16785 |
CTmTextLayout::TTmChunkDescription rightChunk; |
|
16786 |
||
16787 |
TInt iterations(0); |
|
16788 |
TBool endFound(EFalse); |
|
16789 |
||
16790 |
while( !endFound && iterations < KMaxChunkWalkIterations ) |
|
16791 |
{ |
|
16792 |
iterations++; |
|
16793 |
FindAdjacentChunks(currentPos, leftChunk, rightChunk); |
|
16794 |
// Try to move to left end of left chunk |
|
16795 |
endFound = RightEndOfChunkWithinRange( rightChunk, aMinPos, aMaxPos, currentPos ); |
|
16796 |
} |
|
16797 |
} |
|
16798 |
return currentPos; |
|
16799 |
} |
|
16800 |
||
16801 |
TBool CAknFepManager::LeftEndOfChunkWithinRange( const CTmTextLayout::TTmChunkDescription& aChunk, |
|
16802 |
TInt aMinPos, TInt aMaxPos, TTmDocPosSpec& aNewPos) const |
|
16803 |
{ |
|
16804 |
TBool constrained = EFalse; |
|
16805 |
TInt leftEnd; |
|
16806 |
if ( !ChunkIsValid( aChunk ) ) |
|
16807 |
{ |
|
16808 |
constrained = ETrue; // leave the aNewPos as it is |
|
16809 |
} |
|
16810 |
else if ( aChunk.iStart >= iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep() ) |
|
16811 |
{ |
|
16812 |
constrained = ETrue; // That chunk was a ficticious one: |
|
16813 |
} |
|
16814 |
else if ( aChunk.iEnd <= aMinPos || aChunk.iStart >= aMaxPos ) |
|
16815 |
{ |
|
16816 |
constrained = ETrue; // That chunk found does not actually overlap with valid range. Don't go there |
|
16817 |
} |
|
16818 |
else |
|
16819 |
{ |
|
16820 |
if ( aChunk.iRightToLeft ) |
|
16821 |
{ |
|
16822 |
leftEnd = aChunk.iEnd; |
|
16823 |
if ( leftEnd >= aMaxPos ) |
|
16824 |
{ |
|
16825 |
constrained = ETrue; |
|
16826 |
aNewPos.iPos = aMaxPos; |
|
16827 |
} |
|
16828 |
else |
|
16829 |
{ |
|
16830 |
aNewPos.iPos = leftEnd; |
|
16831 |
} |
|
16832 |
aNewPos.iType = TTmDocPosSpec::ETrailing; |
|
16833 |
} |
|
16834 |
else |
|
16835 |
{ |
|
16836 |
leftEnd = aChunk.iStart; |
|
16837 |
if ( leftEnd <= aMinPos ) |
|
16838 |
{ |
|
16839 |
constrained = ETrue; |
|
16840 |
aNewPos.iPos = aMinPos; |
|
16841 |
} |
|
16842 |
else |
|
16843 |
{ |
|
16844 |
aNewPos.iPos = leftEnd; |
|
16845 |
} |
|
16846 |
aNewPos.iType = TTmDocPosSpec::ELeading; |
|
16847 |
} |
|
16848 |
} |
|
16849 |
return constrained; |
|
16850 |
} |
|
16851 |
||
16852 |
TBool CAknFepManager::RightEndOfChunkWithinRange( const CTmTextLayout::TTmChunkDescription& aChunk, |
|
16853 |
TInt aMinPos, TInt aMaxPos, TTmDocPosSpec& aNewPos) const |
|
16854 |
{ |
|
16855 |
TBool constrained = EFalse; |
|
16856 |
TInt rightEnd; |
|
16857 |
if ( !ChunkIsValid( aChunk ) ) |
|
16858 |
{ |
|
16859 |
constrained = ETrue; // leave the aNewPos as it is |
|
16860 |
} |
|
16861 |
else if ( aChunk.iStart >= iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep() ) |
|
16862 |
{ |
|
16863 |
constrained = ETrue; // That chunk was a ficticious one: |
|
16864 |
} |
|
16865 |
else if ( aChunk.iEnd <= aMinPos || aChunk.iStart >= aMaxPos ) |
|
16866 |
{ |
|
16867 |
constrained = ETrue; // That chunk found does not actually overlap with valid range. Don't go there |
|
16868 |
} |
|
16869 |
else |
|
16870 |
{ |
|
16871 |
if ( aChunk.iRightToLeft ) |
|
16872 |
{ |
|
16873 |
rightEnd = aChunk.iStart; |
|
16874 |
if ( rightEnd <= aMinPos ) |
|
16875 |
{ |
|
16876 |
constrained = ETrue; |
|
16877 |
aNewPos.iPos = aMinPos; |
|
16878 |
} |
|
16879 |
else |
|
16880 |
{ |
|
16881 |
aNewPos.iPos = rightEnd; |
|
16882 |
} |
|
16883 |
aNewPos.iType = TTmDocPosSpec::ELeading; |
|
16884 |
} |
|
16885 |
else |
|
16886 |
{ |
|
16887 |
rightEnd = aChunk.iEnd; |
|
16888 |
if ( rightEnd >= aMaxPos ) |
|
16889 |
{ |
|
16890 |
constrained = ETrue; |
|
16891 |
aNewPos.iPos = aMaxPos; |
|
16892 |
} |
|
16893 |
else |
|
16894 |
{ |
|
16895 |
aNewPos.iPos = rightEnd; |
|
16896 |
} |
|
16897 |
aNewPos.iType = TTmDocPosSpec::ETrailing; |
|
16898 |
} |
|
16899 |
} |
|
16900 |
return constrained; |
|
16901 |
} |
|
16902 |
||
16903 |
/** |
|
16904 |
* This method handles the attachment to the chunk being navigated toward. |
|
16905 |
* Should only be used for Right and Left navigation. |
|
16906 |
* The actual direction of that chunk does not need to be looked at. Even if |
|
16907 |
* is the same direction as the one being moved from, you still attach to it, as it may not |
|
16908 |
* be logically contiguous. |
|
16909 |
*/ |
|
16910 |
void CAknFepManager::AdjustPosSpecForAmbiguityAfterLeftOrRightNavigation( TTmDocPosSpec& aPos, |
|
16911 |
TWesternNaviEvent aEvent ) const |
|
16912 |
{ |
|
16913 |
||
16914 |
CTmTextLayout::TTmChunkDescription leftChunk; |
|
16915 |
CTmTextLayout::TTmChunkDescription rightChunk; |
|
16916 |
FindAdjacentChunks(aPos, leftChunk, rightChunk); |
|
16917 |
||
16918 |
TBool inputDirectionIsRTL = ( CurrentInputDirectionality() == TBidiText::ERightToLeft ); |
|
16919 |
||
16920 |
switch (aEvent) |
|
16921 |
{ |
|
16922 |
case ELeftNaviEvent: |
|
16923 |
{ |
|
16924 |
// Do not attach to the left chunk if its directionality is not the same as aDirection |
|
16925 |
if ( ChunkIsValid( leftChunk ) ) |
|
16926 |
if ( COMPARE_BOOLS(inputDirectionIsRTL, leftChunk.iRightToLeft) ) |
|
16927 |
AttachToLeftChunk( aPos, leftChunk ); |
|
16928 |
break; |
|
16929 |
} |
|
16930 |
case ERightNaviEvent: |
|
16931 |
{ |
|
16932 |
if ( ChunkIsValid( rightChunk ) ) |
|
16933 |
if ( COMPARE_BOOLS(inputDirectionIsRTL, rightChunk.iRightToLeft) ) |
|
16934 |
AttachToRightChunk( aPos, rightChunk ); |
|
16935 |
break; |
|
16936 |
} |
|
16937 |
default: |
|
16938 |
break; |
|
16939 |
} |
|
16940 |
||
16941 |
} |
|
16942 |
||
16943 |
||
16944 |
void CAknFepManager::AttachToRightChunk( TTmDocPosSpec& aPos, |
|
16945 |
const CTmTextLayout::TTmChunkDescription& aRightChunk ) |
|
16946 |
{ |
|
16947 |
if ( aRightChunk.iRightToLeft ) |
|
16948 |
{ |
|
16949 |
aPos.iPos = aRightChunk.iEnd; |
|
16950 |
aPos.iType = TTmDocPosSpec::ETrailing; |
|
16951 |
} |
|
16952 |
else |
|
16953 |
{ |
|
16954 |
aPos.iPos = aRightChunk.iStart; |
|
16955 |
aPos.iType = TTmDocPosSpec::ELeading; |
|
16956 |
} |
|
16957 |
} |
|
16958 |
||
16959 |
void CAknFepManager::AttachToLeftChunk( TTmDocPosSpec& aPos, |
|
16960 |
const CTmTextLayout::TTmChunkDescription& aLeftChunk ) |
|
16961 |
{ |
|
16962 |
if ( aLeftChunk.iRightToLeft ) |
|
16963 |
{ |
|
16964 |
aPos.iPos = aLeftChunk.iStart; |
|
16965 |
aPos.iType = TTmDocPosSpec::ELeading; |
|
16966 |
} |
|
16967 |
else |
|
16968 |
{ |
|
16969 |
aPos.iPos = aLeftChunk.iEnd; |
|
16970 |
aPos.iType = TTmDocPosSpec::ETrailing; |
|
16971 |
} |
|
16972 |
} |
|
16973 |
||
16974 |
/** |
|
16975 |
* This routine ensures that the cursor position is not attached to a chunk of opposite direction. |
|
16976 |
* For end of document, the normal routine can be used. |
|
16977 |
* For the start, usually do nothing, but there is the possibility of forcing position 0/Trailing, when |
|
16978 |
* the edge chunk and the input directionality are opposite. |
|
16979 |
*/ |
|
16980 |
void CAknFepManager::AdjustPosSpecForInputLanguageAfterDocumentLoop( TTmDocPosSpec& aPos, |
|
16981 |
TWesternNaviEvent /*aNaviEvent*/, TBool aLoopToTop ) const |
|
16982 |
{ |
|
16983 |
||
16984 |
// Looping based on a Left event should adjust the cursor position as if that point had |
|
16985 |
// been reached by navigation to that same visual position outwards from the body |
|
16986 |
// Define this as the effective navigation that has just happened: |
|
16987 |
TWesternNaviEvent effectiveEvent(ELeftNaviEvent); |
|
16988 |
||
16989 |
// Rule for this effective navigation is |
|
16990 |
// move to top of document : if paradirection is LTR then treat it as a LEFT navi |
|
16991 |
// move to top of document : if paradirection is RTL then treat it as RIGHT navi |
|
16992 |
// move to bottom of document : if paradirection is LTR then treat is as RIGHT navi |
|
16993 |
// move to bottom of document : if paradirection is RTL then treat as LEFT navi |
|
16994 |
// However, NOTE that decrementing events leads to looping to the END! (and vice versa) |
|
16995 |
TBool newParaIsRTL = IsRightToLeftParagraph(aPos); |
|
16996 |
if ( aLoopToTop && newParaIsRTL ) // move to top; RTL |
|
16997 |
effectiveEvent = ERightNaviEvent; |
|
16998 |
else if ( !aLoopToTop && !newParaIsRTL ) // move to bottom; LTR |
|
16999 |
effectiveEvent = ERightNaviEvent; |
|
17000 |
||
17001 |
if ( aLoopToTop ) |
|
17002 |
{ |
|
17003 |
// There is no ficticious block of the paragraph direction at -1 to 0. So we have to |
|
17004 |
// behave as if there is one: |
|
17005 |
// |
|
17006 |
CTmTextLayout::TTmChunkDescription leftChunk; |
|
17007 |
CTmTextLayout::TTmChunkDescription rightChunk; |
|
17008 |
CTmTextLayout::TTmChunkDescription& edgeChunk = leftChunk; |
|
17009 |
||
17010 |
FindAdjacentChunks(aPos, leftChunk, rightChunk); |
|
17011 |
||
17012 |
// Get input language direction |
|
17013 |
TBool inputDirectionIsRTL = ( CurrentInputDirectionality() == TBidiText::ERightToLeft ); |
|
17014 |
if ( effectiveEvent == ELeftNaviEvent ) |
|
17015 |
edgeChunk = leftChunk; |
|
17016 |
else |
|
17017 |
edgeChunk = rightChunk; |
|
17018 |
||
17019 |
// Check edgechunk for its direction |
|
17020 |
if ( !COMPARE_BOOLS( edgeChunk.iRightToLeft, inputDirectionIsRTL ) ) |
|
17021 |
{ |
|
17022 |
// Input language disagrees with the chunk that we are on, |
|
17023 |
aPos.iPos = 0; |
|
17024 |
aPos.iType = TTmDocPosSpec::ETrailing; |
|
17025 |
} |
|
17026 |
||
17027 |
} |
|
17028 |
else // Looping to the end of document |
|
17029 |
{ |
|
17030 |
// There IS a ficticious block at the doc end, so use the usual routine. |
|
17031 |
AdjustPosSpecForAmbiguityAfterLeftOrRightNavigation( aPos, effectiveEvent ); |
|
17032 |
} |
|
17033 |
||
17034 |
} |
|
17035 |
||
17036 |
TBool CAknFepManager::ChunkIsValid( const CTmTextLayout::TTmChunkDescription& aChunk ) |
|
17037 |
{ |
|
17038 |
TBool isValid(ETrue); |
|
17039 |
||
17040 |
const TInt KNotValid = -1; |
|
17041 |
if ( aChunk.iRightToLeft == KNotValid ) |
|
17042 |
isValid = EFalse; |
|
17043 |
else if (aChunk.iStart == KNotValid ) |
|
17044 |
isValid = EFalse; |
|
17045 |
else if (aChunk.iEnd == KNotValid ) |
|
17046 |
isValid = EFalse; |
|
17047 |
||
17048 |
#ifdef _DEBUG |
|
17049 |
if (isValid) |
|
17050 |
__ASSERT_DEBUG( aChunk.iStart <= aChunk.iEnd, |
|
17051 |
AknFepPanic( EAknFepPanicBadCursorNavigationState ) ); |
|
17052 |
#endif |
|
17053 |
||
17054 |
return isValid; |
|
17055 |
} |
|
17056 |
/** |
|
17057 |
* Finds the current input direction. This is determined as best as it can using |
|
17058 |
* - T9Interface as the preferred source of information |
|
17059 |
* - shared data (via AknTextUtils) if that fails |
|
17060 |
* - localLanguage overrides the above sources of information |
|
17061 |
* - when fep is in numeric mode it returns LTR |
|
17062 |
* - if FEP is in an irelevant mode, then LTR is returned |
|
17063 |
* |
|
17064 |
* @return TDirectionality::ELeftToRight for LTR alpha mode or numeric mode |
|
17065 |
*/ |
|
17066 |
TBidiText::TDirectionality CAknFepManager::CurrentInputDirectionality() const |
|
17067 |
{ |
|
17068 |
TBidiText::TDirectionality directionality(TBidiText::ELeftToRight); |
|
17069 |
||
17070 |
// See if we are in a mode where the directionality is defined: |
|
17071 |
TBool checkForRTLValid(EFalse); |
|
17072 |
||
17073 |
switch (iMode ) |
|
17074 |
{ |
|
17075 |
case ELatin: |
|
17076 |
case ENumber: |
|
17077 |
checkForRTLValid = ETrue; |
|
17078 |
break; |
|
17079 |
default: |
|
17080 |
break; |
|
17081 |
} |
|
17082 |
||
17083 |
if ( checkForRTLValid ) |
|
17084 |
{ |
|
17085 |
MPtiLanguage* ptilang = iPtiEngine->CurrentLanguage(); // No need to get language from PtiEngine ? |
|
17086 |
TInt inputLanguage = (ptilang)? ptilang->LanguageCode() : 0; |
|
17087 |
if ( inputLanguage ) |
|
17088 |
{ |
|
17089 |
directionality = TBidiText::ScriptDirectionality( (TLanguage)inputLanguage ); |
|
17090 |
checkForRTLValid = EFalse; |
|
17091 |
} |
|
17092 |
} |
|
17093 |
||
17094 |
// if no T9 interface information is available, then go for other sources |
|
17095 |
// Note that you have to check for local language in this case (belt-and-braces) |
|
17096 |
if ( checkForRTLValid ) |
|
17097 |
{ |
|
17098 |
TLanguage localLanguage = ELangTest; |
|
17099 |
if ( GetLocalLanguage( localLanguage ) ) |
|
17100 |
directionality = TBidiText::ScriptDirectionality( localLanguage ); |
|
17101 |
else |
|
17102 |
directionality = AknTextUtils::CurrentScriptDirectionality(); |
|
17103 |
} |
|
17104 |
||
17105 |
return directionality; |
|
17106 |
} |
|
17107 |
||
17108 |
||
17109 |
TBool CAknFepManager::GetLocalLanguage( TLanguage& aLanguage ) const |
|
17110 |
{ |
|
17111 |
TBool result(EFalse); |
|
17112 |
// Check for a local language override |
|
17113 |
if ( IsFepAwareTextEditor() ) |
|
17114 |
{ |
|
17115 |
// For ITU-T keyboard we always use english in latin-only editors. |
|
17116 |
// In case of qwerty keyboard, some languages can be used in latin |
|
17117 |
// only-editors, some require that english is used instead. That |
|
17118 |
// is decided here. |
|
17119 |
const TInt globalLang = iSharedDataInterface->InputTextLanguage(); |
|
17120 |
TBool allowTest = |
|
17121 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
17122 |
!iQwertyInputMode || |
|
17123 |
#endif |
|
17124 |
globalLang == ELangPrcChinese || |
|
17125 |
globalLang == ELangHongKongChinese || |
|
17126 |
globalLang == ELangTaiwanChinese || |
|
17127 |
globalLang == ELangThai || |
|
17128 |
globalLang == ELangGreek || |
|
17129 |
globalLang == ELangArabic || |
|
17130 |
globalLang == ELangFarsi || |
|
17131 |
globalLang == ELangUrdu || |
|
17132 |
globalLang == ELangHebrew || |
|
17133 |
globalLang == ELangRussian || |
|
17134 |
globalLang == ELangUkrainian || |
|
17135 |
globalLang == ELangHindi || |
|
17136 |
#ifdef RD_MARATHI |
|
17137 |
globalLang == ELangMarathi || |
|
17138 |
#endif // RD_MARATHI |
|
17139 |
||
17140 |
#ifdef RD_HINDI_PHONETIC_INPUT |
|
17141 |
globalLang == KLangHindiPhonetic || |
|
17142 |
#endif |
|
17143 |
globalLang == ELangBulgarian || |
|
17144 |
globalLang == ELangVietnamese; |
|
17145 |
||
17146 |
if (allowTest && iAknEditorFlags & EAknEditorFlagLatinInputModesOnly && |
|
17147 |
iLanguageCapabilities.iInputLanguageCode != ELangJapanese) |
|
17148 |
{ |
|
17149 |
aLanguage = ELangEnglish; |
|
17150 |
} |
|
17151 |
else |
|
17152 |
{ |
|
17153 |
aLanguage = EditorState()->LocalLanguage(); |
|
17154 |
||
17155 |
// Change local language to ELangEnglish if application, e.g. Search Widget, |
|
17156 |
// sets local language to ELangEnglish_Taiwan, ELangEnglish_HongKong |
|
17157 |
// and ELangEnglish_Prc. |
|
17158 |
if( aLanguage == ELangEnglish_Taiwan || |
|
17159 |
aLanguage == ELangEnglish_HongKong || |
|
17160 |
aLanguage == ELangEnglish_Prc ) |
|
17161 |
{ |
|
17162 |
aLanguage = ELangEnglish; |
|
17163 |
} |
|
17164 |
} |
|
17165 |
||
17166 |
if ( aLanguage != ELangTest ) |
|
17167 |
{ |
|
17168 |
MPtiLanguage* languageObject = NULL; |
|
17169 |
languageObject = iPtiEngine->GetLanguage(aLanguage); |
|
17170 |
if (languageObject) // Check if the input language is supported. |
|
17171 |
{ |
|
17172 |
result = ETrue; |
|
17173 |
} |
|
17174 |
else |
|
17175 |
{ |
|
17176 |
aLanguage = ELangTest; |
|
17177 |
} |
|
17178 |
} |
|
17179 |
} |
|
17180 |
return result; |
|
17181 |
} |
|
17182 |
||
17183 |
||
17184 |
TBool CAknFepManager::GetExposedDirectionOfText( TInt aPos, TBool aForward, |
|
17185 |
TBool& aIsRightToLeft ) const |
|
17186 |
{ |
|
17187 |
TBool hasStrongCharacter(EFalse); |
|
17188 |
||
17189 |
// Access the plain text from the editor, getting a little bit at a time. |
|
17190 |
||
17191 |
TInt docLen = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
17192 |
||
17193 |
// Init with defaults for aForward = ETrue |
|
17194 |
TInt limit = docLen; |
|
17195 |
TInt increment = 1; |
|
17196 |
if ( !aForward ) |
|
17197 |
{ |
|
17198 |
limit = -1; // Loop does not execute if == limit |
|
17199 |
increment = -1; |
|
17200 |
} |
|
17201 |
||
17202 |
for ( TInt index = aPos; index != limit ; index += increment ) |
|
17203 |
{ |
|
17204 |
TChar ch = CharAt(index); |
|
17205 |
if ( iInlineTextDecorator->CharacterIsStrongRightToLeft( (TText)ch ) ) |
|
17206 |
{ |
|
17207 |
hasStrongCharacter = ETrue; |
|
17208 |
aIsRightToLeft = ETrue; |
|
17209 |
break; |
|
17210 |
} |
|
17211 |
else if ( iInlineTextDecorator->CharacterIsStrongLeftToRight( (TText)ch ) ) |
|
17212 |
{ |
|
17213 |
hasStrongCharacter = ETrue; |
|
17214 |
aIsRightToLeft = EFalse; |
|
17215 |
break; |
|
17216 |
} |
|
17217 |
} |
|
17218 |
||
17219 |
return hasStrongCharacter; |
|
17220 |
} |
|
17221 |
||
17222 |
TBool CAknFepManager::GetExposedDirectionOfTextInDescriptor( const TDesC& aText, TBool aForward, |
|
17223 |
TBool& aIsRightToLeft ) const |
|
17224 |
{ |
|
17225 |
TBool hasStrongCharacter(EFalse); |
|
17226 |
||
17227 |
TInt textLen = aText.Length(); |
|
17228 |
||
17229 |
TInt start = 0; |
|
17230 |
TInt limit = textLen; |
|
17231 |
TInt increment = 1; |
|
17232 |
if ( !aForward ) |
|
17233 |
{ |
|
17234 |
start = textLen-1; |
|
17235 |
limit = -1; // Loop does not execute if == limit |
|
17236 |
increment = -1; |
|
17237 |
} |
|
17238 |
||
17239 |
for ( TInt index = start; index != limit ; index += increment ) |
|
17240 |
{ |
|
17241 |
if ( iInlineTextDecorator->CharacterIsStrongRightToLeft( (TText)aText[index] ) ) |
|
17242 |
{ |
|
17243 |
hasStrongCharacter = ETrue; |
|
17244 |
aIsRightToLeft = ETrue; |
|
17245 |
break; |
|
17246 |
} |
|
17247 |
else if ( iInlineTextDecorator->CharacterIsStrongLeftToRight( (TText)aText[index] ) ) |
|
17248 |
{ |
|
17249 |
hasStrongCharacter = ETrue; |
|
17250 |
aIsRightToLeft = EFalse; |
|
17251 |
break; |
|
17252 |
} |
|
17253 |
} |
|
17254 |
||
17255 |
return hasStrongCharacter; |
|
17256 |
} |
|
17257 |
||
17258 |
TChar CAknFepManager::CharAt( TInt aPos ) const |
|
17259 |
{ |
|
17260 |
TBuf<ESingleCharacter> chDes; |
|
17261 |
#ifdef RD_SCALABLE_UI_V2 |
|
17262 |
if ( SemiFepAwareTextEditor( ETrue ) ) |
|
17263 |
#else |
|
17264 |
if ( iInputCapabilities.FepAwareTextEditor() ) |
|
17265 |
#endif // RD_SCALABLE_UI_V2 |
|
17266 |
iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep( chDes, aPos, |
|
17267 |
ESingleCharacter); |
|
17268 |
if( chDes.Length() > 0 ) |
|
17269 |
return chDes[0]; |
|
17270 |
else |
|
17271 |
return TChar(0); |
|
17272 |
} |
|
17273 |
||
17274 |
||
17275 |
/** |
|
17276 |
* Navigate off of selected text using an Up/Down/Right/Left navigation event |
|
17277 |
* |
|
17278 |
* The code takes account of the paragraph directionality that the passed selection is |
|
17279 |
* found in. |
|
17280 |
* |
|
17281 |
* The new cursor position is resolved for ambuguity and set using SetCursorPosition and |
|
17282 |
* so it has the same side-effects: |
|
17283 |
* iUncommittedText is set to the zero-width "cursor" state with the new cursor position |
|
17284 |
* iUncommittedText is set into the FepAwareTextEditor state |
|
17285 |
* iCaseManager is updated with a ENullNaviEvent |
|
17286 |
* the doc pos is set in TextView object if present |
|
17287 |
*/ |
|
17288 |
TKeyResponse CAknFepManager::NavigateFromSelectionL( |
|
17289 |
const TCursorSelection& aSelection, |
|
17290 |
TWesternNaviEvent aNaviEvent, |
|
17291 |
TTmDocPosSpec& aPos) |
|
17292 |
{ |
|
17293 |
if (IsCcpuFlagSet(ECcpuStateCopy | ECcpuStateCut | ECcpuStateHashDown)) |
|
17294 |
{ |
|
17295 |
return EKeyWasNotConsumed; |
|
17296 |
} |
|
17297 |
||
17298 |
switch( aNaviEvent ) |
|
17299 |
{ |
|
17300 |
case EUpNaviEvent: |
|
17301 |
case EDownNaviEvent: |
|
17302 |
case ERightNaviEvent: |
|
17303 |
case ELeftNaviEvent: |
|
17304 |
// Carry on. Handle this event |
|
17305 |
break; |
|
17306 |
default: // just leave it as NULL |
|
17307 |
return EKeyWasNotConsumed; |
|
17308 |
} |
|
17309 |
// Find the visual end of the selection |
|
17310 |
TWesternNaviEvent effectiveEvent; // used to return either Right or Left event from next call: |
|
17311 |
GetAvkonDefinedVisualLimitsOfSelection( aSelection, aNaviEvent, aPos, &effectiveEvent ); |
|
17312 |
AdjustPosSpecForAmbiguityAfterLeftOrRightNavigation( aPos, effectiveEvent ); |
|
17313 |
||
17314 |
// Set this as the current position |
|
17315 |
SetCursorPositionL( aPos ); |
|
17316 |
||
17317 |
return EKeyWasConsumed; |
|
17318 |
} |
|
17319 |
||
17320 |
||
17321 |
void CAknFepManager::SetCursorPositionL( const TTmDocPosSpec& aNewCursorPos, TBool aDragSelectOn ) |
|
17322 |
{ |
|
17323 |
if ( !iInputCapabilities.FepAwareTextEditor() ) |
|
17324 |
return; |
|
17325 |
||
17326 |
TInt newAnchorPos = aNewCursorPos.iPos; |
|
17327 |
||
17328 |
if ( aDragSelectOn ) |
|
17329 |
{ |
|
17330 |
TCursorSelection selection; |
|
17331 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(selection); |
|
17332 |
if ( selection.Length() > 0 ) // there is a selection. Keep the anchor |
|
17333 |
newAnchorPos = selection.iAnchorPos; |
|
17334 |
} |
|
17335 |
||
17336 |
iUncommittedText.SetSelection( aNewCursorPos.iPos, newAnchorPos ); |
|
17337 |
||
17338 |
iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(iUncommittedText); |
|
17339 |
iCaseMan->UpdateCase(ENullNaviEvent); |
|
17340 |
||
17341 |
// This is able to set the directional attachment of the cursor in a way that the FepAwareTextEditor interface cannot |
|
17342 |
MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
17343 |
if (docNavi) |
|
17344 |
{ |
|
17345 |
docNavi->SetDocPosL(aNewCursorPos, aDragSelectOn); |
|
17346 |
} |
|
17347 |
else |
|
17348 |
{ |
|
17349 |
CAknEdwinFormAccessor* formAccessor = EditorState()->FormAccessor(); |
|
17350 |
if (formAccessor) |
|
17351 |
{ |
|
17352 |
CEikEdwin *edwin = static_cast<CEikEdwin *>( formAccessor->FormClientControl() ); |
|
17353 |
if (edwin) |
|
17354 |
edwin->SetCursorPosL( aNewCursorPos.iPos, aDragSelectOn ); |
|
17355 |
} |
|
17356 |
} |
|
17357 |
} |
|
17358 |
||
17359 |
||
17360 |
||
17361 |
TBool CAknFepManager::InFirstLineAndFormatted( const TTmDocPosSpec& aPos ) const |
|
17362 |
{ |
|
17363 |
return DocPosInFirstOrLastLineAndFormatted( aPos, ETrue); |
|
17364 |
} |
|
17365 |
||
17366 |
TBool CAknFepManager::InLastLineAndFormatted( const TTmDocPosSpec& aPos ) const |
|
17367 |
{ |
|
17368 |
return DocPosInFirstOrLastLineAndFormatted( aPos, EFalse ); |
|
17369 |
} |
|
17370 |
||
17371 |
TBool CAknFepManager::DocPosInFirstOrLastLineAndFormatted( const TTmDocPosSpec& aPos, |
|
17372 |
TBool aCheckFirstLine ) const |
|
17373 |
{ |
|
17374 |
TBool success(EFalse); |
|
17375 |
TTmLineInfo lineInfo; |
|
17376 |
MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
17377 |
if (docNavi) |
|
17378 |
{ |
|
17379 |
success = docNavi->DocPosToLine( aPos, lineInfo); |
|
17380 |
} |
|
17381 |
else |
|
17382 |
{ |
|
17383 |
CTextLayout* textLayout = TextLayout(); |
|
17384 |
if ( textLayout ) |
|
17385 |
{ |
|
17386 |
success = textLayout->TagmaTextLayout().DocPosToLine( aPos, lineInfo); |
|
17387 |
} |
|
17388 |
} |
|
17389 |
||
17390 |
if ( success ) |
|
17391 |
{ |
|
17392 |
if ( aCheckFirstLine ) |
|
17393 |
success = (lineInfo.iLineNumber == 0 ); |
|
17394 |
else |
|
17395 |
{ |
|
17396 |
// Current position has yielded line information. But how to tell if it is the last line? |
|
17397 |
// Use the fact that the docpos of the last character will be in the last line. |
|
17398 |
// Also account for the fact that these APIs report a character at docLength itself, a |
|
17399 |
// ficticious end of paragraph character. So use a >= docLength |
|
17400 |
success = (lineInfo.iEnd >= |
|
17401 |
iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep() ); |
|
17402 |
} |
|
17403 |
} |
|
17404 |
||
17405 |
return success; |
|
17406 |
} |
|
17407 |
||
17408 |
TBool CAknFepManager::AtVisualStart( const TTmDocPosSpec& aCurrentPos, |
|
17409 |
const TTmDocPosSpec& aLimitPos ) const |
|
17410 |
{ |
|
17411 |
TBool positionsAreTheSame(EFalse); |
|
17412 |
if ( aCurrentPos.iPos == aLimitPos.iPos && aCurrentPos.iType == aLimitPos.iType ) |
|
17413 |
positionsAreTheSame = ETrue; |
|
17414 |
else if ( aCurrentPos.iPos == 0 && aCurrentPos.iType == TTmDocPosSpec::ETrailing ) |
|
17415 |
positionsAreTheSame = ETrue; |
|
17416 |
||
17417 |
return positionsAreTheSame; |
|
17418 |
} |
|
17419 |
||
17420 |
TBool CAknFepManager::AtVisualEnd( const TTmDocPosSpec& aCurrentPos, |
|
17421 |
const TTmDocPosSpec& aLimitPos, TInt aDocLength ) const |
|
17422 |
{ |
|
17423 |
TBool positionsAreTheSame(EFalse); |
|
17424 |
if ( aCurrentPos.iPos == aLimitPos.iPos && aCurrentPos.iType == aLimitPos.iType ) |
|
17425 |
positionsAreTheSame = ETrue; |
|
17426 |
else if ( aCurrentPos.iPos == aDocLength && aCurrentPos.iType == TTmDocPosSpec::ELeading ) |
|
17427 |
positionsAreTheSame = ETrue; |
|
17428 |
else if ( aCurrentPos.iPos > aDocLength ) |
|
17429 |
positionsAreTheSame = ETrue; |
|
17430 |
||
17431 |
return positionsAreTheSame; |
|
17432 |
} |
|
17433 |
||
17434 |
||
17435 |
void CAknFepManager::SetCursorType(TBool aIsLeftToRight) |
|
17436 |
{ |
|
17437 |
if ( !BidiCursorRequired() ) |
|
17438 |
return; |
|
17439 |
||
17440 |
// Optimization to prevent excessive Wserv communication: |
|
17441 |
if ( IsFlagSet( EFlagBidiCursorIsInitialized ) |
|
17442 |
&& COMPARE_BOOLS( !aIsLeftToRight, IsFlagSet( EFlagCursorPointsRightToLeft ) ) ) |
|
17443 |
return; |
|
17444 |
||
17445 |
SetFlag( EFlagBidiCursorIsInitialized ); |
|
17446 |
||
17447 |
MCoeFepAwareTextEditor* editor = iInputCapabilities.FepAwareTextEditor(); |
|
17448 |
if (editor && editor->Extension1()) |
|
17449 |
{ |
|
17450 |
TCharFormat format; |
|
17451 |
TInt docPos = DocPos().iPos; |
|
17452 |
editor->GetFormatForFep(format, docPos); |
|
17453 |
||
17454 |
// Use Avkon routine to make all the layout decisions. It returns a TTextCursor object |
|
17455 |
TTextCursor newCursor; |
|
17456 |
AknCustomCursorSupport::GetBidiTextCursorFromFontSpec( format.iFontSpec, |
|
17457 |
!aIsLeftToRight, newCursor ); |
|
17458 |
TBool setToTrue(ETrue); |
|
17459 |
editor->Extension1()->SetCursorType(setToTrue, newCursor); |
|
17460 |
||
17461 |
// Keep flag in step for optimization |
|
17462 |
if ( aIsLeftToRight ) |
|
17463 |
ClearFlag( EFlagCursorPointsRightToLeft ); |
|
17464 |
else |
|
17465 |
SetFlag( EFlagCursorPointsRightToLeft ); |
|
17466 |
} |
|
17467 |
} |
|
17468 |
||
17469 |
TBool CAknFepManager::DeviceSupportsRTLLanguageL() |
|
17470 |
{ |
|
17471 |
CArrayFixFlat<TInt>* languages = new (ELeave) CArrayFixFlat<TInt>(ELanguageArrayGranularity); |
|
17472 |
CleanupStack::PushL(languages); |
|
17473 |
iPtiEngine->GetAvailableLanguagesL(languages); |
|
17474 |
||
17475 |
TBool bidiCursorSuppressed(EFalse); |
|
17476 |
#if defined(__WINS__) |
|
17477 |
bidiCursorSuppressed = ETrue; |
|
17478 |
// Test (Disabled) mode (fake) UID, key and its value |
|
17479 |
const TInt KTestModeValue = 1; // 1 = show Bidi cursor |
|
17480 |
||
17481 |
CRepository* repository = NULL; |
|
17482 |
TRAPD(ret, repository = CRepository::NewL(KCRUidAknFep)); |
|
17483 |
if (ret == KErrNone) |
|
17484 |
{ |
|
17485 |
TInt modeValue = 0; |
|
17486 |
if (repository->Get(KAknFepTestModeKey, modeValue) == KErrNone) |
|
17487 |
{ |
|
17488 |
if (modeValue == KTestModeValue) |
|
17489 |
{ |
|
17490 |
bidiCursorSuppressed = EFalse; // show bidi cursor |
|
17491 |
} |
|
17492 |
} |
|
17493 |
} |
|
17494 |
delete repository; |
|
17495 |
#endif |
|
17496 |
||
17497 |
TBool result = EFalse; |
|
17498 |
if (!bidiCursorSuppressed) |
|
17499 |
{ |
|
17500 |
for (TInt jj = 0; jj < languages->Count(); jj++) |
|
17501 |
{ |
|
17502 |
if (languages->At(jj) == ELangArabic || |
|
17503 |
languages->At(jj) == ELangHebrew || |
|
17504 |
languages->At(jj) == ELangFarsi || |
|
17505 |
languages->At(jj) == ELangUrdu ) |
|
17506 |
// + others... |
|
17507 |
{ |
|
17508 |
result = ETrue; |
|
17509 |
break; |
|
17510 |
} |
|
17511 |
} |
|
17512 |
} |
|
17513 |
||
17514 |
CleanupStack::PopAndDestroy(); // languages |
|
17515 |
return result; |
|
17516 |
} |
|
17517 |
||
17518 |
void CAknFepManager::CalculateEditorDigitType(TDigitType& aDestination) |
|
17519 |
{ |
|
17520 |
// When current range is latin number mode |
|
17521 |
if ( iMode == ENumber ) |
|
17522 |
{ |
|
17523 |
// Set the Local Digit Type flag to EDigitTypeWestern |
|
17524 |
aDestination = EDigitTypeWestern; |
|
17525 |
return; |
|
17526 |
} |
|
17527 |
||
17528 |
TBool ASCIIDigits = EFalse; |
|
17529 |
MObjectProvider* mop = iInputCapabilities.ObjectProvider(); |
|
17530 |
||
17531 |
if ( mop ) |
|
17532 |
{ |
|
17533 |
CAknExtendedInputCapabilities* extendedInputCapabilities = |
|
17534 |
mop->MopGetObject( extendedInputCapabilities ); |
|
17535 |
||
17536 |
if ( extendedInputCapabilities ) |
|
17537 |
{ |
|
17538 |
if ( extendedInputCapabilities->SupportsCapabilities( |
|
17539 |
CAknExtendedInputCapabilities::ESupportsOnlyASCIIDigits ) ) |
|
17540 |
{ |
|
17541 |
// If this is true, then the inputcaps wants only ascii |
|
17542 |
// digits -> you can, when the editor is seen as numeric, |
|
17543 |
// be sure that only latin indicator is then wanted. |
|
17544 |
ASCIIDigits = ETrue; |
|
17545 |
} |
|
17546 |
} |
|
17547 |
} |
|
17548 |
||
17549 |
if (iAknEditorFlags & EAknEditorFlagLatinInputModesOnly) |
|
17550 |
{ |
|
17551 |
// use of only latin characters implies that numbers are also western |
|
17552 |
ASCIIDigits = ETrue; |
|
17553 |
} |
|
17554 |
||
17555 |
AknTextUtils::TDigitModeQueryType editorType = AknTextUtils::EDigitModeEditorDefault; |
|
17556 |
TBool numberOnlyEditor = iPermittedInputModes == EAknEditorNumericInputMode; |
|
17557 |
if ( numberOnlyEditor ) |
|
17558 |
{ |
|
17559 |
editorType = AknTextUtils::EDigitModeNumberEditor; |
|
17560 |
if (ASCIIDigits) |
|
17561 |
{ |
|
17562 |
editorType = AknTextUtils::EDigitModeLatinNumberEditor; |
|
17563 |
} |
|
17564 |
} |
|
17565 |
||
17566 |
if (iLanguageCapabilities.iArabicIndicDigitsAllowed && |
|
17567 |
(AknTextUtils::DigitModeQuery(editorType) || iMode == ENativeNumber) && |
|
17568 |
!ASCIIDigits) |
|
17569 |
{ |
|
17570 |
aDestination = EDigitTypeArabicIndic; |
|
17571 |
} |
|
17572 |
else if (iLanguageCapabilities.iEasternArabicIndicDigitsAllowed && |
|
17573 |
(AknTextUtils::DigitModeQuery(editorType) || iMode == ENativeNumber) && |
|
17574 |
!ASCIIDigits) |
|
17575 |
{ |
|
17576 |
aDestination = EDigitTypeEasternArabicIndic; |
|
17577 |
} |
|
17578 |
/*Hindi*/ |
|
17579 |
else if ( iLanguageCapabilities.iIndicDigitsAllowed && |
|
17580 |
(AknTextUtils::DigitModeQuery(editorType) || iMode == ENativeNumber) && |
|
17581 |
!ASCIIDigits) |
|
17582 |
{ |
|
17583 |
aDestination = EDigitTypeDevanagari; |
|
17584 |
} |
|
17585 |
else |
|
17586 |
{ |
|
17587 |
aDestination = EDigitTypeWestern; |
|
17588 |
} |
|
17589 |
} |
|
17590 |
||
17591 |
||
17592 |
void CAknFepManager::UpdateNumericEditorDigitType() |
|
17593 |
{ |
|
17594 |
if (iLanguageCapabilities.iNumericEditorDigitType == EDigitTypeUnknown) |
|
17595 |
{ |
|
17596 |
CalculateEditorDigitType(iLanguageCapabilities.iNumericEditorDigitType); |
|
17597 |
} |
|
17598 |
} |
|
17599 |
||
17600 |
void CAknFepManager::UpdateLocalDigitMode() |
|
17601 |
{ |
|
17602 |
TInt oldLocalDigitType = iLanguageCapabilities.iLocalDigitType; |
|
17603 |
CalculateEditorDigitType(iLanguageCapabilities.iLocalDigitType); |
|
17604 |
||
17605 |
if (oldLocalDigitType != iLanguageCapabilities.iLocalDigitType && |
|
17606 |
iCaseMan) // happens in destructor |
|
17607 |
{ |
|
17608 |
UpdateIndicators(); |
|
17609 |
} |
|
17610 |
} |
|
17611 |
||
17612 |
/** |
|
17613 |
* This routine should be called if the flag is set that says that the last navigation was to an |
|
17614 |
* ambiguous point. |
|
17615 |
* The routine checks to see if the event passed is |
|
17616 |
* - Right or Left Arrow |
|
17617 |
* - Would be the event to "jump" across the ambiguity. That is |
|
17618 |
* - if at the "left" side of a LTR | RTL point, you need a Right arrow |
|
17619 |
* - if at the "right" side of a LTR | RTL point, you need a Left arrow. |
|
17620 |
* - if at the "left" side of a RTL | LTR point, you need a Right arrow |
|
17621 |
* - if at the "right" side of a RTL | LTR point, you need a Left arrow. |
|
17622 |
* |
|
17623 |
*/ |
|
17624 |
// TKeyResponse CAknFepManager::AttemptCursorFlipAtAmbiguousPointL( const TKeyEvent& aKeyEvent, TEventCode aEventCode ) |
|
17625 |
TKeyResponse CAknFepManager::AttemptCursorFlipAtAmbiguousPointL( const TUint aCode ) |
|
17626 |
{ |
|
17627 |
TKeyResponse response = EKeyWasNotConsumed; |
|
17628 |
||
17629 |
if ( IsFlagSet(EFlagAtDirectionallyAmbiguousPoint) // only perform if already at ambi-point? |
|
17630 |
&& !IsFlagSet(EFlagInsideInlineEditingTransaction) ) // do not flip if inside inline edit |
|
17631 |
{ |
|
17632 |
if ( aCode == EKeyRightArrow || aCode == EKeyLeftArrow ) |
|
17633 |
{ |
|
17634 |
// Never use TextView() to get editor data, |
|
17635 |
// use FepAwareTextEditor() condition instead of TextView() |
|
17636 |
if ( iInputCapabilities.FepAwareTextEditor() && EditorState() |
|
17637 |
&& AknFepDocumentNavigation() ) |
|
17638 |
{ |
|
17639 |
TTmDocPosSpec docPos = DocPos(); |
|
17640 |
TTextDirectionalInfo status = LocalTextDirectionalStatus( docPos ); |
|
17641 |
||
17642 |
CTmTextLayout::TTmChunkDescription leftChunk; |
|
17643 |
CTmTextLayout::TTmChunkDescription rightChunk; |
|
17644 |
FindAdjacentChunks(docPos, leftChunk, rightChunk); |
|
17645 |
||
17646 |
if ( status.iBlockEnvironment == |
|
17647 |
TTextDirectionalInfo::EAtRightEndOfBlockFacingOppositeDirectionalBlock |
|
17648 |
&& aCode == EKeyRightArrow ) |
|
17649 |
{ |
|
17650 |
response = EKeyWasConsumed; |
|
17651 |
// Set cursor to new directionality ( opposite to current ) |
|
17652 |
SetCursorTypeForTextDirection( status.iDirectionalStatus == |
|
17653 |
TTextDirectionalInfo::ERightToLeft ); |
|
17654 |
// Must actually change the docpos! |
|
17655 |
AttachToRightChunk( docPos, rightChunk ); |
|
17656 |
SetCursorPositionL( docPos, ETrue ); // Drag any existing selection |
|
17657 |
} |
|
17658 |
else if ( status.iBlockEnvironment == |
|
17659 |
TTextDirectionalInfo::EAtLeftEndOfBlockFacingOppositeDirectionalBlock |
|
17660 |
&& aCode == EKeyLeftArrow ) |
|
17661 |
{ |
|
17662 |
response = EKeyWasConsumed; |
|
17663 |
// Effectively this toggles the direction of the cursor |
|
17664 |
SetCursorTypeForTextDirection( status.iDirectionalStatus == |
|
17665 |
TTextDirectionalInfo::ERightToLeft ); |
|
17666 |
// Must actually change the docpos! |
|
17667 |
AttachToLeftChunk( docPos, leftChunk ); |
|
17668 |
SetCursorPositionL( docPos, ETrue ); // Drag any existing selection |
|
17669 |
} |
|
17670 |
} |
|
17671 |
} |
|
17672 |
} |
|
17673 |
return response; |
|
17674 |
} |
|
17675 |
||
17676 |
||
17677 |
TInt CAknFepManager::PostEventCheckCallback(TAny* aObj) |
|
17678 |
{ |
|
17679 |
TRAP_IGNORE(static_cast<CAknFepManager*>(aObj)->DoCursorDirectionCheckL()); |
|
17680 |
return KErrNone; |
|
17681 |
} |
|
17682 |
||
17683 |
TBool CAknFepManager::BidiCursorRequired() const |
|
17684 |
{ |
|
17685 |
return iDeviceSupportsRtlLanguage; |
|
17686 |
} |
|
17687 |
||
17688 |
void CAknFepManager::DoCursorDirectionCheckL() |
|
17689 |
{ |
|
17690 |
iPostEventCheck->Cancel(); |
|
17691 |
if(BidiCursorRequired()) |
|
17692 |
{ |
|
17693 |
AdjustCursorTypeForCurrentPosition(); |
|
17694 |
} |
|
17695 |
||
17696 |
if ( !BidiCursorRequired() |
|
17697 |
|| (TAknFepUiIndicInputManager :: IsIndicLangauge(TLanguage(iLanguageCapabilities.iInputLanguageCode)) )) |
|
17698 |
{ |
|
17699 |
/*Hindi*/ |
|
17700 |
if( ( !WesternPredictive() ) && |
|
17701 |
( TAknFepUiIndicInputManager::IsIndicLangauge( |
|
17702 |
TLanguage( iLanguageCapabilities.iInputLanguageCode ) ) ) && |
|
17703 |
( ( TAknFepUiIndicInputManager::IsCharVirama( |
|
17704 |
PreviousChar( ETrue ), TLanguage( iLanguageCapabilities.iInputLanguageCode ) ) ) |
|
17705 |
#ifdef RD_MARATHI |
|
17706 |
|| ( IsEyeLashRaPresentL() && |
|
17707 |
TAknFepUiIndicInputManager::IsCharVirama( |
|
17708 |
PreviousToPreviousChar( ETrue ), TLanguage( iLanguageCapabilities.iInputLanguageCode ) ) ) |
|
17709 |
#endif |
|
17710 |
) |
|
17711 |
&& !( iInputCapabilities.SupportsSecretText() ) |
|
17712 |
) |
|
17713 |
{ |
|
17714 |
TTmDocPosSpec pos = DocPos(); |
|
17715 |
pos.iType = TTmDocPosSpec::ETrailing; |
|
17716 |
TTmPosInfo2 info; |
|
17717 |
TTmLineInfo lineInfo; |
|
17718 |
TBool findAvailable = EFalse; |
|
17719 |
MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
17720 |
if (docNavi) |
|
17721 |
{ |
|
17722 |
docNavi->FindDocPos(pos, info, lineInfo); |
|
17723 |
findAvailable = ETrue; |
|
17724 |
} |
|
17725 |
else |
|
17726 |
{ |
|
17727 |
CTextLayout* textLayout = TextLayout(); |
|
17728 |
if ( textLayout ) |
|
17729 |
{ |
|
17730 |
textLayout->TagmaTextLayout().FindDocPos(pos, info, lineInfo); |
|
17731 |
findAvailable = ETrue; |
|
17732 |
} |
|
17733 |
} |
|
17734 |
if (findAvailable) |
|
17735 |
{ |
|
17736 |
TCursorSelection sel(info.iDocPos.iPos ,info.iDocPos.iPos ); |
|
17737 |
iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(sel); |
|
17738 |
} |
|
17739 |
} |
|
17740 |
} |
|
17741 |
} |
|
17742 |
||
17743 |
void CAknFepManager::AdjustCursorTypeForCurrentPosition() |
|
17744 |
{ |
|
17745 |
||
17746 |
// Never use TextView() to get editor data, |
|
17747 |
// use FepAwareTextEditor() condition instead of TextView() |
|
17748 |
if ( iInputCapabilities.FepAwareTextEditor() && EditorState() |
|
17749 |
&& AknFepDocumentNavigation()) |
|
17750 |
AdjustCursorTypeForPosition( DocPos() ); |
|
17751 |
} |
|
17752 |
||
17753 |
void CAknFepManager::SchedulePostEventCheckL( TUint aCode ) |
|
17754 |
{ |
|
17755 |
||
17756 |
TBool isToPostEvent = EFalse; |
|
17757 |
TBool isIndicLanguage = TAknFepUiIndicInputManager :: |
|
17758 |
IsIndicLangauge(TLanguage(iLanguageCapabilities.iInputLanguageCode)); |
|
17759 |
||
17760 |
if ( BidiCursorRequired() ) |
|
17761 |
{ |
|
17762 |
switch ( aCode ) |
|
17763 |
{ |
|
17764 |
// Navigation cases: |
|
17765 |
case EKeyDownArrow: |
|
17766 |
case EKeyUpArrow: |
|
17767 |
case EPtiKey1: |
|
17768 |
case EPtiKey2: |
|
17769 |
case EPtiKey3: |
|
17770 |
case EPtiKey4: |
|
17771 |
case EPtiKey5: |
|
17772 |
case EPtiKey6: |
|
17773 |
case EPtiKey7: |
|
17774 |
case EPtiKey8: |
|
17775 |
case EPtiKey9: |
|
17776 |
case EPtiKey0: |
|
17777 |
{ |
|
17778 |
isToPostEvent = ETrue; |
|
17779 |
} |
|
17780 |
break; |
|
17781 |
case EKeyBackspace: |
|
17782 |
case EKeyDelete: |
|
17783 |
{ |
|
17784 |
if(!isIndicLanguage) |
|
17785 |
{ |
|
17786 |
isToPostEvent = ETrue; |
|
17787 |
} |
|
17788 |
} |
|
17789 |
break; |
|
17790 |
case EKeyLeftArrow: |
|
17791 |
case EKeyRightArrow: |
|
17792 |
{ |
|
17793 |
if(!isIndicLanguage) |
|
17794 |
{ |
|
17795 |
isToPostEvent = ETrue; |
|
17796 |
} |
|
17797 |
} |
|
17798 |
break; |
|
17799 |
default: |
|
17800 |
break; |
|
17801 |
} |
|
17802 |
||
17803 |
// If Repha has been inserted then do not post event. |
|
17804 |
if( isIndicLanguage ) |
|
17805 |
{ |
|
17806 |
if( aCode == EPtiKey1 && ( !iQwertyInputMode ) ) |
|
17807 |
{ |
|
17808 |
if( IsRephaPresent() |
|
17809 |
#ifdef RD_MARATHI |
|
17810 |
|| IsEyeLashRaPresentL() |
|
17811 |
#endif |
|
17812 |
) |
|
17813 |
{ |
|
17814 |
isToPostEvent = EFalse; |
|
17815 |
} |
|
17816 |
} |
|
17817 |
} |
|
17818 |
} |
|
17819 |
||
17820 |
if(isIndicLanguage) // iQwertyInputMode check is added so as to ensure that the event is not posted for Qwerty mode. |
|
17821 |
{ |
|
17822 |
if((aCode == EKeyBackspace || aCode == EKeyDelete) && (!iQwertyInputMode)) |
|
17823 |
{ |
|
17824 |
isToPostEvent = ETrue; |
|
17825 |
} |
|
17826 |
} |
|
17827 |
||
17828 |
if(isToPostEvent) |
|
17829 |
{ |
|
17830 |
if ( iPostEventCheck->IsActive() ) |
|
17831 |
iPostEventCheck->Cancel(); |
|
17832 |
iPostEventCheck->Start( TCallBack(PostEventCheckCallback, this) ); |
|
17833 |
} |
|
17834 |
} |
|
17835 |
||
17836 |
void CAknFepManager::AdjustCursorTypeForPosition( const TTmDocPosSpec& aDocPos ) |
|
17837 |
{ |
|
17838 |
||
17839 |
TTextDirectionalInfo dirInfo = LocalTextDirectionalStatus( aDocPos ); |
|
17840 |
// default clearing of this flag |
|
17841 |
ClearFlag( EFlagAtDirectionallyAmbiguousPoint ); |
|
17842 |
||
17843 |
switch ( dirInfo.iBlockEnvironment ) |
|
17844 |
{ |
|
17845 |
case TTextDirectionalInfo::EUndefined: |
|
17846 |
// Set according to input direction |
|
17847 |
SetCursorTypeForTextDirection( CurrentInputDirectionality() == |
|
17848 |
TBidiText::ELeftToRight ); |
|
17849 |
break; // do nothing |
|
17850 |
||
17851 |
// All unambiguous cases |
|
17852 |
case TTextDirectionalInfo::EInsideBlock: |
|
17853 |
case TTextDirectionalInfo::EAtRightEndOfLine: |
|
17854 |
case TTextDirectionalInfo::EAtLeftEndOfLine: |
|
17855 |
case TTextDirectionalInfo::EAtRightEndOfBlockFacingSameDirectionBlock: |
|
17856 |
case TTextDirectionalInfo::EAtLeftEndOfBlockFacingSameDirectionBlock: |
|
17857 |
SetCursorTypeForTextDirection( dirInfo.iDirectionalStatus == |
|
17858 |
TTextDirectionalInfo::ELeftToRight ); |
|
17859 |
break; |
|
17860 |
||
17861 |
// Ambiguous. Navigation has resulted in an ambiguous visual position. Set cursor according |
|
17862 |
// to current direction |
|
17863 |
case TTextDirectionalInfo::EAtRightEndOfBlockFacingOppositeDirectionalBlock: |
|
17864 |
case TTextDirectionalInfo::EAtLeftEndOfBlockFacingOppositeDirectionalBlock: |
|
17865 |
SetCursorTypeForTextDirection( dirInfo.iDirectionalStatus == |
|
17866 |
TTextDirectionalInfo::ELeftToRight ); |
|
17867 |
SetFlag( EFlagAtDirectionallyAmbiguousPoint ); |
|
17868 |
break; |
|
17869 |
default: |
|
17870 |
// Do nothing |
|
17871 |
break; |
|
17872 |
} |
|
17873 |
} |
|
17874 |
||
17875 |
void CAknFepManager::SetCursorTypeForTextDirection( TBool aLeftToRight ) |
|
17876 |
{ |
|
17877 |
SetCursorType( aLeftToRight ); |
|
17878 |
} |
|
17879 |
||
17880 |
void CAknFepManager::SetCursorTypeForInputDirection( TBool /*aLeftToRight*/ ) |
|
17881 |
{ |
|
17882 |
// Do nothing |
|
17883 |
} |
|
17884 |
||
17885 |
CAknFepManager::TTextDirectionalInfo CAknFepManager:: |
|
17886 |
LocalTextDirectionalStatus( const TTmDocPosSpec& aDocPos ) const |
|
17887 |
{ |
|
17888 |
TTextDirectionalInfo directionalInfo; |
|
17889 |
||
17890 |
MCoeFepAwareTextEditor* fepAwareTextEditor = iInputCapabilities.FepAwareTextEditor(); |
|
17891 |
if ( !fepAwareTextEditor ) |
|
17892 |
return directionalInfo; |
|
17893 |
||
17894 |
if ( aDocPos.iPos < 0 ) // somehow, we are before the first character |
|
17895 |
directionalInfo.iDirectionalStatus = TTextDirectionalInfo::ENotInDocument; |
|
17896 |
else if ( aDocPos.iPos > fepAwareTextEditor->DocumentLengthForFep() ) // (iPos = docLen still is within document) |
|
17897 |
directionalInfo.iDirectionalStatus = TTextDirectionalInfo::ENotInDocument; |
|
17898 |
else if ( fepAwareTextEditor->DocumentLengthForFep() == 0 ) // zero length; no document |
|
17899 |
directionalInfo.iDirectionalStatus = TTextDirectionalInfo::ENotInDocument; |
|
17900 |
||
17901 |
if ( directionalInfo.iDirectionalStatus == TTextDirectionalInfo::EUnknown ) |
|
17902 |
{ |
|
17903 |
CTmTextLayout::TTmChunkDescription leftChunk; |
|
17904 |
CTmTextLayout::TTmChunkDescription rightChunk; |
|
17905 |
FindAdjacentChunks(aDocPos, leftChunk, rightChunk); |
|
17906 |
||
17907 |
// Cases: |
|
17908 |
// position is within a chunk (chunks are continuous in logical index and same directionality. |
|
17909 |
// ->Return directionality |
|
17910 |
// position is betweeen two chunks of opposite directionality |
|
17911 |
// -> return simple ambiguity |
|
17912 |
// position is between two chnks of same directionality, but logical index is not contiguous |
|
17913 |
// -> return complex ambiguity ; return directionality |
|
17914 |
||
17915 |
if ( leftChunk.iStart == -1 && rightChunk.iStart == -1 ) // 2 chunks invalid; direction stays EUnkonwn |
|
17916 |
{ |
|
17917 |
directionalInfo.iDirectionalStatus = TTextDirectionalInfo::ENoDirectionalChunks; |
|
17918 |
} |
|
17919 |
else if ( leftChunk.iStart == -1 ) // no left block |
|
17920 |
{ |
|
17921 |
directionalInfo.iBlockEnvironment = TTextDirectionalInfo::EAtLeftEndOfLine; |
|
17922 |
directionalInfo.SetDirectionFromChunk( rightChunk ); |
|
17923 |
} |
|
17924 |
else if ( rightChunk.iStart == -1 ) // no right block |
|
17925 |
{ |
|
17926 |
directionalInfo.iBlockEnvironment = TTextDirectionalInfo::EAtRightEndOfLine; |
|
17927 |
directionalInfo.SetDirectionFromChunk( leftChunk ); |
|
17928 |
} |
|
17929 |
// Both chunks are the same direction. |
|
17930 |
// We are either nicely inside a block or the two blocks are at +/- 2, 4, etc levels |
|
17931 |
else if ( COMPARE_BOOLS( leftChunk.iRightToLeft, rightChunk.iRightToLeft ) ) |
|
17932 |
{ |
|
17933 |
// Can set direction from either chunk; use left one |
|
17934 |
directionalInfo.SetDirectionFromChunk( leftChunk ); |
|
17935 |
||
17936 |
if (leftChunk.iRightToLeft ) |
|
17937 |
{ |
|
17938 |
if ( leftChunk.iStart == rightChunk.iEnd ) // chunks are continguous |
|
17939 |
directionalInfo.iBlockEnvironment = TTextDirectionalInfo::EInsideBlock; |
|
17940 |
else // Chunks are separated by 2, 4 etc. levels |
|
17941 |
directionalInfo.iBlockEnvironment = ( aDocPos.iPos == leftChunk.iStart ) ? |
|
17942 |
TTextDirectionalInfo::EAtRightEndOfBlockFacingSameDirectionBlock : |
|
17943 |
TTextDirectionalInfo::EAtLeftEndOfBlockFacingSameDirectionBlock; |
|
17944 |
} |
|
17945 |
else |
|
17946 |
{ |
|
17947 |
if ( leftChunk.iEnd == rightChunk.iStart ) // chunks are continguous |
|
17948 |
directionalInfo.iBlockEnvironment = TTextDirectionalInfo::EInsideBlock; |
|
17949 |
else // Chunks are separated by 2, 4 etc. levels |
|
17950 |
directionalInfo.iBlockEnvironment = ( aDocPos.iPos == leftChunk.iEnd ) ? |
|
17951 |
TTextDirectionalInfo::EAtRightEndOfBlockFacingSameDirectionBlock : |
|
17952 |
TTextDirectionalInfo::EAtLeftEndOfBlockFacingSameDirectionBlock; |
|
17953 |
} |
|
17954 |
} |
|
17955 |
else // Blocks are in opposite direction. Have to deal with all the values of the iType enum |
|
17956 |
{ |
|
17957 |
TInt charPos; |
|
17958 |
switch( aDocPos.iType ) |
|
17959 |
{ |
|
17960 |
case TTmDocPosSpec::ETrailing: // position follows a block End |
|
17961 |
{ |
|
17962 |
charPos = aDocPos.iPos - 1; // attachment is to character[iPos-1] - now find it |
|
17963 |
if ( leftChunk.iStart <= charPos && charPos < leftChunk.iEnd ) // pos is in left chunk |
|
17964 |
{ |
|
17965 |
directionalInfo.SetDirectionFromChunk( leftChunk ); |
|
17966 |
directionalInfo.iBlockEnvironment = |
|
17967 |
TTextDirectionalInfo::EAtRightEndOfBlockFacingOppositeDirectionalBlock; |
|
17968 |
} |
|
17969 |
else if( rightChunk.iStart <= charPos && charPos < rightChunk.iEnd ) // pos is in right chunk |
|
17970 |
{ |
|
17971 |
directionalInfo.SetDirectionFromChunk( rightChunk ); |
|
17972 |
directionalInfo.iBlockEnvironment = |
|
17973 |
TTextDirectionalInfo::EAtLeftEndOfBlockFacingOppositeDirectionalBlock; |
|
17974 |
} |
|
17975 |
else // Probably impossible situation. Supply reasonable defaults rather than panicking |
|
17976 |
{ |
|
17977 |
directionalInfo.iDirectionalStatus = TTextDirectionalInfo::ELeftToRight; |
|
17978 |
directionalInfo.iBlockEnvironment = |
|
17979 |
TTextDirectionalInfo::EAtLeftEndOfBlockFacingOppositeDirectionalBlock; |
|
17980 |
} |
|
17981 |
break; |
|
17982 |
} |
|
17983 |
case TTmDocPosSpec::ELeading: // position precedes a block start |
|
17984 |
{ |
|
17985 |
charPos = aDocPos.iPos; // attachment is to character[iPos] - now find it |
|
17986 |
if ( leftChunk.iStart <= charPos && charPos < leftChunk.iEnd ) // pos is in left chunk |
|
17987 |
{ |
|
17988 |
directionalInfo.SetDirectionFromChunk( leftChunk ); |
|
17989 |
directionalInfo.iBlockEnvironment = |
|
17990 |
TTextDirectionalInfo::EAtRightEndOfBlockFacingOppositeDirectionalBlock; |
|
17991 |
} |
|
17992 |
else if( rightChunk.iStart <= charPos && charPos < rightChunk.iEnd ) // pos is in right chunk |
|
17993 |
{ |
|
17994 |
directionalInfo.SetDirectionFromChunk( rightChunk ); |
|
17995 |
directionalInfo.iBlockEnvironment = |
|
17996 |
TTextDirectionalInfo::EAtLeftEndOfBlockFacingOppositeDirectionalBlock; |
|
17997 |
} |
|
17998 |
else // Probably impossible situation. Supply reasonable defaults rather than panicking |
|
17999 |
{ |
|
18000 |
directionalInfo.iDirectionalStatus = TTextDirectionalInfo::ELeftToRight; |
|
18001 |
directionalInfo.iBlockEnvironment = |
|
18002 |
TTextDirectionalInfo::EAtLeftEndOfBlockFacingOppositeDirectionalBlock; |
|
18003 |
} |
|
18004 |
break; |
|
18005 |
} |
|
18006 |
case TTmDocPosSpec::ELeftToRight: // Is attached to a Left to right block |
|
18007 |
{ |
|
18008 |
directionalInfo.iDirectionalStatus = TTextDirectionalInfo::ELeftToRight; |
|
18009 |
// If left chunk is RTL, then we are NOT attached to that left block |
|
18010 |
// (ie. we are at left end of the right block) |
|
18011 |
directionalInfo.iBlockEnvironment = leftChunk.iRightToLeft ? |
|
18012 |
TTextDirectionalInfo::EAtLeftEndOfBlockFacingOppositeDirectionalBlock : // must be in right chunk then (left end of it) |
|
18013 |
TTextDirectionalInfo::EAtRightEndOfBlockFacingOppositeDirectionalBlock; // else in left chunk (right end of it) |
|
18014 |
break; |
|
18015 |
} |
|
18016 |
case TTmDocPosSpec::ERightToLeft: |
|
18017 |
{ |
|
18018 |
directionalInfo.iDirectionalStatus = TTextDirectionalInfo::ERightToLeft; |
|
18019 |
// If left chunk if RTL, then we are attached to that left block (ie. at right end of it) |
|
18020 |
directionalInfo.iBlockEnvironment = leftChunk.iRightToLeft ? // is it in left chunk? |
|
18021 |
TTextDirectionalInfo::EAtRightEndOfBlockFacingOppositeDirectionalBlock : // right end of left chunk |
|
18022 |
TTextDirectionalInfo::EAtLeftEndOfBlockFacingOppositeDirectionalBlock; |
|
18023 |
break; |
|
18024 |
} |
|
18025 |
} |
|
18026 |
||
18027 |
} |
|
18028 |
} |
|
18029 |
return directionalInfo; |
|
18030 |
} |
|
18031 |
||
18032 |
||
18033 |
/** |
|
18034 |
* Redecoration is carried out if a neutral is exposed by the deletion to a directionality |
|
18035 |
* different to that which is was already marked. |
|
18036 |
* |
|
18037 |
* The routine leaves iUncommittedText again set to the (possibly new) cursor position. |
|
18038 |
* |
|
18039 |
*/ |
|
18040 |
void CAknFepManager::RedecorateAfterDeletionL( const TDesC& aTextThatWasDeleted ) |
|
18041 |
{ |
|
18042 |
if (!EditorSupportsNeutralProtection()) |
|
18043 |
return; |
|
18044 |
||
18045 |
if ( aTextThatWasDeleted.Length() == 0 ) |
|
18046 |
return; |
|
18047 |
||
18048 |
TBool protect = ETrue; |
|
18049 |
||
18050 |
// Set up iUncommittedText with the current cursor position so that PreviousChar will work: |
|
18051 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
18052 |
||
18053 |
TTmDocPosSpec docPos = DocPos(); |
|
18054 |
TInt docLen = iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
18055 |
||
18056 |
TInt previousPos = docPos.iPos; |
|
18057 |
// Trailing iType actually points to character at index iPos - 1 |
|
18058 |
if( docPos.iType == TTmDocPosSpec::ETrailing ) |
|
18059 |
previousPos = previousPos -= 1; |
|
18060 |
TInt nextPos = previousPos + 1; |
|
18061 |
||
18062 |
// Perform no neutral protection if the beginning of the text is deleted. |
|
18063 |
// Note that there MAY be protection occuring if the delete is from the end so there is |
|
18064 |
// no corresponding test on DocLength. That is handled later where the paragraph direction |
|
18065 |
// is used for the "forward" directionality. |
|
18066 |
if ( previousPos < 0 ) |
|
18067 |
return; |
|
18068 |
||
18069 |
// Up to 2 protection characters, one RTL and one LTR |
|
18070 |
TBuf<2> textToInsert; |
|
18071 |
||
18072 |
TBool adjacentPrecedingIsNeutral(EFalse); |
|
18073 |
TBool adjacentTrailingIsNeutral(EFalse); |
|
18074 |
||
18075 |
// See if either preceding or next is neutral |
|
18076 |
adjacentPrecedingIsNeutral = iInlineTextDecorator->CharacterIsNeutral( CharAt(previousPos) ); |
|
18077 |
if ( nextPos < docLen ) |
|
18078 |
adjacentTrailingIsNeutral = iInlineTextDecorator->CharacterIsNeutral( CharAt(nextPos) ); |
|
18079 |
||
18080 |
if ( !adjacentPrecedingIsNeutral && !adjacentTrailingIsNeutral ) |
|
18081 |
protect = EFalse; |
|
18082 |
||
18083 |
// Inits actually correspond to LTR, but they are only used if the bools indicating |
|
18084 |
// strong directionality found get set |
|
18085 |
TBool directionPrecedingDeleteIsRTL(EFalse); |
|
18086 |
TBool directionTrailingDeleteIsRTL(EFalse); |
|
18087 |
if ( protect ) |
|
18088 |
{ |
|
18089 |
TBool strongPreceding = GetExposedDirectionOfText( previousPos, EFalse, |
|
18090 |
directionPrecedingDeleteIsRTL ); |
|
18091 |
TBool strongTrailing = GetExposedDirectionOfText( nextPos, ETrue, |
|
18092 |
directionTrailingDeleteIsRTL ); |
|
18093 |
if (!strongTrailing) |
|
18094 |
{ |
|
18095 |
TBool isRTLPara = IsRightToLeftParagraph(docPos); |
|
18096 |
directionTrailingDeleteIsRTL = isRTLPara; |
|
18097 |
strongTrailing = ETrue; |
|
18098 |
} |
|
18099 |
if ( !strongPreceding || !strongTrailing) // Must have strong in both directions |
|
18100 |
protect = EFalse; |
|
18101 |
else if ( COMPARE_BOOLS( directionPrecedingDeleteIsRTL, directionTrailingDeleteIsRTL ) ) // Must differ |
|
18102 |
protect = EFalse; |
|
18103 |
} |
|
18104 |
||
18105 |
TBool forwardProtection(EFalse); |
|
18106 |
||
18107 |
if ( protect ) |
|
18108 |
{ |
|
18109 |
protect = EFalse; |
|
18110 |
TBool deletedWasRTL; |
|
18111 |
||
18112 |
// Check for and do reverse protection |
|
18113 |
if ( adjacentPrecedingIsNeutral ) |
|
18114 |
{ |
|
18115 |
TBool deletedTextIsStrong = GetExposedDirectionOfTextInDescriptor( aTextThatWasDeleted, |
|
18116 |
ETrue, |
|
18117 |
deletedWasRTL ); // search forward into deleted stuff |
|
18118 |
if ( deletedTextIsStrong && (directionPrecedingDeleteIsRTL == deletedWasRTL)) |
|
18119 |
{ |
|
18120 |
protect = ETrue; |
|
18121 |
forwardProtection = EFalse; |
|
18122 |
if ( deletedWasRTL ) |
|
18123 |
textToInsert.Append( CAknFepInlineTextDecorator::ERightToLeftMark ); |
|
18124 |
else |
|
18125 |
textToInsert.Append( CAknFepInlineTextDecorator::ELeftToRightMark ); |
|
18126 |
} |
|
18127 |
} |
|
18128 |
||
18129 |
// Check for and do forward protection |
|
18130 |
// Note it is possible to have both forward and reverse redecoration. |
|
18131 |
if ( adjacentTrailingIsNeutral ) |
|
18132 |
{ |
|
18133 |
TBool deletedTextIsStrong = GetExposedDirectionOfTextInDescriptor( aTextThatWasDeleted, |
|
18134 |
EFalse, |
|
18135 |
deletedWasRTL ); // search backward in deleted stuff |
|
18136 |
if (deletedTextIsStrong && (directionTrailingDeleteIsRTL == deletedWasRTL) ) |
|
18137 |
{ |
|
18138 |
protect = ETrue; |
|
18139 |
forwardProtection = ETrue; |
|
18140 |
if ( deletedWasRTL ) |
|
18141 |
textToInsert.Append( CAknFepInlineTextDecorator::ERightToLeftMark ); |
|
18142 |
else |
|
18143 |
textToInsert.Append( CAknFepInlineTextDecorator::ELeftToRightMark ); |
|
18144 |
} |
|
18145 |
} |
|
18146 |
} |
|
18147 |
||
18148 |
||
18149 |
if ( protect ) |
|
18150 |
{ |
|
18151 |
StartInlineEditL(textToInsert); |
|
18152 |
CommitInlineEditWithoutResolutionL(*(iInputCapabilities.FepAwareTextEditor()), ETrue); |
|
18153 |
// iUncommittedText is now set to correct value by the Commitxxxx method |
|
18154 |
// Document position is adjusted to as to keep the cursor stable. |
|
18155 |
// Make a docPos. If reverse protection, then the position should trail |
|
18156 |
TTmDocPosSpec docPos( iUncommittedText.LowerPos() , TTmDocPosSpec::ETrailing ); |
|
18157 |
// But if there has been forward Protection, then we have to back up the cursor by 1 |
|
18158 |
// and lead. (This is OK too, if there is simultaneous reversse and forward protection) |
|
18159 |
if ( forwardProtection ) |
|
18160 |
{ |
|
18161 |
docPos.iPos = Max(docPos.iPos - 1, 0 ); |
|
18162 |
docPos.iType = TTmDocPosSpec::ELeading; |
|
18163 |
} |
|
18164 |
SetCursorPositionL( docPos ); |
|
18165 |
} |
|
18166 |
} |
|
18167 |
||
18168 |
TBool CAknFepManager::EditorSupportsNeutralProtection() |
|
18169 |
{ |
|
18170 |
TBool ret = ETrue; |
|
18171 |
if ( !IsFepAwareTextEditor() ) |
|
18172 |
ret = EFalse; |
|
18173 |
||
18174 |
else if (iInputCapabilities.SupportsSecretText()) |
|
18175 |
ret = EFalse; |
|
18176 |
||
18177 |
else if ( iAknEditorFlags & EAknEditorFlagLatinInputModesOnly ) |
|
18178 |
ret = EFalse; |
|
18179 |
||
18180 |
else if (iPermittedInputModes == EAknEditorNumericInputMode) |
|
18181 |
ret = EFalse; |
|
18182 |
||
18183 |
else if ( !CharIsValidInEditor( CAknFepInlineTextDecorator::ERightToLeftMark ) ) |
|
18184 |
ret = EFalse; |
|
18185 |
||
18186 |
return ret; |
|
18187 |
} |
|
18188 |
||
18189 |
void CAknFepManager::CommitInlineEditWithoutResolutionL(MCoeFepAwareTextEditor& aFepAwareTextEditor, |
|
18190 |
TBool aCursorVisibility , TBool aClearPti ) |
|
18191 |
{ |
|
18192 |
aFepAwareTextEditor.SetInlineEditingCursorVisibilityL(aCursorVisibility); |
|
18193 |
/* |
|
18194 |
On any call to CommitFepInlineEditL, the mode will change |
|
18195 |
even when a leave event occurs. |
|
18196 |
*/ |
|
18197 |
ClearFlag(EFlagInsideInlineEditingTransaction | EFlagInsideMultitapInlineEditingTransaction); |
|
18198 |
ClearCcpuFlag(ECcpuStateNewPredictiveWord); |
|
18199 |
||
18200 |
if(aClearPti) |
|
18201 |
{ |
|
18202 |
iPtiEngine->CommitCurrentWord(); |
|
18203 |
} |
|
18204 |
CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
18205 |
aFepAwareTextEditor.CommitFepInlineEditL(*coeEnv); |
|
18206 |
aFepAwareTextEditor.GetCursorSelectionForFep(iUncommittedText); |
|
18207 |
// iMatchState=EWordMatchFirst; |
|
18208 |
iCaseMan->UpdateCase(ENullNaviEvent); |
|
18209 |
} |
|
18210 |
||
18211 |
void CAknFepManager::WordConcatenationTimerTimeoutL() |
|
18212 |
{ |
|
18213 |
iConcatenationTimer->Cancel(); |
|
18214 |
||
18215 |
// add concatenated word to the UDB (a concatenated word is a compound word) |
|
18216 |
AddCompoundWordToUdbL(); |
|
18217 |
||
18218 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
18219 |
MoveCursorToEndOfWordL(); |
|
18220 |
#endif |
|
18221 |
} |
|
18222 |
||
18223 |
||
18224 |
TKeyResponse CAknFepManager::HandlePredictiveNaviEventOutsideInlineEditL(TUint aCode, |
|
18225 |
TKeyPressLength aLength) |
|
18226 |
{ |
|
18227 |
TKeyResponse response = EKeyWasNotConsumed; |
|
18228 |
||
18229 |
TWesternNaviEvent naviEvent = ENullNaviEvent; |
|
18230 |
if (aCode == EKeyLeftArrow) |
|
18231 |
{ |
|
18232 |
naviEvent = ELeftNaviEvent; |
|
18233 |
} |
|
18234 |
else if (aCode == EKeyRightArrow) |
|
18235 |
{ |
|
18236 |
naviEvent = ERightNaviEvent; |
|
18237 |
} |
|
18238 |
else if (aCode == EKeyBackspace) |
|
18239 |
{ |
|
18240 |
naviEvent = EBackspaceEvent; |
|
18241 |
} |
|
18242 |
||
18243 |
TInt nextCharPos = 0; // Character ordinal in logical memory (0 - n-1) |
|
18244 |
TBool nextPositionFound = EFalse; |
|
18245 |
if ( naviEvent == ERightNaviEvent ) |
|
18246 |
{ |
|
18247 |
nextPositionFound = GetNextVisualRightCharacter( nextCharPos ); |
|
18248 |
} |
|
18249 |
else if ( naviEvent == ELeftNaviEvent ) |
|
18250 |
{ |
|
18251 |
nextPositionFound = GetNextVisualLeftCharacter( nextCharPos ); |
|
18252 |
} |
|
18253 |
else if ( naviEvent == EBackspaceEvent ) |
|
18254 |
{ |
|
18255 |
if (iLanguageCapabilities.iRightToLeftLanguage) |
|
18256 |
{ |
|
18257 |
TChar character = PreviousChar(); |
|
18258 |
TChar::TBdCategory bdCategory = character.GetBdCategory(); |
|
18259 |
// In case last character in buffer is number or Latin characters, needs to delete |
|
18260 |
// character from left. |
|
18261 |
if (TChar::EEuropeanNumber == bdCategory || TChar::EArabicNumber == bdCategory || |
|
18262 |
TChar::ELeftToRight == bdCategory ) |
|
18263 |
{ |
|
18264 |
nextPositionFound = GetNextVisualLeftCharacter( nextCharPos ); |
|
18265 |
} |
|
18266 |
else |
|
18267 |
{ |
|
18268 |
nextPositionFound = GetNextVisualRightCharacter( nextCharPos ); |
|
18269 |
} |
|
18270 |
} |
|
18271 |
else |
|
18272 |
{ |
|
18273 |
nextPositionFound = GetNextVisualLeftCharacter( nextCharPos ); |
|
18274 |
} |
|
18275 |
} |
|
18276 |
||
18277 |
if ( !nextPositionFound ) |
|
18278 |
{ |
|
18279 |
response = EKeyWasNotConsumed; |
|
18280 |
} |
|
18281 |
else // not looping - lets see what to do |
|
18282 |
{ |
|
18283 |
TBuf<ESingleCharacter> characterBuffer; |
|
18284 |
iInputCapabilities.FepAwareTextEditor()->GetEditorContentForFep(characterBuffer, |
|
18285 |
nextCharPos, |
|
18286 |
ESingleCharacter); |
|
18287 |
||
18288 |
if ( !IsValidInLineCharacter( STATIC_CAST(TChar, characterBuffer[0])) ) |
|
18289 |
{ |
|
18290 |
// if the character is a non-alpha character; let it go |
|
18291 |
response=EKeyWasNotConsumed; |
|
18292 |
if (IsFlagSet(EFlagCompoundWord)) |
|
18293 |
{ |
|
18294 |
if (STATIC_CAST(TChar, characterBuffer[0]).IsSpace()) |
|
18295 |
// we are navigating over a space so add any current compond word to the udb |
|
18296 |
AddCompoundWordToUdbL(); |
|
18297 |
ClearFlag(EFlagCompoundWord); |
|
18298 |
} |
|
18299 |
//allow to popup editsubmenu |
|
18300 |
ClearCcpuFlag(ECcpuStateIgnoreStarUp); |
|
18301 |
} |
|
18302 |
else |
|
18303 |
{ |
|
18304 |
if (FepUI()->HandleKeyL(aCode, aLength)) |
|
18305 |
{ |
|
18306 |
response=EKeyWasConsumed; |
|
18307 |
} |
|
18308 |
} |
|
18309 |
} |
|
18310 |
return response; |
|
18311 |
} |
|
18312 |
||
18313 |
/** |
|
18314 |
* Call back function: |
|
18315 |
*/ |
|
18316 |
TInt CAknFepManager::DoSimulateKey(TAny* aThisPtr) |
|
18317 |
{ |
|
18318 |
CAknFepManager* myobj = static_cast<CAknFepManager*>(aThisPtr); |
|
18319 |
TRAPD(error, myobj->HandleOwnedSimulateKeyL()); |
|
18320 |
return error; |
|
18321 |
} |
|
18322 |
||
18323 |
void CAknFepManager::HandleOwnedSimulateKeyL() |
|
18324 |
{ |
|
18325 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
18326 |
#ifdef __HALF_QWERTY_KEYPAD |
|
18327 |
if( KeyboardLayout() == EPtiKeyboardHalfQwerty ) |
|
18328 |
{ |
|
18329 |
CCoeEnv::Static()->SimulateKeyEventL( iHalfQwertyLastKeyEvent, EEventKey ); |
|
18330 |
} |
|
18331 |
else |
|
18332 |
#endif //__HALF_QWERTY_KEYPAD |
|
18333 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
18334 |
if (iSimulateKey > 0) |
|
18335 |
{ |
|
18336 |
HandleKeyEventL(iSimulateKey, EShortKeyPress); |
|
18337 |
iSimulateKey = 0; |
|
18338 |
} |
|
18339 |
} |
|
18340 |
||
18341 |
/** |
|
18342 |
* This method is that the label of CBA is updated by aTextResId. |
|
18343 |
* @param aPosition CBA position, either ELeftSoftkeyIndex or ERightSoftkeyIndex |
|
18344 |
* @param aCommandId command id for softkey |
|
18345 |
* @param aTextResId resource id to set string on label. |
|
18346 |
* @return TBool The return value is ETrue in case it is necessary to update CBA. |
|
18347 |
*/ |
|
18348 |
TBool CAknFepManager::UpdateCBALabelL(TInt aPosition, TInt aCommandId, TInt aTextResId) |
|
18349 |
{ |
|
18350 |
return iUiInterface->UpdateSoftkeyLabelL(aPosition, aCommandId, aTextResId); |
|
18351 |
} |
|
18352 |
||
18353 |
void CAknFepManager::DoLaunchSctAndPctL(TInt aResourceId, TShowSctMode aShowSctMode) |
|
18354 |
{ |
|
18355 |
TBool replace = EFalse; |
|
18356 |
TBool disableRecentItemRow = EFalse; |
|
18357 |
||
18358 |
if (ExtendedInputCapabilities() & CAknExtendedInputCapabilities::EDisableSCT) |
|
18359 |
{ |
|
18360 |
// The editor doesn't allow SCT. |
|
18361 |
return; |
|
18362 |
} |
|
18363 |
if ( EditorType() == CAknExtendedInputCapabilities::EEikSecretEditorBased ) |
|
18364 |
{ |
|
18365 |
||
18366 |
disableRecentItemRow = ETrue; |
|
18367 |
} |
|
18368 |
||
18369 |
if (IsCcpuFlagSet(ECcpuStateCbaSymbol) && |
|
18370 |
iMode == ELatin && WesternPredictive(ELatin) && |
|
18371 |
iPtiEngine->LastEnteredKey() == EPtiKey1) |
|
18372 |
{ |
|
18373 |
// User is entering special character as result of pressing key '1' and |
|
18374 |
// cycling through candidates until left softkey turns into "Symbol". In |
|
18375 |
// that case we want to replace last cahracter instead of adding new one. |
|
18376 |
replace = ETrue; |
|
18377 |
} |
|
18378 |
||
18379 |
//Commit characters in latin multitap as some editors may call CancelFepTransaction() |
|
18380 |
//which will be received before the focus change notification. |
|
18381 |
if (IsFeatureSupportedJapanese()) |
|
18382 |
{ |
|
18383 |
TryCloseUiL(); |
|
18384 |
} |
|
18385 |
else |
|
18386 |
{ |
|
18387 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
18388 |
if(!(WesternPredictive())) |
|
18389 |
#endif |
|
18390 |
CommitInlineEditL(); |
|
18391 |
} |
|
18392 |
||
18393 |
if (!EditorHasFreeSpace()) |
|
18394 |
{ |
|
18395 |
return; |
|
18396 |
} |
|
18397 |
||
18398 |
// get the SCT resource id from editor default settings |
|
18399 |
TInt currentEditorSCTResId = GetCurrentEditorSCTResId(); |
|
18400 |
TInt charMap = aResourceId; |
|
18401 |
if ( FeatureManager::FeatureSupported(KFeatureIdChinese) ) |
|
18402 |
{ |
|
18403 |
if (charMap == R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG) |
|
18404 |
{ |
|
18405 |
charMap = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_CHINESE; |
|
18406 |
} |
|
18407 |
} |
|
18408 |
if (!charMap) |
|
18409 |
{ |
|
18410 |
// override numeric keymap if necessary. flag is for non standard charmaps |
|
18411 |
TInt standardNumericCharMap = EDefaultNumericCharMapResId; |
|
18412 |
if ((iMode == ENumber || iMode == ENativeNumber) && |
|
18413 |
!(iAknEditorFlags & EAknEditorFlagUseSCTNumericCharmap) && |
|
18414 |
(iCharWidth == EHalfWidthChar) && |
|
18415 |
( (iAknEditorNumericKeymap != EAknEditorAlphanumericNumberModeKeymap) || |
|
18416 |
(iPermittedInputModes == EAknEditorNumericInputMode) )) |
|
18417 |
{ |
|
18418 |
standardNumericCharMap = NumericModeSCTResourceId(); |
|
18419 |
} |
|
18420 |
charMap = standardNumericCharMap; |
|
18421 |
} |
|
18422 |
||
18423 |
if ( charMap == ENoCharacters && !IsAbleToLaunchSCT()) |
|
18424 |
{ |
|
18425 |
currentEditorSCTResId = charMap; |
|
18426 |
} |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
18427 |
if(R_AKNFEP_SCT_NUMERIC_MODE_CHARS_PLAIN == charMap && |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
18428 |
( R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_LATIN_ONLY == currentEditorSCTResId || |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
18429 |
R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG == currentEditorSCTResId || |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
18430 |
R_AVKON_URL_SPECIAL_CHARACTER_TABLE_DIALOG == currentEditorSCTResId) ) |
44 | 18431 |
{ |
18432 |
TBool isEmpty = ETrue; |
|
18433 |
TRAP_IGNORE(isEmpty = GetSctLengthL(charMap)); |
|
18434 |
if(isEmpty) |
|
18435 |
{ |
|
18436 |
return; |
|
18437 |
} |
|
18438 |
} |
|
18439 |
||
18440 |
if (currentEditorSCTResId) |
|
18441 |
{ |
|
18442 |
TBuf<32> specialChars; |
|
18443 |
||
18444 |
TInt sctChars = EAknSCTChiChineseInputModes; |
|
18445 |
TInt afterSctChars = EAknSCTHalfCase; |
|
18446 |
||
18447 |
if (iCharWidth == EFullWidthChar) |
|
18448 |
{ |
|
18449 |
sctChars = EAknSCTFullCase; |
|
18450 |
if (iMode == ELatin) |
|
18451 |
{ |
|
18452 |
afterSctChars = EAknSCTUpperCase; |
|
18453 |
if (iCaseMan->CurrentCase() == EAknEditorLowerCase) |
|
18454 |
{ |
|
18455 |
afterSctChars = EAknSCTLowerCase; |
|
18456 |
} |
|
18457 |
} |
|
18458 |
else if (iMode == ENumber||iMode == ENativeNumber) |
|
18459 |
{ |
|
18460 |
afterSctChars = EAknSCTLowerCase; |
|
18461 |
} |
|
18462 |
} |
|
18463 |
else |
|
18464 |
{ |
|
18465 |
if (iMode == ELatin) |
|
18466 |
{ |
|
18467 |
if ( FeatureManager::FeatureSupported(KFeatureIdChinese) ) |
|
18468 |
{ |
|
18469 |
sctChars = EAknSCTChiLatinInputModes; |
|
18470 |
} |
|
18471 |
else |
|
18472 |
{ |
|
18473 |
if (iQwertyInputMode) |
|
18474 |
{ |
|
18475 |
sctChars = EAknSCTQwerty; |
|
18476 |
afterSctChars = EAknSCTFullCase; |
|
18477 |
} |
|
18478 |
else |
|
18479 |
{ |
|
18480 |
sctChars = EAknSCTUpperCase; |
|
18481 |
afterSctChars = EAknSCTFullCase; |
|
18482 |
if (iCaseMan->CurrentCase() == EAknEditorLowerCase) |
|
18483 |
{ |
|
18484 |
sctChars = EAknSCTLowerCase; |
|
18485 |
} |
|
18486 |
} |
|
18487 |
} |
|
18488 |
} |
|
18489 |
else if (iMode == ENumber||iMode == ENativeNumber) |
|
18490 |
{ |
|
18491 |
sctChars = EAknSCTNumeric; |
|
18492 |
if ( ((iAknEditorFlags & EAknEditorFlagUseSCTNumericCharmap) || |
|
18493 |
(iAknEditorNumericKeymap == EAknEditorAlphanumericNumberModeKeymap)) && |
|
18494 |
!IsOnlyHalfWidthCharacterPermitted() ) |
|
18495 |
{ |
|
18496 |
sctChars = EAknSCTLowerCase; |
|
18497 |
afterSctChars = EAknSCTFullCase; |
|
18498 |
} |
|
18499 |
} |
|
18500 |
else if (iMode == EHiraganaKanji) |
|
18501 |
{ |
|
18502 |
sctChars = EAknSCTFullCase; |
|
18503 |
} |
|
18504 |
else if(iMode == EKatakana) |
|
18505 |
{ |
|
18506 |
sctChars = EAknSCTHalfCase; |
|
18507 |
afterSctChars = EAknSCTFullCase; |
|
18508 |
} |
|
18509 |
} |
|
18510 |
||
18511 |
SetFlag(EFlagForegroundUIComponentVisible); |
|
18512 |
||
18513 |
TBool showAnotherTable = EFalse; |
|
18514 |
if (IsFeatureSupportedJapanese()) |
|
18515 |
{ |
|
18516 |
if (sctChars == EAknSCTFullCase) |
|
18517 |
{ |
|
18518 |
if (!IsOnlyFullWidthCharacterPermitted()) |
|
18519 |
{ |
|
18520 |
showAnotherTable = ETrue; |
|
18521 |
} |
|
18522 |
} |
|
18523 |
else if (sctChars == EAknSCTHalfCase || sctChars == EAknSCTUpperCase |
|
18524 |
|| sctChars == EAknSCTLowerCase) |
|
18525 |
{ |
|
18526 |
if (!IsOnlyHalfWidthCharacterPermitted() |
|
18527 |
&& !(iAknEditorFlags & EAknEditorFlagLatinInputModesOnly)) |
|
18528 |
{ |
|
18529 |
showAnotherTable = ETrue; |
|
18530 |
} |
|
18531 |
} |
|
18532 |
} |
|
18533 |
#ifdef RD_SCALABLE_UI_V2 |
|
18534 |
if( iFepFullyConstructed && !iFepPluginManager->IsGlobleNotes()) |
|
18535 |
{ |
|
18536 |
if (iFepPluginManager->PluginInputMode() == EPluginInputModeItut || |
|
18537 |
iFepPluginManager->PluginInputMode() == EPluginInputModeFSQ || |
|
18538 |
iFepPluginManager->PluginInputMode() == EPluginInputModeFingerHwr || |
|
18539 |
iFepPluginManager->PluginInputMode() == EPluginInputModePortraitFSQ ) |
|
18540 |
||
18541 |
{ |
|
18542 |
SetStopProcessFocus(ETrue, EFalse); |
|
18543 |
iFepPluginManager->SetMenuState(); |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
18544 |
} |
44 | 18545 |
else if (!iFepPluginManager->IsGlobleNotes()) |
18546 |
{ |
|
18547 |
iFepPluginManager->ClosePluginInputUiL( ETrue ); |
|
18548 |
} |
|
18549 |
} |
|
18550 |
#endif |
|
18551 |
||
18552 |
TBool lockNumericKeys = ( iPtiEngine->IsQwertyBasedMode(iPtiEngine->InputMode())) |
|
18553 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
18554 |
|| ( iPtiEngine->InputMode() == EPtiEngineHalfQwerty ) || |
|
18555 |
( iPtiEngine->InputMode() == EPtiEngineHalfQwertyPredictive ) |
|
18556 |
#endif |
|
18557 |
; |
|
18558 |
TUid fepUid = CCoeEnv::Static()->FepUid(); |
|
18559 |
||
18560 |
if(IsAbleToLaunchSmiley()) |
|
18561 |
{ |
|
18562 |
if(aShowSctMode == EShowSmileyFirst) |
|
18563 |
{ |
|
18564 |
sctChars |= EAknCharMapEmotionFirst; |
|
18565 |
} |
|
18566 |
else |
|
18567 |
{ |
|
18568 |
sctChars |= EAknCharMapEmotionUse; |
|
18569 |
} |
|
18570 |
} |
|
18571 |
ClearExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
18572 |
||
18573 |
if ( iFepPluginManager && iFepPluginManager->IsSpellVisible() ) |
|
18574 |
{ |
|
18575 |
iFepPluginManager->SetLaunchSCTInSpell( ETrue ); |
|
18576 |
} |
|
18577 |
SendEventsToPluginManL(EPluginEnablePriorityChangeOnOriChange,EFalse); |
|
18578 |
if (iUiInterface->CharMapDialogL( |
|
18579 |
sctChars, |
|
18580 |
specialChars, |
|
18581 |
charMap, |
|
18582 |
lockNumericKeys, |
|
18583 |
aShowSctMode==EShowPctFirst, |
|
18584 |
!IsAbleToLaunchPCT(), |
|
18585 |
showAnotherTable, |
|
18586 |
afterSctChars, |
|
18587 |
currentEditorSCTResId, |
|
18588 |
disableRecentItemRow)) |
|
18589 |
{ |
|
18590 |
PrepareFepAfterDialogExitL(fepUid); |
|
18591 |
SetCcpuFlag(ECcpuStateSupressCursorMoveToEnd); |
|
18592 |
// after closing SCT, need change dim state. |
|
18593 |
SendEventsToPluginManL(EPluginEnableFetchDimState); |
|
18594 |
#ifdef RD_SCALABLE_UI_V2 |
|
18595 |
iNotifyPlugin = EFalse; |
|
18596 |
if( iFepFullyConstructed && iFepPluginManager) |
|
18597 |
{ |
|
18598 |
if (iFepPluginManager->PluginInputMode() == EPluginInputModeItut || |
|
18599 |
iFepPluginManager->PluginInputMode() == EPluginInputModeFSQ || |
|
18600 |
iFepPluginManager->PluginInputMode() == EPluginInputModeFingerHwr || |
|
18601 |
iFepPluginManager->PluginInputMode() == EPluginInputModePortraitFSQ ) |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
18602 |
|
44 | 18603 |
{ |
18604 |
SetStopProcessFocus(EFalse); |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
18605 |
} |
44 | 18606 |
else |
18607 |
{ |
|
18608 |
HandleChangeInFocus(); |
|
18609 |
} |
|
18610 |
} |
|
18611 |
else |
|
18612 |
{ |
|
18613 |
HandleChangeInFocus(); |
|
18614 |
} |
|
18615 |
// Set the flag, not change focus for next. |
|
18616 |
iNotifyPlugin = ETrue; |
|
18617 |
#endif |
|
18618 |
||
18619 |
//Removes auto-complition part if SCT is launched and any special character is selected |
|
18620 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
18621 |
if( specialChars.Length() > 0 ) |
|
18622 |
{ |
|
18623 |
RemoveSuggestedAdvanceCompletionL(); |
|
18624 |
} |
|
18625 |
#endif // RD_INTELLIGENT_TEXT_INPUT |
|
18626 |
TBuf<ESingleCharacter> charAsDesc(ESingleCharacter); |
|
18627 |
for ( TInt ii = 0; ii < specialChars.Length(); ii++) |
|
18628 |
{ |
|
18629 |
charAsDesc[0]=(TText)specialChars[ii]; |
|
18630 |
||
18631 |
if (iInputCapabilities.SupportsSecretText()) |
|
18632 |
{ |
|
18633 |
TChar ch = charAsDesc[0]; |
|
18634 |
if (ch == TText(0x000A) || ch == TText(CEditableText::EParagraphDelimiter)) |
|
18635 |
// 0x000A is ascii, EParagraphDelimiter is unicode - future |
|
18636 |
// proofs against sct changing to unicode |
|
18637 |
ch = EKeyEnter; |
|
18638 |
if (CharIsValidInEditor(ch)) |
|
18639 |
{ |
|
18640 |
//we receive an extra key press if we simulate a key that is also a device key |
|
18641 |
if (ch.IsDigit() || TUint(ch) == EStarKeyUnicodeValue |
|
18642 |
|| TUint(ch) == EHashKeyUnicodeValue) |
|
18643 |
SetFlag(EFlagPassNextKey); |
|
18644 |
SimulateKeyEventL(ch); |
|
18645 |
} |
|
18646 |
} |
|
18647 |
else |
|
18648 |
{ |
|
18649 |
if (charAsDesc[0] == TText(0x000A)) // 0x000A is line feed |
|
18650 |
{ |
|
18651 |
charAsDesc[0] = CEditableText::EParagraphDelimiter; |
|
18652 |
} |
|
18653 |
||
18654 |
if (CharIsValidInEditor(charAsDesc[0])) |
|
18655 |
{ |
|
18656 |
TCursorSelection cursorSelection(0,0); |
|
18657 |
if ((iAknEditorFlags & EAknEditorFlagMTAutoOverwrite) && iMode == ELatin |
|
18658 |
&& !WesternPredictive()) |
|
18659 |
{ |
|
18660 |
TInt edSize = |
|
18661 |
iInputCapabilities.FepAwareTextEditor()->DocumentLengthForFep(); |
|
18662 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
18663 |
if (iUncommittedText.iCursorPos < edSize |
|
18664 |
&& iUncommittedText.Length() == 0) |
|
18665 |
{ |
|
18666 |
cursorSelection = TCursorSelection(iUncommittedText.iCursorPos + 1, |
|
18667 |
iUncommittedText.iAnchorPos); |
|
18668 |
} |
|
18669 |
} |
|
18670 |
if (EditorState()) |
|
18671 |
{ |
|
18672 |
if (charAsDesc[0] == CEditableText::EParagraphDelimiter) |
|
18673 |
{ |
|
18674 |
// This is line feed character. Post it to editor and let it decide |
|
18675 |
// if it is valid. |
|
18676 |
if (!(iAknEditorFlags & EAknEditorFlagFindPane) |
|
18677 |
&& specialChars.Length() == 1) |
|
18678 |
{ |
|
18679 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
18680 |
CommitInlineEditL(); |
|
18681 |
#endif |
|
18682 |
||
18683 |
SimulateKeyEventL(EKeyEnter); |
|
18684 |
SimulateKeyEventL(EKeyF19); // Asyncronous case update |
|
18685 |
} |
|
18686 |
} |
|
18687 |
else |
|
18688 |
{ |
|
18689 |
if (replace) |
|
18690 |
{ |
|
18691 |
TKeyEvent delKey = {8, EStdKeyBackspace, 1, 0}; |
|
18692 |
CCoeEnv::Static()->SimulateKeyEventL(delKey, EEventKey); |
|
18693 |
} |
|
18694 |
//There may be several char to be inserted, need disable Focus change to avoid multi-focus change. |
|
18695 |
#ifdef RD_SCALABLE_UI_V2 |
|
18696 |
#endif |
|
18697 |
InsertTextFromDialogL(charAsDesc, cursorSelection); |
|
18698 |
} |
|
18699 |
// Clear dead key, vowel sequence and vietnamese tone mark states. |
|
18700 |
iPtiEngine->HandleCommandL(EPtiCommandGetAndClearLastVietnameseChar, |
|
18701 |
NULL); |
|
18702 |
iPtiEngine->HandleCommandL(EPtiCommandClearVowelSeq, |
|
18703 |
NULL); |
|
18704 |
iPtiEngine->HandleCommandL(EPtiCommandGetAndClearDeadKeyRootChar, |
|
18705 |
NULL); |
|
18706 |
} |
|
18707 |
} |
|
18708 |
} |
|
18709 |
} |
|
18710 |
} |
|
18711 |
else |
|
18712 |
{ |
|
18713 |
iClosePeninputUi = EFalse; |
|
18714 |
iStopProcessFocus = EFalse; |
|
18715 |
} |
|
18716 |
PrepareFepAfterDialogExitL(fepUid); |
|
18717 |
SendEventsToPluginManL(EPluginEnablePriorityChangeOnOriChange,ETrue); |
|
18718 |
} |
|
18719 |
} |
|
18720 |
||
18721 |
/** |
|
18722 |
* Queries supportting of SecretText |
|
18723 |
* |
|
18724 |
* @since 2.6 |
|
18725 |
* @return ETrue if SecretText was supported |
|
18726 |
*/ |
|
18727 |
TBool CAknFepManager::IsSupportsSecretText() const |
|
18728 |
{ |
|
18729 |
TBool bSecret = iInputCapabilities.SupportsSecretText(); |
|
18730 |
if( !bSecret ) |
|
18731 |
{ |
|
18732 |
//test java editor |
|
18733 |
MObjectProvider* mop = iInputCapabilities.ObjectProvider(); |
|
18734 |
if ( mop ) |
|
18735 |
{ |
|
18736 |
CAknExtendedInputCapabilities* extendedInputCapabilities; |
|
18737 |
extendedInputCapabilities = mop->MopGetObject( extendedInputCapabilities ); |
|
18738 |
if ( extendedInputCapabilities ) |
|
18739 |
{ |
|
18740 |
TUint constraints = extendedInputCapabilities->MIDPConstrainst(); |
|
18741 |
if( constraints & 0x10000 ) |
|
18742 |
{ |
|
18743 |
bSecret = ETrue; |
|
18744 |
} |
|
18745 |
} |
|
18746 |
} |
|
18747 |
} |
|
18748 |
||
18749 |
return bSecret; |
|
18750 |
} |
|
18751 |
||
18752 |
void CAknFepManager::SendEventsToPluginManL( TInt aEventType, TInt aEventData ) |
|
18753 |
{ |
|
18754 |
#ifdef RD_SCALABLE_UI_V2 |
|
18755 |
if ( iFepFullyConstructed ) |
|
18756 |
{ |
|
18757 |
iFepPluginManager->HandleEventsFromFepL( aEventType, aEventData ); |
|
18758 |
} |
|
18759 |
#endif //RD_SCALABLE_UI_V2 |
|
18760 |
} |
|
18761 |
||
18762 |
void CAknFepManager::UpdateCangJieState(TInt aNewMode) |
|
18763 |
{ |
|
18764 |
CAknFepUIManagerChinese* fepUiMgr = STATIC_CAST(CAknFepUIManagerChinese*, |
|
18765 |
iLangMan->GetFepUI(ECangJie, ENoneWidthChar, EFalse)); |
|
18766 |
||
18767 |
if (aNewMode >= 0) |
|
18768 |
{ |
|
18769 |
if ( fepUiMgr ) |
|
18770 |
{ |
|
18771 |
fepUiMgr->UpdateCangJieState(); |
|
18772 |
} |
|
18773 |
||
18774 |
// Store CangJie settings into the sharedata |
|
18775 |
iSharedDataInterface->SetCangJieMode(aNewMode); |
|
18776 |
} |
|
18777 |
} |
|
18778 |
||
18779 |
TInt CAknFepManager::LaunchCangJieOptionDlgL() |
|
18780 |
{ |
|
18781 |
// Get the CangJie level from the GS |
|
18782 |
TInt currentLevel = iSharedDataInterface->CangJieMode(); |
|
18783 |
||
18784 |
if ((currentLevel != ECangJieNormal) |
|
18785 |
&& (currentLevel != ECangJieEasy) |
|
18786 |
&& (currentLevel != ECangJieAdvanced)) |
|
18787 |
return KErrGeneral; |
|
18788 |
||
18789 |
// Launch the CangJie setting menu |
|
18790 |
CDesCArrayFlat* items = CCoeEnv::Static()->ReadDesC16ArrayResourceL(R_AVKON_CANGJIE_OPTIONS_LBX); |
|
18791 |
CleanupStack::PushL(items); |
|
18792 |
||
18793 |
TUid fepUid = CCoeEnv::Static()->FepUid(); |
|
18794 |
ClearExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
18795 |
TInt ret = iUiInterface->LaunchCangJieOptionDlgL( |
|
18796 |
R_AVKON_CANGJIE_MODE_OPTIONS_SETTING_PAGE, |
|
18797 |
currentLevel, |
|
18798 |
items |
|
18799 |
); |
|
18800 |
PrepareFepAfterDialogExitL(fepUid); |
|
18801 |
||
18802 |
CleanupStack::PopAndDestroy(items); |
|
18803 |
||
18804 |
return ret ? currentLevel : KErrGeneral; |
|
18805 |
} |
|
18806 |
||
18807 |
GLDEF_C void AknFepPanic(TAknFepPanic aPanic) |
|
18808 |
{ |
|
18809 |
User::Panic(_L("AKNFEP"),aPanic); |
|
18810 |
} |
|
18811 |
||
18812 |
/** |
|
18813 |
* Set Multitap timer value. |
|
18814 |
* |
|
18815 |
* @since 3.0 |
|
18816 |
* @param Value of KAknFepMultiTapTimer setting |
|
18817 |
*/ |
|
18818 |
void CAknFepManager::SetMultiTapTimer(const TInt aMultiTapTimer) |
|
18819 |
{ |
|
18820 |
if (iMultiTapTimer != aMultiTapTimer) |
|
18821 |
{ |
|
18822 |
iMultiTapTimer = aMultiTapTimer; |
|
18823 |
} |
|
18824 |
} |
|
18825 |
||
18826 |
/** |
|
18827 |
* Set Japanese Qwerty Flags value. |
|
18828 |
* |
|
18829 |
* @since 3.0 |
|
18830 |
* @param Value of KAknFepJapaneseSpecialCharFlag setting |
|
18831 |
*/ |
|
18832 |
void CAknFepManager::SetJapaneseQwertyFlags(const TInt aJapaneseQwertyFlags) |
|
18833 |
{ |
|
18834 |
if (iJapaneseQwertyFlags != aJapaneseQwertyFlags) |
|
18835 |
{ |
|
18836 |
iJapaneseQwertyFlags = aJapaneseQwertyFlags; |
|
18837 |
} |
|
18838 |
} |
|
18839 |
||
18840 |
/** |
|
18841 |
* Handle the Chr Key Monitor |
|
18842 |
* for Japanese variant only. |
|
18843 |
* |
|
18844 |
* @since 3.0 |
|
18845 |
* @return KErrNone if succeed, KErrDied if failed |
|
18846 |
*/ |
|
18847 |
TInt CAknFepManager::HandleChrKeyMonitorCallback(TAny* aObj) |
|
18848 |
{ |
|
18849 |
TRAPD(err, static_cast<CAknFepManager*>(aObj)->HandleChrKeyMonitorL()); |
|
18850 |
if (err) |
|
18851 |
{ |
|
18852 |
static_cast<CAknFepManager*>(aObj)->CleanUpFep(); |
|
18853 |
return KErrDied; |
|
18854 |
} |
|
18855 |
return KErrNone; |
|
18856 |
} |
|
18857 |
||
18858 |
/** |
|
18859 |
* Handle the Chr Key Monitor |
|
18860 |
* for Japanese variant only. |
|
18861 |
* |
|
18862 |
* @since 3.0 |
|
18863 |
*/ |
|
18864 |
void CAknFepManager::HandleChrKeyMonitorL() |
|
18865 |
{ |
|
18866 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
18867 |
#ifdef __HALF_QWERTY_KEYPAD |
|
18868 |
if ( IsFlagSet(EFlagQwertyChrKeyDepressed) && |
|
18869 |
IsFlagSet(EFlagNoActionDuringChrKeyPress) && |
|
18870 |
(EPtiKeyboardHalfQwerty == KeyboardLayout() ) && |
|
18871 |
( iWesternPredictive || iMode == EPinyin || |
|
18872 |
iMode == EStroke || iMode == EZhuyin ) ) |
|
18873 |
{ |
|
18874 |
// Clear the chr key depressed flag |
|
18875 |
TBool validchr = FepUI()->IsValidLongChrKeyPress(); |
|
18876 |
||
18877 |
if(!validchr || !IsAbleToLaunchSCT() ) |
|
18878 |
{ |
|
18879 |
FepUI()->HandleKeyL( EStdKeyLeftFunc, EShortKeyPress ); |
|
18880 |
ClearFlag( EFlagQwertyChrKeyDepressed | EFlagNoActionDuringChrKeyPress); |
|
18881 |
} |
|
18882 |
else |
|
18883 |
{ |
|
18884 |
// will launch SCT later |
|
18885 |
iChrLongKeyPress = ETrue; |
|
18886 |
} |
|
18887 |
||
18888 |
} |
|
18889 |
else |
|
18890 |
#endif |
|
18891 |
#endif |
|
18892 |
if (IsFlagSet(EFlagQwertyChrKeyDepressed) && IsFlagSet(EFlagNoActionDuringChrKeyPress) |
|
18893 |
&& iCurrentFepUI->IsValidShiftKeyPress()) |
|
18894 |
{ |
|
18895 |
// Timer cancel |
|
18896 |
iChrKeypressMonitor->Cancel(); |
|
18897 |
// Commit characters |
|
18898 |
HandleChangeInFocus(); |
|
18899 |
// Clear flags |
|
18900 |
ClearFlag(EFlagQwertyChrKeyDepressed | EFlagNoActionDuringChrKeyPress); |
|
18901 |
// Open editting menu |
|
18902 |
LaunchSelectModeMenuL(); |
|
18903 |
} |
|
18904 |
} |
|
18905 |
||
18906 |
||
18907 |
// ----------------------------------------------------------------------------- |
|
18908 |
// CAknFepManager::SetCursorSelectionL |
|
18909 |
// Set editor cursor selection. |
|
18910 |
// (other items were commented in a header). |
|
18911 |
// ----------------------------------------------------------------------------- |
|
18912 |
// |
|
18913 |
void CAknFepManager::SetCursorSelectionL(const TCursorSelection& /*aCurSel*/, TBool /*aSyncCursor*/) |
|
18914 |
{ |
|
18915 |
} |
|
18916 |
||
18917 |
TInt CAknFepManager::HandleResourceChangedCallback(TAny* aObj) |
|
18918 |
{ |
|
18919 |
TRAPD(err, static_cast<CAknFepManager*>(aObj)->ResourceChangedTimeroutL()); |
|
18920 |
if (err) |
|
18921 |
{ |
|
18922 |
static_cast<CAknFepManager*>(aObj)->CleanUpFep(); |
|
18923 |
return KErrNoMemory; |
|
18924 |
} |
|
18925 |
return KErrNone; |
|
18926 |
} |
|
18927 |
||
18928 |
void CAknFepManager::ResourceChangedTimeroutL() |
|
18929 |
{ |
|
18930 |
if(iCurrentFepUI) |
|
18931 |
{ |
|
18932 |
iCurrentFepUI->ResourceChanged(1); |
|
18933 |
} |
|
18934 |
} |
|
18935 |
||
18936 |
||
18937 |
// ----------------------------------------------------------------------------- |
|
18938 |
// pen related inplementation |
|
18939 |
// ----------------------------------------------------------------------------- |
|
18940 |
#ifdef RD_SCALABLE_UI_V2 |
|
18941 |
||
18942 |
// ----------------------------------------------------------------------------- |
|
18943 |
// CAknFepManager::HandleLayoutChange |
|
18944 |
// Update plugin UI case mode. |
|
18945 |
// (other items were commented in a header). |
|
18946 |
// ----------------------------------------------------------------------------- |
|
18947 |
// |
|
18948 |
void CAknFepManager::HandleResourceChange(TInt aType) |
|
18949 |
{ |
|
18950 |
if(iCurrentFepUI) |
|
18951 |
{ |
|
18952 |
iAsyncResouceChanged.CallBack(); |
|
18953 |
} |
|
18954 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
18955 |
||
18956 |
if(aType == KEikDynamicLayoutVariantSwitch) |
|
18957 |
{ |
|
18958 |
if ( iAvkonAppUi->IsDisplayingDialog() && iMatchesListLaunched ) |
|
18959 |
{ |
|
18960 |
iUiInterface->DeleteDialogs(); |
|
18961 |
} |
|
18962 |
||
18963 |
//When there is a change of layout, the inline text position changes and hence the candidate |
|
18964 |
//list position also needs to change accordingly. |
|
18965 |
//We need the editor to be brought back to focus, this is because we need the position of |
|
18966 |
//the inline text. |
|
18967 |
if( iCandidatePopup && iPtiEngine ) |
|
18968 |
{ |
|
18969 |
iCandidatePopup->UnFocus(); |
|
18970 |
//Need to get the editor state back after it is brought back to focus. |
|
18971 |
TRAP_IGNORE( HandleChangeInFocusL()); |
|
18972 |
||
18973 |
// Add candidate list control stack to get the layout change event |
|
18974 |
// after dialog control...... |
|
18975 |
TRAP_IGNORE( iCandidatePopup->SetFocusAddStackReducePriorityL() ); |
|
18976 |
} |
|
18977 |
} |
|
18978 |
#endif |
|
18979 |
TRAP_IGNORE(SendEventsToPluginManL( EPluginResourceChanged, aType )); |
|
18980 |
} |
|
18981 |
void CAknFepManager::HandlePointerEventL(const TPointerEvent& aPointerEvent) |
|
18982 |
{ |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
18983 |
if ( IsFlagSet( CAknFepManager::EFlagNoMatches ) ) |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
18984 |
{ |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
18985 |
// Set this flag to launch spell mode on split itut |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
18986 |
SetExtendedFlag( EExtendedFlagPointInNoMatchEditor ); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
18987 |
ClearFlag(CAknFepManager::EFlagNoMatches); |
44 | 18988 |
} |
18989 |
||
18990 |
if(aPointerEvent.iType == TPointerEvent::EDrag) |
|
18991 |
{ |
|
18992 |
SetExtendedFlag(EExtendedFlagPointerEventTypeEDrag); |
|
18993 |
} |
|
18994 |
if (aPointerEvent.iType == TPointerEvent::EButton1Up) |
|
18995 |
{ |
|
18996 |
ClearExtendedFlag(EExtendedFlagPointerEventTypeEDrag); |
|
18997 |
||
18998 |
// Remember last up-click in case it is needed for displaying |
|
18999 |
// stylus ccpu-menu. |
|
19000 |
iClickPoint = aPointerEvent.iPosition; |
|
19001 |
} |
|
19002 |
} |
|
19003 |
||
19004 |
// ----------------------------------------------------------------------------- |
|
19005 |
// CAknFepManager::HandleSelModeArrowKeyEventL |
|
19006 |
// Set text selection when tap on the arrow keys. |
|
19007 |
// (other items were commented in a header). |
|
19008 |
// ----------------------------------------------------------------------------- |
|
19009 |
// |
|
19010 |
TBool CAknFepManager::HandleSelModeArrowKeyEventL(const TKeyEvent& aKeyEvent, |
|
19011 |
TEventCode aEventCode, |
|
19012 |
TKeyResponse& aRetCode) |
|
19013 |
{ |
|
19014 |
aRetCode = EKeyWasNotConsumed; |
|
19015 |
TBool used = EFalse; |
|
19016 |
||
19017 |
// only arrow keys are potentially handled |
|
19018 |
if ( ( aKeyEvent.iScanCode == EStdKeyLeftArrow |
|
19019 |
|| aKeyEvent.iScanCode == EStdKeyRightArrow ) |
|
19020 |
&& iInputCapabilities.FepAwareTextEditor() ) |
|
19021 |
{ |
|
19022 |
TInt inputMode = PluginInputMode(); |
|
19023 |
TBool isArabicFingerHwr = ( inputMode == EPluginInputModeFingerHwr && |
|
19024 |
GetInputLanguageFromSharedDataInterface() == ELangArabic ); |
|
19025 |
TCursorSelection currentEditorSelection( 0, 0 ); |
|
19026 |
||
19027 |
iInputCapabilities.FepAwareTextEditor()-> |
|
19028 |
GetCursorSelectionForFep( currentEditorSelection ); |
|
19029 |
||
19030 |
if ( !IsMfneEditor() && ( inputMode == EPluginInputModeItut || |
|
19031 |
inputMode == EPluginInputModeFSQ || |
|
19032 |
inputMode == EPluginInputModePortraitFSQ || |
|
19033 |
isArabicFingerHwr ) |
|
19034 |
&& currentEditorSelection.Length() != 0 ) |
|
19035 |
{ |
|
19036 |
used = ETrue; |
|
19037 |
||
19038 |
if ( !( aKeyEvent.iModifiers & EModifierShift ) ) |
|
19039 |
{ |
|
19040 |
TKeyEvent ccpuStart = aKeyEvent; |
|
19041 |
ccpuStart.iModifiers |= EModifierShift; |
|
19042 |
ccpuStart.iModifiers |= EModifierRightShift; |
|
19043 |
CCoeEnv::Static()->SimulateKeyEventL( ccpuStart, aEventCode ); |
|
19044 |
aRetCode = EKeyWasConsumed; |
|
19045 |
} |
|
19046 |
} |
|
19047 |
} |
|
19048 |
||
19049 |
return used; |
|
19050 |
} |
|
19051 |
||
19052 |
#else // !RD_SCALABLE_UI_V2 |
|
19053 |
// ----------------------------------------------------------------------------- |
|
19054 |
// CAknFepManager::HandleResourceChange |
|
19055 |
// Update plugin UI case mode. |
|
19056 |
// (other items were commented in a header). |
|
19057 |
// ----------------------------------------------------------------------------- |
|
19058 |
// |
|
19059 |
void CAknFepManager::HandleResourceChange(TInt aType) |
|
19060 |
{ |
|
19061 |
if (iFepFullyConstructed && Japanese() ) |
|
19062 |
{ |
|
19063 |
// Japaneseinput should handle the event of changing layout or screen. |
|
19064 |
FepUI()->ResourceChanged(aType); |
|
19065 |
} |
|
19066 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
19067 |
if(iCandidatePopup && iPtiEngine && (aType == KEikDynamicLayoutVariantSwitch)) |
|
19068 |
{ |
|
19069 |
//When there is a change of layout, the inline text position changes and hence the candidate |
|
19070 |
//list position also needs to change accordingly. |
|
19071 |
//We need the editor to be brought back to focus, this is because we need the position of |
|
19072 |
//the inline text. |
|
19073 |
iCandidatePopup->UnFocus(); |
|
19074 |
//Need to get the editor state back after it is brought back to focus. |
|
19075 |
TRAP_IGNORE(HandleChangeInFocusL()); |
|
19076 |
//Can not do anything if FEP is not constructed fully |
|
19077 |
if(iFepFullyConstructed) |
|
19078 |
{ |
|
19079 |
//Now we read the position of the inline text |
|
19080 |
TPoint inlineEditorTl; |
|
19081 |
TPoint inlineEditorBr; |
|
19082 |
TInt height; |
|
19083 |
TInt ascent; |
|
19084 |
TInt documentOffset = iPtiEngine->CurrentWord().Length(); |
|
19085 |
// Popup Position for RTL |
|
19086 |
if(iLanguageCapabilities.iRightToLeftLanguage) |
|
19087 |
documentOffset = 0; |
|
19088 |
// Popup Position for RTL |
|
19089 |
TRAP_IGNORE( GetScreenCoordinatesL( inlineEditorTl, height, ascent, documentOffset )); |
|
19090 |
inlineEditorTl.iY -= height; |
|
19091 |
TRAP_IGNORE( GetScreenCoordinatesL( inlineEditorBr, height, ascent )); |
|
19092 |
||
19093 |
//Let the candidate list know about a change of resource and update the |
|
19094 |
//inline text rectangle. |
|
19095 |
//Now show the candidate list at the re-calculated position |
|
19096 |
iCandidatePopup->ShowAtNewPosition(TRect(inlineEditorTl,inlineEditorBr)); |
|
19097 |
} |
|
19098 |
} |
|
19099 |
#endif |
|
19100 |
} |
|
19101 |
||
19102 |
#endif //RD_SCALABLE_UI_V2 |
|
19103 |
||
19104 |
TDigitType CAknFepManager::LocalDigit() |
|
19105 |
{ |
|
19106 |
return iLanguageCapabilities.iLocalDigitType; |
|
19107 |
} |
|
19108 |
||
19109 |
/** |
|
19110 |
* Returns ETrue if arabic indic digit setting is on. |
|
19111 |
* |
|
19112 |
* @since 3.0 |
|
19113 |
*/ |
|
19114 |
TBool CAknFepManager::ArabicIndicDigitsInUse() const |
|
19115 |
{ |
|
19116 |
return (iLanguageCapabilities.iLocalDigitType == EDigitTypeArabicIndic); |
|
19117 |
} |
|
19118 |
||
19119 |
TBool CAknFepManager::EasternArabicIndicDigitsInUse() const |
|
19120 |
{ |
|
19121 |
return (iLanguageCapabilities.iLocalDigitType == EDigitTypeEasternArabicIndic); |
|
19122 |
} |
|
19123 |
||
19124 |
/** |
|
19125 |
* Sets delayed commit on (predicitve word will be commited in |
|
19126 |
* next call to TryCloseUiL. This is needed because of Japanese ReadingTextL). |
|
19127 |
* |
|
19128 |
* @since 3.1 |
|
19129 |
*/ |
|
19130 |
void CAknFepManager::SetDelayedCommit() |
|
19131 |
{ |
|
19132 |
iCcpuMode |= ECcpuStataCommitPredictiveWord; |
|
19133 |
} |
|
19134 |
||
19135 |
// ----------------------------------------------------------------------------- |
|
19136 |
// CAknFepManager::SetDefaultNumberMode |
|
19137 |
// |
|
19138 |
// Set default number mode for non-latin languagues |
|
19139 |
// |
|
19140 |
// Copied from CGSLangModel::SetDefaultNumberMode |
|
19141 |
// ----------------------------------------------------------------------------- |
|
19142 |
// |
|
19143 |
void CAknFepManager::SetDefaultNumberMode( TInt aMode, TInt aNbrModeType ) |
|
19144 |
{ |
|
19145 |
//As aMode comes from the UI, it can either be 0 or 1. This needs |
|
19146 |
//special handling for Indic mode as it has been defined as an enum |
|
19147 |
//constant and has a value of 2. This applies to any values defined |
|
19148 |
//in the enum and have a value > 1. |
|
19149 |
if ( aNbrModeType == ENbrModeTypeArabic || |
|
19150 |
aNbrModeType == ENbrModeTypeEasternArabic ) |
|
19151 |
{ |
|
19152 |
iSharedDataInterface->SetDefaultNumberMode( KSettingsDefaultNumberMode, aMode ); |
|
19153 |
} |
|
19154 |
else |
|
19155 |
{ |
|
19156 |
iSharedDataInterface->SetDefaultNumberMode( KSettingsIndicDefaultNumberMode, aMode ); |
|
19157 |
} |
|
19158 |
||
19159 |
TLocale locale; |
|
19160 |
if ( aMode == ENbrModeLatin ) |
|
19161 |
{ |
|
19162 |
locale.SetDigitType( EDigitTypeWestern ); |
|
19163 |
} |
|
19164 |
else |
|
19165 |
{ |
|
19166 |
//if aMode != EGSNbrModeLatin, then it should be either latin or arabic. However |
|
19167 |
//as EGSNbrModeArabic and EGsNbrModeIndic both have a value = 1, we can't use |
|
19168 |
//that constant for below comparison. Hence, need to depend on the 2nd param. |
|
19169 |
switch ( aNbrModeType ) |
|
19170 |
{ |
|
19171 |
case ENbrModeTypeArabic: |
|
19172 |
locale.SetDigitType( EDigitTypeArabicIndic ); |
|
19173 |
break; |
|
19174 |
case ENbrModeTypeIndic: |
|
19175 |
locale.SetDigitType( EDigitTypeDevanagari ); |
|
19176 |
break; |
|
19177 |
case ENbrModeTypeEasternArabic: |
|
19178 |
locale.SetDigitType( EDigitTypeEasternArabicIndic ); |
|
19179 |
break; |
|
19180 |
default: |
|
19181 |
break; |
|
19182 |
} |
|
19183 |
} |
|
19184 |
||
19185 |
locale.Set(); |
|
19186 |
} |
|
19187 |
||
19188 |
// ----------------------------------------------------------------------------- |
|
19189 |
// CAknFepManager::ResolveCurrentCandidateListIndex |
|
19190 |
// |
|
19191 |
// Calculates correct selection index for matches popup list. |
|
19192 |
// ----------------------------------------------------------------------------- |
|
19193 |
// |
|
19194 |
TInt CAknFepManager::ResolveCurrentCandidateListIndex(CDesCArrayFlat* aCandList) |
|
19195 |
{ |
|
19196 |
if (iPtiEngine && aCandList) |
|
19197 |
{ |
|
19198 |
TBuf<EMaximumFepWordLength> currentCand; |
|
19199 |
||
19200 |
currentCand.Copy(iPtiEngine->CurrentWord()); |
|
19201 |
for (TInt i = 0; i < aCandList->Count(); i++) |
|
19202 |
{ |
|
19203 |
if (currentCand == aCandList->MdcaPoint(i)) |
|
19204 |
{ |
|
19205 |
if (i == aCandList->Count() - 1) |
|
19206 |
{ |
|
19207 |
return 0; |
|
19208 |
} |
|
19209 |
return i + 1; |
|
19210 |
} |
|
19211 |
} |
|
19212 |
} |
|
19213 |
||
19214 |
return 0; |
|
19215 |
} |
|
19216 |
||
19217 |
void CAknFepManager::AlignLogicalAndVisualCursorL( TTmDocPosSpec::TType aType, |
|
19218 |
TBool aToLeft ) |
|
19219 |
{ |
|
19220 |
if( !( iInputCapabilities.SupportsSecretText() ) ) |
|
19221 |
{ |
|
19222 |
if( IsFlagSet( EFlagInsideInlineEditingTransaction ) && |
|
19223 |
IsFlagSet( EFlagInsideMultitapInlineEditingTransaction ) ) |
|
19224 |
{ |
|
19225 |
CommitInlineEditL(); |
|
19226 |
} |
|
19227 |
||
19228 |
MCoeFepAwareTextEditor* fepAwareTextEditor = |
|
19229 |
iInputCapabilities.FepAwareTextEditor(); |
|
19230 |
||
19231 |
MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
19232 |
if( (docNavi || TextLayout()) && fepAwareTextEditor ) |
|
19233 |
{ |
|
19234 |
TTmDocPosSpec pos = DocPos(); |
|
19235 |
pos.iType = aType; |
|
19236 |
TTmPosInfo2 info; |
|
19237 |
if (docNavi) |
|
19238 |
{ |
|
19239 |
docNavi->GetNextVisualCursorPos( pos, info, aToLeft ); |
|
19240 |
} |
|
19241 |
else |
|
19242 |
{ |
|
19243 |
TextLayout()->TagmaTextLayout().GetNextVisualCursorPos( pos, info, aToLeft ); |
|
19244 |
} |
|
19245 |
TCursorSelection curSel( info.iDocPos.iPos, info.iDocPos.iPos ); |
|
19246 |
fepAwareTextEditor->SetCursorSelectionForFepL( curSel ); |
|
19247 |
} |
|
19248 |
} |
|
19249 |
} |
|
19250 |
||
19251 |
void CAknFepManager::RemoveRephaCharacterL() |
|
19252 |
{ |
|
19253 |
MCoeFepAwareTextEditor* fepAwareTextEditor = |
|
19254 |
iInputCapabilities.FepAwareTextEditor(); |
|
19255 |
||
19256 |
if( fepAwareTextEditor ) |
|
19257 |
{ |
|
19258 |
TInt previousCharPos = 0; |
|
19259 |
TBool leftFlag = GetNextVisualLeftCharacter( previousCharPos ); |
|
19260 |
||
19261 |
if( !leftFlag ) |
|
19262 |
{ |
|
19263 |
return; |
|
19264 |
} |
|
19265 |
||
19266 |
TCursorSelection curSel; |
|
19267 |
fepAwareTextEditor->GetCursorSelectionForFep( curSel ); |
|
19268 |
||
19269 |
TInt lowerPos = curSel.LowerPos(); |
|
19270 |
if( lowerPos > 1 ) |
|
19271 |
{ |
|
19272 |
const TInt rephaLength( 2 ); |
|
19273 |
TBuf<rephaLength> previousCharacter; |
|
19274 |
previousCharacter.FillZ(); |
|
19275 |
||
19276 |
fepAwareTextEditor-> |
|
19277 |
GetEditorContentForFep( previousCharacter, |
|
19278 |
previousCharPos, rephaLength ); |
|
19279 |
||
19280 |
if (rephaLength == previousCharacter.Length()) |
|
19281 |
{ |
|
19282 |
if( previousCharacter[0] == TAknFepUiIndicInputManager::RaCharacter( |
|
19283 |
TLanguage( iLanguageCapabilities.iInputLanguageCode ) ) && |
|
19284 |
previousCharacter[1] == TAknFepUiIndicInputManager::Virama( |
|
19285 |
TLanguage( iLanguageCapabilities.iInputLanguageCode ) ) ) |
|
19286 |
{ |
|
19287 |
curSel.iAnchorPos = previousCharPos; |
|
19288 |
curSel.iCursorPos = previousCharPos + rephaLength; |
|
19289 |
||
19290 |
// Remove the repha |
|
19291 |
||
19292 |
if( IsFlagSet( EFlagInsideInlineEditingTransaction ) && |
|
19293 |
IsFlagSet( EFlagInsideMultitapInlineEditingTransaction ) ) |
|
19294 |
{ |
|
19295 |
CommitInlineEditL(); |
|
19296 |
} |
|
19297 |
StartInlineEditL( curSel, previousCharacter, rephaLength, ETrue ); |
|
19298 |
UpdateInlineEditL( KNullDesC, 0 ); |
|
19299 |
CommitInlineEditL(); |
|
19300 |
||
19301 |
// Go to the visual right position of current ligature as the |
|
19302 |
// repha has been deleted. |
|
19303 |
AlignLogicalAndVisualCursorL( TTmDocPosSpec::ELeading, EFalse ); |
|
19304 |
} |
|
19305 |
} |
|
19306 |
} |
|
19307 |
} |
|
19308 |
} |
|
19309 |
||
19310 |
TBool CAknFepManager::IsRephaPresent() |
|
19311 |
{ |
|
19312 |
TBool result = EFalse; |
|
19313 |
||
19314 |
MCoeFepAwareTextEditor* fepAwareTextEditor = |
|
19315 |
iInputCapabilities.FepAwareTextEditor(); |
|
19316 |
||
19317 |
if( fepAwareTextEditor ) |
|
19318 |
{ |
|
19319 |
TCursorSelection curSel; |
|
19320 |
||
19321 |
fepAwareTextEditor->GetCursorSelectionForFep( curSel ); |
|
19322 |
||
19323 |
TInt previousCharPos = 0; |
|
19324 |
TBool leftFlag = GetNextVisualLeftCharacter( previousCharPos ); |
|
19325 |
||
19326 |
if( !leftFlag ) |
|
19327 |
{ |
|
19328 |
return result; |
|
19329 |
} |
|
19330 |
||
19331 |
TInt lowerPos = curSel.LowerPos(); |
|
19332 |
if( lowerPos > 1 ) |
|
19333 |
{ |
|
19334 |
const TInt rephaLength( 2 ); |
|
19335 |
TBuf<rephaLength> previousCharacter; |
|
19336 |
previousCharacter.FillZ(); |
|
19337 |
||
19338 |
fepAwareTextEditor-> |
|
19339 |
GetEditorContentForFep( previousCharacter, |
|
19340 |
previousCharPos, rephaLength ); |
|
19341 |
||
19342 |
// Verify whether the length of the string is equal to the length |
|
19343 |
// of repha before doing further checks. |
|
19344 |
if( previousCharacter.Length() == rephaLength ) |
|
19345 |
{ |
|
19346 |
if( previousCharacter[0] == TAknFepUiIndicInputManager::RaCharacter( |
|
19347 |
TLanguage( iLanguageCapabilities.iInputLanguageCode ) ) && |
|
19348 |
previousCharacter[1] == TAknFepUiIndicInputManager::Virama( |
|
19349 |
TLanguage( iLanguageCapabilities.iInputLanguageCode ) ) ) |
|
19350 |
{ |
|
19351 |
result = ETrue; |
|
19352 |
} |
|
19353 |
} |
|
19354 |
} |
|
19355 |
} |
|
19356 |
||
19357 |
return result; |
|
19358 |
} |
|
19359 |
||
19360 |
TText CAknFepManager::PreviousToPreviousChar( TBool aContextSensitive ) |
|
19361 |
{ |
|
19362 |
TBuf<ESingleCharacter> prevToPrevChar( ESingleCharacter ); |
|
19363 |
prevToPrevChar.FillZ(); |
|
19364 |
||
19365 |
if( !aContextSensitive ) |
|
19366 |
{ |
|
19367 |
TTmDocPosSpec pos = DocPos(); |
|
19368 |
||
19369 |
// Pos=0 means it is before the first character and there is no previous character |
|
19370 |
if (pos.iPos > 0 ) |
|
19371 |
{ |
|
19372 |
if( iInputCapabilities.FepAwareTextEditor() ) |
|
19373 |
{ |
|
19374 |
iInputCapabilities.FepAwareTextEditor()-> |
|
19375 |
GetEditorContentForFep( prevToPrevChar, pos.iPos - 1, ESingleCharacter ); |
|
19376 |
} |
|
19377 |
} |
|
19378 |
} |
|
19379 |
else |
|
19380 |
{ |
|
19381 |
TCursorSelection curSel; |
|
19382 |
||
19383 |
MCoeFepAwareTextEditor* fepAwareTextEditor = |
|
19384 |
iInputCapabilities.FepAwareTextEditor(); |
|
19385 |
||
19386 |
if( fepAwareTextEditor ) |
|
19387 |
{ |
|
19388 |
fepAwareTextEditor->GetCursorSelectionForFep( curSel ); |
|
19389 |
TInt lowerpos = curSel.LowerPos(); |
|
19390 |
||
19391 |
if( lowerpos > 1 ) |
|
19392 |
{ |
|
19393 |
fepAwareTextEditor-> |
|
19394 |
GetEditorContentForFep( prevToPrevChar, lowerpos - 2, ESingleCharacter ); |
|
19395 |
} |
|
19396 |
} |
|
19397 |
} |
|
19398 |
if (prevToPrevChar.Length()) |
|
19399 |
return prevToPrevChar[0]; |
|
19400 |
else |
|
19401 |
return NULL; |
|
19402 |
} |
|
19403 |
||
19404 |
void CAknFepManager::RemoveRakarCharacterL() |
|
19405 |
{ |
|
19406 |
MCoeFepAwareTextEditor* fepAwareTextEditor = |
|
19407 |
iInputCapabilities.FepAwareTextEditor(); |
|
19408 |
||
19409 |
if( fepAwareTextEditor ) |
|
19410 |
{ |
|
19411 |
TCursorSelection curSel; |
|
19412 |
||
19413 |
fepAwareTextEditor->GetCursorSelectionForFep( curSel ); |
|
19414 |
||
19415 |
TInt lowerpos = curSel.LowerPos(); |
|
19416 |
||
19417 |
if( lowerpos > 1 ) |
|
19418 |
{ |
|
19419 |
const TInt rakarLength( 2 ); |
|
19420 |
TBuf<rakarLength> buffer; |
|
19421 |
buffer.FillZ(); |
|
19422 |
||
19423 |
fepAwareTextEditor-> |
|
19424 |
GetEditorContentForFep( buffer, lowerpos - rakarLength, rakarLength ); |
|
19425 |
||
19426 |
if (rakarLength == buffer.Length()) |
|
19427 |
{ |
|
19428 |
if( buffer[0] == TAknFepUiIndicInputManager::Virama( |
|
19429 |
TLanguage( iLanguageCapabilities.iInputLanguageCode ) ) && |
|
19430 |
buffer[1] == TAknFepUiIndicInputManager::RaCharacter( |
|
19431 |
TLanguage( iLanguageCapabilities.iInputLanguageCode ) ) ) |
|
19432 |
{ |
|
19433 |
curSel.iAnchorPos = lowerpos - rakarLength; |
|
19434 |
curSel.iCursorPos = lowerpos; |
|
19435 |
||
19436 |
// Remove the repha |
|
19437 |
||
19438 |
if( IsFlagSet( EFlagInsideInlineEditingTransaction ) && |
|
19439 |
IsFlagSet( EFlagInsideMultitapInlineEditingTransaction ) ) |
|
19440 |
{ |
|
19441 |
CommitInlineEditL(); |
|
19442 |
} |
|
19443 |
StartInlineEditL( curSel, buffer, rakarLength, ETrue ); |
|
19444 |
UpdateInlineEditL( KNullDesC, 0 ); |
|
19445 |
CommitInlineEditL(); |
|
19446 |
} |
|
19447 |
} |
|
19448 |
} |
|
19449 |
} |
|
19450 |
} |
|
19451 |
||
19452 |
/** |
|
19453 |
* Returns the status of predictive input. |
|
19454 |
* |
|
19455 |
* @since 3.2 |
|
19456 |
* @return ETrue is available predictive input. |
|
19457 |
*/ |
|
19458 |
TBool CAknFepManager::IsAbleToChangePrediction() const |
|
19459 |
{ |
|
19460 |
TBool ret = EFalse; |
|
19461 |
if (!(iAknEditorFlags & EAknEditorFlagNoT9)) |
|
19462 |
{ |
|
19463 |
if (iMode == EHiraganaKanji) |
|
19464 |
{ |
|
19465 |
if (HasJapanesePredictionInputMode()) |
|
19466 |
{ |
|
19467 |
ret = ETrue; |
|
19468 |
} |
|
19469 |
} |
|
19470 |
else |
|
19471 |
{ |
|
19472 |
ret = ETrue; |
|
19473 |
} |
|
19474 |
} |
|
19475 |
return ret; |
|
19476 |
} |
|
19477 |
||
19478 |
TLanguage CAknFepManager :: GetInputLanguageFromSharedDataInterface() |
|
19479 |
{ |
|
19480 |
return ((TLanguage)(iSharedDataInterface->InputTextLanguage())); |
|
19481 |
} |
|
19482 |
||
19483 |
||
19484 |
void CAknFepManager::DeactivatePredicitveWordAndMoveCursorL() |
|
19485 |
{ |
|
19486 |
if (WesternPredictive()) |
|
19487 |
{ |
|
19488 |
TWesternNaviEvent naviEvent = ERightNaviEvent; |
|
19489 |
||
19490 |
if (iLanguageCapabilities.iRightToLeftLanguage) |
|
19491 |
{ |
|
19492 |
naviEvent = ELeftNaviEvent; |
|
19493 |
} |
|
19494 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
19495 |
// This function is called at time of Cut/Copy command |
|
19496 |
// TryCloseUiL will remove the auto completion part |
|
19497 |
// To adjust the visual cursor position commit the text with |
|
19498 |
// auto completion part. |
|
19499 |
if( IsAutoCompleteOn()) |
|
19500 |
{ |
|
19501 |
TInt tailLength = 0; |
|
19502 |
iPtiEngine->HandleCommandL( EPtiCommandGetAutoCompletionTailLength, &tailLength ); |
|
19503 |
||
19504 |
if( tailLength > 0) |
|
19505 |
{ |
|
19506 |
// Sync the key sequence and editor text. |
|
19507 |
iPtiEngine->HandleCommandL( EPtiCommandLockCurrentCandidate ); |
|
19508 |
} |
|
19509 |
} |
|
19510 |
#endif |
|
19511 |
||
19512 |
// Find the visual left/right end of the current word |
|
19513 |
TTmDocPosSpec pos; |
|
19514 |
GetAvkonDefinedVisualLimitsOfSelection( |
|
19515 |
iUncommittedText, naviEvent, pos, NULL ); |
|
19516 |
||
19517 |
TryCloseUiL(); |
|
19518 |
||
19519 |
// Position should be dis-ambiguated based on last navigation and direction of blocks. |
|
19520 |
AdjustPosSpecForAmbiguityAfterLeftOrRightNavigation( pos, naviEvent ); |
|
19521 |
||
19522 |
SetCursorPositionL( pos ); |
|
19523 |
||
19524 |
iCaseMan->UpdateCase(ENullNaviEvent); |
|
19525 |
} |
|
19526 |
} |
|
19527 |
||
19528 |
||
19529 |
// ----------------------------------------------------------------------------- |
|
19530 |
// CAknFepManager::EditorCcpuStatus |
|
19531 |
// |
|
19532 |
// Returns the Ccpu status of given editor state as a flag combination. |
|
19533 |
// ----------------------------------------------------------------------------- |
|
19534 |
// |
|
19535 |
TInt CAknFepManager::EditorCcpuStatus(CAknEdwinState* aEdwinState) |
|
19536 |
{ |
|
19537 |
TInt ret = 0; |
|
19538 |
||
19539 |
if (aEdwinState && aEdwinState->CcpuState()) |
|
19540 |
{ |
|
19541 |
if (aEdwinState->CcpuState()->CcpuCanCopy()) |
|
19542 |
{ |
|
19543 |
ret |= ECcpuStatusFlagCanCopy; |
|
19544 |
} |
|
19545 |
if (aEdwinState->CcpuState()->CcpuCanCut()) |
|
19546 |
{ |
|
19547 |
ret |= ECcpuStatusFlagCanCut; |
|
19548 |
} |
|
19549 |
if (aEdwinState->CcpuState()->CcpuCanPaste()) |
|
19550 |
{ |
|
19551 |
ret |= ECcpuStatusFlagCanPaste; |
|
19552 |
} |
|
19553 |
} |
|
19554 |
return ret; |
|
19555 |
} |
|
19556 |
||
19557 |
void CAknFepManager::NewLigatureL( const TDesC& aText ) |
|
19558 |
{ |
|
19559 |
if( !iInputCapabilities.SupportsSecretText() && |
|
19560 |
( EditorHasFreeSpace() || |
|
19561 |
IsFlagSet( EFlagInsideMultitapInlineEditingTransaction ) ) ) |
|
19562 |
{ |
|
19563 |
if ( iFepManState == EAknFepStateInitial ) //multitapping |
|
19564 |
{ |
|
19565 |
if ( !IsFlagSet( EFlagInsideMultitapInlineEditingTransaction ) ) |
|
19566 |
{ |
|
19567 |
ClearFlag( EFlagLineFeedCharacter ); |
|
19568 |
StartInlineEditL( aText ); |
|
19569 |
SetFlag( EFlagInsideMultitapInlineEditingTransaction ); |
|
19570 |
SetFlag( EFlagInsideInlineEditingTransaction ); |
|
19571 |
} |
|
19572 |
} |
|
19573 |
} |
|
19574 |
} |
|
19575 |
||
19576 |
||
19577 |
||
19578 |
// ----------------------------------------------------------------------------- |
|
19579 |
// CAknFepManager::CancelCcpuMode |
|
19580 |
// |
|
19581 |
// Cancels the copy / cut mode initiated from editing options -submenu. |
|
19582 |
// ----------------------------------------------------------------------------- |
|
19583 |
// |
|
19584 |
void CAknFepManager::CancelCcpuMode() |
|
19585 |
{ |
|
19586 |
iIndicator->SetCopyMode(EFalse); |
|
19587 |
if (IsCcpuFlagSet(ECcpuStateStartCopy | ECcpuStateCopy | ECcpuStateStartCut | ECcpuStateCut)) |
|
19588 |
{ |
|
19589 |
iUiInterface->DeleteSoftkeys(); |
|
19590 |
} |
|
19591 |
||
19592 |
ResetCcpuFlags(); |
|
19593 |
} |
|
19594 |
||
19595 |
// ----------------------------------------------------------------------------- |
|
19596 |
// CAknFepManager::CancelShiftKeyTimer |
|
19597 |
// |
|
19598 |
// Cancels shift key timer. |
|
19599 |
// ----------------------------------------------------------------------------- |
|
19600 |
// |
|
19601 |
void CAknFepManager::CancelShiftKeyTimer() |
|
19602 |
{ |
|
19603 |
ClearFlag(EFlagShiftKeyDepressed); |
|
19604 |
if (iShiftKeypressMonitor) |
|
19605 |
{ |
|
19606 |
iShiftKeypressMonitor->Cancel(); |
|
19607 |
} |
|
19608 |
} |
|
19609 |
||
19610 |
void CAknFepManager::RemoveTextFromEditorL( TInt aNumOfCharacters, |
|
19611 |
TInt aPos /*= 0*/, |
|
19612 |
TBool aIsToAlignCursor /* = ETrue */) |
|
19613 |
{ |
|
19614 |
if( IsFlagSet( EFlagInsideInlineEditingTransaction ) && |
|
19615 |
IsFlagSet( EFlagInsideMultitapInlineEditingTransaction ) ) |
|
19616 |
{ |
|
19617 |
// Update the inline buffer with NULL descriptor. |
|
19618 |
// Inline buffer can be only at position 0, i.e. |
|
19619 |
// where the cursor stands. |
|
19620 |
if( aNumOfCharacters == UncommittedText().Length() |
|
19621 |
&& aPos == 0 ) |
|
19622 |
{ |
|
19623 |
UpdateInlineEditL( KNullDesC, 0 ); |
|
19624 |
} |
|
19625 |
CommitInlineEditL(); |
|
19626 |
} |
|
19627 |
else |
|
19628 |
{ |
|
19629 |
MCoeFepAwareTextEditor* fepAwareTextEditor = |
|
19630 |
iInputCapabilities.FepAwareTextEditor(); |
|
19631 |
||
19632 |
if( fepAwareTextEditor && aPos >= 0 ) |
|
19633 |
{ |
|
19634 |
// Get the previous cursor position. |
|
19635 |
TCursorSelection cursorSelPrevious; |
|
19636 |
fepAwareTextEditor->GetCursorSelectionForFep( cursorSelPrevious ); |
|
19637 |
||
19638 |
// Place the cursor at the desired position. |
|
19639 |
TCursorSelection sel( cursorSelPrevious.iCursorPos - aPos, |
|
19640 |
cursorSelPrevious.iCursorPos - aPos ); |
|
19641 |
fepAwareTextEditor->SetCursorSelectionForFepL( sel ); |
|
19642 |
||
19643 |
// Set cursor span on previous N characters |
|
19644 |
if ( sel.iAnchorPos >= aNumOfCharacters ) |
|
19645 |
{ |
|
19646 |
sel.iAnchorPos -= aNumOfCharacters; |
|
19647 |
||
19648 |
// get text to clear |
|
19649 |
TBuf<EMaximumFepWordLength> bufToClear; |
|
19650 |
fepAwareTextEditor->GetEditorContentForFep( bufToClear, sel.iAnchorPos, |
|
19651 |
aNumOfCharacters ); |
|
19652 |
||
19653 |
// delete the character with an inline edit |
|
19654 |
StartInlineEditL( sel, bufToClear, aNumOfCharacters, EFalse ); |
|
19655 |
UpdateInlineEditL( KNullDesC, 0 ); |
|
19656 |
CommitInlineEditL(); |
|
19657 |
||
19658 |
if( aIsToAlignCursor ) |
|
19659 |
{ |
|
19660 |
// Move the cursor to the original position considering the |
|
19661 |
// aNumOfCharacters |
|
19662 |
cursorSelPrevious.iCursorPos -= aNumOfCharacters; |
|
19663 |
cursorSelPrevious.iAnchorPos = cursorSelPrevious.iCursorPos; |
|
19664 |
fepAwareTextEditor->SetCursorSelectionForFepL( cursorSelPrevious ); |
|
19665 |
} |
|
19666 |
} |
|
19667 |
} |
|
19668 |
} |
|
19669 |
} |
|
19670 |
||
19671 |
#ifdef RD_MARATHI |
|
19672 |
||
19673 |
TBool CAknFepManager::IsChandraAPresentL() |
|
19674 |
{ |
|
19675 |
TBool result = EFalse; |
|
19676 |
||
19677 |
MCoeFepAwareTextEditor* fepAwareTextEditor = |
|
19678 |
iInputCapabilities.FepAwareTextEditor(); |
|
19679 |
||
19680 |
if( fepAwareTextEditor ) |
|
19681 |
{ |
|
19682 |
TCursorSelection curSel; |
|
19683 |
||
19684 |
fepAwareTextEditor->GetCursorSelectionForFep( curSel ); |
|
19685 |
||
19686 |
TInt lowerpos = curSel.LowerPos(); |
|
19687 |
||
19688 |
TInt chandraALength = 2; |
|
19689 |
TBuf<2> buf; |
|
19690 |
TAknFepUiIndicInputManager::GetChandraA( buf ); |
|
19691 |
||
19692 |
if( lowerpos > ( chandraALength - 1 ) ) |
|
19693 |
{ |
|
19694 |
TBuf<2>previousCharacter; |
|
19695 |
||
19696 |
fepAwareTextEditor->GetEditorContentForFep( |
|
19697 |
previousCharacter, lowerpos-chandraALength, chandraALength ); |
|
19698 |
||
19699 |
if( buf.CompareC( previousCharacter ) == 0 ) |
|
19700 |
{ |
|
19701 |
// Chandra-A found |
|
19702 |
result = ETrue; |
|
19703 |
} |
|
19704 |
} |
|
19705 |
} |
|
19706 |
return result; |
|
19707 |
} |
|
19708 |
||
19709 |
TBool CAknFepManager::IsEyeLashRaPresentL() |
|
19710 |
{ |
|
19711 |
TBool result = EFalse; |
|
19712 |
||
19713 |
MCoeFepAwareTextEditor* fepAwareTextEditor = |
|
19714 |
iInputCapabilities.FepAwareTextEditor(); |
|
19715 |
||
19716 |
if( fepAwareTextEditor ) |
|
19717 |
{ |
|
19718 |
TCursorSelection curSel; |
|
19719 |
||
19720 |
fepAwareTextEditor->GetCursorSelectionForFep( curSel ); |
|
19721 |
||
19722 |
TInt lowerpos = curSel.LowerPos(); |
|
19723 |
||
19724 |
||
19725 |
TBuf<3> buf; |
|
19726 |
TAknFepUiIndicInputManager::GetEyeLashRa( buf, |
|
19727 |
(TLanguage)iLanguageCapabilities.iInputLanguageCode ); |
|
19728 |
TInt eyeLashRaLength = buf.Length(); |
|
19729 |
||
19730 |
if( ( lowerpos - eyeLashRaLength ) >= 0 ) |
|
19731 |
{ |
|
19732 |
TBuf<3>previousCharacter; |
|
19733 |
||
19734 |
fepAwareTextEditor->GetEditorContentForFep( |
|
19735 |
previousCharacter, lowerpos-eyeLashRaLength, eyeLashRaLength ); |
|
19736 |
||
19737 |
if( previousCharacter.Length() >=2 && |
|
19738 |
buf.CompareC( previousCharacter ) == 0 ) |
|
19739 |
{ |
|
19740 |
// EyeLashRa found |
|
19741 |
result = ETrue; |
|
19742 |
} |
|
19743 |
} |
|
19744 |
} |
|
19745 |
return result; |
|
19746 |
} |
|
19747 |
||
19748 |
#endif // RD_MARATHI |
|
19749 |
#ifndef RD_INTELLIGENT_TEXT_INPUT |
|
19750 |
void CAknFepManager::RemoveSuggestedCompletionL() |
|
19751 |
{ |
|
19752 |
if(iPtiEngine->InputMode() == EPtiEngineWordCompletion && |
|
19753 |
IsFlagSet(CAknFepManager::EFlagInsideInlineEditingTransaction)) |
|
19754 |
{ |
|
19755 |
TBuf<CAknFepManager::EMaximumFepWordLength> currentText = iPtiEngine->CurrentWord(); |
|
19756 |
if(currentText.Length() > iPtiEngine->CurrentInputSequence().Length()) |
|
19757 |
{ |
|
19758 |
currentText.SetLength(iPtiEngine->CurrentInputSequence().Length()); |
|
19759 |
iPtiEngine->SetCurrentWord(currentText); |
|
19760 |
UpdateInlineEditL(currentText,currentText.Length()); |
|
19761 |
TransferFepStateToEditorL(); |
|
19762 |
} |
|
19763 |
||
19764 |
} |
|
19765 |
} |
|
19766 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
19767 |
||
19768 |
||
19769 |
// ----------------------------------------------------------------------------- |
|
19770 |
// CAknFepManager::ExtendedInputCapabilities |
|
19771 |
// |
|
19772 |
// Returns the extended input bapabilities bitvector. |
|
19773 |
// ----------------------------------------------------------------------------- |
|
19774 |
// |
|
19775 |
TUint CAknFepManager::ExtendedInputCapabilities() const |
|
19776 |
{ |
|
19777 |
MObjectProvider* mop = iInputCapabilities.ObjectProvider(); |
|
19778 |
||
19779 |
if ( mop && iInputCapabilities.FepAwareTextEditor() )//IsFepAwareTextEditor() |
|
19780 |
{ |
|
19781 |
CAknExtendedInputCapabilities* extendedInputCapabilities = |
|
19782 |
mop->MopGetObject( extendedInputCapabilities ); |
|
19783 |
||
19784 |
if ( extendedInputCapabilities ) |
|
19785 |
{ |
|
19786 |
return extendedInputCapabilities->Capabilities(); |
|
19787 |
} |
|
19788 |
} |
|
19789 |
||
19790 |
return 0; |
|
19791 |
} |
|
19792 |
||
19793 |
||
19794 |
#ifdef RD_SCALABLE_UI_V2 |
|
19795 |
// ----------------------------------------------------------------------------- |
|
19796 |
// CAknFepManager::LaunchStylusCcpuMenuL |
|
19797 |
// |
|
19798 |
// Displays stylus ccpu-menu. |
|
19799 |
// ----------------------------------------------------------------------------- |
|
19800 |
// |
|
19801 |
void CAknFepManager::LaunchStylusCcpuMenuL(TPoint &aClickPoint) |
|
19802 |
{ |
|
19803 |
const TInt KItemCopy = 0x01; |
|
19804 |
const TInt KItemCut = 0x02; |
|
19805 |
const TInt KItemPaste = 0x04; |
|
19806 |
||
19807 |
delete iStylusCcpuMenu; |
|
19808 |
iStylusCcpuMenu = NULL; |
|
19809 |
||
19810 |
// It is assume that this method is called only if there is selected |
|
19811 |
// text in suitable editor, ie. there will be at least "copy"-item available. |
|
19812 |
TInt items = KItemCopy; |
|
19813 |
||
19814 |
CAknEdwinState* editorState = EditorState(); |
|
19815 |
if (editorState && editorState->CcpuState()) |
|
19816 |
{ |
|
19817 |
if (editorState->CcpuState()->CcpuCanCut()) |
|
19818 |
{ |
|
19819 |
items |= KItemCut; |
|
19820 |
} |
|
19821 |
if (editorState->CcpuState()->CcpuCanPaste()) |
|
19822 |
{ |
|
19823 |
items |= KItemPaste; |
|
19824 |
} |
|
19825 |
} |
|
19826 |
||
19827 |
if (items) |
|
19828 |
{ |
|
19829 |
TBuf<CAknFepUiInterfaceMenuPane::SItemData::ENominalTextLength> itemStr; |
|
19830 |
iStylusCcpuMenu = iUiInterface->NewStylusPopUpMenuL(this, aClickPoint); |
|
19831 |
||
19832 |
if (items & KItemCopy) |
|
19833 |
{ |
|
19834 |
StringLoader::Load(itemStr, R_AKNFEP_SOFTKEY_COPY); |
|
19835 |
iStylusCcpuMenu->AddMenuItemL(itemStr.Mid(1, itemStr.Length() - 1).Left(CAknFepUiInterfaceMenuPane::SItemData::ENominalTextLength), EEikCmdEditCopy); |
|
19836 |
} |
|
19837 |
if (items & KItemCut) |
|
19838 |
{ |
|
19839 |
itemStr.Zero(); |
|
19840 |
StringLoader::Load(itemStr, R_AKNFEP_SOFTKEY_CUT); |
|
19841 |
iStylusCcpuMenu->AddMenuItemL(itemStr.Mid(1, itemStr.Length() - 1).Left(CAknFepUiInterfaceMenuPane::SItemData::ENominalTextLength), EEikCmdEditCut); |
|
19842 |
} |
|
19843 |
if (items & KItemPaste) |
|
19844 |
{ |
|
19845 |
itemStr.Zero(); |
|
19846 |
StringLoader::Load(itemStr, R_AKNFEP_STYLUS_CCPU_MENU_PASTE); |
|
19847 |
iStylusCcpuMenu->AddMenuItemL(itemStr.Mid(1, itemStr.Length() - 1).Left(CAknFepUiInterfaceMenuPane::SItemData::ENominalTextLength), EEikCmdEditPaste); |
|
19848 |
} |
|
19849 |
||
19850 |
SetCcpuFlag(ECcpuStateCopy); // This forces ProcessCommandL to handle the events. |
|
19851 |
iStylusCcpuMenu->SetPosition(aClickPoint); |
|
19852 |
iStylusCcpuMenu->ShowMenu(); |
|
19853 |
} |
|
19854 |
} |
|
19855 |
#endif |
|
19856 |
||
19857 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
19858 |
TBool CAknFepManager::IsFnKeyMappedL(TPtiKeyboardType aKeyboardType) |
|
19859 |
{ |
|
19860 |
MPtiLanguage *lang = NULL; |
|
19861 |
RArray < TPtiNumericKeyBinding > keybinding; |
|
19862 |
TBool ret = EFalse; |
|
19863 |
if(iPtiEngine) |
|
19864 |
{ |
|
19865 |
lang = iPtiEngine->CurrentLanguage(); |
|
19866 |
if(lang) |
|
19867 |
{ |
|
19868 |
iPtiEngine->GetNumericModeKeysForQwertyL(lang->LanguageCode(), keybinding, aKeyboardType); |
|
19869 |
TInt numericKeysCount = keybinding.Count(); |
|
19870 |
while ( numericKeysCount-- ) |
|
19871 |
{ |
|
19872 |
TPtiNumericKeyBinding numKeyBind = keybinding[numericKeysCount]; |
|
19873 |
if ( numKeyBind.iCase == EPtiCaseFnLower || numKeyBind.iCase == EPtiCaseFnUpper) |
|
19874 |
{ |
|
19875 |
ret = ETrue; |
|
19876 |
break; |
|
19877 |
} |
|
19878 |
} |
|
19879 |
} |
|
19880 |
} |
|
19881 |
keybinding.Reset(); |
|
19882 |
return ret; |
|
19883 |
} |
|
19884 |
TBool CAknFepManager::IsFnKeyMapped() |
|
19885 |
{ |
|
19886 |
return iIsFnKeyMapped; |
|
19887 |
} |
|
19888 |
||
19889 |
void CAknFepManager::SetFnKeyMappingState() |
|
19890 |
{ |
|
19891 |
TRAP_IGNORE(iIsFnKeyMapped = IsFnKeyMappedL()); |
|
19892 |
} |
|
19893 |
||
19894 |
TBool CAknFepManager::KeyMapsDifferentCharacterWithFn( TPtiKey aKey ) const |
|
19895 |
{ |
|
19896 |
// we are interested only about the first mapped character => buffer length 1 is adequate |
|
19897 |
TBuf<1> lowerMapping; |
|
19898 |
TBuf<1> upperMapping; |
|
19899 |
TBuf<1> lowerFnMapping; |
|
19900 |
TBuf<1> upperFnMapping; |
|
19901 |
iPtiEngine->MappingDataForKey( aKey, lowerMapping, EPtiCaseLower ); |
|
19902 |
iPtiEngine->MappingDataForKey( aKey, upperMapping, EPtiCaseUpper ); |
|
19903 |
iPtiEngine->MappingDataForKey( aKey, lowerFnMapping, EPtiCaseFnLower ); |
|
19904 |
iPtiEngine->MappingDataForKey( aKey, upperFnMapping, EPtiCaseFnUpper ); |
|
19905 |
||
19906 |
if ( lowerFnMapping.Length() ) |
|
19907 |
{ |
|
19908 |
if ( !lowerMapping.Length() || // < key maps character only with Fn |
|
19909 |
lowerMapping[0] != lowerFnMapping[0] ) // < Fn changes the character of the key |
|
19910 |
{ |
|
19911 |
return ETrue; |
|
19912 |
} |
|
19913 |
} |
|
19914 |
else if ( upperFnMapping.Length() ) |
|
19915 |
{ |
|
19916 |
if ( !upperMapping.Length() || // < key maps character only with Fn |
|
19917 |
upperMapping[0] != upperFnMapping[0] ) // < Fn changes the character of the key |
|
19918 |
{ |
|
19919 |
return ETrue; |
|
19920 |
} |
|
19921 |
} |
|
19922 |
||
19923 |
return EFalse; // The key doesn't have symbol behind Fn or the symbol is the same as without Fn |
|
19924 |
} |
|
19925 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
19926 |
MAknFepDocumentNavigation* CAknFepManager::AknFepDocumentNavigation() const |
|
19927 |
{ |
|
19928 |
MAknFepDocumentNavigation* navi = NULL; |
|
19929 |
||
19930 |
MObjectProvider* mop = iInputCapabilities.ObjectProvider(); |
|
19931 |
if ( mop ) |
|
19932 |
{ |
|
19933 |
mop->MopGetObject( navi ); |
|
19934 |
} |
|
19935 |
||
19936 |
return navi; |
|
19937 |
} |
|
19938 |
||
19939 |
CAknFepUIInterface* CAknFepManager::UiInterface() |
|
19940 |
{ |
|
19941 |
return iUiInterface; |
|
19942 |
} |
|
19943 |
||
19944 |
void CAknFepManager::AlignLogicalAndVisualCursorL() |
|
19945 |
{ |
|
19946 |
TBool isIndicLang = |
|
19947 |
TAknFepUiIndicInputManager:: |
|
19948 |
IsIndicLangauge( TLanguage( iLanguageCapabilities.iInputLanguageCode ) ); |
|
19949 |
||
19950 |
if( isIndicLang ) |
|
19951 |
{ |
|
19952 |
TTmDocPosSpec pos = DocPos(); |
|
19953 |
pos.iType = TTmDocPosSpec::ETrailing; |
|
19954 |
TTmPosInfo2 info; |
|
19955 |
TTmLineInfo lineInfo; |
|
19956 |
||
19957 |
TBool findAvailable = EFalse; |
|
19958 |
||
19959 |
MAknFepDocumentNavigation* docNavi = AknFepDocumentNavigation(); |
|
19960 |
||
19961 |
if ( docNavi ) |
|
19962 |
{ |
|
19963 |
docNavi->FindDocPos( pos, info, lineInfo ); |
|
19964 |
findAvailable = ETrue; |
|
19965 |
} |
|
19966 |
else |
|
19967 |
{ |
|
19968 |
CTextLayout* textLayout = TextLayout(); |
|
19969 |
if ( textLayout ) |
|
19970 |
{ |
|
19971 |
textLayout->TagmaTextLayout().FindDocPos( pos, info, lineInfo ); |
|
19972 |
findAvailable = ETrue; |
|
19973 |
} |
|
19974 |
} |
|
19975 |
||
19976 |
if ( findAvailable ) |
|
19977 |
{ |
|
19978 |
TCursorSelection sel( info.iDocPos.iPos, info.iDocPos.iPos ); |
|
19979 |
iInputCapabilities.FepAwareTextEditor()->SetCursorSelectionForFepL(sel); |
|
19980 |
} |
|
19981 |
} |
|
19982 |
} |
|
19983 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
19984 |
TKeyResponse CAknFepManager::HandleFnKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aEventCode ) |
|
19985 |
{ |
|
19986 |
TKeyResponse ret; |
|
19987 |
||
19988 |
#ifdef __HALF_QWERTY_KEYPAD |
|
19989 |
if ( IsFlagSet( EFlagShiftKeyDepressed ) && |
|
19990 |
( EPtiKeyboardHalfQwerty == KeyboardLayout() )&& |
|
19991 |
( aEventCode != EEventKeyUp ) ) |
|
19992 |
{ |
|
19993 |
return EKeyWasNotConsumed; |
|
19994 |
} |
|
19995 |
#endif |
|
19996 |
||
19997 |
if (!iCurrentFepUI->IsValidFnKeyPress() && EStdKeyRightFunc == aKeyEvent.iScanCode) |
|
19998 |
{ |
|
19999 |
TBool Uiret = ETrue; |
|
20000 |
if (EEventKeyDown == aEventCode ) |
|
20001 |
{ |
|
20002 |
Uiret = FepUI()->HandleKeyL(EKeyRightFunc, EShortKeyPress); |
|
20003 |
} |
|
20004 |
||
20005 |
if (Uiret) |
|
20006 |
{ |
|
20007 |
ret = EKeyWasConsumed; |
|
20008 |
} |
|
20009 |
else |
|
20010 |
{ |
|
20011 |
ret = iFnKeyManager->HandleFnKeyEventL( aKeyEvent, aEventCode, |
|
20012 |
iInputCapabilities ) ; |
|
20013 |
} |
|
20014 |
} |
|
20015 |
else |
|
20016 |
{ |
|
20017 |
//Handle Fn key and consider long press case |
|
20018 |
if( EStdKeyRightFunc == aKeyEvent.iScanCode ) |
|
20019 |
{ |
|
20020 |
switch(aEventCode) |
|
20021 |
{ |
|
20022 |
case EEventKeyDown: |
|
50
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
20023 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
20024 |
//if current state of fn key is EFnKeyNone or EFnKeyNext..., EFnKeyLock will be set; |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
20025 |
//otherwise, EFnKeyNone will be set. |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
20026 |
if ( iFnKeyManager->FnKeyState() == CAknFepFnKeyManager::EFnKeyLock ) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
20027 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
20028 |
ClearExtendedFlag( EExtendedFlagFnKeyNeedLockMode ); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
20029 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
20030 |
else |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
20031 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
20032 |
SetExtendedFlag( EExtendedFlagFnKeyNeedLockMode ); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
20033 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
20034 |
ActivateFnkeyPressMonitor(); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
20035 |
} |
44 | 20036 |
break; |
20037 |
case EEventKeyUp: |
|
20038 |
{ |
|
20039 |
if(!iFnKeypressMonitor->IsActive()) |
|
20040 |
{ |
|
20041 |
//when long pressing event occurrs, |
|
20042 |
//event has been already handled in HandleFnKeyPressMonitorCallback() |
|
50
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
20043 |
if ( !IsExtendedFlagSet ( EExtendedFlagFnKeyNeedLockMode )) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
20044 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
20045 |
iFnKeyManager->SetFnKeyState(CAknFepFnKeyManager::EFnKeyNone); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
20046 |
} |
44 | 20047 |
return EKeyWasConsumed; |
20048 |
} |
|
20049 |
//when short pressing event occurs, |
|
20050 |
//only deactive fn Key press monitor and normal event handle flow will work |
|
20051 |
DeactivateFnkeyPressMonitor(); |
|
20052 |
} |
|
20053 |
break; |
|
20054 |
default: |
|
20055 |
break; |
|
20056 |
} |
|
20057 |
} |
|
20058 |
ret = iFnKeyManager->HandleFnKeyEventL( aKeyEvent, aEventCode, |
|
20059 |
iInputCapabilities ) ; |
|
20060 |
} |
|
20061 |
if(IsHybridAplhaEditor() && !iHybridAplphaChangedToAlphanumeric) |
|
20062 |
{ |
|
20063 |
if(FnKeyState() != CAknFepFnKeyManager::EFnKeyLock) |
|
20064 |
iHybridAplphaChangedToAlphanumeric = ETrue; |
|
20065 |
} |
|
20066 |
||
20067 |
return ret; |
|
20068 |
} |
|
20069 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
20070 |
||
20071 |
// ----------------------------------------------------------------------------- |
|
20072 |
// CAknFepManager::HasJapanesePredictionInputMode |
|
20073 |
// Has Japanese prediction input mode in PtiEngine |
|
20074 |
// ----------------------------------------------------------------------------- |
|
20075 |
// |
|
20076 |
TBool CAknFepManager::HasJapanesePredictionInputMode() const |
|
20077 |
{ |
|
20078 |
// Is it supported Japanese predictive input |
|
20079 |
TBool ret = EFalse; |
|
20080 |
MPtiLanguage* ptilang = iPtiEngine->GetLanguage(ELangJapanese); |
|
20081 |
if ( ptilang |
|
20082 |
&& ( (!iQwertyInputMode && ptilang->HasInputMode(EPtiEngineHiraganaKanjiPredictive)) |
|
20083 |
||(iQwertyInputMode && ptilang->HasInputMode(EPtiEngineHiraganaKanjiPredictiveQwerty)) ) ) |
|
20084 |
{ |
|
20085 |
ret = ETrue; |
|
20086 |
} |
|
20087 |
return ret; |
|
20088 |
} |
|
20089 |
#ifdef RD_HINDI_PHONETIC_INPUT |
|
20090 |
void CAknFepManager::HandleIndicCaseL() |
|
20091 |
{ |
|
20092 |
iHashKeyMan->HandleSetIndicStateL(); |
|
20093 |
} |
|
20094 |
#endif |
|
20095 |
||
20096 |
// ----------------------------------------------------------------------------- |
|
20097 |
// CAknFepManager::IsCursorAtEndOfWord |
|
20098 |
// |
|
20099 |
// ----------------------------------------------------------------------------- |
|
20100 |
// |
|
20101 |
TBool CAknFepManager::IsCursorAtEndOfWord() |
|
20102 |
{ |
|
20103 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(iUncommittedText); |
|
20104 |
TInt origPos = iUncommittedText.iCursorPos; |
|
20105 |
||
20106 |
FindEndOfWord(iUncommittedText.iCursorPos); |
|
20107 |
||
20108 |
if (origPos != iUncommittedText.iCursorPos) |
|
20109 |
{ |
|
20110 |
return EFalse; |
|
20111 |
} |
|
20112 |
||
20113 |
return ETrue; |
|
20114 |
} |
|
20115 |
||
20116 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
20117 |
TInt CAknFepManager::GetCurrentCase() |
|
20118 |
{ |
|
20119 |
TCase returnCase; |
|
20120 |
||
20121 |
switch( iCaseMan->CurrentCase() ) |
|
20122 |
{ |
|
20123 |
case EAknEditorUpperCase: |
|
20124 |
case EAknEditorTextCase: |
|
20125 |
{ |
|
20126 |
returnCase = EUpperCase; |
|
20127 |
} |
|
20128 |
break; |
|
20129 |
||
20130 |
case EAknEditorLowerCase: |
|
20131 |
{ |
|
20132 |
returnCase = ELowerCase; |
|
20133 |
} |
|
20134 |
break; |
|
20135 |
||
20136 |
default: |
|
20137 |
returnCase = ELowerCase; |
|
20138 |
break; |
|
20139 |
} |
|
20140 |
return returnCase; |
|
20141 |
} |
|
20142 |
// Predictive QWERTY changes (XT9) ----> |
|
20143 |
||
20144 |
void CAknFepManager::GetCandidatesL( CDesCArray& aArray, TInt& aActiveIdx ) |
|
20145 |
{ |
|
20146 |
iPtiEngine->GetCandidateListL(aArray); |
|
20147 |
iPtiEngine->HandleCommandL( |
|
20148 |
EPtiCommandUserActionGetCurrentIndexOfCandidates, &aActiveIdx); |
|
20149 |
} |
|
20150 |
||
20151 |
void CAknFepManager::GetUpdateCandidatePositionL(TRect& aRect) |
|
20152 |
{ |
|
20153 |
if(iCandidatePopup && iFepFullyConstructed && iPtiEngine) |
|
20154 |
{ |
|
20155 |
//Now we read the position of the inline text |
|
20156 |
TPoint inlineEditorTl; |
|
20157 |
TPoint inlineEditorBr; |
|
20158 |
TInt height; |
|
20159 |
TInt ascent; |
|
20160 |
TInt documentOffset = iPtiEngine->CurrentWord().Length(); |
|
20161 |
// Popup Position for RTL |
|
20162 |
if(iLanguageCapabilities.iRightToLeftLanguage) |
|
20163 |
documentOffset = 0; |
|
20164 |
// Popup Position for RTL |
|
20165 |
GetScreenCoordinatesL(inlineEditorTl, height, ascent, documentOffset); |
|
20166 |
inlineEditorTl.iY -= height; |
|
20167 |
GetScreenCoordinatesL(inlineEditorBr, height, ascent); |
|
20168 |
aRect.iTl = inlineEditorTl; |
|
20169 |
aRect.iBr = inlineEditorBr; |
|
20170 |
} |
|
20171 |
} |
|
20172 |
||
20173 |
TBool CAknFepManager::IsRightToLeftLanguage() |
|
20174 |
{ |
|
20175 |
return iLanguageCapabilities.iRightToLeftLanguage ; |
|
20176 |
} |
|
20177 |
||
20178 |
/** |
|
20179 |
* Setter for the advanced predictive typing correction. |
|
20180 |
* @param aLevel The level to be set. |
|
20181 |
*/ |
|
20182 |
void CAknFepManager::SetTypingCorrectionLevel(TInt aLevel) |
|
20183 |
{ |
|
20184 |
iTypingCorrectionLevel = aLevel; |
|
20185 |
||
20186 |
if(iFepFullyConstructed) |
|
20187 |
{ |
|
20188 |
TPtiErrorCorrectionLevel correctionLevel = (TPtiErrorCorrectionLevel)aLevel; |
|
20189 |
TRAP_IGNORE(iPtiEngine->HandleCommandL( EPtiCommandSetCorrectionLevel, &correctionLevel )); |
|
20190 |
} |
|
20191 |
} |
|
20192 |
||
20193 |
/** |
|
20194 |
* Resetter for the advanced predictive Number Candidate setting. |
|
20195 |
* @param aValue The value to be set. |
|
20196 |
*/ |
|
20197 |
void CAknFepManager::SetNumberCandidateState(TInt aValue) |
|
20198 |
{ |
|
20199 |
if(aValue == 0) |
|
20200 |
iIsNumberCandidateShown = EFalse; |
|
20201 |
else if(aValue == 1) |
|
20202 |
iIsNumberCandidateShown = ETrue; |
|
20203 |
||
20204 |
if(iFepFullyConstructed) |
|
20205 |
{ |
|
20206 |
TRAP_IGNORE(iPtiEngine->HandleCommandL( EPtiCommandSetNumberCandidateStatus, |
|
20207 |
&iIsNumberCandidateShown )); |
|
20208 |
} |
|
20209 |
} |
|
20210 |
||
20211 |
void CAknFepManager::RemoveSuggestedAdvanceCompletionL() |
|
20212 |
{ |
|
20213 |
if( IsFlagSet(CAknFepManager::EFlagInsideInlineEditingTransaction) && |
|
20214 |
iPtiEngine->CurrentWord().Length() ) |
|
20215 |
{ |
|
20216 |
TRAP_IGNORE(iPtiEngine->HandleCommandL( EPtiCommandUserActionShorten )); |
|
20217 |
TPtrC currentText = iPtiEngine->CurrentWord(); |
|
20218 |
UpdateInlineEditL( currentText, currentText.Length() ); |
|
20219 |
} |
|
20220 |
} |
|
20221 |
/** |
|
20222 |
* Setes the current state from GS to the local state |
|
20223 |
*/ |
|
20224 |
||
20225 |
void CAknFepManager::SetAutoCompletionState(TInt aValue) |
|
20226 |
{ |
|
20227 |
if(aValue == 0) |
|
20228 |
{ |
|
20229 |
iIsAutoCompleteOn = EFalse; |
|
20230 |
} |
|
20231 |
else if(aValue == 1) |
|
20232 |
{ |
|
20233 |
iIsAutoCompleteOn = ETrue; |
|
20234 |
} |
|
20235 |
||
20236 |
if(iFepFullyConstructed) |
|
20237 |
{ |
|
20238 |
if(iIsAutoCompleteOn) |
|
20239 |
{ |
|
20240 |
TRAP_IGNORE(iPtiEngine->HandleCommandL( EPtiCommandEnableAutoCompletion )); |
|
20241 |
} |
|
20242 |
else |
|
20243 |
{ |
|
20244 |
TInt tailLength = 0; |
|
20245 |
TRAP_IGNORE(iPtiEngine->HandleCommandL( EPtiCommandGetAutoCompletionTailLength, &tailLength )); |
|
20246 |
if(tailLength > 0) |
|
20247 |
{ |
|
20248 |
// send an update to engine to signify change in autocompletion from on to off while tail exists |
|
20249 |
// This will set EPtiXt9FlagAutoCompletionSetOnToOff flag as true in engine |
|
20250 |
TInt value = 1; |
|
20251 |
TRAP_IGNORE(iPtiEngine->HandleCommandL( EPtiCommandAutoCompletionOnToOff,&value)); |
|
20252 |
} |
|
20253 |
||
20254 |
||
20255 |
TRAP_IGNORE(iPtiEngine->HandleCommandL( EPtiCommandDisableAutoCompletion )); |
|
20256 |
} |
|
20257 |
} |
|
20258 |
} |
|
20259 |
||
20260 |
/** |
|
20261 |
* Sets the primary candidate from GS to the local state |
|
20262 |
*/ |
|
20263 |
||
20264 |
void CAknFepManager::SetPrimaryCandidate(TInt aValue) |
|
20265 |
{ |
|
20266 |
if(aValue == 0) |
|
20267 |
iPrimaryCandidate = ETrue; |
|
20268 |
else if(aValue == 1) |
|
20269 |
iPrimaryCandidate = EFalse; |
|
20270 |
if(iFepFullyConstructed) |
|
20271 |
{ |
|
20272 |
TRAP_IGNORE(iPtiEngine->HandleCommandL( EPtiCommandSetProactiveCorrection, |
|
20273 |
&iPrimaryCandidate )); |
|
20274 |
} |
|
20275 |
} |
|
20276 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
20277 |
||
20278 |
CAknFepPluginManager* CAknFepManager::PluginUIManager() |
|
20279 |
{ |
|
20280 |
#ifdef RD_SCALABLE_UI_V2 |
|
20281 |
||
20282 |
return iFepPluginManager; |
|
20283 |
#else |
|
20284 |
return NULL; |
|
20285 |
#endif //RD_SCALABLE_UI_V2 |
|
20286 |
} |
|
20287 |
||
20288 |
// add for phrase creation |
|
20289 |
MZhuyinKeyHandler* CAknFepManager::ZhuyinKeyHandler() |
|
20290 |
{ |
|
20291 |
return iZhuyinKeyHandler; |
|
20292 |
} |
|
20293 |
// add for phrase creation |
|
20294 |
CAknFepZhuyinAnalyser* CAknFepManager::ZhuyinAnalyser() |
|
20295 |
{ |
|
20296 |
return iZhuyinAnalyser; |
|
20297 |
} |
|
20298 |
||
20299 |
#ifdef RD_SCALABLE_UI_V2 |
|
20300 |
void CAknFepManager::UpdateTouchCaseMode() |
|
20301 |
{ |
|
20302 |
if (iFepFullyConstructed && |
|
20303 |
iFepPluginManager |
|
20304 |
// case should be updated even if current input mode is none because iPreviousCoseMode |
|
20305 |
// still need to be updated. |
|
20306 |
/*&& |
|
20307 |
iFepPluginManager->PluginInputMode() != EPluginInputModeNone*/) |
|
20308 |
{ |
|
20309 |
iFepPluginManager->UpdateCaseMode(); |
|
20310 |
} |
|
20311 |
} |
|
20312 |
#endif// RD_SCALABLE_UI_V2 |
|
20313 |
||
20314 |
void CAknFepManager::SetStopProcessFocus(TBool aStop, TBool aClose) |
|
20315 |
{ |
|
20316 |
iClosePeninputUi = aClose; |
|
20317 |
iStopProcessFocus = aStop; |
|
20318 |
if (!aStop) |
|
20319 |
{ |
|
20320 |
HandleChangeInFocus(); |
|
20321 |
} |
|
20322 |
} |
|
20323 |
||
20324 |
TBool CAknFepManager::StopProcessFocus() |
|
20325 |
{ |
|
20326 |
return iStopProcessFocus; |
|
20327 |
} |
|
20328 |
||
20329 |
TBool CAknFepManager::CloseUiOnFocusChange() |
|
20330 |
{ |
|
20331 |
return iClosePeninputUi; |
|
20332 |
} |
|
20333 |
void CAknFepManager::HandleCopyCutStateL() |
|
20334 |
{ |
|
20335 |
if (IsCcpuFlagSet(ECcpuStateCopy | ECcpuStateCut)) |
|
20336 |
{ |
|
20337 |
TCursorSelection selection; |
|
20338 |
iInputCapabilities.FepAwareTextEditor()->GetCursorSelectionForFep(selection); |
|
20339 |
TBool update; |
|
20340 |
if (selection.Length() > 0) |
|
20341 |
{ |
|
20342 |
if (!IsCcpuFlagSet(ECcpuStateButton)) |
|
20343 |
{ |
|
20344 |
__ASSERT_DEBUG(iUiInterface->SoftkeysExist(), |
|
20345 |
AknFepPanic(EAknFepPanicNoHandleToFepAwareTextEditor)); |
|
20346 |
if (IsCcpuFlagSet(ECcpuStateCopy)) |
|
20347 |
{ |
|
20348 |
update = UpdateCBALabelL(ELeftSoftkeyIndex, EEikCmdEditCopy, R_AKNFEP_SOFTKEY_COPY); |
|
20349 |
update |= UpdateCBALabelL( EMiddleSoftkeyIndex, EEikCmdEditCopy, R_AVKON_SOFTKEY_SELECT_TEXT ); |
|
20350 |
} |
|
20351 |
else |
|
20352 |
{ |
|
20353 |
update = UpdateCBALabelL(ELeftSoftkeyIndex, EEikCmdEditCut, R_AKNFEP_SOFTKEY_CUT); |
|
20354 |
update |= UpdateCBALabelL( EMiddleSoftkeyIndex, EEikCmdEditCut, R_AVKON_SOFTKEY_SELECT_TEXT ); |
|
20355 |
} |
|
20356 |
if (update) |
|
20357 |
{ |
|
20358 |
iUiInterface->DrawSoftkeysNow(); |
|
20359 |
} |
|
20360 |
SetCcpuFlag(ECcpuStateButton); |
|
20361 |
} |
|
20362 |
} |
|
20363 |
else if (IsCcpuFlagSet(ECcpuStateButton)) |
|
20364 |
{ |
|
20365 |
ClearCcpuFlag(ECcpuStateButton); |
|
20366 |
update = EFalse; |
|
20367 |
update = UpdateCBALabelL(ELeftSoftkeyIndex, KNullCommandId, R_TEXT_SOFTKEY_EMPTY); |
|
20368 |
update |= UpdateCBALabelL( EMiddleSoftkeyIndex, KNullCommandId, R_TEXT_SOFTKEY_EMPTY ); |
|
20369 |
if (update) |
|
20370 |
{ |
|
20371 |
iUiInterface->DrawSoftkeysNow(); |
|
20372 |
} |
|
20373 |
} |
|
20374 |
} |
|
20375 |
} |
|
20376 |
#ifdef RD_SCALABLE_UI_V2 |
|
20377 |
TInt GetForegroundTaskAppWgId() |
|
20378 |
{ |
|
20379 |
TApaTaskList tList(CCoeEnv::Static()->WsSession()); |
|
20380 |
||
20381 |
TApaTask task = tList.FindByPos(0); |
|
20382 |
return task.WgId(); |
|
20383 |
} |
|
20384 |
||
20385 |
void CAknFepManager::DimInputmodeTouchMenuItems(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
20386 |
{ |
|
20387 |
DimEditMenuModeItems(aMenuPane); |
|
20388 |
||
20389 |
if ( IsChineseInputLanguage() ) |
|
20390 |
{ |
|
20391 |
DoChineseTouchMenu(aMenuPane); |
|
20392 |
} |
|
20393 |
else if ( iLanguageCapabilities.iInputLanguageCode == ELangJapanese) |
|
20394 |
{ |
|
20395 |
DoJapaneseMenu(aMenuPane); |
|
20396 |
} |
|
20397 |
else |
|
20398 |
{ |
|
20399 |
DoWesternTouchMenu(aMenuPane); |
|
20400 |
} |
|
20401 |
} |
|
20402 |
#endif |
|
20403 |
||
20404 |
void CAknFepManager::DimInputmodeMenuItems(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
20405 |
{ |
|
20406 |
DimEditMenuModeItems(aMenuPane); |
|
20407 |
||
20408 |
if ( IsChineseInputLanguage() ) |
|
20409 |
{ |
|
20410 |
DoChineseMenu(aMenuPane); |
|
20411 |
} |
|
20412 |
else if ( iLanguageCapabilities.iInputLanguageCode == ELangJapanese) |
|
20413 |
{ |
|
20414 |
DoJapaneseMenu(aMenuPane); |
|
20415 |
} |
|
20416 |
else |
|
20417 |
{ |
|
20418 |
DoWesternMenu(aMenuPane); |
|
20419 |
} |
|
20420 |
} |
|
20421 |
||
20422 |
void CAknFepManager::HandleCopyCutEventL(TInt aCommandId) |
|
20423 |
{ |
|
20424 |
if (iCcpuMode != ECcpuStateNone) |
|
20425 |
{ |
|
20426 |
ResetCcpuFlags(); |
|
20427 |
iUiInterface->DeleteSoftkeys(); |
|
20428 |
||
20429 |
SetCcpuFlag(ECcpuStatePosted); |
|
20430 |
||
20431 |
#ifdef RD_SCALABLE_UI_V2 |
|
20432 |
if (aCommandId == EEikCmdEditCopy) |
|
20433 |
{ |
|
20434 |
// Send copy event to AknCcpuSupport. |
|
20435 |
CCoeEnv::Static()->SimulateKeyEventL(KAknCcpuCopyEvent, EEventKey); |
|
20436 |
} |
|
20437 |
else |
|
20438 |
{ |
|
20439 |
// Send cut event to AknCcpuSupport. |
|
20440 |
CCoeEnv::Static()->SimulateKeyEventL(KAknCcpuCutEvent, EEventKey); |
|
20441 |
} |
|
20442 |
#else |
|
20443 |
/*As part of build warnings commenting this perticular code it might require when touch is enabled. |
|
20444 |
if (aCommandId == EEikCmdEditCopy) |
|
20445 |
{ |
|
20446 |
// Send copy-event to editor. |
|
20447 |
CCoeEnv::Static()->SimulateKeyEventL(KEditorCopyEvent, EEventKey); |
|
20448 |
} |
|
20449 |
else |
|
20450 |
{ |
|
20451 |
// send cut-event to editor. |
|
20452 |
CCoeEnv::Static()->SimulateKeyEventL(KEditorCutEvent, EEventKey); |
|
20453 |
} |
|
20454 |
*/ |
|
20455 |
#endif // RD_SCALABLE_UI_V2 |
|
20456 |
||
20457 |
if (iInputCapabilities.FepAwareTextEditor()) |
|
20458 |
{ |
|
20459 |
// update indicators only if this is editable component. |
|
20460 |
iIndicator->SetCopyMode(EFalse); |
|
20461 |
UpdateIndicators(); |
|
20462 |
} |
|
20463 |
#ifdef RD_SCALABLE_UI_V2 |
|
20464 |
HandleChangeInFocus(); |
|
20465 |
#endif |
|
20466 |
||
20467 |
} |
|
20468 |
||
20469 |
} |
|
20470 |
||
20471 |
TInt CAknFepManager::FepShowVkbPreviewStatus() |
|
20472 |
{ |
|
20473 |
return iSharedDataInterface->FepShowVkbPreviewStatus(); |
|
20474 |
} |
|
20475 |
||
20476 |
void CAknFepManager::InitPreviewMenuPane(CAknFepUiInterfaceMenuPane* aMenuPane) |
|
20477 |
{ |
|
20478 |
if (FepShowVkbPreviewStatus() > 0) |
|
20479 |
{ |
|
20480 |
aMenuPane->GetMenuPane()->SetItemButtonState(EPenInputCmdPreviewOn, |
|
20481 |
EEikMenuItemSymbolOn ); |
|
20482 |
} |
|
20483 |
else |
|
20484 |
{ |
|
20485 |
aMenuPane->GetMenuPane()->SetItemButtonState(EPenInputCmdPreviewOff, |
|
20486 |
EEikMenuItemSymbolOn ); |
|
20487 |
} |
|
20488 |
} |
|
20489 |
||
20490 |
void CAknFepManager::SynCCPSoftKey() |
|
20491 |
{ |
|
20492 |
TRAP_IGNORE(HandleCopyCutStateL()); |
|
20493 |
} |
|
20494 |
||
20495 |
TInt CAknFepManager::PluginInputMode() const |
|
20496 |
{ |
|
20497 |
#ifdef RD_SCALABLE_UI_V2 |
|
20498 |
return iFepPluginManager ? iFepPluginManager->PluginInputMode() : EPluginInputModeNone; |
|
20499 |
#else |
|
20500 |
return EPluginInputModeNone; |
|
20501 |
#endif |
|
20502 |
} |
|
20503 |
||
20504 |
void CAknFepManager::HandleEndKeyL() |
|
20505 |
{ |
|
20506 |
#ifdef RD_SCALABLE_UI_V2 |
|
20507 |
||
20508 |
if (iFepPluginManager) |
|
20509 |
{ |
|
20510 |
return; |
|
20511 |
} |
|
20512 |
||
20513 |
RWsSession &ws = CCoeEnv::Static()->WsSession(); |
|
20514 |
//TInt wgId =ws.GetFocusWindowGroup(); |
|
20515 |
CApaWindowGroupName* wg = CApaWindowGroupName::NewLC(ws, |
|
20516 |
CCoeEnv::Static()->WsSession().GetFocusWindowGroup()); |
|
20517 |
||
20518 |
TUid id = wg->AppUid(); |
|
20519 |
CleanupStack::PopAndDestroy(wg); |
|
20520 |
||
20521 |
if (0x10207218 == id.iUid || |
|
20522 |
0x10281EF2 == id.iUid) |
|
20523 |
{ |
|
20524 |
RPeninputServer iPenInputServer; |
|
20525 |
||
20526 |
TInt err = iPenInputServer.Connect(); |
|
20527 |
if(err == KErrNone) |
|
20528 |
{ |
|
20529 |
iPenInputServer.SetForeground(ETrue); |
|
20530 |
iPenInputServer.ActivateLayout( EFalse ); |
|
20531 |
iPenInputServer.HandleCommand(ECmdPenInputWindowClose); |
|
20532 |
||
20533 |
iPenInputServer.ClearServerEvent(); |
|
20534 |
iPenInputServer.LoseForeground(); |
|
20535 |
iPenInputServer.Close(); |
|
20536 |
} |
|
20537 |
} |
|
20538 |
#endif //RD_SCALABLE_UI_V2 |
|
20539 |
} |
|
20540 |
void CAknFepManager::NeedDisableKeySound(const TKeyEvent& aKeyEvent, TEventCode aEventCode) |
|
20541 |
{ |
|
20542 |
#ifdef RD_SCALABLE_UI_V2 |
|
20543 |
TInt keyCode = aKeyEvent.iScanCode; |
|
20544 |
TBool interestKey = EFalse; |
|
20545 |
if ( keyCode == EPtiKey0 || |
|
20546 |
keyCode == EPtiKey1 || |
|
20547 |
keyCode == EPtiKey2 || |
|
20548 |
keyCode == EPtiKey3 || |
|
20549 |
keyCode == EPtiKey4 || |
|
20550 |
keyCode == EPtiKey5 || |
|
20551 |
keyCode == EPtiKey6 || |
|
20552 |
keyCode == EPtiKey7 || |
|
20553 |
keyCode == EPtiKey8 || |
|
20554 |
keyCode == EPtiKey9 || |
|
20555 |
keyCode == EStdKeyDownArrow || |
|
20556 |
keyCode == EStdKeyRightArrow || |
|
20557 |
keyCode == EStdKeyLeftArrow || |
|
20558 |
keyCode == EStdKeyUpArrow || |
|
20559 |
keyCode == EStdKeyBackspace |
|
20560 |
) |
|
20561 |
{ |
|
20562 |
interestKey = ETrue; |
|
20563 |
} |
|
20564 |
if( interestKey && iFepPluginManager && |
|
20565 |
iFepPluginManager->PluginInputMode() == EPluginInputModeItut) |
|
20566 |
{ |
|
20567 |
if( aEventCode == EEventKeyDown ) |
|
20568 |
{ |
|
20569 |
static_cast<CAknAppUi*>(CEikonEnv::Static()->EikAppUi())-> |
|
20570 |
DisableNextKeySound( keyCode ); |
|
20571 |
} |
|
20572 |
else if( aEventCode == EEventKey ) |
|
20573 |
{ |
|
20574 |
#ifdef RD_TACTILE_FEEDBACK |
|
20575 |
MTouchFeedback::Instance()-> |
|
20576 |
InstantFeedback(ETouchFeedbackSensitive); |
|
20577 |
#endif |
|
20578 |
} |
|
20579 |
} |
|
20580 |
#endif |
|
20581 |
} |
|
20582 |
||
20583 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
20584 |
void CAknFepManager::SetComposChrFlag( TBool aFlag ) |
|
20585 |
{ |
|
20586 |
iComposChrFlag = aFlag; |
|
20587 |
} |
|
20588 |
TBool CAknFepManager::GetComposChrFlag( ) |
|
20589 |
{ |
|
20590 |
return iComposChrFlag; |
|
20591 |
} |
|
20592 |
#endif |
|
20593 |
||
20594 |
// add for phrase creation User db view |
|
20595 |
void CAknFepManager::AddUserDBDlgItemL( CAknFepUiInterfaceMenuPane* aMenuPane, TInt aIndex ) |
|
20596 |
{ |
|
20597 |
CAknFepUiInterfaceMenuPane::SItemData mData; |
|
20598 |
||
20599 |
TBuf<KMaxFileName> langStr; |
|
20600 |
TInt Inputlangindex; |
|
20601 |
if (!aMenuPane->MenuItemExists(EAknCmdUserDBDlg, Inputlangindex)) |
|
20602 |
{ |
|
20603 |
StringLoader::Load(langStr, R_AKNFEP_OPTIONS_USER_DB_DLG); |
|
20604 |
||
20605 |
mData.iCommandId = EAknCmdUserDBDlg; |
|
20606 |
mData.iCascadeId = 0; |
|
20607 |
mData.iFlags = 0; |
|
20608 |
mData.iText.Copy(langStr.Mid(1, langStr.Length() - 1).Left(CAknFepUiInterfaceMenuPane::SItemData::ENominalTextLength)); |
|
20609 |
||
20610 |
aMenuPane->InsertMenuItemL(mData, aIndex); |
|
20611 |
} |
|
20612 |
} |
|
20613 |
// add for phrase creation |
|
20614 |
void CAknFepManager::LaunchUserDBDlgL( ) |
|
20615 |
{ |
|
20616 |
TInt itemIndex = 0; |
|
20617 |
||
20618 |
//Change title text |
|
20619 |
CEikStatusPane* statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane(); |
|
20620 |
CAknTitlePane* title = static_cast< CAknTitlePane* >( |
|
20621 |
statusPane->ControlL( TUid::Uid( EEikStatusPaneUidTitle) ) ); |
|
20622 |
||
20623 |
//Save the old title tet |
|
20624 |
HBufC* Oldtitletext = title->Text()->AllocLC(); |
|
20625 |
//Load the new title text |
|
20626 |
HBufC* titletext = StringLoader::LoadLC( R_AKNFEP_USER_DB_MANAGEMENT_TITLE ); |
|
20627 |
//Set title to the new text |
|
20628 |
title->SetTextL( *titletext ); |
|
20629 |
||
20630 |
CDesCArray* items = new( ELeave ) CDesCArrayFlat( KSelectItemSize ); |
|
20631 |
CleanupStack::PushL( items ); |
|
20632 |
CArrayFix<TInt>* selectedItems = new( ELeave ) CArrayFixFlat<TInt>( KSelectItemSize ); |
|
20633 |
CleanupStack::PushL( selectedItems ); |
|
20634 |
||
20635 |
CAknToolbar* toolbar = iAvkonAppUi->CurrentFixedToolbar(); |
|
20636 |
||
20637 |
if( toolbar && toolbar->IsShown() && toolbar->CountComponentControls()>0 ) |
|
20638 |
{ |
|
20639 |
toolbar->SetDimmed( ETrue ); |
|
20640 |
toolbar->DrawDeferred(); |
|
20641 |
} |
|
20642 |
||
20643 |
TUid naviPaneUid; |
|
20644 |
naviPaneUid.iUid = EEikStatusPaneUidNavi; |
|
20645 |
||
20646 |
CEikStatusPaneBase::TPaneCapabilities subPane = |
|
20647 |
statusPane->PaneCapabilities(naviPaneUid); |
|
20648 |
// if we can access the navigation pane |
|
20649 |
if (subPane.IsPresent() && subPane.IsAppOwned()) |
|
20650 |
{ |
|
20651 |
CAknNavigationControlContainer |
|
20652 |
* naviPane = |
|
20653 |
(CAknNavigationControlContainer *) statusPane->ControlL(naviPaneUid); |
|
20654 |
iTapGroup = naviPane->CreateTabGroupL(); |
|
20655 |
iTapGroup->MakeVisible( EFalse ); |
|
20656 |
naviPane->PushL( *iTapGroup ); |
|
20657 |
} |
|
20658 |
||
20659 |
iUserdbdlg = CAknFepUserdbDlg::NewL( itemIndex, |
|
20660 |
selectedItems, items, R_AKNFEP_USERDB_DLG_MENUBAR, iPtiEngine, this ); |
|
20661 |
||
20662 |
iIsUserdbdlgActive = 1; |
|
20663 |
||
20664 |
iUserdbdlg->RunLD(); |
|
20665 |
||
20666 |
iIsUserdbdlgActive = 0; |
|
20667 |
||
20668 |
// if we can access the navigation pane |
|
20669 |
if (subPane.IsPresent() && subPane.IsAppOwned()) |
|
20670 |
{ |
|
20671 |
||
20672 |
CAknNavigationControlContainer |
|
20673 |
* naviPane = |
|
20674 |
(CAknNavigationControlContainer *) statusPane->ControlL(naviPaneUid); |
|
20675 |
naviPane->Pop(); |
|
20676 |
delete iTapGroup; |
|
20677 |
iTapGroup = NULL; |
|
20678 |
} |
|
20679 |
||
20680 |
//Set the title to old text |
|
20681 |
title->SetTextL( *Oldtitletext ); |
|
20682 |
||
20683 |
if( toolbar ) |
|
20684 |
{ |
|
20685 |
toolbar->SetDimmed( EFalse ); |
|
20686 |
toolbar->DrawNow(); |
|
20687 |
} |
|
20688 |
||
20689 |
CleanupStack::PopAndDestroy( selectedItems ); |
|
20690 |
CleanupStack::PopAndDestroy( items ); |
|
20691 |
CleanupStack::PopAndDestroy( titletext ); |
|
20692 |
CleanupStack::PopAndDestroy( Oldtitletext ); |
|
20693 |
iUserdbdlg = NULL; |
|
20694 |
} |
|
20695 |
// add for phrase creation |
|
20696 |
TBool CAknFepManager::IsPinyinPhraseCreation() const |
|
20697 |
{ |
|
20698 |
return iPinyinPhraseCreation; |
|
20699 |
} |
|
20700 |
||
20701 |
void CAknFepManager::PinyinPhraseCreation( TBool aPinyinPhraseCreation ) |
|
20702 |
{ |
|
20703 |
if ( iPinyinPhraseCreation != aPinyinPhraseCreation ) |
|
20704 |
{ |
|
20705 |
iPinyinPhraseCreation = aPinyinPhraseCreation; |
|
20706 |
} |
|
20707 |
} |
|
20708 |
// add for phrase creation |
|
20709 |
TBool CAknFepManager::IsPhraseCreation() const |
|
20710 |
{ |
|
20711 |
return iPhraseCreation; |
|
20712 |
} |
|
20713 |
// add for phrase creation |
|
20714 |
void CAknFepManager::PhraseCreation( TBool aPhraseCreation ) |
|
20715 |
{ |
|
20716 |
if ( iPhraseCreation != aPhraseCreation ) |
|
20717 |
{ |
|
20718 |
iPhraseCreation = aPhraseCreation; |
|
20719 |
} |
|
20720 |
} |
|
20721 |
// add for phrase creation |
|
20722 |
TBool CAknFepManager::IsEntryPhrase() const |
|
20723 |
{ |
|
20724 |
return iEntryPhrase; |
|
20725 |
} |
|
20726 |
// add for phrase creation |
|
20727 |
void CAknFepManager::EntryPhrase( TBool aEntryPhrase ) |
|
20728 |
{ |
|
20729 |
if ( iEntryPhrase != aEntryPhrase ) |
|
20730 |
{ |
|
20731 |
iEntryPhrase = aEntryPhrase; |
|
20732 |
} |
|
20733 |
} |
|
20734 |
// add for phrase creation |
|
20735 |
void CAknFepManager::EnableKeyStar( TBool aEnable ) |
|
20736 |
{ |
|
20737 |
if ( iKeyStar != aEnable ) |
|
20738 |
{ |
|
20739 |
iKeyStar = aEnable; |
|
20740 |
} |
|
20741 |
} |
|
20742 |
// add for phrase creation |
|
20743 |
TBool CAknFepManager::IsEnableKeyStar( ) const |
|
20744 |
{ |
|
20745 |
return iKeyStar; |
|
20746 |
} |
|
20747 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
20748 |
||
20749 |
||
20750 |
#ifdef __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__ |
|
20751 |
/** |
|
20752 |
* @return ETrue If the number entry with long key press is supported on QWERTY keyboard. |
|
20753 |
*/ |
|
20754 |
TBool CAknFepManager::LongPressNumberEntryOnQwerty() const |
|
20755 |
{ |
|
20756 |
TBool value = EFalse; |
|
20757 |
if ( iSharedDataInterface ) |
|
20758 |
{ |
|
20759 |
value = iSharedDataInterface->LongPressNumberEntryOnQwerty(); |
|
20760 |
} |
|
20761 |
return value; |
|
20762 |
} |
|
20763 |
||
20764 |
#endif // __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__ |
|
20765 |
||
20766 |
||
20767 |
void CAknFepManager::MultitapThroughSCTCharL(TCallBack aCallBack) |
|
20768 |
{ |
|
20769 |
||
20770 |
TInt res = GetNumericSCTResID(); |
|
20771 |
||
20772 |
if(!res) |
|
20773 |
{ |
|
20774 |
return; |
|
20775 |
} |
|
20776 |
||
20777 |
if(!iNumericResourceTimer) |
|
20778 |
{ |
|
20779 |
iNumericResourceTimer = CChrMultiTapTimer::NewL(aCallBack); |
|
20780 |
} |
|
20781 |
||
20782 |
if(!iResourceString || iNumericResourceId !=res ) |
|
20783 |
{ |
|
20784 |
// either the resource string has not be created or the resource ID has changed |
|
20785 |
if(iResourceString) |
|
20786 |
{ |
|
20787 |
delete iResourceString; |
|
20788 |
iResourceString = NULL; |
|
20789 |
} |
|
20790 |
iNumericResourceId = res; |
|
20791 |
TResourceReader reader; |
|
20792 |
CEikonEnv::Static()->CreateResourceReaderLC(reader,iNumericResourceId); |
|
20793 |
reader.ReadInt32(); // skip sct id |
|
20794 |
iResourceString = reader.ReadHBufC16L(); |
|
20795 |
CleanupStack::PopAndDestroy(); |
|
20796 |
} |
|
20797 |
if(!iResourceString) |
|
20798 |
{ |
|
20799 |
return; |
|
20800 |
} |
|
20801 |
if(iNumericResourceTimer->IsActive()) |
|
20802 |
{ |
|
20803 |
if( iChrCharIndex == iResourceString->Length() ) |
|
20804 |
{ |
|
20805 |
iChrCharIndex = 0; |
|
20806 |
} |
|
20807 |
||
20808 |
iNumericResourceTimer->Cancel(); |
|
20809 |
iNumericResourceTimer->After(KChrKeyMultitapTimeout); |
|
20810 |
} |
|
20811 |
else |
|
20812 |
{ |
|
20813 |
iChrCharIndex = 0; |
|
20814 |
iNumericResourceTimer->After(KChrKeyMultitapTimeout); |
|
20815 |
} |
|
20816 |
TBuf<1> buf; |
|
20817 |
buf.Append((*iResourceString)[iChrCharIndex]); |
|
20818 |
NewCharacterL(buf); |
|
20819 |
iChrCharIndex++; |
|
20820 |
if (iResourceString->Length() == 1) |
|
20821 |
{ |
|
20822 |
NumericResourceMultiTapTimerTimeoutL(); |
|
20823 |
} |
|
20824 |
||
20825 |
} |
|
20826 |
TBool CAknFepManager::NumericResourceMultiTapTimerTimeoutL() |
|
20827 |
{ |
|
20828 |
if(iNumericResourceTimer->IsActive()) |
|
20829 |
{ |
|
20830 |
iNumericResourceTimer->Cancel(); |
|
20831 |
if(IsFlagSet(CAknFepManager::EFlagInsideMultitapInlineEditingTransaction)) |
|
20832 |
{ |
|
20833 |
CommitInlineEditL(); |
|
20834 |
return ETrue; |
|
20835 |
} |
|
20836 |
} |
|
20837 |
return EFalse; |
|
20838 |
} |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
20839 |
void CAknFepManager::ChangeMfneAmPm() |
44 | 20840 |
{ |
20841 |
//trigger when touch at "AM" or "PM" in ICF |
|
20842 |
if (iInputCapabilities.FepAwareTextEditor() && IsMfneEditor() ) |
|
20843 |
{ |
|
20844 |
MObjectProvider* mop = iInputCapabilities.ObjectProvider(); |
|
20845 |
if ( mop && iInputCapabilities.FepAwareTextEditor() ) |
|
20846 |
{ |
|
20847 |
CAknExtendedInputCapabilities* extendedInputCapabilities = |
|
20848 |
mop->MopGetObject( extendedInputCapabilities ); |
|
20849 |
if ( extendedInputCapabilities->Capabilities() && CAknExtendedInputCapabilities::EInputEditorAmPm )// if support AM/PM toggle |
|
20850 |
{ |
|
20851 |
extendedInputCapabilities->ReportEventL( |
|
20852 |
CAknExtendedInputCapabilities::MAknEventObserver::EChangeAmPm, NULL); |
|
20853 |
} |
|
20854 |
} |
|
20855 |
} |
|
20856 |
} |
|
20857 |
||
20858 |
//------------------------------------------------------------------- |
|
20859 |
||
20860 |
// |
|
20861 |
// CChrMultiTapTimer |
|
20862 |
// |
|
20863 |
||
20864 |
// --------------------------------------------------------------------------- |
|
20865 |
// CChrMultiTapTimer::NewL |
|
20866 |
// |
|
20867 |
// --------------------------------------------------------------------------- |
|
20868 |
// |
|
20869 |
CChrMultiTapTimer* CChrMultiTapTimer::NewL(TCallBack aCallback) |
|
20870 |
{ |
|
20871 |
CChrMultiTapTimer* self = new(ELeave)CChrMultiTapTimer(aCallback); |
|
20872 |
CleanupStack::PushL(self); |
|
20873 |
self->ConstructL(); |
|
20874 |
CleanupStack::Pop(); // self |
|
20875 |
return self; |
|
20876 |
} |
|
20877 |
||
20878 |
||
20879 |
// --------------------------------------------------------------------------- |
|
20880 |
// CChrMultiTapTimer::CChrMultiTapTimer |
|
20881 |
// |
|
20882 |
// --------------------------------------------------------------------------- |
|
20883 |
// |
|
20884 |
CChrMultiTapTimer::CChrMultiTapTimer(TCallBack aCallback) |
|
20885 |
:CTimer(EPriorityStandard), iCallback(aCallback) |
|
20886 |
{ |
|
20887 |
} |
|
20888 |
||
20889 |
// --------------------------------------------------------------------------- |
|
20890 |
// CChrMultiTapTimer::ConstructL |
|
20891 |
// |
|
20892 |
// --------------------------------------------------------------------------- |
|
20893 |
// |
|
20894 |
void CChrMultiTapTimer::ConstructL() |
|
20895 |
{ |
|
20896 |
CTimer::ConstructL(); |
|
20897 |
CActiveScheduler::Add(this); |
|
20898 |
} |
|
20899 |
||
20900 |
// --------------------------------------------------------------------------- |
|
20901 |
// CChrMultiTapTimer::After |
|
20902 |
// |
|
20903 |
// --------------------------------------------------------------------------- |
|
20904 |
// |
|
20905 |
void CChrMultiTapTimer::After(TTimeIntervalMicroSeconds32 aInterval) |
|
20906 |
{ |
|
20907 |
if (IsActive()) |
|
20908 |
{ |
|
20909 |
Cancel(); |
|
20910 |
} |
|
20911 |
CTimer::After(aInterval); |
|
20912 |
} |
|
20913 |
||
20914 |
// --------------------------------------------------------------------------- |
|
20915 |
// CChrMultiTapTimer::RunL |
|
20916 |
// |
|
20917 |
// --------------------------------------------------------------------------- |
|
20918 |
// |
|
20919 |
void CChrMultiTapTimer::RunL() |
|
20920 |
{ |
|
20921 |
iCallback.CallBack(); |
|
20922 |
} |
|
20923 |
||
20924 |
TBool CAknFepManager::IsLanguageSupportPrediction() |
|
20925 |
{ |
|
20926 |
TBool isLanguagugeSupportsPrediction = EFalse; |
|
20927 |
switch(iKeyboardType) |
|
20928 |
{ |
|
20929 |
case EPtiKeyboardHalfQwerty: |
|
20930 |
#ifdef __HALF_QWERTY_KEYPAD |
|
20931 |
isLanguagugeSupportsPrediction = (iQwertyInputMode) & (iLanguageCapabilities.iSupportsWesternHalfQwertyPredictive); |
|
20932 |
#endif |
|
20933 |
break; |
|
20934 |
case EPtiKeyboardQwerty4x12: |
|
20935 |
case EPtiKeyboardQwerty4x10: |
|
20936 |
case EPtiKeyboardQwerty3x11: |
|
20937 |
case EPtiKeyboardCustomQwerty: |
|
20938 |
isLanguagugeSupportsPrediction = (iQwertyInputMode) & (iLanguageCapabilities.iSupportsWesternQwertyPredictive); |
|
20939 |
break; |
|
20940 |
case EPtiKeyboardNone: |
|
20941 |
case EPtiKeyboard12Key: |
|
20942 |
isLanguagugeSupportsPrediction = (!iQwertyInputMode) & (iLanguageCapabilities.iSupportsWesternPredictive); |
|
20943 |
break; |
|
20944 |
default: |
|
20945 |
isLanguagugeSupportsPrediction = (!iQwertyInputMode) & (iLanguageCapabilities.iSupportsWesternPredictive); |
|
20946 |
break; |
|
20947 |
} |
|
20948 |
return isLanguagugeSupportsPrediction; |
|
20949 |
} |
|
20950 |
#endif //RD_INTELLIGENT_TEXT_INPUT |
|
20951 |
||
20952 |
TBool CAknFepManager::IsAllowedKeymappingForNumberMode(TChar aChar) const |
|
20953 |
{ |
|
20954 |
TBool response = EFalse; |
|
20955 |
||
20956 |
||
20957 |
switch ( iAknEditorNumericKeymap ) |
|
20958 |
{ |
|
20959 |
case EAknEditorStandardNumberModeKeymap: |
|
20960 |
case EAknEditorFixedDiallingNumberModeKeymap: |
|
20961 |
case EAknEditorSATNumberModeKeymap: |
|
20962 |
case EAknEditorSATHiddenNumberModeKeymap: |
|
20963 |
{ |
|
20964 |
response = (aChar == '#'); |
|
20965 |
} |
|
20966 |
break; |
|
20967 |
case EAknEditorCalculatorNumberModeKeymap: |
|
20968 |
case EAknEditorConverterNumberModeKeymap: |
|
20969 |
{ |
|
20970 |
TLocale tLoc; |
|
20971 |
response = (aChar == tLoc.DecimalSeparator()); |
|
20972 |
} |
|
20973 |
break; |
|
20974 |
case EAknEditorToFieldNumberModeKeymap: |
|
20975 |
{ |
|
20976 |
response = (aChar == ';'); |
|
20977 |
} |
|
20978 |
break; |
|
20979 |
case EAknEditorPlainNumberModeKeymap: |
|
20980 |
case EAknEditorReservedInternalUseKeymap: |
|
20981 |
default: |
|
20982 |
break; |
|
20983 |
} |
|
20984 |
||
20985 |
return response; |
|
20986 |
} |
|
20987 |
/** |
|
20988 |
* Return wether ipnut mode is change by press shift+space. |
|
20989 |
* This is for half-qwerty. |
|
20990 |
*/ |
|
20991 |
TBool CAknFepManager::IsChangeModeByShiftAndSpace() |
|
20992 |
{ |
|
20993 |
return iShiftAndSpace; |
|
20994 |
} |
|
20995 |
||
20996 |
/** |
|
20997 |
* Set wether ipnut mode is change by press shift+space. |
|
20998 |
* This is for half-qwerty. |
|
20999 |
*/ |
|
21000 |
void CAknFepManager::SetChangeModeByShiftAndSpace( TBool aFlag ) |
|
21001 |
{ |
|
21002 |
iShiftAndSpace = aFlag; |
|
21003 |
} |
|
21004 |
||
21005 |
void CAknFepManager::HideExactWordPopUp() |
|
21006 |
{ |
|
21007 |
iExactWordPopupContent->HidePopUp(); |
|
21008 |
TRAP_IGNORE( SendEventsToPluginManL( EPluginHideTooltip )); |
|
21009 |
} |
|
21010 |
||
21011 |
TBool CAknFepManager::IsExactWordPopUpShown() |
|
21012 |
{ |
|
21013 |
#ifdef RD_SCALABLE_UI_V2 |
|
21014 |
return iExactWordPopupContent->IsPopUpVisible() |
|
21015 |
|| ( iFepPluginManager && iFepPluginManager->IsTooltipOpenOnFSQ() ); |
|
21016 |
#else |
|
21017 |
return iExactWordPopupContent->IsPopUpVisible(); |
|
21018 |
#endif // RD_SCALABLE_UI_V2 |
|
21019 |
} |
|
21020 |
void CAknFepManager::StopDisplayingMenuBar() |
|
21021 |
{ |
|
21022 |
if (iEditMenuBar) |
|
21023 |
{ |
|
21024 |
iEditMenuBar->StopDisplayingMenuBar(); |
|
21025 |
iEditMenuBar = NULL; |
|
21026 |
} |
|
21027 |
#ifdef __ITI_VIRTUAL_TOUCH_FIRST_GENERATION_SUPPORT__ |
|
21028 |
// temporary solution for Entering key on virtual QWERTY not working |
|
21029 |
// like enter on virtual ITU-T or on external keyboard |
|
21030 |
if ( iOptionsMenuBar && !( iFepPluginManager && |
|
21031 |
( iFepPluginManager->CurrentPluginInputMode() == EPluginInputModeFSQ || |
|
21032 |
iFepPluginManager->CurrentPluginInputMode() == EPluginInputModePortraitFSQ ) ) ) |
|
21033 |
{ |
|
21034 |
iOptionsMenuBar->StopDisplayingMenuBar(); |
|
21035 |
iOptionsMenuBar = NULL; |
|
21036 |
} |
|
21037 |
#endif //__ITI_VIRTUAL_TOUCH_FIRST_GENERATION_SUPPORT__ |
|
21038 |
} |
|
21039 |
||
21040 |
void CAknFepManager::SetQwertyModeToInputcapbility() |
|
21041 |
{ |
|
21042 |
if ( iSharedDataInterface->QwertyInputMode() ) |
|
21043 |
{ |
|
21044 |
SetExtendedInputCapabilities( ExtendedInputCapabilities() | |
|
21045 |
CAknExtendedInputCapabilities::EInputEditorQwertyInputActive ); |
|
21046 |
} |
|
21047 |
else |
|
21048 |
{ |
|
21049 |
SetExtendedInputCapabilities( ExtendedInputCapabilities() & |
|
21050 |
~CAknExtendedInputCapabilities::EInputEditorQwertyInputActive ); |
|
21051 |
} |
|
21052 |
} |
|
21053 |
void CAknFepManager::SetExtendedInputCapabilities( TUint aCapabilities) |
|
21054 |
{ |
|
21055 |
MObjectProvider* mop = iInputCapabilities.ObjectProvider(); |
|
21056 |
||
21057 |
if ( mop && iInputCapabilities.FepAwareTextEditor() )//IsFepAwareTextEditor() |
|
21058 |
{ |
|
21059 |
CAknExtendedInputCapabilities* extendedInputCapabilities = |
|
21060 |
mop->MopGetObject( extendedInputCapabilities ); |
|
21061 |
||
21062 |
if ( extendedInputCapabilities ) |
|
21063 |
{ |
|
21064 |
extendedInputCapabilities->SetCapabilities( aCapabilities ); |
|
21065 |
} |
|
21066 |
} |
|
21067 |
||
21068 |
return; |
|
21069 |
} |
|
21070 |
||
21071 |
void CAknFepManager::PrepareFepAfterDialogExitL(TUid aFepUid) |
|
21072 |
{ |
|
21073 |
// This ensures that on 3rd party fep change we do not have access to other fep variables |
|
21074 |
if (aFepUid != CCoeEnv::Static()->FepUid()) |
|
21075 |
{ |
|
21076 |
// In case the fep has changed, then leave |
|
21077 |
User::Leave(KErrNone); |
|
21078 |
} |
|
21079 |
// Once the editor which launches a dialog is destroyed, this flag is set |
|
21080 |
// In case we have any dialog launched we leave as the underneath editor is |
|
21081 |
// destroyed |
|
21082 |
if (IsExtendedFlagSet(EExtendedFlagEdwinEditorDestroyed)) |
|
21083 |
{ |
|
21084 |
if(!iFepAwareDialogParentEditor) |
|
21085 |
{ |
|
21086 |
// For Eg: Messaging editor launches spell query which inturn launches |
|
21087 |
// SCT. Then don't clear the flag once we dismiss SCT because we even |
|
21088 |
// need to dismiss spell query dialog. |
|
21089 |
ClearExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
21090 |
} |
|
21091 |
User::Leave(KErrNone); |
|
21092 |
} |
|
21093 |
if(!iFepAwareDialogParentEditor) |
|
21094 |
{ |
|
21095 |
ClearExtendedFlag(EExtendedFlagEdwinEditorDestroyed); |
|
21096 |
} |
|
21097 |
} |
|
21098 |
||
21099 |
void CAknFepManager::PrepareFepForFepAwareDialogLaunch() |
|
21100 |
{ |
|
21101 |
iFepAwareDialogParentEditor = EditorState(); |
|
21102 |
SetExtendedFlag(EExtendedFlagFepAwareDialogLaunched); |
|
21103 |
} |
|
21104 |
||
21105 |
void CAknFepManager::PrepareFepAfterFepAwareDialogExitL(TUid aFepUid) |
|
21106 |
{ |
|
21107 |
// This ensures that on 3rd party fep change we do not have access to other fep variables |
|
21108 |
if (aFepUid != CCoeEnv::Static()->FepUid()) |
|
21109 |
{ |
|
21110 |
// In case the fep has changed, then leave |
|
21111 |
User::Leave(KErrNone); |
|
21112 |
} |
|
21113 |
iFepAwareDialogParentEditor = NULL; |
|
21114 |
ClearExtendedFlag(EExtendedFlagFepAwareDialogLaunched); |
|
21115 |
} |
|
21116 |
||
21117 |
void CAknFepManager::ConvertCharToKey(TChar aChar, TUint16& aKey) const |
|
21118 |
{ |
|
21119 |
aKey = 0; |
|
21120 |
||
21121 |
if (!iPtiEngine) |
|
21122 |
return; |
|
21123 |
||
21124 |
CPtiCoreLanguage* lang = static_cast<CPtiCoreLanguage*>( iPtiEngine->CurrentLanguage() ); |
|
21125 |
if (!lang) |
|
21126 |
return; |
|
21127 |
||
21128 |
const TBool vietnamese = (iLanguageCapabilities.iInputLanguageCode == ELangVietnamese); |
|
21129 |
||
21130 |
MPtiKeyMappings* map; |
|
21131 |
TPtiKeyboardType keyboardLayout = KeyboardLayout(); |
|
21132 |
if ( keyboardLayout == EPtiKeyboardQwerty4x12 |
|
21133 |
|| keyboardLayout == EPtiKeyboardQwerty4x10 |
|
21134 |
|| keyboardLayout == EPtiKeyboardQwerty3x11 |
|
21135 |
|| keyboardLayout == EPtiKeyboardCustomQwerty ) |
|
21136 |
{ |
|
21137 |
map = lang->GetQwertyKeymappings(); |
|
21138 |
} |
|
21139 |
else if( keyboardLayout == EPtiKeyboardHalfQwerty ) |
|
21140 |
{ |
|
21141 |
map = lang->GetHalfQwertyKeymappings(); |
|
21142 |
} |
|
21143 |
else |
|
21144 |
{ |
|
21145 |
map = lang->GetKeymappings(); |
|
21146 |
} |
|
21147 |
||
21148 |
if (!map) |
|
21149 |
{ |
|
21150 |
return; |
|
21151 |
} |
|
21152 |
||
21153 |
TUint16 ch; |
|
21154 |
ch = (TUint16)map->KeyForCharacter(aChar); |
|
21155 |
if ( !ch && vietnamese |
|
21156 |
&& !( iFepPluginManager && iFepPluginManager->IsSupportITIOnFSQ() ) ) |
|
21157 |
{ |
|
21158 |
// This may be Vietnamese tone mark or an accented character which isn't listed |
|
21159 |
// in keymappings. |
|
21160 |
ch = RemapVietnameseAccentedCharacter(aChar); |
|
21161 |
} |
|
21162 |
||
21163 |
aKey = ch; |
|
21164 |
} |
|
21165 |
||
21166 |
TBool CAknFepManager::GetSctLengthL(TInt resourceId)const |
|
21167 |
{ |
|
21168 |
CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
21169 |
TResourceReader reader; |
|
21170 |
CEikonEnv::Static()->CreateResourceReaderLC(reader,resourceId); |
|
21171 |
TInt component_count=reader.ReadInt16(); |
|
21172 |
TInt length = 0; |
|
21173 |
TBool isEmpty = ETrue; |
|
21174 |
HBufC* sctChar = NULL; |
|
21175 |
||
21176 |
for (TInt ii=0;ii<component_count;ii++) |
|
21177 |
{ |
|
21178 |
TInt component_id=reader.ReadInt16(); |
|
21179 |
switch(component_id) |
|
21180 |
{ |
|
21181 |
case EAknSCTLowerCase: |
|
21182 |
{ |
|
21183 |
sctChar = reader.ReadHBufCL(); |
|
21184 |
length += (sctChar != NULL)? sctChar->Length(): 0; |
|
21185 |
break; |
|
21186 |
} |
|
21187 |
case EAknSCTUpperCase: |
|
21188 |
{ |
|
21189 |
sctChar = reader.ReadHBufCL(); |
|
21190 |
length += (sctChar != NULL)? sctChar->Length(): 0; |
|
21191 |
break; |
|
21192 |
} |
|
21193 |
case EAknSCTNumeric: |
|
21194 |
{ |
|
21195 |
sctChar = reader.ReadHBufCL(); |
|
21196 |
length += (sctChar != NULL)? sctChar->Length(): 0; |
|
21197 |
break; |
|
21198 |
} |
|
21199 |
case EAknSCTFullCase: |
|
21200 |
{ |
|
21201 |
sctChar = reader.ReadHBufCL(); |
|
21202 |
length += (sctChar != NULL)? sctChar->Length(): 0; |
|
21203 |
break; |
|
21204 |
} |
|
21205 |
case EAknSCTHalfCase: |
|
21206 |
{ |
|
21207 |
sctChar = reader.ReadHBufCL(); |
|
21208 |
length += (sctChar != NULL)? sctChar->Length(): 0; |
|
21209 |
break; |
|
21210 |
} |
|
21211 |
case EAknSCTQwerty: |
|
21212 |
{ |
|
21213 |
sctChar = reader.ReadHBufCL(); |
|
21214 |
length += (sctChar != NULL)? sctChar->Length(): 0; |
|
21215 |
break; |
|
21216 |
} |
|
21217 |
default: |
|
21218 |
break; |
|
21219 |
} |
|
21220 |
delete sctChar; |
|
21221 |
sctChar = NULL; |
|
21222 |
if(length > 0) |
|
21223 |
{ |
|
21224 |
isEmpty = EFalse; |
|
21225 |
break; |
|
21226 |
} |
|
21227 |
} |
|
21228 |
CleanupStack::PopAndDestroy(); //reader |
|
21229 |
return isEmpty; |
|
21230 |
} |
|
21231 |
||
21232 |
// ======================================== |
|
21233 |
// Update Editor State Flag |
|
21234 |
// Add editor state flags or |
|
21235 |
// Remove editor state flags |
|
21236 |
// ======================================== |
|
21237 |
void CAknFepManager::UpdateEditorStateFlags( TInt aFlag, TBool aAdd ) const |
|
21238 |
{ |
|
21239 |
CAknEdwinState* state( EditorState() ); |
|
21240 |
if ( state ) |
|
21241 |
{ |
|
21242 |
TInt flags( state->Flags() ); |
|
21243 |
if ( aAdd ) |
|
21244 |
{ |
|
21245 |
flags |= aFlag; // Add flag |
|
21246 |
} |
|
21247 |
else |
|
21248 |
{ |
|
21249 |
flags &= ~aFlag; // Remove flag |
|
21250 |
} |
|
21251 |
state->SetFlags( flags ); |
|
21252 |
} |
|
21253 |
} |
|
21254 |
||
21255 |
||
21256 |
// --------------------------------------------------------------------------- |
|
21257 |
// CAknFepManager::HandleFnKeyPressMonitorCallback |
|
21258 |
// Handle fnkey press monitor callback |
|
21259 |
// static function |
|
21260 |
// --------------------------------------------------------------------------- |
|
21261 |
// |
|
21262 |
TInt CAknFepManager::HandleFnKeyPressMonitorCallback(TAny* aObj) |
|
21263 |
{ |
|
21264 |
TRAPD(err, static_cast<CAknFepManager*>(aObj)->HandleFnKeyPressMonitor()); |
|
21265 |
if (err) |
|
21266 |
{ |
|
21267 |
static_cast<CAknFepManager*>(aObj)->CleanUpFep(); |
|
21268 |
return KErrDied; |
|
21269 |
} |
|
21270 |
return KErrNone; |
|
21271 |
} |
|
21272 |
||
21273 |
// --------------------------------------------------------------------------- |
|
21274 |
// CAknFepManager::HandleFnKeyPressMonitor |
|
21275 |
// Handle fnkey press monitor callback |
|
21276 |
// --------------------------------------------------------------------------- |
|
21277 |
// |
|
21278 |
void CAknFepManager::HandleFnKeyPressMonitor() |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
21279 |
{ |
50
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
21280 |
DeactivateFnkeyPressMonitor(); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
21281 |
if (IsExtendedFlagSet ( EExtendedFlagFnKeyNeedLockMode ) ) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
21282 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
21283 |
iFnKeyManager->SetFnKeyState(CAknFepFnKeyManager::EFnKeyLock); |
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
21284 |
} |
44 | 21285 |
} |
21286 |
||
21287 |
// --------------------------------------------------------------------------- |
|
21288 |
// CAknFepManager::ActivateFnkeyPressMonitor |
|
21289 |
// Activate Fnkey press Monitor |
|
21290 |
// --------------------------------------------------------------------------- |
|
21291 |
// |
|
21292 |
void CAknFepManager::ActivateFnkeyPressMonitor() |
|
21293 |
{ |
|
21294 |
if( iFnKeypressMonitor ) |
|
50
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
21295 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
21296 |
if ( iFnKeypressMonitor->IsActive() ) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
21297 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
21298 |
iFnKeypressMonitor->Cancel(); |
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
21299 |
} |
44 | 21300 |
iFnKeypressMonitor->Start(KFnKeyLongPressTimeout, KFnKeyLongPressTimeout, |
21301 |
TCallBack(HandleFnKeyPressMonitorCallback, this)); |
|
21302 |
} |
|
21303 |
} |
|
21304 |
||
21305 |
// --------------------------------------------------------------------------- |
|
21306 |
// CAknFepManager::DeactivateFnkeyPressMonitor |
|
21307 |
// Deactivate Fnkey press Monitor |
|
21308 |
// --------------------------------------------------------------------------- |
|
21309 |
// |
|
21310 |
void CAknFepManager::DeactivateFnkeyPressMonitor() |
|
21311 |
{ |
|
21312 |
if( iFnKeypressMonitor && iFnKeypressMonitor->IsActive()) |
|
21313 |
{ |
|
21314 |
iFnKeypressMonitor->Cancel(); |
|
21315 |
} |
|
21316 |
} |
|
21317 |
||
21318 |
// --------------------------------------------------------------------------- |
|
21319 |
// LOCAL METHODS |
|
21320 |
// |
|
21321 |
// --------------------------------------------------------------------------- |
|
21322 |
// |
|
21323 |
const TInt KVietKeyMarker = 0xffff; |
|
21324 |
const TUint16 vietnameseAccents[] = |
|
21325 |
{ |
|
21326 |
KVietKeyMarker, EPtiKey2, // For key 2, a-based |
|
21327 |
0x00c1, 0x00c0, 0x1ea2, 0x00c3, 0x1ea0, |
|
21328 |
0x00e1, 0x00e0, 0x1ea3, 0x00e3, 0x1ea1, |
|
21329 |
0x0102, 0x1eae, 0x1eb0, 0x1eb2, 0x1eb4, 0x1eb6, |
|
21330 |
0x0103, 0x1eaf, 0x1eb1, 0x1eb3, 0x1eb5, 0x1eb7, |
|
21331 |
0x00c2, 0x1ea4, 0x1ea6, 0x1ea8, 0x1eaa, 0x1eac, |
|
21332 |
0x00e2, 0x1ea5, 0x1ea7, 0x1ea9, 0x1eab, 0x1ead, |
|
21333 |
||
21334 |
KVietKeyMarker, EPtiKey3, // For key 3, e-based |
|
21335 |
0x00c9, 0x00c8, 0x1eba, 0x1ebc, 0x1eb8, |
|
21336 |
0x00e9, 0x00e8, 0x1ebb, 0x1ebd, 0x1eb9, |
|
21337 |
0x00ca, 0x1ebe, 0x1ec0, 0x1ec2, 0x1ec4, 0x1ec6, |
|
21338 |
0x00ea, 0x1ebf, 0x1ec1, 0x1ec3, 0x1ec5, 0x1ec7, |
|
21339 |
||
21340 |
KVietKeyMarker, EPtiKey4, // For key 4, i-based |
|
21341 |
0x00cd, 0x00cc, 0x1ec8, 0x0128, 0x1eca, |
|
21342 |
0x00ed, 0x00ec, 0x1ec9, 0x0129, 0x1ecb, |
|
21343 |
||
21344 |
KVietKeyMarker, EPtiKey6, // For key 6, o-based |
|
21345 |
0x00d3, 0x00d2, 0x1ece, 0x00d5, 0x1ecc, |
|
21346 |
0x00f3, 0x00f2, 0x1ecf, 0x00f5, 0x1ecd, |
|
21347 |
0x00d4, 0x1ed0, 0x1ed2, 0x1ed4, 0x1ed6, 0x1ed8, |
|
21348 |
0x00f4, 0x1ed1, 0x1ed3, 0x1ed5, 0x1ed7, 0x1ed9, |
|
21349 |
0x01a0, 0x1eda, 0x1edc, 0x1ede, 0x1ee0, 0x1ee2, |
|
21350 |
0x01a1, 0x1edb, 0x1edd, 0x1edf, 0x1ee1, 0x1ee3, |
|
21351 |
0 |
|
21352 |
}; |
|
21353 |
||
21354 |
||
21355 |
// --------------------------------------------------------------------------- |
|
21356 |
// RemapVietnameseAccentedCharacter |
|
21357 |
// |
|
21358 |
// --------------------------------------------------------------------------- |
|
21359 |
// |
|
21360 |
LOCAL_C TInt RemapVietnameseAccentedCharacter(TUint16 aChr) |
|
21361 |
{ |
|
21362 |
// Check tone marks first. |
|
21363 |
switch (aChr) |
|
21364 |
{ |
|
21365 |
case 0x0301: |
|
21366 |
return EPtiKey2; |
|
21367 |
case 0x0300: |
|
21368 |
return EPtiKey3; |
|
21369 |
case 0x0309: |
|
21370 |
return EPtiKey4; |
|
21371 |
case 0x0303: |
|
21372 |
return EPtiKey5; |
|
21373 |
case 0x0323: |
|
21374 |
return EPtiKey6; |
|
21375 |
default: |
|
21376 |
break; |
|
21377 |
} |
|
21378 |
||
21379 |
TInt ret = 0; |
|
21380 |
||
21381 |
for (const TUint16* ptr = vietnameseAccents; *ptr != 0; ptr++) |
|
21382 |
{ |
|
21383 |
if (*ptr == KVietKeyMarker) |
|
21384 |
{ |
|
21385 |
ret = ptr[1]; |
|
21386 |
ptr++; |
|
21387 |
} |
|
21388 |
else |
|
21389 |
{ |
|
21390 |
if (*ptr == aChr) |
|
21391 |
{ |
|
21392 |
break; |
|
21393 |
} |
|
21394 |
} |
|
21395 |
} |
|
21396 |
||
21397 |
return ret; |
|
21398 |
} |
|
21399 |
||
21400 |
// End of file |