author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 15 Sep 2010 12:34:44 +0300 | |
branch | RCL_3 |
changeset 50 | 5a1685599b76 |
parent 44 | ecbabf52600f |
child 56 | 8152b1f1763a |
permissions | -rw-r--r-- |
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: common layout window for UI interface of VKB and HWR |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
// System includes |
|
20 |
#include <coemain.h> |
|
21 |
||
22 |
#include <AknFepGlobalEnums.h> |
|
23 |
#include <aknfeppeninputenums.h> |
|
24 |
#include <peninputpluginutils.h> |
|
25 |
#include <peninputcmdparam.h> // Use global signal |
|
26 |
#include <peninputlayoutmultilineicf.h> |
|
27 |
#include <peninputeventbutton.h> |
|
28 |
#include <peninputmultimodebutton.h> |
|
29 |
#include <peninputdragbutton.h> |
|
30 |
#include <peninputlayoutchoicelist.h> |
|
31 |
#include <peninputlayout.h> |
|
32 |
#include <peninputrangebar.h> |
|
33 |
#include <bautils.h> |
|
34 |
#include <AknIconUtils.h> |
|
35 |
#include <AknLayoutDef.h> |
|
36 |
#include <AknUtils.h> |
|
37 |
#include <aknlayoutscalable_avkon.cdl.h> |
|
38 |
#include <AknsUtils.h> |
|
39 |
//#include <peninputcmdparam.h> |
|
40 |
#include <aknFepVietnameseInputTables.h> |
|
41 |
||
42 |
// User includes |
|
43 |
#include "peninputdataconverter.h" |
|
44 |
#include "peninputrangebarinfo.h" |
|
45 |
#include "peninputlayoutwindowext.h" |
|
46 |
#include "peninputclientlayoutinfo.h" |
|
47 |
#include "peninputdataprovider.h" |
|
48 |
#include "peninputlayoutcontext.h" |
|
49 |
#include "peninputvkbctrlext.h" |
|
50 |
#include "peninputnumerickeymappingmgr.h" |
|
51 |
#include "peninputgenericvkb.hrh" |
|
52 |
||
53 |
// Constants |
|
54 |
const TInt KIntLengthForByte = 8; |
|
55 |
const TInt KPeninputLayoutWindowUnitWidth = 12; |
|
56 |
const TInt KInvalidIndex = -1; |
|
57 |
||
58 |
//const TInt32 KInvalidResId = -1; |
|
59 |
//const TInt KInvalidImg = -1 ; |
|
60 |
const TUint32 KDefaultTextColor = 0x000000; |
|
61 |
const TUint32 KDefaultShadowTextColor = 0xffffff; |
|
62 |
//const TInt KNotSupportSkin = -1; |
|
63 |
||
64 |
const TInt KIntSizeToInt16 = 2; |
|
65 |
const TInt KMaxNumericString = 32; |
|
66 |
||
67 |
// ======== MEMBER FUNCTIONS ======== |
|
68 |
||
69 |
// ------------------------------------------------------------------------ |
|
70 |
// CPeninputLayoutWindowExt::CPeninputLayoutWindowExt |
|
71 |
// (other items were commented in a header) |
|
72 |
// ------------------------------------------------------------------------ |
|
73 |
// |
|
74 |
EXPORT_C CPeninputLayoutWindowExt::CPeninputLayoutWindowExt( |
|
75 |
CFepUiLayout* aUiLayout, MPeninputLayoutContext* aLayoutContext ) |
|
76 |
: CAknFepCtrlBaseWindowExt( aUiLayout, EPeninutWindowCtrlIdBaseWindow ), |
|
77 |
iConfigInfo( NULL ), iLayoutContext( aLayoutContext ), |
|
78 |
iLastUsedTotalColumns( KPeninputLayoutWindowUnitWidth ), |
|
79 |
iFirstTimeConstruct( ETrue ), |
|
80 |
iSwitchFontSet(EFalse), |
|
81 |
iUnitSizeChange(EFalse) |
|
82 |
{ |
|
83 |
} |
|
84 |
||
85 |
// --------------------------------------------------------------------------- |
|
86 |
// CPeninputLayoutWindowExt::ConstructL |
|
87 |
// (other items were commented in a header) |
|
88 |
// --------------------------------------------------------------------------- |
|
89 |
// |
|
90 |
EXPORT_C void CPeninputLayoutWindowExt::ConstructL() |
|
91 |
{ |
|
92 |
BaseConstructL(); |
|
93 |
||
94 |
if( iLayoutContext->LayoutType() == EPluginInputModeVkb || |
|
95 |
iLayoutContext->LayoutType() == EPluginInputModeFSQ ) |
|
96 |
{ |
|
97 |
iVkbLayout = CAknFepCtrlVkbLayout::NewL(); |
|
98 |
} |
|
99 |
else |
|
100 |
{ |
|
101 |
iVkbLayout = NULL; |
|
102 |
} |
|
103 |
||
104 |
CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
105 |
||
106 |
// Set up resources |
|
107 |
TFileName resFileName = GetWindowResFileName(); |
|
108 |
BaflUtils::NearestLanguageFile(coeEnv->FsSession(), resFileName ); |
|
109 |
iWinResId = coeEnv->AddResourceFileL( resFileName ); |
|
110 |
||
111 |
//TResourceReader reader; |
|
112 |
||
113 |
//coeEnv->CreateResourceReaderLC( reader, GetWindowResId() ); |
|
114 |
SetResourceId( GetWindowResId() ); |
|
115 |
ConstructFromResourceL(); |
|
116 |
||
117 |
if (!iKeyMappingMgr) |
|
118 |
{ |
|
119 |
// if key mapping mgr is not constructed in ConstructFromResourceL, need to |
|
120 |
// construct it here |
|
121 |
TResourceReader resReader; |
|
122 |
CCoeEnv::Static()->CreateResourceReaderLC(resReader, GetNumKeymappingResId()); |
|
123 |
iKeyMappingMgr = CPeninputNumericKepMappingMgr::NewL(resReader); |
|
124 |
CleanupStack::PopAndDestroy(1); |
|
125 |
} |
|
126 |
||
127 |
CreateAllControlsL(); |
|
128 |
SetControlsFont(); |
|
129 |
} |
|
130 |
||
131 |
// --------------------------------------------------------------------------- |
|
132 |
// CPeninputLayoutWindowExt::~CPeninputLayoutWindowExt |
|
133 |
// (other items were commented in a header) |
|
134 |
// --------------------------------------------------------------------------- |
|
135 |
// |
|
136 |
EXPORT_C CPeninputLayoutWindowExt::~CPeninputLayoutWindowExt() |
|
137 |
{ |
|
138 |
delete iConfigInfo; |
|
139 |
delete iKeyMappingMgr; |
|
140 |
delete iVkbLayout; |
|
141 |
// Delete resource file from CoeEnv |
|
142 |
CCoeEnv::Static()->DeleteResourceFile( iWinResId ); |
|
143 |
||
144 |
CCoeEnv::Static()->DeleteResourceFile( iConfigResId ); |
|
145 |
||
146 |
delete iToneSet; |
|
147 |
} |
|
148 |
||
149 |
// --------------------------------------------------------------------------- |
|
150 |
// CPeninputLayoutWindowExt::SizeChanged |
|
151 |
// (other items were commented in a header) |
|
152 |
// --------------------------------------------------------------------------- |
|
153 |
// |
|
154 |
EXPORT_C void CPeninputLayoutWindowExt::SizeChanged( TBool /*aLandscapeStyle*/ ) |
|
155 |
{ |
|
156 |
iLangOrSizeChanged = ETrue; |
|
157 |
ReadLafForShadow(); |
|
158 |
ResetLastColRow(); |
|
159 |
||
160 |
if ( iConfigInfo ) |
|
161 |
{ |
|
162 |
ChangeClientSize(); |
|
163 |
} |
|
164 |
||
165 |
//ReadLafForShadow( rect ); |
|
166 |
||
167 |
TInt style = EPeninputPositionChangeBrJustify; |
|
168 |
TBuf<KIntSizeToInt16> bufStyle; |
|
169 |
bufStyle = ( TUint16* )&style; |
|
170 |
HandleControlEvent(EPeninputLayoutEventMovePosition, NULL, bufStyle); |
|
171 |
||
172 |
iLangOrSizeChanged = EFalse; |
|
173 |
} |
|
174 |
||
175 |
// --------------------------------------------------------------------------- |
|
176 |
// CPeninputLayoutWindowExt::ReadLafForShadow |
|
177 |
// (other items were commented in a header). |
|
178 |
// --------------------------------------------------------------------------- |
|
179 |
// |
|
180 |
void CPeninputLayoutWindowExt::ReadLafForShadow() |
|
181 |
{ |
|
182 |
TAknWindowLineLayout shadowPane; |
|
183 |
TAknWindowLineLayout shadowTl; |
|
184 |
TAknWindowLineLayout shadowBr; |
|
185 |
TAknLayoutRect shadowRect; |
|
186 |
TAknLayoutRect shadowTlRect; |
|
187 |
TAknLayoutRect shadowBrRect; |
|
188 |
||
189 |
shadowPane = AknLayoutScalable_Avkon::bg_popup_fep_shadow_pane(1).LayoutLine(); |
|
190 |
shadowRect.LayoutRect(TRect(), shadowPane); |
|
191 |
||
192 |
shadowTl = AknLayoutScalable_Avkon::bg_popup_fep_shadow_pane_g1().LayoutLine(); |
|
193 |
shadowTlRect.LayoutRect(shadowRect.Rect(), shadowTl); |
|
194 |
||
195 |
shadowBr = AknLayoutScalable_Avkon::bg_popup_fep_shadow_pane_g8().LayoutLine(); |
|
196 |
shadowBrRect.LayoutRect(shadowRect.Rect(), shadowBr); |
|
197 |
||
198 |
iShadowTlWidth = shadowTlRect.Rect().Size().iWidth; |
|
199 |
iShadowTlHeight = shadowTlRect.Rect().Size().iHeight; |
|
200 |
iShadowBrWidth = shadowBrRect.Rect().Size().iWidth; |
|
201 |
iShadowBrHeight = shadowBrRect.Rect().Size().iHeight; |
|
202 |
} |
|
203 |
||
204 |
// --------------------------------------------------------------------------- |
|
205 |
// CPeninputLayoutWindowExt::SizeChanged |
|
206 |
// (other items were commented in a header). |
|
207 |
// --------------------------------------------------------------------------- |
|
208 |
// |
|
209 |
EXPORT_C void CPeninputLayoutWindowExt::SizeChangedForBaseWindow( TInt /*aTotalColumns*/ ) |
|
210 |
{ |
|
211 |
} |
|
212 |
// --------------------------------------------------------------------------- |
|
213 |
// CPeninputLayoutWindowExt::HandleControlEvent |
|
214 |
// (other items were commented in a header) |
|
215 |
// --------------------------------------------------------------------------- |
|
216 |
// |
|
217 |
EXPORT_C void CPeninputLayoutWindowExt::HandleControlEvent( TInt aEventType, |
|
218 |
CFepUiBaseCtrl* aCtrl, const TDesC& aEventData ) |
|
219 |
{ |
|
220 |
// Call this function in base class |
|
221 |
CAknFepCtrlBaseWindowExt::HandleControlEvent( aEventType, |
|
222 |
aCtrl, aEventData ); |
|
223 |
||
224 |
TInt* data = ( TInt* ) aEventData.Ptr(); |
|
225 |
||
226 |
switch ( aEventType ) |
|
227 |
{ |
|
228 |
case EEventButtonUp: |
|
229 |
{ |
|
230 |
// check current range |
|
231 |
TInt curRange = CPeninputDataConverter::AnyToInt |
|
232 |
( iLayoutContext->RequestData( EPeninputDataTypeCurrentRange ) ); |
|
233 |
if( aCtrl->ControlId() == EPeninutWindowCtrlIdShiftBtn) |
|
234 |
{ |
|
235 |
if ( ( curRange == ERangeEnglish ) || ( curRange == ERangeAccent ) |
|
236 |
|| ( ConfigInfo()->CaseSensitive() && ( curRange == ERangeNative ) ) ) |
|
237 |
{ |
|
238 |
CAknFepCtrlMultiModeButton* button = |
|
239 |
static_cast<CAknFepCtrlMultiModeButton*>( aCtrl ); |
|
240 |
TInt realCase = button->GetRealCaseByMode( button->CurrentMode() ); |
|
241 |
HandleMergedBtnClicked( realCase ); |
|
242 |
} |
|
243 |
else |
|
244 |
{ |
|
245 |
HandleShiftAndCapslockBtnClicked(); |
|
246 |
TInt shiftStatus = CPeninputDataConverter::AnyToInt |
|
247 |
( iLayoutContext->RequestData( EPeninputDataTypeShiftDown ) ); |
|
248 |
ChangeMergedButtonStatus( shiftStatus, 0 ); |
|
249 |
} |
|
250 |
} |
|
251 |
||
252 |
} |
|
253 |
break; |
|
254 |
case EPeninputLayoutEventSwitchLanguage: |
|
255 |
{ |
|
256 |
TRAP_IGNORE( ChangeInputLanguageL( *data ) ); |
|
257 |
} |
|
258 |
break; |
|
259 |
case EPeninputLayoutEventRange: |
|
260 |
{ |
|
261 |
HandleRangeEvent( *data ); |
|
262 |
} |
|
263 |
break; |
|
264 |
case EPeninputLayoutEventRangeLoop: |
|
265 |
{ |
|
266 |
HandleRangeLoopEvent( *data ); |
|
267 |
} |
|
268 |
break; |
|
269 |
case EPeninputLayoutEventShift: |
|
270 |
{ |
|
271 |
HandleShiftAndCapslockBtnClicked(); |
|
272 |
TInt shiftStatus = CPeninputDataConverter::AnyToInt |
|
273 |
( iLayoutContext->RequestData( EPeninputDataTypeShiftDown ) ); |
|
274 |
ChangeMergedButtonStatus( shiftStatus, 0 ); |
|
275 |
} |
|
276 |
break; |
|
277 |
case EPeninputLayoutEventCapslock: |
|
278 |
{ |
|
279 |
HandleCapslockBtnClicked(); |
|
280 |
} |
|
281 |
break; |
|
282 |
case EPeninputLayoutEventMovePosition: |
|
283 |
{ |
|
284 |
TInt style = *( ( TUint16* ) aEventData.Ptr() ); |
|
285 |
ChangeLayoutPosition( style ); |
|
286 |
} |
|
287 |
break; |
|
288 |
case EPeninputLayoutEventSetPermittedRange: |
|
289 |
{ |
|
290 |
if ( *data & ERangeNative ) |
|
291 |
{ |
|
292 |
*data = *data | ERangeAccent | ERangeNativeNumber |
|
293 |
| ERangeMixedText | ERangeMixedNumber; |
|
294 |
} |
|
295 |
else if(*data & ERangeEnglish) |
|
296 |
{ |
|
297 |
*data = *data | ERangeAccent; |
|
298 |
} |
|
299 |
||
300 |
iLayoutContext->SetData( EPeninputDataTypePermittedRange, data ); |
|
301 |
||
302 |
// Set range of range bar component |
|
303 |
CFepUiBaseCtrl* bar = |
|
304 |
Control( EPeninutWindowCtrlIdRangeBar ); |
|
305 |
if ( bar ) |
|
306 |
{ |
|
307 |
CAknFepCtrlRangeBar* rangebar = |
|
308 |
static_cast<CAknFepCtrlRangeBar*>( bar ); |
|
309 |
rangebar->SetPermittedRanges( *data ); |
|
310 |
} |
|
311 |
} |
|
312 |
break; |
|
313 |
case EPeninputLayoutEventSetPermittedCase: |
|
314 |
{ |
|
315 |
// Update data:case |
|
316 |
iLayoutContext->SetData( EPeninputDataTypePermittedCase, data ); |
|
317 |
||
318 |
// Set range of case |
|
319 |
CFepUiBaseCtrl* bar = |
|
320 |
Control( EPeninutWindowCtrlIdRangeBar ); |
|
321 |
if ( bar ) |
|
322 |
{ |
|
323 |
CAknFepCtrlRangeBar* rangebar = |
|
324 |
static_cast<CAknFepCtrlRangeBar*>( bar ); |
|
325 |
||
326 |
rangebar->SetPermittedCase( ERangeEnglish, ECaseUpper, |
|
327 |
( *data & ECaseUpper) != 0 ); |
|
328 |
rangebar->SetPermittedCase( ERangeEnglish, ECaseLower, |
|
329 |
( *data & ECaseLower) != 0 ); |
|
330 |
rangebar->SetPermittedCase( ERangeEnglish, ECaseText, |
|
331 |
( *data & ECaseText) != 0 ); |
|
332 |
} |
|
333 |
} |
|
334 |
break; |
|
335 |
case EPeninputLayoutEventSetCase: |
|
336 |
{ |
|
337 |
DoCaseChange( *data ); |
|
338 |
} |
|
339 |
break; |
|
340 |
case EEventSizeChanged: |
|
341 |
{ |
|
342 |
//if icf editor size changed, we need to inform owner |
|
343 |
if(aCtrl->ControlId() == EPeninutWindowCtrlIdInputContextField || |
|
344 |
aCtrl->ControlId() == EPeninputWindowCtrlIdMultiLineICF) |
|
345 |
{ |
|
346 |
iLayoutContext->Sendkey( ESignalLayoutICFLengthChanged, KNullDesC ); |
|
347 |
} |
|
348 |
} |
|
349 |
break; |
|
350 |
default: |
|
351 |
break; |
|
352 |
} |
|
353 |
} |
|
354 |
||
355 |
// --------------------------------------------------------------------------- |
|
356 |
// CPeninputLayoutWindowExt::SetEditorTextL |
|
357 |
// (other items were commented in a header) |
|
358 |
// --------------------------------------------------------------------------- |
|
359 |
// |
|
360 |
EXPORT_C void CPeninputLayoutWindowExt::SetEditorTextL( |
|
361 |
const TFepInputContextFieldData& aData ) |
|
362 |
{ |
|
363 |
if (Control(EPeninutWindowCtrlIdInputContextField)) |
|
364 |
{ |
|
365 |
static_cast<CFepInputContextField*>( Control(EPeninutWindowCtrlIdInputContextField))->SetTextL( aData ); |
|
366 |
return; |
|
367 |
} |
|
368 |
||
369 |
if (Control(EPeninputWindowCtrlIdMultiLineICF)) |
|
370 |
{ |
|
371 |
CFepLayoutMultiLineIcf* multiIcf = |
|
372 |
static_cast<CFepLayoutMultiLineIcf*>( Control(EPeninputWindowCtrlIdMultiLineICF)); |
|
373 |
||
374 |
multiIcf->SetTextL( aData ); |
|
375 |
||
376 |
if ( iLayoutContext->LayoutType() == EPluginInputModeVkb || |
|
377 |
iLayoutContext->LayoutType() == EPluginInputModeFSQ ) |
|
378 |
{ |
|
379 |
TInt lang = CPeninputDataConverter::AnyToInt |
|
380 |
( iLayoutContext->RequestData( EPeninputDataTypeInputLanguage ) ); |
|
381 |
TInt curRange = CPeninputDataConverter::AnyToInt |
|
382 |
( iLayoutContext->RequestData( EPeninputDataTypeCurrentRange ) ); |
|
383 |
||
384 |
if ( lang == ELangVietnamese && curRange == ERangeEnglish ) |
|
385 |
{ |
|
386 |
TBuf<1> preData; |
|
387 |
multiIcf->ExtractText( preData, aData.iCurSel.LowerPos()-1, 1 ); |
|
388 |
iVowelChar = EFalse; |
|
389 |
||
390 |
if ( KNullDesC() != preData ) |
|
391 |
{ |
|
392 |
for (TUint i = 0; i < sizeof(VietVowelList) / sizeof(TText); ++i) |
|
393 |
{ |
|
394 |
TBuf<1> buf; |
|
395 |
buf.Append( VietVowelList[i] ); |
|
396 |
if (preData == buf) |
|
397 |
{ |
|
398 |
iVowelChar = ETrue; |
|
399 |
break; |
|
400 |
} |
|
401 |
} |
|
402 |
} |
|
403 |
CPeninputVkbCtrlExt* vkbCtrl = static_cast<CPeninputVkbCtrlExt*> |
|
404 |
( Control( EPeninutWindowCtrlIdVkbCtrl ) ); |
|
405 |
vkbCtrl->DimKeySet( iToneSet, !iVowelChar ); |
|
406 |
} |
|
407 |
} |
|
408 |
} |
|
50
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
409 |
else |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
410 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
411 |
// If in virtual QWERTY mode |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
412 |
if ( iLayoutContext->LayoutType() == EPluginInputModeFSQ ) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
413 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
414 |
TInt lang = CPeninputDataConverter::AnyToInt |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
415 |
( iLayoutContext->RequestData( EPeninputDataTypeInputLanguage )); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
416 |
TInt curRange = CPeninputDataConverter::AnyToInt |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
417 |
( iLayoutContext->RequestData( EPeninputDataTypeCurrentRange )); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
418 |
|
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
419 |
// When writing language is Vietnamese and range is English |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
420 |
if ( lang == ELangVietnamese && curRange == ERangeEnglish ) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
421 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
422 |
TBuf<1> charData; |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
423 |
// Get the input character |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
424 |
charData.Append( aData.iText ); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
425 |
iVowelChar = EFalse; |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
426 |
|
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
427 |
if ( KNullDesC() != charData ) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
428 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
429 |
// Check whether the input char is in the list of VietVowelList |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
430 |
for ( TUint i = 0; i < sizeof( VietVowelList ) / sizeof( TText ); ++i ) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
431 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
432 |
TBuf<1> buf; |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
433 |
buf.Append( VietVowelList[i] ); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
434 |
if ( charData == buf ) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
435 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
436 |
iVowelChar = ETrue; |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
437 |
break; |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
438 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
439 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
440 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
441 |
|
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
442 |
CPeninputVkbCtrlExt* vkbCtrl = static_cast<CPeninputVkbCtrlExt*> |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
443 |
( Control( EPeninutWindowCtrlIdVkbCtrl )); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
444 |
// Set the dim status of the tone keys |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
445 |
vkbCtrl->DimKeySet( iToneSet, !iVowelChar ); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
446 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
447 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
448 |
} |
44 | 449 |
} |
450 |
||
451 |
// --------------------------------------------------------------------------- |
|
452 |
// CPeninputLayoutWindowExt::SetEditorTextL |
|
453 |
// (other items were commented in a header) |
|
454 |
// --------------------------------------------------------------------------- |
|
455 |
// |
|
456 |
EXPORT_C void CPeninputLayoutWindowExt::SetTextIsSecret( TBool aData ) |
|
457 |
{ |
|
458 |
if ( Control(EPeninutWindowCtrlIdInputContextField)) |
|
459 |
{ |
|
460 |
static_cast<CFepInputContextField*> |
|
461 |
(Control(EPeninutWindowCtrlIdInputContextField))->SetTextIsSecret( aData ); |
|
462 |
} |
|
463 |
else if (Control(EPeninputWindowCtrlIdMultiLineICF)) |
|
464 |
{ |
|
465 |
static_cast<CFepLayoutMultiLineIcf*> |
|
466 |
(Control(EPeninputWindowCtrlIdMultiLineICF))->SetTextIsSecret( aData ); |
|
467 |
} |
|
468 |
} |
|
469 |
||
470 |
void CPeninputLayoutWindowExt::SetNumberGrouping( TBool aData ) |
|
471 |
{ |
|
472 |
if (Control(EPeninputWindowCtrlIdMultiLineICF)) |
|
473 |
{ |
|
474 |
static_cast<CFepLayoutMultiLineIcf*> |
|
475 |
(Control(EPeninputWindowCtrlIdMultiLineICF))->SetNumberGrouping( aData ); |
|
476 |
} |
|
477 |
} |
|
478 |
||
479 |
||
480 |
// --------------------------------------------------------------------------- |
|
481 |
// CPeninputLayoutWindowExt::DoClose |
|
482 |
// (other items were commented in a header) |
|
483 |
// --------------------------------------------------------------------------- |
|
484 |
// |
|
485 |
EXPORT_C TBool CPeninputLayoutWindowExt::DoClose() |
|
486 |
{ |
|
487 |
// Send EVkbEventWindowClose to layout |
|
488 |
this->ReportEvent( EPeninputLayoutEventClose, KNullDesC ); |
|
489 |
||
490 |
// Return true which will permit the window close |
|
491 |
return EFalse; |
|
492 |
} |
|
493 |
||
494 |
||
495 |
// --------------------------------------------------------------------------- |
|
496 |
// Get layout config method. It does a lasy initialization for a instance of |
|
497 |
// CPeninputLayoutWindowExt::ConfigInfo |
|
498 |
// (other items were commented in a header) |
|
499 |
// --------------------------------------------------------------------------- |
|
500 |
// |
|
501 |
EXPORT_C CPeninputLayoutConfig* CPeninputLayoutWindowExt::ConfigInfo() const |
|
502 |
{ |
|
503 |
return iConfigInfo; |
|
504 |
} |
|
505 |
||
506 |
// --------------------------------------------------------------------------- |
|
507 |
// CPeninputLayoutWindowExt::CheckResourceExist |
|
508 |
// (other items were commented in a header) |
|
509 |
// --------------------------------------------------------------------------- |
|
510 |
// |
|
511 |
TBool CPeninputLayoutWindowExt::CheckResourceExist( const TDesC& aFileName ) |
|
512 |
{ |
|
513 |
RFile file; |
|
514 |
||
515 |
if ( !aFileName.Length() ) |
|
516 |
{ |
|
517 |
return EFalse; |
|
518 |
} |
|
519 |
||
520 |
TInt rs = file.Open( CCoeEnv::Static()->FsSession(), aFileName, EFileRead ); |
|
521 |
||
522 |
if ( rs == KErrNotFound ) |
|
523 |
{ |
|
524 |
return EFalse; |
|
525 |
} |
|
526 |
else |
|
527 |
{ |
|
528 |
file.Close(); |
|
529 |
||
530 |
return ETrue; |
|
531 |
} |
|
532 |
} |
|
533 |
||
534 |
// --------------------------------------------------------------------------- |
|
535 |
// CPeninputLayoutWindowExt::CancelDeadKey |
|
536 |
// (other items were commented in a header) |
|
537 |
// --------------------------------------------------------------------------- |
|
538 |
// |
|
539 |
void CPeninputLayoutWindowExt::CancelDeadKey() |
|
540 |
{ |
|
541 |
// Get the dead key status |
|
542 |
TInt latchedFlag = CPeninputDataConverter::AnyToInt( |
|
543 |
iLayoutContext->RequestData( EAkninputDataTypeLatchedSet )); |
|
544 |
// If the DeadKey is latched, cancel it |
|
545 |
if ( latchedFlag ) |
|
546 |
{ |
|
547 |
RPointerArray<CPeninputVkbLayoutInfo> vkbListInfo; |
|
548 |
RPointerArray<CPeninputVkbKeyInfo> keyInfoList; |
|
549 |
||
550 |
// Get the vkb layout list supportted by current writing language |
|
551 |
vkbListInfo = iVkbLayout->VkbLayoutInfoList(); |
|
552 |
TInt vkbListNum = vkbListInfo.Count(); |
|
553 |
||
554 |
CVirtualKey* pKey; |
|
555 |
TBool deadKeyChange = EFalse; |
|
556 |
||
557 |
// Find the latched DeadKey in all kinds of vkb layout |
|
558 |
// which supportted by current writing language |
|
559 |
for ( TInt i = 0; i < vkbListNum && !deadKeyChange ; i++ ) |
|
560 |
{ |
|
561 |
// Get the key info list in one vkb layout |
|
562 |
keyInfoList = vkbListInfo[i]->KeyInfoList(); |
|
563 |
TInt keyListNum = keyInfoList.Count(); |
|
564 |
for ( TInt j = 0; j < keyListNum && !deadKeyChange ; j++ ) |
|
565 |
{ |
|
566 |
pKey = keyInfoList[j]->Key(); |
|
567 |
// If the Dead key is latched |
|
568 |
if ( pKey->Latched()) |
|
569 |
{ |
|
570 |
// Unlatch the DeadKey |
|
571 |
pKey->SetLatched( EFalse ); |
|
572 |
||
573 |
// Set the DeadKey state |
|
574 |
iLayoutContext->SetData( |
|
575 |
EAkninputDataTypeLatchedSet, &deadKeyChange ); |
|
576 |
||
577 |
deadKeyChange = ETrue; |
|
578 |
} |
|
579 |
} |
|
580 |
} |
|
581 |
} |
|
582 |
} |
|
583 |
||
584 |
// --------------------------------------------------------------------------- |
|
585 |
// CPeninputLayoutWindowExt::ChangeInputLanguageL |
|
586 |
// (other items were commented in a header) |
|
587 |
// --------------------------------------------------------------------------- |
|
588 |
// |
|
589 |
EXPORT_C void CPeninputLayoutWindowExt::ChangeInputLanguageL( TInt aLangID ) |
|
590 |
{ |
|
591 |
// Determine whether a new language id is same as existing one, |
|
592 |
if ( ConfigInfo() ) |
|
593 |
{ |
|
594 |
// If language not changed, exit this function |
|
595 |
if ( ConfigInfo()->Language() == aLangID ) |
|
596 |
{ |
|
597 |
return; |
|
598 |
} |
|
599 |
} |
|
600 |
||
601 |
// First check file exist or not |
|
602 |
TBool found = CheckResourceExist( GetWindowConfigResFileName( aLangID ) ); |
|
603 |
if ( !found ) |
|
604 |
{ |
|
605 |
aLangID = ELangEnglish; |
|
606 |
found = CheckResourceExist( GetWindowConfigResFileName( aLangID ) ); |
|
607 |
} |
|
608 |
||
609 |
if ( found ) |
|
610 |
{ |
|
611 |
// Remove the dead key's latched status |
|
612 |
CancelDeadKey(); |
|
613 |
||
614 |
// Store language |
|
615 |
iLayoutContext->SetData( EPeninputDataTypeInputLanguage, &aLangID ); |
|
616 |
||
617 |
if ( iLayoutContext->LayoutType() == EPluginInputModeVkb || |
|
618 |
iLayoutContext->LayoutType() == EPluginInputModeFSQ ) |
|
619 |
{ |
|
620 |
CFepUiBaseCtrl* ctrl = |
|
621 |
Control( EPeninutWindowCtrlIdVkbCtrl ); |
|
622 |
if ( ctrl ) |
|
623 |
{ |
|
624 |
( static_cast<CPeninputVkbCtrlExt*>( ctrl ) )->Reset(); |
|
625 |
} |
|
626 |
} |
|
627 |
||
628 |
// Re-construct config info |
|
629 |
if ( iConfigInfo ) |
|
630 |
{ |
|
631 |
delete iConfigInfo; |
|
632 |
iConfigInfo = NULL; |
|
633 |
} |
|
634 |
||
635 |
if (iConfigResId) |
|
636 |
{ |
|
637 |
CCoeEnv::Static()->DeleteResourceFile( iConfigResId ); |
|
638 |
} |
|
639 |
||
640 |
// construct resource utils |
|
641 |
||
642 |
CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
643 |
||
644 |
// Set up resources |
|
645 |
TFileName resFileName = GetWindowConfigResFileName( aLangID ); |
|
646 |
BaflUtils::NearestLanguageFile(coeEnv->FsSession(), resFileName ); |
|
647 |
iConfigResId = coeEnv->AddResourceFileL( resFileName ); |
|
648 |
||
649 |
TResourceReader reader; |
|
650 |
||
651 |
coeEnv->CreateResourceReaderLC( reader, GetWindowConfigResId() ); |
|
652 |
if ( iLayoutContext->LayoutType() == EPluginInputModeVkb || |
|
653 |
iLayoutContext->LayoutType() == EPluginInputModeFSQ ) |
|
654 |
{ |
|
655 |
iVkbLayout->Reset(); |
|
656 |
} |
|
657 |
iConfigInfo = CPeninputLayoutConfig::NewL( *iVkbLayout, reader ); |
|
658 |
||
659 |
// Pop and destroy reader |
|
660 |
CleanupStack::PopAndDestroy( 1 ); |
|
661 |
||
662 |
// Re-construct rangebar |
|
663 |
ChangeRangeBarL(); |
|
664 |
||
665 |
//Reset range and layoutid |
|
666 |
TInt range = -1; |
|
667 |
iLayoutContext->SetData( EPeninputDataTypeCurrentRange, &range ); |
|
668 |
iLayoutContext->SetData( EPeninputDataTypeClientLayout, &range ); |
|
669 |
ResetLastColRow(); |
|
670 |
iLangOrSizeChanged = ETrue; |
|
671 |
||
672 |
CFepUiBaseCtrl* icfCtrl = Control( EPeninputWindowCtrlIdMultiLineICF ); |
|
673 |
if ( icfCtrl ) |
|
674 |
{ |
|
675 |
static_cast<CFepLayoutMultiLineIcf*>(icfCtrl)->SetLanguageId( aLangID ); |
|
676 |
} |
|
677 |
||
678 |
delete iToneSet; |
|
679 |
iToneSet = NULL; |
|
680 |
||
681 |
if ( aLangID == ELangVietnamese ) |
|
682 |
{ |
|
683 |
iToneSet = HBufC::NewL( KNumberOfToneMarks ); |
|
684 |
||
685 |
for (TInt index = 0; index < KNumberOfToneMarks; index ++) |
|
686 |
{ |
|
687 |
iToneSet->Des().Append( VietToneMatrix[0][index] ); |
|
688 |
} |
|
689 |
} |
|
690 |
} |
|
691 |
} |
|
692 |
||
693 |
// --------------------------------------------------------------------------- |
|
694 |
// CPeninputLayoutWindowExt::ChangeRangeBarL |
|
695 |
// (other items were commented in a header) |
|
696 |
// --------------------------------------------------------------------------- |
|
697 |
// |
|
698 |
void CPeninputLayoutWindowExt::ChangeRangeBarL() |
|
699 |
{ |
|
700 |
// Read range bar from config into and reconstruct range button |
|
701 |
if ( iConfigInfo ) |
|
702 |
{ |
|
703 |
TInt resid = iConfigInfo->RangebarResId(); |
|
704 |
CFepUiBaseCtrl* bar = |
|
705 |
Control( EPeninutWindowCtrlIdRangeBar ); |
|
706 |
||
707 |
if ( bar ) |
|
708 |
{ |
|
709 |
CAknFepCtrlRangeBar* rangebar = |
|
710 |
static_cast<CAknFepCtrlRangeBar*>( bar ); |
|
711 |
||
712 |
CAknFepCtrlRangeBar::TRangeBarActionStyle style = |
|
713 |
( CAknFepCtrlRangeBar::TRangeBarActionStyle ) |
|
714 |
iConfigInfo->RangeBarInfo()->RangeStyle(); |
|
715 |
||
716 |
rangebar->SetActionStyle( style ); |
|
717 |
||
718 |
TResourceReader reader; |
|
719 |
||
720 |
CCoeEnv::Static()->CreateResourceReaderLC( reader, resid ); |
|
721 |
||
722 |
rangebar->ConstructFromResourceL( reader ); |
|
723 |
||
724 |
// Pop and destroy reader |
|
725 |
CleanupStack::PopAndDestroy( 1 ); |
|
726 |
} |
|
727 |
} |
|
728 |
} |
|
729 |
||
730 |
// --------------------------------------------------------------------------- |
|
731 |
// CPeninputLayoutWindowExt::ChangeRange |
|
732 |
// (other items were commented in a header) |
|
733 |
// --------------------------------------------------------------------------- |
|
734 |
// |
|
735 |
EXPORT_C void CPeninputLayoutWindowExt::ChangeRange( TInt aRange, TInt aVkbLayoutId, |
|
736 |
TBool aNotify ) |
|
737 |
{ |
|
738 |
TInt curRange = CPeninputDataConverter::AnyToInt |
|
739 |
( iLayoutContext->RequestData( EPeninputDataTypeCurrentRange ) ); |
|
740 |
TInt curVkbLayout = CPeninputDataConverter::AnyToInt |
|
741 |
( iLayoutContext->RequestData( EPeninputDataTypeVkbLayout ) ); |
|
742 |
TInt curLanguage = CPeninputDataConverter::AnyToInt |
|
743 |
( iLayoutContext->RequestData( EPeninputDataTypeInputLanguage ) ); |
|
744 |
||
745 |
CFepUiBaseCtrl* bar = |
|
746 |
Control( EPeninutWindowCtrlIdRangeBar ); |
|
747 |
CAknFepCtrlRangeBar* rangebar = |
|
748 |
static_cast<CAknFepCtrlRangeBar*>( bar ); |
|
749 |
||
750 |
if ( rangebar ) |
|
751 |
{ |
|
752 |
rangebar->ActiveRange( aRange ); |
|
753 |
} |
|
754 |
||
755 |
if (curRange != aRange || curVkbLayout != aVkbLayoutId || aRange == ERangeAccent) |
|
756 |
{ |
|
757 |
// Update data:range |
|
758 |
if (curRange != aRange) |
|
759 |
iLayoutContext->SetData( EPeninputDataTypeCurrentRange, &aRange ); |
|
760 |
||
761 |
// Change client layout |
|
762 |
CPeninputRangeBarInfo* rangeBarInfo = iConfigInfo->RangeBarInfo(); |
|
763 |
CPeninputRangeInfo* rangeInfo = rangeBarInfo->FindRange(aRange); |
|
764 |
||
765 |
__ASSERT_DEBUG(rangeInfo, User::Panic(_L("Commonlayout-Invalid Range"), aRange)); |
|
766 |
||
767 |
ChangeClientLayout(rangeInfo->ClientLayoutId()); |
|
768 |
||
769 |
// Notify fep the new range |
|
770 |
if (aNotify) |
|
771 |
{ |
|
772 |
TBuf<KIntLengthForByte> buf; |
|
773 |
CPeninputDataConverter::IntToDesc( aRange, buf ); |
|
774 |
iLayoutContext->Sendkey( ESignalRange, buf ); |
|
775 |
||
776 |
// When change range mannually, make the entire window visible |
|
777 |
TInt style = EPeninputPositionChangeBrJustify; |
|
778 |
TBuf<KIntSizeToInt16> bufStyle; |
|
779 |
bufStyle = ( TUint16* )&style; |
|
780 |
HandleControlEvent(EPeninputLayoutEventMovePosition, NULL, bufStyle); |
|
781 |
} |
|
782 |
||
783 |
// Change vkb layout |
|
784 |
if ( iLayoutContext->LayoutType() == EPluginInputModeVkb || |
|
785 |
iLayoutContext->LayoutType() == EPluginInputModeFSQ ) |
|
786 |
{ |
|
787 |
if ( ( aRange == ERangeEnglish ) || ( aRange == ERangeAccent ) |
|
788 |
|| (( aRange == ERangeNativeNumber ) && (iLayoutContext->LayoutType() != EPluginInputModeFSQ )) |
|
789 |
|| ( ConfigInfo()->CaseSensitive() |
|
790 |
&& ( aRange == ERangeNative ) ) ) |
|
791 |
{ |
|
792 |
// Change shift and capslock button status according to the current case |
|
793 |
TInt curCase = CPeninputDataConverter::AnyToInt |
|
794 |
( iLayoutContext->RequestData( EPeninputDataTypeCase ) ); |
|
795 |
TInt shfit; |
|
796 |
TInt capslock; |
|
797 |
||
798 |
CPeninputDataConverter::ShiftCapslockByCase( curCase, |
|
799 |
shfit, capslock ); |
|
800 |
||
801 |
iLayoutContext->SetData( EPeninputDataTypeShiftDown, &shfit ); |
|
802 |
//ChangeButtonStatus( shfit, EPeninutWindowCtrlIdShiftBtn ); |
|
803 |
iLayoutContext->SetData( EPeninputDataTypeCapslockDown, &capslock ); |
|
804 |
//ChangeButtonStatus( capslock, EPeninutWindowCtrlIdCapslockBtn ); |
|
805 |
ChangeMergedButtonStatus( shfit, capslock ); |
|
806 |
||
807 |
TInt caseid = CaseByShiftCapslockStatus(); |
|
808 |
TInt vkblayoutid = |
|
809 |
ConfigInfo()->ShiftCapsSingleVkbLayoutId( aRange, caseid ); |
|
810 |
||
811 |
if ( aRange == ERangeAccent ) |
|
812 |
{ |
|
813 |
TInt curAccentIndex = CPeninputDataConverter::AnyToInt |
|
814 |
( iLayoutContext->RequestData( EPeninputDataTypeCurrentAccent ) ); |
|
815 |
vkblayoutid = vkblayoutid + curAccentIndex * 2; |
|
816 |
} |
|
817 |
||
818 |
// Change vkb layout |
|
819 |
ChangeVkbLayout( vkblayoutid ); |
|
820 |
} |
|
821 |
// Deal these four language in special way |
|
822 |
else if((( aRange == ERangeNativeNumber ) || ( aRange == ERangeNumber )) |
|
823 |
&& ( iLayoutContext->LayoutType() == EPluginInputModeFSQ ) |
|
824 |
&& (( curLanguage == ELangArabic ) |
|
825 |
|| ( curLanguage == ELangFarsi) |
|
826 |
|| ( curLanguage == ELangUrdu ) |
|
827 |
|| ( curLanguage == ELangThai ))) |
|
828 |
{ |
|
829 |
if ( !aVkbLayoutId ) |
|
830 |
{ |
|
831 |
TInt shiftFlag = ( aRange == ERangeNativeNumber )? 0:1; |
|
832 |
aVkbLayoutId = ( aRange == ERangeNativeNumber )? |
|
833 |
EPeninputVkbLayoutNativeNumberShift : EPeninputVkbLayoutLatinNumber; |
|
834 |
||
835 |
TInt capslockFlag = 0; |
|
836 |
||
837 |
iLayoutContext->SetData( EPeninputDataTypeShiftDown, &shiftFlag ); |
|
838 |
iLayoutContext->SetData( EPeninputDataTypeCapslockDown, &capslockFlag ); |
|
839 |
||
840 |
ChangeMergedButtonStatus( shiftFlag, capslockFlag ); |
|
841 |
} |
|
842 |
ChangeVkbLayout( aVkbLayoutId ); |
|
843 |
} |
|
844 |
else |
|
845 |
{ |
|
846 |
TInt flag = 0; |
|
847 |
||
848 |
iLayoutContext->SetData( EPeninputDataTypeShiftDown, &flag ); |
|
849 |
//ChangeButtonStatus( 0, EPeninutWindowCtrlIdShiftBtn ); |
|
850 |
iLayoutContext->SetData( EPeninputDataTypeCapslockDown, &flag ); |
|
851 |
//ChangeButtonStatus( 0, EPeninutWindowCtrlIdCapslockBtn ); |
|
852 |
ChangeMergedButtonStatus( 0, 0 ); |
|
853 |
||
854 |
// Change vkb layout |
|
855 |
if ( aVkbLayoutId ) |
|
856 |
{ |
|
857 |
ChangeVkbLayout( aVkbLayoutId ); |
|
858 |
} |
|
859 |
else |
|
860 |
{ |
|
861 |
ChangeVkbLayout( rangeInfo->VkbLayoutId() ); |
|
862 |
} |
|
863 |
} |
|
864 |
} |
|
865 |
||
866 |
} |
|
867 |
||
868 |
if ( ( iLayoutContext->LayoutType() == EPluginInputModeVkb || |
|
869 |
iLayoutContext->LayoutType() == EPluginInputModeFSQ ) |
|
870 |
&& ( curRange == ERangeNumber || curRange == ERangeNativeNumber ) |
|
871 |
&& ( curRange == aRange ) ) |
|
872 |
{ |
|
873 |
// Dimmed some keys if needed |
|
874 |
DimKeys(); |
|
875 |
} |
|
876 |
} |
|
877 |
||
878 |
// --------------------------------------------------------------------------- |
|
879 |
// CPeninputLayoutWindowExt::ChangeClientLayout |
|
880 |
// (other items were commented in a header) |
|
881 |
// --------------------------------------------------------------------------- |
|
882 |
// |
|
883 |
EXPORT_C void CPeninputLayoutWindowExt::ChangeClientLayout( |
|
884 |
TInt aClientLayoutId ) |
|
885 |
{ |
|
886 |
TInt curClientId = CPeninputDataConverter::AnyToInt |
|
887 |
( iLayoutContext->RequestData( EPeninputDataTypeClientLayout ) ); |
|
888 |
||
889 |
if ( curClientId != aClientLayoutId ) |
|
890 |
{ |
|
891 |
CPeninputClientLayoutInfo* clientLayout = |
|
892 |
ConfigInfo()->FindClientLayoutInfo( aClientLayoutId ); |
|
893 |
||
894 |
__ASSERT_DEBUG( clientLayout, User::Panic(_L("Commonlayout-Invalid ClientLayout"), aClientLayoutId)); |
|
895 |
||
896 |
SetLafLayOut( clientLayout->Rows(), clientLayout->Columns() ); |
|
897 |
||
898 |
//SizeChangedForBaseWindow( clientLayout->Columns() ); |
|
899 |
||
900 |
// Re-Orginize all controls according to the configuration |
|
901 |
ReorganizeControls( aClientLayoutId, ETrue ); |
|
902 |
||
903 |
// Update data:client layout id |
|
904 |
iLayoutContext->SetData( EPeninputDataTypeClientLayout, |
|
905 |
&aClientLayoutId ); |
|
906 |
} |
|
907 |
} |
|
908 |
||
909 |
// --------------------------------------------------------------------------- |
|
910 |
// CPeninputLayoutWindowExt::ChangeVkbLayout |
|
911 |
// (other items were commented in a header) |
|
912 |
// --------------------------------------------------------------------------- |
|
913 |
// |
|
914 |
EXPORT_C void CPeninputLayoutWindowExt::ChangeVkbLayout( TInt aVkbLayoutId ) |
|
915 |
{ |
|
916 |
||
917 |
// Remove the dead key's latched status |
|
918 |
CancelDeadKey(); |
|
919 |
||
920 |
||
921 |
TInt curVkbId = CPeninputDataConverter::AnyToInt |
|
922 |
( iLayoutContext->RequestData( EPeninputDataTypeVkbLayout ) ); |
|
923 |
||
924 |
if ( ( curVkbId != aVkbLayoutId ) || ( iLangOrSizeChanged ) ) |
|
925 |
{ |
|
926 |
iLangOrSizeChanged = EFalse; |
|
927 |
// Update data : vkb layout id |
|
928 |
iLayoutContext->SetData( EPeninputDataTypeVkbLayout, &aVkbLayoutId ); |
|
929 |
||
930 |
iVkbLayout->ChangeVkbLayout( aVkbLayoutId ); |
|
931 |
SetVkbLayoutSize(); |
|
932 |
||
933 |
TInt curClientId = CPeninputDataConverter::AnyToInt |
|
934 |
( iLayoutContext->RequestData( EPeninputDataTypeClientLayout ) ); |
|
935 |
CPeninputControlInfo* vkbInfo = iConfigInfo->FindClientLayoutInfo |
|
936 |
( curClientId )->FindControlInfo( EPeninutWindowCtrlIdVkbCtrl ); |
|
937 |
||
938 |
TRect rect; |
|
939 |
CPeninputVkbCtrlExt* vkbCtrl = static_cast<CPeninputVkbCtrlExt*> |
|
940 |
( Control(EPeninutWindowCtrlIdVkbCtrl)); |
|
941 |
||
942 |
||
943 |
CPeninputVkbLayoutInfo* vkblayout = |
|
944 |
ConfigInfo()->FindVkbLayoutInfo( aVkbLayoutId ); |
|
945 |
||
946 |
if ( vkbCtrl && vkblayout ) |
|
947 |
{ |
|
948 |
DimKeys(); |
|
949 |
||
950 |
// Make the true draw |
|
951 |
UpdateArea( vkbCtrl->Rect(), EFalse ); |
|
952 |
} |
|
953 |
} |
|
954 |
} |
|
955 |
||
956 |
// -------------------------------------------------------------------------- |
|
957 |
// CPeninputLayoutWindowExt::HandleRangeEvent |
|
958 |
// (other items were commented in a header) |
|
959 |
// -------------------------------------------------------------------------- |
|
960 |
// |
|
961 |
EXPORT_C void CPeninputLayoutWindowExt::HandleRangeEvent( TInt aRange ) |
|
962 |
{ |
|
963 |
TInt curRange = CPeninputDataConverter::AnyToInt |
|
964 |
( iLayoutContext->RequestData( EPeninputDataTypeCurrentRange ) ); |
|
965 |
||
966 |
CPeninputRangeBarInfo* rangeBar = iConfigInfo->RangeBarInfo(); |
|
967 |
if ( !rangeBar ) |
|
968 |
{ |
|
969 |
return; |
|
970 |
} |
|
971 |
||
972 |
CPeninputRangeInfo* rangeInfo = rangeBar->FindRange( aRange ); |
|
973 |
||
974 |
if ( !rangeInfo ) |
|
975 |
{ |
|
976 |
return; |
|
977 |
} |
|
978 |
||
979 |
TInt responseStyle = rangeInfo->ResponseStyle(); |
|
980 |
if ( responseStyle == EPeninputRangeResponseNoAction ) |
|
981 |
{ |
|
982 |
return; |
|
983 |
} |
|
984 |
||
985 |
if (curRange != aRange && responseStyle == EPeninputRangeResponseSwitchRange) |
|
986 |
{ |
|
987 |
TInt index = KInvalidIndex; |
|
988 |
||
989 |
if ( aRange == ERangeAccent ) |
|
990 |
{ |
|
991 |
index = 0; |
|
992 |
} |
|
993 |
iLayoutContext->SetData( EPeninputDataTypeCurrentAccent, &index ); |
|
994 |
||
995 |
ChangeRange( aRange ); |
|
996 |
} |
|
997 |
else if ( responseStyle == EPeninputRangeResponsePopupChoiceItem ) |
|
998 |
{ |
|
999 |
PopupChoiceList(); |
|
1000 |
} |
|
1001 |
} |
|
1002 |
||
1003 |
// -------------------------------------------------------------------------- |
|
1004 |
// CPeninputLayoutWindowExt::HandleRangeLoopEvent |
|
1005 |
// (other items were commented in a header) |
|
1006 |
// -------------------------------------------------------------------------- |
|
1007 |
// |
|
1008 |
EXPORT_C void CPeninputLayoutWindowExt::HandleRangeLoopEvent( TInt aLoop ) |
|
1009 |
{ |
|
1010 |
TInt curRange = CPeninputDataConverter::AnyToInt |
|
1011 |
( iLayoutContext->RequestData( EPeninputDataTypeCurrentRange ) ); |
|
1012 |
||
1013 |
CFepUiBaseCtrl* ctrl = Control( EPeninutWindowCtrlIdRangeBar ); |
|
1014 |
CAknFepCtrlRangeBar* rangebar = static_cast<CAknFepCtrlRangeBar*>( ctrl ); |
|
1015 |
||
1016 |
if ( rangebar ) |
|
1017 |
{ |
|
1018 |
TRAP_IGNORE( rangebar->SetCaseL( curRange, aLoop ) ); |
|
1019 |
||
1020 |
if ( ( curRange == ERangeEnglish ) || ( ConfigInfo()->CaseSensitive() |
|
1021 |
&& ( curRange == ERangeNative ) ) ) |
|
1022 |
{ |
|
1023 |
TInt curCase = rangebar->GetCase( curRange ); |
|
1024 |
||
1025 |
// Store case in the data manager, the engine will |
|
1026 |
// get notice at the same time |
|
1027 |
iLayoutContext->SetData( EPeninputDataTypeCase, &curCase ); |
|
1028 |
||
1029 |
// Notify fep the new case |
|
1030 |
TBuf<KIntLengthForByte> buf; |
|
1031 |
CPeninputDataConverter::IntToDesc( curCase, buf ); |
|
1032 |
iLayoutContext->Sendkey( ESignalCaseMode, buf ); |
|
1033 |
} |
|
1034 |
} |
|
1035 |
} |
|
1036 |
||
1037 |
// -------------------------------------------------------------------------- |
|
1038 |
// CPeninputLayoutWindowExt::CaseByShiftCapslockStatus |
|
1039 |
// (other items were commented in a header) |
|
1040 |
// -------------------------------------------------------------------------- |
|
1041 |
// |
|
1042 |
EXPORT_C TInt CPeninputLayoutWindowExt::CaseByShiftCapslockStatus() |
|
1043 |
{ |
|
1044 |
TInt shiftStatus = CPeninputDataConverter::AnyToInt |
|
1045 |
( iLayoutContext->RequestData( EPeninputDataTypeShiftDown ) ); |
|
1046 |
TInt capslockStatus = CPeninputDataConverter::AnyToInt |
|
1047 |
( iLayoutContext->RequestData( EPeninputDataTypeCapslockDown ) ); |
|
1048 |
||
1049 |
return ( capslockStatus * 2 + shiftStatus ); |
|
1050 |
} |
|
1051 |
||
1052 |
// --------------------------------------------------------------------------- |
|
1053 |
// CPeninputLayoutWindow::HandleShiftBtnClicked |
|
1054 |
// (other items were commented in a header) |
|
1055 |
// --------------------------------------------------------------------------- |
|
1056 |
// |
|
1057 |
EXPORT_C void CPeninputLayoutWindowExt::HandleMergedBtnClicked( TInt aCase ) |
|
1058 |
{ |
|
1059 |
switch( aCase ) |
|
1060 |
{ |
|
1061 |
case ECaseLower: |
|
1062 |
{ |
|
1063 |
HandleCapslockBtnClicked(); |
|
1064 |
} |
|
1065 |
break; |
|
1066 |
case ECaseUpper: |
|
1067 |
{ |
|
1068 |
HandleShiftBtnClicked(); |
|
1069 |
} |
|
1070 |
break; |
|
1071 |
case ECaseText: |
|
1072 |
// case ECaseInverseText: |
|
1073 |
{ |
|
1074 |
// Current case is Text, equals shift button |
|
1075 |
//HandleCapslockBtnClicked(); |
|
1076 |
HandleShiftAndCapslockBtnClicked(); |
|
1077 |
} |
|
1078 |
break; |
|
1079 |
default: |
|
1080 |
break; |
|
1081 |
} |
|
1082 |
||
1083 |
} |
|
1084 |
||
1085 |
// --------------------------------------------------------------------------- |
|
1086 |
// CPeninputLayoutWindowExt::HandleShiftBtnClicked |
|
1087 |
// (other items were commented in a header) |
|
1088 |
// --------------------------------------------------------------------------- |
|
1089 |
// |
|
1090 |
EXPORT_C void CPeninputLayoutWindowExt::HandleShiftBtnClicked() |
|
1091 |
{ |
|
1092 |
TInt curRange = CPeninputDataConverter::AnyToInt |
|
1093 |
( iLayoutContext->RequestData( EPeninputDataTypeCurrentRange ) ); |
|
1094 |
||
1095 |
TInt shiftStatus = CPeninputDataConverter::AnyToInt |
|
1096 |
( iLayoutContext->RequestData( EPeninputDataTypeShiftDown ) ); |
|
1097 |
TInt capslockStatus = CPeninputDataConverter::AnyToInt |
|
1098 |
( iLayoutContext->RequestData( EPeninputDataTypeCapslockDown ) ); |
|
1099 |
||
1100 |
// Update data |
|
1101 |
if ( iLayoutContext->IsCapsLockPermitted() ) |
|
1102 |
{ |
|
1103 |
if ( curRange == ERangeEnglish || curRange == ERangeAccent |
|
1104 |
|| ( ConfigInfo()->CaseSensitive() && curRange == ERangeNative ) ) |
|
1105 |
{ |
|
1106 |
capslockStatus = !capslockStatus; |
|
1107 |
ChangeMergedButtonStatus( shiftStatus, capslockStatus ); |
|
1108 |
iLayoutContext->SetData( EPeninputDataTypeCapslockDown, &capslockStatus ); |
|
1109 |
} |
|
1110 |
} |
|
1111 |
else |
|
1112 |
{ |
|
1113 |
if ( iLayoutContext->IsShiftPermitted() ) |
|
1114 |
{ |
|
1115 |
shiftStatus = !shiftStatus; |
|
1116 |
ChangeMergedButtonStatus( shiftStatus, capslockStatus ); |
|
1117 |
iLayoutContext->SetData( EPeninputDataTypeShiftDown, &shiftStatus ); |
|
1118 |
} |
|
1119 |
} |
|
1120 |
||
1121 |
// Update vkb layout |
|
1122 |
TInt caseid = CaseByShiftCapslockStatus(); |
|
1123 |
||
1124 |
TInt vkbLayout = iConfigInfo->ShiftCapsSingleVkbLayoutId( curRange, |
|
1125 |
caseid ); |
|
1126 |
||
1127 |
TInt responseStyle = |
|
1128 |
iConfigInfo->RangeBarInfo()->FindRange( curRange )->ResponseStyle(); |
|
1129 |
if ( ( curRange == ERangeAccent ) |
|
1130 |
&& ( responseStyle == EPeninputRangeResponsePopupChoiceItem ) ) |
|
1131 |
{ |
|
1132 |
TInt curAccentIndex = CPeninputDataConverter::AnyToInt |
|
1133 |
( iLayoutContext->RequestData( EPeninputDataTypeCurrentAccent ) ); |
|
1134 |
vkbLayout = vkbLayout + curAccentIndex * 2; |
|
1135 |
} |
|
1136 |
||
1137 |
ChangeVkbLayout( vkbLayout ); |
|
1138 |
||
1139 |
// Synchronize case if needed |
|
1140 |
if ( ( curRange == ERangeEnglish ) || ( curRange == ERangeAccent ) |
|
1141 |
|| ( ConfigInfo()->CaseSensitive() && ( curRange == ERangeNative ) ) ) |
|
1142 |
{ |
|
1143 |
// Notify fep the new case |
|
1144 |
TBuf<KIntLengthForByte> buf; |
|
1145 |
TInt fepcase = CPeninputDataConverter::FepCaseByCaseId( caseid ); |
|
1146 |
iLayoutContext->SetData( EPeninputDataTypeCase, &fepcase ); |
|
1147 |
CPeninputDataConverter::IntToDesc( fepcase, buf ); |
|
1148 |
iLayoutContext->Sendkey( ESignalCaseMode, buf ); |
|
1149 |
} |
|
1150 |
} |
|
1151 |
||
1152 |
// --------------------------------------------------------------------------- |
|
1153 |
// CPeninputLayoutWindowExt::HandleCapslockBtnClicked |
|
1154 |
// (other items were commented in a header) |
|
1155 |
// --------------------------------------------------------------------------- |
|
1156 |
// |
|
1157 |
EXPORT_C void CPeninputLayoutWindowExt::HandleCapslockBtnClicked() |
|
1158 |
{ |
|
1159 |
TInt curRange = CPeninputDataConverter::AnyToInt |
|
1160 |
( iLayoutContext->RequestData( EPeninputDataTypeCurrentRange ) ); |
|
1161 |
||
1162 |
TInt capslockStatus = CPeninputDataConverter::AnyToInt |
|
1163 |
( iLayoutContext->RequestData( EPeninputDataTypeCapslockDown ) ); |
|
1164 |
TInt shiftStatus = CPeninputDataConverter::AnyToInt |
|
1165 |
( iLayoutContext->RequestData( EPeninputDataTypeShiftDown ) ); |
|
1166 |
||
1167 |
if ( iLayoutContext->IsShiftPermitted() ) |
|
1168 |
{ |
|
1169 |
if ( curRange == ERangeEnglish || curRange == ERangeAccent || |
|
1170 |
( ConfigInfo()->CaseSensitive() && curRange == ERangeNative ) ) |
|
1171 |
{ |
|
1172 |
shiftStatus = !shiftStatus; |
|
1173 |
ChangeMergedButtonStatus( shiftStatus, capslockStatus ); |
|
1174 |
iLayoutContext->SetData( EPeninputDataTypeShiftDown, &shiftStatus ); |
|
1175 |
} |
|
1176 |
} |
|
1177 |
else |
|
1178 |
{ |
|
1179 |
if ( iLayoutContext->IsCapsLockPermitted() ) |
|
1180 |
{ |
|
1181 |
capslockStatus = !capslockStatus; |
|
1182 |
ChangeMergedButtonStatus( shiftStatus, capslockStatus ); |
|
1183 |
iLayoutContext->SetData( EPeninputDataTypeCapslockDown, &capslockStatus ); |
|
1184 |
} |
|
1185 |
} |
|
1186 |
||
1187 |
// Update vkb layout |
|
1188 |
TInt caseid = CaseByShiftCapslockStatus(); |
|
1189 |
TInt vkbLayout = iConfigInfo->ShiftCapsSingleVkbLayoutId( curRange, |
|
1190 |
caseid ); |
|
1191 |
||
1192 |
TInt responseStyle = |
|
1193 |
iConfigInfo->RangeBarInfo()->FindRange( curRange )->ResponseStyle(); |
|
1194 |
if ( ( curRange == ERangeAccent ) |
|
1195 |
&& ( responseStyle == EPeninputRangeResponsePopupChoiceItem ) ) |
|
1196 |
{ |
|
1197 |
TInt curAccentIndex = CPeninputDataConverter::AnyToInt |
|
1198 |
( iLayoutContext->RequestData( EPeninputDataTypeCurrentAccent ) ); |
|
1199 |
vkbLayout = vkbLayout + curAccentIndex * 2; |
|
1200 |
} |
|
1201 |
||
1202 |
ChangeVkbLayout( vkbLayout ); |
|
1203 |
||
1204 |
// Synchronize case if needed |
|
1205 |
if ( ( curRange == ERangeEnglish ) || ( curRange == ERangeAccent ) |
|
1206 |
|| ( ConfigInfo()->CaseSensitive() && ( curRange == ERangeNative ) ) ) |
|
1207 |
{ |
|
1208 |
// Notify fep the new case |
|
1209 |
TBuf<KIntLengthForByte> buf; |
|
1210 |
TInt fepcase = CPeninputDataConverter::FepCaseByCaseId( caseid ); |
|
1211 |
iLayoutContext->SetData( EPeninputDataTypeCase, &fepcase ); |
|
1212 |
CPeninputDataConverter::IntToDesc( fepcase, buf ); |
|
1213 |
iLayoutContext->Sendkey( ESignalCaseMode, buf ); |
|
1214 |
} |
|
1215 |
} |
|
1216 |
||
1217 |
EXPORT_C void CPeninputLayoutWindowExt::HandleShiftAndCapslockBtnClicked() |
|
1218 |
{ |
|
1219 |
TInt curRange = CPeninputDataConverter::AnyToInt |
|
1220 |
( iLayoutContext->RequestData( EPeninputDataTypeCurrentRange ) ); |
|
1221 |
||
1222 |
TInt shiftStatus = CPeninputDataConverter::AnyToInt |
|
1223 |
( iLayoutContext->RequestData( EPeninputDataTypeShiftDown ) ); |
|
1224 |
TInt capslockStatus = CPeninputDataConverter::AnyToInt |
|
1225 |
( iLayoutContext->RequestData( EPeninputDataTypeCapslockDown ) ); |
|
1226 |
TInt languageStatus = CPeninputDataConverter::AnyToInt |
|
1227 |
( iLayoutContext->RequestData( EPeninputDataTypeInputLanguage )); |
|
1228 |
TInt permittedRange = CPeninputDataConverter::AnyToInt |
|
1229 |
( iLayoutContext->RequestData( EPeninputDataTypePermittedRange )); |
|
1230 |
||
1231 |
if ( shiftStatus ) |
|
1232 |
{ |
|
1233 |
shiftStatus = 0; |
|
1234 |
} |
|
1235 |
else |
|
1236 |
{ |
|
1237 |
shiftStatus = 1; |
|
1238 |
} |
|
1239 |
||
1240 |
// Update data |
|
1241 |
iLayoutContext->SetData( EPeninputDataTypeShiftDown, &shiftStatus ); |
|
1242 |
||
1243 |
if ( iLayoutContext->IsCapsLockPermitted() ) |
|
1244 |
{ |
|
1245 |
if ( curRange == ERangeEnglish || curRange == ERangeAccent |
|
1246 |
|| ( ConfigInfo()->CaseSensitive() && curRange == ERangeNative ) ) |
|
1247 |
{ |
|
1248 |
capslockStatus = !capslockStatus; |
|
1249 |
ChangeMergedButtonStatus( shiftStatus, capslockStatus ); |
|
1250 |
iLayoutContext->SetData( EPeninputDataTypeCapslockDown, &capslockStatus ); |
|
1251 |
} |
|
1252 |
} |
|
1253 |
else |
|
1254 |
{ |
|
1255 |
if ( iLayoutContext->IsShiftPermitted() ) |
|
1256 |
{ |
|
1257 |
shiftStatus = !shiftStatus; |
|
1258 |
ChangeMergedButtonStatus( shiftStatus, capslockStatus ); |
|
1259 |
iLayoutContext->SetData( EPeninputDataTypeShiftDown, &shiftStatus ); |
|
1260 |
} |
|
1261 |
} |
|
1262 |
||
1263 |
// Update vkb layout |
|
1264 |
TInt caseid = CaseByShiftCapslockStatus(); |
|
1265 |
||
1266 |
TInt vkbLayout = iConfigInfo->ShiftCapsSingleVkbLayoutId( curRange, |
|
1267 |
caseid ); |
|
1268 |
||
1269 |
TInt responseStyle = |
|
1270 |
iConfigInfo->RangeBarInfo()->FindRange( curRange )->ResponseStyle(); |
|
1271 |
if ( ( curRange == ERangeAccent ) |
|
1272 |
&& ( responseStyle == EPeninputRangeResponsePopupChoiceItem ) ) |
|
1273 |
{ |
|
1274 |
TInt curAccentIndex = CPeninputDataConverter::AnyToInt |
|
1275 |
( iLayoutContext->RequestData( EPeninputDataTypeCurrentAccent ) ); |
|
1276 |
vkbLayout = vkbLayout + curAccentIndex * 2; |
|
1277 |
} |
|
1278 |
||
1279 |
TBool bSupportNative = ( languageStatus == ELangArabic ) |
|
1280 |
|| ( languageStatus == ELangFarsi) |
|
1281 |
|| ( languageStatus == ELangUrdu ) |
|
1282 |
|| ( languageStatus == ELangThai ); |
|
1283 |
||
1284 |
// Click shift will change number between "native number" and "latin number" |
|
1285 |
if (( iLayoutContext->LayoutType() == EPluginInputModeFSQ ) |
|
1286 |
&& ( bSupportNative ) |
|
1287 |
&& (( ERangeNativeNumber == curRange ) || ( ERangeNumber == curRange ))) |
|
1288 |
{ |
|
1289 |
if (( ERangeNumber == curRange ) |
|
1290 |
&& ( permittedRange & ERangeNativeNumber )) |
|
1291 |
{ |
|
1292 |
vkbLayout = EPeninputVkbLayoutNativeNumberShift; |
|
1293 |
} |
|
1294 |
||
1295 |
if (( ERangeNativeNumber == curRange ) |
|
1296 |
&& ( permittedRange & ERangeNumber )) |
|
1297 |
{ |
|
1298 |
vkbLayout = EPeninputVkbLayoutLatinNumber; |
|
1299 |
} |
|
1300 |
} |
|
1301 |
else |
|
1302 |
{ |
|
50
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1303 |
if ( permittedRange != ERangeNumber ) |
44 | 1304 |
ChangeVkbLayout( vkbLayout ); |
1305 |
} |
|
1306 |
||
1307 |
// Synchronize case if needed |
|
1308 |
if ( ( curRange == ERangeEnglish ) || ( curRange == ERangeAccent ) |
|
1309 |
|| ( ConfigInfo()->CaseSensitive() && ( curRange == ERangeNative ) ) ) |
|
1310 |
{ |
|
1311 |
// Notify fep the new case |
|
1312 |
TBuf<KIntLengthForByte> buf; |
|
1313 |
TInt fepcase = CPeninputDataConverter::FepCaseByCaseId( caseid ); |
|
1314 |
iLayoutContext->SetData( EPeninputDataTypeCase, &fepcase ); |
|
1315 |
CPeninputDataConverter::IntToDesc( fepcase, buf ); |
|
1316 |
iLayoutContext->Sendkey( ESignalCaseMode, buf ); |
|
1317 |
} |
|
1318 |
else if ((( curRange == ERangeNumber ) || ( curRange == ERangeNativeNumber )) |
|
1319 |
&& ( iLayoutContext->LayoutType() == EPluginInputModeFSQ ) |
|
1320 |
&& ( bSupportNative )) |
|
1321 |
{ |
|
1322 |
// If support native number, change range to native number |
|
1323 |
if( curRange == ERangeNumber && ( permittedRange & ERangeNativeNumber )) |
|
1324 |
{ |
|
1325 |
ChangeRange( ERangeNativeNumber, vkbLayout ); |
|
1326 |
} |
|
1327 |
// If not support native number, set shift state back |
|
1328 |
else if (( curRange == ERangeNumber ) && !( permittedRange & ERangeNativeNumber )) |
|
1329 |
{ |
|
1330 |
TInt shiftButton = 1; |
|
1331 |
TInt capslockButton = 0; |
|
1332 |
ChangeMergedButtonStatus( shiftButton, capslockButton ); |
|
1333 |
iLayoutContext->SetData( EPeninputDataTypeShiftDown, &shiftButton ); |
|
1334 |
} |
|
1335 |
// If support latin number, change range to latin number |
|
1336 |
else if (( curRange == ERangeNativeNumber ) && ( permittedRange & ERangeNumber ) ) |
|
1337 |
{ |
|
1338 |
ChangeRange( ERangeNumber, vkbLayout ); |
|
1339 |
} |
|
1340 |
// If not support latin number, set shift state back |
|
1341 |
else if (( curRange == ERangeNativeNumber ) && !( permittedRange & ERangeNumber )) |
|
1342 |
{ |
|
1343 |
TInt shiftButton = 0; |
|
1344 |
TInt capslockButton = 0; |
|
1345 |
ChangeMergedButtonStatus( shiftButton, capslockButton ); |
|
1346 |
iLayoutContext->SetData( EPeninputDataTypeShiftDown, &shiftButton ); |
|
1347 |
} |
|
1348 |
} |
|
1349 |
else |
|
1350 |
{ |
|
1351 |
// Do nothing |
|
1352 |
} |
|
1353 |
||
1354 |
||
1355 |
} |
|
1356 |
||
1357 |
// --------------------------------------------------------------------------- |
|
1358 |
// CPeninputLayoutWindowExt::DimKeys |
|
1359 |
// (other items were commented in a header) |
|
1360 |
// --------------------------------------------------------------------------- |
|
1361 |
// |
|
1362 |
void CPeninputLayoutWindowExt::DimKeys() |
|
1363 |
{ |
|
1364 |
TRAP_IGNORE(DimKeysL()); |
|
1365 |
} |
|
1366 |
void CPeninputLayoutWindowExt::DimKeysL() |
|
1367 |
{ |
|
1368 |
CPeninputVkbCtrlExt* vkbCtrl = static_cast<CPeninputVkbCtrlExt*> |
|
1369 |
( Control( EPeninutWindowCtrlIdVkbCtrl ) ); |
|
1370 |
vkbCtrl->CancelDims(); |
|
1371 |
TInt currentRange = CPeninputDataConverter::AnyToInt |
|
1372 |
( iLayoutContext->RequestData( EPeninputDataTypeCurrentRange ) ); |
|
1373 |
TInt permitRange = CPeninputDataConverter::AnyToInt |
|
1374 |
( iLayoutContext->RequestData( EPeninputDataTypePermittedRange ) ); |
|
1375 |
TInt keyMapping = CPeninputDataConverter::AnyToInt |
|
1376 |
( iLayoutContext->RequestData( EPeninputDataTypeNumericKeymap ) ); |
|
1377 |
TInt inputLang = CPeninputDataConverter::AnyToInt |
|
1378 |
( iLayoutContext->RequestData( EPeninputDataTypeInputLanguage ) ); |
|
1379 |
||
1380 |
if ( currentRange == ERangeNumber && |
|
1381 |
(permitRange == ERangeNumber || |
|
1382 |
permitRange == ERangeNativeNumber || |
|
1383 |
permitRange == (ERangeNumber | ERangeNativeNumber)) ) |
|
1384 |
{ |
|
1385 |
HBufC* rs = NULL; |
|
1386 |
if ( keyMapping == EKeymapFromResource ) |
|
1387 |
{ |
|
1388 |
HBufC* customRes = |
|
1389 |
(HBufC*) iLayoutContext->RequestData(EAknFepDataTypeUseDefinedResource); |
|
1390 |
_LIT(KTenNumbers,"0123456789"); |
|
1391 |
rs = HBufC::NewL(KTenNumbers().Length() + customRes->Length()); |
|
1392 |
rs->Des().Copy(*customRes); |
|
1393 |
rs->Des().Append(KTenNumbers); |
|
1394 |
} |
|
1395 |
else |
|
1396 |
{ |
|
1397 |
TRAP_IGNORE( rs = iKeyMappingMgr->KeyMappingStringL( keyMapping ); ); |
|
1398 |
} |
|
1399 |
||
1400 |
if( rs ) |
|
1401 |
{ |
|
1402 |
vkbCtrl->DimKeys( rs ); |
|
1403 |
delete rs; |
|
1404 |
} |
|
1405 |
} |
|
1406 |
else if ( currentRange == ERangeNativeNumber && |
|
1407 |
(permitRange == ERangeNumber || |
|
1408 |
permitRange == ERangeNativeNumber || |
|
1409 |
permitRange == (ERangeNumber | ERangeNativeNumber)) ) |
|
1410 |
{ |
|
1411 |
HBufC* rs = NULL; |
|
1412 |
TRAP_IGNORE( rs = GetKeyMappingStringL( keyMapping, inputLang ) ); |
|
1413 |
if( rs ) |
|
1414 |
{ |
|
1415 |
vkbCtrl->DimKeys( rs ); |
|
1416 |
delete rs; |
|
1417 |
} |
|
1418 |
} |
|
1419 |
||
1420 |
else if ( (currentRange == ERangeNative || currentRange == ERangeEnglish) && CPeninputDataConverter::AnyToInt |
|
1421 |
( iLayoutContext->RequestData( EPeninputDataTypeInputLanguage ) ) == ELangVietnamese ) |
|
1422 |
{ |
|
1423 |
vkbCtrl->DimKeySet( iToneSet, !iVowelChar ); |
|
1424 |
} |
|
1425 |
||
1426 |
vkbCtrl->Draw(); |
|
1427 |
} |
|
1428 |
||
1429 |
// --------------------------------------------------------------------------- |
|
1430 |
// CPeninputLayoutWindowExt::AddControlL |
|
1431 |
// (other items were commented in a header) |
|
1432 |
// --------------------------------------------------------------------------- |
|
1433 |
// |
|
1434 |
EXPORT_C void CPeninputLayoutWindowExt::AddNotOwnedControl( |
|
1435 |
CFepUiBaseCtrl* aControl ) |
|
1436 |
{ |
|
1437 |
//do nothing if we already has the control. |
|
1438 |
if ( KErrNotFound != ControlList().Find( aControl ) ) |
|
1439 |
{ |
|
1440 |
return; |
|
1441 |
} |
|
1442 |
||
1443 |
if ( aControl ) |
|
1444 |
{ |
|
1445 |
( const_cast<RPointerArray<CFepUiBaseCtrl>&> |
|
1446 |
( ControlList() ) ).Append( aControl ); |
|
1447 |
} |
|
1448 |
} |
|
1449 |
// --------------------------------------------------------------------------- |
|
1450 |
// CPeninputLayoutWindowExt::ChangeButtonStatus |
|
1451 |
// (other items were commented in a header) |
|
1452 |
// --------------------------------------------------------------------------- |
|
1453 |
// |
|
1454 |
EXPORT_C void CPeninputLayoutWindowExt::ChangeButtonStatus( const TInt aIsDown, |
|
1455 |
const TInt aControlId ) |
|
1456 |
{ |
|
1457 |
CAknFepCtrlEventButton* button = |
|
1458 |
static_cast<CAknFepCtrlEventButton*> |
|
1459 |
(ControlById( aControlId ) ); |
|
1460 |
||
1461 |
if ( button ) |
|
1462 |
{ |
|
1463 |
button->SetHighlight( aIsDown == 0 ? EFalse : ETrue ); |
|
1464 |
} |
|
1465 |
} |
|
1466 |
||
1467 |
// --------------------------------------------------------------------------- |
|
1468 |
// CPeninputLayoutWindow::ChangeButtonStatus |
|
1469 |
// (other items were commented in a header) |
|
1470 |
// --------------------------------------------------------------------------- |
|
1471 |
// |
|
1472 |
EXPORT_C void CPeninputLayoutWindowExt::ChangeMergedButtonStatus( |
|
1473 |
const TInt aIsShiftCase, |
|
1474 |
const TInt aIsCapslockCase ) |
|
1475 |
{ |
|
1476 |
CAknFepCtrlMultiModeButton* button = |
|
1477 |
static_cast<CAknFepCtrlMultiModeButton*> |
|
1478 |
(ControlById( EPeninutWindowCtrlIdShiftBtn ) ); |
|
1479 |
||
1480 |
if( !button ) |
|
1481 |
{ |
|
1482 |
return; |
|
1483 |
} |
|
50
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1484 |
|
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1485 |
const TInt range = CPeninputDataConverter::AnyToInt( |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1486 |
iLayoutContext->RequestData(EPeninputDataTypeCurrentRange)); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1487 |
|
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1488 |
TBool shiftDown = ( aIsShiftCase > 0 ); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1489 |
|
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1490 |
if ( range == ERangeNumber || range == ERangeNativeNumber ) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1491 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1492 |
TRAP_IGNORE(HandleNumberModePagingL( shiftDown )); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1493 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1494 |
else |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1495 |
{ |
44 | 1496 |
switch ( aIsCapslockCase * 2 + aIsShiftCase ) |
1497 |
{ |
|
1498 |
case 1: // text case |
|
1499 |
{ |
|
1500 |
TRAP_IGNORE( button->SetCurrentModeL( EBtnBmpActive, 1 ) ); |
|
1501 |
button->SetHighlight( ETrue ); |
|
1502 |
} |
|
1503 |
break; |
|
1504 |
case 2: // upper case |
|
1505 |
{ |
|
1506 |
TRAP_IGNORE( button->SetCurrentModeL( EBtnBmpActive, 2 ) ); |
|
1507 |
button->SetHighlight( ETrue ); |
|
1508 |
} |
|
1509 |
break; |
|
1510 |
default: |
|
1511 |
{ |
|
1512 |
TRAP_IGNORE( button->SetCurrentModeL( EBtnBmpActive, 0 ) ); |
|
1513 |
button->SetHighlight( EFalse ); |
|
1514 |
} |
|
1515 |
break; |
|
50
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1516 |
} |
44 | 1517 |
} |
1518 |
} |
|
1519 |
// --------------------------------------------------------------------------- |
|
1520 |
// CPeninputLayoutWindowExt::ChangeLayoutPosition |
|
1521 |
// (other items were commented in a header) |
|
1522 |
// --------------------------------------------------------------------------- |
|
1523 |
// |
|
1524 |
EXPORT_C void CPeninputLayoutWindowExt::ChangeLayoutPosition( TInt aJustifyStyle ) |
|
1525 |
{ |
|
1526 |
if ( iLayoutContext->LayoutType() == EPluginInputModeFSQ ) |
|
1527 |
{ |
|
1528 |
TopLeftJustify(); |
|
1529 |
return; |
|
1530 |
} |
|
1531 |
switch ( aJustifyStyle ) |
|
1532 |
{ |
|
1533 |
case EPeninputPositionChangeBrJustify: |
|
1534 |
{ |
|
1535 |
BottomRightJustify(); |
|
1536 |
} |
|
1537 |
break; |
|
1538 |
case EPeninputPositionChangeDataQuery: |
|
1539 |
{ |
|
1540 |
//BottomRightJustify(); |
|
1541 |
DataQueryJustify(); |
|
1542 |
} |
|
1543 |
break; |
|
1544 |
default: |
|
1545 |
{ |
|
1546 |
TopLeftJustify(); |
|
1547 |
} |
|
1548 |
break; |
|
1549 |
} |
|
1550 |
} |
|
1551 |
||
1552 |
// --------------------------------------------------------------------------- |
|
1553 |
// CPeninputLayoutWindowExt::SetWindowRect |
|
1554 |
// (other items were commented in a header) |
|
1555 |
// --------------------------------------------------------------------------- |
|
1556 |
// |
|
1557 |
EXPORT_C void CPeninputLayoutWindowExt::SetWindowRect( const TRect& aRect ) |
|
1558 |
{ |
|
1559 |
//we should know the layout size now |
|
1560 |
if(iLayoutContext->LayoutType() == EPluginInputModeFSQ) |
|
1561 |
{ |
|
1562 |
SetRect( aRect ); |
|
1563 |
UiLayout()->SetRect(aRect); |
|
1564 |
} |
|
1565 |
else |
|
1566 |
{ |
|
1567 |
TRect rect = aRect; |
|
1568 |
||
1569 |
||
1570 |
TRect shadowRect = TRect( TPoint(), |
|
1571 |
TSize( aRect.Width() + iShadowBrWidth + iShadowTlWidth, |
|
1572 |
aRect.Height() + iShadowTlHeight + iShadowBrHeight) |
|
1573 |
); |
|
1574 |
||
1575 |
rect.Move( TPoint(iShadowTlWidth, iShadowTlHeight) - rect.iTl ); |
|
1576 |
||
1577 |
SetRect( rect ); |
|
1578 |
RootControl()->SetRect( rect ); |
|
1579 |
UiLayout()->SetShadowRect( shadowRect ); |
|
1580 |
} |
|
1581 |
} |
|
1582 |
||
1583 |
||
1584 |
// ----------------------------------------------------------------------------- |
|
1585 |
// CPeninputLayoutWindowExt::SetSwitchBtnFont |
|
1586 |
// (other items were commented in a header). |
|
1587 |
// ----------------------------------------------------------------------------- |
|
1588 |
// |
|
1589 |
EXPORT_C void CPeninputLayoutWindowExt::SetSwitchBtnFont(CAknFepCtrlEventButton& aSwitchBtn) |
|
1590 |
{ |
|
1591 |
// read switch font laf info only when need |
|
1592 |
if (CPeninputDataConverter::AnyToInt( |
|
1593 |
iLayoutContext->RequestData(EAkninputDataTypeSizeChanging)) ||(!iSwitchFontSet)) |
|
1594 |
{ |
|
1595 |
TAknTextLineLayout langSwitch; |
|
1596 |
TAknTextLineLayout langSwitchShadow; |
|
1597 |
||
1598 |
switch( iLayoutContext->LayoutType() ) |
|
1599 |
{ |
|
1600 |
case EPluginInputModeVkb: |
|
1601 |
case EPluginInputModeFSQ: |
|
1602 |
{ |
|
1603 |
langSwitch = |
|
1604 |
AknLayoutScalable_Avkon::cell_vkb_side_pane_t1().LayoutLine(); |
|
1605 |
langSwitchShadow = |
|
1606 |
AknLayoutScalable_Avkon::cell_vkb_side_pane_t1_copy1().LayoutLine(); |
|
1607 |
} |
|
1608 |
break; |
|
1609 |
case EPluginInputModeHwr: |
|
1610 |
{ |
|
1611 |
langSwitch = |
|
1612 |
AknLayoutScalable_Avkon::cell_hwr_side_pane_t1().LayoutLine(); |
|
1613 |
langSwitchShadow = |
|
1614 |
AknLayoutScalable_Avkon::cell_hwr_side_pane_t1_copy1().LayoutLine(); |
|
1615 |
} |
|
1616 |
break; |
|
1617 |
default: |
|
1618 |
{ |
|
1619 |
return; |
|
1620 |
} |
|
1621 |
} |
|
1622 |
||
1623 |
iSwitchFont = langSwitch.iFont; |
|
1624 |
iSwitchShadowFont = langSwitchShadow.iFont; |
|
1625 |
} |
|
1626 |
||
1627 |
aSwitchBtn.SetFont(AknLayoutUtils::FontFromId(iSwitchFont, NULL)); |
|
1628 |
aSwitchBtn.SetShadowFont(AknLayoutUtils::FontFromId(iSwitchShadowFont, NULL)); |
|
1629 |
iSwitchFontSet = ETrue; |
|
1630 |
} |
|
1631 |
||
1632 |
// --------------------------------------------------------------------------- |
|
1633 |
// CPeninputLayoutWindowExt::TopLeftJustify |
|
1634 |
// (other items were commented in a header) |
|
1635 |
// --------------------------------------------------------------------------- |
|
1636 |
// |
|
1637 |
EXPORT_C void CPeninputLayoutWindowExt::SetSwitchBtnTextColor(CAknFepCtrlEventButton& aSwitchBtn) |
|
1638 |
{ |
|
1639 |
TRgb textColor; |
|
1640 |
TInt error = AknsUtils::GetCachedColor(UiLayout()->SkinInstance(), |
|
1641 |
textColor, |
|
1642 |
KAknsIIDQsnTextColors, |
|
1643 |
EAknsCIQsnTextColorsCG59); |
|
1644 |
||
1645 |
if (error != KErrNone) |
|
1646 |
{ |
|
1647 |
textColor = TRgb(KDefaultTextColor); |
|
1648 |
} |
|
1649 |
||
1650 |
aSwitchBtn.SetFontColor( textColor ); |
|
1651 |
||
1652 |
TRgb shadowTextColor; |
|
1653 |
error = AknsUtils::GetCachedColor(UiLayout()->SkinInstance(), |
|
1654 |
shadowTextColor, |
|
1655 |
KAknsIIDQsnTextColors, |
|
1656 |
EAknsCIQsnTextColorsCG62); |
|
1657 |
||
1658 |
if (error != KErrNone) |
|
1659 |
{ |
|
1660 |
shadowTextColor = TRgb(KDefaultShadowTextColor); |
|
1661 |
} |
|
1662 |
||
1663 |
aSwitchBtn.SetShadowFontColor( shadowTextColor ); |
|
1664 |
} |
|
1665 |
||
1666 |
// --------------------------------------------------------------------------- |
|
1667 |
// CPeninputLayoutWindowExt::TopLeftJustify |
|
1668 |
// (other items were commented in a header) |
|
1669 |
// --------------------------------------------------------------------------- |
|
1670 |
// |
|
1671 |
void CPeninputLayoutWindowExt::TopLeftJustify() |
|
1672 |
{ |
|
1673 |
// Read position from datamgr |
|
1674 |
TSize layoutSize = UiLayout()->Rect().Size(); |
|
1675 |
||
1676 |
TPoint tl = UiLayout()->Position(); |
|
1677 |
||
1678 |
TPoint oldBr = tl + layoutSize; |
|
1679 |
||
1680 |
if ( tl.iX < 0 ) |
|
1681 |
{ |
|
1682 |
tl.iX = 0; |
|
1683 |
} |
|
1684 |
||
1685 |
if ( tl.iY < 0 ) |
|
1686 |
{ |
|
1687 |
tl.iY = 0; |
|
1688 |
} |
|
1689 |
||
1690 |
TPoint br = tl + layoutSize; |
|
1691 |
||
1692 |
if ( br != oldBr ) |
|
1693 |
{ |
|
1694 |
//Write the new position into CenRep |
|
1695 |
TInt x = 0; |
|
1696 |
TInt y = 0; |
|
1697 |
x = 0x0000FFFF & br.iX; |
|
1698 |
y = 0xFFFF0000 & ( br.iY << 16 ); |
|
1699 |
TInt pos = x | y; |
|
1700 |
iLayoutContext->SetData( EPeninputDataTypeWindowPosition, &pos ); |
|
1701 |
} |
|
1702 |
||
1703 |
UiLayout()->LayoutOwner()->SetPosition( tl ); |
|
1704 |
} |
|
1705 |
||
1706 |
// --------------------------------------------------------------------------- |
|
1707 |
// CPeninputLayoutWindowExt::BottomRightJustify |
|
1708 |
// (other items were commented in a header). |
|
1709 |
// --------------------------------------------------------------------------- |
|
1710 |
// |
|
1711 |
void CPeninputLayoutWindowExt::BottomRightJustify() |
|
1712 |
{ |
|
1713 |
// Read position from datamgr |
|
1714 |
TSize layoutSize( UiLayout()->Rect().Size() ); |
|
1715 |
||
1716 |
TPoint oldbr; |
|
1717 |
TPoint br; |
|
1718 |
TPoint tl; |
|
1719 |
||
1720 |
TSize screenSize = *( ( TSize* ) iLayoutContext->RequestData |
|
1721 |
( EPeninputDataTypeScreenSize ) ); |
|
1722 |
||
1723 |
TInt windowPosition = CPeninputDataConverter::AnyToInt |
|
1724 |
( iLayoutContext->RequestData( EPeninputDataTypeWindowPosition ) ); |
|
1725 |
||
1726 |
oldbr.iX = windowPosition & 0x0000FFFF; |
|
1727 |
oldbr.iY = ( windowPosition & 0xFFFF0000 ) >> 16; |
|
1728 |
||
1729 |
br = oldbr; |
|
1730 |
||
1731 |
// Check the top left point is in screen |
|
1732 |
if (br.iX > screenSize.iWidth) |
|
1733 |
{ |
|
1734 |
br.iX = screenSize.iWidth; |
|
1735 |
} |
|
1736 |
if( br.iY > screenSize.iHeight ) |
|
1737 |
{ |
|
1738 |
br.iY = screenSize.iHeight; |
|
1739 |
} |
|
1740 |
||
1741 |
tl.iX = br.iX - layoutSize.iWidth; |
|
1742 |
tl.iY = br.iY - layoutSize.iHeight; |
|
1743 |
||
1744 |
if ( tl.iX < 0 ) |
|
1745 |
{ |
|
1746 |
tl.iX = 0; |
|
1747 |
br.iX = layoutSize.iWidth; |
|
1748 |
} |
|
1749 |
||
1750 |
if ( tl.iY < 0 ) |
|
1751 |
{ |
|
1752 |
tl.iY = 0; |
|
1753 |
br.iY = layoutSize.iHeight; |
|
1754 |
} |
|
1755 |
||
1756 |
if ( oldbr != br ) |
|
1757 |
{ |
|
1758 |
//Write the new position into CenRep |
|
1759 |
TInt x = 0; |
|
1760 |
TInt y = 0; |
|
1761 |
x = 0x0000FFFF & br.iX; |
|
1762 |
y = 0xFFFF0000 & ( br.iY << 16 ); |
|
1763 |
TInt pos = x | y; |
|
1764 |
iLayoutContext->SetData( EPeninputDataTypeWindowPosition, &pos ); |
|
1765 |
} |
|
1766 |
||
1767 |
UiLayout()->LayoutOwner()->SetPosition( tl ); |
|
1768 |
} |
|
1769 |
||
1770 |
// --------------------------------------------------------------------------- |
|
1771 |
// CPeninputLayoutWindowExt::DataQueryJustify |
|
1772 |
// (other items were commented in a header) |
|
1773 |
// --------------------------------------------------------------------------- |
|
1774 |
// |
|
1775 |
void CPeninputLayoutWindowExt::DataQueryJustify() |
|
1776 |
{ |
|
1777 |
TRect* dataQueryRect = ( TRect* )( iLayoutContext->RequestData |
|
1778 |
( EPeninputDataTypeDataQueryDlgRect) ); |
|
1779 |
||
1780 |
TRect rect = TRect( UiLayout()->Position(), UiLayout()->Rect().Size() ); |
|
1781 |
||
1782 |
CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
1783 |
TPixelsTwipsAndRotation ptSize; |
|
1784 |
coeEnv->ScreenDevice()->GetDefaultScreenSizeAndRotation(ptSize); |
|
1785 |
||
1786 |
// Landscape mode: move window to the br of the screen |
|
1787 |
if (ptSize.iPixelSize.iWidth > ptSize.iPixelSize.iHeight) |
|
1788 |
{ |
|
1789 |
rect.SetRect(ptSize.iPixelSize.iWidth - rect.Width(), |
|
1790 |
ptSize.iPixelSize.iHeight/2 - rect.Height()/2, |
|
1791 |
ptSize.iPixelSize.iWidth, |
|
1792 |
ptSize.iPixelSize.iHeight/2 + rect.Height()/2); |
|
1793 |
} |
|
1794 |
// Portrait mode: dodge the dataquery |
|
1795 |
else if ( rect.Intersects( *dataQueryRect ) ) |
|
1796 |
{ |
|
1797 |
TInt Y = dataQueryRect->iTl.iY; |
|
1798 |
TInt height = rect.iBr.iY - rect.iTl.iY; |
|
1799 |
rect.iTl.iY = Y - height; |
|
1800 |
rect.iBr.iY = Y; |
|
1801 |
||
1802 |
if( rect.iTl.iY <0 ) |
|
1803 |
{ |
|
1804 |
rect.iTl.iY = 0; |
|
1805 |
rect.iBr.iY = height; |
|
1806 |
} |
|
1807 |
} |
|
1808 |
||
1809 |
//Write the new position into CenRep |
|
1810 |
TInt x = 0; |
|
1811 |
TInt y = 0; |
|
1812 |
x = 0x0000FFFF & rect.iBr.iX; |
|
1813 |
y = 0xFFFF0000 & ( rect.iBr.iY << 16 ); |
|
1814 |
TInt pos = x | y; |
|
1815 |
iLayoutContext->SetData( EPeninputDataTypeWindowPosition, &pos ); |
|
1816 |
||
1817 |
//Set the layout position |
|
1818 |
UiLayout()->LayoutOwner()->SetPosition( rect.iTl ); |
|
1819 |
} |
|
1820 |
||
1821 |
TBool CPeninputLayoutWindowExt::CreateCustomControlL( TInt16 /*aControlId*/, TInt32 /*aImageId*/ ) |
|
1822 |
{ |
|
1823 |
return EFalse; |
|
1824 |
} |
|
1825 |
||
1826 |
// --------------------------------------------------------------------------- |
|
1827 |
// CPeninputLayoutWindowExt::Draw |
|
1828 |
// (other items were commented in a header) |
|
1829 |
// --------------------------------------------------------------------------- |
|
1830 |
// |
|
1831 |
EXPORT_C void CPeninputLayoutWindowExt::Draw() |
|
1832 |
{ |
|
1833 |
// Draw shadow |
|
1834 |
CAknFepCtrlBaseWindowExt::Draw(); |
|
1835 |
UpdateArea(UiLayout()->Rect(), EFalse); |
|
1836 |
} |
|
1837 |
||
1838 |
// --------------------------------------------------------------------------- |
|
1839 |
// CPeninputLayoutWindowExt::GetKeyMappingStringL |
|
1840 |
// (other items were commented in a header) |
|
1841 |
// --------------------------------------------------------------------------- |
|
1842 |
// |
|
1843 |
HBufC* CPeninputLayoutWindowExt::GetKeyMappingStringL(TInt aKeyMapping, |
|
1844 |
const TInt aLang ) |
|
1845 |
{ |
|
1846 |
HBufC* rs = NULL; |
|
1847 |
if ( aKeyMapping == EKeymapFromResource ) |
|
1848 |
{ |
|
1849 |
HBufC* customRes = (HBufC*) iLayoutContext->RequestData(EAknFepDataTypeUseDefinedResource); |
|
1850 |
_LIT(KTenNumbers,"0123456789"); |
|
1851 |
TBuf<KMaxNumericString> numbers; |
|
1852 |
if( aLang == ELangArabic ) |
|
1853 |
{ |
|
1854 |
numbers.Format( _L("%c%c%c%c%c%c%c%c%c%c"), |
|
1855 |
0x0660, 0x0661, 0x0662, |
|
1856 |
0x0663, 0x0664, 0x0665, |
|
1857 |
0x0666, 0x0667, 0x0668, 0x0669 ); |
|
1858 |
} |
|
1859 |
else if( aLang == ELangUrdu || aLang == ELangFarsi ) |
|
1860 |
{ |
|
1861 |
numbers.Format( _L("%c%c%c%c%c%c%c%c%c%c"), |
|
1862 |
0x06F0, 0x06F1, 0x06F2, |
|
1863 |
0x06F3, 0x06F4, 0x06F5, |
|
1864 |
0x06F6, 0x06F7, 0x06F8, 0x06F9 ); |
|
1865 |
} |
|
1866 |
else if( aLang == ELangHindi ) |
|
1867 |
{ |
|
1868 |
numbers.Format( _L("%c%c%c%c%c%c%c%c%c%c"), |
|
1869 |
0x0966, 0x0967, 0x0968, |
|
1870 |
0x0969, 0x096a, 0x096b, |
|
1871 |
0x096c, 0x096d, 0x096e, 0x096f ); |
|
1872 |
} |
|
1873 |
else if( aLang == ELangThai ) |
|
1874 |
{ |
|
1875 |
numbers.Format( _L("%c%c%c%c%c%c%c%c%c%c"), |
|
1876 |
0x0E50, 0x0E51, 0x0E52, |
|
1877 |
0x0E53, 0x0E54, 0x0E55, |
|
1878 |
0x0E56, 0x0E57, 0x0E58, 0x0E59 ); |
|
1879 |
} |
|
1880 |
else |
|
1881 |
{ |
|
1882 |
numbers = KTenNumbers; |
|
1883 |
} |
|
1884 |
||
1885 |
rs = HBufC::NewL(numbers.Length() + customRes->Length()); |
|
1886 |
rs->Des().Copy(*customRes); |
|
1887 |
rs->Des().Append(numbers); |
|
1888 |
} |
|
1889 |
else |
|
1890 |
{ |
|
1891 |
rs = iKeyMappingMgr->KeyMappingStringL( aKeyMapping, aLang ); |
|
1892 |
} |
|
1893 |
||
1894 |
return rs; |
|
1895 |
} |
|
1896 |
||
1897 |
// --------------------------------------------------------------------------- |
|
1898 |
// CPeninputLayoutWindowExt::SetEnableSwitchToHwr |
|
1899 |
// (other items were commented in a header) |
|
1900 |
// --------------------------------------------------------------------------- |
|
1901 |
// |
|
1902 |
EXPORT_C void CPeninputLayoutWindowExt::SetEnableSwitchToHwr(TBool aEnable) |
|
1903 |
{ |
|
1904 |
CAknFepCtrlEventButton* switchToHwrBtn = static_cast<CAknFepCtrlEventButton*> |
|
1905 |
( Control( EPeninutWindowCtrlIdSwitchToHwrBtn ) ); |
|
1906 |
||
1907 |
if ( aEnable ) |
|
1908 |
{ |
|
1909 |
switchToHwrBtn->SetDimmed(EFalse); |
|
1910 |
} |
|
1911 |
else |
|
1912 |
{ |
|
1913 |
switchToHwrBtn->SetDimmed(ETrue); |
|
1914 |
switchToHwrBtn->SetActive(EFalse); |
|
1915 |
} |
|
1916 |
} |
|
1917 |
||
1918 |
// --------------------------------------------------------------------------- |
|
1919 |
// CPeninputLayoutWindowExt::SetEnableSettingBtn |
|
1920 |
// (other items were commented in a header) |
|
1921 |
// --------------------------------------------------------------------------- |
|
1922 |
// |
|
1923 |
EXPORT_C void CPeninputLayoutWindowExt::SetEnableSettingBtn(TBool aEnable) |
|
1924 |
{ |
|
1925 |
CAknFepCtrlEventButton* optionBtn = static_cast<CAknFepCtrlEventButton*> |
|
1926 |
(Control( EPeninutWindowCtrlIdOptionBtn ) ); |
|
1927 |
||
1928 |
if ( aEnable ) |
|
1929 |
{ |
|
1930 |
optionBtn->SetDimmed(EFalse); |
|
1931 |
} |
|
1932 |
else |
|
1933 |
{ |
|
1934 |
optionBtn->SetDimmed(ETrue); |
|
1935 |
optionBtn->SetActive(EFalse); |
|
1936 |
} |
|
1937 |
} |
|
1938 |
||
1939 |
// --------------------------------------------------------------------------- |
|
1940 |
// CPeninputLayoutWindowExt::ReconfigUnitSize |
|
1941 |
// (other items were commented in a header) |
|
1942 |
// --------------------------------------------------------------------------- |
|
1943 |
// |
|
1944 |
EXPORT_C TBool CPeninputLayoutWindowExt::ReconfigUnitSize(TInt /*aClientLayoutId*/) |
|
1945 |
{ |
|
1946 |
return EFalse; |
|
1947 |
} |
|
1948 |
||
1949 |
EXPORT_C void CPeninputLayoutWindowExt::SetLafLayOut(TInt /*aRows*/, TInt /*aColumns*/) |
|
1950 |
{ |
|
1951 |
||
1952 |
} |
|
1953 |
||
1954 |
EXPORT_C void CPeninputLayoutWindowExt::SetVkbLayoutSize() |
|
1955 |
{ |
|
1956 |
||
1957 |
} |
|
1958 |
EXPORT_C void CPeninputLayoutWindowExt::OnInputLanguageChange() |
|
1959 |
{ |
|
1960 |
if ( iLayoutContext->LayoutType() == EPluginInputModeVkb ) |
|
1961 |
{ |
|
1962 |
CFepUiBaseCtrl* ctrl = |
|
1963 |
Control( EPeninutWindowCtrlIdVkbCtrl ); |
|
1964 |
if ( ctrl ) |
|
1965 |
{ |
|
1966 |
( static_cast<CPeninputVkbCtrlExt*>( ctrl ) )->Reset(); |
|
1967 |
} |
|
1968 |
} |
|
1969 |
} |
|
1970 |
||
1971 |
void CPeninputLayoutWindowExt::AddCustomControlGroupL(CFepUiBaseCtrl* aCtrl) |
|
1972 |
{ |
|
1973 |
AddControlL(aCtrl); |
|
1974 |
} |
|
1975 |
||
1976 |
void CPeninputLayoutWindowExt::ResetLastColRow() |
|
1977 |
{ |
|
1978 |
iLastUsedTotalColumns = 0; |
|
1979 |
iLastUsedTotalRows = 0; |
|
1980 |
} |
|
1981 |
||
1982 |
||
1983 |
EXPORT_C void CPeninputLayoutWindowExt::SetTextAlignmentL( TInt aAlignment ) |
|
1984 |
{ |
|
1985 |
CFepLayoutMultiLineIcf* icf = |
|
1986 |
static_cast<CFepLayoutMultiLineIcf*>( Control(EPeninputWindowCtrlIdMultiLineICF)); |
|
1987 |
||
1988 |
if ( icf && ConfigInfo()->Language() != ELangNone ) |
|
1989 |
{ |
|
1990 |
icf->SetTextAlignmentL( aAlignment, ConfigInfo()->Language() ); |
|
1991 |
} |
|
1992 |
} |
|
50
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1993 |
|
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1994 |
// ------------------------------------------------ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1995 |
// CPeninputLayoutWindowExt::CurrentNumberModeId |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1996 |
// ------------------------------------------------ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1997 |
TInt CPeninputLayoutWindowExt::CurrentNumberModeId(TBool aShifted, |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1998 |
TInt aLanguage, TBool aPagingPermitted) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1999 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2000 |
TInt ret = 0; |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2001 |
if (aPagingPermitted) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2002 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2003 |
if (aLanguage == ELangArabic || aLanguage == ELangFarsi || aLanguage |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2004 |
== ELangUrdu) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2005 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2006 |
if (aShifted) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2007 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2008 |
ret = ECaseNumberSpecialPagingArabic22; |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2009 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2010 |
else |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2011 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2012 |
ret = ECaseNumberSpecialPagingArabic12; |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2013 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2014 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2015 |
else if (aLanguage == ELangThai) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2016 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2017 |
if (aShifted) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2018 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2019 |
ret = ECaseNumberSpecialPaging12; |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2020 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2021 |
else |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2022 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2023 |
ret = ECaseNumberSpecialPaging22; |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2024 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2025 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2026 |
else |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2027 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2028 |
if ( aShifted ) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2029 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2030 |
ret = ECaseNumberSpecialPaging22; |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2031 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2032 |
else |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2033 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2034 |
ret = ECaseNumberSpecialPaging12; |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2035 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2036 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2037 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2038 |
else |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2039 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2040 |
if (aLanguage == ELangArabic || aLanguage == ELangFarsi || aLanguage |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2041 |
== ELangUrdu) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2042 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2043 |
ret = ECaseNumberSpecialPagingArabic11; |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2044 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2045 |
else |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2046 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2047 |
ret = ECaseNumberSpecialPaging11; |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2048 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2049 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2050 |
return ret; |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2051 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2052 |
|
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2053 |
void CPeninputLayoutWindowExt::HandleNumberModePagingL( TBool aShifted ) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2054 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2055 |
CAknFepCtrlMultiModeButton* button = static_cast<CAknFepCtrlMultiModeButton*> (ControlById( EPeninutWindowCtrlIdShiftBtn ) ); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2056 |
|
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2057 |
if ( !button ) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2058 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2059 |
return; |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2060 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2061 |
|
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2062 |
const TInt lang = CPeninputDataConverter::AnyToInt( iLayoutContext->RequestData( EPeninputDataTypeInputLanguage ) ); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2063 |
TInt permittedRange = CPeninputDataConverter::AnyToInt |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2064 |
( iLayoutContext->RequestData( EPeninputDataTypePermittedRange )); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2065 |
TBool isPagingPermitted = EFalse; |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2066 |
if ( permittedRange == ERangeNumber || permittedRange == ERangeNativeNumber ) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2067 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2068 |
//if latin number only or native number only is permitted do not allow paging |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2069 |
isPagingPermitted = EFalse; |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2070 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2071 |
else |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2072 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2073 |
isPagingPermitted = !button->IsDimmed(); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2074 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2075 |
|
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2076 |
TInt modeId = CurrentNumberModeId( aShifted, lang, isPagingPermitted ); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2077 |
TInt index = button ->ModeIndexByModeId( modeId ); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2078 |
|
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2079 |
button->SetCurrentModeL( EBtnBmpActive, index ); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2080 |
button->SetHighlight( EFalse ); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
2081 |
} |
44 | 2082 |
//End Of File |