|
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: peninput VKB data manager |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // System includes |
|
20 #include <peninputdataconverter.h> |
|
21 #include <peninputcommonlayoutglobalenum.h> |
|
22 #include <aknutils.h> |
|
23 #include <AknLayoutScalable_Avkon.cdl.h> |
|
24 #include <peninputpluginutils.h> |
|
25 |
|
26 // User includes |
|
27 #include "PeninputVkbKr.hrh" |
|
28 #include "peninputgenericvkblafdatamgr.h" |
|
29 |
|
30 #define LAF_MODIFY 1 |
|
31 |
|
32 const TInt KKeypadLayout[][2] = |
|
33 { |
|
34 { 10, 3 }, // 10x3 |
|
35 { 11, 3 }, // 11x3 |
|
36 { 11, 4 }, // 11x4 |
|
37 { 9, 3 }, // 9x3 |
|
38 { 3, 3 }, // 3x3 |
|
39 }; |
|
40 |
|
41 const TInt KVkbTopAndBottomParam[] = { 5, 3, 4 }; |
|
42 typedef TAknWindowComponentLayout (*Pfun)(TInt aVariety, TInt aCol = 0, TInt aRow = 0); |
|
43 |
|
44 const Pfun cell_pane_func[]= |
|
45 { |
|
46 AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane, |
|
47 AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_cp01, |
|
48 AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_cp02, |
|
49 AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_cp03, |
|
50 AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_cp04, |
|
51 AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_cp05, |
|
52 AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_cp06, |
|
53 AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_cp07, |
|
54 AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_cp08, |
|
55 AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_cp09, |
|
56 AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_cp10 |
|
57 }; |
|
58 // { 0, 34, 68, 102, 136, 170, 204, 238, 272, 305 }; |
|
59 const TInt KKeypadRectXPoint10x[] = |
|
60 { 0, 34, 68, 102, 136, 170, 204, 238, 272, 305 }; |
|
61 const TInt KKeypadCellWidth10x[] = |
|
62 { 41, 41, 41, 41, 41, 41, 41, 41, 41, 44 }; |
|
63 // { 0, 32, 63, 94, 125, 155, 230, 217, 248, 279, 311 }; |
|
64 const TInt KKeypadRectXPoint11x[] = |
|
65 { 0, 31, 62, 93, 124, 155, 186, 217, 248, 278, 311 }; |
|
66 const TInt KKeypadCellWidth11x[] = |
|
67 { 36, 36, 36, 36, 36, 36, 36, 36, 36, 39, 39 }; |
|
68 const TInt KKeypadRectXPoint3x[] = |
|
69 { 0, 97, 194, 291 }; |
|
70 const TInt KKeypadCellWidth3x[] = |
|
71 { 120, 120, 120, 44 }; |
|
72 |
|
73 // ======== MEMBER FUNCTIONS ======== |
|
74 |
|
75 // --------------------------------------------------------------------------- |
|
76 // CPeninputGenericVkbLafMgr::NewL |
|
77 // (other items were commented in a header) |
|
78 // --------------------------------------------------------------------------- |
|
79 // |
|
80 CPeninputGenericVkbLafMgr* CPeninputGenericVkbLafMgr::NewL() |
|
81 { |
|
82 CPeninputGenericVkbLafMgr* self = NewLC(); |
|
83 CleanupStack::Pop(self); |
|
84 |
|
85 return self; |
|
86 } |
|
87 |
|
88 // --------------------------------------------------------------------------- |
|
89 // CPeninputGenericVkbLafMgr::NewLC |
|
90 // (other items were commented in a header) |
|
91 // --------------------------------------------------------------------------- |
|
92 // |
|
93 CPeninputGenericVkbLafMgr* CPeninputGenericVkbLafMgr::NewLC() |
|
94 { |
|
95 CPeninputGenericVkbLafMgr* self = |
|
96 new ( ELeave ) CPeninputGenericVkbLafMgr(); |
|
97 CleanupStack::PushL( self ); |
|
98 self->ConstructL(); |
|
99 |
|
100 return self; |
|
101 } |
|
102 |
|
103 // --------------------------------------------------------------------------- |
|
104 // CPeninputGenericVkbLafMgr::CPeninputGenericVkbLafMgr |
|
105 // (other items were commented in a header) |
|
106 // --------------------------------------------------------------------------- |
|
107 // |
|
108 CPeninputGenericVkbLafMgr::CPeninputGenericVkbLafMgr(): |
|
109 iInputMode(EPluginInputModeNone) |
|
110 { |
|
111 } |
|
112 |
|
113 // --------------------------------------------------------------------------- |
|
114 // CPeninputGenericVkbLafMgr::~CPeninputGenericVkbLafMgr |
|
115 // (other items were commented in a header) |
|
116 // --------------------------------------------------------------------------- |
|
117 // |
|
118 CPeninputGenericVkbLafMgr::~CPeninputGenericVkbLafMgr() |
|
119 { |
|
120 delete iLafData; |
|
121 iLafData = NULL; |
|
122 } |
|
123 |
|
124 TBool CPeninputGenericVkbLafMgr::IsValid() |
|
125 { |
|
126 if (!iLafData) |
|
127 return EFalse; |
|
128 |
|
129 return iLafData->IsValid(); |
|
130 } |
|
131 |
|
132 // --------------------------------------------------------------------------- |
|
133 // CPeninputGenericVkbLafMgr::ConstructL |
|
134 // (other items were commented in a header) |
|
135 // --------------------------------------------------------------------------- |
|
136 // |
|
137 void CPeninputGenericVkbLafMgr::ConstructL() |
|
138 { |
|
139 |
|
140 } |
|
141 |
|
142 // --------------------------------------------------------------------------- |
|
143 // CPeninputGenericVkbLafMgr::SetInputMode |
|
144 // (other items were commented in a header) |
|
145 // --------------------------------------------------------------------------- |
|
146 // |
|
147 void CPeninputGenericVkbLafMgr::SetInputModeL( TPluginInputMode aInputMode) |
|
148 { |
|
149 if (iInputMode == aInputMode) |
|
150 { |
|
151 return; |
|
152 } |
|
153 |
|
154 |
|
155 if (iLafData) |
|
156 { |
|
157 delete iLafData; |
|
158 iLafData = NULL; |
|
159 } |
|
160 |
|
161 if (aInputMode == EPluginInputModeVkb) |
|
162 { |
|
163 iLafData = CPeninputLafDataVKB::NewL(ELayoutNone); |
|
164 } |
|
165 else if (aInputMode == EPluginInputModeFSQ) |
|
166 { |
|
167 iLafData = CPeninputLafDataFSQ::NewL(ELayoutNone); |
|
168 } |
|
169 else |
|
170 { |
|
171 User::Leave(KErrNotSupported); |
|
172 } |
|
173 } |
|
174 |
|
175 TPluginInputMode CPeninputGenericVkbLafMgr::InputMode() const |
|
176 { |
|
177 return iInputMode; |
|
178 } |
|
179 |
|
180 // --------------------------------------------------------------------------- |
|
181 // CPeninputGenericVkbLafMgr::SetLayoutType |
|
182 // (other items were commented in a header) |
|
183 // --------------------------------------------------------------------------- |
|
184 // |
|
185 void CPeninputGenericVkbLafMgr::SetLayoutType( TPeninputQwtLayoutType aLayoutType ) |
|
186 { |
|
187 ASSERT(iLafData); |
|
188 iLafData->SetLayoutType( aLayoutType ); |
|
189 } |
|
190 |
|
191 // --------------------------------------------------------------------------- |
|
192 // CPeninputGenericVkbLafMgr::SetLafOption |
|
193 // (other items were commented in a header) |
|
194 // --------------------------------------------------------------------------- |
|
195 // |
|
196 void CPeninputGenericVkbLafMgr::SetLafOption( TPeninputVkbLafOption aOption ) |
|
197 { |
|
198 if( iLafData->LafOption() == aOption ) |
|
199 return; |
|
200 |
|
201 iLafData->SetLafOption( aOption ); |
|
202 TRAP_IGNORE(iLafData->ConstructL()); |
|
203 } |
|
204 |
|
205 // --------------------------------------------------------------------------- |
|
206 // CPeninputGenericVkbLafMgr::SetLafOption |
|
207 // (other items were commented in a header) |
|
208 // --------------------------------------------------------------------------- |
|
209 // |
|
210 TPeninputVkbLafOption CPeninputGenericVkbLafMgr::OptionType() const |
|
211 { |
|
212 return iLafData->LafOption(); |
|
213 } |
|
214 |
|
215 // --------------------------------------------------------------------------- |
|
216 // CPeninputGenericVkbLafMgr::GetButtonRect |
|
217 // (other items were commented in a header) |
|
218 // --------------------------------------------------------------------------- |
|
219 // |
|
220 void CPeninputGenericVkbLafMgr::GetButtonRect( TPeninputCommonCtrlID aButtonID, |
|
221 TRect& aOutterRect, |
|
222 TRect& aInnerRect ) |
|
223 { |
|
224 ASSERT(iLafData); |
|
225 const TPeninputButtonLayoutData& data = iLafData->ButtonLayoutData( aButtonID ); |
|
226 aOutterRect = data.iRect; |
|
227 aInnerRect = data.iInnerRect; |
|
228 } |
|
229 |
|
230 // --------------------------------------------------------------------------- |
|
231 // CPeninputGenericVkbLafMgr::KeyRect |
|
232 // (other items were commented in a header) |
|
233 // --------------------------------------------------------------------------- |
|
234 // |
|
235 const TRect& CPeninputGenericVkbLafMgr::KeypadRect() const |
|
236 { |
|
237 ASSERT(iLafData); |
|
238 const TPeninputKeyLayoutData& data = iLafData->KeypadLayoutData(); |
|
239 return data.iKaypadRect; |
|
240 } |
|
241 |
|
242 // --------------------------------------------------------------------------- |
|
243 // CPeninputGenericVkbLafMgr::ICFRect |
|
244 // (other items were commented in a header) |
|
245 // --------------------------------------------------------------------------- |
|
246 // |
|
247 const TRect& CPeninputGenericVkbLafMgr::ICFRect() const |
|
248 { |
|
249 ASSERT(iLafData); |
|
250 return iLafData->ICFLayoutData().iRect; |
|
251 } |
|
252 |
|
253 // --------------------------------------------------------------------------- |
|
254 // CPeninputGenericVkbLafMgr::ICFPromptTextFont |
|
255 // (other items were commented in a header) |
|
256 // --------------------------------------------------------------------------- |
|
257 // |
|
258 const CFont* CPeninputGenericVkbLafMgr::ICFPromptTextFont() const |
|
259 { |
|
260 ASSERT(iLafData); |
|
261 return iLafData->ICFLayoutData().iPromptTextFont; |
|
262 } |
|
263 |
|
264 // --------------------------------------------------------------------------- |
|
265 // CPeninputGenericVkbLafMgr::ICFTextFont |
|
266 // (other items were commented in a header) |
|
267 // --------------------------------------------------------------------------- |
|
268 // |
|
269 const CFont* CPeninputGenericVkbLafMgr::ICFTextFont() const |
|
270 { |
|
271 ASSERT(iLafData); |
|
272 return iLafData->ICFLayoutData().iTextFont; |
|
273 } |
|
274 |
|
275 |
|
276 // --------------------------------------------------------------------------- |
|
277 // CPeninputGenericVkbLafMgr::KeyTextLayout |
|
278 // (other items were commented in a header) |
|
279 // --------------------------------------------------------------------------- |
|
280 // |
|
281 TAknTextLineLayout CPeninputGenericVkbLafMgr::KeyTextLayout() const |
|
282 { |
|
283 ASSERT(iLafData); |
|
284 return iLafData->KeypadLayoutData().iTextLayout; |
|
285 } |
|
286 |
|
287 // --------------------------------------------------------------------------- |
|
288 // CPeninputGenericVkbLafMgr::ICFPromptTextFont |
|
289 // (other items were commented in a header) |
|
290 // --------------------------------------------------------------------------- |
|
291 // |
|
292 void CPeninputGenericVkbLafMgr::GetICFConfig( TPeninputICFConfig& aICFConfig ) |
|
293 { |
|
294 ASSERT(iLafData); |
|
295 const TPeninputEntryLayoutData& icfLayout = iLafData->ICFLayoutData(); |
|
296 aICFConfig.iLeftMargin = icfLayout.iPromptTextRect.iTl.iX - icfLayout.iRect.iTl.iX; |
|
297 aICFConfig.iRightMargin = icfLayout.iRect.iBr.iX - icfLayout.iPromptTextRect.iBr.iX; |
|
298 aICFConfig.iTopMargin = icfLayout.iPromptTextRect.iTl.iY - icfLayout.iRect.iTl.iY; |
|
299 aICFConfig.iTextLineHeight = icfLayout.iPromptTextRect.Height(); |
|
300 aICFConfig.iLineSpaceMargin = icfLayout.iTextRect.iTl.iY - icfLayout.iPromptTextRect.iBr.iY; |
|
301 } |
|
302 |
|
303 // |
|
304 const TRect& CPeninputGenericVkbLafMgr::EntirePaneRect() const |
|
305 { |
|
306 ASSERT(iLafData); |
|
307 return iLafData->QwtLayoutData().iQwtRect; |
|
308 } |
|
309 |
|
310 // --------------------------------------------------------------------------- |
|
311 // CPeninputGenericVkbLafMgr::KeyRect |
|
312 // (other items were commented in a header) |
|
313 // --------------------------------------------------------------------------- |
|
314 // |
|
315 void CPeninputGenericVkbLafMgr::GetKeyRect( TInt aColume, |
|
316 TInt aRow, |
|
317 TRect& aKeyRect, |
|
318 TRect& aCharRect ) const |
|
319 { |
|
320 ASSERT(iLafData); |
|
321 TInt colNum = 0; |
|
322 TInt index = 0; |
|
323 switch( iLafData->LayoutType() ) |
|
324 { |
|
325 case ELayout10x3: |
|
326 { |
|
327 colNum = 10; |
|
328 } |
|
329 break; |
|
330 case ELayout11x3: |
|
331 { |
|
332 colNum = 11; |
|
333 } |
|
334 break; |
|
335 case ELayout11x4: |
|
336 { |
|
337 colNum = 11; |
|
338 } |
|
339 break; |
|
340 case ELayout9x3: |
|
341 { |
|
342 colNum=9; |
|
343 } |
|
344 break; |
|
345 case ELayout3x3: |
|
346 { |
|
347 colNum = 3; |
|
348 } |
|
349 break; |
|
350 } |
|
351 index = aRow * colNum + aColume; |
|
352 aKeyRect = iLafData->KeypadLayoutData().iRects[index]; |
|
353 aCharRect = iLafData->KeypadLayoutData().iCharRects[index]; |
|
354 } |
|
355 |
|
356 TPeninputQwtLayoutType CPeninputGenericVkbLafMgr::LayoutTypeFromRowsColumns(const TInt aRows, |
|
357 const TInt aColumns) |
|
358 { |
|
359 TPeninputQwtLayoutType ret; |
|
360 |
|
361 if (aRows == 3 && aColumns == 10) |
|
362 { |
|
363 ret = ELayout10x3; |
|
364 } |
|
365 else if (aRows == 3 && aColumns == 11) |
|
366 { |
|
367 ret = ELayout11x3; |
|
368 } |
|
369 else if (aRows == 4 && aColumns == 11) |
|
370 { |
|
371 ret = ELayout11x4; |
|
372 } |
|
373 else if (aRows == 3 && aColumns == 9) |
|
374 { |
|
375 ret = ELayout9x3; |
|
376 } |
|
377 else if (aRows == 3 && aColumns == 3) |
|
378 { |
|
379 ret = ELayout3x3; |
|
380 } |
|
381 else |
|
382 { |
|
383 ret = ELayoutNone; |
|
384 } |
|
385 |
|
386 return ret; |
|
387 } |
|
388 // --------------------------------------------------------------------------- |
|
389 // CPeninputGenericVkbLafMgr::KeyTextFont |
|
390 // (other items were commented in a header) |
|
391 // --------------------------------------------------------------------------- |
|
392 // |
|
393 const CFont* CPeninputGenericVkbLafMgr::KeyTextFont() const |
|
394 { |
|
395 ASSERT(iLafData); |
|
396 return iLafData->KeypadLayoutData().iFont; |
|
397 } |
|
398 |
|
399 // --------------------------------------------------------------------------- |
|
400 // CPeninputGenericVkbLafMgr::KeyTextFont |
|
401 // (other items were commented in a header) |
|
402 // --------------------------------------------------------------------------- |
|
403 // |
|
404 const TRect& CPeninputGenericVkbLafMgr::RangbarRect() const |
|
405 { |
|
406 ASSERT(iLafData); |
|
407 return iLafData->RangbarLayoutData().iRect; |
|
408 } |
|
409 |
|
410 // --------------------------------------------------------------------------- |
|
411 // CPeninputGenericVkbLafMgr::KeyTextFont |
|
412 // (other items were commented in a header) |
|
413 // --------------------------------------------------------------------------- |
|
414 // |
|
415 const TRect& CPeninputGenericVkbLafMgr::TitlebarRect() const |
|
416 { |
|
417 ASSERT(iLafData); |
|
418 return iLafData->QwtLayoutData().iTitlebarRect; |
|
419 } |
|
420 |
|
421 // --------------------------------------------------------------------------- |
|
422 // CPeninputGenericVkbLafMgr::ClientRect |
|
423 // (other items were commented in a header) |
|
424 // --------------------------------------------------------------------------- |
|
425 // |
|
426 const TRect& CPeninputGenericVkbLafMgr::ClientRect() const |
|
427 { |
|
428 ASSERT(iLafData); |
|
429 return iLafData->QwtLayoutData().iClientRect; |
|
430 } |
|
431 |
|
432 // --------------------------------------------------------------------------- |
|
433 // CPeninputGenericVkbLafMgr::RangbarCellCount |
|
434 // (other items were commented in a header) |
|
435 // --------------------------------------------------------------------------- |
|
436 // |
|
437 TInt CPeninputGenericVkbLafMgr::RangbarCellCount() const |
|
438 { |
|
439 ASSERT(iLafData); |
|
440 return iLafData->RangbarLayoutData().iCellDataArray.Count(); |
|
441 } |
|
442 |
|
443 // --------------------------------------------------------------------------- |
|
444 // CPeninputGenericVkbLafMgr::RangbarCellCount |
|
445 // (other items were commented in a header) |
|
446 // --------------------------------------------------------------------------- |
|
447 // |
|
448 void CPeninputGenericVkbLafMgr::RangbarCellAt( TInt aIndex, |
|
449 TRect& aOutterRect, |
|
450 TRect& aInnerRect ) |
|
451 { |
|
452 ASSERT(iLafData); |
|
453 aOutterRect = iLafData->RangbarLayoutData().iCellDataArray[aIndex].iRect; |
|
454 aInnerRect = iLafData->RangbarLayoutData().iCellDataArray[aIndex].iInnerRect; |
|
455 } |
|
456 |
|
457 // --------------------------------------------------------------------------- |
|
458 // CPeninputGenericVkbLafMgr::GetSpaceButtonExLayoutInfo |
|
459 // (other items were commented in a header) |
|
460 // --------------------------------------------------------------------------- |
|
461 // |
|
462 void CPeninputGenericVkbLafMgr::GetSpaceButtonExLayoutInfo( TRect& aIconsFrameRect, |
|
463 TRect& aMiddleIconRect ) const |
|
464 { |
|
465 ASSERT(iLafData); |
|
466 aIconsFrameRect = iLafData->QwtLayoutData().iSpaceButtonEx.iIconsFrameRect; |
|
467 aMiddleIconRect = iLafData->QwtLayoutData().iSpaceButtonEx.iMiddleIconRect; |
|
468 } |
|
469 |
|
470 // --------------------------------------------------------------------------- |
|
471 // CPeninputQwtLayoutDataInfo::~CPeninputQwtLayoutDataInfo |
|
472 // (other items were commented in a header) |
|
473 // --------------------------------------------------------------------------- |
|
474 // |
|
475 CPeninputQwtLayoutDataInfo::~CPeninputQwtLayoutDataInfo() |
|
476 { |
|
477 iKeypad.iRects.Close(); |
|
478 iKeypad.iCharRects.Close(); |
|
479 iRangbar.iCellDataArray.Close(); |
|
480 } |
|
481 |
|
482 // --------------------------------------------------------------------------- |
|
483 // CPeninputLafDataCommon::DestoryDataCommon |
|
484 // (other items were commented in a header) |
|
485 // --------------------------------------------------------------------------- |
|
486 // |
|
487 void MPeninputLafDataCommon::DestoryDataCommon() |
|
488 { |
|
489 iLayoutDataInfo.ResetAndDestroy(); |
|
490 iLayoutDataInfo.Close(); |
|
491 } |
|
492 |
|
493 MPeninputLafDataCommon::~MPeninputLafDataCommon() |
|
494 { |
|
495 |
|
496 } |
|
497 // CPeninputLafDataCommon::ButtonLayoutData(TInt aButtonID) |
|
498 // (other items were commented in a header) |
|
499 // --------------------------------------------------------------------------- |
|
500 // |
|
501 const TPeninputButtonLayoutData& MPeninputLafDataCommon::ButtonLayoutData( TInt aButtonID ) const |
|
502 { |
|
503 ASSERT( IsValid() ); |
|
504 const TPeninputButtonLayoutData* pData = NULL; |
|
505 |
|
506 switch( aButtonID ) |
|
507 { |
|
508 case EPeninutWindowCtrlIdMoveBtn: |
|
509 { |
|
510 pData = &(iLayoutDataInfo[iLayoutType]->iMoveButton); |
|
511 } |
|
512 break; |
|
513 case EPeninutWindowCtrlIdCloseBtn: |
|
514 { |
|
515 pData = &(iLayoutDataInfo[iLayoutType]->iCloseButton); |
|
516 } |
|
517 break; |
|
518 case EPeninutWindowCtrlIdOptionBtn: |
|
519 { |
|
520 pData = &(iLayoutDataInfo[iLayoutType]->iOptionButton); |
|
521 } |
|
522 break; |
|
523 case EPeninutWindowCtrlIdBackspaceBtn: |
|
524 { |
|
525 pData = &(iLayoutDataInfo[iLayoutType]->iClearButton); |
|
526 } |
|
527 break; |
|
528 case EPeninutWindowCtrlIdEnterBtn: |
|
529 { |
|
530 pData = &(iLayoutDataInfo[iLayoutType]->iEnterButton); |
|
531 } |
|
532 break; |
|
533 case EPeninutWindowCtrlIdSwitchToHwrBtn: |
|
534 { |
|
535 pData = &(iLayoutDataInfo[iLayoutType]->iSwitchButton); |
|
536 } |
|
537 break; |
|
538 case EPeninutWindowCtrlIdSpaceBtn: |
|
539 { |
|
540 pData = &(iLayoutDataInfo[iLayoutType]->iSpaceButton); |
|
541 } |
|
542 break; |
|
543 case EPeninutWindowCtrlIdShiftBtn: |
|
544 { |
|
545 pData = &(iLayoutDataInfo[iLayoutType]->iShiftButton); |
|
546 } |
|
547 break; |
|
548 case EPeninupWindowCtrlIdArrowLeftBtn: |
|
549 { |
|
550 pData = &(iLayoutDataInfo[iLayoutType]->iLeftButton); |
|
551 } |
|
552 break; |
|
553 case EPeninupWindowCtrlIdArrowRightBtn: |
|
554 { |
|
555 pData = &(iLayoutDataInfo[iLayoutType]->iRightButton); |
|
556 } |
|
557 break; |
|
558 case EPeninutVkbCtrlIdSymbolTableUp: |
|
559 { |
|
560 pData = &(iLayoutDataInfo[iLayoutType]->iTableUpButton); |
|
561 } |
|
562 break; |
|
563 case EPeninutVkbCtrlIdSymbolTableDown: |
|
564 { |
|
565 pData = &(iLayoutDataInfo[iLayoutType]->iTableDownButton); |
|
566 } |
|
567 break; |
|
568 case EPeninutVkbCtrlIdSymbolTablePageLabel: |
|
569 { |
|
570 pData = &(iLayoutDataInfo[iLayoutType]->iTablePageLabel); |
|
571 } |
|
572 break; |
|
573 default: |
|
574 ASSERT(EFalse); |
|
575 break; |
|
576 } |
|
577 ASSERT(pData); |
|
578 return *pData; |
|
579 } |
|
580 // --------------------------------------------------------------------------- |
|
581 // CPeninputLafDataCommon::ICFLayoutData() |
|
582 // (other items were commented in a header) |
|
583 // --------------------------------------------------------------------------- |
|
584 // |
|
585 const TPeninputEntryLayoutData& MPeninputLafDataCommon::ICFLayoutData() const |
|
586 { |
|
587 ASSERT( IsValid() ); |
|
588 return iLayoutDataInfo[iLayoutType]->iICF; |
|
589 } |
|
590 |
|
591 // --------------------------------------------------------------------------- |
|
592 // CPeninputLafDataCommon::KeypadLayoutData() |
|
593 // (other items were commented in a header) |
|
594 // --------------------------------------------------------------------------- |
|
595 // |
|
596 const TPeninputKeyLayoutData& MPeninputLafDataCommon::KeypadLayoutData() const |
|
597 { |
|
598 ASSERT( IsValid() ); |
|
599 return iLayoutDataInfo[iLayoutType]->iKeypad; |
|
600 } |
|
601 |
|
602 // --------------------------------------------------------------------------- |
|
603 // CPeninputLafDataCommon::RangbarLayoutData(TInt aRangbarID) |
|
604 // (other items were commented in a header) |
|
605 // --------------------------------------------------------------------------- |
|
606 // |
|
607 const TPeninputRangeBarLayoutData& MPeninputLafDataCommon::RangbarLayoutData() const |
|
608 { |
|
609 ASSERT( IsValid() ); |
|
610 return iLayoutDataInfo[iLayoutType]->iRangbar; |
|
611 } |
|
612 |
|
613 // --------------------------------------------------------------------------- |
|
614 // CPeninputLafDataCommon::RangbarLayoutData(TInt aRangbarID) |
|
615 // (other items were commented in a header) |
|
616 // --------------------------------------------------------------------------- |
|
617 // |
|
618 const CPeninputQwtLayoutDataInfo& MPeninputLafDataCommon::QwtLayoutData() const |
|
619 { |
|
620 ASSERT( IsValid() ); |
|
621 return *iLayoutDataInfo[iLayoutType]; |
|
622 } |
|
623 |
|
624 // --------------------------------------------------------------------------- |
|
625 // CPeninputLafDataCommon::ConstructL() |
|
626 // (other items were commented in a header) |
|
627 // --------------------------------------------------------------------------- |
|
628 // |
|
629 void MPeninputLafDataCommon::ConstructL() |
|
630 { |
|
631 ReadLafInfoL(); |
|
632 } |
|
633 |
|
634 // --------------------------------------------------------------------------- |
|
635 // CPeninputLafDataCommon::ConstructL() |
|
636 // (other items were commented in a header) |
|
637 // --------------------------------------------------------------------------- |
|
638 // |
|
639 TBool MPeninputLafDataCommon::IsValid() const |
|
640 { |
|
641 return ( iLayoutDataInfo.Count() && iLayoutType != ELayoutNone ) ? ETrue : EFalse; |
|
642 } |
|
643 |
|
644 |
|
645 // --------------------------------------------------------------------------- |
|
646 // CPeninputLafDataCommon::GetTopAndBottomPaneInfo |
|
647 // (other items were commented in a header) |
|
648 // --------------------------------------------------------------------------- |
|
649 // |
|
650 void MPeninputLafDataCommon::GetTopAndBottomPaneInfo( const TRect& aParentWndRect, |
|
651 TInt aLayoutType, |
|
652 TInt aLayoutParam, |
|
653 CPeninputQwtLayoutDataInfo& aDataInfo ) |
|
654 { |
|
655 const TInt endFSQType = 2; |
|
656 |
|
657 |
|
658 |
|
659 // judge which case |
|
660 TBool isVKB = aLayoutParam > endFSQType ? ETrue : EFalse; |
|
661 |
|
662 TAknWindowLineLayout toppane, bottompane, bottomgrid; |
|
663 TAknWindowLineLayout topleftpane, topentrypane, toprightpane; |
|
664 TAknWindowLineLayout cellBtn, cellBtnInner; |
|
665 |
|
666 TAknLayoutRect toppaneRect, bottompaneRect, bottomgridRect; |
|
667 TAknLayoutRect topleftpaneRect, topentrypaneRect, toprightpaneRect; |
|
668 TAknLayoutRect cellBtnRect, cellBtnInnerRect; |
|
669 TAknTextLineLayout cellText; |
|
670 TAknLayoutText txt; |
|
671 TRect keypadRect; |
|
672 TRect innerRect; |
|
673 // top pane |
|
674 if( isVKB ) |
|
675 { |
|
676 toppane = AknLayoutScalable_Avkon:: |
|
677 vkb2_area_top_pane(KVkbTopAndBottomParam[aLayoutType]).LayoutLine(); |
|
678 } |
|
679 else |
|
680 { |
|
681 toppane = AknLayoutScalable_Avkon::vkb2_area_top_pane(aLayoutParam).LayoutLine(); |
|
682 } |
|
683 toppaneRect.LayoutRect(aParentWndRect, toppane); |
|
684 aDataInfo.iTitlebarRect = toppaneRect.Rect(); |
|
685 |
|
686 |
|
687 topleftpane = AknLayoutScalable_Avkon::vkb2_top_grid_left_pane(aLayoutParam).LayoutLine(); |
|
688 topleftpaneRect.LayoutRect(toppaneRect.Rect(), topleftpane); |
|
689 |
|
690 // close button |
|
691 cellBtn = AknLayoutScalable_Avkon::vkb2_top_cell_left_pane(aLayoutParam, 0 ,0).LayoutLine(); |
|
692 cellBtnRect.LayoutRect(topleftpaneRect.Rect(), cellBtn); |
|
693 AknPenImageUtils::CalculateGraphicRect( cellBtnRect.Rect(), innerRect ); |
|
694 aDataInfo.iCloseButton.iRect = cellBtnRect.Rect(); |
|
695 aDataInfo.iCloseButton.iInnerRect = innerRect; |
|
696 // option button |
|
697 cellBtn = AknLayoutScalable_Avkon::vkb2_top_cell_left_pane(aLayoutParam, 0 ,1).LayoutLine(); |
|
698 cellBtnRect.LayoutRect(topleftpaneRect.Rect(), cellBtn); |
|
699 AknPenImageUtils::CalculateGraphicRect( cellBtnRect.Rect(), innerRect ); |
|
700 aDataInfo.iOptionButton.iRect = cellBtnRect.Rect(); |
|
701 aDataInfo.iOptionButton.iInnerRect = innerRect; |
|
702 // entry pane |
|
703 topentrypane = AknLayoutScalable_Avkon::vkb2_top_entry_pane(aLayoutParam).LayoutLine(); |
|
704 topentrypaneRect.LayoutRect(toppaneRect.Rect(), topentrypane); |
|
705 aDataInfo.iICF.iRect = topentrypaneRect.Rect(); |
|
706 cellText = AknLayoutScalable_Avkon::vkb2_top_entry_pane_t1(aLayoutParam).LayoutLine(); |
|
707 aDataInfo.iICF.iPromptTextFont = AknLayoutUtils::FontFromId(cellText.iFont, NULL); |
|
708 txt.LayoutText( topentrypaneRect.Rect(), cellText ); |
|
709 aDataInfo.iICF.iPromptTextRect = txt.TextRect(); |
|
710 cellText = AknLayoutScalable_Avkon::vkb2_top_entry_pane_t2(aLayoutParam).LayoutLine(); |
|
711 aDataInfo.iICF.iTextFont = AknLayoutUtils::FontFromId(cellText.iFont, NULL); |
|
712 txt.LayoutText( topentrypaneRect.Rect(), cellText ); |
|
713 aDataInfo.iICF.iTextRect = txt.TextRect(); |
|
714 |
|
715 // ?? need modified later. inner rect is same as outter rect. |
|
716 toprightpane = AknLayoutScalable_Avkon::vkb2_top_grid_right_pane(aLayoutParam).LayoutLine(); |
|
717 toprightpaneRect.LayoutRect(toppaneRect.Rect(), toprightpane); |
|
718 if( isVKB ) |
|
719 { |
|
720 // clear button |
|
721 cellBtn = AknLayoutScalable_Avkon:: |
|
722 vkb2_top_grid_right_pane_g1(aLayoutParam).LayoutLine(); |
|
723 cellBtnRect.LayoutRect(toprightpaneRect.Rect(), cellBtn); |
|
724 AknPenImageUtils::CalculateGraphicRect( cellBtnRect.Rect(), innerRect ); |
|
725 aDataInfo.iClearButton.iRect = cellBtnRect.Rect(); |
|
726 aDataInfo.iClearButton.iInnerRect = innerRect; |
|
727 // move button (VKB) |
|
728 cellBtn = AknLayoutScalable_Avkon:: |
|
729 vkb2_top_grid_right_pane_g4(aLayoutParam).LayoutLine(); |
|
730 cellBtnRect.LayoutRect(toprightpaneRect.Rect(), cellBtn); |
|
731 AknPenImageUtils::CalculateGraphicRect( cellBtnRect.Rect(), innerRect ); |
|
732 aDataInfo.iMoveButton.iRect = cellBtnRect.Rect(); |
|
733 aDataInfo.iMoveButton.iInnerRect = innerRect; |
|
734 |
|
735 } |
|
736 else |
|
737 { |
|
738 // clear button |
|
739 cellBtn = AknLayoutScalable_Avkon::vkb2_top_grid_right_pane_g1(aLayoutType).LayoutLine(); |
|
740 cellBtnRect.LayoutRect(toprightpaneRect.Rect(), cellBtn); |
|
741 AknPenImageUtils::CalculateGraphicRect( cellBtnRect.Rect(), innerRect ); |
|
742 aDataInfo.iClearButton.iRect = cellBtnRect.Rect(); |
|
743 aDataInfo.iClearButton.iInnerRect = innerRect; |
|
744 // left button (FSQ) |
|
745 cellBtn = AknLayoutScalable_Avkon::vkb2_top_grid_right_pane_g2(aLayoutType).LayoutLine(); |
|
746 cellBtnRect.LayoutRect(toprightpaneRect.Rect(), cellBtn); |
|
747 AknPenImageUtils::CalculateGraphicRect( cellBtnRect.Rect(), innerRect ); |
|
748 aDataInfo.iLeftButton.iRect = cellBtnRect.Rect(); |
|
749 aDataInfo.iLeftButton.iInnerRect = innerRect; |
|
750 // right button (FSQ) |
|
751 cellBtn = AknLayoutScalable_Avkon::vkb2_top_grid_right_pane_g3(aLayoutType).LayoutLine(); |
|
752 cellBtnRect.LayoutRect(toprightpaneRect.Rect(), cellBtn); |
|
753 AknPenImageUtils::CalculateGraphicRect( cellBtnRect.Rect(), innerRect ); |
|
754 aDataInfo.iRightButton.iRect = cellBtnRect.Rect(); |
|
755 aDataInfo.iRightButton.iInnerRect = innerRect; |
|
756 } |
|
757 |
|
758 |
|
759 // bottom pane |
|
760 const TInt VKBParamBottom2Range[] = { 6, 8, 8 }; |
|
761 const TInt FSQParamBottom2Range[] = { 0, 2, 4 }; |
|
762 const TInt VKBParamBottom3Range[] = { 7, 9, 9 }; |
|
763 const TInt FSQParamBottom3Range[] = { 1, 3, 5 }; |
|
764 |
|
765 |
|
766 if( isVKB ) |
|
767 { |
|
768 bottompane = AknLayoutScalable_Avkon:: |
|
769 vkb2_area_bottom_pane(KVkbTopAndBottomParam[aLayoutType]).LayoutLine(); |
|
770 } |
|
771 else |
|
772 { |
|
773 bottompane = AknLayoutScalable_Avkon::vkb2_area_bottom_pane(aLayoutParam).LayoutLine(); |
|
774 } |
|
775 bottompaneRect.LayoutRect(aParentWndRect, bottompane); |
|
776 |
|
777 TRect bottomRect = bottompaneRect.Rect(); |
|
778 |
|
779 // Get keypad rect |
|
780 keypadRect.SetRect( toppaneRect.Rect().iTl.iX, |
|
781 toppaneRect.Rect().iBr.iY, |
|
782 bottomRect.iBr.iX, |
|
783 bottomRect.iTl.iY); |
|
784 aDataInfo.iKeypad.iKaypadRect = keypadRect; |
|
785 aDataInfo.iClientRect.SetRect( toppaneRect.Rect().iTl.iX, |
|
786 toppaneRect.Rect().iBr.iY, |
|
787 bottomRect.iBr.iX, |
|
788 bottomRect.iBr.iY); |
|
789 if( isVKB ) |
|
790 { |
|
791 aDataInfo.iQwtRect.SetRect( toppaneRect.Rect().iTl.iX, |
|
792 toppaneRect.Rect().iTl.iY, |
|
793 bottomRect.iBr.iX, |
|
794 bottomRect.iBr.iY ); |
|
795 } |
|
796 else |
|
797 { |
|
798 aDataInfo.iQwtRect = aParentWndRect; |
|
799 } |
|
800 |
|
801 TInt bottomLayoutType = 0; |
|
802 if( isVKB ) |
|
803 { |
|
804 bottomLayoutType = iLafOption & EOption3CellRange ? |
|
805 VKBParamBottom3Range[aLayoutType] : VKBParamBottom2Range[aLayoutType]; |
|
806 } |
|
807 else |
|
808 { |
|
809 bottomLayoutType = iLafOption & EOption3CellRange ? |
|
810 FSQParamBottom3Range[aLayoutType] : FSQParamBottom2Range[aLayoutType]; |
|
811 } |
|
812 |
|
813 bottomgrid = AknLayoutScalable_Avkon::vkb2_area_bottom_grid_pane(bottomLayoutType).LayoutLine(); |
|
814 bottomgridRect.LayoutRect(bottomRect, bottomgrid); |
|
815 |
|
816 TInt maxParam = iLafOption & EOption3CellRange ? 4 : 3; |
|
817 // shift button |
|
818 cellBtn = AknLayoutScalable_Avkon::vkb2_cell_bottom_grid_pane(aLayoutParam, 0, 0).LayoutLine(); |
|
819 cellBtnRect.LayoutRect(bottomgridRect.Rect(), cellBtn); |
|
820 AknPenImageUtils::CalculateGraphicRect( cellBtnRect.Rect(), innerRect ); |
|
821 aDataInfo.iShiftButton.iRect = cellBtnRect.Rect(); |
|
822 aDataInfo.iShiftButton.iInnerRect = innerRect; |
|
823 |
|
824 TPeninputButtonLayoutData btnLayoutData; |
|
825 for( TInt i = 1; i < maxParam; i++ ) |
|
826 { |
|
827 #ifdef LAF_MODIFY |
|
828 if( i == 3 ) |
|
829 { |
|
830 btnLayoutData.iRect = aDataInfo.iRangbar.iCellDataArray[i-2].iRect; |
|
831 btnLayoutData.iRect.Move( btnLayoutData.iRect.Width(), 0 ); |
|
832 AknPenImageUtils::CalculateGraphicRect( btnLayoutData.iRect, innerRect ); |
|
833 btnLayoutData.iInnerRect = innerRect; |
|
834 aDataInfo.iRangbar.iCellDataArray.Append( btnLayoutData ); |
|
835 break; |
|
836 } |
|
837 #endif //LAF_MODIFY |
|
838 // range cell |
|
839 cellBtn = AknLayoutScalable_Avkon::vkb2_cell_bottom_grid_pane(aLayoutParam, i, 0).LayoutLine(); |
|
840 cellBtnRect.LayoutRect(bottomgridRect.Rect(), cellBtn); |
|
841 AknPenImageUtils::CalculateGraphicRect( cellBtnRect.Rect(), innerRect ); |
|
842 btnLayoutData.iRect = cellBtnRect.Rect(); |
|
843 btnLayoutData.iInnerRect = innerRect; |
|
844 |
|
845 aDataInfo.iRangbar.iCellDataArray.Append( btnLayoutData ); |
|
846 } |
|
847 |
|
848 TInt count = aDataInfo.iRangbar.iCellDataArray.Count(); |
|
849 aDataInfo.iRangbar.iRect = TRect( aDataInfo.iRangbar.iCellDataArray[0].iRect.iTl, |
|
850 aDataInfo.iRangbar.iCellDataArray[count - 1].iRect.iBr ); |
|
851 |
|
852 // input mode button ?? need modified later. inner rect is same as outter rect |
|
853 cellBtn = AknLayoutScalable_Avkon::vkb2_area_bottom_pane_g1(bottomLayoutType).LayoutLine(); |
|
854 cellBtnRect.LayoutRect(bottomRect, cellBtn); |
|
855 AknPenImageUtils::CalculateGraphicRect( cellBtnRect.Rect(), innerRect ); |
|
856 aDataInfo.iSwitchButton.iRect = cellBtnRect.Rect(); |
|
857 aDataInfo.iSwitchButton.iInnerRect = innerRect; |
|
858 // enter button |
|
859 cellBtn = AknLayoutScalable_Avkon::vkb2_area_bottom_pane_g2(bottomLayoutType).LayoutLine(); |
|
860 cellBtnRect.LayoutRect(bottomRect, cellBtn); |
|
861 AknPenImageUtils::CalculateGraphicRect( cellBtnRect.Rect(), innerRect ); |
|
862 aDataInfo.iEnterButton.iRect = cellBtnRect.Rect(); |
|
863 aDataInfo.iEnterButton.iInnerRect = innerRect; |
|
864 // space button |
|
865 cellBtn = AknLayoutScalable_Avkon::vkb2_area_bottom_pane_g3(bottomLayoutType).LayoutLine(); |
|
866 cellBtnRect.LayoutRect(bottomRect, cellBtn); |
|
867 aDataInfo.iSpaceButton.iRect = cellBtnRect.Rect(); |
|
868 aDataInfo.iSpaceButton.iRect.iTl = TPoint( aDataInfo.iRangbar.iRect.iBr.iX, |
|
869 aDataInfo.iRangbar.iRect.iTl.iY ); |
|
870 aDataInfo.iSpaceButton.iInnerRect = cellBtnRect.Rect(); |
|
871 // 3 pieces graphics laf info |
|
872 TRect spaceRect, iconRect, tempRect; |
|
873 cellBtn = |
|
874 AknLayoutScalable_Avkon::vkb2_area_bottom_space_btn_pane(bottomLayoutType).LayoutLine(); |
|
875 cellBtnRect.LayoutRect(bottomRect, cellBtn); |
|
876 spaceRect = cellBtnRect.Rect(); |
|
877 cellBtn = |
|
878 AknLayoutScalable_Avkon::vkb2_area_bottom_space_btn_pane_g1(bottomLayoutType).LayoutLine(); |
|
879 cellBtnRect.LayoutRect(spaceRect, cellBtn); |
|
880 iconRect = cellBtnRect.Rect(); |
|
881 TInt nOffsetX = iconRect.iTl.iX - spaceRect.iTl.iX; |
|
882 tempRect = spaceRect; |
|
883 tempRect.Shrink( nOffsetX, 0 ); |
|
884 aDataInfo.iSpaceButtonEx.iIconsFrameRect = tempRect; |
|
885 tempRect.Shrink( iconRect.Width(), 0 ); |
|
886 aDataInfo.iSpaceButtonEx.iMiddleIconRect = tempRect; |
|
887 |
|
888 // preview popup window |
|
889 TAknWindowLineLayout previewWnd, previewWndInner; |
|
890 TAknLayoutRect previewWndRect, previewWndInnerRect; |
|
891 previewWnd = AknLayoutScalable_Avkon::popup_fep_char_preview_window(aLayoutParam).LayoutLine(); |
|
892 previewWndRect.LayoutRect( aParentWndRect, previewWnd ); |
|
893 previewWndInner = AknLayoutScalable_Avkon::bg_popup_fep_char_preview_window_g9().LayoutLine(); |
|
894 previewWndInnerRect.LayoutRect( previewWndRect.Rect(), previewWndInner ); |
|
895 aDataInfo.iPreviewWndRect = previewWndRect.Rect(); |
|
896 aDataInfo.iPreviewWndInnerRect = previewWndInnerRect.Rect(); |
|
897 aDataInfo.iPreviewWndText = AknLayoutScalable_Avkon::popup_fep_char_preview_window_t1( |
|
898 aLayoutParam).LayoutLine(); |
|
899 } |
|
900 |
|
901 // --------------------------------------------------------------------------- |
|
902 // CPeninputLafDataCommon::SetLayoutType( TInt aLayoutType ) |
|
903 // (other items were commented in a header) |
|
904 // --------------------------------------------------------------------------- |
|
905 // |
|
906 inline void MPeninputLafDataCommon::SetLayoutType( TInt aLayoutType ) |
|
907 { |
|
908 iLayoutType = aLayoutType; |
|
909 } |
|
910 |
|
911 // --------------------------------------------------------------------------- |
|
912 // CPeninputLafDataCommon::LayoutType |
|
913 // (other items were commented in a header) |
|
914 // --------------------------------------------------------------------------- |
|
915 // |
|
916 inline TInt MPeninputLafDataCommon::LayoutType() const |
|
917 { |
|
918 return iLayoutType; |
|
919 } |
|
920 |
|
921 // --------------------------------------------------------------------------- |
|
922 // CPeninputLafDataCommon::SetLafOption |
|
923 // (other items were commented in a header) |
|
924 // --------------------------------------------------------------------------- |
|
925 // |
|
926 inline void MPeninputLafDataCommon::SetLafOption( TPeninputVkbLafOption aLafOption ) |
|
927 { |
|
928 iLafOption = aLafOption; |
|
929 } |
|
930 |
|
931 // --------------------------------------------------------------------------- |
|
932 // CPeninputLafDataCommon::SetLafOption |
|
933 // (other items were commented in a header) |
|
934 // --------------------------------------------------------------------------- |
|
935 // |
|
936 inline TPeninputVkbLafOption MPeninputLafDataCommon::LafOption() const |
|
937 { |
|
938 return iLafOption; |
|
939 } |
|
940 |
|
941 // --------------------------------------------------------------------------- |
|
942 // CPeninputLafDataVKB::NewL( TInt aLayoutType ) |
|
943 // (other items were commented in a header) |
|
944 // --------------------------------------------------------------------------- |
|
945 // |
|
946 CPeninputLafDataVKB* CPeninputLafDataVKB::NewL( TInt aLayoutType ) |
|
947 { |
|
948 CPeninputLafDataVKB* self = NewLC( aLayoutType ); |
|
949 CleanupStack::Pop(); |
|
950 return self; |
|
951 } |
|
952 // --------------------------------------------------------------------------- |
|
953 // CPeninputLafDataVKB::NewL( TInt aLayoutType ) |
|
954 // (other items were commented in a header) |
|
955 // --------------------------------------------------------------------------- |
|
956 // |
|
957 CPeninputLafDataVKB* CPeninputLafDataVKB::NewLC( TInt aLayoutType ) |
|
958 { |
|
959 CPeninputLafDataVKB* self = new ( ELeave ) CPeninputLafDataVKB( aLayoutType ); |
|
960 CleanupStack::PushL( self ); |
|
961 self->ConstructL(); |
|
962 |
|
963 return self; |
|
964 } |
|
965 CPeninputLafDataVKB::~CPeninputLafDataVKB() |
|
966 { |
|
967 DestoryDataCommon(); |
|
968 } |
|
969 |
|
970 |
|
971 // --------------------------------------------------------------------------- |
|
972 // CPeninputLafDataVKB::NewL( TInt aLayoutType ) |
|
973 // (other items were commented in a header) |
|
974 // --------------------------------------------------------------------------- |
|
975 // |
|
976 CPeninputLafDataVKB::CPeninputLafDataVKB( TInt aLayoutType ) |
|
977 { |
|
978 SetLayoutType( aLayoutType ); |
|
979 } |
|
980 // --------------------------------------------------------------------------- |
|
981 // CPeninputLafDataVKB::NewL( TInt aLayoutType ) |
|
982 // (other items were commented in a header) |
|
983 // --------------------------------------------------------------------------- |
|
984 // |
|
985 void CPeninputLafDataVKB::ReadLafInfoL() |
|
986 { |
|
987 // clean up all the data |
|
988 iLayoutDataInfo.ResetAndDestroy(); |
|
989 |
|
990 CPeninputQwtLayoutDataInfo* dataInfo = new( ELeave ) CPeninputQwtLayoutDataInfo; |
|
991 |
|
992 TAknWindowLineLayout appWnd; |
|
993 TAknWindowLineLayout wndLayout; |
|
994 TAknWindowLineLayout keypad, rowpane, cellpane; |
|
995 |
|
996 TAknLayoutRect keypadRect, rowpaneRect, cellpaneRect; |
|
997 TAknLayoutRect wndRect; |
|
998 TAknLayoutText keyTextLayout; |
|
999 TAknTextLineLayout keyText; |
|
1000 TRect keyRect, keyCharRect; |
|
1001 // -----------------------Portray Mode-------------------------- |
|
1002 appWnd = AknLayoutScalable_Avkon::application_window(0).LayoutLine(); |
|
1003 //iAppWndRect = appWnd.Rect(); |
|
1004 |
|
1005 // ==================10x3==================== |
|
1006 wndLayout = AknLayoutScalable_Avkon::popup_fep_vkb2_window(3).LayoutLine(); |
|
1007 wndRect.LayoutRect(appWnd.Rect(), wndLayout); |
|
1008 // top pane and bottom pane |
|
1009 GetTopAndBottomPaneInfo( wndRect.Rect(), ELayout10x3, 3, *dataInfo ); |
|
1010 // keypad |
|
1011 keyText = AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_t1(0).LayoutLine(); |
|
1012 dataInfo->iKeypad.iTextLayout = keyText; |
|
1013 dataInfo->iKeypad.iFont = AknLayoutUtils::FontFromId(keyText.iFont, NULL); |
|
1014 //dataInfo->iKeypad.iTxtRect = keyText.TextRect(); |
|
1015 |
|
1016 keypad = AknLayoutScalable_Avkon:: |
|
1017 vkb2_area_keypad_pane(KVkbTopAndBottomParam[ELayout10x3]).LayoutLine(); |
|
1018 keypadRect.LayoutRect(wndRect.Rect(), keypad); |
|
1019 //iKeypadRect10x3 = keypadRect.Rect(); |
|
1020 for( TInt i = 0; i < KKeypadLayout[0][1]; i++) |
|
1021 { |
|
1022 for( TInt j = 0; j < KKeypadLayout[0][0]; j++) |
|
1023 { |
|
1024 rowpane = AknLayoutScalable_Avkon::vkb2_row_keypad_pane(2, 0, i).LayoutLine(); |
|
1025 rowpaneRect.LayoutRect(keypadRect.Rect(), rowpane); |
|
1026 cellpane = (*cell_pane_func[j])(0).LayoutLine(); |
|
1027 cellpaneRect.LayoutRect(rowpaneRect.Rect(), cellpane); |
|
1028 keyRect = cellpaneRect.Rect(); |
|
1029 keyRect.Move( -keypadRect.Rect().iTl.iX, -keypadRect.Rect().iTl.iY ); |
|
1030 #ifdef LAF_MODIFY |
|
1031 keyRect.iTl.iX = KKeypadRectXPoint10x[j]; |
|
1032 keyRect.SetWidth( KKeypadCellWidth10x[j] ); |
|
1033 #endif //LAF_MODIFY |
|
1034 dataInfo->iKeypad.iRects.AppendL(keyRect); |
|
1035 keyTextLayout.LayoutText(keyRect, keyText); |
|
1036 dataInfo->iKeypad.iCharRects.AppendL(keyTextLayout.TextRect()); |
|
1037 } |
|
1038 } |
|
1039 iLayoutDataInfo.AppendL( dataInfo ); |
|
1040 |
|
1041 // ==================11x3==================== |
|
1042 dataInfo = new( ELeave ) CPeninputQwtLayoutDataInfo; |
|
1043 wndLayout = AknLayoutScalable_Avkon::popup_fep_vkb2_window(1).LayoutLine(); |
|
1044 wndRect.LayoutRect(appWnd.Rect(), wndLayout); |
|
1045 // top pane and bottom pane |
|
1046 GetTopAndBottomPaneInfo( wndRect.Rect(), ELayout11x3, 4, *dataInfo ); |
|
1047 // keypad |
|
1048 keyText = AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_t1(0).LayoutLine(); |
|
1049 dataInfo->iKeypad.iTextLayout = keyText; |
|
1050 dataInfo->iKeypad.iFont = AknLayoutUtils::FontFromId(keyText.iFont, NULL); |
|
1051 |
|
1052 keypad = AknLayoutScalable_Avkon:: |
|
1053 vkb2_area_keypad_pane(KVkbTopAndBottomParam[ELayout11x3]).LayoutLine(); |
|
1054 keypadRect.LayoutRect(wndRect.Rect(), keypad); |
|
1055 for( TInt i = 0; i < KKeypadLayout[1][1]; i++) |
|
1056 { |
|
1057 for( TInt j = 0; j < KKeypadLayout[1][0]; j++) |
|
1058 { |
|
1059 rowpane = AknLayoutScalable_Avkon::vkb2_row_keypad_pane(0, 0, i).LayoutLine(); |
|
1060 rowpaneRect.LayoutRect(keypadRect.Rect(), rowpane); |
|
1061 cellpane = (*cell_pane_func[j])(1).LayoutLine(); |
|
1062 cellpaneRect.LayoutRect(rowpaneRect.Rect(), cellpane); |
|
1063 keyRect = cellpaneRect.Rect(); |
|
1064 keyRect.Move( -keypadRect.Rect().iTl.iX, -keypadRect.Rect().iTl.iY ); |
|
1065 #ifdef LAF_MODIFY |
|
1066 keyRect.iTl.iX = KKeypadRectXPoint11x[j]; |
|
1067 keyRect.SetWidth( KKeypadCellWidth11x[j] ); |
|
1068 #endif //LAF_MODIFY |
|
1069 dataInfo->iKeypad.iRects.AppendL(keyRect); |
|
1070 keyTextLayout.LayoutText(keyRect, keyText); |
|
1071 dataInfo->iKeypad.iCharRects.AppendL(keyTextLayout.TextRect()); |
|
1072 } |
|
1073 } |
|
1074 iLayoutDataInfo.AppendL( dataInfo ); |
|
1075 |
|
1076 // ==================11x4==================== |
|
1077 dataInfo = new( ELeave ) CPeninputQwtLayoutDataInfo; |
|
1078 wndLayout = AknLayoutScalable_Avkon::popup_fep_vkb2_window(2).LayoutLine(); |
|
1079 wndRect.LayoutRect(appWnd.Rect(), wndLayout); |
|
1080 // top pane and bottom pane |
|
1081 GetTopAndBottomPaneInfo( wndRect.Rect(), ELayout11x4, 4, *dataInfo ); |
|
1082 // keypad |
|
1083 keyText = AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_t1(0).LayoutLine(); |
|
1084 dataInfo->iKeypad.iTextLayout = keyText; |
|
1085 dataInfo->iKeypad.iFont = AknLayoutUtils::FontFromId(keyText.iFont, NULL); |
|
1086 |
|
1087 keypad = AknLayoutScalable_Avkon:: |
|
1088 vkb2_area_keypad_pane(KVkbTopAndBottomParam[ELayout11x4]).LayoutLine(); |
|
1089 keypadRect.LayoutRect(wndRect.Rect(), keypad); |
|
1090 for( TInt i = 0; i < KKeypadLayout[2][1]; i++) |
|
1091 { |
|
1092 for( TInt j = 0; j < KKeypadLayout[2][0]; j++) |
|
1093 { |
|
1094 rowpane = AknLayoutScalable_Avkon::vkb2_row_keypad_pane(1, 0, i).LayoutLine(); |
|
1095 rowpaneRect.LayoutRect(keypadRect.Rect(), rowpane); |
|
1096 cellpane = (*cell_pane_func[j])(1).LayoutLine(); |
|
1097 cellpaneRect.LayoutRect(rowpaneRect.Rect(), cellpane); |
|
1098 keyRect = cellpaneRect.Rect(); |
|
1099 keyRect.Move( -keypadRect.Rect().iTl.iX, -keypadRect.Rect().iTl.iY ); |
|
1100 #ifdef LAF_MODIFY |
|
1101 keyRect.iTl.iX = KKeypadRectXPoint11x[j]; |
|
1102 keyRect.SetWidth( KKeypadCellWidth11x[j] ); |
|
1103 #endif //LAF_MODIFY |
|
1104 dataInfo->iKeypad.iRects.AppendL(keyRect); |
|
1105 keyTextLayout.LayoutText(keyRect, keyText); |
|
1106 dataInfo->iKeypad.iCharRects.AppendL(keyTextLayout.TextRect()); |
|
1107 } |
|
1108 } |
|
1109 iLayoutDataInfo.AppendL( dataInfo ); |
|
1110 |
|
1111 // ==================9x3==================== |
|
1112 dataInfo = new( ELeave ) CPeninputQwtLayoutDataInfo; |
|
1113 wndLayout = AknLayoutScalable_Avkon::popup_fep_vkb2_window(3).LayoutLine(); |
|
1114 wndRect.LayoutRect(appWnd.Rect(), wndLayout); |
|
1115 // top pane and bottom pane |
|
1116 GetTopAndBottomPaneInfo( wndRect.Rect(), ELayout10x3, 3, *dataInfo ); |
|
1117 // keypad |
|
1118 keyText = AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_t1(0).LayoutLine(); |
|
1119 dataInfo->iKeypad.iTextLayout = keyText; |
|
1120 dataInfo->iKeypad.iFont = AknLayoutUtils::FontFromId(keyText.iFont, NULL); |
|
1121 //dataInfo->iKeypad.iTxtRect = keyText.TextRect(); |
|
1122 |
|
1123 keypad = AknLayoutScalable_Avkon:: |
|
1124 vkb2_area_keypad_pane(KVkbTopAndBottomParam[ELayout10x3]).LayoutLine(); |
|
1125 keypadRect.LayoutRect(wndRect.Rect(), keypad); |
|
1126 //iKeypadRect10x3 = keypadRect.Rect(); |
|
1127 for( TInt i = 0; i < KKeypadLayout[3][1]; i++) |
|
1128 { |
|
1129 for( TInt j = 0; j < KKeypadLayout[3][0]; j++) |
|
1130 { |
|
1131 rowpane = AknLayoutScalable_Avkon::vkb2_row_keypad_pane(2, 0, i).LayoutLine(); |
|
1132 rowpaneRect.LayoutRect(keypadRect.Rect(), rowpane); |
|
1133 cellpane = (*cell_pane_func[j])(0).LayoutLine(); |
|
1134 cellpaneRect.LayoutRect(rowpaneRect.Rect(), cellpane); |
|
1135 keyRect = cellpaneRect.Rect(); |
|
1136 keyRect.Move( -keypadRect.Rect().iTl.iX, -keypadRect.Rect().iTl.iY ); |
|
1137 #ifdef LAF_MODIFY |
|
1138 keyRect.iTl.iX = KKeypadRectXPoint10x[j]; |
|
1139 keyRect.SetWidth( KKeypadCellWidth10x[j] ); |
|
1140 #endif //LAF_MODIFY |
|
1141 dataInfo->iKeypad.iRects.AppendL(keyRect); |
|
1142 keyTextLayout.LayoutText(keyRect, keyText); |
|
1143 dataInfo->iKeypad.iCharRects.AppendL(keyTextLayout.TextRect()); |
|
1144 } |
|
1145 } |
|
1146 |
|
1147 // for table up & down keys |
|
1148 rowpane = AknLayoutScalable_Avkon::vkb2_row_keypad_pane(2, 0, 0).LayoutLine(); |
|
1149 rowpaneRect.LayoutRect(keypadRect.Rect(), rowpane); |
|
1150 cellpane = (*cell_pane_func[9])(0).LayoutLine(); |
|
1151 cellpaneRect.LayoutRect(rowpaneRect.Rect(), cellpane); |
|
1152 keyRect = cellpaneRect.Rect(); |
|
1153 keyRect.Move( -keypadRect.Rect().iTl.iX, -keypadRect.Rect().iTl.iY ); |
|
1154 #ifdef LAF_MODIFY |
|
1155 keyRect.iTl.iX = KKeypadRectXPoint10x[9]; |
|
1156 keyRect.SetWidth( KKeypadCellWidth10x[9] ); |
|
1157 #endif //LAF_MODIFY |
|
1158 keyRect = cellpaneRect.Rect(); |
|
1159 TInt keyHeight=keyRect.Height(); |
|
1160 TInt keyWidth=37; |
|
1161 keyRect.iTl.iX = keypadRect.Rect().iBr.iX - keyWidth; |
|
1162 keyRect.iTl.iY = keypadRect.Rect().iTl.iY; |
|
1163 keyRect.SetHeight(keyHeight); |
|
1164 keyRect.SetWidth(keyWidth); |
|
1165 TRect rectTableUp=keyRect; |
|
1166 TRect rectTableDown=keyRect; |
|
1167 TRect rectTablePage=keyRect; |
|
1168 |
|
1169 rectTablePage.Move(0,keyHeight); |
|
1170 rectTableDown.Move(0,keyHeight*2); |
|
1171 |
|
1172 dataInfo->iTableUpButton.iRect=rectTableUp; |
|
1173 dataInfo->iTableUpButton.iInnerRect=rectTableUp; |
|
1174 dataInfo->iTableUpButton.iInnerRect.Shrink(5,5); |
|
1175 dataInfo->iTableDownButton.iRect=rectTableDown; |
|
1176 dataInfo->iTableDownButton.iInnerRect=rectTableDown; |
|
1177 dataInfo->iTableDownButton.iInnerRect.Shrink(5,5); |
|
1178 dataInfo->iTablePageLabel.iRect=rectTablePage; |
|
1179 dataInfo->iTablePageLabel.iInnerRect=rectTablePage; |
|
1180 dataInfo->iTablePageLabel.iInnerRect.Shrink(5,5); |
|
1181 |
|
1182 dataInfo->iKeypad.iKaypadRect.iBr.iX-=keyWidth; |
|
1183 |
|
1184 iLayoutDataInfo.AppendL( dataInfo ); |
|
1185 |
|
1186 // ==================3x3==================== |
|
1187 dataInfo = new( ELeave ) CPeninputQwtLayoutDataInfo; |
|
1188 wndLayout = AknLayoutScalable_Avkon::popup_fep_vkb2_window(3).LayoutLine(); |
|
1189 wndRect.LayoutRect(appWnd.Rect(), wndLayout); |
|
1190 // top pane and bottom pane |
|
1191 GetTopAndBottomPaneInfo( wndRect.Rect(), ELayout10x3, 3, *dataInfo ); |
|
1192 // keypad |
|
1193 keyText = AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_t1(0).LayoutLine(); |
|
1194 dataInfo->iKeypad.iTextLayout = keyText; |
|
1195 // TODO: |
|
1196 //dataInfo->iKeypad.iFont = AknLayoutUtils::FontFromId(keyText.iFont, NULL); |
|
1197 dataInfo->iKeypad.iFont = AknLayoutUtils::FontFromId(0x82800000, NULL); |
|
1198 |
|
1199 keypad = AknLayoutScalable_Avkon:: |
|
1200 vkb2_area_keypad_pane(KVkbTopAndBottomParam[ELayout10x3]).LayoutLine(); |
|
1201 keypadRect.LayoutRect(wndRect.Rect(), keypad); |
|
1202 //iKeypadRect10x3 = keypadRect.Rect(); |
|
1203 for( TInt i = 0; i < KKeypadLayout[4][1]; i++) |
|
1204 { |
|
1205 for( TInt j = 0; j < KKeypadLayout[4][0]; j++) |
|
1206 { |
|
1207 rowpane = AknLayoutScalable_Avkon::vkb2_row_keypad_pane(2, 0, i).LayoutLine(); |
|
1208 rowpaneRect.LayoutRect(keypadRect.Rect(), rowpane); |
|
1209 cellpane = (*cell_pane_func[j])(0).LayoutLine(); |
|
1210 cellpaneRect.LayoutRect(rowpaneRect.Rect(), cellpane); |
|
1211 keyRect = cellpaneRect.Rect(); |
|
1212 keyRect.Move( -keypadRect.Rect().iTl.iX, -keypadRect.Rect().iTl.iY ); |
|
1213 #ifdef LAF_MODIFY |
|
1214 keyRect.iTl.iX = KKeypadRectXPoint3x[j]; |
|
1215 keyRect.SetWidth( KKeypadCellWidth3x[j] ); |
|
1216 #endif //LAF_MODIFY |
|
1217 dataInfo->iKeypad.iRects.AppendL(keyRect); |
|
1218 keyTextLayout.LayoutText(keyRect, keyText); |
|
1219 dataInfo->iKeypad.iCharRects.AppendL(keyTextLayout.TextRect()); |
|
1220 } |
|
1221 } |
|
1222 |
|
1223 dataInfo->iTableUpButton.iRect=rectTableUp; |
|
1224 dataInfo->iTableUpButton.iInnerRect=rectTableUp; |
|
1225 dataInfo->iTableUpButton.iInnerRect.Shrink(5,5); |
|
1226 dataInfo->iTableDownButton.iRect=rectTableDown; |
|
1227 dataInfo->iTableDownButton.iInnerRect=rectTableDown; |
|
1228 dataInfo->iTableDownButton.iInnerRect.Shrink(5,5); |
|
1229 dataInfo->iTablePageLabel.iRect=rectTablePage; |
|
1230 dataInfo->iTablePageLabel.iInnerRect=rectTablePage; |
|
1231 dataInfo->iTablePageLabel.iInnerRect.Shrink(5,5); |
|
1232 |
|
1233 dataInfo->iKeypad.iKaypadRect.iBr.iX-=keyWidth; |
|
1234 |
|
1235 iLayoutDataInfo.AppendL( dataInfo ); |
|
1236 |
|
1237 } |
|
1238 // --------------------------------------------------------------------------- |
|
1239 // CPeninputLafDataFSQ::NewL( TInt aLayoutType ) |
|
1240 // (other items were commented in a header) |
|
1241 // --------------------------------------------------------------------------- |
|
1242 // |
|
1243 CPeninputLafDataFSQ* CPeninputLafDataFSQ::NewL( TInt aLayoutType ) |
|
1244 { |
|
1245 CPeninputLafDataFSQ* self = NewLC( aLayoutType ); |
|
1246 CleanupStack::Pop(); |
|
1247 return self; |
|
1248 } |
|
1249 // --------------------------------------------------------------------------- |
|
1250 // CPeninputLafDataFSQ::NewLC( TInt aLayoutType ) |
|
1251 // (other items were commented in a header) |
|
1252 // --------------------------------------------------------------------------- |
|
1253 // |
|
1254 CPeninputLafDataFSQ* CPeninputLafDataFSQ::NewLC( TInt aLayoutType ) |
|
1255 { |
|
1256 CPeninputLafDataFSQ* self = new ( ELeave ) CPeninputLafDataFSQ( aLayoutType ); |
|
1257 CleanupStack::PushL( self ); |
|
1258 self->ConstructL(); |
|
1259 |
|
1260 return self; |
|
1261 |
|
1262 } |
|
1263 |
|
1264 CPeninputLafDataFSQ::~CPeninputLafDataFSQ() |
|
1265 { |
|
1266 DestoryDataCommon(); |
|
1267 } |
|
1268 |
|
1269 // --------------------------------------------------------------------------- |
|
1270 // CPeninputLafDataFSQ::CPeninputLafDataFSQ( TInt aLayoutType ) |
|
1271 // (other items were commented in a header) |
|
1272 // --------------------------------------------------------------------------- |
|
1273 // |
|
1274 CPeninputLafDataFSQ::CPeninputLafDataFSQ( TInt aLayoutType ) |
|
1275 { |
|
1276 SetLayoutType( aLayoutType ); |
|
1277 } |
|
1278 // --------------------------------------------------------------------------- |
|
1279 // CPeninputLafDataFSQ::ReadLafInfo() |
|
1280 // (other items were commented in a header) |
|
1281 // --------------------------------------------------------------------------- |
|
1282 // |
|
1283 void CPeninputLafDataFSQ::ReadLafInfoL() |
|
1284 { |
|
1285 // clean up all the data |
|
1286 iLayoutDataInfo.ResetAndDestroy(); |
|
1287 |
|
1288 CPeninputQwtLayoutDataInfo* dataInfo = new( ELeave ) CPeninputQwtLayoutDataInfo; |
|
1289 TAknWindowLineLayout appWnd; |
|
1290 TAknWindowLineLayout wndLayout; |
|
1291 TAknWindowLineLayout keypad, cellpane; |
|
1292 |
|
1293 TAknLayoutRect keypadRect, cellpaneRect; |
|
1294 TAknLayoutRect wndRect; |
|
1295 TAknLayoutText keyTextLayout; |
|
1296 TAknTextLineLayout keyText; |
|
1297 TRect keyRect; |
|
1298 |
|
1299 // -----------------------Landscape Mode-------------------------- |
|
1300 appWnd = AknLayoutScalable_Avkon::application_window(0).LayoutLine(); |
|
1301 wndLayout = AknLayoutScalable_Avkon::popup_fep_vkb2_window(0).LayoutLine(); |
|
1302 wndRect.LayoutRect(appWnd.Rect(), wndLayout); |
|
1303 // ==================10x3==================== |
|
1304 // top pane and bottom pane |
|
1305 GetTopAndBottomPaneInfo( wndRect.Rect(), ELayout10x3, 0, *dataInfo ); |
|
1306 // keypad |
|
1307 keyText = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane_t1(0).LayoutLine(); |
|
1308 dataInfo->iKeypad.iTextLayout = keyText; |
|
1309 dataInfo->iKeypad.iFont = AknLayoutUtils::FontFromId(keyText.iFont, NULL); |
|
1310 //dataInfo->iKeypad.iTxtRect = keyText.TextRect(); |
|
1311 |
|
1312 keypad = AknLayoutScalable_Avkon::vkb2_area_keypad_pane(0).LayoutLine(); |
|
1313 keypadRect.LayoutRect(wndRect.Rect(), keypad); |
|
1314 //iKeypadRect10x3 = keypadRect.Rect(); |
|
1315 for( TInt i = 0; i < KKeypadLayout[0][1]; i++) |
|
1316 { |
|
1317 for( TInt j = 0; j < KKeypadLayout[0][0]; j++) |
|
1318 { |
|
1319 cellpane = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane(0, j, i).LayoutLine(); |
|
1320 cellpaneRect.LayoutRect(keypadRect.Rect(), cellpane); |
|
1321 keyRect = cellpaneRect.Rect(); |
|
1322 keyRect.Move( -keypadRect.Rect().iTl.iX, -keypadRect.Rect().iTl.iY ); |
|
1323 dataInfo->iKeypad.iRects.AppendL(keyRect); |
|
1324 keyTextLayout.LayoutText(keyRect, keyText); |
|
1325 dataInfo->iKeypad.iCharRects.AppendL(keyTextLayout.TextRect()); |
|
1326 } |
|
1327 } |
|
1328 keyText = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane_t1(0).LayoutLine(); |
|
1329 dataInfo->iKeypad.iFont = AknLayoutUtils::FontFromId(keyText.iFont, NULL); |
|
1330 //dataInfo->iKeypad.iTxtRect = keyText.TextRect(); |
|
1331 iLayoutDataInfo.AppendL( dataInfo ); |
|
1332 |
|
1333 // ==================11x3==================== |
|
1334 dataInfo = new( ELeave ) CPeninputQwtLayoutDataInfo; |
|
1335 wndLayout = AknLayoutScalable_Avkon::popup_fep_vkb2_window(0).LayoutLine(); |
|
1336 wndRect.LayoutRect(appWnd.Rect(), wndLayout); |
|
1337 // top pane and bottom pane |
|
1338 GetTopAndBottomPaneInfo( wndRect.Rect(), ELayout11x3, 1, *dataInfo ); |
|
1339 // keypad |
|
1340 keypad = AknLayoutScalable_Avkon::vkb2_area_keypad_pane(1).LayoutLine(); |
|
1341 keypadRect.LayoutRect(wndRect.Rect(), keypad); |
|
1342 for( TInt i = 0; i < KKeypadLayout[1][1]; i++) |
|
1343 { |
|
1344 for( TInt j = 0; j < KKeypadLayout[1][0]; j++) |
|
1345 { |
|
1346 cellpane = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane(1, j, i).LayoutLine(); |
|
1347 cellpaneRect.LayoutRect(keypadRect.Rect(), cellpane); |
|
1348 keyRect = cellpaneRect.Rect(); |
|
1349 keyRect.Move( -keypadRect.Rect().iTl.iX, -keypadRect.Rect().iTl.iY ); |
|
1350 dataInfo->iKeypad.iRects.AppendL(keyRect); |
|
1351 keyTextLayout.LayoutText(keyRect, keyText); |
|
1352 dataInfo->iKeypad.iCharRects.AppendL(keyTextLayout.TextRect()); |
|
1353 } |
|
1354 } |
|
1355 keyText = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane_t1(1).LayoutLine(); |
|
1356 dataInfo->iKeypad.iTextLayout = keyText; |
|
1357 dataInfo->iKeypad.iFont = AknLayoutUtils::FontFromId(keyText.iFont, NULL); |
|
1358 //dataInfo->iKeypad.iTxtRect = keyText.TextRect(); |
|
1359 iLayoutDataInfo.AppendL( dataInfo ); |
|
1360 |
|
1361 // ==================11x4==================== |
|
1362 dataInfo = new( ELeave ) CPeninputQwtLayoutDataInfo; |
|
1363 wndLayout = AknLayoutScalable_Avkon::popup_fep_vkb2_window(0).LayoutLine(); |
|
1364 wndRect.LayoutRect(appWnd.Rect(), wndLayout); |
|
1365 // top pane and bottom pane |
|
1366 GetTopAndBottomPaneInfo( wndRect.Rect(), ELayout11x4, 2, *dataInfo ); |
|
1367 // keypad |
|
1368 keypad = AknLayoutScalable_Avkon::vkb2_area_keypad_pane(2).LayoutLine(); |
|
1369 keypadRect.LayoutRect(wndRect.Rect(), keypad); |
|
1370 for( TInt i = 0; i < KKeypadLayout[2][1]; i++) |
|
1371 { |
|
1372 for( TInt j = 0; j < KKeypadLayout[2][0]; j++) |
|
1373 { |
|
1374 cellpane = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane(2, j, i).LayoutLine(); |
|
1375 cellpaneRect.LayoutRect(keypadRect.Rect(), cellpane); |
|
1376 keyRect = cellpaneRect.Rect(); |
|
1377 keyRect.Move( -keypadRect.Rect().iTl.iX, -keypadRect.Rect().iTl.iY ); |
|
1378 dataInfo->iKeypad.iRects.AppendL(keyRect); |
|
1379 keyTextLayout.LayoutText(keyRect, keyText); |
|
1380 dataInfo->iKeypad.iCharRects.AppendL(keyTextLayout.TextRect()); |
|
1381 } |
|
1382 } |
|
1383 keyText = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane_t1(2).LayoutLine(); |
|
1384 dataInfo->iKeypad.iTextLayout = keyText; |
|
1385 dataInfo->iKeypad.iFont = AknLayoutUtils::FontFromId(keyText.iFont, NULL); |
|
1386 //dataInfo->iKeypad.iTxtRect = keyText.TextRect(); |
|
1387 iLayoutDataInfo.AppendL( dataInfo ); |
|
1388 |
|
1389 // ==================10x3==================== |
|
1390 dataInfo = new( ELeave ) CPeninputQwtLayoutDataInfo; |
|
1391 wndLayout = AknLayoutScalable_Avkon::popup_fep_vkb2_window(0).LayoutLine(); |
|
1392 wndRect.LayoutRect(appWnd.Rect(), wndLayout); |
|
1393 // top pane and bottom pane |
|
1394 GetTopAndBottomPaneInfo( wndRect.Rect(), ELayout10x3, 0, *dataInfo ); |
|
1395 // keypad |
|
1396 keypad = AknLayoutScalable_Avkon::vkb2_area_keypad_pane(0).LayoutLine(); |
|
1397 keypadRect.LayoutRect(wndRect.Rect(), keypad); |
|
1398 for( TInt i = 0; i < KKeypadLayout[3][1]; i++) |
|
1399 { |
|
1400 for( TInt j = 0; j < KKeypadLayout[3][0]; j++) |
|
1401 { |
|
1402 cellpane = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane(0, j, i).LayoutLine(); |
|
1403 cellpaneRect.LayoutRect(keypadRect.Rect(), cellpane); |
|
1404 keyRect = cellpaneRect.Rect(); |
|
1405 keyRect.Move( -keypadRect.Rect().iTl.iX, -keypadRect.Rect().iTl.iY ); |
|
1406 dataInfo->iKeypad.iRects.AppendL(keyRect); |
|
1407 keyTextLayout.LayoutText(keyRect, keyText); |
|
1408 dataInfo->iKeypad.iCharRects.AppendL(keyTextLayout.TextRect()); |
|
1409 } |
|
1410 } |
|
1411 keyText = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane_t1(0).LayoutLine(); |
|
1412 dataInfo->iKeypad.iTextLayout = keyText; |
|
1413 dataInfo->iKeypad.iFont = AknLayoutUtils::FontFromId(keyText.iFont, NULL); |
|
1414 |
|
1415 // for table up & down |
|
1416 TRect rectTableUp; |
|
1417 TRect rectTableDown; |
|
1418 TRect rectTablePage; |
|
1419 TRect refRect; |
|
1420 TRect refInnerRect; |
|
1421 |
|
1422 refRect=dataInfo->iSwitchButton.iRect; |
|
1423 refInnerRect=dataInfo->iSwitchButton.iInnerRect; |
|
1424 |
|
1425 rectTableUp=refRect; |
|
1426 rectTableUp.Move(0,-refRect.Height()*3); |
|
1427 rectTablePage=refRect; |
|
1428 rectTablePage.Move(0,-refRect.Height()*2); |
|
1429 rectTableDown=refRect; |
|
1430 rectTableDown.Move(0,-refRect.Height()); |
|
1431 |
|
1432 dataInfo->iTableUpButton.iRect=rectTableUp; |
|
1433 dataInfo->iTableUpButton.iInnerRect=rectTableUp; |
|
1434 dataInfo->iTableUpButton.iInnerRect.Shrink(5,5); |
|
1435 dataInfo->iTableDownButton.iRect=rectTableDown; |
|
1436 dataInfo->iTableDownButton.iInnerRect=rectTableDown; |
|
1437 dataInfo->iTableDownButton.iInnerRect.Shrink(5,5); |
|
1438 dataInfo->iTablePageLabel.iRect=rectTablePage; |
|
1439 dataInfo->iTablePageLabel.iInnerRect=rectTablePage; |
|
1440 dataInfo->iTablePageLabel.iInnerRect.Shrink(5,5); |
|
1441 |
|
1442 // for shrinking whole keypad rect |
|
1443 dataInfo->iKeypad.iKaypadRect.iBr.iX-=dataInfo->iSwitchButton.iRect.Width(); |
|
1444 |
|
1445 //dataInfo->iKeypad.iTxtRect = keyText.TextRect(); |
|
1446 iLayoutDataInfo.AppendL( dataInfo ); |
|
1447 |
|
1448 // ==================3x3==================== |
|
1449 dataInfo = new( ELeave ) CPeninputQwtLayoutDataInfo; |
|
1450 wndLayout = AknLayoutScalable_Avkon::popup_fep_vkb2_window(0).LayoutLine(); |
|
1451 wndRect.LayoutRect(appWnd.Rect(), wndLayout); |
|
1452 // top pane and bottom pane |
|
1453 GetTopAndBottomPaneInfo( wndRect.Rect(), ELayout10x3, 0, *dataInfo ); |
|
1454 //dataInfo->iKeypad.iKaypadRect.iBr.iX-=dataInfo->iSwitchButton.iRect.Width(); |
|
1455 // keypad |
|
1456 keypad = AknLayoutScalable_Avkon::vkb2_area_keypad_pane(0).LayoutLine(); |
|
1457 keypadRect.LayoutRect(wndRect.Rect(), keypad); |
|
1458 for( TInt i = 0; i < KKeypadLayout[4][1]; i++) |
|
1459 { |
|
1460 for( TInt j = 0; j < KKeypadLayout[4][0]; j++) |
|
1461 { |
|
1462 cellpane = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane(0, j*3, i).LayoutLine(); |
|
1463 //cellpane.il*=3; |
|
1464 cellpane.iW*=3; |
|
1465 cellpaneRect.LayoutRect(keypadRect.Rect(), cellpane); |
|
1466 keyRect = cellpaneRect.Rect(); |
|
1467 keyRect.Move( -keypadRect.Rect().iTl.iX, -keypadRect.Rect().iTl.iY ); |
|
1468 dataInfo->iKeypad.iRects.AppendL(keyRect); |
|
1469 keyTextLayout.LayoutText(keyRect, keyText); |
|
1470 dataInfo->iKeypad.iCharRects.AppendL(keyTextLayout.TextRect()); |
|
1471 } |
|
1472 } |
|
1473 keyText = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane_t1(0).LayoutLine(); |
|
1474 dataInfo->iKeypad.iTextLayout = keyText; |
|
1475 dataInfo->iKeypad.iFont = AknLayoutUtils::FontFromId(keyText.iFont, NULL); |
|
1476 //dataInfo->iKeypad.iTxtRect = keyText.TextRect(); |
|
1477 |
|
1478 // for table up & down |
|
1479 dataInfo->iTableUpButton.iRect=rectTableUp; |
|
1480 dataInfo->iTableUpButton.iInnerRect=rectTableUp; |
|
1481 dataInfo->iTableUpButton.iInnerRect.Shrink(5,5); |
|
1482 dataInfo->iTableDownButton.iRect=rectTableDown; |
|
1483 dataInfo->iTableDownButton.iInnerRect=rectTableDown; |
|
1484 dataInfo->iTableDownButton.iInnerRect.Shrink(5,5); |
|
1485 dataInfo->iTablePageLabel.iRect=rectTablePage; |
|
1486 dataInfo->iTablePageLabel.iInnerRect=rectTablePage; |
|
1487 dataInfo->iTablePageLabel.iInnerRect.Shrink(5,5); |
|
1488 |
|
1489 // for shrinking whole keypad rect |
|
1490 dataInfo->iKeypad.iKaypadRect.iBr.iX-=dataInfo->iSwitchButton.iRect.Width(); |
|
1491 |
|
1492 iLayoutDataInfo.AppendL( dataInfo ); |
|
1493 |
|
1494 } |