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 framework |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // System includes |
|
20 #include <aknfeppeninputenums.h> // Command from fep or IME to plugin |
|
21 #include <AknFepGlobalEnums.h> // Define EPluginInputModeHwr |
|
22 #include <peninputcmd.h> // Use global signal |
|
23 #include <peninputlayoutchoicelist.h> |
|
24 #include <peninputlayoutbutton.h> |
|
25 #include <peninputdragbutton.h> |
|
26 #include <coemain.h> |
|
27 |
|
28 // User includes |
|
29 #include "peninputuistatebase.h" |
|
30 #include "peninputdataconverter.h" |
|
31 #include "peninputcommonlayoutext.h" |
|
32 #include "peninputlayoutwindowext.h" |
|
33 #include "peninputdatamgr.h" |
|
34 #include "peninputuistatemgr.h" |
|
35 #include "peninputrangebarinfo.h" |
|
36 |
|
37 // Constants |
|
38 const TInt KPeninputCommonLayoutBufLen = 8; |
|
39 const TInt KIntSizeToInt16 = 2; |
|
40 |
|
41 // ======== MEMBER FUNCTIONS ======== |
|
42 |
|
43 // --------------------------------------------------------------------------- |
|
44 // CPeninputCommonLayoutExt::CPeninputCommonLayoutExt |
|
45 // (other items were commented in a header) |
|
46 // --------------------------------------------------------------------------- |
|
47 // |
|
48 EXPORT_C CPeninputCommonLayoutExt::CPeninputCommonLayoutExt( MLayoutOwner* aLayoutOwner ) |
|
49 : CFepUiLayout( aLayoutOwner ) |
|
50 { |
|
51 } |
|
52 |
|
53 // --------------------------------------------------------------------------- |
|
54 // CPeninputCommonLayoutExt::ConstructL |
|
55 // (other items were commented in a header) |
|
56 // --------------------------------------------------------------------------- |
|
57 // |
|
58 EXPORT_C void CPeninputCommonLayoutExt::ConstructL( const TAny* aInitData ) |
|
59 { |
|
60 BaseConstructL(); |
|
61 |
|
62 TPixelsTwipsAndRotation ptSize; |
|
63 |
|
64 CCoeEnv::Static()->ScreenDevice()->GetDefaultScreenSizeAndRotation( ptSize ); |
|
65 |
|
66 SetScreenSize(ptSize.iPixelSize); |
|
67 |
|
68 // This method must be called first, because it will initialize |
|
69 // language from CenRep |
|
70 CreateDataMgrL(aInitData); |
|
71 |
|
72 TBool sizeChanging = ETrue; |
|
73 if ( iDataMgr ) |
|
74 { |
|
75 // Store screen mode, and get new window position |
|
76 iDataMgr->SetData( EPeninputDataTypeScreenMode, ( TAny* ) &ptSize ); |
|
77 |
|
78 // Store justify style |
|
79 iDataMgr->SetData(EAkninputDataTypeSizeChanging, &sizeChanging); |
|
80 } |
|
81 |
|
82 iUiStateMgr = CPeninputUiStateMgr::NewL( this ); |
|
83 |
|
84 CreateLayoutWindowL(); |
|
85 |
|
86 if ( iLayoutWindow ) |
|
87 { |
|
88 iLayoutWindow->Hide(ETrue); |
|
89 AddControlL( iLayoutWindow ); |
|
90 |
|
91 // Config layout self using the whole screen |
|
92 //SetRect(TRect(TPoint(0, 0), ptSize.iPixelSize )); |
|
93 |
|
94 // Call the function in window to read config info |
|
95 //ChangeInputLanguage( *( (TInt*)iDataMgr->RequestData(EPeninputDataTypeInputLanguage))); |
|
96 |
|
97 iLayoutWindow->SizeChanged( ETrue ); |
|
98 // EnableLayoutMoving( static_cast<CDragBar*>( iLayoutWindow->MoveButton() ) ); |
|
99 } |
|
100 |
|
101 if (iDataMgr) |
|
102 { |
|
103 sizeChanging = EFalse; |
|
104 iDataMgr->SetData(EAkninputDataTypeSizeChanging, &sizeChanging); |
|
105 } |
|
106 } |
|
107 |
|
108 // --------------------------------------------------------------------------- |
|
109 // CPeninputCommonLayoutExt::~CPeninputCommonLayoutExt |
|
110 // (other items were commented in a header) |
|
111 // --------------------------------------------------------------------------- |
|
112 // |
|
113 EXPORT_C CPeninputCommonLayoutExt::~CPeninputCommonLayoutExt() |
|
114 { |
|
115 delete iUiStateMgr; |
|
116 delete iDataMgr; |
|
117 |
|
118 } |
|
119 |
|
120 // --------------------------------------------------------------------------- |
|
121 // CPeninputCommonLayoutExt::UiStateMgr |
|
122 // (other items were commented in a header) |
|
123 // --------------------------------------------------------------------------- |
|
124 // |
|
125 EXPORT_C MPeninputUiStateMgr* CPeninputCommonLayoutExt::UiStateMgr() const |
|
126 { |
|
127 return iUiStateMgr; |
|
128 } |
|
129 |
|
130 // --------------------------------------------------------------------------- |
|
131 // CPeninputCommonLayoutExt::LayoutWindow |
|
132 // (other items were commented in a header) |
|
133 // --------------------------------------------------------------------------- |
|
134 // |
|
135 EXPORT_C CPeninputLayoutWindowExt* CPeninputCommonLayoutExt::LayoutWindow() const |
|
136 { |
|
137 return iLayoutWindow; |
|
138 } |
|
139 |
|
140 // --------------------------------------------------------------------------- |
|
141 // CPeninputCommonLayoutExt::HandleCommand |
|
142 // (other items were commented in a header) |
|
143 // --------------------------------------------------------------------------- |
|
144 // |
|
145 EXPORT_C TInt CPeninputCommonLayoutExt::HandleCommand( TInt aCmd, |
|
146 TUint8* aData ) |
|
147 { |
|
148 // Handle command from fep or IME to this layout |
|
149 TUint* data = ( TUint* ) aData; |
|
150 TBuf<KPeninputCommonLayoutBufLen> buf; |
|
151 TBuf<KIntSizeToInt16> bufStyle; |
|
152 TInt style; |
|
153 TInt ret = KErrNone; |
|
154 |
|
155 switch ( aCmd ) |
|
156 { |
|
157 case ECmdPenInputPermittedRange: |
|
158 CPeninputDataConverter::IntToDesc( *data, buf ); |
|
159 SendEventToWindow( EPeninputLayoutEventSetPermittedRange, NULL, |
|
160 buf ); |
|
161 break; |
|
162 case ECmdPenInputAllowChangeCase: |
|
163 { |
|
164 iDataMgr->SetData( EAkninputDataTypeAllowCaseChange, data ); |
|
165 } |
|
166 break; |
|
167 case ECmdPenInputPermittedCase: |
|
168 { |
|
169 CPeninputDataConverter::IntToDesc( *data, buf ); |
|
170 SendEventToWindow( EPeninputLayoutEventSetPermittedCase, NULL, |
|
171 buf ); |
|
172 } |
|
173 break; |
|
174 case ECmdPenInputEditorNumericKeyMap: |
|
175 { |
|
176 iDataMgr->SetData( EPeninputDataTypeNumericKeymap, data ); |
|
177 } |
|
178 break; |
|
179 case ECmdPenInputCase: |
|
180 { |
|
181 CPeninputDataConverter::IntToDesc( *data, buf ); |
|
182 SendEventToWindow( EPeninputLayoutEventSetCase, NULL, |
|
183 buf ); |
|
184 } |
|
185 break; |
|
186 case ECmdPenInputLanguage: |
|
187 { |
|
188 ChangeInputLanguage(*data); |
|
189 } |
|
190 break; |
|
191 case ECmdPenInputRange: |
|
192 { |
|
193 ChangeRange( TranslateRange(*data) ); |
|
194 } |
|
195 break; |
|
196 /*case ECmdPenInputEnableSwitchBtn: |
|
197 { |
|
198 if ( LayoutType() == EPluginInputModeVkb ) |
|
199 { |
|
200 SetEnableSwitchToHwr(*data); |
|
201 } |
|
202 } |
|
203 break;*/ |
|
204 case ECmdPenInputEnableSettingBtn: |
|
205 { |
|
206 SetEnableSettingBtn(*data); |
|
207 } |
|
208 break; |
|
209 case ECmdPenInputIsSecretText: |
|
210 { |
|
211 iLayoutWindow->SetTextIsSecret( *aData ); |
|
212 } |
|
213 break; |
|
214 case ECmdPenInputIsNumberGrouping: |
|
215 { |
|
216 iLayoutWindow->SetNumberGrouping( *aData ); |
|
217 } |
|
218 break; |
|
219 case ECmdPenInputWindowOpen: |
|
220 { |
|
221 if ( *data == EPenInputOpenManually ) |
|
222 { |
|
223 style = EPeninputPositionChangeBrJustify; |
|
224 bufStyle = ( TUint16* )&style; |
|
225 SendEventToWindow(EPeninputLayoutEventMovePosition, NULL, bufStyle ); |
|
226 } |
|
227 iLayoutWindow->Hide(EFalse); |
|
228 LayoutOwner()->Hide( EFalse ); |
|
229 } |
|
230 break; |
|
231 case ECmdPenInputWindowClose: |
|
232 { |
|
233 iLayoutWindow->Hide(ETrue); |
|
234 LayoutOwner()->Hide( ETrue ); |
|
235 |
|
236 SendEventToWindow( EPeninputLayoutEventCloseWindow, NULL ); |
|
237 } |
|
238 break; |
|
239 case ECmdPenInputSetWindowPos: |
|
240 { |
|
241 // Only VKB need to move position automatically |
|
242 if ( LayoutType() == EPluginInputModeVkb ) |
|
243 { |
|
244 // Data is a TRect |
|
245 iDataMgr->SetData( EPeninputDataTypeDataQueryDlgRect, |
|
246 (TRect*) aData ); |
|
247 |
|
248 // Store justify style |
|
249 style = EPeninputPositionChangeDataQuery; |
|
250 bufStyle = ( TUint16* )&style; |
|
251 SendEventToWindow(EPeninputLayoutEventMovePosition, NULL, bufStyle); |
|
252 } |
|
253 } |
|
254 break; |
|
255 case ECmdPenInputEditorCustomNumericKeyMap: |
|
256 { |
|
257 iDataMgr->SetData(EAknFepDataTypeUseDefinedResource, aData); |
|
258 } |
|
259 break; |
|
260 case ECmdPenInputSetTextAlignment: |
|
261 { |
|
262 TRAP_IGNORE(iLayoutWindow->SetTextAlignmentL( *data )); |
|
263 } |
|
264 break; |
|
265 default: |
|
266 { |
|
267 ret = CFepUiLayout::HandleCommand( aCmd, aData ); |
|
268 } |
|
269 break; |
|
270 } |
|
271 |
|
272 return ret; |
|
273 } |
|
274 |
|
275 // --------------------------------------------------------------------------- |
|
276 // CPeninputCommonLayoutExt::SizeChanged |
|
277 // (other items were commented in a header) |
|
278 // --------------------------------------------------------------------------- |
|
279 // |
|
280 EXPORT_C TInt CPeninputCommonLayoutExt::SizeChanged( const TAny* /*aData*/ ) |
|
281 { |
|
282 TBool sizeChanging = ETrue; |
|
283 iDataMgr->SetData(EAkninputDataTypeSizeChanging, &sizeChanging); |
|
284 |
|
285 // Handle size changed event |
|
286 TPixelsTwipsAndRotation ptSize; |
|
287 |
|
288 CCoeEnv::Static()->ScreenDevice()->GetDefaultScreenSizeAndRotation( ptSize ); |
|
289 //SetScreenSize(ptSize.iPixelSize); |
|
290 |
|
291 // Store screen mode, and get new window position |
|
292 iDataMgr->SetData( EPeninputDataTypeScreenMode, ( TAny* )&ptSize ); |
|
293 |
|
294 // The following need to implement |
|
295 iLayoutWindow->SizeChanged( ETrue ); |
|
296 |
|
297 sizeChanging = EFalse; |
|
298 iDataMgr->SetData(EAkninputDataTypeSizeChanging, &sizeChanging); |
|
299 |
|
300 return KErrNone; |
|
301 } |
|
302 |
|
303 // --------------------------------------------------------------------------- |
|
304 // CPeninputCommonLayoutExt::HandleControlEvent |
|
305 // (other items were commented in a header) |
|
306 // --------------------------------------------------------------------------- |
|
307 // |
|
308 EXPORT_C void CPeninputCommonLayoutExt::HandleControlEvent( |
|
309 TInt aEventType, CFepUiBaseCtrl* aCtrl, const TDesC& aEventData ) |
|
310 { |
|
311 // Handle event from control |
|
312 TInt* data = ( TInt* ) aEventData.Ptr(); |
|
313 |
|
314 // Buffer for data conversion |
|
315 TBuf<KPeninputCommonLayoutBufLen> buf; |
|
316 |
|
317 switch ( aEventType ) |
|
318 { |
|
319 case EPeninputLayoutEventClose: |
|
320 { |
|
321 SignalOwner( ESignalLayoutClosed ); |
|
322 } |
|
323 break; |
|
324 case EPeninputLayoutEventOption: |
|
325 { |
|
326 SignalOwner( ESignalLaunchOptionMenu ); |
|
327 } |
|
328 break; |
|
329 case EPeninputLayoutEventSwitchLanguage: |
|
330 { |
|
331 SignalOwner( ESignalLaunchLanguageMenu ); |
|
332 } |
|
333 break; |
|
334 // When drag end, store the position data |
|
335 case EEventDraggingEnd: |
|
336 { |
|
337 TInt x = 0; |
|
338 TInt y = 0; |
|
339 x = 0x0000FFFF & ( Position().iX + Rect().Width() ); |
|
340 y = 0xFFFF0000 & ( ( Position().iY + Rect().Height() ) << 16 ); |
|
341 TInt position = x | y; |
|
342 if ( position ) |
|
343 { |
|
344 iDataMgr->SetData( EPeninputDataTypeWindowPosition, &position ); |
|
345 } |
|
346 } |
|
347 break; |
|
348 case EPeninputLayoutEventToVkb: |
|
349 { |
|
350 TBool switchByMode = ETrue; |
|
351 TInt mode = EPluginInputModeVkb; |
|
352 CPeninputDataConverter::CombinationToDesc( switchByMode, |
|
353 mode, buf ); |
|
354 SignalOwner( ESignalLayoutUIChanged, buf ); |
|
355 } |
|
356 break; |
|
357 default: |
|
358 { |
|
359 if ( iUiStateMgr->CurrentUiState() ) |
|
360 { |
|
361 if ( !iUiStateMgr->CurrentUiState()->HandleControlEvent |
|
362 ( aEventType, aEventData ) ) |
|
363 { |
|
364 SendEventToWindow( aEventType, aCtrl, aEventData ); |
|
365 } |
|
366 } |
|
367 } |
|
368 break; |
|
369 } |
|
370 } |
|
371 |
|
372 // --------------------------------------------------------------------------- |
|
373 // CPeninputCommonLayoutExt::OnAppEditorTextComing |
|
374 // (other items were commented in a header) |
|
375 // --------------------------------------------------------------------------- |
|
376 // |
|
377 EXPORT_C TInt CPeninputCommonLayoutExt::OnAppEditorTextComing( |
|
378 const TFepInputContextFieldData& aData ) |
|
379 { |
|
380 // Handle edit text coming |
|
381 if ( iLayoutWindow ) |
|
382 { |
|
383 TRAPD( err, iLayoutWindow->SetEditorTextL( aData ) ); |
|
384 return err; |
|
385 } |
|
386 |
|
387 return KErrNone; |
|
388 } |
|
389 |
|
390 // --------------------------------------------------------------------------- |
|
391 // CPeninputCommonLayoutExt::HandleRawKeyEventL |
|
392 // (other items were commented in a header) |
|
393 // --------------------------------------------------------------------------- |
|
394 // |
|
395 EXPORT_C TBool CPeninputCommonLayoutExt::HandleRawKeyEventL( |
|
396 const TRawEvent& aKeyEvent ) |
|
397 { |
|
398 return iUiStateMgr->CurrentUiState()->HandleKeyEventL( aKeyEvent ); |
|
399 } |
|
400 |
|
401 // --------------------------------------------------------------------------- |
|
402 // CPeninputCommonLayoutExt::SendEventToWindow |
|
403 // (other items were commented in a header) |
|
404 // --------------------------------------------------------------------------- |
|
405 // |
|
406 EXPORT_C void CPeninputCommonLayoutExt::SendEventToWindow( |
|
407 TInt aEventType, CFepUiBaseCtrl* aCtrl, const TDesC& aEventData ) |
|
408 { |
|
409 iLayoutWindow->HandleControlEvent( aEventType, aCtrl, aEventData ); |
|
410 } |
|
411 |
|
412 // --------------------------------------------------------------------------- |
|
413 // CPeninputCommonLayoutExt::SendEventToLayout |
|
414 // (other items were commented in a header) |
|
415 // --------------------------------------------------------------------------- |
|
416 // |
|
417 EXPORT_C void CPeninputCommonLayoutExt::SendEventToLayout( |
|
418 TInt aEventType, CFepUiBaseCtrl* aCtrl, const TDesC& aEventData ) |
|
419 { |
|
420 HandleControlEvent( aEventType, aCtrl, aEventData ); |
|
421 } |
|
422 |
|
423 // --------------------------------------------------------------------------- |
|
424 // CPeninputCommonLayoutExt::Sendkey |
|
425 // (other items were commented in a header) |
|
426 // --------------------------------------------------------------------------- |
|
427 // |
|
428 EXPORT_C void CPeninputCommonLayoutExt::Sendkey( TInt aEventType, |
|
429 const TDesC& aEventData ) |
|
430 { |
|
431 SignalOwner( aEventType, aEventData ); |
|
432 } |
|
433 |
|
434 // --------------------------------------------------------------------------- |
|
435 // CPeninputCommonLayoutExt::IsShiftPermitted |
|
436 // (other items were commented in a header). |
|
437 // --------------------------------------------------------------------------- |
|
438 // |
|
439 EXPORT_C TBool CPeninputCommonLayoutExt::IsShiftPermitted() |
|
440 { |
|
441 return iDataMgr->IsShiftPermitted(); |
|
442 } |
|
443 |
|
444 // --------------------------------------------------------------------------- |
|
445 // CPeninputCommonLayoutExt::IsCapsLockPermitted |
|
446 // (other items were commented in a header). |
|
447 // --------------------------------------------------------------------------- |
|
448 // |
|
449 EXPORT_C TBool CPeninputCommonLayoutExt::IsCapsLockPermitted() |
|
450 { |
|
451 return iDataMgr->IsCapsLockPermitted(); |
|
452 } |
|
453 |
|
454 // --------------------------------------------------------------------------- |
|
455 // CPeninputCommonLayoutExt::RequestData |
|
456 // (other items were commented in a header) |
|
457 // --------------------------------------------------------------------------- |
|
458 // |
|
459 EXPORT_C TAny* CPeninputCommonLayoutExt::RequestData( |
|
460 TPeninputDataType aDataType ) |
|
461 { |
|
462 return iDataMgr->RequestData( aDataType ); |
|
463 } |
|
464 |
|
465 // --------------------------------------------------------------------------- |
|
466 // CPeninputCommonLayoutExt::SetData |
|
467 // (other items were commented in a header) |
|
468 // --------------------------------------------------------------------------- |
|
469 // |
|
470 EXPORT_C void CPeninputCommonLayoutExt::SetData( TPeninputDataType aDataType, |
|
471 TAny* aData ) |
|
472 { |
|
473 iDataMgr->SetData( aDataType, aData ); |
|
474 } |
|
475 |
|
476 // --------------------------------------------------------------------------- |
|
477 // CPeninputCommonLayoutExt::SetData |
|
478 // (other items were commented in a header) |
|
479 // --------------------------------------------------------------------------- |
|
480 // |
|
481 EXPORT_C TBool CPeninputCommonLayoutExt::IsValidDestination( const TRect& aRect, |
|
482 CDragBar* aDragBar, |
|
483 TBool& aVInfo, |
|
484 TBool& aHInfo, |
|
485 TBool aFlag ) |
|
486 { |
|
487 // Validate move button destination |
|
488 if ( !aDragBar ) |
|
489 { |
|
490 return EFalse; |
|
491 } |
|
492 |
|
493 TRect rect = aRect; |
|
494 |
|
495 if ( aFlag ) |
|
496 { |
|
497 // Layout is moving |
|
498 aHInfo = aVInfo = EFalse; |
|
499 TRect dragbarRect( aRect.iTl, aDragBar->Rect().Size() ); |
|
500 |
|
501 if ( dragbarRect.iTl.iX >= 0 |
|
502 && dragbarRect.iBr.iX < ScreenSize().iWidth ) |
|
503 { |
|
504 aHInfo = ETrue; |
|
505 } |
|
506 |
|
507 if ( dragbarRect.iTl.iY >= 0 |
|
508 && dragbarRect.iBr.iY < ScreenSize().iHeight ) |
|
509 { |
|
510 aVInfo = ETrue; |
|
511 } |
|
512 |
|
513 return ( aHInfo && aVInfo ); |
|
514 } |
|
515 else |
|
516 { |
|
517 if ( aDragBar ) |
|
518 { |
|
519 rect.SetSize( aDragBar->Rect().Size() ); |
|
520 } |
|
521 |
|
522 TBool tlInvalid = !Rect().Contains( rect.iTl ); |
|
523 TBool brInvalid = !Rect().Contains( rect.iBr ); |
|
524 |
|
525 if ( tlInvalid && !brInvalid ) |
|
526 { |
|
527 if ( rect.iTl.iX >= Rect().iTl.iX |
|
528 && rect.iTl.iX <= Rect().iBr.iX ) |
|
529 { |
|
530 aHInfo = ETrue; |
|
531 } |
|
532 else if ( rect.iTl.iY >= Rect().iTl.iY |
|
533 && rect.iTl.iY <= Rect().iBr.iY ) |
|
534 { |
|
535 aVInfo = ETrue; |
|
536 } |
|
537 } |
|
538 else if ( !tlInvalid && brInvalid ) |
|
539 { |
|
540 if ( rect.iBr.iX >= Rect().iTl.iX |
|
541 && rect.iBr.iX <= Rect().iBr.iX ) |
|
542 { |
|
543 aHInfo = ETrue; |
|
544 } |
|
545 else if ( rect.iBr.iY >= Rect().iTl.iY |
|
546 && rect.iBr.iY <= Rect().iBr.iY ) |
|
547 { |
|
548 aVInfo = ETrue; |
|
549 } |
|
550 } |
|
551 |
|
552 return !( tlInvalid || brInvalid ); |
|
553 } |
|
554 } |
|
555 |
|
556 // --------------------------------------------------------------------------- |
|
557 // CPeninputCommonLayoutExt::TranslateRange |
|
558 // (other items were commented in a header) |
|
559 // --------------------------------------------------------------------------- |
|
560 // |
|
561 TInt CPeninputCommonLayoutExt::TranslateRange(TInt aRange) |
|
562 { |
|
563 TInt newRange = aRange; |
|
564 |
|
565 if ( aRange == ERangeNative) |
|
566 { |
|
567 if ( iLayoutWindow |
|
568 && iLayoutWindow->ConfigInfo() |
|
569 && iLayoutWindow->ConfigInfo()->RangeBarInfo()->FindRange( ERangeNative ) ) |
|
570 { |
|
571 newRange = ERangeNative; |
|
572 } |
|
573 else |
|
574 { |
|
575 newRange = ERangeEnglish; |
|
576 } |
|
577 } |
|
578 else if ( aRange == ERangeEnglish) |
|
579 { |
|
580 if ( iLayoutWindow |
|
581 && iLayoutWindow->ConfigInfo() |
|
582 && iLayoutWindow->ConfigInfo()->RangeBarInfo()->FindRange( ERangeEnglish ) ) |
|
583 { |
|
584 newRange = ERangeEnglish; |
|
585 } |
|
586 else |
|
587 { |
|
588 newRange = ERangeNative; |
|
589 } |
|
590 } |
|
591 |
|
592 return newRange; |
|
593 } |
|
594 |
|
595 // --------------------------------------------------------------------------- |
|
596 // CPeninputCommonLayoutExt::Init |
|
597 // (other items were commented in a header) |
|
598 // --------------------------------------------------------------------------- |
|
599 // |
|
600 EXPORT_C TRect CPeninputCommonLayoutExt::Init() |
|
601 { |
|
602 TRect r = CFepUiLayout::Init(); |
|
603 //wxy -- No need to set position here |
|
604 //LayoutOwner()->SetPosition( Rect().iTl ); |
|
605 //r = TRect( Position(), r.Size() ); |
|
606 |
|
607 return r; |
|
608 } |
|
609 |
|
610 // --------------------------------------------------------------------------- |
|
611 // CPeninputCommonLayoutExt::SaveKey |
|
612 // (other items were commented in a header) |
|
613 // --------------------------------------------------------------------------- |
|
614 // |
|
615 EXPORT_C void CPeninputCommonLayoutExt::SaveKey( TInt aKey, TInt aValue ) |
|
616 { |
|
617 iDataMgr->SaveKey( aKey, aValue ); |
|
618 } |
|
619 |
|
620 // --------------------------------------------------------------------------- |
|
621 // CPeninputCommonLayoutExt::ChangeInputLanguage |
|
622 // (other items were commented in a header) |
|
623 // --------------------------------------------------------------------------- |
|
624 // |
|
625 void CPeninputCommonLayoutExt::ChangeInputLanguage( TInt aLangID ) |
|
626 { |
|
627 // Call ChangeInputLanguage function in iLayoutWindow |
|
628 TRAP_IGNORE( iLayoutWindow->ChangeInputLanguageL( aLangID ) ); |
|
629 } |
|
630 |
|
631 // --------------------------------------------------------------------------- |
|
632 // CPeninputCommonLayoutExt::ChangeLanguage |
|
633 // (other items were commented in a header). |
|
634 // --------------------------------------------------------------------------- |
|
635 // |
|
636 void CPeninputCommonLayoutExt::ChangeRange( TInt aRange ) |
|
637 { |
|
638 iLayoutWindow->ChangeRange( aRange, 0, EFalse ); |
|
639 } |
|
640 |
|
641 // --------------------------------------------------------------------------- |
|
642 // CPeninputCommonLayoutExt::SetEnableSwitchToHwr |
|
643 // (other items were commented in a header). |
|
644 // --------------------------------------------------------------------------- |
|
645 // |
|
646 void CPeninputCommonLayoutExt::SetEnableSwitchToHwr( TBool aEnable ) |
|
647 { |
|
648 iLayoutWindow->SetEnableSwitchToHwr( aEnable ); |
|
649 } |
|
650 |
|
651 // --------------------------------------------------------------------------- |
|
652 // CPeninputCommonLayoutExt::SetEnableSettingBtn |
|
653 // (other items were commented in a header). |
|
654 // --------------------------------------------------------------------------- |
|
655 // |
|
656 void CPeninputCommonLayoutExt::SetEnableSettingBtn( TBool aEnable ) |
|
657 { |
|
658 iLayoutWindow->SetEnableSettingBtn( aEnable ); |
|
659 } |
|
660 |
|
661 EXPORT_C TInt CPeninputCommonLayoutExt::PenInputType() |
|
662 { |
|
663 return LayoutType(); |
|
664 } |
|
665 |
|
666 EXPORT_C void CPeninputCommonLayoutExt::SetPositionFromOutside(const TPoint& aNewPos) |
|
667 { |
|
668 LayoutOwner()->SetPosition(aNewPos); |
|
669 TInt x = 0x0000FFFF & aNewPos.iX; |
|
670 TInt y = 0xFFFF0000 & ( aNewPos.iY << 16 ); |
|
671 TInt position = x | y; |
|
672 |
|
673 SetData( EPeninputDataTypeWindowPosition, (TAny*)&position ); |
|
674 } |
|
675 |
|