|
1 /* |
|
2 * Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0"" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * CAknFepSharedDataInterface class |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 #include <w32std.h> |
|
31 #include <eikdef.h> |
|
32 #include <eikenv.h> |
|
33 #include <AknUtils.h> |
|
34 |
|
35 #include "AknFepSharedDataInterface.h" |
|
36 #include "AknFepManager.h" |
|
37 |
|
38 #include <centralrepository.h> |
|
39 #include <AknFepInternalCRKeys.h> |
|
40 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
41 #include <AknFepInternalPSKeys.h> |
|
42 #include <AknFepGlobalEnums.h> |
|
43 #include <PtiDefs.h> |
|
44 #endif |
|
45 #include <AvkonInternalCRKeys.h> // KAknQwertyInputModeActive |
|
46 #include <settingsinternalcrkeys.h> //Pen related settings |
|
47 #include <sensorplugindomaincrkeys.h> // KCRUidSensorSettings |
|
48 |
|
49 // TODO: include CommonengineInternalCRKeys.h |
|
50 const TUid KCRUidCommonEngineKeys = {0x1020503B}; |
|
51 const TUint32 KGSDisplayTxtLang = 0x00000001; |
|
52 |
|
53 const TInt KJapHwrConversion = 0x0010; |
|
54 |
|
55 #include <AknDef.h> |
|
56 |
|
57 CAknFepSharedDataInterface* CAknFepSharedDataInterface::NewL(CAknFepManager* aFepManager) |
|
58 { |
|
59 CAknFepSharedDataInterface* self = new (ELeave) CAknFepSharedDataInterface(aFepManager); |
|
60 CleanupStack::PushL(self); |
|
61 self->ConstructL(); |
|
62 CleanupStack::Pop(); //self |
|
63 return self; |
|
64 } |
|
65 |
|
66 |
|
67 CAknFepSharedDataInterface::~CAknFepSharedDataInterface() |
|
68 { |
|
69 delete iCommonEngineRepository; |
|
70 delete iAknFepRepositoryWatcher; |
|
71 delete iAknFepLocaleRepositoryWatcher; |
|
72 delete iAknFepRepository; |
|
73 delete iGsPenSettings; |
|
74 delete iLocaleRepository; |
|
75 delete iSensorRepository; |
|
76 |
|
77 if (iQwertyModeStatusSubscriber) |
|
78 { |
|
79 iQwertyModeStatusSubscriber->StopSubscribe(); |
|
80 } |
|
81 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
82 if (iKeyboardLayoutStatusSubscriber) |
|
83 { |
|
84 iKeyboardLayoutStatusSubscriber->StopSubscribe(); |
|
85 } |
|
86 iKeyboardLayoutStatusProperty.Close(); |
|
87 delete iKeyboardLayoutStatusSubscriber; |
|
88 #endif |
|
89 iQwertyModeStatusProperty.Close(); |
|
90 delete iQwertyModeStatusSubscriber; |
|
91 } |
|
92 |
|
93 |
|
94 TInt CAknFepSharedDataInterface::PredictiveTextOn() |
|
95 { |
|
96 TInt value = 0; |
|
97 if (iAknFepRepository) |
|
98 { |
|
99 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
100 TPtiKeyboardType layout = (TPtiKeyboardType)KeyboardLayout(); |
|
101 TInt temp = 0; |
|
102 iAknFepRepository->Get(KAknFepPredTxtFlagExtension, temp); |
|
103 switch(layout) |
|
104 { |
|
105 case EPtiKeyboardNone: |
|
106 break; |
|
107 case EPtiKeyboard12Key: |
|
108 temp &= EKeyboardStyle12Key; |
|
109 break; |
|
110 case EPtiKeyboardHalfQwerty: |
|
111 temp &= EKeyboardStyleHalfQwerty; |
|
112 break; |
|
113 case EPtiKeyboardQwerty4x12: |
|
114 case EPtiKeyboardQwerty4x10: |
|
115 case EPtiKeyboardQwerty3x11: |
|
116 case EPtiKeyboardCustomQwerty: |
|
117 temp &= EKeyboardStyleQwerty; |
|
118 break; |
|
119 default: |
|
120 break; |
|
121 } |
|
122 value = ( temp ? 1 : 0); |
|
123 #else |
|
124 iAknFepRepository->Get(KAknFepPredTxtFlag, value); |
|
125 #endif |
|
126 } |
|
127 return value; |
|
128 } |
|
129 |
|
130 TInt CAknFepSharedDataInterface::PredictiveTextJapaneseOn() |
|
131 { |
|
132 TInt value = 0; |
|
133 if (iAknFepRepository) |
|
134 { |
|
135 iAknFepRepository->Get(KAknFepJapanesePredTxtFlag, value); |
|
136 } |
|
137 return value; |
|
138 } |
|
139 |
|
140 TInt CAknFepSharedDataInterface::InputMode() |
|
141 { |
|
142 TUint value = 0; |
|
143 if (iAknFepRepository) |
|
144 { |
|
145 /* Teleca change begin, 03.07.2008 ssal |
|
146 original code: |
|
147 TPtrC filteredPtr(0,0); |
|
148 iAknFepRepository->Get(KAknFepChineseInputMode, value);*/ |
|
149 _LIT(Kx, "x"); |
|
150 // This conversion is needed because KAknFepChineseInputMode cenrep key original type was 16bit int. |
|
151 // now type is changed to string, so that it can accommodate bigger values like EHangul 0x16000. |
|
152 TBuf<CAknFepManager::EMaximumFepWordLength> conversion; |
|
153 iAknFepRepository->Get(KAknFepChineseInputMode, conversion); |
|
154 |
|
155 TInt len = conversion.Find(Kx); |
|
156 TLex lex; |
|
157 |
|
158 if(len) |
|
159 { |
|
160 TPtrC ptr = conversion.Mid(len +1); |
|
161 lex.Assign(ptr); |
|
162 } |
|
163 else |
|
164 { |
|
165 lex.Assign(conversion); |
|
166 } |
|
167 |
|
168 lex.Val(value, EHex); |
|
169 /* Teleca change end, 04.06.2008 ssal */ |
|
170 } |
|
171 return value; |
|
172 } |
|
173 |
|
174 void CAknFepSharedDataInterface::SetInputMode(TInt aInputMode) |
|
175 { |
|
176 if (iAknFepRepository) |
|
177 { |
|
178 /* Teleca change begin, 03.07.2008 ssal |
|
179 original code: |
|
180 iAknFepRepository->Set(KAknFepChineseInputMode, aInputMode);*/ |
|
181 |
|
182 // Please see the explanation on CAknFepSharedDataInterface::InputMode() method |
|
183 TBuf<CAknFepManager::EMaximumFepWordLength> conversion; |
|
184 conversion.Num(aInputMode, EHex); |
|
185 |
|
186 iAknFepRepository->Set(KAknFepChineseInputMode, conversion); |
|
187 /* Teleca change end, 04.06.2008 ssal */ |
|
188 } |
|
189 } |
|
190 |
|
191 TInt CAknFepSharedDataInterface::CangJieMode() |
|
192 { |
|
193 TInt value = 0; |
|
194 if (iAknFepRepository) |
|
195 { |
|
196 iAknFepRepository->Get(KAknFepCangJieMode, value); |
|
197 } |
|
198 return value; |
|
199 } |
|
200 |
|
201 void CAknFepSharedDataInterface::SetCangJieMode(TInt aNewCangJieMode) |
|
202 { |
|
203 if (iAknFepRepository) |
|
204 { |
|
205 iAknFepRepository->Set(KAknFepCangJieMode, aNewCangJieMode); |
|
206 } |
|
207 } |
|
208 |
|
209 TInt CAknFepSharedDataInterface::InputTextLanguage() |
|
210 { |
|
211 TInt value = 0; |
|
212 if (iAknFepRepository) |
|
213 { |
|
214 iAknFepRepository->Get(KAknFepInputTxtLang, value); |
|
215 } |
|
216 return TLanguage(value); |
|
217 } |
|
218 |
|
219 void CAknFepSharedDataInterface::SetInputTextLanguage(TInt aValue) |
|
220 { |
|
221 if (iAknFepRepository) |
|
222 { |
|
223 iAknFepRepository->Set(KAknFepInputTxtLang, aValue); |
|
224 } |
|
225 |
|
226 // now inform all open apps of the switch |
|
227 TWsEvent event; |
|
228 event.SetType(KEikInputLanguageChange); |
|
229 CEikonEnv::Static()->WsSession().SendEventToAllWindowGroups(event); |
|
230 } |
|
231 |
|
232 TInt CAknFepSharedDataInterface::DisplayLanguage() |
|
233 { |
|
234 TInt value = 0; |
|
235 if (iCommonEngineRepository) |
|
236 { |
|
237 iCommonEngineRepository->Get(KGSDisplayTxtLang, value); |
|
238 } |
|
239 return TLanguage(value); |
|
240 } |
|
241 |
|
242 void CAknFepSharedDataInterface::SetPredictiveTextOn() |
|
243 { |
|
244 if (iAknFepRepository) |
|
245 { |
|
246 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
247 TPtiKeyboardType layout = (TPtiKeyboardType)KeyboardLayout(); |
|
248 TInt value = 0; |
|
249 iAknFepRepository->Get(KAknFepPredTxtFlagExtension, value); |
|
250 switch(layout) |
|
251 { |
|
252 case EPtiKeyboardNone: |
|
253 // No keyboard active, so don't change anything |
|
254 break; |
|
255 case EPtiKeyboard12Key: |
|
256 value |= EKeyboardStyle12Key; |
|
257 break; |
|
258 case EPtiKeyboardHalfQwerty: |
|
259 value |= EKeyboardStyleHalfQwerty; |
|
260 break; |
|
261 case EPtiKeyboardQwerty4x12: |
|
262 case EPtiKeyboardQwerty4x10: |
|
263 case EPtiKeyboardQwerty3x11: |
|
264 case EPtiKeyboardCustomQwerty: |
|
265 value |= EKeyboardStyleQwerty; |
|
266 break; |
|
267 default: |
|
268 break; |
|
269 } |
|
270 iAknFepRepository->Set(KAknFepPredTxtFlagExtension, value); |
|
271 // For backwards compatibility |
|
272 if (value & EKeyboardStyle12Key) |
|
273 { |
|
274 iAknFepRepository->Set(KAknFepPredTxtFlag, 1); |
|
275 } |
|
276 #else |
|
277 iAknFepRepository->Set(KAknFepPredTxtFlag, 1); |
|
278 #endif |
|
279 } |
|
280 } |
|
281 |
|
282 |
|
283 void CAknFepSharedDataInterface::ResetPredictiveTextOn() |
|
284 { |
|
285 if (iAknFepRepository) |
|
286 { |
|
287 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
288 TPtiKeyboardType layout = (TPtiKeyboardType)KeyboardLayout(); |
|
289 TInt value = 0; |
|
290 iAknFepRepository->Get(KAknFepPredTxtFlagExtension, value); |
|
291 switch(layout) |
|
292 { |
|
293 case EPtiKeyboardNone: |
|
294 // No keyboard active, so don't change anything |
|
295 break; |
|
296 case EPtiKeyboard12Key: |
|
297 value &= ~EKeyboardStyle12Key; |
|
298 break; |
|
299 case EPtiKeyboardHalfQwerty: |
|
300 value &= ~EKeyboardStyleHalfQwerty; |
|
301 break; |
|
302 case EPtiKeyboardQwerty4x12: |
|
303 case EPtiKeyboardQwerty4x10: |
|
304 case EPtiKeyboardQwerty3x11: |
|
305 case EPtiKeyboardCustomQwerty: |
|
306 value &= ~EKeyboardStyleQwerty; |
|
307 break; |
|
308 default: |
|
309 break; |
|
310 } |
|
311 iAknFepRepository->Set(KAknFepPredTxtFlagExtension, value); |
|
312 // For backwards compatibility |
|
313 if (!(value & EKeyboardStyle12Key)) |
|
314 { |
|
315 iAknFepRepository->Set(KAknFepPredTxtFlag, 0); |
|
316 } |
|
317 #else |
|
318 iAknFepRepository->Set(KAknFepPredTxtFlag, 0); |
|
319 #endif |
|
320 } |
|
321 } |
|
322 |
|
323 void CAknFepSharedDataInterface::SetJapanesePredictiveTextOn() |
|
324 { |
|
325 if (iAknFepRepository) |
|
326 { |
|
327 iAknFepRepository->Set(KAknFepJapanesePredTxtFlag, 1); |
|
328 } |
|
329 } |
|
330 |
|
331 |
|
332 void CAknFepSharedDataInterface::ResetJapanesePredictiveTextOn() |
|
333 { |
|
334 if (iAknFepRepository) |
|
335 { |
|
336 iAknFepRepository->Set(KAknFepJapanesePredTxtFlag, 0); |
|
337 } |
|
338 } |
|
339 |
|
340 TInt CAknFepSharedDataInterface::PluginInputMode() const |
|
341 { |
|
342 TInt value = 0; |
|
343 if (iAknFepRepository) |
|
344 { |
|
345 iAknFepRepository->Get(KAknFepLastUsedInput, value); |
|
346 } |
|
347 return value; |
|
348 } |
|
349 |
|
350 void CAknFepSharedDataInterface::SetPluginInputMode(TInt aDevice) |
|
351 { |
|
352 if (iAknFepRepository) |
|
353 { |
|
354 iAknFepRepository->Set(KAknFepLastUsedInput, aDevice); |
|
355 } |
|
356 } |
|
357 |
|
358 TInt CAknFepSharedDataInterface::PluginUILanguage() const |
|
359 { |
|
360 TInt value = 0; |
|
361 if (iAknFepRepository) |
|
362 { |
|
363 //iAknFepRepository->Create(KAknFepLastUsedUILanguage, 0); //?? |
|
364 iAknFepRepository->Get(KAknFepLastUsedUILanguage, value); |
|
365 } |
|
366 return value; |
|
367 } |
|
368 |
|
369 void CAknFepSharedDataInterface::SetPluginUILanguage(TInt aLanguage) |
|
370 { |
|
371 if (iAknFepRepository) |
|
372 { |
|
373 iAknFepRepository->Set(KAknFepLastUsedUILanguage, aLanguage); |
|
374 } |
|
375 } |
|
376 |
|
377 void CAknFepSharedDataInterface::SetDefaultNumberMode( TInt aMode, TInt aValue ) |
|
378 { |
|
379 if (iLocaleRepository) |
|
380 { |
|
381 iLocaleRepository->Set(aMode, aValue); |
|
382 } |
|
383 } |
|
384 |
|
385 |
|
386 TInt CAknFepSharedDataInterface::PenInputLanguage() const |
|
387 { |
|
388 TInt value = 0; |
|
389 if (iAknFepRepository) |
|
390 { |
|
391 iAknFepRepository->Get(KAknFepInputTxtLang, value); |
|
392 } |
|
393 return value; |
|
394 } |
|
395 |
|
396 TInt CAknFepSharedDataInterface::ScrollLatinPredictiveCandidates() const |
|
397 { |
|
398 return iSharedDataScrollLatinPredictive; |
|
399 } |
|
400 |
|
401 TInt CAknFepSharedDataInterface::SpaceWithScrollRight() const |
|
402 { |
|
403 return iSharedDataSpaceWithScrollRight; |
|
404 } |
|
405 |
|
406 TInt CAknFepSharedDataInterface::EntersWithScrollDown() const |
|
407 { |
|
408 return iSharedDataEnterWithScrollDown; |
|
409 } |
|
410 |
|
411 TInt CAknFepSharedDataInterface::QwertyInputMode() //const |
|
412 { |
|
413 TInt value = 0; |
|
414 iQwertyModeStatusProperty.Get(value); |
|
415 return value; |
|
416 } |
|
417 |
|
418 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
419 TInt CAknFepSharedDataInterface::KeyboardLayout() //const |
|
420 { |
|
421 TInt value = 0; |
|
422 iKeyboardLayoutStatusProperty.Get(value); |
|
423 return value; |
|
424 } |
|
425 |
|
426 #ifdef FF_DUAL_LANGUAGE_SUPPORT |
|
427 TInt CAknFepSharedDataInterface::InputTextLanguageSecondary() |
|
428 { |
|
429 TInt value = 0; |
|
430 if (iAknFepRepository) |
|
431 { |
|
432 iAknFepRepository->Get(KAknFepInputTxtLangSecondary, value); |
|
433 } |
|
434 return TLanguage(value); |
|
435 } |
|
436 |
|
437 void CAknFepSharedDataInterface::SetInputTextLanguageSecondary(TInt aValue) |
|
438 { |
|
439 if (iAknFepRepository) |
|
440 { |
|
441 iAknFepRepository->Set(KAknFepInputTxtLangSecondary, aValue); |
|
442 } |
|
443 |
|
444 // now inform all open apps of the switch |
|
445 // same event as primary input language change |
|
446 TWsEvent event; |
|
447 event.SetType(KEikInputLanguageChange); |
|
448 CEikonEnv::Static()->WsSession().SendEventToAllWindowGroups(event); |
|
449 } |
|
450 |
|
451 #endif //FF_DUAL_LANGUAGE_SUPPORT |
|
452 #endif |
|
453 |
|
454 CAknFepSharedDataInterface::CAknFepSharedDataInterface(CAknFepManager* aFepManager) |
|
455 { |
|
456 iFepManager = aFepManager; |
|
457 } |
|
458 |
|
459 |
|
460 void CAknFepSharedDataInterface::ConstructL() |
|
461 { |
|
462 TInt ret = KErrNone; |
|
463 |
|
464 TRAP(ret, iCommonEngineRepository = CRepository::NewL(KCRUidCommonEngineKeys)); |
|
465 |
|
466 TRAP(ret, iAknFepRepository = CRepository::NewL(KCRUidAknFep)); |
|
467 if (ret == KErrNone) |
|
468 { |
|
469 iAknFepRepositoryWatcher = CAknFepRepositoryWatcher::NewL( |
|
470 KCRUidAknFep, |
|
471 TCallBack(HandleRepositoryCallBack, this), |
|
472 iAknFepRepository); |
|
473 HandleHashKeySelectionChange();//we need read proactively before value changed,and we must sure the iAknFepRepository has been constructed |
|
474 } |
|
475 |
|
476 TRAP(ret, iLocaleRepository = CRepository::NewL( KCRUidLocaleSettings )); |
|
477 |
|
478 if (ret == KErrNone) |
|
479 { |
|
480 iAknFepLocaleRepositoryWatcher = CAknFepRepositoryWatcher::NewL( |
|
481 KCRUidLocaleSettings, |
|
482 TCallBack(HandleLocaleRepositoryCallBack, this), |
|
483 iLocaleRepository); |
|
484 } |
|
485 |
|
486 User::LeaveIfError(iQwertyModeStatusProperty.Attach(KCRUidAvkon, KAknQwertyInputModeActive)); |
|
487 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
488 //Attach the P&S property to the keyboardlayout and subscribe to the P&S framework |
|
489 // for any keyboard layout change. |
|
490 User::LeaveIfError(iKeyboardLayoutStatusProperty.Attach(KCRUidAvkon, KAknKeyBoardLayout)); |
|
491 iKeyboardLayoutStatusSubscriber = new (ELeave) CSubscriber( |
|
492 TCallBack(HandleKeyboardLayoutChangeNotification, this), |
|
493 iKeyboardLayoutStatusProperty); |
|
494 iKeyboardLayoutStatusSubscriber->SubscribeL(); |
|
495 #endif |
|
496 iQwertyModeStatusSubscriber = new (ELeave) CSubscriber( |
|
497 TCallBack(QwertyModeChangeNotification, this), |
|
498 iQwertyModeStatusProperty); |
|
499 iQwertyModeStatusSubscriber->SubscribeL(); |
|
500 |
|
501 // Read read-only shared data settings. |
|
502 if (iAknFepRepository) |
|
503 { |
|
504 iAknFepRepository->Get(KAknFepScrollLatinPredictive, iSharedDataScrollLatinPredictive); |
|
505 iAknFepRepository->Get(KAknFepSpaceWithScrollRight, iSharedDataSpaceWithScrollRight); |
|
506 iAknFepRepository->Get(KAknFepEnterWithScrollDown, iSharedDataEnterWithScrollDown); |
|
507 } |
|
508 |
|
509 TRAP(ret, iGsPenSettings = CRepository::NewL(KCRUidPersonalizationSettings)); |
|
510 |
|
511 TRAP(ret, iSensorRepository = CRepository::NewL( KCRUidSensorSettings ) ); |
|
512 } |
|
513 |
|
514 TInt CAknFepSharedDataInterface::HashKeySelectionNotification(TAny* aObj) |
|
515 { |
|
516 if (aObj) |
|
517 { |
|
518 static_cast<CAknFepSharedDataInterface*>(aObj)->HandleHashKeySelectionChange(); |
|
519 return KErrNone; |
|
520 } |
|
521 else |
|
522 { |
|
523 return KErrArgument; |
|
524 } |
|
525 } |
|
526 |
|
527 void CAknFepSharedDataInterface::HandleHashKeySelectionChange() |
|
528 { |
|
529 TInt value(0); |
|
530 |
|
531 if (iAknFepRepository) |
|
532 { |
|
533 iAknFepRepository->Get(KAknFepHashKeySelection, value); |
|
534 } |
|
535 |
|
536 iHashKeySelectionInUse = value; |
|
537 } |
|
538 |
|
539 |
|
540 TInt CAknFepSharedDataInterface::InputModeChangeGSNotification(TAny* aObj) |
|
541 { |
|
542 if (aObj) |
|
543 { |
|
544 static_cast<CAknFepSharedDataInterface*>(aObj)->HandleInputModeGSChange(); |
|
545 return KErrNone; |
|
546 } |
|
547 else |
|
548 { |
|
549 return KErrArgument; |
|
550 } |
|
551 } |
|
552 |
|
553 void CAknFepSharedDataInterface::HandleInputModeGSChange() |
|
554 { |
|
555 iFepManager->SetFlag(CAknFepManager::EFlagNewSharedDataInputMode); |
|
556 } |
|
557 |
|
558 TInt CAknFepSharedDataInterface::InputTextLangGSNotification(TAny* aObj) |
|
559 { |
|
560 if (aObj) |
|
561 { |
|
562 static_cast<CAknFepSharedDataInterface*>(aObj)->HandleInputTextLanguageGSChange(); |
|
563 return KErrNone; |
|
564 } |
|
565 else |
|
566 { |
|
567 return KErrArgument; |
|
568 } |
|
569 } |
|
570 |
|
571 void CAknFepSharedDataInterface::HandleInputTextLanguageGSChange() |
|
572 { |
|
573 iFepManager->SetFlag(CAknFepManager::EFlagNewSharedDataInputLanguage); |
|
574 ESubVariantFlag subVariant = AknLayoutUtils::SubVariant(); |
|
575 if((AknLayoutUtils::Variant() == EApacVariant) |
|
576 && ((subVariant == EPrcSubVariant) |
|
577 || (subVariant == EHongKongSubVariant) |
|
578 || (subVariant == ETaiwanSubVariant))) |
|
579 { |
|
580 iFepManager->SetFlag(CAknFepManager::EFlagNewSharedDataInputMode); |
|
581 } |
|
582 } |
|
583 |
|
584 |
|
585 TInt CAknFepSharedDataInterface::PredictiveTextSettingChangeGSNotification(TAny* aObj) |
|
586 { |
|
587 if (aObj) |
|
588 { |
|
589 static_cast<CAknFepSharedDataInterface*>(aObj)->HandlePredictiveTextSettingGSChange(); |
|
590 return KErrNone; |
|
591 } |
|
592 else |
|
593 { |
|
594 return KErrArgument; |
|
595 } |
|
596 } |
|
597 |
|
598 TInt CAknFepSharedDataInterface::JapanesePredictiveTextSettingChangeGSNotification(TAny* aObj) |
|
599 { |
|
600 if (aObj) |
|
601 { |
|
602 static_cast<CAknFepSharedDataInterface*>(aObj)->HandleJapanesePredictiveTextSettingGSChange(); |
|
603 return KErrNone; |
|
604 } |
|
605 else |
|
606 { |
|
607 return KErrArgument; |
|
608 } |
|
609 } |
|
610 |
|
611 TInt CAknFepSharedDataInterface::QwertyModeChangeNotification(TAny* aObj) |
|
612 { |
|
613 if (aObj) |
|
614 { |
|
615 static_cast<CAknFepSharedDataInterface*>(aObj)->HandleQwertyModeChangeNotification(); |
|
616 return KErrNone; |
|
617 } |
|
618 else |
|
619 { |
|
620 return KErrArgument; |
|
621 } |
|
622 } |
|
623 |
|
624 void CAknFepSharedDataInterface::HandlePredictiveTextSettingGSChange() |
|
625 { |
|
626 TInt value = 0; |
|
627 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
628 if (iAknFepRepository) |
|
629 { |
|
630 iAknFepRepository->Get(KAknFepPredTxtFlagExtension, value); |
|
631 } |
|
632 TPtiKeyboardType layout = (TPtiKeyboardType)KeyboardLayout(); |
|
633 switch(layout) |
|
634 { |
|
635 case EPtiKeyboardNone: |
|
636 break; |
|
637 case EPtiKeyboard12Key: |
|
638 value &= EKeyboardStyle12Key; |
|
639 break; |
|
640 case EPtiKeyboardHalfQwerty: |
|
641 value &= EKeyboardStyleHalfQwerty; |
|
642 break; |
|
643 case EPtiKeyboardQwerty4x12: |
|
644 case EPtiKeyboardQwerty4x10: |
|
645 case EPtiKeyboardQwerty3x11: |
|
646 case EPtiKeyboardCustomQwerty: |
|
647 value &= EKeyboardStyleQwerty; |
|
648 break; |
|
649 default: |
|
650 break; |
|
651 } |
|
652 if (value > 0) |
|
653 { |
|
654 value = 1; |
|
655 } |
|
656 #else |
|
657 if (iAknFepRepository) |
|
658 { |
|
659 iAknFepRepository->Get(KAknFepPredTxtFlag, value); |
|
660 } |
|
661 #endif |
|
662 iFepManager->SetWesternPredictive(value); |
|
663 } |
|
664 |
|
665 void CAknFepSharedDataInterface::HandleJapanesePredictiveTextSettingGSChange() |
|
666 { |
|
667 TInt value = 0; |
|
668 if (iAknFepRepository) |
|
669 { |
|
670 iAknFepRepository->Get(KAknFepJapanesePredTxtFlag, value); |
|
671 } |
|
672 iFepManager->SetJapanesePredictive(value); |
|
673 } |
|
674 |
|
675 void CAknFepSharedDataInterface::HandleQwertyModeChangeNotification() |
|
676 { |
|
677 TInt value = 0; |
|
678 iQwertyModeStatusProperty.Get(value); |
|
679 iFepManager->SetQwertyMode(value); |
|
680 } |
|
681 |
|
682 TInt CAknFepSharedDataInterface::NumberModeChangesGSNotification() |
|
683 { |
|
684 iFepManager->NumberModeChangeGSNotification(); |
|
685 return KErrNone; |
|
686 } |
|
687 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
688 |
|
689 // |
|
690 //Intensionally not called methods |
|
691 // JapanesePredictiveTextSettingChangeGSNotification() |
|
692 // MultiTapTimerChangeGSNotification() |
|
693 // JapaneseQwertyFlagsChangeGSNotification() |
|
694 // PredictiveTextAutoCompleteSettingChangeGSNotification() - Autocompletion feature |
|
695 // |
|
696 TInt CAknFepSharedDataInterface::HandleGenericRepositoryChange(TAny* aPtr) |
|
697 { |
|
698 CAknFepSharedDataInterface *self = STATIC_CAST(CAknFepSharedDataInterface*, aPtr); |
|
699 TInt error = KErrNone; |
|
700 if(self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepChineseInputMode) |
|
701 { |
|
702 error = InputModeChangeGSNotification(aPtr); |
|
703 } |
|
704 if(self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepInputTxtLang) |
|
705 { |
|
706 error = InputTextLangGSNotification(aPtr); |
|
707 } |
|
708 if(self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepPredTxtFlag) |
|
709 { |
|
710 error = PredictiveTextSettingChangeGSNotification(aPtr); |
|
711 } |
|
712 if(self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepAutoCompleteFlag) |
|
713 { |
|
714 error = PredictiveTextAutoCompleteSettingChangeGSNotification(aPtr); |
|
715 } |
|
716 if(self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepTypingCorrectionLevel) |
|
717 { |
|
718 error = PredictiveTextTypingCorrectionLevelChangeNotification(aPtr); |
|
719 } |
|
720 if(self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepNumberCandidateFlag) |
|
721 { |
|
722 error = PredictiveTextNumberCandidateSettingChangeNotification(aPtr); |
|
723 } |
|
724 if(self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepPrimaryCandidateFlag) |
|
725 { |
|
726 error = PredictiveTextPrimaryCandidateChangeNotification(aPtr); |
|
727 } |
|
728 |
|
729 return error; |
|
730 } |
|
731 #endif |
|
732 TInt CAknFepSharedDataInterface::HandleRepositoryCallBack(TAny* aPtr) |
|
733 { |
|
734 CAknFepSharedDataInterface *self = STATIC_CAST(CAknFepSharedDataInterface*, aPtr); |
|
735 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
736 if(self->iAknFepRepositoryWatcher->IsGenericCenrepChange()) |
|
737 { |
|
738 return HandleGenericRepositoryChange(aPtr); |
|
739 } |
|
740 else |
|
741 #endif |
|
742 if (self->iAknFepRepositoryWatcher) |
|
743 { |
|
744 if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepHashKeySelection) |
|
745 { |
|
746 return HashKeySelectionNotification(aPtr); |
|
747 } |
|
748 if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepChineseInputMode) |
|
749 { |
|
750 return InputModeChangeGSNotification(aPtr); |
|
751 } |
|
752 else if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepInputTxtLang) |
|
753 { |
|
754 return InputTextLangGSNotification(aPtr); |
|
755 } |
|
756 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
757 #ifdef FF_DUAL_LANGUAGE_SUPPORT |
|
758 else if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepInputTxtLangSecondary) |
|
759 { |
|
760 return InputTextLangGSNotification(aPtr); |
|
761 } |
|
762 #endif //FF_DUAL_LANGUAGE_SUPPORT |
|
763 #endif |
|
764 else if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepPredTxtFlag) |
|
765 { |
|
766 return PredictiveTextSettingChangeGSNotification(aPtr); |
|
767 } |
|
768 else if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepJapanesePredTxtFlag) |
|
769 { |
|
770 return JapanesePredictiveTextSettingChangeGSNotification(aPtr); |
|
771 } |
|
772 else if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepMultiTapTimer) |
|
773 { |
|
774 return MultiTapTimerChangeGSNotification(aPtr); |
|
775 } |
|
776 else if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepJapaneseSpecialCharFlag) |
|
777 { |
|
778 return JapaneseQwertyFlagsChangeGSNotification(aPtr); |
|
779 } |
|
780 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
781 else if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepAutoCompleteFlag) |
|
782 { |
|
783 return PredictiveTextAutoCompleteSettingChangeGSNotification(aPtr); |
|
784 } |
|
785 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
786 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
787 else if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepAutoCompleteFlag) |
|
788 { |
|
789 return PredictiveTextAutoCompleteSettingChangeGSNotification(aPtr); |
|
790 } |
|
791 else if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepTypingCorrectionLevel) |
|
792 { |
|
793 return PredictiveTextTypingCorrectionLevelChangeNotification(aPtr); |
|
794 } |
|
795 else if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepNumberCandidateFlag) |
|
796 { |
|
797 return PredictiveTextNumberCandidateSettingChangeNotification(aPtr); |
|
798 } |
|
799 else if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepPrimaryCandidateFlag) |
|
800 { |
|
801 return PredictiveTextPrimaryCandidateChangeNotification(aPtr); |
|
802 } |
|
803 else if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepPredTxtFlagExtension) |
|
804 { |
|
805 return PredictiveTextSettingChangeGSNotification(aPtr); |
|
806 } |
|
807 #endif |
|
808 } |
|
809 |
|
810 return KErrNone; |
|
811 } |
|
812 |
|
813 TInt CAknFepSharedDataInterface::HandleLocaleRepositoryCallBack(TAny* aPtr) |
|
814 { |
|
815 CAknFepSharedDataInterface *self = STATIC_CAST(CAknFepSharedDataInterface*, aPtr); |
|
816 |
|
817 if(self->iAknFepLocaleRepositoryWatcher) |
|
818 { |
|
819 if (self->iAknFepLocaleRepositoryWatcher->ChangedKey() == KSettingsDefaultNumberMode |
|
820 || self->iAknFepLocaleRepositoryWatcher->ChangedKey() == KSettingsIndicDefaultNumberMode) |
|
821 { |
|
822 return self->NumberModeChangesGSNotification(); |
|
823 } |
|
824 } |
|
825 return KErrNone; |
|
826 } |
|
827 |
|
828 CAknFepSharedDataInterface::CSubscriber::CSubscriber(TCallBack aCallBack, RProperty& aProperty) |
|
829 : |
|
830 CActive(EPriorityNormal), iCallBack(aCallBack), iProperty(aProperty) |
|
831 { |
|
832 CActiveScheduler::Add(this); |
|
833 } |
|
834 |
|
835 CAknFepSharedDataInterface::CSubscriber::~CSubscriber() |
|
836 { |
|
837 Cancel(); |
|
838 } |
|
839 |
|
840 void CAknFepSharedDataInterface::CSubscriber::SubscribeL() |
|
841 { |
|
842 if (!IsActive()) |
|
843 { |
|
844 iProperty.Subscribe(iStatus); |
|
845 SetActive(); |
|
846 } |
|
847 } |
|
848 |
|
849 void CAknFepSharedDataInterface::CSubscriber::StopSubscribe() |
|
850 { |
|
851 Cancel(); |
|
852 } |
|
853 |
|
854 void CAknFepSharedDataInterface::CSubscriber::RunL() |
|
855 { |
|
856 if (iStatus.Int() == KErrNone) |
|
857 { |
|
858 iCallBack.CallBack(); |
|
859 SubscribeL(); |
|
860 } |
|
861 } |
|
862 |
|
863 void CAknFepSharedDataInterface::CSubscriber::DoCancel() |
|
864 { |
|
865 iProperty.Cancel(); |
|
866 } |
|
867 |
|
868 |
|
869 TInt CAknFepSharedDataInterface::EditSubmenuInUse() const |
|
870 { |
|
871 TInt value = 0; |
|
872 if (iAknFepRepository) |
|
873 { |
|
874 iAknFepRepository->Get(KAknFepHashKeySelection, value); |
|
875 } |
|
876 |
|
877 return value; |
|
878 } |
|
879 |
|
880 |
|
881 |
|
882 TInt CAknFepSharedDataInterface::HashKeySelectionInUse() |
|
883 { |
|
884 // This is never used in qwerty modes. |
|
885 if (QwertyInputMode()) |
|
886 { |
|
887 return 0; |
|
888 } |
|
889 |
|
890 TInt value = 0; |
|
891 if (iAknFepRepository) |
|
892 { |
|
893 iAknFepRepository->Get(KAknFepHashKeySelection, value); |
|
894 } |
|
895 |
|
896 return iHashKeySelectionInUse; |
|
897 } |
|
898 |
|
899 |
|
900 CAknFepRepositoryWatcher* CAknFepRepositoryWatcher::NewL( |
|
901 const TUid aUid, |
|
902 const TUint32 aKey, |
|
903 CCenRepNotifyHandler::TCenRepKeyType aKeyType, |
|
904 TCallBack aCallBack, |
|
905 CRepository* aRepository) |
|
906 { |
|
907 CAknFepRepositoryWatcher* self = new(ELeave) CAknFepRepositoryWatcher(aUid, aKey, aCallBack, |
|
908 aRepository); |
|
909 |
|
910 CleanupStack::PushL(self); |
|
911 self->ConstructL(aKeyType); |
|
912 CleanupStack::Pop(self); |
|
913 |
|
914 return self; |
|
915 } |
|
916 |
|
917 CAknFepRepositoryWatcher* CAknFepRepositoryWatcher::NewL( |
|
918 const TUid aUid, |
|
919 TCallBack aCallBack, |
|
920 CRepository* aRepository) |
|
921 { |
|
922 CAknFepRepositoryWatcher* self = new(ELeave) CAknFepRepositoryWatcher(aUid, |
|
923 NCentralRepositoryConstants::KInvalidNotificationId, |
|
924 aCallBack, aRepository); |
|
925 |
|
926 CleanupStack::PushL(self); |
|
927 self->ConstructL(); |
|
928 CleanupStack::Pop(self); |
|
929 |
|
930 return self; |
|
931 } |
|
932 |
|
933 CAknFepRepositoryWatcher::~CAknFepRepositoryWatcher() |
|
934 { |
|
935 if( iNotifyHandler ) |
|
936 { |
|
937 iNotifyHandler->StopListening(); |
|
938 delete iNotifyHandler; |
|
939 iNotifyHandler = NULL; |
|
940 } |
|
941 } |
|
942 |
|
943 CAknFepRepositoryWatcher::CAknFepRepositoryWatcher( |
|
944 const TUid aUid, |
|
945 const TUint32 aKey, |
|
946 TCallBack aCallBack, |
|
947 CRepository* aRepository) |
|
948 : |
|
949 iUid(aUid), iKey(aKey), iCallBack(aCallBack), iRepository(aRepository) |
|
950 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
951 , iIsGeneric (EFalse) |
|
952 #endif |
|
953 { |
|
954 } |
|
955 |
|
956 void CAknFepRepositoryWatcher::ConstructL(CCenRepNotifyHandler::TCenRepKeyType aKeyType) |
|
957 { |
|
958 iNotifyHandler = CCenRepNotifyHandler::NewL(*this, *iRepository, aKeyType, iKey); |
|
959 iNotifyHandler->StartListeningL(); |
|
960 } |
|
961 |
|
962 void CAknFepRepositoryWatcher::ConstructL() |
|
963 { |
|
964 iNotifyHandler = CCenRepNotifyHandler::NewL(*this, *iRepository); |
|
965 iNotifyHandler->StartListeningL(); |
|
966 } |
|
967 |
|
968 TUint32 CAknFepRepositoryWatcher::ChangedKey() |
|
969 { |
|
970 return iChangedKey; |
|
971 } |
|
972 |
|
973 void CAknFepRepositoryWatcher::HandleNotifyInt(TUint32 aKey, TInt aNewValue) |
|
974 { |
|
975 #ifdef _DEBUG |
|
976 RDebug::Print(_L("AknFep: HandleNotifyInt aKey=%d, aNewValue=%d"), aKey, aNewValue); |
|
977 #endif |
|
978 iChangedKey = aKey; |
|
979 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
980 iIsGeneric = EFalse; |
|
981 #endif |
|
982 iCallBack.CallBack(); |
|
983 iChangedKey = NCentralRepositoryConstants::KInvalidNotificationId; |
|
984 } |
|
985 |
|
986 void CAknFepRepositoryWatcher::HandleNotifyError(TUint32 /*aKey*/, TInt /*aError*/, CCenRepNotifyHandler* /*aHandler*/) |
|
987 { |
|
988 } |
|
989 |
|
990 /* |
|
991 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
992 void CAknFepRepositoryWatcher::HandleNotifyGeneric(TUint32 aId) |
|
993 { |
|
994 #ifdef _DEBUG |
|
995 RDebug::Print(_L("AknFep: HandleNotifyGeneric aId=%d"), aId); |
|
996 #endif |
|
997 iChangedKey = aId; |
|
998 iIsGeneric = ETrue; |
|
999 iCallBack.CallBack(); |
|
1000 iChangedKey = NCentralRepositoryConstants::KInvalidNotificationId; |
|
1001 } |
|
1002 #else*/ |
|
1003 |
|
1004 void CAknFepRepositoryWatcher::HandleNotifyGeneric(TUint32 aId) |
|
1005 { |
|
1006 #ifdef _DEBUG |
|
1007 RDebug::Print(_L("AknFep: HandleNotifyGeneric aId=%d"), aId); |
|
1008 #endif |
|
1009 iChangedKey = aId; |
|
1010 iCallBack.CallBack(); |
|
1011 iChangedKey = NCentralRepositoryConstants::KInvalidNotificationId; |
|
1012 } |
|
1013 //#endif |
|
1014 |
|
1015 /** |
|
1016 * Multitap timer value. |
|
1017 * Replaces the constant KMultiTapTimeoutMS in Japanese variant. |
|
1018 * |
|
1019 * @since 3.0 |
|
1020 * @return Value of KAknFepMultiTapTimer setting. |
|
1021 */ |
|
1022 TInt CAknFepSharedDataInterface::MultiTapTimer() const |
|
1023 { |
|
1024 TInt value = 1000000; |
|
1025 if (iAknFepRepository) |
|
1026 { |
|
1027 iAknFepRepository->Get(KAknFepMultiTapTimer, value); |
|
1028 } |
|
1029 return value; |
|
1030 } |
|
1031 |
|
1032 /** |
|
1033 * Change notification for Multitap timer. |
|
1034 * |
|
1035 * @since 3.0 |
|
1036 * @return return KErrNone if aObj isn't NULL |
|
1037 * return KErrArgument if aObj is NULL |
|
1038 */ |
|
1039 TInt CAknFepSharedDataInterface::MultiTapTimerChangeGSNotification(TAny* aObj) |
|
1040 { |
|
1041 if (aObj) |
|
1042 { |
|
1043 static_cast<CAknFepSharedDataInterface*>(aObj)->HandleMultiTapTimerChangeGSNotification(); |
|
1044 return KErrNone; |
|
1045 } |
|
1046 else |
|
1047 { |
|
1048 return KErrArgument; |
|
1049 } |
|
1050 } |
|
1051 |
|
1052 /** |
|
1053 * Handle change notification for Multitap timer. |
|
1054 * |
|
1055 * @since 3.0 |
|
1056 */ |
|
1057 void CAknFepSharedDataInterface::HandleMultiTapTimerChangeGSNotification() |
|
1058 { |
|
1059 TInt value = MultiTapTimer(); |
|
1060 iFepManager->SetMultiTapTimer(value); |
|
1061 } |
|
1062 |
|
1063 /** |
|
1064 * Japanese Qwerty Flags value. |
|
1065 * Replaces the constant KAknFepJapaneseSpecialCharFlag in Japanese variant. |
|
1066 * |
|
1067 * @since 3.0 |
|
1068 * @return Value of KAknFepJapaneseSpecialCharFlag setting. |
|
1069 */ |
|
1070 TInt CAknFepSharedDataInterface::JapaneseQwertyFlags() const |
|
1071 { |
|
1072 TInt value = 0x000F; |
|
1073 if (iAknFepRepository) |
|
1074 { |
|
1075 iAknFepRepository->Get(KAknFepJapaneseSpecialCharFlag, value); |
|
1076 } |
|
1077 return value; |
|
1078 } |
|
1079 |
|
1080 /** |
|
1081 * Change notification for Japanese Qwerty Flags. |
|
1082 * |
|
1083 * @since 3.0 |
|
1084 * @return return KErrNone if aObj isn't NULL |
|
1085 * return KErrArgument if aObj is NULL |
|
1086 */ |
|
1087 TInt CAknFepSharedDataInterface::JapaneseQwertyFlagsChangeGSNotification(TAny* aObj) |
|
1088 { |
|
1089 if (aObj) |
|
1090 { |
|
1091 static_cast<CAknFepSharedDataInterface*>(aObj)->HandleJapaneseQwertyFlagsChangeGSNotification(); |
|
1092 return KErrNone; |
|
1093 } |
|
1094 else |
|
1095 { |
|
1096 return KErrArgument; |
|
1097 } |
|
1098 } |
|
1099 |
|
1100 /** |
|
1101 * Handle change notification for Japanese Qwerty Flags. |
|
1102 * |
|
1103 * @since 3.0 |
|
1104 */ |
|
1105 void CAknFepSharedDataInterface::HandleJapaneseQwertyFlagsChangeGSNotification() |
|
1106 { |
|
1107 TInt value = JapaneseQwertyFlags(); |
|
1108 iFepManager->SetJapaneseQwertyFlags(value); |
|
1109 } |
|
1110 |
|
1111 /** |
|
1112 * Returns a value of current clear direction. |
|
1113 * |
|
1114 * @since 3.2 |
|
1115 * @return Value of KAknFepClearDirection setting. |
|
1116 */ |
|
1117 TInt CAknFepSharedDataInterface::ClearDirection() const |
|
1118 { |
|
1119 TInt value = EClearDirectionLeft; |
|
1120 if (iAknFepRepository) |
|
1121 { |
|
1122 iAknFepRepository->Get(KAknFepClearDirection, value); |
|
1123 } |
|
1124 return value; |
|
1125 } |
|
1126 |
|
1127 /** |
|
1128 * Set a value of current clear direction. |
|
1129 * |
|
1130 * @since 3.2 |
|
1131 * @param aValue new value set to Clear Direction shared data item which |
|
1132 * represents the direction currently being used |
|
1133 */ |
|
1134 void CAknFepSharedDataInterface::SetClearDirection(TInt aValue) |
|
1135 { |
|
1136 if (iAknFepRepository) |
|
1137 { |
|
1138 iAknFepRepository->Set(KAknFepClearDirection, aValue); |
|
1139 } |
|
1140 } |
|
1141 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
1142 TInt CAknFepSharedDataInterface::HandleKeyboardLayoutChangeNotification(TAny* aObj) |
|
1143 { |
|
1144 if (aObj) |
|
1145 { |
|
1146 static_cast<CAknFepSharedDataInterface*>(aObj)->HandleKeyboardLayoutChange(); |
|
1147 return KErrNone; |
|
1148 } |
|
1149 else |
|
1150 { |
|
1151 return KErrArgument; |
|
1152 } |
|
1153 } |
|
1154 #endif |
|
1155 |
|
1156 |
|
1157 void CAknFepSharedDataInterface::SetPredictiveTextAutoCompleteOn() |
|
1158 { |
|
1159 if (iAknFepRepository) |
|
1160 { |
|
1161 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
1162 //Set autocomplete flag only for the current keyboard layout type. Otherwise, |
|
1163 //by simply setting to "1", we los information on autocompletion settings |
|
1164 //of other keyboard types. |
|
1165 TPtiKeyboardType currentKeyboardLayoutlayout = (TPtiKeyboardType)KeyboardLayout(); |
|
1166 TInt autocompletionSetting = 0; |
|
1167 iAknFepRepository->Get(KAknFepAutoCompleteFlag, autocompletionSetting); |
|
1168 switch(currentKeyboardLayoutlayout) |
|
1169 { |
|
1170 case EPtiKeyboardNone: |
|
1171 break; |
|
1172 case EPtiKeyboard12Key: |
|
1173 autocompletionSetting |= EKeyboardStyle12Key; |
|
1174 break; |
|
1175 case EPtiKeyboardQwerty4x12: |
|
1176 case EPtiKeyboardQwerty4x10: |
|
1177 case EPtiKeyboardQwerty3x11: |
|
1178 case EPtiKeyboardHalfQwerty: |
|
1179 case EPtiKeyboardCustomQwerty: |
|
1180 autocompletionSetting |= EKeyboardStyleQwerty; |
|
1181 break; |
|
1182 default: |
|
1183 break; |
|
1184 } |
|
1185 iAknFepRepository->Set(KAknFepAutoCompleteFlag, autocompletionSetting); |
|
1186 #else |
|
1187 iAknFepRepository->Set(KAknFepAutoCompleteFlag, 1); |
|
1188 #endif |
|
1189 } |
|
1190 } |
|
1191 |
|
1192 |
|
1193 void CAknFepSharedDataInterface::ResetPredictiveTextAutoCompleteOn() |
|
1194 { |
|
1195 if (iAknFepRepository) |
|
1196 { |
|
1197 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
1198 //Reset autocomplete flag only for the current keyboard layout type. Otherwise, |
|
1199 //by simply setting to "0", we lose information on autocompletion settings |
|
1200 //of other keyboard types. |
|
1201 TPtiKeyboardType currentKeyboardLayoutlayout = (TPtiKeyboardType)KeyboardLayout(); |
|
1202 TInt autocompletionSetting = 0; |
|
1203 iAknFepRepository->Get(KAknFepAutoCompleteFlag, autocompletionSetting); |
|
1204 switch(currentKeyboardLayoutlayout) |
|
1205 { |
|
1206 case EPtiKeyboardNone: |
|
1207 break; |
|
1208 case EPtiKeyboard12Key: |
|
1209 autocompletionSetting &= ~EKeyboardStyle12Key; |
|
1210 break; |
|
1211 case EPtiKeyboardQwerty4x12: |
|
1212 case EPtiKeyboardQwerty4x10: |
|
1213 case EPtiKeyboardQwerty3x11: |
|
1214 case EPtiKeyboardHalfQwerty: |
|
1215 case EPtiKeyboardCustomQwerty: |
|
1216 autocompletionSetting &= ~EKeyboardStyleQwerty; |
|
1217 break; |
|
1218 default: |
|
1219 break; |
|
1220 } |
|
1221 iAknFepRepository->Set(KAknFepAutoCompleteFlag, autocompletionSetting); |
|
1222 #else |
|
1223 iAknFepRepository->Set(KAknFepAutoCompleteFlag, 0); |
|
1224 #endif |
|
1225 } |
|
1226 } |
|
1227 |
|
1228 #ifndef RD_INTELLIGENT_TEXT_INPUT |
|
1229 void CAknFepSharedDataInterface::HandlePredictiveTextAutoCompleteSettingGSChange() |
|
1230 { |
|
1231 TInt value = 0; |
|
1232 if (iAknFepRepository) |
|
1233 { |
|
1234 iAknFepRepository->Get(KAknFepAutoCompleteFlag, value); |
|
1235 } |
|
1236 iFepManager->SetAutoCompletionState(value); |
|
1237 } |
|
1238 |
|
1239 |
|
1240 TInt CAknFepSharedDataInterface::PredictiveTextAutoCompleteSettingChangeGSNotification(TAny* aObj) |
|
1241 { |
|
1242 if (aObj) |
|
1243 { |
|
1244 static_cast<CAknFepSharedDataInterface*>(aObj)->HandlePredictiveTextAutoCompleteSettingGSChange(); |
|
1245 return KErrNone; |
|
1246 } |
|
1247 else |
|
1248 { |
|
1249 return KErrArgument; |
|
1250 } |
|
1251 } |
|
1252 |
|
1253 #endif //RD_INTELLIGENT_TEXT_INPUT |
|
1254 |
|
1255 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
1256 void CAknFepSharedDataInterface::SetFnKeyState(TInt aState) |
|
1257 { |
|
1258 RProperty::Set(KPSUidAknFep,KAknFepFnKeyState, aState); |
|
1259 } |
|
1260 |
|
1261 TInt CAknFepSharedDataInterface::GetFnKeyState() |
|
1262 { |
|
1263 TInt state = 0; |
|
1264 RProperty::Get(KPSUidAknFep,KAknFepFnKeyState, state); |
|
1265 return state; |
|
1266 } |
|
1267 void CAknFepSharedDataInterface::HandleKeyboardLayoutChange() |
|
1268 { |
|
1269 TInt value = 0; |
|
1270 TPtiKeyboardType keyboardType; |
|
1271 iKeyboardLayoutStatusProperty.Get(value); |
|
1272 keyboardType = (TPtiKeyboardType)value; |
|
1273 iFepManager->SetKeyboardLayout(keyboardType); |
|
1274 iFepManager->SetFnKeyMappingState(); |
|
1275 #ifdef __ITI_VIRTUAL_TOUCH_FIRST_GENERATION_SUPPORT__ |
|
1276 iFepManager->StopDisplayingMenuBar(); |
|
1277 #endif //__ITI_VIRTUAL_TOUCH_FIRST_GENERATION_SUPPORT__ |
|
1278 } |
|
1279 TInt CAknFepSharedDataInterface::PredictiveTextAutoCompleteOn() |
|
1280 { |
|
1281 TInt value = 0; |
|
1282 if (iAknFepRepository) |
|
1283 { |
|
1284 TPtiKeyboardType layout = (TPtiKeyboardType)KeyboardLayout(); |
|
1285 TInt temp = 0; |
|
1286 iAknFepRepository->Get(KAknFepAutoCompleteFlag, temp); |
|
1287 switch(layout) |
|
1288 { |
|
1289 case EPtiKeyboardNone: |
|
1290 break; |
|
1291 case EPtiKeyboard12Key: |
|
1292 temp &= EKeyboardStyle12Key; |
|
1293 break; |
|
1294 case EPtiKeyboardHalfQwerty: |
|
1295 temp &= EKeyboardStyleHalfQwerty; |
|
1296 break; |
|
1297 case EPtiKeyboardQwerty4x12: |
|
1298 case EPtiKeyboardQwerty4x10: |
|
1299 case EPtiKeyboardQwerty3x11: |
|
1300 case EPtiKeyboardCustomQwerty: |
|
1301 temp &= EKeyboardStyleQwerty; |
|
1302 break; |
|
1303 default: |
|
1304 break; |
|
1305 } |
|
1306 value = ( temp ? 1 : 0); |
|
1307 } |
|
1308 return value; |
|
1309 } |
|
1310 |
|
1311 void CAknFepSharedDataInterface::HandlePredictiveTextAutoCompleteSettingGSChange() |
|
1312 { |
|
1313 TInt value = 0; |
|
1314 if (iAknFepRepository) |
|
1315 { |
|
1316 iAknFepRepository->Get(KAknFepAutoCompleteFlag, value); |
|
1317 } |
|
1318 TPtiKeyboardType layout = (TPtiKeyboardType)KeyboardLayout(); |
|
1319 switch(layout) |
|
1320 { |
|
1321 case EPtiKeyboardNone: |
|
1322 break; |
|
1323 case EPtiKeyboard12Key: |
|
1324 value &= EKeyboardStyle12Key; |
|
1325 break; |
|
1326 case EPtiKeyboardHalfQwerty: |
|
1327 value &= EKeyboardStyleHalfQwerty; |
|
1328 break; |
|
1329 case EPtiKeyboardQwerty4x12: |
|
1330 case EPtiKeyboardQwerty4x10: |
|
1331 case EPtiKeyboardQwerty3x11: |
|
1332 case EPtiKeyboardCustomQwerty: |
|
1333 value &= EKeyboardStyleQwerty; |
|
1334 break; |
|
1335 default: |
|
1336 break; |
|
1337 } |
|
1338 if (value > 0) |
|
1339 { |
|
1340 value = 1; |
|
1341 } |
|
1342 iFepManager->SetAutoCompletionState(value); |
|
1343 } |
|
1344 |
|
1345 |
|
1346 TInt CAknFepSharedDataInterface::PredictiveTextAutoCompleteSettingChangeGSNotification(TAny* aObj) |
|
1347 { |
|
1348 if (aObj) |
|
1349 { |
|
1350 static_cast<CAknFepSharedDataInterface*>(aObj)->HandlePredictiveTextAutoCompleteSettingGSChange(); |
|
1351 return KErrNone; |
|
1352 } |
|
1353 else |
|
1354 { |
|
1355 return KErrArgument; |
|
1356 } |
|
1357 } |
|
1358 /** |
|
1359 * Queries the value of PredictiveText Typing Correction Level from shared data |
|
1360 * |
|
1361 * @return Typing Correction Level |
|
1362 */ |
|
1363 TInt CAknFepSharedDataInterface::PredictiveTextTypingCorrectionLevel() |
|
1364 { |
|
1365 TInt value = 0; |
|
1366 if (iAknFepRepository) |
|
1367 { |
|
1368 iAknFepRepository->Get(KAknFepTypingCorrectionLevel, value); |
|
1369 } |
|
1370 return value; |
|
1371 } |
|
1372 |
|
1373 |
|
1374 /** |
|
1375 * Sets the value of PredictiveText Typing Correction Level state to aCorrectionLevel in shared data |
|
1376 */ |
|
1377 void CAknFepSharedDataInterface::SetPredictiveTextTypingCorrectionLevel(TInt aCorrectionLevel) |
|
1378 { |
|
1379 if (iAknFepRepository) |
|
1380 { |
|
1381 iAknFepRepository->Set(KAknFepTypingCorrectionLevel, aCorrectionLevel); |
|
1382 } |
|
1383 } |
|
1384 |
|
1385 void CAknFepSharedDataInterface::HandlePredictiveTextTypingCorrectionLevelChange() |
|
1386 { |
|
1387 TInt value = 0; |
|
1388 if (iAknFepRepository) |
|
1389 { |
|
1390 iAknFepRepository->Get(KAknFepTypingCorrectionLevel, value); |
|
1391 } |
|
1392 iFepManager->SetTypingCorrectionLevel(value); |
|
1393 } |
|
1394 |
|
1395 /** |
|
1396 * Handles a change in predictive text Typing Correction Level setting. |
|
1397 */ |
|
1398 TInt CAknFepSharedDataInterface::PredictiveTextTypingCorrectionLevelChangeNotification(TAny* aObj) |
|
1399 { |
|
1400 if (aObj) |
|
1401 { |
|
1402 static_cast<CAknFepSharedDataInterface*>(aObj)->HandlePredictiveTextTypingCorrectionLevelChange(); |
|
1403 return KErrNone; |
|
1404 } |
|
1405 else |
|
1406 { |
|
1407 return KErrArgument; |
|
1408 } |
|
1409 } |
|
1410 |
|
1411 /** |
|
1412 * Queries the value of PredictiveText Number Candidate Shown state to be On from shared data |
|
1413 * |
|
1414 * @return 1 for shown or 0 for not shown |
|
1415 */ |
|
1416 TInt CAknFepSharedDataInterface::PredictiveTextNumberCandidateShown() |
|
1417 { |
|
1418 TInt value = 0; |
|
1419 if (iAknFepRepository) |
|
1420 { |
|
1421 iAknFepRepository->Get(KAknFepNumberCandidateFlag, value); |
|
1422 } |
|
1423 return value; |
|
1424 } |
|
1425 |
|
1426 |
|
1427 /** |
|
1428 * Sets the value of PredictiveText Number Candidate Shown state to 1 in shared data - this |
|
1429 * is used to represent predictive text Number Candidate Shown being shown. |
|
1430 */ |
|
1431 void CAknFepSharedDataInterface::SetPredictiveTextNumberCandidateShown() |
|
1432 { |
|
1433 if (iAknFepRepository) |
|
1434 { |
|
1435 iAknFepRepository->Set(KAknFepNumberCandidateFlag, 1); |
|
1436 } |
|
1437 } |
|
1438 |
|
1439 |
|
1440 /** |
|
1441 * Sets the value of PredictiveText Number Candidate Shown state to 0 in shared data - this |
|
1442 * is used to represent predictive text Number Candidate Shown being not shown. |
|
1443 */ |
|
1444 void CAknFepSharedDataInterface::ResetPredictiveTextNumberCandidateShown() |
|
1445 { |
|
1446 if (iAknFepRepository) |
|
1447 { |
|
1448 iAknFepRepository->Set(KAknFepNumberCandidateFlag, 0); |
|
1449 } |
|
1450 } |
|
1451 |
|
1452 void CAknFepSharedDataInterface::HandlePredictiveTextNumberCandidateSettingChange() |
|
1453 { |
|
1454 TInt value = 0; |
|
1455 if (iAknFepRepository) |
|
1456 { |
|
1457 iAknFepRepository->Get(KAknFepNumberCandidateFlag, value); |
|
1458 } |
|
1459 iFepManager->SetNumberCandidateState(value); |
|
1460 } |
|
1461 |
|
1462 /** |
|
1463 * Handles a change in predictive text Number Candidate Shown setting. |
|
1464 */ |
|
1465 TInt CAknFepSharedDataInterface::PredictiveTextNumberCandidateSettingChangeNotification(TAny* aObj) |
|
1466 { |
|
1467 if (aObj) |
|
1468 { |
|
1469 static_cast<CAknFepSharedDataInterface*>(aObj)->HandlePredictiveTextNumberCandidateSettingChange(); |
|
1470 return KErrNone; |
|
1471 } |
|
1472 else |
|
1473 { |
|
1474 return KErrArgument; |
|
1475 } |
|
1476 } |
|
1477 |
|
1478 /** |
|
1479 * Queries the value of PredictiveText Primary candidate setting from shared data |
|
1480 * |
|
1481 * @return Primary candidate setting(0 for Suggested or 1 for Exact) |
|
1482 */ |
|
1483 TInt CAknFepSharedDataInterface::PredictiveTextPrimaryCandidate() |
|
1484 { |
|
1485 TInt value = 0; |
|
1486 if (iAknFepRepository) |
|
1487 { |
|
1488 iAknFepRepository->Get(KAknFepPrimaryCandidateFlag, value); |
|
1489 } |
|
1490 return value; |
|
1491 } |
|
1492 |
|
1493 |
|
1494 /** |
|
1495 * Sets the value of PredictiveText Primary candidate setting state to aPrimaryCandidate in shared data |
|
1496 */ |
|
1497 void CAknFepSharedDataInterface::SetPredictiveTextPrimaryCandidate(TInt aPrimaryCandidate) |
|
1498 { |
|
1499 if (iAknFepRepository) |
|
1500 { |
|
1501 iAknFepRepository->Set(KAknFepPrimaryCandidateFlag, aPrimaryCandidate); |
|
1502 } |
|
1503 } |
|
1504 /** |
|
1505 * Handles a change in predictive text Primary candidate setting. |
|
1506 */ |
|
1507 void CAknFepSharedDataInterface::HandlePredictiveTextPrimaryCandidateChange() |
|
1508 { |
|
1509 TInt value = 0; |
|
1510 if (iAknFepRepository) |
|
1511 { |
|
1512 iAknFepRepository->Get(KAknFepPrimaryCandidateFlag, value); |
|
1513 } |
|
1514 iFepManager->SetPrimaryCandidate(value); |
|
1515 } |
|
1516 |
|
1517 /** |
|
1518 * Handles a change in predictive text Typing Correction Level setting. |
|
1519 */ |
|
1520 TInt CAknFepSharedDataInterface::PredictiveTextPrimaryCandidateChangeNotification(TAny* aObj) |
|
1521 { |
|
1522 if (aObj) |
|
1523 { |
|
1524 static_cast<CAknFepSharedDataInterface*>(aObj)->HandlePredictiveTextPrimaryCandidateChange(); |
|
1525 return KErrNone; |
|
1526 } |
|
1527 else |
|
1528 { |
|
1529 return KErrArgument; |
|
1530 } |
|
1531 } |
|
1532 #else // RD_INTELLIGENT_TEXT_INPUT |
|
1533 |
|
1534 TInt CAknFepSharedDataInterface::PredictiveTextAutoCompleteOn() |
|
1535 { |
|
1536 TInt value = 0; |
|
1537 if (iAknFepRepository) |
|
1538 { |
|
1539 iAknFepRepository->Get(KAknFepAutoCompleteFlag, value); |
|
1540 } |
|
1541 return value; |
|
1542 } |
|
1543 #endif |
|
1544 /** |
|
1545 * Returns a value of HWR conversion on/off. |
|
1546 * |
|
1547 * @since 3.2 |
|
1548 * @return Value of KAknFepJapaneseHwrConversion setting. |
|
1549 */ |
|
1550 TInt CAknFepSharedDataInterface::JapaneseHwrConversion() const |
|
1551 { |
|
1552 TInt value = 0; |
|
1553 if (iAknFepRepository) |
|
1554 { |
|
1555 iAknFepRepository->Get(KAknFepJapaneseSpecialCharFlag, value); |
|
1556 } |
|
1557 return (value & KJapHwrConversion)? |
|
1558 EJapaneseConversionOn : EJapaneseConversionOff; |
|
1559 } |
|
1560 |
|
1561 /** |
|
1562 * Set a value of HWR conversion on/off. |
|
1563 * |
|
1564 * @since 3.2 |
|
1565 * @param aValue new value set to HWR conversion on/off shared data item |
|
1566 */ |
|
1567 void CAknFepSharedDataInterface::SetJapaneseHwrConversion(TInt aValue) |
|
1568 { |
|
1569 if (iAknFepRepository) |
|
1570 { |
|
1571 TInt value; |
|
1572 iAknFepRepository->Get(KAknFepJapaneseSpecialCharFlag, value); |
|
1573 if (aValue == EJapaneseConversionOn) |
|
1574 { |
|
1575 value |= KJapHwrConversion; |
|
1576 } |
|
1577 else |
|
1578 { |
|
1579 value &= ~(KJapHwrConversion); |
|
1580 } |
|
1581 iAknFepRepository->Set(KAknFepJapaneseSpecialCharFlag, value); |
|
1582 } |
|
1583 } |
|
1584 |
|
1585 TInt CAknFepSharedDataInterface::FepShowFsqPreviewStatus() |
|
1586 { |
|
1587 TInt value = 0; |
|
1588 if (iAknFepRepository) |
|
1589 { |
|
1590 iAknFepRepository->Get(KAknFepShowFsqPreview, value); |
|
1591 } |
|
1592 return value; |
|
1593 } |
|
1594 |
|
1595 |
|
1596 void CAknFepSharedDataInterface::SetFepShowFsqPreviewStatus(TInt aValue) |
|
1597 { |
|
1598 if (iAknFepRepository) |
|
1599 { |
|
1600 iAknFepRepository->Set(KAknFepShowFsqPreview, aValue); |
|
1601 } |
|
1602 } |
|
1603 |
|
1604 TInt CAknFepSharedDataInterface::FepShowVkbPreviewStatus() |
|
1605 { |
|
1606 TInt value = 0; |
|
1607 if (iAknFepRepository) |
|
1608 { |
|
1609 iAknFepRepository->Get(KAknFepShowVkbPreview, value); |
|
1610 } |
|
1611 return value; |
|
1612 } |
|
1613 |
|
1614 |
|
1615 void CAknFepSharedDataInterface::SetFepShowVkbPreviewStatus(TInt aValue) |
|
1616 { |
|
1617 if (iAknFepRepository) |
|
1618 { |
|
1619 iAknFepRepository->Set(KAknFepShowVkbPreview, aValue); |
|
1620 } |
|
1621 } |
|
1622 |
|
1623 TInt CAknFepSharedDataInterface::FepLastUseVkbModeForLandscape() |
|
1624 { |
|
1625 TInt value = 4; |
|
1626 if (iAknFepRepository) |
|
1627 { |
|
1628 iAknFepRepository->Get(KAknFepLastUseVkbMode, value); |
|
1629 } |
|
1630 return value; |
|
1631 } |
|
1632 |
|
1633 |
|
1634 void CAknFepSharedDataInterface::SetFepLastUseVkbModeForLandscape(TInt aValue) |
|
1635 { |
|
1636 if (iAknFepRepository) |
|
1637 { |
|
1638 iAknFepRepository->Set(KAknFepLastUseVkbMode, aValue); |
|
1639 } |
|
1640 } |
|
1641 |
|
1642 TBool CAknFepSharedDataInterface::AutoRotateEnabled() |
|
1643 { |
|
1644 TInt sensorState( 0 ); |
|
1645 |
|
1646 if (iSensorRepository) |
|
1647 { |
|
1648 iSensorRepository->Get( KSenSettingsSensorsOn, sensorState ); |
|
1649 } |
|
1650 if ( sensorState ) |
|
1651 { |
|
1652 TInt turnCtrl = 0; |
|
1653 iSensorRepository->Get( KSenSettingsTurnCtrl, turnCtrl ); |
|
1654 turnCtrl = turnCtrl >> 2; |
|
1655 |
|
1656 if ( turnCtrl ) |
|
1657 { |
|
1658 return ETrue; |
|
1659 } |
|
1660 } |
|
1661 |
|
1662 return EFalse; |
|
1663 } |
|
1664 |
|
1665 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
1666 #ifdef __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__ |
|
1667 /** |
|
1668 * Queries if numbers (and other characters found behind Fn) can be entered with long key press on QWERTY. |
|
1669 */ |
|
1670 TBool CAknFepSharedDataInterface::LongPressNumberEntryOnQwerty() const |
|
1671 { |
|
1672 TInt value = 0; |
|
1673 if (iAknFepRepository) |
|
1674 { |
|
1675 iAknFepRepository->Get(KAknFepLongPressNumberEntryOnQwerty, value); |
|
1676 } |
|
1677 return value; |
|
1678 } |
|
1679 |
|
1680 /** |
|
1681 * Queries if copy-pasting with shift+softkeys is available also on QWERTY. |
|
1682 */ |
|
1683 TBool CAknFepSharedDataInterface::ShiftCopyPastingOnQwerty() const |
|
1684 { |
|
1685 TInt value = 0; |
|
1686 if (iAknFepRepository) |
|
1687 { |
|
1688 iAknFepRepository->Get(KAknFepShiftCopyPasteOnQwerty, value); |
|
1689 } |
|
1690 return value; |
|
1691 } |
|
1692 #endif // __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__ |
|
1693 #endif // RD_INTELLIGENT_TEXT_INPUT |
|
1694 |
|
1695 #ifdef RD_SCALABLE_UI_V2 |
|
1696 // --------------------------------------------------------------------------- |
|
1697 // Get a value of current default on screen vkb. |
|
1698 // It depends on input lanage is PRC/HW/TW Chinese. |
|
1699 // --------------------------------------------------------------------------- |
|
1700 // |
|
1701 TInt CAknFepSharedDataInterface::DefaultOnScreenVKB() |
|
1702 { |
|
1703 TInt value = 0; |
|
1704 switch( PenInputLanguage() ) |
|
1705 { |
|
1706 case ELangPrcChinese: |
|
1707 { |
|
1708 iGsPenSettings->Get( KSettingsDefaultVkbPrc, value ); |
|
1709 } |
|
1710 break; |
|
1711 case ELangHongKongChinese: |
|
1712 { |
|
1713 iGsPenSettings->Get( KSettingsDefaultVkbHk, value ); |
|
1714 } |
|
1715 break; |
|
1716 case ELangTaiwanChinese: |
|
1717 { |
|
1718 iGsPenSettings->Get( KSettingsDefaultVkbTw, value ); |
|
1719 } |
|
1720 break; |
|
1721 default: |
|
1722 break; |
|
1723 } |
|
1724 return value; |
|
1725 }; |
|
1726 #endif |
|
1727 |
|
1728 // End of File |