44
|
1 |
/*
|
|
2 |
* Copyright (c) 2002-2005 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: Input mode plugin implementation file
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
// System includes
|
|
30 |
#include <ecom.h>
|
|
31 |
#include <AknFepManagerInterface.h>
|
|
32 |
#include <eikmenup.h>
|
|
33 |
#include <coemain.h>
|
|
34 |
|
|
35 |
// User includes
|
|
36 |
#include "peninputimepluginitut.h"
|
|
37 |
#include "peninputimepluginitutdebug.h"
|
|
38 |
#include "pluginfepmanageritut.h"
|
|
39 |
|
|
40 |
const TInt KInvalidImplId = 0;
|
|
41 |
|
|
42 |
_LIT(KItutImeName,"vitut Itut");
|
|
43 |
_LIT(KSplitItutImeName, "split vitut Itut");
|
|
44 |
|
|
45 |
class TScriptPair
|
|
46 |
{
|
|
47 |
public:
|
|
48 |
const TInt* iData;
|
|
49 |
TInt iLen;
|
|
50 |
CPenInputImePluginItut::TScriptIndex iScriptIdx;
|
|
51 |
};
|
|
52 |
|
|
53 |
const TInt LatinLangs[] =
|
|
54 |
{
|
|
55 |
65, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
|
|
56 |
11, 12, 13, 14, 15, 17, 18, 20, 21, 22,
|
|
57 |
23, 24, 25, 26, 27, 28, 39, 44, 45, 46,
|
|
58 |
47, 48, 49, 51, 59, 67, 68, 70, 76, 78,
|
|
59 |
79, 82, 83, 85, 91, 96, 102, 103, 401, 402
|
|
60 |
};
|
|
61 |
const TInt CyrillicLangs[] = {16, 42, 93,};
|
|
62 |
const TInt GreekLangs[] = {54, 55,};
|
|
63 |
const TInt HebrewLangs[] = {57,};
|
|
64 |
const TInt ArabicLangs[] = {37,};
|
|
65 |
const TInt FarsiLangs[] = {50,};
|
|
66 |
const TInt UrduLangs[] = {94,};
|
|
67 |
const TInt ThaiLangs[] = {33,};
|
|
68 |
const TInt ChnLangs[] = {29, 30, 31,};
|
|
69 |
const TInt IndicLangs[] = {58, 72};
|
|
70 |
|
|
71 |
_LIT(KPluginResourcePath, "z:\\RESOURCE\\Plugins\\");
|
|
72 |
_LIT(KResFilePattern, "peninputitutconfig_*.rsc");
|
|
73 |
_LIT(KResFilePatternSplit, "peninputsplititutconfig_*.rsc");
|
|
74 |
|
|
75 |
_LIT(KLatinResFile, "peninputitutconfig_latin.rsc");
|
|
76 |
_LIT(KLatinResFileSplit, "peninputsplititutconfig_latin.rsc");
|
|
77 |
_LIT(KCyrillicResFile, "peninputitutconfig_cyrillic.rsc");
|
|
78 |
_LIT(KCyrillicResFileSplit, "peninputsplititutconfig_cyrillic.rsc");
|
|
79 |
_LIT(KGreekResFile, "peninputitutconfig_greek.rsc");
|
|
80 |
_LIT(KGreekResFileSplit, "peninputsplititutconfig_greek.rsc");
|
|
81 |
_LIT(KHebrewResFile, "peninputitutconfig_hebrew.rsc");
|
|
82 |
_LIT(KHebrewResFileSplit, "peninputsplititutconfig_hebrew.rsc");
|
|
83 |
_LIT(KArabicResFile, "peninputitutconfig_arabic.rsc");
|
|
84 |
_LIT(KArabicResFileSplit, "peninputsplititutconfig_arabic.rsc");
|
|
85 |
_LIT(KFarsiResFile, "peninputitutconfig_farsi.rsc");
|
|
86 |
_LIT(KFarsiResFileSplit, "peninputsplititutconfig_farsi.rsc");
|
|
87 |
_LIT(KUrduResFile, "peninputitutconfig_urdu.rsc");
|
|
88 |
_LIT(KUrduResFileSplit, "peninputsplititutconfig_urdu.rsc");
|
|
89 |
_LIT(KThaiResFile, "peninputitutconfig_thai.rsc");
|
|
90 |
_LIT(KThaiResFileSplit, "peninputsplititutconfig_thai.rsc");
|
|
91 |
_LIT(KChnResFile, "peninputitutconfig_chinese.rsc");
|
|
92 |
_LIT(KChnResFileSplit, "peninputsplititutconfig_chinese.rsc");
|
|
93 |
|
|
94 |
_LIT(KDevanagiriResFile, "peninputitutconfig_devanagari.rsc");
|
|
95 |
_LIT(KDevanagiriResFileSplit, "peninputsplititutconfig_devanagari.rsc");
|
|
96 |
const TScriptPair KSupportScripts[] =
|
|
97 |
{
|
|
98 |
{LatinLangs, sizeof(LatinLangs)/sizeof(TInt),
|
|
99 |
CPenInputImePluginItut::ELatinLang},
|
|
100 |
{CyrillicLangs, 3, CPenInputImePluginItut::ECyrillicLang},
|
|
101 |
{GreekLangs, 2, CPenInputImePluginItut::EGreekLang},
|
|
102 |
{HebrewLangs, 1, CPenInputImePluginItut::EHebrewLang},
|
|
103 |
{ArabicLangs, 1, CPenInputImePluginItut::EArabicLang},
|
|
104 |
{FarsiLangs, 1, CPenInputImePluginItut::EFarsiLang},
|
|
105 |
{UrduLangs, 1, CPenInputImePluginItut::EUrduLang},
|
|
106 |
{ThaiLangs, 1, CPenInputImePluginItut::EThaiLang},
|
|
107 |
{ChnLangs, 3, CPenInputImePluginItut::EChnLang},
|
|
108 |
{IndicLangs, 2, CPenInputImePluginItut::EIndicLang}
|
|
109 |
};
|
|
110 |
|
|
111 |
// -----------------------------------------------------------------------------
|
|
112 |
// RImplInfoPtrArray cleanup function
|
|
113 |
// -----------------------------------------------------------------------------
|
|
114 |
//
|
|
115 |
void Cleanup( TAny* aAny )
|
|
116 |
{
|
|
117 |
RImplInfoPtrArray* implArray =
|
|
118 |
reinterpret_cast< RImplInfoPtrArray*> ( aAny );
|
|
119 |
implArray->ResetAndDestroy();
|
|
120 |
implArray->Close();
|
|
121 |
}
|
|
122 |
|
|
123 |
//lint -esym( 960, 58, * ) lint notes: break used outside of a switch
|
|
124 |
|
|
125 |
// ======== MEMBER FUNCTIONS ========
|
|
126 |
|
|
127 |
// -----------------------------------------------------------------------------
|
|
128 |
// CPenInputImePluginItut::NewL
|
|
129 |
// Factory function
|
|
130 |
// (other items were commented in a header).
|
|
131 |
// -----------------------------------------------------------------------------
|
|
132 |
//
|
|
133 |
CPenInputImePluginItut* CPenInputImePluginItut::NewL(TAny* aInitParams)
|
|
134 |
{
|
|
135 |
CPenInputImePluginItut* self = new ( ELeave ) CPenInputImePluginItut(
|
|
136 |
static_cast<RPeninputServer*>(
|
|
137 |
aInitParams ) );
|
|
138 |
CleanupStack::PushL( self );
|
|
139 |
self->ConstructL();
|
|
140 |
CleanupStack::Pop( self );
|
|
141 |
return self;
|
|
142 |
}
|
|
143 |
|
|
144 |
// -----------------------------------------------------------------------------
|
|
145 |
// CPenInputImePluginItut::NewLC
|
|
146 |
// factory function
|
|
147 |
// (other items were commented in a header).
|
|
148 |
// -----------------------------------------------------------------------------
|
|
149 |
//
|
|
150 |
CPenInputImePluginItut* CPenInputImePluginItut::NewLC(
|
|
151 |
TAny* aInitParams )
|
|
152 |
{
|
|
153 |
CPenInputImePluginItut* self = new ( ELeave ) CPenInputImePluginItut(
|
|
154 |
static_cast<RPeninputServer*>(
|
|
155 |
aInitParams ) );
|
|
156 |
CleanupStack::PushL( self );
|
|
157 |
self->ConstructL();
|
|
158 |
return self;
|
|
159 |
}
|
|
160 |
|
|
161 |
// -----------------------------------------------------------------------------
|
|
162 |
// CPenInputImePluginItut::~CPenInputImePluginItut
|
|
163 |
// Destructor
|
|
164 |
// (other items were commented in a header).
|
|
165 |
// -----------------------------------------------------------------------------
|
|
166 |
//
|
|
167 |
CPenInputImePluginItut::~CPenInputImePluginItut()
|
|
168 |
{
|
|
169 |
DeActivate();
|
|
170 |
iUiLayoutImpIdList.Close();
|
|
171 |
delete iPluginUiManager;
|
|
172 |
}
|
|
173 |
|
|
174 |
// -----------------------------------------------------------------------------
|
|
175 |
// CPenInputImePluginItut::GetInputMethodUiL
|
|
176 |
// Create layout UI interface
|
|
177 |
// (other items were commented in a header).
|
|
178 |
// -----------------------------------------------------------------------------
|
|
179 |
//
|
|
180 |
MAknFepManagerInterface* CPenInputImePluginItut::GetInputMethodUiL(
|
|
181 |
MAknFepManagerUIInterface* aFepManager,
|
|
182 |
TLanguage aLanguage,
|
|
183 |
TInt aMode,
|
|
184 |
const TDesC8& /*aData*/,
|
|
185 |
const TBool aIsSplitView)
|
|
186 |
{
|
|
187 |
iFepManager = aFepManager;
|
|
188 |
iLanguage = aLanguage;
|
|
189 |
CPluginFepManagerBase* fepmanager = NULL;
|
|
190 |
|
|
191 |
TUid layoutId;
|
|
192 |
TInt i;
|
|
193 |
|
|
194 |
switch ( aMode )
|
|
195 |
{
|
|
196 |
case EPluginInputModeItut:
|
|
197 |
{
|
|
198 |
if(aIsSplitView)
|
|
199 |
{
|
|
200 |
layoutId.iUid = KSplitItutUiId;
|
|
201 |
}
|
|
202 |
else
|
|
203 |
{
|
|
204 |
layoutId.iUid = KItutUiId;
|
|
205 |
}
|
|
206 |
}
|
|
207 |
break;
|
|
208 |
default:
|
|
209 |
return NULL;
|
|
210 |
}
|
|
211 |
fepmanager = GetPluginUiL( aMode );
|
|
212 |
|
|
213 |
for ( i = 0; i < iUiLayoutImpIdList.Count(); ++i )
|
|
214 |
{
|
|
215 |
if( iUiLayoutImpIdList[i] == layoutId.iUid )
|
|
216 |
{
|
|
217 |
break;
|
|
218 |
}
|
|
219 |
}
|
|
220 |
|
|
221 |
if ( i < iUiLayoutImpIdList.Count() )
|
|
222 |
{
|
|
223 |
iPenInputMode = aMode;
|
|
224 |
TInt errCode = iPenInputServer->SetUiLayoutId( layoutId );
|
|
225 |
if ( errCode == KErrNone )
|
|
226 |
{
|
|
227 |
fepmanager->OnInit();
|
|
228 |
return fepmanager;
|
|
229 |
}
|
|
230 |
}
|
|
231 |
|
|
232 |
return NULL;
|
|
233 |
}
|
|
234 |
|
|
235 |
// -----------------------------------------------------------------------------
|
|
236 |
// CPenInputImePluginItut::GetInputMethodUiL
|
|
237 |
// Create layout UI interface
|
|
238 |
// (other items were commented in a header).
|
|
239 |
// -----------------------------------------------------------------------------
|
|
240 |
//
|
|
241 |
MAknFepManagerInterface* CPenInputImePluginItut::GetInputMethodUiL(
|
|
242 |
MAknFepManagerUIInterface* aFepManager,
|
|
243 |
TInt aLayoutId,
|
|
244 |
const TDesC8& aData )
|
|
245 |
{
|
|
246 |
iFepManager = aFepManager;
|
|
247 |
CPluginFepManagerBase* fepmanager = NULL;
|
|
248 |
TInt i;
|
|
249 |
TInt mode;
|
|
250 |
|
|
251 |
if ( aLayoutId == KItutUiId || aLayoutId == KSplitItutUiId)
|
|
252 |
{
|
|
253 |
mode = EPluginInputModeItut;
|
|
254 |
}
|
|
255 |
else
|
|
256 |
{
|
|
257 |
mode = EPluginInputModeNone;
|
|
258 |
return NULL;
|
|
259 |
}
|
|
260 |
|
|
261 |
fepmanager = GetPluginUiL( mode );
|
|
262 |
for ( i = 0; i < iUiLayoutImpIdList.Count(); ++i )
|
|
263 |
{
|
|
264 |
if ( iUiLayoutImpIdList[i] == aLayoutId )
|
|
265 |
{
|
|
266 |
break;
|
|
267 |
}
|
|
268 |
}
|
|
269 |
|
|
270 |
if ( i < iUiLayoutImpIdList.Count() )
|
|
271 |
{
|
|
272 |
iPenInputMode = mode;
|
|
273 |
iPenInputServer->SetUiLayoutId( TUid::Uid( aLayoutId ), aData );
|
|
274 |
fepmanager->OnInit();
|
|
275 |
return fepmanager;
|
|
276 |
}
|
|
277 |
|
|
278 |
return NULL;
|
|
279 |
}
|
|
280 |
|
|
281 |
// -----------------------------------------------------------------------------
|
|
282 |
// CPenInputImePluginItut::Activate
|
|
283 |
// Activate current IME plugin.
|
|
284 |
// (other items were commented in a header).
|
|
285 |
// -----------------------------------------------------------------------------
|
|
286 |
//
|
|
287 |
void CPenInputImePluginItut::Activate()
|
|
288 |
{
|
|
289 |
if(iPenInputServer)
|
|
290 |
{
|
|
291 |
iPenInputServer->ActivateLayout(ETrue);
|
|
292 |
}
|
|
293 |
}
|
|
294 |
|
|
295 |
// -----------------------------------------------------------------------------
|
|
296 |
// CPenInputImePluginItut::DeActivate
|
|
297 |
// Deactivate current IME plugin.
|
|
298 |
// (other items were commented in a header).
|
|
299 |
// -----------------------------------------------------------------------------
|
|
300 |
//
|
|
301 |
void CPenInputImePluginItut::DeActivate()
|
|
302 |
{
|
|
303 |
if (iPenInputServer && iPenInputServer->IsVisible())
|
|
304 |
{
|
|
305 |
iPenInputServer->ActivateLayout(EFalse);
|
|
306 |
}
|
|
307 |
}
|
|
308 |
|
|
309 |
// -----------------------------------------------------------------------------
|
|
310 |
// CPenInputImePluginItut::ImeImplId
|
|
311 |
// Get current IME plugin implementation ID.
|
|
312 |
// (other items were commented in a header).
|
|
313 |
// -----------------------------------------------------------------------------
|
|
314 |
//
|
|
315 |
TInt CPenInputImePluginItut::ImeImplId()
|
|
316 |
{
|
|
317 |
return KInputMethodImplementationId;
|
|
318 |
}
|
|
319 |
|
|
320 |
// -----------------------------------------------------------------------------
|
|
321 |
// CPenInputImePluginItut::LayoutUiImplId
|
|
322 |
// Get current layout UI implementation id.
|
|
323 |
// (other items were commented in a header).
|
|
324 |
// -----------------------------------------------------------------------------
|
|
325 |
//
|
|
326 |
TInt CPenInputImePluginItut::LayoutUiImplId()
|
|
327 |
{
|
|
328 |
TInt id;
|
|
329 |
switch ( iPenInputMode )
|
|
330 |
{
|
|
331 |
case EPluginInputModeItut:
|
|
332 |
{
|
|
333 |
id = KItutUiId;
|
|
334 |
}
|
|
335 |
break;
|
|
336 |
default:
|
|
337 |
{
|
|
338 |
id = KInvalidImplId;
|
|
339 |
}
|
|
340 |
break;
|
|
341 |
}
|
|
342 |
return id;
|
|
343 |
}
|
|
344 |
|
|
345 |
|
|
346 |
// -----------------------------------------------------------------------------
|
|
347 |
// CPenInputImePluginItut::SupportModes
|
|
348 |
// Get suppored layout UI modes(VKB/HWR).
|
|
349 |
// (other items were commented in a header).
|
|
350 |
// -----------------------------------------------------------------------------
|
|
351 |
//
|
|
352 |
TInt CPenInputImePluginItut::SupportModes(CPtiEngine* aPtiEngine,
|
|
353 |
RArray<TImePlguinImplDetail>& aSupportList) const
|
|
354 |
{
|
|
355 |
TInt ret = KErrNone;
|
|
356 |
TRAP_IGNORE( ret = SupportModesL( aPtiEngine, aSupportList ) );
|
|
357 |
return ret;
|
|
358 |
}
|
|
359 |
|
|
360 |
// -----------------------------------------------------------------------------
|
|
361 |
// CPenInputImePluginItut::SupportModesL
|
|
362 |
// Get suppored layout UI modes(VKB/HWR).
|
|
363 |
// (other items were commented in a header).
|
|
364 |
// -----------------------------------------------------------------------------
|
|
365 |
//
|
|
366 |
TBool IsFileInDir( CDir* aDir, const TDesC& aFileName )
|
|
367 |
{
|
|
368 |
if( aDir )
|
|
369 |
{
|
|
370 |
for( TInt k = 0; k < aDir->Count(); ++k )
|
|
371 |
{
|
|
372 |
if( aFileName.CompareF( (*aDir)[k].iName ) == 0 )
|
|
373 |
{
|
|
374 |
return ETrue;
|
|
375 |
}
|
|
376 |
}
|
|
377 |
}
|
|
378 |
return EFalse;
|
|
379 |
}
|
|
380 |
|
|
381 |
|
|
382 |
TInt CPenInputImePluginItut::SupportModesL(CPtiEngine* /*aPtiEngine*/,
|
|
383 |
RArray<TImePlguinImplDetail>& aSupportList) const
|
|
384 |
{
|
|
385 |
CleanupClosePushL( aSupportList );
|
|
386 |
RImplInfoPtrArray infoArray;
|
|
387 |
TUid id;
|
|
388 |
id.iUid = KHwrLayoutInterfaceId;
|
|
389 |
TBool itut = EFalse;
|
|
390 |
TBool splititut = EFalse;
|
|
391 |
|
|
392 |
CleanupStack::PushL( TCleanupItem( Cleanup, &infoArray ) );
|
|
393 |
REComSession::ListImplementationsL(id, infoArray);
|
|
394 |
|
|
395 |
for (TInt i = 0; i < infoArray.Count(); ++i)
|
|
396 |
{
|
|
397 |
if (infoArray[i]->ImplementationUid().iUid == KItutUiId)
|
|
398 |
{
|
|
399 |
itut = ETrue;
|
|
400 |
}
|
|
401 |
|
|
402 |
if (infoArray[i]->ImplementationUid().iUid == KSplitItutUiId)
|
|
403 |
{
|
|
404 |
splititut = ETrue;
|
|
405 |
}
|
|
406 |
}
|
|
407 |
|
|
408 |
TImePlguinImplDetail detail;
|
|
409 |
|
|
410 |
detail.iImplementationId = KInputMethodImplementationId;
|
|
411 |
|
|
412 |
if (itut)
|
|
413 |
{
|
|
414 |
detail.iMode = EPluginInputModeItut;
|
|
415 |
detail.iDisplayName.Copy(KItutImeName());
|
|
416 |
detail.iMeritValue = EImeMerit_Preferred;
|
|
417 |
|
|
418 |
TFindFile fileFinder(CCoeEnv::Static()->FsSession());
|
|
419 |
|
|
420 |
CDir* dir = NULL;
|
|
421 |
TInt result = fileFinder.FindWildByDir( KResFilePattern, KPluginResourcePath, dir );
|
|
422 |
if( result == KErrNone )
|
|
423 |
{
|
|
424 |
for (TInt i = 0; i < sizeof(KSupportScripts)/sizeof(KSupportScripts[0]); i++)
|
|
425 |
{
|
|
426 |
if ( IsFileInDir( dir, ResFileNameByScriptIdx(KSupportScripts[i].iScriptIdx) ) )
|
|
427 |
{
|
|
428 |
TInt* data = const_cast<TInt*>(KSupportScripts[i].iData);
|
|
429 |
for (TInt j = 0; j < KSupportScripts[i].iLen; j++)
|
|
430 |
{
|
|
431 |
detail.iLanguage = *(data);
|
|
432 |
data++;
|
|
433 |
aSupportList.AppendL(detail);
|
|
434 |
}
|
|
435 |
}
|
|
436 |
}
|
|
437 |
}
|
|
438 |
delete dir;
|
|
439 |
}
|
|
440 |
|
|
441 |
if (splititut)
|
|
442 |
{
|
|
443 |
detail.iMode = EPluginInputModeItut;
|
|
444 |
detail.iDisplayName.Copy(KSplitItutImeName());
|
|
445 |
detail.iMeritValue = EImeMerit_Preferred;
|
|
446 |
|
|
447 |
TFindFile fileFinder(CCoeEnv::Static()->FsSession());
|
|
448 |
|
|
449 |
CDir* dir = NULL;
|
|
450 |
TInt result = fileFinder.FindWildByDir( KResFilePatternSplit, KPluginResourcePath, dir );
|
|
451 |
if( result == KErrNone )
|
|
452 |
{
|
|
453 |
for (TInt i = 0; i < sizeof(KSupportScripts)/sizeof(KSupportScripts[0]); i++)
|
|
454 |
{
|
|
455 |
if ( IsFileInDir( dir, ResFileNameByScriptIdxForSplit(KSupportScripts[i].iScriptIdx) ) )
|
|
456 |
{
|
|
457 |
TInt* data = const_cast<TInt*>(KSupportScripts[i].iData);
|
|
458 |
for (TInt j = 0; j < KSupportScripts[i].iLen; j++)
|
|
459 |
{
|
|
460 |
detail.iLanguage = *(data);
|
|
461 |
data++;
|
|
462 |
aSupportList.AppendL(detail);
|
|
463 |
}
|
|
464 |
}
|
|
465 |
}
|
|
466 |
}
|
|
467 |
delete dir;
|
|
468 |
}
|
|
469 |
|
|
470 |
CleanupStack::PopAndDestroy(&infoArray); // infoArray
|
|
471 |
CleanupStack::Pop( &aSupportList );
|
|
472 |
return 0;
|
|
473 |
}
|
|
474 |
|
|
475 |
// -----------------------------------------------------------------------------
|
|
476 |
// CPenInputImePluginItut::CurrentMode
|
|
477 |
// Get current layout UI mode.
|
|
478 |
// (other items were commented in a header).
|
|
479 |
// -----------------------------------------------------------------------------
|
|
480 |
//
|
|
481 |
TInt CPenInputImePluginItut::CurrentMode() const
|
|
482 |
{
|
|
483 |
return iPenInputMode;
|
|
484 |
}
|
|
485 |
|
|
486 |
// -----------------------------------------------------------------------------
|
|
487 |
// CPenInputImePluginItut::HandleServerEventL
|
|
488 |
// Handle pen input server event..
|
|
489 |
// (other items were commented in a header).
|
|
490 |
// -----------------------------------------------------------------------------
|
|
491 |
//
|
|
492 |
TBool CPenInputImePluginItut::HandleServerEventL( TInt aEventId, const TDesC& aData )
|
|
493 |
{
|
|
494 |
TBool bHandled = EFalse;
|
|
495 |
switch ( aEventId )
|
|
496 |
{
|
|
497 |
case ESignalLayoutICFLengthChanged:
|
|
498 |
{
|
|
499 |
GetCurrentUi()->RetrieveEditorMaxLength();
|
|
500 |
}
|
|
501 |
break;
|
|
502 |
case ESignalCaseMode:
|
|
503 |
{
|
|
504 |
TInt data = *(TInt*)( aData.Ptr() );
|
|
505 |
ASSERT( data >= 0 );
|
|
506 |
//lint !e728
|
|
507 |
GetCurrentUi()->UpdateCaseMode( data );
|
|
508 |
}
|
|
509 |
break;
|
|
510 |
default:
|
|
511 |
break;
|
|
512 |
}
|
|
513 |
|
|
514 |
return bHandled;
|
|
515 |
}
|
|
516 |
|
|
517 |
// -----------------------------------------------------------------------------
|
|
518 |
// CPenInputImePluginItut::HandleMenuCommandL
|
|
519 |
// Handle the menu command.
|
|
520 |
// (other items were commented in a header).
|
|
521 |
// -----------------------------------------------------------------------------
|
|
522 |
//
|
|
523 |
TBool CPenInputImePluginItut::HandleMenuCommandL( TInt /*aCommandId*/ )
|
|
524 |
{
|
|
525 |
return EFalse;
|
|
526 |
}
|
|
527 |
|
|
528 |
// -----------------------------------------------------------------------------
|
|
529 |
// CPenInputImePluginItut::DynInitMenuPaneL
|
|
530 |
// Dynamiclly update menu items during it displays.
|
|
531 |
// (other items were commented in a header).
|
|
532 |
// -----------------------------------------------------------------------------
|
|
533 |
//
|
|
534 |
void CPenInputImePluginItut::DynInitMenuPaneL( CAknFepUiInterfaceMenuPane* /*aMenuPane*/ )
|
|
535 |
{
|
|
536 |
}
|
|
537 |
|
|
538 |
|
|
539 |
// -----------------------------------------------------------------------------
|
|
540 |
// CPenInputImePluginItut::CPenInputImePluginItut
|
|
541 |
// C++ default constructor.
|
|
542 |
// (other items were commented in a header).
|
|
543 |
// -----------------------------------------------------------------------------
|
|
544 |
//
|
|
545 |
CPenInputImePluginItut::CPenInputImePluginItut( RPeninputServer* aHwrServer )
|
|
546 |
:iPenInputServer( aHwrServer )
|
|
547 |
{
|
|
548 |
}
|
|
549 |
|
|
550 |
// -----------------------------------------------------------------------------
|
|
551 |
// CPenInputImePluginItut::ConstructL
|
|
552 |
// 2nd phase constructor.
|
|
553 |
// (other items were commented in a header).
|
|
554 |
// -----------------------------------------------------------------------------
|
|
555 |
//
|
|
556 |
void CPenInputImePluginItut::ConstructL()
|
|
557 |
{
|
|
558 |
FindUiLayoutImplementationL();
|
|
559 |
}
|
|
560 |
|
|
561 |
// -----------------------------------------------------------------------------
|
|
562 |
// CPenInputImePluginItut::FindUiLayoutImplementationL
|
|
563 |
// Enumuate all layout UI ids.
|
|
564 |
// (other items were commented in a header).
|
|
565 |
// -----------------------------------------------------------------------------
|
|
566 |
//
|
|
567 |
void CPenInputImePluginItut::FindUiLayoutImplementationL()
|
|
568 |
{
|
|
569 |
RImplInfoPtrArray infoArray;
|
|
570 |
TUid id;
|
|
571 |
id.iUid = KHwrLayoutInterfaceId;
|
|
572 |
|
|
573 |
iUiLayoutImpIdList.Reset();
|
|
574 |
CleanupStack::PushL( TCleanupItem( Cleanup, &infoArray ) );
|
|
575 |
REComSession::ListImplementationsL( id, infoArray );
|
|
576 |
|
|
577 |
for ( TInt i = 0; i < infoArray.Count(); ++i )
|
|
578 |
{
|
|
579 |
iUiLayoutImpIdList.AppendL( infoArray[i]->ImplementationUid().iUid );
|
|
580 |
}
|
|
581 |
|
|
582 |
CleanupStack::PopAndDestroy( &infoArray ); // infoArray
|
|
583 |
}
|
|
584 |
|
|
585 |
// -----------------------------------------------------------------------------
|
|
586 |
// CPenInputImePluginItut::GetPluginUiL
|
|
587 |
// Get HWR UI interface.
|
|
588 |
// (other items were commented in a header).
|
|
589 |
// -----------------------------------------------------------------------------
|
|
590 |
//
|
|
591 |
CPluginFepManagerBase* CPenInputImePluginItut::GetPluginUiL( TInt aMode )
|
|
592 |
{
|
|
593 |
switch ( aMode )
|
|
594 |
{
|
|
595 |
case EPluginInputModeItut:
|
|
596 |
{
|
|
597 |
delete iPluginUiManager;
|
|
598 |
iPluginUiManager = NULL;
|
|
599 |
iPluginUiManager = CPluginFepManagerItut::NewL(*this, iPenInputServer);
|
|
600 |
return iPluginUiManager;
|
|
601 |
}
|
|
602 |
default:
|
|
603 |
{
|
|
604 |
return NULL;
|
|
605 |
}
|
|
606 |
}
|
|
607 |
}
|
|
608 |
|
|
609 |
// -----------------------------------------------------------------------------
|
|
610 |
// CPenInputImePluginItut::ResFileNameByScriptIdx
|
|
611 |
// Get HWR UI interface.
|
|
612 |
// (other items were commented in a header).
|
|
613 |
// -----------------------------------------------------------------------------
|
|
614 |
//
|
|
615 |
const TDesC& CPenInputImePluginItut::ResFileNameByScriptIdx(const TScriptIndex aIndex)
|
|
616 |
{
|
|
617 |
switch (aIndex)
|
|
618 |
{
|
|
619 |
case ELatinLang:
|
|
620 |
return KLatinResFile;
|
|
621 |
case ECyrillicLang:
|
|
622 |
return KCyrillicResFile;
|
|
623 |
case EGreekLang:
|
|
624 |
return KGreekResFile;
|
|
625 |
case EHebrewLang:
|
|
626 |
return KHebrewResFile;
|
|
627 |
case EArabicLang:
|
|
628 |
return KArabicResFile;
|
|
629 |
case EFarsiLang:
|
|
630 |
return KFarsiResFile;
|
|
631 |
case EUrduLang:
|
|
632 |
return KUrduResFile;
|
|
633 |
case EThaiLang:
|
|
634 |
return KThaiResFile;
|
|
635 |
case EChnLang:
|
|
636 |
return KChnResFile;
|
|
637 |
case EIndicLang:
|
|
638 |
return KDevanagiriResFile;
|
|
639 |
default:
|
|
640 |
break;
|
|
641 |
}
|
|
642 |
|
|
643 |
return KNullDesC;
|
|
644 |
}
|
|
645 |
|
|
646 |
const TDesC& CPenInputImePluginItut::ResFileNameByScriptIdxForSplit(const TScriptIndex aIndex)
|
|
647 |
{
|
|
648 |
switch (aIndex)
|
|
649 |
{
|
|
650 |
case ELatinLang:
|
|
651 |
return KLatinResFileSplit;
|
|
652 |
|
|
653 |
case ECyrillicLang:
|
|
654 |
return KCyrillicResFileSplit;
|
|
655 |
|
|
656 |
case EGreekLang:
|
|
657 |
return KGreekResFileSplit;
|
|
658 |
|
|
659 |
case EHebrewLang:
|
|
660 |
return KHebrewResFileSplit;
|
|
661 |
|
|
662 |
case EArabicLang:
|
|
663 |
return KArabicResFileSplit;
|
|
664 |
|
|
665 |
case EFarsiLang:
|
|
666 |
return KFarsiResFileSplit;
|
|
667 |
|
|
668 |
case EUrduLang:
|
|
669 |
return KUrduResFileSplit;
|
|
670 |
|
|
671 |
case EThaiLang:
|
|
672 |
return KThaiResFileSplit;
|
|
673 |
|
|
674 |
case EChnLang:
|
|
675 |
return KChnResFileSplit;
|
|
676 |
|
|
677 |
case EIndicLang:
|
|
678 |
return KDevanagiriResFileSplit;
|
|
679 |
|
|
680 |
default:
|
|
681 |
break;
|
|
682 |
}
|
|
683 |
|
|
684 |
return KNullDesC;
|
|
685 |
}
|
|
686 |
|
|
687 |
//End Of File
|