author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 14 Sep 2010 21:59:06 +0300 | |
branch | RCL_3 |
changeset 22 | bd83ceabce89 |
parent 21 | ecbabf52600f |
permissions | -rw-r--r-- |
21 | 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: split itu-t data manager |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#include <PtiEngine.h> |
|
20 |
#include <coemain.h> |
|
21 |
#include <AknUtils.h> |
|
22 |
#include <peninputsplititutnew.rsg> |
|
23 |
#include <peninputsplititutconfig_chinese.rsg> |
|
24 |
#include <peninputsplititutconfig_latin.rsg> |
|
25 |
#include <peninputsplititutconfig_hebrew.rsg> |
|
26 |
#include <peninputsplititutconfig_farsi.rsg> |
|
27 |
#include <AknFepGlobalEnums.h> |
|
28 |
#include <eikon.hrh> |
|
29 |
#include <bautils.h> |
|
30 |
#include <aknlayoutscalable_avkon.cdl.h> |
|
31 |
#include <peninputlayoutmultilineicf.h> |
|
32 |
#include <AknSettingCache.h> |
|
33 |
||
34 |
#include "peninputsplititutdatamgr.h" |
|
35 |
#include "peninputsplititutlayoutcontext.h" |
|
36 |
#include "peninputsplititutconverter.h" |
|
37 |
#include "peninputsplititutwindowmanager.h" |
|
38 |
||
39 |
#define LAF_MODIFY 1 |
|
40 |
_LIT(KItutCommonResFile, "z:\\resource\\plugins\\peninputsplititutnew.rsc"); |
|
41 |
_LIT(KConfigResourceFile, |
|
42 |
"z:\\resource\\plugins\\peninputsplititutconfig_"); |
|
43 |
_LIT(KResourceFileExtName, ".rsc"); |
|
44 |
||
45 |
_LIT(KAvkonResourceFile, "z:\\resource\\avkon.rsc"); |
|
46 |
||
47 |
const TInt KOnePageCandidateCount = 40; |
|
48 |
const TInt KMaxPredictCandCnt = 250; |
|
49 |
const TInt KInvalidResId = -1; |
|
50 |
const TInt KInvalidImMode = -1; |
|
51 |
const TInt KInvalidIndex = -1; |
|
52 |
const TUint16 KPlusChar = '+'; |
|
53 |
||
54 |
||
55 |
// ============================ MEMBER FUNCTIONS ============================= |
|
56 |
||
57 |
// --------------------------------------------------------------------------- |
|
58 |
// CSplitItutDataMgr::NewL |
|
59 |
// (other items were commented in a header) |
|
60 |
// --------------------------------------------------------------------------- |
|
61 |
// |
|
62 |
CSplitItutDataMgr* CSplitItutDataMgr::NewL(MSplitItutLayoutContext* aLayoutContext, |
|
63 |
CPtiEngine* aPtiEngine) |
|
64 |
{ |
|
65 |
CSplitItutDataMgr* self = new (ELeave) CSplitItutDataMgr(aLayoutContext, aPtiEngine); |
|
66 |
CleanupStack::PushL(self); |
|
67 |
self->ConstructL(); |
|
68 |
CleanupStack::Pop(self);//self |
|
69 |
return self; |
|
70 |
} |
|
71 |
||
72 |
/* |
|
73 |
// --------------------------------------------------------------------------- |
|
74 |
// CSplitItutDataMgr::ClearChnCandidates |
|
75 |
// (other items were commented in a header) |
|
76 |
// --------------------------------------------------------------------------- |
|
77 |
// |
|
78 |
void CSplitItutDataMgr::ClearChnCandidates(TInt aCmd) |
|
79 |
{ |
|
80 |
switch (aCmd) |
|
81 |
{ |
|
82 |
case EItutCandidates: |
|
83 |
{ |
|
84 |
iCandidates.ResetAndDestroy(); |
|
85 |
iCandidates.Close(); |
|
86 |
} |
|
87 |
break; |
|
88 |
case EItutPuncCandidates: |
|
89 |
{ |
|
90 |
iPuncCandidates.ResetAndDestroy(); |
|
91 |
iPuncCandidates.Close(); |
|
92 |
} |
|
93 |
break; |
|
94 |
default: |
|
95 |
break; |
|
96 |
} |
|
97 |
} |
|
98 |
*/ |
|
99 |
||
100 |
// ---------CSplitItutDataMgr---------------------------------------- |
|
101 |
// CSplitItutDataMgr::~CSplitItutDataMgr |
|
102 |
// (other items were commented in a header) |
|
103 |
// --------------------------------------------------------------------------- |
|
104 |
// |
|
105 |
CSplitItutDataMgr::~CSplitItutDataMgr() |
|
106 |
{ |
|
107 |
iSubscriberList.Close(); |
|
108 |
||
109 |
CCoeEnv::Static()->DeleteResourceFile(iAvkonResId); |
|
110 |
CCoeEnv::Static()->DeleteResourceFile(iCommonResId); |
|
111 |
||
112 |
if (iConfigResId) |
|
113 |
{ |
|
114 |
CCoeEnv::Static()->DeleteResourceFile(iConfigResId); |
|
115 |
} |
|
116 |
||
117 |
// ClearChnCandidates(EItutCandidates); |
|
118 |
// ClearChnCandidates(EItutPuncCandidates); |
|
119 |
||
120 |
iKeypadCellRects.Close(); |
|
121 |
// iKeypadCellRectsCn.Close(); |
|
122 |
delete iNumericKeymapData; |
|
123 |
} |
|
124 |
||
125 |
// --------------------------------------------------------------------------- |
|
126 |
// CSplitItutDataMgr::ConstructL |
|
127 |
// (other items were commented in a header) |
|
128 |
// --------------------------------------------------------------------------- |
|
129 |
// |
|
130 |
void CSplitItutDataMgr::ConstructL() |
|
131 |
{ |
|
132 |
// initialize layout info of controls and layout |
|
133 |
ReadLafInfo(); |
|
134 |
TFileName resourceCommonName(KItutCommonResFile); |
|
135 |
CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
136 |
BaflUtils::NearestLanguageFile(coeEnv->FsSession(), resourceCommonName); |
|
137 |
iCommonResId = coeEnv->AddResourceFileL(resourceCommonName); |
|
138 |
||
139 |
TFileName resourceAvkonName(KAvkonResourceFile); |
|
140 |
BaflUtils::NearestLanguageFile(coeEnv->FsSession(), resourceAvkonName); |
|
141 |
iAvkonResId = coeEnv->AddResourceFileL(resourceAvkonName); |
|
142 |
} |
|
143 |
||
144 |
// --------------------------------------------------------------------------- |
|
145 |
// CSplitItutDataMgr::ReadLafInfo |
|
146 |
// (other items were commented in a header) |
|
147 |
// --------------------------------------------------------------------------- |
|
148 |
// |
|
149 |
void CSplitItutDataMgr::ReadLafInfo() |
|
150 |
{ |
|
151 |
// Screen |
|
152 |
TRect rect; |
|
153 |
rect = AknLayoutScalable_Avkon::application_window(0).LayoutLine().Rect(); |
|
154 |
iScreenSize = rect.Size(); |
|
155 |
||
156 |
// finger Layout |
|
157 |
TAknWindowLineLayout splitwnd, splitpane; |
|
158 |
TAknLayoutRect spliwndtrect, splitpanerect; |
|
159 |
||
160 |
// Get Split view rect |
|
161 |
splitwnd = AknLayoutScalable_Avkon::popup_fep_ituss_window(0).LayoutLine(); |
|
162 |
spliwndtrect.LayoutRect(rect, splitwnd); |
|
163 |
||
164 |
splitpane = AknLayoutScalable_Avkon::ituss_keypad_pane(0).LayoutLine(); |
|
165 |
splitpanerect.LayoutRect(spliwndtrect.Rect(), splitpane); |
|
166 |
||
167 |
iLayoutRect = spliwndtrect.Rect(); |
|
168 |
// spell layout rect |
|
169 |
iLayoutRectSpell = rect; |
|
170 |
iLayoutOffset = spliwndtrect.Rect().iTl; |
|
171 |
iBackgroundRect = iLayoutRect; |
|
172 |
iBackgroundRect.Move(-iLayoutOffset); |
|
173 |
||
174 |
||
175 |
// Keypad |
|
176 |
TAknWindowLineLayout itucell, ituinnercell; |
|
177 |
TAknLayoutRect itucellrect, ituinnercellrect; |
|
178 |
||
179 |
iKeypadCellRects.Reset(); |
|
180 |
// iKeypadCellRectsCn.Reset(); |
|
181 |
||
182 |
itucell = AknLayoutScalable_Avkon::cell_ituss_key_pane(0).LayoutLine(); |
|
183 |
itucellrect.LayoutRect(splitpanerect.Rect(), itucell); |
|
184 |
ituinnercell = AknLayoutScalable_Avkon::bg_cell_ituss_key_g1(1).LayoutLine(); |
|
185 |
||
186 |
iKeypadRect = splitpanerect.Rect(); |
|
187 |
iKeypadRect.SetHeight(itucellrect.Rect().Height() * 4); |
|
188 |
iKeypadRect.Move(-iLayoutOffset); |
|
189 |
||
190 |
TRect cellrect = itucellrect.Rect(); |
|
191 |
cellrect.Move(-iLayoutOffset); |
|
192 |
cellrect.Move(-iKeypadRect.iTl); |
|
193 |
||
194 |
// keypad is 4 rows, 3 cols |
|
195 |
for (TInt i = 0; i < 4; i++) |
|
196 |
{ |
|
197 |
for (TInt j = 0; j < 3; j++) |
|
198 |
{ |
|
199 |
TRect keyrect = cellrect; |
|
200 |
keyrect.Move(itucellrect.Rect().Width() * j, itucellrect.Rect().Height() * i); |
|
201 |
||
202 |
ituinnercellrect.LayoutRect(keyrect, ituinnercell); |
|
203 |
iKeypadCellRects.Append(ituinnercellrect.Rect()); |
|
204 |
||
205 |
// read shift icon rect |
|
206 |
if( i == 3 && j == 2 ) |
|
207 |
{ |
|
208 |
TAknWindowLineLayout shiftIcon = AknLayoutScalable_Avkon:: |
|
209 |
cell_ituss_key_pane_g2( 0 ).LayoutLine(); |
|
210 |
TAknLayoutRect shiftIconRect; |
|
211 |
shiftIconRect.LayoutRect( keyrect, shiftIcon ); |
|
212 |
iShiftIconRect = shiftIconRect.Rect(); |
|
213 |
} |
|
214 |
||
215 |
// read star icon rect |
|
216 |
if( i == 3 && j == 2 ) |
|
217 |
{ |
|
218 |
TAknWindowLineLayout starIcon = AknLayoutScalable_Avkon:: |
|
219 |
cell_ituss_key_pane_g2( 0 ).LayoutLine(); |
|
220 |
TAknLayoutRect starIconRect; |
|
221 |
starIconRect.LayoutRect( keyrect, starIcon ); |
|
222 |
iStarIconRect = starIconRect.Rect(); |
|
223 |
} |
|
224 |
||
225 |
} |
|
226 |
} |
|
227 |
||
228 |
||
229 |
iVkBigNumTextForPrtWest = AknLayoutScalable_Avkon::cell_ituss_key_t1(4).LayoutLine(); |
|
230 |
||
231 |
iVkNumText = AknLayoutScalable_Avkon::cell_ituss_key_t1(1).LayoutLine(); |
|
232 |
// Key text row 1 |
|
233 |
iVkAlphaText1 = AknLayoutScalable_Avkon::cell_ituss_key_t2(1).LayoutLine(); |
|
234 |
iVkAlphaText3 = AknLayoutScalable_Avkon::cell_ituss_key_t4(1).LayoutLine(); |
|
235 |
// Key text row 2 |
|
236 |
iVkAlphaText2 = AknLayoutScalable_Avkon::cell_ituss_key_t3(1).LayoutLine(); |
|
237 |
||
238 |
// Plus for Numberic Only keypad |
|
239 |
iVkTextPlusForNumbericOnly = |
|
240 |
AknLayoutScalable_Avkon::cell_ituss_key_t5(0).LayoutLine(); |
|
241 |
||
242 |
// close button |
|
243 |
TAknWindowLineLayout funcbtn, funcbtnbg, funcbtninner; |
|
244 |
TAknLayoutRect funcrect, funcbgrect, funcinnerrect, arrowleftinnerrect, arrowrightinnerrect; |
|
245 |
TAknLayoutRect optioninnerrect, backspaceinnerrect; |
|
246 |
||
247 |
funcbtn = AknLayoutScalable_Avkon::cell_ituss_key_pane(1).LayoutLine(); |
|
248 |
funcrect.LayoutRect(splitpanerect.Rect(), funcbtn); |
|
249 |
||
250 |
funcbtnbg = AknLayoutScalable_Avkon::bg_cell_ituss_key_g1(1).LayoutLine(); |
|
251 |
funcbgrect.LayoutRect(funcrect.Rect(), funcbtnbg); |
|
252 |
||
253 |
funcbtninner = AknLayoutScalable_Avkon::cell_ituss_key_pane_g1(0).LayoutLine(); |
|
254 |
funcinnerrect.LayoutRect(funcrect.Rect(), funcbtninner); |
|
255 |
||
256 |
TInt btnWidth = funcrect.Rect().Width(); |
|
257 |
// close button |
|
258 |
iCloseRect = funcbgrect.Rect(); |
|
259 |
iCloseRect.Move(0, funcrect.Rect().Height() * 4); |
|
260 |
iCloseRect.Move(-iLayoutOffset); |
|
261 |
||
262 |
iCloseInnerRect = funcinnerrect.Rect(); |
|
263 |
iCloseInnerRect.Move(0, iKeypadRect.iBr.iY ); |
|
264 |
iCloseInnerRect.Move(-iLayoutOffset); |
|
265 |
||
266 |
// arrow left button |
|
267 |
iArrowLeftRect = iCloseRect; |
|
268 |
iArrowLeftRect.Move(btnWidth, 0); |
|
269 |
arrowleftinnerrect.LayoutRect(iArrowLeftRect, funcbtninner); |
|
270 |
iArrowLeftInnerRect = arrowleftinnerrect.Rect(); |
|
271 |
||
272 |
// option button |
|
273 |
iOptionsRect = iArrowLeftRect; |
|
274 |
iOptionsRect.Move(btnWidth, 0); |
|
275 |
optioninnerrect.LayoutRect(iOptionsRect, funcbtninner); |
|
276 |
iOptionInnerRect = optioninnerrect.Rect(); |
|
277 |
||
278 |
// arrow right button |
|
279 |
iArrowRightRect = iOptionsRect; |
|
280 |
iArrowRightRect.Move(btnWidth, 0); |
|
281 |
arrowrightinnerrect.LayoutRect(iArrowRightRect, funcbtninner); |
|
282 |
iArrowRightInnerRect = arrowrightinnerrect.Rect(); |
|
283 |
||
284 |
// backspace button |
|
285 |
iBackspaceRect = iArrowRightRect; |
|
286 |
iBackspaceRect.Move(btnWidth, 0); |
|
287 |
backspaceinnerrect.LayoutRect(iBackspaceRect, funcbtninner); |
|
288 |
iBackspaceInnerRect = backspaceinnerrect.Rect(); |
|
289 |
||
290 |
||
291 |
// preview popup window |
|
292 |
TAknWindowLineLayout previewWnd, previewBackground, previewWndInner; |
|
293 |
TAknLayoutRect previewWndRect, previewBackgroundRect, previewWndInnerRect; |
|
294 |
TAknLayoutText previewWndText; |
|
295 |
previewWnd = AknLayoutScalable_Avkon::popup_fshwr2_char_preview_window(0).LayoutLine(); |
|
296 |
||
297 |
previewWndRect.LayoutRect( iLayoutRect, previewWnd ); |
|
298 |
previewBackground = AknLayoutScalable_Avkon::bg_popup_fep_char_preview_window_cp01().LayoutLine(); |
|
299 |
previewBackgroundRect.LayoutRect( previewWndRect.Rect(), previewBackground ); |
|
300 |
iPreviewWndRect = previewBackgroundRect.Rect(); |
|
301 |
||
302 |
previewWndInner = AknLayoutScalable_Avkon::bg_popup_fep_char_preview_window_g9().LayoutLine(); |
|
303 |
previewWndInnerRect.LayoutRect( previewBackgroundRect.Rect(), previewWndInner ); |
|
304 |
||
305 |
iPreviewWndInnerRect = previewWndInnerRect.Rect(); |
|
306 |
iPreviewWndText = |
|
307 |
AknLayoutScalable_Avkon::popup_fshwr2_char_preview_window_t1(0).LayoutLine(); |
|
308 |
previewWndText.LayoutText(previewWndRect.Rect(), iPreviewWndText); |
|
309 |
iBubbleFont = const_cast<CFont*>(previewWndText.Font()); |
|
310 |
||
311 |
// for spell window |
|
312 |
TAknWindowLineLayout spellwnd; |
|
313 |
TAknLayoutRect spellwndtrect; |
|
314 |
||
315 |
spellwnd = AknLayoutScalable_Avkon::popup_fep_ituss_window(1).LayoutLine(); |
|
316 |
spellwndtrect.LayoutRect(rect, spellwnd); |
|
317 |
||
318 |
// icf in spell mode |
|
319 |
TAknWindowLineLayout icfpane, focuspane, |
|
320 |
bottomInnerBtn, middleInnerBtn, middleBtn; |
|
321 |
TAknLayoutRect icfpaneRect, focuspaneRect, |
|
322 |
bottomButton, bottomInnerRect, middleBtnRect, okBtnRect, cancelBtnRect; |
|
323 |
||
324 |
icfpane = AknLayoutScalable_Avkon::popup_fep_vtchi_icf_pane(1).LayoutLine(); |
|
325 |
icfpaneRect.LayoutRect(rect, icfpane); |
|
326 |
||
327 |
focuspane = AknLayoutScalable_Avkon::vtchi_query_pane(0).LayoutLine(); |
|
328 |
focuspaneRect.LayoutRect(icfpaneRect.Rect(), focuspane); |
|
329 |
iSpellICFRect = focuspaneRect.Rect(); |
|
330 |
||
331 |
// Middle pane |
|
332 |
TRect middleButtonPaneRect = spellwndtrect.Rect(); |
|
333 |
TInt leftMargin = itucellrect.Rect().iTl.iX; |
|
334 |
middleButtonPaneRect.Move( leftMargin, 0 ); |
|
335 |
||
336 |
middleBtn = AknLayoutScalable_Avkon::cell_ituss_key_pane(3).LayoutLine(); |
|
337 |
middleBtnRect.LayoutRect( splitpanerect.Rect(), middleBtn ); |
|
338 |
middleInnerBtn = AknLayoutScalable_Avkon::bg_cell_ituss_key_g1(5).LayoutLine(); |
|
339 |
||
340 |
TRect cellMiddleRect; |
|
341 |
cellMiddleRect.iTl = middleButtonPaneRect.iTl; |
|
342 |
cellMiddleRect.SetHeight( middleBtnRect.Rect().Height()); |
|
343 |
cellMiddleRect.SetWidth( middleBtnRect.Rect().Width()); |
|
344 |
||
345 |
// OK button |
|
346 |
okBtnRect.LayoutRect( cellMiddleRect, middleInnerBtn ); |
|
347 |
iOkRect = okBtnRect.Rect(); |
|
348 |
||
349 |
// Cancel button |
|
350 |
cellMiddleRect.Move( middleBtnRect.Rect().Width(), 0 ); |
|
351 |
||
352 |
cancelBtnRect.LayoutRect( cellMiddleRect, middleInnerBtn ); |
|
353 |
iCancelRect = cancelBtnRect.Rect(); |
|
354 |
||
355 |
iSpellBtnTextFormat = AknLayoutScalable_Avkon::ituss_sks_pane_t1().LayoutLine(); |
|
356 |
iSpellBtnTextFormat.ir = 7; |
|
357 |
||
358 |
// Bottom pane |
|
359 |
TRect cellSpellRect; |
|
360 |
cellSpellRect.iTl.iX = middleButtonPaneRect.iTl.iX; |
|
361 |
cellSpellRect.iTl.iY = middleButtonPaneRect.iTl.iY + |
|
22
bd83ceabce89
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
362 |
itucellrect.Rect().Height() * 5; |
21 | 363 |
cellSpellRect.SetHeight( itucellrect.Rect().Height()); |
364 |
cellSpellRect.SetWidth( itucellrect.Rect().Width()); |
|
365 |
||
366 |
// Left |
|
367 |
bottomButton.LayoutRect( cellSpellRect, ituinnercell ); |
|
368 |
iSpellArrowLeftRect = bottomButton.Rect(); |
|
369 |
||
370 |
bottomInnerBtn = AknLayoutScalable_Avkon::cell_ituss_key_pane_g1(2).LayoutLine(); |
|
371 |
bottomInnerRect.LayoutRect( bottomButton.Rect(), bottomInnerBtn ); |
|
372 |
iSpellArrowLeftRectInner = bottomInnerRect.Rect(); |
|
373 |
||
374 |
// Right |
|
375 |
cellSpellRect.Move( itucellrect.Rect().Width(), 0 ); |
|
376 |
bottomButton.LayoutRect( cellSpellRect, ituinnercell ); |
|
377 |
iSpellArrowRightRect = bottomButton.Rect(); |
|
378 |
||
379 |
bottomInnerRect.LayoutRect( bottomButton.Rect(), bottomInnerBtn ); |
|
380 |
iSpellArrowRightRectInner = bottomInnerRect.Rect(); |
|
381 |
||
382 |
// backspace in spell mode |
|
383 |
cellSpellRect.Move( itucellrect.Rect().Width(), 0 ); |
|
384 |
bottomButton.LayoutRect( cellSpellRect, ituinnercell ); |
|
385 |
iSpellBackSpcace = bottomButton.Rect(); |
|
386 |
||
387 |
bottomInnerRect.LayoutRect( bottomButton.Rect(), bottomInnerBtn ); |
|
388 |
iSpellBackSpcaceInner = bottomInnerRect.Rect(); |
|
389 |
||
390 |
// icf indicator |
|
391 |
TAknWindowLineLayout icfIndiPaneWithoutText; |
|
392 |
TAknLayoutRect icfIndiPaneRectWithoutText; |
|
393 |
TAknTextLineLayout indiTextLayout; |
|
394 |
||
395 |
icfIndiPaneWithoutText = AknLayoutScalable_Avkon::icf_edit_indi_pane(0).LayoutLine(); |
|
396 |
icfIndiPaneRectWithoutText.LayoutRect( focuspaneRect.Rect(), icfIndiPaneWithoutText ); |
|
397 |
iIndiPaneRectWithoutTextForPrtWest = icfIndiPaneRectWithoutText.Rect(); |
|
398 |
||
399 |
TAknWindowLineLayout spellIndiIcon; |
|
400 |
TAknLayoutRect spellIndiIconRect; |
|
401 |
spellIndiIcon = AknLayoutScalable_Avkon::icf_edit_indi_pane_g2(0).LayoutLine(); |
|
402 |
spellIndiIconRect.LayoutRect( icfIndiPaneRectWithoutText.Rect(), spellIndiIcon ); |
|
403 |
iIndiIconRectWithoutTextForPrtWest = spellIndiIconRect.Rect(); |
|
404 |
||
405 |
indiTextLayout = AknLayoutScalable_Avkon::icf_edit_indi_pane_t1(0).LayoutLine(); |
|
406 |
iIndiTextForPrtWest = indiTextLayout; |
|
407 |
||
408 |
// ICF text line info |
|
409 |
TAknTextLineLayout icftextT1, icftextT2, icftextT3; |
|
410 |
icftextT1 = AknLayoutScalable_Avkon::vtchi_query_pane_t1(0).LayoutLine(); |
|
411 |
icftextT2 = AknLayoutScalable_Avkon::vtchi_query_pane_t2(0).LayoutLine(); |
|
412 |
icftextT3 = AknLayoutScalable_Avkon::vtchi_query_pane_t3(0).LayoutLine(); |
|
413 |
||
414 |
iIcfTextAlignment = icftextT1.iJ; |
|
415 |
iIcfTextLeftMargin = icftextT1.il; |
|
416 |
iIcfTextRightMargin = icftextT1.ir; |
|
417 |
||
418 |
TAknLayoutText ctxt1, ctxt2, ctxt3; |
|
419 |
ctxt1.LayoutText( focuspaneRect.Rect(), icftextT1 ); |
|
420 |
ctxt2.LayoutText( focuspaneRect.Rect(), icftextT2 ); |
|
421 |
ctxt3.LayoutText( focuspaneRect.Rect(), icftextT3 ); |
|
422 |
||
423 |
iIcfTextTopMargin = ctxt1.TextRect().iTl.iY - focuspaneRect.Rect().iTl.iY; |
|
424 |
iIcfTextLineSpaceMargin = ctxt2.TextRect().iTl.iY - ctxt1.TextRect().iBr.iY; |
|
425 |
iIcfTextBottomMargin = focuspaneRect.Rect().iBr.iY - ctxt3.TextRect().iBr.iY |
|
426 |
- iIcfTextLineSpaceMargin; |
|
427 |
iIcfTextHeight = ctxt1.TextRect().Height(); |
|
428 |
||
429 |
iIcfFont = const_cast<CFont*>(AknLayoutUtils::FontFromId(icftextT1.iFont, NULL)); |
|
430 |
} |
|
431 |
||
432 |
// --------------------------------------------------------------------------- |
|
433 |
// CSplitItutDataMgr::ReadLafInfo |
|
434 |
// (other items were commented in a header) |
|
435 |
// --------------------------------------------------------------------------- |
|
436 |
// |
|
437 |
void CSplitItutDataMgr::AddSubscriber(MItutPropertySubscriber* aSubscriber) |
|
438 |
{ |
|
439 |
if (aSubscriber) |
|
440 |
{ |
|
441 |
const TInt index = iSubscriberList.Find(aSubscriber); |
|
442 |
||
443 |
if (index == KErrNotFound) |
|
444 |
{ |
|
445 |
iSubscriberList.Append(aSubscriber); |
|
446 |
} |
|
447 |
} |
|
448 |
} |
|
449 |
||
450 |
// --------------------------------------------------------------------------- |
|
451 |
// CSplitItutDataMgr::ReadLafInfo |
|
452 |
// (other items were commented in a header) |
|
453 |
// --------------------------------------------------------------------------- |
|
454 |
// |
|
455 |
void CSplitItutDataMgr::SetLanguageL(TInt aLanguage) |
|
456 |
{ |
|
457 |
ASSERT( IsValidLanguage( aLanguage ) ); |
|
458 |
||
459 |
if (iLanguage != aLanguage) |
|
460 |
{ |
|
461 |
if( IsValidLanguage( iLanguage ) ) |
|
462 |
iIsLangDirectionSwitch = IsRtoLLanguage( aLanguage ) ^ IsRtoLLanguage( iLanguage ); |
|
463 |
else |
|
464 |
//Check mirroring is needed when first setting language |
|
465 |
iIsLangDirectionSwitch = IsRtoLLanguage( aLanguage ); |
|
466 |
||
467 |
iLanguage = aLanguage; |
|
468 |
iInputMode = KInvalidImMode; |
|
469 |
||
470 |
//SetTextAlignment(); |
|
471 |
||
472 |
TInt scriptIdx = GetConfigResFileName(aLanguage); |
|
473 |
||
474 |
if (scriptIdx != iCurrentScriptIdx) |
|
475 |
{ |
|
476 |
iCurrentScriptIdx = scriptIdx; |
|
477 |
||
478 |
CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
479 |
||
480 |
if (iConfigResId) |
|
481 |
{ |
|
482 |
coeEnv->DeleteResourceFile(iConfigResId); |
|
483 |
} |
|
484 |
||
485 |
TFileName resourceConfigName(iResourceFilename); |
|
486 |
BaflUtils::NearestLanguageFile(coeEnv->FsSession(), resourceConfigName); |
|
487 |
iConfigResId = coeEnv->AddResourceFileL(resourceConfigName); |
|
488 |
||
489 |
if (IsChinese()) |
|
490 |
{ |
|
491 |
iLayoutContext->UiManager()->CreateChineseSpecificCtrlsIfNeededL(); |
|
492 |
} |
|
493 |
||
494 |
NotifyChangeControlLayout(MItutPropertySubscriber::EItutPropertyKeypadResourceId, |
|
495 |
KeypadResourceId()); |
|
496 |
} |
|
497 |
} |
|
498 |
} |
|
499 |
||
500 |
// --------------------------------------------------------------------------- |
|
501 |
// CSplitItutDataMgr::ReadLafInfo |
|
502 |
// (other items were commented in a header) |
|
503 |
// --------------------------------------------------------------------------- |
|
504 |
// |
|
505 |
void CSplitItutDataMgr::SetCase(TInt aCase) |
|
506 |
{ |
|
507 |
if (iCase != aCase || iInputMode == ELatin) |
|
508 |
{ |
|
509 |
iCase = aCase; |
|
510 |
NotifyChangeControlLayout(MItutPropertySubscriber::EItutPropertyKeypadResourceId, |
|
511 |
KeypadResourceId()); |
|
512 |
} |
|
513 |
} |
|
514 |
||
515 |
// --------------------------------------------------------------------------- |
|
516 |
// CSplitItutDataMgr::ReadLafInfo |
|
517 |
// (other items were commented in a header) |
|
518 |
// --------------------------------------------------------------------------- |
|
519 |
// |
|
520 |
void CSplitItutDataMgr::SetInputModeL(TInt aMode) |
|
521 |
{ |
|
522 |
TInt engineMode = KInvalidImMode; |
|
523 |
||
524 |
switch (aMode) |
|
525 |
{ |
|
526 |
case EPinyin: |
|
527 |
{ |
|
528 |
engineMode = EPtiEnginePinyinByPhrase; |
|
529 |
} |
|
530 |
break; |
|
531 |
case EStroke: |
|
532 |
{ |
|
533 |
engineMode = EPtiEngineStrokeByPhrase; |
|
534 |
} |
|
535 |
break; |
|
536 |
case EZhuyin: |
|
537 |
{ |
|
538 |
engineMode = EPtiEngineZhuyinByPhrase; |
|
539 |
} |
|
540 |
break; |
|
541 |
case ELatin: |
|
542 |
case EHindi: |
|
543 |
case ENumber: |
|
544 |
case ENativeNumber: |
|
545 |
{ |
|
546 |
iInputMode = aMode; |
|
547 |
NotifyChangeControlLayout(MItutPropertySubscriber::EItutPropertyKeypadResourceId, |
|
548 |
KeypadResourceId()); |
|
549 |
} |
|
550 |
break; |
|
551 |
case EZhuyinFind: |
|
552 |
{ |
|
553 |
iInputMode = EZhuyin; |
|
554 |
||
555 |
return; |
|
556 |
} |
|
557 |
case EStrokeFind: |
|
558 |
{ |
|
559 |
iInputMode = EStroke; |
|
560 |
||
561 |
return; |
|
562 |
} |
|
563 |
default: |
|
564 |
return; |
|
565 |
} |
|
566 |
||
567 |
if (IsChinese()) |
|
568 |
{ |
|
569 |
TInt err = iPtiEngine->ActivateLanguageL(iLanguage, TPtiEngineInputMode(engineMode)); |
|
570 |
if (err == KErrNone) |
|
571 |
{ |
|
572 |
iPtiEngine->SetCandidatePageLength(KOnePageCandidateCount); |
|
573 |
iInputMode = aMode; |
|
574 |
} |
|
575 |
} |
|
576 |
} |
|
577 |
||
578 |
||
579 |
// --------------------------------------------------------------------------- |
|
580 |
// CSplitItutDataMgr::RequestData |
|
581 |
// (other items were commented in a header) |
|
582 |
// --------------------------------------------------------------------------- |
|
583 |
// |
|
584 |
TAny* CSplitItutDataMgr::RequestData(TInt aDataType) |
|
585 |
{ |
|
586 |
switch ( aDataType ) |
|
587 |
{ |
|
588 |
case EScreenSize: |
|
589 |
return &iScreenSize; |
|
590 |
case ELayoutOffset: |
|
591 |
return &iLayoutOffset; |
|
592 |
case ELayoutRect: |
|
593 |
return iSpellMode ? &iLayoutRectSpell : &iLayoutRect; |
|
594 |
case EBackgroundRect: |
|
595 |
return iSpellMode ? &iLayoutRectSpell : &iBackgroundRect; |
|
596 |
case EBackspaceRect: |
|
597 |
return IsChinese() ? &iBackspaceCnRect : &iBackspaceRect; |
|
598 |
case EKeypadRect: |
|
599 |
return &iKeypadRect; |
|
600 |
// return IsChinese() ? &iKeypadRectCn : &iKeypadRect; |
|
601 |
case EKeypadCellRects: |
|
602 |
return &iKeypadCellRects; |
|
603 |
// return IsChinese() ? &iKeypadCellRectsCn : &iKeypadCellRects; |
|
604 |
case EKeypadLeftTextLine: |
|
605 |
if ( iInputMode == ENumber || iInputMode == ENativeNumber ) |
|
606 |
{ |
|
607 |
return &iVkBigNumTextForPrtWest; |
|
608 |
} |
|
609 |
else |
|
610 |
{ |
|
611 |
return &iVkNumText; |
|
612 |
} |
|
613 |
case EKeypadRightTextLine1: |
|
614 |
if ( iInputMode == ENumber || iInputMode == ENativeNumber ) |
|
615 |
{ |
|
616 |
return &iVkTextPlusForNumbericOnly; |
|
617 |
} |
|
618 |
else |
|
619 |
{ |
|
620 |
return &iVkAlphaText1; |
|
621 |
} |
|
622 |
case EKeypadRightTextLine2: |
|
623 |
return &iVkAlphaText2; |
|
624 |
case EKeypadRightTextLine3: |
|
625 |
return &iVkAlphaText3; |
|
626 |
/* |
|
627 |
case EDropdownlistUnitWidth: |
|
628 |
return &iCandsUnitWidth; |
|
629 |
case EDropdownlistUnitHeight: |
|
630 |
return &iCandsUnitHeight; |
|
631 |
case EDropdownlistHorizontalMargin: |
|
632 |
return &iCandsHorizontalMargin; |
|
633 |
case EDropdownlistVerticalMargin: |
|
634 |
return &iCandsVerticalMargin; |
|
635 |
case EDropdownListNaviWidth: |
|
636 |
return &iCandsNaviWidth; |
|
637 |
case EDropdownListSpinBtnHeight: |
|
638 |
return &iCandsSpinBtnHeight; |
|
639 |
case EDropdownListSpellLTPos: |
|
640 |
return &iCandsSpellLTPos; |
|
641 |
case EDropdownListCandsLTPos: |
|
642 |
return &iCandsLTPos; |
|
643 |
case EDropdownListPuncLTPos: |
|
644 |
return &iCandsPuncLTPos; |
|
645 |
case EDropdownListFont: |
|
646 |
return reinterpret_cast<TAny*>(iCandsFont); |
|
647 |
case EDropdownListTextMargin: |
|
648 |
return &iCandsTextMargin; |
|
649 |
case EDropdownListTextColor: |
|
650 |
return &iCandsTextColor; |
|
651 |
*/ |
|
652 |
||
653 |
case ELanguage: |
|
654 |
return &iLanguage; |
|
655 |
case EInputMode: |
|
656 |
return &iInputMode; |
|
657 |
case ECase: |
|
658 |
return &iCase; |
|
659 |
/* |
|
660 |
case EChnCandidates: |
|
661 |
return &iCandidates; |
|
662 |
case EChnPuncCandidates: |
|
663 |
return &iPuncCandidates; |
|
664 |
*/ |
|
665 |
case EArrowLeftRect: |
|
666 |
if( iSpellMode ) |
|
667 |
{ |
|
668 |
return &iSpellArrowLeftRect; |
|
669 |
} |
|
670 |
else |
|
671 |
{ |
|
672 |
return IsChinese() ? &iArrowLeftCnRect : &iArrowLeftRect; |
|
673 |
} |
|
674 |
case EArrowRightRect: |
|
675 |
if( iSpellMode ) |
|
676 |
{ |
|
677 |
return &iSpellArrowRightRect; |
|
678 |
} |
|
679 |
else |
|
680 |
{ |
|
681 |
return IsChinese() ? &iArrowRightCnRect : &iArrowRightRect; |
|
682 |
} |
|
683 |
case EArrowUpRect: |
|
684 |
// case EItutPosArrowUp: |
|
685 |
return &iArrowUpRect; |
|
686 |
case EArrowDownRect: |
|
687 |
// case EItutPosArrowDown: |
|
688 |
return &iArrowDownRect; |
|
689 |
case EOptionsRect: |
|
690 |
#ifdef LAF_MODIFY |
|
691 |
return IsChinese() ? &iOptionsRectCn : &iOptionsRect; |
|
692 |
#else |
|
693 |
return &iOptionsRect; |
|
694 |
#endif |
|
695 |
case ECloseRect: |
|
696 |
#ifdef LAF_MODIFY |
|
697 |
return IsChinese() ? &iCloseRectCn : &iCloseRect; |
|
698 |
#else |
|
699 |
return &iCloseRect; |
|
700 |
#endif |
|
701 |
case ELeftInnerRect: |
|
702 |
if( iSpellMode ) |
|
703 |
{ |
|
704 |
return &iSpellArrowLeftRectInner; |
|
705 |
} |
|
706 |
else |
|
707 |
{ |
|
708 |
return IsChinese() ? &iArrowLeftInnerCnRect : &iArrowLeftInnerRect; |
|
709 |
} |
|
710 |
case ERightInnerRect: |
|
711 |
if( iSpellMode ) |
|
712 |
{ |
|
713 |
return &iSpellArrowRightRectInner; |
|
714 |
} |
|
715 |
else |
|
716 |
{ |
|
717 |
return IsChinese() ? &iArrowRightInnerCnRect : &iArrowRightInnerRect; |
|
718 |
} |
|
719 |
case EBackspaceInnerRect: |
|
720 |
return IsChinese() ? &iBackspaceInnerCnRect : &iBackspaceInnerRect; |
|
721 |
case EUpInnerRect: |
|
722 |
return &iArrowUpInnerRect; |
|
723 |
case EDownInnerRect: |
|
724 |
return &iArrowDownInnerRect; |
|
725 |
case ECloseInnerRect: |
|
726 |
#ifdef LAF_MODIFY |
|
727 |
return IsChinese() ? &iCloseInnerRectCn : &iCloseInnerRect; |
|
728 |
#else |
|
729 |
return &iCloseInnerRect; |
|
730 |
#endif |
|
731 |
case EOptionInnerRect: |
|
732 |
#ifdef LAF_MODIFY |
|
733 |
return IsChinese() ? &iOptionInnerRectCn : &iOptionInnerRect; |
|
734 |
#else |
|
735 |
return &iOptionInnerRect; |
|
736 |
#endif |
|
737 |
case ELatinOnly: |
|
738 |
return &iLatinOnly; |
|
739 |
case EPreviewBubbleRect: |
|
740 |
return &iPreviewWndRect; |
|
741 |
case EPreviewBubbleInnerRect: |
|
742 |
return &iPreviewWndInnerRect; |
|
743 |
case EPreviewBubbleTextlayout: |
|
744 |
return &iPreviewWndText; |
|
745 |
case EPreviewBubbleFont: |
|
746 |
return reinterpret_cast<TAny*>(iBubbleFont); |
|
747 |
case EItutPosOk: |
|
748 |
return &iOkRect; |
|
749 |
case EItutPosCancel: |
|
750 |
return &iCancelRect; |
|
751 |
case EBtnTextLine: |
|
752 |
return &iSpellBtnTextFormat; |
|
753 |
case ESpellICFRect: |
|
754 |
return &iSpellICFRect; |
|
755 |
case ESpellEditIndicatorRect: |
|
756 |
return &iSpellEditIndicator; |
|
757 |
case EIcfFont: |
|
758 |
return reinterpret_cast<TAny*>(iIcfFont); |
|
759 |
case EImIndicatorRect: |
|
760 |
return &iSpellEditIndicator; |
|
761 |
case ESpellBackSpcae: |
|
762 |
return &iSpellBackSpcace; |
|
763 |
case ESpellBackSpcaeInner: |
|
764 |
return &iSpellBackSpcaceInner; |
|
765 |
case EIndiPaneWithoutTextRect: |
|
766 |
return &iIndiPaneRectWithoutTextForPrtWest; |
|
767 |
case EIndiIconWithoutTextRect: |
|
768 |
return &iIndiIconRectWithoutTextForPrtWest; |
|
769 |
case EIndiTextLine: |
|
770 |
return &iIndiTextForPrtWest; |
|
771 |
default: |
|
772 |
break; |
|
773 |
} |
|
774 |
||
775 |
return NULL; |
|
776 |
} |
|
777 |
||
778 |
// --------------------------------------------------------------------------- |
|
779 |
// CSplitItutDataMgr::CSplitItutDataMgr |
|
780 |
// (other items were commented in a header) |
|
781 |
// --------------------------------------------------------------------------- |
|
782 |
// |
|
783 |
CSplitItutDataMgr::CSplitItutDataMgr(MSplitItutLayoutContext* aLayoutContext, |
|
784 |
CPtiEngine* aPtiEngine) |
|
785 |
: |
|
786 |
iPtiEngine( aPtiEngine ), |
|
787 |
iLanguage(ELangNone), |
|
788 |
iInputMode(KInvalidImMode), |
|
789 |
iCase(EAknEditorUpperCase), |
|
790 |
iConfigResId(0), |
|
791 |
iLayoutContext(aLayoutContext), |
|
792 |
iCurrentScriptIdx(KInvalidIndex), |
|
793 |
iSpellMode(EFalse) |
|
794 |
{ |
|
795 |
} |
|
796 |
||
797 |
||
798 |
||
799 |
// --------------------------------------------------------------------------- |
|
800 |
// CSplitItutDataMgr::NotifySubscriber |
|
801 |
// (other items were commented in a header) |
|
802 |
// --------------------------------------------------------------------------- |
|
803 |
// |
|
804 |
void CSplitItutDataMgr::NotifySubscriber(MItutPropertySubscriber::TItutProperty aPropertyName, |
|
805 |
const TDesC& aValue) |
|
806 |
{ |
|
807 |
for (TInt i = 0; i < iSubscriberList.Count(); i++) |
|
808 |
{ |
|
809 |
TRAP_IGNORE(iSubscriberList[i]->SetPropertyL(aPropertyName, aValue)); |
|
810 |
} |
|
811 |
} |
|
812 |
||
813 |
// --------------------------------------------------------------------------- |
|
814 |
// CSplitItutDataMgr::NotifyChangeControlLayout |
|
815 |
// (other items were commented in a header) |
|
816 |
// --------------------------------------------------------------------------- |
|
817 |
// |
|
818 |
void CSplitItutDataMgr::NotifyChangeControlLayout( |
|
819 |
MItutPropertySubscriber::TItutProperty aPropertyName, TInt aCtrlResId) |
|
820 |
{ |
|
821 |
TInt ctrlResId = KInvalidResId; |
|
822 |
||
823 |
switch (aPropertyName) |
|
824 |
{ |
|
825 |
case MItutPropertySubscriber::EItutPropertyKeypadResourceId: |
|
826 |
{ |
|
827 |
ctrlResId = iLayoutContext->Control(ECtrlIdStdItut)->ResourceId(); |
|
828 |
} |
|
829 |
break; |
|
830 |
case MItutPropertySubscriber::EItutPropertyCandidateListResourceId: |
|
831 |
{ |
|
832 |
ctrlResId = iLayoutContext->Control(ECtrlIdStdCandsList)->ResourceId(); |
|
833 |
} |
|
834 |
break; |
|
835 |
default: |
|
836 |
break; |
|
837 |
} |
|
838 |
||
839 |
// since keypad resource divided by script, so maybe ctrlResId unchanged, |
|
840 |
// but it is actually changed in different script |
|
841 |
if ((ctrlResId != aCtrlResId) || |
|
842 |
(aPropertyName == MItutPropertySubscriber::EItutPropertyKeypadResourceId)) |
|
843 |
{ |
|
844 |
TPtrC ptr(reinterpret_cast<TText*>(&aCtrlResId), sizeof(aCtrlResId)/sizeof(TText)); |
|
845 |
||
846 |
NotifySubscriber(aPropertyName, ptr); |
|
847 |
} |
|
848 |
} |
|
849 |
||
850 |
/* |
|
851 |
TInt CSplitItutDataMgr::GetNextPageCandidateL(RPointerArray<HBufC>& aList) |
|
852 |
{ |
|
853 |
if (iPtiEngine && (iPtiEngine->NextCandidatePage())) |
|
854 |
{ |
|
855 |
TItutDataConverter::ConvertChnPhraseCandidateL(iPtiEngine->CandidatePage(), aList); |
|
856 |
||
857 |
return KErrNone; |
|
858 |
} |
|
859 |
||
860 |
return KErrNotSupported; |
|
861 |
} |
|
862 |
||
863 |
TBool CSplitItutDataMgr::NextPageCandidateExist() |
|
864 |
{ |
|
865 |
if (iPtiEngine) |
|
866 |
{ |
|
867 |
return iPtiEngine->MoreCandidatePages(); |
|
868 |
} |
|
869 |
||
870 |
return EFalse; |
|
871 |
} |
|
872 |
*/ |
|
873 |
||
874 |
||
875 |
// --------------------------------------------------------------------------- |
|
876 |
// CSplitItutDataMgr::KeypadResourceId |
|
877 |
// (other items were commented in a header) |
|
878 |
// --------------------------------------------------------------------------- |
|
879 |
// |
|
880 |
TInt CSplitItutDataMgr::KeypadResourceId() |
|
881 |
{ |
|
882 |
if (iInputMode == ENumber ) |
|
883 |
{ |
|
884 |
if( IsExistPlusChar() ) |
|
885 |
return R_FINGER_INPUT_KEYPAD_NUMBER_WITH_PLUS; |
|
886 |
else |
|
887 |
return R_FINGER_INPUT_KEYPAD_NUMBER; |
|
888 |
} |
|
889 |
if( iInputMode == ENativeNumber ) |
|
890 |
{ |
|
891 |
if( IsExistPlusChar() ) |
|
892 |
return R_FINGER_INPUT_KEYPAD_NATIVE_NUMBER_WITH_PLUS; |
|
893 |
else |
|
894 |
return R_FINGER_INPUT_KEYPAD_NATIVE_NUMBER; |
|
895 |
} |
|
896 |
||
897 |
if ( iLatinOnly ) |
|
898 |
{ |
|
899 |
if ( iCase == EAknEditorTextCase || iCase == EAknEditorUpperCase ) |
|
900 |
{ |
|
901 |
return R_FINGER_INPUT_KEYPAD_LATINONLY_UPPERCASE; |
|
902 |
} |
|
903 |
return R_FINGER_INPUT_KEYPAD_LATINONLY_LOWERCASE; |
|
904 |
} |
|
905 |
||
906 |
if (!iLangCaseSensitive ) |
|
907 |
{ |
|
908 |
return R_FINGER_INPUT_KEYPAD_ABC; |
|
909 |
} |
|
910 |
if ( IsChinese() ) |
|
911 |
{ |
|
912 |
return ChineseKeypadResourceId(); |
|
913 |
} |
|
914 |
if ( IsHindi() ) |
|
915 |
{ |
|
916 |
return HindiKeypadResourceId(); |
|
917 |
} |
|
918 |
||
919 |
if (iCase == EAknEditorTextCase || iCase == EAknEditorUpperCase) |
|
920 |
{ |
|
921 |
return R_FINGER_INPUT_KEYPAD_ABC_UPPERCASE; |
|
922 |
} |
|
923 |
else |
|
924 |
{ |
|
925 |
return R_FINGER_INPUT_KEYPAD_ABC_LOWERCASE; |
|
926 |
} |
|
927 |
} |
|
928 |
||
929 |
||
930 |
// --------------------------------------------------------------------------- |
|
931 |
// CSplitItutDataMgr::ChineseKeypadResourceId |
|
932 |
// (other items were commented in a header) |
|
933 |
// --------------------------------------------------------------------------- |
|
934 |
// |
|
935 |
TInt CSplitItutDataMgr::ChineseKeypadResourceId() |
|
936 |
{ |
|
937 |
||
938 |
if (iInputMode == EZhuyin) |
|
939 |
{ |
|
940 |
return R_FINGER_INPUT_KEYPAD_ZHUYIN_STANDBY_PREDICT; |
|
941 |
} |
|
942 |
if (iInputMode == EPinyin) |
|
943 |
{ |
|
944 |
return R_FINGER_INPUT_KEYPAD_PINYIN_STANDBY_PREDICT; |
|
945 |
} |
|
946 |
if (iInputMode == EStroke) |
|
947 |
{ |
|
948 |
TInt resID; |
|
949 |
if (InputLanguage() == ELangPrcChinese) |
|
950 |
{ |
|
951 |
resID = R_FINGER_INPUT_KEYPAD_STROKE_STANDBY_PREDICT_PRC; |
|
952 |
} |
|
953 |
else |
|
954 |
{ |
|
955 |
resID = R_FINGER_INPUT_KEYPAD_STROKE_STANDBY_PREDICT_TRA; |
|
956 |
} |
|
957 |
return resID; |
|
958 |
} |
|
959 |
||
960 |
if (iCase == EAknEditorTextCase || iCase == EAknEditorUpperCase) |
|
961 |
{ |
|
962 |
return R_FINGER_INPUT_KEYPAD_ABC_UPPERCASE_CHN; |
|
963 |
} |
|
964 |
else |
|
965 |
{ |
|
966 |
return R_FINGER_INPUT_KEYPAD_ABC_LOWERCASE_CHN; |
|
967 |
} |
|
968 |
} |
|
969 |
||
970 |
||
971 |
// --------------------------------------------------------------------------- |
|
972 |
// CSplitItutDataMgr::HindiKeypadResourceId |
|
973 |
// (other items were commented in a header) |
|
974 |
// --------------------------------------------------------------------------- |
|
975 |
// |
|
976 |
TInt CSplitItutDataMgr::HindiKeypadResourceId() |
|
977 |
{ |
|
978 |
if ( iInputMode == EHindi ) |
|
979 |
{ |
|
980 |
return R_FINGER_INPUT_KEYPAD_ABC; |
|
981 |
} |
|
982 |
||
983 |
if (iCase == EAknEditorTextCase || iCase == EAknEditorUpperCase) |
|
984 |
{ |
|
985 |
return R_FINGER_INPUT_KEYPAD_LATINONLY_UPPERCASE; |
|
986 |
} |
|
987 |
else |
|
988 |
{ |
|
989 |
return R_FINGER_INPUT_KEYPAD_LATINONLY_LOWERCASE; |
|
990 |
} |
|
991 |
} |
|
992 |
||
993 |
// --------------------------------------------------------------------------- |
|
994 |
// CSplitItutDataMgr::GetConfigResFileName |
|
995 |
// (other items were commented in a header) |
|
996 |
// --------------------------------------------------------------------------- |
|
997 |
// |
|
998 |
TInt CSplitItutDataMgr::GetConfigResFileName(TInt aLang) |
|
999 |
{ |
|
1000 |
iResourceFilename.Zero(); |
|
1001 |
iResourceFilename = KConfigResourceFile(); |
|
1002 |
||
1003 |
for (TInt i = 0; i < sizeof(TScriptMapping) / sizeof(TScriptMapping[0]); i++) |
|
1004 |
{ |
|
1005 |
TScriptInfo script = TScriptMapping[i]; |
|
1006 |
||
1007 |
if (FindLang(&(LangsArr[script.iStartIdx]), script.iEndIdx - script.iStartIdx, aLang) != |
|
1008 |
KErrNotFound) |
|
1009 |
{ |
|
1010 |
iResourceFilename.Append(ResFileExtByScriptIdx(script.iScriptExt)); |
|
1011 |
iResourceFilename.Append(KResourceFileExtName); |
|
1012 |
iLangCaseSensitive = script.iCaseSensitive; |
|
1013 |
return i; |
|
1014 |
} |
|
1015 |
} |
|
1016 |
||
1017 |
// default resource file is latin |
|
1018 |
iResourceFilename.Append(ResFileExtByScriptIdx(TScriptMapping[0].iScriptExt)); |
|
1019 |
iResourceFilename.Append(KResourceFileExtName); |
|
1020 |
iLangCaseSensitive = TScriptMapping[0].iCaseSensitive; |
|
1021 |
return 0; |
|
1022 |
} |
|
1023 |
||
1024 |
// --------------------------------------------------------------------------- |
|
1025 |
// CSplitItutDataMgr::FindLang |
|
1026 |
// (other items were commented in a header) |
|
1027 |
// --------------------------------------------------------------------------- |
|
1028 |
// |
|
1029 |
TInt CSplitItutDataMgr::FindLang(const TInt* aArray, |
|
1030 |
TInt aEndIdx, |
|
1031 |
TInt aLang) |
|
1032 |
{ |
|
1033 |
for (TInt i = 0; i <= aEndIdx; i++) |
|
1034 |
{ |
|
1035 |
if (aLang == *aArray) |
|
1036 |
{ |
|
1037 |
return i; |
|
1038 |
} |
|
1039 |
||
1040 |
aArray++; |
|
1041 |
} |
|
1042 |
||
1043 |
return KErrNotFound; |
|
1044 |
} |
|
1045 |
||
1046 |
||
1047 |
// --------------------------------------------------------------------------- |
|
1048 |
// CSplitItutDataMgr::FindLang |
|
1049 |
// (other items were commented in a header) |
|
1050 |
// --------------------------------------------------------------------------- |
|
1051 |
// |
|
1052 |
TBool CSplitItutDataMgr::IsChinese() |
|
1053 |
{ |
|
1054 |
return (iLanguage == ELangPrcChinese || iLanguage == ELangHongKongChinese |
|
1055 |
|| iLanguage == ELangTaiwanChinese); |
|
1056 |
} |
|
1057 |
||
1058 |
// --------------------------------------------------------------------------- |
|
1059 |
// CSplitItutDataMgr::IsHindi |
|
1060 |
// (other items were commented in a header) |
|
1061 |
// --------------------------------------------------------------------------- |
|
1062 |
// |
|
1063 |
TBool CSplitItutDataMgr::IsHindi() |
|
1064 |
{ |
|
1065 |
return ( iLanguage == ELangHindi ); |
|
1066 |
} |
|
1067 |
||
1068 |
// --------------------------------------------------------------------------- |
|
1069 |
// CSplitItutDataMgr::IsThai |
|
1070 |
// (other items were commented in a header) |
|
1071 |
// --------------------------------------------------------------------------- |
|
1072 |
// |
|
1073 |
TBool CSplitItutDataMgr::IsThai() |
|
1074 |
{ |
|
1075 |
return ( iLanguage == ELangThai ); |
|
1076 |
} |
|
1077 |
||
1078 |
// --------------------------------------------------------------------------- |
|
1079 |
// CSplitItutDataMgr::IsRtoLLanguage |
|
1080 |
// (other items were commented in a header) |
|
1081 |
// --------------------------------------------------------------------------- |
|
1082 |
// |
|
1083 |
TBool CSplitItutDataMgr::IsRtoLLanguage() |
|
1084 |
{ |
|
1085 |
return ( iLanguage == ELangArabic || |
|
1086 |
iLanguage == ELangHebrew || |
|
1087 |
iLanguage == ELangFarsi || |
|
1088 |
iLanguage == ELangUrdu ); |
|
1089 |
} |
|
1090 |
||
1091 |
// --------------------------------------------------------------------------- |
|
1092 |
// CSplitItutDataMgr::IsRtoLLanguage |
|
1093 |
// (other items were commented in a header) |
|
1094 |
// --------------------------------------------------------------------------- |
|
1095 |
// |
|
1096 |
TBool CSplitItutDataMgr::IsRtoLLanguage( TInt aLanguage ) |
|
1097 |
{ |
|
1098 |
return ( aLanguage == ELangArabic || |
|
1099 |
aLanguage == ELangHebrew || |
|
1100 |
aLanguage == ELangFarsi || |
|
1101 |
aLanguage == ELangUrdu ); |
|
1102 |
} |
|
1103 |
||
1104 |
// --------------------------------------------------------------------------- |
|
1105 |
// CSplitItutDataMgr::IsLangDirectionSwitch |
|
1106 |
// (other items were commented in a header) |
|
1107 |
// --------------------------------------------------------------------------- |
|
1108 |
// |
|
1109 |
TBool CSplitItutDataMgr::IsLangDirectionSwitch() const |
|
1110 |
{ |
|
1111 |
return iIsLangDirectionSwitch; |
|
1112 |
} |
|
1113 |
||
1114 |
// --------------------------------------------------------------------------- |
|
1115 |
// CSplitItutDataMgr::ResFileExtByScriptIdx |
|
1116 |
// (other items were commented in a header) |
|
1117 |
// --------------------------------------------------------------------------- |
|
1118 |
// |
|
1119 |
const TDesC& CSplitItutDataMgr::ResFileExtByScriptIdx(const TScriptExtIndex aIndex) |
|
1120 |
{ |
|
1121 |
switch (aIndex) |
|
1122 |
{ |
|
1123 |
case ELatinExt: |
|
1124 |
return KLatinExt; |
|
1125 |
case ECyrillicExt: |
|
1126 |
return KCyrillicExt; |
|
1127 |
case EGreekExt: |
|
1128 |
return KGreekExt; |
|
1129 |
case EHebrewExt: |
|
1130 |
return KHebrewExt; |
|
1131 |
case EArabicExt: |
|
1132 |
return KArabicExt; |
|
1133 |
case EFarsiExt: |
|
1134 |
return KFarsiExt; |
|
1135 |
case EUrduExt: |
|
1136 |
return KUrduExt; |
|
1137 |
case EThaiExt: |
|
1138 |
return KThaiExt; |
|
1139 |
case EChnExt: |
|
1140 |
return KChnExt; |
|
1141 |
case EDevanagiriExt: |
|
1142 |
return KDevanagiriExt; |
|
1143 |
default: |
|
1144 |
break; |
|
1145 |
} |
|
1146 |
||
1147 |
return KNullDesC; |
|
1148 |
} |
|
1149 |
||
1150 |
// --------------------------------------------------------------------------- |
|
1151 |
// CSplitItutDataMgr::SetUpdate |
|
1152 |
// (other items were commented in a header) |
|
1153 |
// --------------------------------------------------------------------------- |
|
1154 |
// |
|
1155 |
void CSplitItutDataMgr::SetUpdate(TBool aNeedUpdate) |
|
1156 |
{ |
|
1157 |
iNeedUpdate = aNeedUpdate; |
|
1158 |
} |
|
1159 |
||
1160 |
// --------------------------------------------------------------------------- |
|
1161 |
// CSplitItutDataMgr::IsUpdate |
|
1162 |
// (other items were commented in a header) |
|
1163 |
// --------------------------------------------------------------------------- |
|
1164 |
// |
|
1165 |
TBool CSplitItutDataMgr::IsUpdate() const |
|
1166 |
{ |
|
1167 |
return iNeedUpdate; |
|
1168 |
} |
|
1169 |
||
1170 |
// --------------------------------------------------------------------------- |
|
1171 |
// CSplitItutDataMgr::SetNumericKeymap |
|
1172 |
// (other items were commented in a header) |
|
1173 |
// --------------------------------------------------------------------------- |
|
1174 |
// |
|
1175 |
void CSplitItutDataMgr::SetNumericKeymap( const TInt aKeymap ) |
|
1176 |
{ |
|
1177 |
iNumericKeymap = aKeymap; |
|
1178 |
} |
|
1179 |
||
1180 |
// --------------------------------------------------------------------------- |
|
1181 |
// CSplitItutDataMgr::SetNumericKeymapData |
|
1182 |
// (other items were commented in a header) |
|
1183 |
// --------------------------------------------------------------------------- |
|
1184 |
// |
|
1185 |
void CSplitItutDataMgr::SetNumericKeymapData( TInt* aKeymapData ) |
|
1186 |
{ |
|
1187 |
delete iNumericKeymapData; |
|
1188 |
TInt* len = (TInt*)((TUint8*)aKeymapData - 4); |
|
1189 |
TPtrC16 keymapRes((const TUint16*)aKeymapData, *len/2); |
|
1190 |
iNumericKeymapData = keymapRes.Alloc(); |
|
1191 |
} |
|
1192 |
||
1193 |
// --------------------------------------------------------------------------- |
|
1194 |
// CSplitItutDataMgr::IsExistPlusChar |
|
1195 |
// (other items were commented in a header) |
|
1196 |
// --------------------------------------------------------------------------- |
|
1197 |
// |
|
1198 |
TBool CSplitItutDataMgr::IsExistPlusChar() |
|
1199 |
{ |
|
1200 |
if( !IsNumericOnly() ) |
|
1201 |
{ |
|
1202 |
return EFalse; |
|
1203 |
} |
|
1204 |
if ( iNumericKeymap == EKeymapFromResource ) |
|
1205 |
{ |
|
1206 |
HBufC* keyRes = iNumericKeymapData; |
|
1207 |
if( keyRes != NULL && keyRes->Locate( TChar( KPlusChar ) ) != KErrNotFound ) |
|
1208 |
{ |
|
1209 |
return ETrue; |
|
1210 |
} |
|
1211 |
} |
|
1212 |
else if ( iNumericKeymap == EAknEditorStandardNumberModeKeymap |
|
1213 |
|| iNumericKeymap == EAknEditorConverterNumberModeKeymap |
|
1214 |
|| iNumericKeymap == EAknEditorCalculatorNumberModeKeymap |
|
1215 |
|| iNumericKeymap == EAknEditorToFieldNumberModeKeymap |
|
1216 |
|| iNumericKeymap == EAknEditorFixedDiallingNumberModeKeymap |
|
1217 |
|| iNumericKeymap == EAknEditorSATNumberModeKeymap ) |
|
1218 |
{ |
|
1219 |
return ETrue; |
|
1220 |
} |
|
1221 |
return EFalse; |
|
1222 |
} |
|
1223 |
||
1224 |
// End Of File |