44
|
1 |
/*
|
|
2 |
* Copyright (c) 2003-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 |
* Provides the CAknFepUIManagerWestern methods.
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
// INCLUDE FILES
|
|
31 |
#include <e32svr.h> // RDebug stuff...
|
|
32 |
#include <e32keys.h>
|
|
33 |
#include <AknsUtils.h>
|
|
34 |
|
|
35 |
#include "AknFepGlobalEnums.h"
|
|
36 |
#include "AknFepManagerUIInterface.h"
|
|
37 |
#include "AknFepManagerInterface.h"
|
|
38 |
#include "AknFepUIManagerStateInterface.h"
|
|
39 |
#include "AknFepUiManagerBase.h"
|
|
40 |
#include "AknFepUiManagerWestern.h"
|
|
41 |
|
|
42 |
// Western input
|
|
43 |
#include "AknFepUiInputStateInitialLatinMultitap.h"
|
|
44 |
#include "AknFepUiInputStateInitialNumber.h"
|
|
45 |
#include "AknFepUiInputStateInitialWesternPredictive.h"
|
|
46 |
#include "AknFepUiInputStateEntryWesternPredictive.h"
|
|
47 |
#include "AknFepUiInputStateInitialHalfQwertyWesternPredictive.h"
|
|
48 |
#include "AknFepUiInputStateEntryHalfQwertyWesternPredictive.h"
|
|
49 |
#ifdef RD_INTELLIGENT_TEXT_INPUT
|
|
50 |
// Predictive QWERTY changes ---->
|
|
51 |
#include "AknFepUiInputStateInitialQwertyWesternPredictive.h"
|
|
52 |
#include "AknFepUiInputStateEntryQwertyWesternPredictive.h"
|
|
53 |
// Predictive QWERTY changes <----
|
|
54 |
#endif //RD_INTELLIGENT_TEXT_INPUT
|
|
55 |
#include "AknFepPluginManager.h"
|
|
56 |
|
|
57 |
// Arabic & Hebrew input
|
|
58 |
#include "AknFepUiInputStateInitialArabicHebrewMultitap.h"
|
|
59 |
#include "AknFepUiInputStateInitialArabicHebrewPredictive.h"
|
|
60 |
#include "AknFepUiInputStateEntryArabicHebrewPredictive.h"
|
|
61 |
|
|
62 |
// Thai input
|
|
63 |
#include "AknFepUIInputStateInitialThaiMultitap.h"
|
|
64 |
#include "AknFepUiInputStateInitialThaiPredictive.h"
|
|
65 |
#include "AknFepUiInputStateEntryThaiPredictive.h"
|
|
66 |
|
|
67 |
#include "AknFepThaiSCTSelector.h"
|
|
68 |
|
|
69 |
//Hindi Input
|
|
70 |
#include "AknFepUIInputStateInitialIndicMultitap.h"
|
|
71 |
#include "AknFepUiInputStateInitialIndicPredictive.h"
|
|
72 |
#include "AknFepUiInputStateEntryIndicPredictive.h"
|
|
73 |
#include "AknFepUiIndicInputManager.h"
|
|
74 |
|
|
75 |
// Qwerty input
|
|
76 |
#include "AknFepUiInputStateQwerty.h"
|
|
77 |
#ifdef RD_INTELLIGENT_TEXT_INPUT
|
|
78 |
#include "AknFepUiInputStateHalfQwerty.h"
|
|
79 |
#endif
|
|
80 |
|
|
81 |
#ifdef RD_HINDI_PHONETIC_INPUT
|
|
82 |
#include "aknfepuiinputstateinitialindicphoneticmultitap.h"
|
|
83 |
#include "aknfepuiinputstateindicphoneticqwerty.h"
|
|
84 |
#endif
|
|
85 |
// Vietnamese input
|
|
86 |
#include "AknFepUIInputStateInitialVietnameseMultitap.h"
|
|
87 |
#include "AknFepVietnameseToneManager.h"
|
|
88 |
#include "AknFepUiInputStateEntryVietnamesePredictive.h"
|
|
89 |
#include "AknFepCaseManager.h"
|
|
90 |
#include "AknFepPanic.h"
|
|
91 |
|
|
92 |
// Japanese input
|
|
93 |
#include "AknFepUiInputStateEntryWesternPredictiveJp.h"
|
|
94 |
|
|
95 |
#include <AknIndicatorContainer.h> // CAknIndicatorContainer::TIndicatorContext
|
|
96 |
#include <PtiEngine.h>
|
|
97 |
#include <PtiDefs.h>
|
|
98 |
#include <PtiUserDicEntry.h>
|
|
99 |
#include <aknfep.rsg>
|
|
100 |
// CONSTANTS
|
|
101 |
|
|
102 |
/**
|
|
103 |
* CAknFepUIManagerWestern class.
|
|
104 |
*
|
|
105 |
*/
|
|
106 |
|
|
107 |
//============================ MEMBER FUNCTIONS ==============================
|
|
108 |
|
|
109 |
|
|
110 |
// ---------------------------------------------------------------------------
|
|
111 |
// CAknFepUIManagerWestern::NewL
|
|
112 |
//
|
|
113 |
//
|
|
114 |
// ---------------------------------------------------------------------------
|
|
115 |
//
|
|
116 |
CAknFepUIManagerWestern* CAknFepUIManagerWestern::NewL(MAknFepManagerUIInterface* aFepMan,
|
|
117 |
CAknFepCaseManager* aCaseMan,
|
|
118 |
TLanguage aLanguage)
|
|
119 |
{
|
|
120 |
CAknFepUIManagerWestern* self = new(ELeave)CAknFepUIManagerWestern(aFepMan, aCaseMan);
|
|
121 |
CleanupStack::PushL(self);
|
|
122 |
self->ConstructL(aLanguage);
|
|
123 |
CleanupStack::Pop();
|
|
124 |
return self;
|
|
125 |
}
|
|
126 |
|
|
127 |
// ---------------------------------------------------------------------------
|
|
128 |
// CAknFepUIManagerWestern::~CAknFepUIManagerWestern
|
|
129 |
//
|
|
130 |
//
|
|
131 |
// ---------------------------------------------------------------------------
|
|
132 |
//
|
|
133 |
CAknFepUIManagerWestern::~CAknFepUIManagerWestern()
|
|
134 |
{
|
|
135 |
delete iAknFepThaiSCTSelector;
|
|
136 |
delete iVietToneMarkMgr;
|
|
137 |
}
|
|
138 |
|
|
139 |
// ---------------------------------------------------------------------------
|
|
140 |
// CAknFepUIManagerWestern::HandleKeyL
|
|
141 |
//
|
|
142 |
//
|
|
143 |
// ---------------------------------------------------------------------------
|
|
144 |
//
|
|
145 |
TBool CAknFepUIManagerWestern::HandleKeyL( TInt aKey, TKeyPressLength aLength,
|
|
146 |
TEventCode /*aEventCode*/ )
|
|
147 |
{
|
|
148 |
#ifdef RD_INTELLIGENT_TEXT_INPUT
|
|
149 |
// The implementation is anyway identical with the base class, so we can
|
|
150 |
// as well call the base implementation.
|
|
151 |
return CAknFepUIManagerBase::HandleKeyL(aKey, aLength);
|
|
152 |
#else
|
|
153 |
TUIState currentState = iFepUiState.State();
|
|
154 |
if (aLength == EShortKeyPress)
|
|
155 |
{
|
|
156 |
iInitialFepUIState = currentState;
|
|
157 |
}
|
|
158 |
|
|
159 |
if(!iStatePtr->HandleKeyL(aKey, aLength))
|
|
160 |
{
|
|
161 |
if(currentState != iStatePtr->State()) //Check to see if we've changed state.
|
|
162 |
{
|
|
163 |
return iStatePtr->HandleKeyL(aKey, aLength);
|
|
164 |
}
|
|
165 |
return EFalse; // we've failed to handle it..
|
|
166 |
}
|
|
167 |
return ETrue; //we're ok.
|
|
168 |
#endif // RD_INTELLIGENT_TEXT_INPUT
|
|
169 |
}
|
|
170 |
|
|
171 |
// ---------------------------------------------------------------------------
|
|
172 |
// CAknFepUIManagerWestern::CloseUI
|
|
173 |
//
|
|
174 |
//
|
|
175 |
// ---------------------------------------------------------------------------
|
|
176 |
//
|
|
177 |
void CAknFepUIManagerWestern::CloseUI()
|
|
178 |
{
|
|
179 |
ChangeState(EInitial);
|
|
180 |
}
|
|
181 |
|
|
182 |
|
|
183 |
// ---------------------------------------------------------------------------
|
|
184 |
// CAknFepUIManagerWestern::AddTextToUserDictionaryL
|
|
185 |
//
|
|
186 |
//
|
|
187 |
// ---------------------------------------------------------------------------
|
|
188 |
//
|
|
189 |
void CAknFepUIManagerWestern::AddTextToUserDictionaryL(const TDesC& aText)
|
|
190 |
{
|
|
191 |
HBufC* udbTextBuf = HBufC::NewLC(CAknFepManager::EMaximumFepWordLength); // buffer for text
|
|
192 |
TPtr udbText=udbTextBuf->Des();
|
|
193 |
TChar ch;
|
|
194 |
|
|
195 |
TInt textLengthToAdd = Min((TInt)CAknFepManager::EMaximumFepWordLength, aText.Length());
|
|
196 |
|
|
197 |
for (TInt ii=0; ii < textLengthToAdd; ii++)
|
|
198 |
{
|
|
199 |
ch = STATIC_CAST(TChar, aText[ii]);
|
|
200 |
udbText.Append(ch);
|
|
201 |
if (ch.IsSpace() || ii == textLengthToAdd-1)
|
|
202 |
{
|
|
203 |
if (ch.IsSpace())
|
|
204 |
{
|
|
205 |
udbText.Delete(udbText.Length()-1, CAknFepManager::ESingleCharacter);
|
|
206 |
}
|
|
207 |
if (udbText.Length())
|
|
208 |
{
|
|
209 |
// add the contents of udbText to the user dictionary.
|
|
210 |
CPtiEngine* ptiengine = PtiEngine();
|
|
211 |
TPtiUserDictionaryEntry newUdbEntry(udbText);
|
|
212 |
TPtiEngineInputMode currentInputMode = ptiengine->InputMode();
|
|
213 |
// PtiEngine needs to be in predictive mode when the word is added to UDB.
|
|
214 |
#ifdef RD_INTELLIGENT_TEXT_INPUT
|
|
215 |
if(iQwertyInputMode)
|
|
216 |
{
|
|
217 |
#ifdef __HALF_QWERTY_KEYPAD
|
|
218 |
if( EPtiKeyboardHalfQwerty == iFepMan->KeyboardLayout())
|
|
219 |
{
|
|
220 |
ptiengine->SetInputMode( EPtiEngineHalfQwertyPredictive );
|
|
221 |
}
|
|
222 |
else
|
|
223 |
#endif //__HALF_QWERTY_KEYPAD
|
|
224 |
{
|
|
225 |
ptiengine->SetInputMode(EPtiEngineQwertyPredictive );
|
|
226 |
}
|
|
227 |
}
|
|
228 |
else
|
|
229 |
#endif //RD_INTELLIGENT_TEXT_INPUT
|
|
230 |
{
|
|
231 |
ptiengine->SetInputMode(EPtiEnginePredictive);
|
|
232 |
}
|
|
233 |
ptiengine->AddUserDictionaryEntry(newUdbEntry);
|
|
234 |
ptiengine->SetInputMode(currentInputMode);
|
|
235 |
}
|
|
236 |
udbText.Zero();
|
|
237 |
}
|
|
238 |
}
|
|
239 |
CleanupStack::PopAndDestroy(); // udbTextBuf
|
|
240 |
}
|
|
241 |
|
|
242 |
// ---------------------------------------------------------------------------
|
|
243 |
// CAknFepUIManagerWestern::GetFormatOfFepInlineText
|
|
244 |
//
|
|
245 |
//
|
|
246 |
// ---------------------------------------------------------------------------
|
|
247 |
//
|
|
248 |
void CAknFepUIManagerWestern::GetFormatOfFepInlineText(TCharFormat& aFormat,
|
|
249 |
TInt& aNumberOfCharactersWithSameFormat,
|
|
250 |
TInt aPositionOfCharacter) const
|
|
251 |
{
|
|
252 |
if ( (iPredictive && iFepUiState.State() == EEntry )
|
|
253 |
#ifdef RD_HINDI_PHONETIC_INPUT
|
|
254 |
//adding condition to underline uncommitted text for hindi phonetic
|
|
255 |
|| TAknFepUiIndicInputManager :: IsIndicPhoneticLanguage( ( TLanguage )iLanguage )
|
|
256 |
#endif
|
|
257 |
) // EInitial???
|
|
258 |
{
|
|
259 |
aFormat.iFontPresentation.iUnderline = EUnderlineOn;
|
|
260 |
if (iFepMan->IsFlagSet(CAknFepManager::EFlagNoMatches))
|
|
261 |
{
|
|
262 |
aFormat.iFontPresentation.iHighlightStyle =
|
|
263 |
TFontPresentation::EFontHighlightNoMatchesIndicator;
|
|
264 |
}
|
|
265 |
TCursorSelection uncommit = iFepMan->UncommittedText();
|
|
266 |
TInt lengthOfRemainderOfInlineText = uncommit.Length()-aPositionOfCharacter;
|
|
267 |
#ifndef RD_INTELLIGENT_TEXT_INPUT
|
|
268 |
if(iFepMan->IsAutoCompleteOn())
|
|
269 |
{
|
|
270 |
// For AutoWord Completion - the suggested completion has to be gray slated
|
|
271 |
CPtiEngine* ptiengine = PtiEngine();
|
|
272 |
TInt actualLength = (ptiengine->CurrentInputSequence()).Length();
|
|
273 |
|
|
274 |
if(lengthOfRemainderOfInlineText>0)
|
|
275 |
{
|
|
276 |
if(actualLength < lengthOfRemainderOfInlineText)
|
|
277 |
{
|
|
278 |
if(iLanguage == ELangHindi)
|
|
279 |
{
|
|
280 |
TBuf<CAknFepManager::EMaximumFepWordLength> currentWord(ptiengine->CurrentWord()); //
|
|
281 |
// AutoComplete - Fix - Begin
|
|
282 |
if(actualLength < currentWord.Length())
|
|
283 |
{
|
|
284 |
TUint currentchar = TUint(currentWord[actualLength]);
|
|
285 |
while((TAknFepUiIndicInputManager::IsIndicDependantCharacter(currentchar, iLanguage)))
|
|
286 |
{
|
|
287 |
actualLength++;
|
|
288 |
if(!(actualLength < currentWord.Length()))
|
|
289 |
break;
|
|
290 |
currentchar = TUint(currentWord[actualLength]);
|
|
291 |
}
|
|
292 |
// AutoComplete - Fix - Begin
|
|
293 |
}
|
|
294 |
}
|
|
295 |
}
|
|
296 |
|
|
297 |
if (aPositionOfCharacter<actualLength && (lengthOfRemainderOfInlineText>0))
|
|
298 |
{
|
|
299 |
aFormat.iFontPresentation.iUnderline = EUnderlineOn;
|
|
300 |
aNumberOfCharactersWithSameFormat = actualLength;
|
|
301 |
}
|
|
302 |
else
|
|
303 |
{
|
|
304 |
// Display the autocompleted text in gray colour
|
|
305 |
TRgb autoTextColor;
|
|
306 |
MAknsSkinInstance *skin = AknsUtils::SkinInstance();
|
|
307 |
TInt err = AknsUtils::GetCachedColor( skin, autoTextColor, KAknsIIDQsnTextColors,
|
|
308 |
EAknsCIQsnTextColorsCG64 );
|
|
309 |
if (!err)
|
|
310 |
{
|
|
311 |
aFormat.iFontPresentation.iTextColor = autoTextColor;
|
|
312 |
}
|
|
313 |
else
|
|
314 |
{
|
|
315 |
// In case of error occurs, display text in hardcoded slate gray color
|
|
316 |
aFormat.iFontPresentation.iTextColor = KSLATEGRAY;
|
|
317 |
}
|
|
318 |
|
|
319 |
aNumberOfCharactersWithSameFormat=lengthOfRemainderOfInlineText;
|
|
320 |
}
|
|
321 |
}
|
|
322 |
}
|
|
323 |
else
|
|
324 |
#endif
|
|
325 |
#ifdef RD_INTELLIGENT_TEXT_INPUT
|
|
326 |
// Predictive QWERTY (XT9) changes ---->
|
|
327 |
TInt wordLength = uncommit.Length();
|
|
328 |
if ( lengthOfRemainderOfInlineText > 0 )
|
|
329 |
{
|
|
330 |
TInt tailLength = 0;
|
|
331 |
//TInt err = PtiEngine()->HandleCommandL( EPtiCommandGetAutoCompletionTailLength, &tailLength );
|
|
332 |
TRAP_IGNORE( PtiEngine()->HandleCommandL(
|
|
333 |
EPtiCommandGetAutoCompletionTailLength,
|
|
334 |
&tailLength ));
|
|
335 |
|
|
336 |
if ( aPositionOfCharacter < wordLength-tailLength )
|
|
337 |
{
|
|
338 |
aFormat.iFontPresentation.iUnderline = EUnderlineOn;
|
|
339 |
aNumberOfCharactersWithSameFormat = lengthOfRemainderOfInlineText-tailLength;
|
|
340 |
}
|
|
341 |
else
|
|
342 |
{
|
|
343 |
aFormat.iFontPresentation.iUnderline = EUnderlineOff;
|
|
344 |
aFormat.iFontPresentation.iTextColor = KSLATEGRAY;
|
|
345 |
aNumberOfCharactersWithSameFormat=lengthOfRemainderOfInlineText;
|
|
346 |
}
|
|
347 |
}
|
|
348 |
#else
|
|
349 |
#ifdef RD_HINDI_PHONETIC_INPUT
|
|
350 |
//for phonetic, space character needs to be checked explicitly so that it is not underlined
|
|
351 |
//for predictive when space is entered it gets committed and changes to initial state, hence check is not present
|
|
352 |
if(TAknFepUiIndicInputManager :: IsIndicPhoneticLanguage( ( TLanguage )iLanguage ) )
|
|
353 |
{
|
|
354 |
TChar tempChar(0);
|
|
355 |
iFepUiState.GetPhoneticLatinChar(tempChar);
|
|
356 |
if(tempChar.IsSpace())
|
|
357 |
aFormat.iFontPresentation.iUnderline = EUnderlineOff;
|
|
358 |
}
|
|
359 |
#else
|
|
360 |
if (lengthOfRemainderOfInlineText>0)
|
|
361 |
{
|
|
362 |
aFormat.iFontPresentation.iUnderline = EUnderlineOn;
|
|
363 |
aNumberOfCharactersWithSameFormat=lengthOfRemainderOfInlineText;
|
|
364 |
}
|
|
365 |
#endif
|
|
366 |
// Predictive QWERTY (XT9) changes <----
|
|
367 |
#endif //RD_INTELLIGENT_TEXT_INPUT
|
|
368 |
}
|
|
369 |
}
|
|
370 |
|
|
371 |
|
|
372 |
// ---------------------------------------------------------------------------
|
|
373 |
// CAknFepUIManagerWestern::SupportLanguage
|
|
374 |
//
|
|
375 |
//
|
|
376 |
// ---------------------------------------------------------------------------
|
|
377 |
//
|
|
378 |
TInt CAknFepUIManagerWestern::SupportLanguage(TInt aMode) const
|
|
379 |
{
|
|
380 |
TInt lang = iLanguage;
|
|
381 |
switch (aMode)
|
|
382 |
{
|
|
383 |
case ELatin:
|
|
384 |
{
|
|
385 |
switch ( iLanguage )
|
|
386 |
{
|
|
387 |
case ELangTaiwanChinese:
|
|
388 |
{
|
|
389 |
lang = ELangEnglish_Taiwan;
|
|
390 |
break;
|
|
391 |
}
|
|
392 |
case ELangHongKongChinese:
|
|
393 |
{
|
|
394 |
lang = ELangEnglish_HongKong;
|
|
395 |
break;
|
|
396 |
}
|
|
397 |
case ELangPrcChinese:
|
|
398 |
{
|
|
399 |
lang = ELangEnglish_Prc;
|
|
400 |
break;
|
|
401 |
}
|
|
402 |
case ELangJapanese:
|
|
403 |
case ELangHindi:
|
|
404 |
{
|
|
405 |
// Chinese and Japanese languages uses always English as a latin language.
|
|
406 |
lang = ELangEnglish;
|
|
407 |
break;
|
|
408 |
}
|
|
409 |
default:
|
|
410 |
{
|
|
411 |
lang = iLanguage;
|
|
412 |
break;
|
|
413 |
}
|
|
414 |
}
|
|
415 |
}
|
|
416 |
break;
|
|
417 |
case ENumber:
|
|
418 |
{
|
|
419 |
if ( iLanguage == ELangJapanese )
|
|
420 |
{
|
|
421 |
// Japanese languages uses always English as a number language for qwerty.
|
|
422 |
lang = ELangEnglish;
|
|
423 |
}
|
|
424 |
else
|
|
425 |
{
|
|
426 |
lang = iLanguage;
|
|
427 |
}
|
|
428 |
}
|
|
429 |
break;
|
|
430 |
case EHindi:
|
|
431 |
case ENativeNumber:
|
|
432 |
lang = iLanguage;
|
|
433 |
break;
|
|
434 |
|
|
435 |
|
|
436 |
default:
|
|
437 |
break;
|
|
438 |
}
|
|
439 |
return lang;
|
|
440 |
}
|
|
441 |
|
|
442 |
// ---------------------------------------------------------------------------
|
|
443 |
// CAknFepUIManagerWestern::ActivateUI
|
|
444 |
//
|
|
445 |
//
|
|
446 |
// ---------------------------------------------------------------------------
|
|
447 |
//
|
|
448 |
void CAknFepUIManagerWestern::ActivateUI()
|
|
449 |
{
|
|
450 |
ChangeState(EEntry);
|
|
451 |
}
|
|
452 |
|
|
453 |
// ---------------------------------------------------------------------------
|
|
454 |
// CAknFepUIManagerWestern::ChangeState
|
|
455 |
//
|
|
456 |
//
|
|
457 |
// ---------------------------------------------------------------------------
|
|
458 |
// MAknFepUIManagerStateInterface
|
|
459 |
TUIState CAknFepUIManagerWestern::ChangeState(TUIState aState)
|
|
460 |
{
|
|
461 |
#ifdef RD_SCALABLE_UI_V2
|
|
462 |
if (iFepMan->PluginUIManager() &&
|
|
463 |
iFepMan->PluginUIManager()->IsMatchState() &&
|
|
464 |
!iFepMan->PluginUIManager()->IsSpellVisible())
|
|
465 |
{
|
|
466 |
//TRAP_IGNORE(iFepMan->UpdateCbaL(R_AKNFEP_SOFTKEYS_FINGER));
|
|
467 |
iFepMan->PluginUIManager()->SetFingerMatchSelectionState(EFalse);
|
|
468 |
}
|
|
469 |
|
|
470 |
// For addition of ITI features on FSQ
|
|
471 |
// When candidate list on FSQ is opened, some HW keys may cause state change,
|
|
472 |
// e.g. left/right keys, need to hide candidate list
|
|
473 |
if ( iFepMan->PluginUIManager()
|
|
474 |
&& iFepMan->PluginUIManager()->EnableITIOnFSQ() )
|
|
475 |
{
|
|
476 |
TRAP_IGNORE( iFepMan->PluginUIManager()->HideCandidateListL() );
|
|
477 |
}
|
|
478 |
|
|
479 |
#endif //RD_SCALABLE_UI_V2
|
|
480 |
switch(aState)
|
|
481 |
{
|
|
482 |
case EInitial:
|
|
483 |
{
|
|
484 |
switch(iMode)
|
|
485 |
{
|
|
486 |
case ELatin:
|
|
487 |
{
|
|
488 |
if (iPredictive)
|
|
489 |
{
|
|
490 |
#ifdef RD_INTELLIGENT_TEXT_INPUT
|
|
491 |
// Predictive QWERTY (XT9) changes ---->
|
|
492 |
if (iQwertyInputMode)
|
|
493 |
{
|
|
494 |
#ifdef __HALF_QWERTY_KEYPAD
|
|
495 |
if( EPtiKeyboardHalfQwerty == iFepMan->KeyboardLayout())
|
|
496 |
{
|
|
497 |
iFepUiState = TAknFepUiInputStateInitialHalfQwertyWesternPredictive( this );
|
|
498 |
}
|
|
499 |
else
|
|
500 |
#endif // Half Qwerty
|
|
501 |
iFepUiState = TAknFepInputStateInitialQwertyWesternPredictive(this);
|
|
502 |
} // Predictive QWERTY (XT9) changes <----
|
|
503 |
else
|
|
504 |
#endif // RD_INTELLIGENT_TEXT_INPUT
|
|
505 |
if ( iLanguage == ELangArabic || iLanguage == ELangHebrew
|
|
506 |
|| iLanguage == ELangFarsi || iLanguage == ELangUrdu )
|
|
507 |
{
|
|
508 |
iFepUiState = TAknFepInputStateInitialArabicHebrewPredictive(this);
|
|
509 |
}
|
|
510 |
else if (iLanguage == ELangThai)
|
|
511 |
{
|
|
512 |
iFepUiState = TAknFepInputStateInitialThaiPredictive(this);
|
|
513 |
}
|
|
514 |
// Indic Script
|
|
515 |
else
|
|
516 |
{
|
|
517 |
iFepUiState = TAknFepInputStateInitialWesternPredictive(this);
|
|
518 |
}
|
|
519 |
}
|
|
520 |
else
|
|
521 |
{
|
|
522 |
if ( iLanguage == ELangArabic || iLanguage == ELangHebrew
|
|
523 |
|| iLanguage == ELangFarsi || iLanguage == ELangUrdu )
|
|
524 |
{
|
|
525 |
iFepUiState = TAknFepInputStateInitialArabicHebrewMultitap(this);
|
|
526 |
}
|
|
527 |
else if (iLanguage == ELangThai)
|
|
528 |
{
|
|
529 |
iFepUiState = TAknFepInputStateInitialThaiMultitap(this);
|
|
530 |
}
|
|
531 |
/* Indic Script */
|
|
532 |
|
|
533 |
#ifdef RD_HINDI_PHONETIC_INPUT
|
|
534 |
|
|
535 |
else if(TAknFepUiIndicInputManager :: IsIndicPhoneticLanguage(
|
|
536 |
( TLanguage )iLanguage ) )
|
|
537 |
{
|
|
538 |
iFepUiState = TAknFepInputStateInitialIndicPhoneticMultitap(
|
|
539 |
this, KLangHindiPhonetic);
|
|
540 |
}
|
|
541 |
#endif
|
|
542 |
else if(iLanguage == ELangVietnamese)
|
|
543 |
{
|
|
544 |
iFepUiState = TAknFepInputStateInitialVietnameseMultitap(this);
|
|
545 |
}
|
|
546 |
else
|
|
547 |
{
|
|
548 |
iFepUiState = TAknFepInputStateInitialLatinMultitap(this);
|
|
549 |
}
|
|
550 |
}
|
|
551 |
}
|
|
552 |
break;
|
|
553 |
case EHindi:
|
|
554 |
iFepUiState = TAknFepInputStateInitialIndicMultitap(this, iLanguage);
|
|
555 |
break;
|
|
556 |
case ENumber:
|
|
557 |
case ENativeNumber:
|
|
558 |
{
|
|
559 |
// Map directly to the resources...
|
|
560 |
iFepUiState = TAknFepInputStateInitialNumber(this);
|
|
561 |
break;
|
|
562 |
}
|
|
563 |
default:
|
|
564 |
AknFepPanic(EAknFepPanicBadInputState);
|
|
565 |
}
|
|
566 |
break;
|
|
567 |
}
|
|
568 |
case EEntry:
|
|
569 |
{
|
|
570 |
switch(iMode)
|
|
571 |
{
|
|
572 |
case ELatin:
|
|
573 |
#ifdef RD_INTELLIGENT_TEXT_INPUT
|
|
574 |
// Predictive QWERTY (XT9) changes ---->
|
|
575 |
if (iQwertyInputMode)
|
|
576 |
{
|
|
577 |
#ifdef __HALF_QWERTY_KEYPAD
|
|
578 |
if( EPtiKeyboardHalfQwerty == iFepMan->KeyboardLayout())
|
|
579 |
{
|
|
580 |
iFepUiState = TAknFepUiInputStateEntryHalfQwertyWesternPredictive( this );
|
|
581 |
}
|
|
582 |
else
|
|
583 |
#endif // Half Qwerty
|
|
584 |
iFepUiState = TAknFepInputStateEntryQwertyWesternPredictive(this);
|
|
585 |
} // Predictive QWERTY (XT9) changes <----
|
|
586 |
else
|
|
587 |
#endif // RD_INTELLIGENT_TEXT_INPUT
|
|
588 |
if ( iLanguage == ELangArabic || iLanguage == ELangHebrew
|
|
589 |
|| iLanguage == ELangFarsi || iLanguage == ELangUrdu)
|
|
590 |
{
|
|
591 |
iFepUiState = TAknFepInputStateEntryArabicHebrewPredictive(this);
|
|
592 |
}
|
|
593 |
else if (iLanguage == ELangThai)
|
|
594 |
{
|
|
595 |
iFepUiState = TAknFepInputStateEntryThaiPredictive(this);
|
|
596 |
}
|
|
597 |
/* Indic Script */
|
|
598 |
else if (iLanguage == ELangVietnamese)
|
|
599 |
{
|
|
600 |
iFepUiState = TAknFepInputStateEntryVietnamesePredictive(this);
|
|
601 |
}
|
|
602 |
else if (iLanguage == ELangJapanese)
|
|
603 |
{
|
|
604 |
iFepUiState = TAknFepInputStateEntryWesternPredictiveJp(this);
|
|
605 |
}
|
|
606 |
else
|
|
607 |
{
|
|
608 |
iFepUiState = TAknFepInputStateEntryWesternPredictive(this);
|
|
609 |
}
|
|
610 |
break;
|
|
611 |
case EHindi:
|
|
612 |
iFepUiState = TAknFepInputStateEntryIndicPredictive(this, iLanguage);
|
|
613 |
break;
|
|
614 |
default:
|
|
615 |
AknFepPanic(EAknFepPanicBadInputState);
|
|
616 |
break;
|
|
617 |
}
|
|
618 |
}
|
|
619 |
break;
|
|
620 |
case EQwerty:
|
|
621 |
#ifdef RD_HINDI_PHONETIC_INPUT
|
|
622 |
|
|
623 |
if(iLanguage == KLangHindiPhonetic)
|
|
624 |
{
|
|
625 |
iFepUiState = TAknFepInputStateIndicPhoneticQwerty(this);
|
|
626 |
}
|
|
627 |
else
|
|
628 |
{
|
|
629 |
#endif
|
|
630 |
iFepUiState = TAknFepInputStateQwerty(this);
|
|
631 |
#ifdef RD_HINDI_PHONETIC_INPUT
|
|
632 |
|
|
633 |
}
|
|
634 |
#endif
|
|
635 |
break;
|
|
636 |
#ifdef RD_INTELLIGENT_TEXT_INPUT
|
|
637 |
case EHalfQwerty:
|
|
638 |
iFepUiState = TAknFepInputStateHalfQwerty(this);
|
|
639 |
break;
|
|
640 |
#endif
|
|
641 |
case ECandidate:
|
|
642 |
AknFepPanic(EAknFepPanicBadInputState);
|
|
643 |
break;
|
|
644 |
case EPredictiveCandidate:
|
|
645 |
{
|
|
646 |
AknFepPanic(EAknFepPanicBadInputState);
|
|
647 |
}
|
|
648 |
break;
|
|
649 |
case EPredictiveInput:
|
|
650 |
AknFepPanic(EAknFepPanicBadInputState);
|
|
651 |
break;
|
|
652 |
default:
|
|
653 |
AknFepPanic(EAknFepPanicBadInputState);
|
|
654 |
}
|
|
655 |
|
|
656 |
iPtiEngine->SetObserver(&iFepUiState);
|
|
657 |
#ifdef _DEBUG
|
|
658 |
RDebug::Print(_L("UI Manager: New State: %d"), iFepUiState.State());
|
|
659 |
#endif
|
|
660 |
return iStatePtr->State();
|
|
661 |
}
|
|
662 |
|
|
663 |
// ---------------------------------------------------------------------------
|
|
664 |
// CAknFepUIManagerWestern::ThaiSCTResourceId
|
|
665 |
//
|
|
666 |
//
|
|
667 |
// ---------------------------------------------------------------------------
|
|
668 |
//
|
|
669 |
TInt CAknFepUIManagerWestern::ThaiSCTResourceId(TUint aPrewChar,TInt aKey)
|
|
670 |
{
|
|
671 |
TInt resourceId = 0;
|
|
672 |
if (iAknFepThaiSCTSelector)
|
|
673 |
{
|
|
674 |
resourceId = iAknFepThaiSCTSelector->ThaiSCRResourceId(aPrewChar,aKey);
|
|
675 |
}
|
|
676 |
return resourceId;
|
|
677 |
}
|
|
678 |
|
|
679 |
// ---------------------------------------------------------------------------
|
|
680 |
// CAknFepUIManagerWestern::VietnameseToneManager
|
|
681 |
//
|
|
682 |
//
|
|
683 |
// ---------------------------------------------------------------------------
|
|
684 |
//
|
|
685 |
CAknFepVietnameseToneManager* CAknFepUIManagerWestern::VietnameseToneManager() const
|
|
686 |
{
|
|
687 |
return iVietToneMarkMgr;
|
|
688 |
}
|
|
689 |
|
|
690 |
// ---------------------------------------------------------------------------
|
|
691 |
// CAknFepUIManagerWestern::CAknFepUIManagerWestern
|
|
692 |
//
|
|
693 |
//
|
|
694 |
// ---------------------------------------------------------------------------
|
|
695 |
//
|
|
696 |
CAknFepUIManagerWestern::CAknFepUIManagerWestern(MAknFepManagerUIInterface* aFepMan,
|
|
697 |
CAknFepCaseManager* aCaseMan)
|
|
698 |
: CAknFepUIManagerBase(aFepMan, aCaseMan),
|
|
699 |
iFepUiState(NULL)
|
|
700 |
{
|
|
701 |
}
|
|
702 |
|
|
703 |
// ---------------------------------------------------------------------------
|
|
704 |
// CAknFepUIManagerWestern::ConstructL
|
|
705 |
//
|
|
706 |
//
|
|
707 |
// ---------------------------------------------------------------------------
|
|
708 |
//
|
|
709 |
void CAknFepUIManagerWestern::ConstructL(TLanguage aLanguage)
|
|
710 |
{
|
|
711 |
CAknFepUIManagerBase::ConstructL(aLanguage);
|
|
712 |
iAknFepThaiSCTSelector = CAknFepThaiSCTSelector::NewL();
|
|
713 |
iVietToneMarkMgr = CAknFepVietnameseToneManager::NewL();
|
|
714 |
}
|
|
715 |
|
|
716 |
// ---------------------------------------------------------------------------
|
|
717 |
// CAknFepUIManagerWestern::FepUIState
|
|
718 |
//
|
|
719 |
//
|
|
720 |
// ---------------------------------------------------------------------------
|
|
721 |
//
|
|
722 |
TAknFepInputStateBase* CAknFepUIManagerWestern::FepUIState()
|
|
723 |
{
|
|
724 |
return &iFepUiState;
|
|
725 |
}
|
|
726 |
|
|
727 |
// End of file
|