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: 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 <aknlayoutscalable_apps.cdl.h>
|
|
25 |
#include <layoutmetadata.cdl.h>
|
|
26 |
|
|
27 |
// User includes
|
|
28 |
#include "peninputvkbcnlafdatamgr.h"
|
|
29 |
|
|
30 |
#define LAF_MODIFY 1
|
|
31 |
|
|
32 |
const TInt KKeypadLayoutCn[][2] =
|
|
33 |
{
|
|
34 |
{ 10, 3 }, // 10x3
|
|
35 |
{ 11, 3 }, // 11x3
|
|
36 |
{ 11, 4 }, // 11x4
|
|
37 |
{ 10, 4 }, // 10x4
|
|
38 |
};
|
|
39 |
|
|
40 |
const TInt KVkbTopAndBottomParam[] = { 5, 3, 4, 7};
|
|
41 |
typedef TAknWindowComponentLayout (*Pfun)(TInt aVariety, TInt aCol = 0, TInt aRow = 0);
|
|
42 |
|
|
43 |
const Pfun cell_pane_func_cn[]=
|
|
44 |
{
|
|
45 |
AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane,
|
|
46 |
AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_cp01,
|
|
47 |
AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_cp02,
|
|
48 |
AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_cp03,
|
|
49 |
AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_cp04,
|
|
50 |
AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_cp05,
|
|
51 |
AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_cp06,
|
|
52 |
AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_cp07,
|
|
53 |
AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_cp08,
|
|
54 |
AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_cp09,
|
|
55 |
AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_cp10
|
|
56 |
};
|
|
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, 186, 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 |
// ======== MEMBER FUNCTIONS ========
|
|
69 |
|
|
70 |
// ---------------------------------------------------------------------------
|
|
71 |
// CPeninputCnGenericVkbLafMgr::NewL
|
|
72 |
// (other items were commented in a header)
|
|
73 |
// ---------------------------------------------------------------------------
|
|
74 |
//
|
|
75 |
CPeninputCnGenericVkbLafMgr* CPeninputCnGenericVkbLafMgr::NewL()
|
|
76 |
{
|
|
77 |
CPeninputCnGenericVkbLafMgr* self = NewLC();
|
|
78 |
CleanupStack::Pop(self);
|
|
79 |
|
|
80 |
return self;
|
|
81 |
}
|
|
82 |
|
|
83 |
// ---------------------------------------------------------------------------
|
|
84 |
// CPeninputCnGenericVkbLafMgr::NewLC
|
|
85 |
// (other items were commented in a header)
|
|
86 |
// ---------------------------------------------------------------------------
|
|
87 |
//
|
|
88 |
CPeninputCnGenericVkbLafMgr* CPeninputCnGenericVkbLafMgr::NewLC()
|
|
89 |
{
|
|
90 |
CPeninputCnGenericVkbLafMgr* self =
|
|
91 |
new ( ELeave ) CPeninputCnGenericVkbLafMgr();
|
|
92 |
CleanupStack::PushL( self );
|
|
93 |
self->ConstructL();
|
|
94 |
|
|
95 |
return self;
|
|
96 |
}
|
|
97 |
|
|
98 |
// ---------------------------------------------------------------------------
|
|
99 |
// CPeninputCnGenericVkbLafMgr::CPeninputCnGenericVkbLafMgr
|
|
100 |
// (other items were commented in a header)
|
|
101 |
// ---------------------------------------------------------------------------
|
|
102 |
//
|
|
103 |
CPeninputCnGenericVkbLafMgr::CPeninputCnGenericVkbLafMgr():
|
|
104 |
iInputMode(EPluginInputModeNone)
|
|
105 |
{
|
|
106 |
}
|
|
107 |
|
|
108 |
// ---------------------------------------------------------------------------
|
|
109 |
// CPeninputCnGenericVkbLafMgr::~CPeninputCnGenericVkbLafMgr
|
|
110 |
// (other items were commented in a header)
|
|
111 |
// ---------------------------------------------------------------------------
|
|
112 |
//
|
|
113 |
CPeninputCnGenericVkbLafMgr::~CPeninputCnGenericVkbLafMgr()
|
|
114 |
{
|
|
115 |
delete iLafData;
|
|
116 |
iLafData = NULL;
|
|
117 |
}
|
|
118 |
|
|
119 |
TBool CPeninputCnGenericVkbLafMgr::IsValid()
|
|
120 |
{
|
|
121 |
if (!iLafData)
|
|
122 |
return EFalse;
|
|
123 |
|
|
124 |
return iLafData->IsValid();
|
|
125 |
}
|
|
126 |
|
|
127 |
// ---------------------------------------------------------------------------
|
|
128 |
// CPeninputCnGenericVkbLafMgr::ConstructL
|
|
129 |
// (other items were commented in a header)
|
|
130 |
// ---------------------------------------------------------------------------
|
|
131 |
//
|
|
132 |
void CPeninputCnGenericVkbLafMgr::ConstructL()
|
|
133 |
{
|
|
134 |
|
|
135 |
}
|
|
136 |
|
|
137 |
// ---------------------------------------------------------------------------
|
|
138 |
// CPeninputCnGenericVkbLafMgr::SetInputMode
|
|
139 |
// (other items were commented in a header)
|
|
140 |
// ---------------------------------------------------------------------------
|
|
141 |
//
|
|
142 |
void CPeninputCnGenericVkbLafMgr::SetInputModeL( TPluginInputMode aInputMode)
|
|
143 |
{
|
|
144 |
if (iInputMode == aInputMode)
|
|
145 |
{
|
|
146 |
return;
|
|
147 |
}
|
|
148 |
|
|
149 |
iInputMode = aInputMode;
|
|
150 |
|
|
151 |
if (iLafData)
|
|
152 |
{
|
|
153 |
delete iLafData;
|
|
154 |
iLafData = NULL;
|
|
155 |
}
|
|
156 |
|
|
157 |
if (aInputMode == EPluginInputModeVkb)
|
|
158 |
{
|
|
159 |
iLafData = CPeninputCnLafDataVKB::NewL(ELayoutNone);
|
|
160 |
}
|
|
161 |
else if (aInputMode == EPluginInputModeFSQ)
|
|
162 |
{
|
|
163 |
iLafData = CPeninputCnLafDataFSQ::NewL(ELayoutNone);
|
|
164 |
}
|
|
165 |
else
|
|
166 |
{
|
|
167 |
User::Leave(KErrNotSupported);
|
|
168 |
}
|
|
169 |
}
|
|
170 |
|
|
171 |
TPluginInputMode CPeninputCnGenericVkbLafMgr::InputMode() const
|
|
172 |
{
|
|
173 |
return iInputMode;
|
|
174 |
}
|
|
175 |
|
|
176 |
// ---------------------------------------------------------------------------
|
|
177 |
// CPeninputCnGenericVkbLafMgr::SetLayoutType
|
|
178 |
// (other items were commented in a header)
|
|
179 |
// ---------------------------------------------------------------------------
|
|
180 |
//
|
|
181 |
void CPeninputCnGenericVkbLafMgr::SetLayoutType( TPeninputCnQwtLayoutType aLayoutType )
|
|
182 |
{
|
|
183 |
ASSERT(iLafData);
|
|
184 |
iLafData->SetLayoutType( aLayoutType );
|
|
185 |
}
|
|
186 |
|
|
187 |
// ---------------------------------------------------------------------------
|
|
188 |
// CPeninputCnGenericVkbLafMgr::SetLafOption
|
|
189 |
// (other items were commented in a header)
|
|
190 |
// ---------------------------------------------------------------------------
|
|
191 |
//
|
|
192 |
void CPeninputCnGenericVkbLafMgr::SetLafOption( TPeninputCnVkbLafOption aOption )
|
|
193 |
{
|
|
194 |
if( iLafData->LafOption() == aOption )
|
|
195 |
return;
|
|
196 |
|
|
197 |
iLafData->SetLafOption( aOption );
|
|
198 |
TRAP_IGNORE(iLafData->ConstructL());
|
|
199 |
}
|
|
200 |
|
|
201 |
// ---------------------------------------------------------------------------
|
|
202 |
// CPeninputCnGenericVkbLafMgr::SetLafOption
|
|
203 |
// (other items were commented in a header)
|
|
204 |
// ---------------------------------------------------------------------------
|
|
205 |
//
|
|
206 |
TPeninputCnVkbLafOption CPeninputCnGenericVkbLafMgr::OptionType() const
|
|
207 |
{
|
|
208 |
return iLafData->LafOption();
|
|
209 |
}
|
|
210 |
|
|
211 |
// ---------------------------------------------------------------------------
|
|
212 |
// CPeninputCnGenericVkbLafMgr::GetButtonRect
|
|
213 |
// (other items were commented in a header)
|
|
214 |
// ---------------------------------------------------------------------------
|
|
215 |
//
|
|
216 |
void CPeninputCnGenericVkbLafMgr::GetButtonRect( TPeninputCommonCtrlID aButtonID,
|
|
217 |
TRect& aOutterRect,
|
|
218 |
TRect& aInnerRect )
|
|
219 |
{
|
|
220 |
ASSERT(iLafData);
|
|
221 |
const TPeninputCnButtonLayoutData& data = iLafData->ButtonLayoutData( aButtonID );
|
|
222 |
aOutterRect = data.iRect;
|
|
223 |
aInnerRect = data.iInnerRect;
|
|
224 |
}
|
|
225 |
|
|
226 |
// ---------------------------------------------------------------------------
|
|
227 |
// CPeninputCnGenericVkbLafMgr::KeyRect
|
|
228 |
// (other items were commented in a header)
|
|
229 |
// ---------------------------------------------------------------------------
|
|
230 |
//
|
|
231 |
const TRect& CPeninputCnGenericVkbLafMgr::KeypadRect() const
|
|
232 |
{
|
|
233 |
ASSERT(iLafData);
|
|
234 |
return iLafData->KeypadLayoutData().iKaypadRect;
|
|
235 |
}
|
|
236 |
|
|
237 |
// ---------------------------------------------------------------------------
|
|
238 |
// CPeninputCnGenericVkbLafMgr::ICFRect
|
|
239 |
// (other items were commented in a header)
|
|
240 |
// ---------------------------------------------------------------------------
|
|
241 |
//
|
|
242 |
const TRect& CPeninputCnGenericVkbLafMgr::ICFRect() const
|
|
243 |
{
|
|
244 |
ASSERT(iLafData);
|
|
245 |
return iLafData->ICFLayoutData().iRect;
|
|
246 |
}
|
|
247 |
|
|
248 |
// ---------------------------------------------------------------------------
|
|
249 |
// CPeninputCnGenericVkbLafMgr::ICFPromptTextFont
|
|
250 |
// (other items were commented in a header)
|
|
251 |
// ---------------------------------------------------------------------------
|
|
252 |
//
|
|
253 |
const CFont* CPeninputCnGenericVkbLafMgr::ICFPromptTextFont() const
|
|
254 |
{
|
|
255 |
ASSERT(iLafData);
|
|
256 |
return iLafData->ICFLayoutData().iPromptTextFont;
|
|
257 |
}
|
|
258 |
|
|
259 |
// ---------------------------------------------------------------------------
|
|
260 |
// CPeninputCnGenericVkbLafMgr::ICFPromptTextFont
|
|
261 |
// (other items were commented in a header)
|
|
262 |
// ---------------------------------------------------------------------------
|
|
263 |
//
|
|
264 |
const CFont* CPeninputCnGenericVkbLafMgr::ICFTextFont() const
|
|
265 |
{
|
|
266 |
ASSERT(iLafData);
|
|
267 |
return iLafData->ICFLayoutData().iTextFont;
|
|
268 |
}
|
|
269 |
|
|
270 |
// ---------------------------------------------------------------------------
|
|
271 |
TAknTextLineLayout CPeninputCnGenericVkbLafMgr::KeyTextLayout() const
|
|
272 |
{
|
|
273 |
ASSERT(iLafData);
|
|
274 |
return iLafData->KeypadLayoutData().iTextLayout;
|
|
275 |
}
|
|
276 |
// CPeninputCnGenericVkbLafMgr::ICFPromptTextFont
|
|
277 |
// (other items were commented in a header)
|
|
278 |
// ---------------------------------------------------------------------------
|
|
279 |
//
|
|
280 |
const TRect& CPeninputCnGenericVkbLafMgr::EntirePaneRect() const
|
|
281 |
{
|
|
282 |
ASSERT(iLafData);
|
|
283 |
return iLafData->QwtLayoutData().iQwtRect;
|
|
284 |
}
|
|
285 |
|
|
286 |
// ---------------------------------------------------------------------------
|
|
287 |
// CPeninputCnGenericVkbLafMgr::KeyRect
|
|
288 |
// (other items were commented in a header)
|
|
289 |
// ---------------------------------------------------------------------------
|
|
290 |
//
|
|
291 |
void CPeninputCnGenericVkbLafMgr::GetKeyRect( TInt aColume,
|
|
292 |
TInt aRow,
|
|
293 |
TRect& aKeyRect,
|
|
294 |
TRect& aCharRect ) const
|
|
295 |
{
|
|
296 |
ASSERT(iLafData);
|
|
297 |
TInt colNum = 0;
|
|
298 |
TInt index = 0;
|
|
299 |
switch( iLafData->LayoutType() )
|
|
300 |
{
|
|
301 |
case ELayout10x3:
|
|
302 |
case ELayout10x3_withCandi:
|
|
303 |
case ELayout10x4:
|
|
304 |
{
|
|
305 |
colNum = 10;
|
|
306 |
}
|
|
307 |
break;
|
|
308 |
case ELayout11x3:
|
|
309 |
{
|
|
310 |
colNum = 11;
|
|
311 |
}
|
|
312 |
break;
|
|
313 |
case ELayout11x4:
|
|
314 |
{
|
|
315 |
colNum = 11;
|
|
316 |
}
|
|
317 |
break;
|
|
318 |
}
|
|
319 |
index = aRow * colNum + aColume;
|
|
320 |
aKeyRect = iLafData->KeypadLayoutData().iRects[index];
|
|
321 |
aCharRect = iLafData->KeypadLayoutData().iCharRects[index];
|
|
322 |
}
|
|
323 |
|
|
324 |
TPeninputCnQwtLayoutType CPeninputCnGenericVkbLafMgr::
|
|
325 |
LayoutTypeFromRowsColumns(const TInt aRows, const TInt aColumns)
|
|
326 |
{
|
|
327 |
TPeninputCnQwtLayoutType ret;
|
|
328 |
|
|
329 |
if (aRows == 3 && aColumns == 10)
|
|
330 |
{
|
|
331 |
ret = ELayout10x3_withCandi;
|
|
332 |
}
|
|
333 |
else if (aRows == 3 && aColumns == 11)
|
|
334 |
{
|
|
335 |
ret = ELayout11x3;
|
|
336 |
}
|
|
337 |
else if (aRows == 4 && aColumns == 11)
|
|
338 |
{
|
|
339 |
ret = ELayout11x4;
|
|
340 |
}
|
|
341 |
else if (aRows == 4 && aColumns == 10)
|
|
342 |
{
|
|
343 |
ret = ELayout10x4;
|
|
344 |
}
|
|
345 |
else
|
|
346 |
{
|
|
347 |
ret = ELayoutNone;
|
|
348 |
}
|
|
349 |
|
|
350 |
return ret;
|
|
351 |
}
|
|
352 |
// ---------------------------------------------------------------------------
|
|
353 |
// CPeninputCnGenericVkbLafMgr::KeyTextFont
|
|
354 |
// (other items were commented in a header)
|
|
355 |
// ---------------------------------------------------------------------------
|
|
356 |
//
|
|
357 |
const CFont* CPeninputCnGenericVkbLafMgr::KeyTextFont() const
|
|
358 |
{
|
|
359 |
ASSERT(iLafData);
|
|
360 |
return iLafData->KeypadLayoutData().iFont;
|
|
361 |
}
|
|
362 |
|
|
363 |
// ---------------------------------------------------------------------------
|
|
364 |
// CPeninputCnGenericVkbLafMgr::KeyTextFont
|
|
365 |
// (other items were commented in a header)
|
|
366 |
// ---------------------------------------------------------------------------
|
|
367 |
//
|
|
368 |
const TRect& CPeninputCnGenericVkbLafMgr::RangbarRect() const
|
|
369 |
{
|
|
370 |
ASSERT(iLafData);
|
|
371 |
return iLafData->RangbarLayoutData().iRect;
|
|
372 |
}
|
|
373 |
|
|
374 |
// ---------------------------------------------------------------------------
|
|
375 |
// CPeninputCnGenericVkbLafMgr::GetICFConfig
|
|
376 |
// (other items were commented in a header)
|
|
377 |
// ---------------------------------------------------------------------------
|
|
378 |
//
|
|
379 |
void CPeninputCnGenericVkbLafMgr::GetICFConfig( TPeninputCnICFConfig& aICFConfig )
|
|
380 |
{
|
|
381 |
ASSERT(iLafData);
|
|
382 |
const TPeninputCnEntryLayoutData& icfLayout = iLafData->ICFLayoutData();
|
|
383 |
aICFConfig.iLeftMargin = icfLayout.iPromptTextRect.iTl.iX - icfLayout.iRect.iTl.iX;
|
|
384 |
aICFConfig.iRightMargin = icfLayout.iRect.iBr.iX - icfLayout.iPromptTextRect.iBr.iX;
|
|
385 |
aICFConfig.iTopMargin = icfLayout.iPromptTextRect.iTl.iY - icfLayout.iRect.iTl.iY;
|
|
386 |
aICFConfig.iTextLineHeight = icfLayout.iPromptTextRect.Height();
|
|
387 |
|
|
388 |
TRect rect;
|
|
389 |
AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen, rect);
|
|
390 |
TBool landscape = rect.Size().iWidth < rect.Size().iHeight ? EFalse : ETrue;
|
|
391 |
|
|
392 |
// Just one row for ICF on PinYin layout
|
|
393 |
if( iLafData->LayoutType() == ELayout11x4 &&
|
|
394 |
iInputMode == EPluginInputModeFSQ && landscape )
|
|
395 |
{
|
|
396 |
aICFConfig.iLineSpaceMargin = icfLayout.iRect.Height()
|
|
397 |
-aICFConfig.iTopMargin
|
|
398 |
-icfLayout.iPromptTextRect.Height();
|
|
399 |
}
|
|
400 |
else
|
|
401 |
{
|
|
402 |
aICFConfig.iLineSpaceMargin = icfLayout.iTextRect.iTl.iY - icfLayout.iPromptTextRect.iBr.iY;
|
|
403 |
}
|
|
404 |
}
|
|
405 |
|
|
406 |
// ---------------------------------------------------------------------------
|
|
407 |
// CPeninputCnGenericVkbLafMgr::KeyTextFont
|
|
408 |
// (other items were commented in a header)
|
|
409 |
// ---------------------------------------------------------------------------
|
|
410 |
//
|
|
411 |
const TRect& CPeninputCnGenericVkbLafMgr::TitlebarRect() const
|
|
412 |
{
|
|
413 |
ASSERT(iLafData);
|
|
414 |
return iLafData->QwtLayoutData().iTitlebarRect;
|
|
415 |
}
|
|
416 |
|
|
417 |
// ---------------------------------------------------------------------------
|
|
418 |
// CPeninputCnGenericVkbLafMgr::ClientRect
|
|
419 |
// (other items were commented in a header)
|
|
420 |
// ---------------------------------------------------------------------------
|
|
421 |
//
|
|
422 |
const TRect& CPeninputCnGenericVkbLafMgr::ClientRect() const
|
|
423 |
{
|
|
424 |
ASSERT(iLafData);
|
|
425 |
return iLafData->QwtLayoutData().iClientRect;
|
|
426 |
}
|
|
427 |
|
|
428 |
// ---------------------------------------------------------------------------
|
|
429 |
// CPeninputCnGenericVkbLafMgr::RangbarCellCount
|
|
430 |
// (other items were commented in a header)
|
|
431 |
// ---------------------------------------------------------------------------
|
|
432 |
//
|
|
433 |
TInt CPeninputCnGenericVkbLafMgr::RangbarCellCount() const
|
|
434 |
{
|
|
435 |
ASSERT(iLafData);
|
|
436 |
return iLafData->RangbarLayoutData().iCellDataArray.Count();
|
|
437 |
}
|
|
438 |
|
|
439 |
// ---------------------------------------------------------------------------
|
|
440 |
// CPeninputCnGenericVkbLafMgr::RangbarCellCount
|
|
441 |
// (other items were commented in a header)
|
|
442 |
// ---------------------------------------------------------------------------
|
|
443 |
//
|
|
444 |
void CPeninputCnGenericVkbLafMgr::RangbarCellAt( TInt aIndex,
|
|
445 |
TRect& aOutterRect,
|
|
446 |
TRect& aInnerRect )
|
|
447 |
{
|
|
448 |
ASSERT(iLafData);
|
|
449 |
aOutterRect = iLafData->RangbarLayoutData().iCellDataArray[aIndex].iRect;
|
|
450 |
aInnerRect = iLafData->RangbarLayoutData().iCellDataArray[aIndex].iInnerRect;
|
|
451 |
}
|
|
452 |
|
|
453 |
// ---------------------------------------------------------------------------
|
|
454 |
// Return layout data for candidate list
|
|
455 |
// ---------------------------------------------------------------------------
|
|
456 |
//
|
|
457 |
const TPeninputCnCandidateListLayoutData&
|
|
458 |
CPeninputCnGenericVkbLafMgr::CandidateListLayoutData() const
|
|
459 |
{
|
|
460 |
ASSERT(iLafData);
|
|
461 |
return iLafData->QwtLayoutData().iCandidateList;
|
|
462 |
}
|
|
463 |
|
|
464 |
// ---------------------------------------------------------------------------
|
|
465 |
// Return layout data for tooltip box
|
|
466 |
// ---------------------------------------------------------------------------
|
|
467 |
//
|
|
468 |
const TPeninputCnTooltipBoxLayoutData&
|
|
469 |
CPeninputCnGenericVkbLafMgr::TooltipBoxLayoutData() const
|
|
470 |
{
|
|
471 |
ASSERT(iLafData);
|
|
472 |
return iLafData->QwtLayoutData().iTooltipBox;
|
|
473 |
}
|
|
474 |
|
|
475 |
// ---------------------------------------------------------------------------
|
|
476 |
// CPeninputCnGenericVkbLafMgr::GetCellSize
|
|
477 |
// (other items were commented in a header)
|
|
478 |
// ---------------------------------------------------------------------------
|
|
479 |
//
|
|
480 |
TSize CPeninputCnGenericVkbLafMgr::GetCellSize( TPeninputCnCellType aCellType )
|
|
481 |
{
|
|
482 |
TAknWindowLineLayout appWnd;
|
|
483 |
TAknWindowLineLayout wndLayout, cellLayout;
|
|
484 |
TAknLayoutRect wndRect, cellRect;
|
|
485 |
|
|
486 |
appWnd = AknLayoutScalable_Avkon::application_window(0).LayoutLine();
|
|
487 |
|
|
488 |
switch( aCellType )
|
|
489 |
{
|
|
490 |
case EVkbCangjieAndPinying: //10x4
|
|
491 |
case EVkbStroke:
|
|
492 |
case EVkbLatin:
|
|
493 |
case EVkbNumber:
|
|
494 |
{
|
|
495 |
wndLayout = AknLayoutScalable_Avkon::popup_fep_vkb2_window(4).LayoutLine();
|
|
496 |
wndRect.LayoutRect(appWnd.Rect(), wndLayout);
|
|
497 |
cellLayout = AknLayoutScalable_Avkon::aid_size_cell_vkb2(7).LayoutLine();
|
|
498 |
cellRect.LayoutRect( wndRect.Rect(), cellLayout );
|
|
499 |
}
|
|
500 |
break;
|
|
501 |
case EVkbZhuyin: //11x4
|
|
502 |
case EVkbLatin_Zhuyin:
|
|
503 |
case EVkbNumber_Zhuyin:
|
|
504 |
//case EVkbAccent:
|
|
505 |
wndLayout = AknLayoutScalable_Avkon::popup_fep_vkb2_window(2).LayoutLine();
|
|
506 |
wndRect.LayoutRect(appWnd.Rect(), wndLayout);
|
|
507 |
cellLayout = AknLayoutScalable_Avkon::aid_size_cell_vkb2(4).LayoutLine();
|
|
508 |
cellRect.LayoutRect( wndRect.Rect(), cellLayout );
|
|
509 |
break;
|
|
510 |
case EVkbCangjieAndPinying_FSQ: //10x4
|
|
511 |
case EVkbStroke_FSQ:
|
|
512 |
case EVkbLatin_FSQ:
|
|
513 |
case EVkbNumber_FSQ:
|
|
514 |
{
|
|
515 |
wndLayout = AknLayoutScalable_Avkon::popup_fep_vkb2_window(0).LayoutLine();
|
|
516 |
wndRect.LayoutRect(appWnd.Rect(), wndLayout);
|
|
517 |
cellLayout = AknLayoutScalable_Avkon::aid_size_cell_vkb2(6).LayoutLine();
|
|
518 |
cellRect.LayoutRect( wndRect.Rect(), cellLayout );
|
|
519 |
}
|
|
520 |
break;
|
|
521 |
case EVkbNumber_Zhuyin_FSQ: //11x4
|
|
522 |
case EVkbZhuyin_FSQ:
|
|
523 |
case EVkbLatin_Zhuyin_FSQ:
|
|
524 |
{
|
|
525 |
wndLayout = AknLayoutScalable_Avkon::popup_fep_vkb2_window(0).LayoutLine();
|
|
526 |
wndRect.LayoutRect(appWnd.Rect(), wndLayout);
|
|
527 |
cellLayout = AknLayoutScalable_Avkon::aid_size_cell_vkb2(2).LayoutLine();
|
|
528 |
cellRect.LayoutRect( wndRect.Rect(), cellLayout );
|
|
529 |
}
|
|
530 |
break;
|
|
531 |
}
|
|
532 |
if( aCellType == EVkbCangjieAndPinying_FSQ || aCellType == EVkbStroke_FSQ)
|
|
533 |
{
|
|
534 |
TRect rect = cellRect.Rect();
|
|
535 |
rect.Shrink( 5, 0 );
|
|
536 |
return rect.Size();
|
|
537 |
}
|
|
538 |
return cellRect.Rect().Size();
|
|
539 |
}
|
|
540 |
|
|
541 |
// ---------------------------------------------------------------------------
|
|
542 |
// CPeninputCnGenericVkbLafMgr::CellAidGap
|
|
543 |
// (other items were commented in a header)
|
|
544 |
// ---------------------------------------------------------------------------
|
|
545 |
//
|
|
546 |
TInt CPeninputCnGenericVkbLafMgr::CellAidGap( TPeninputCnCellType aCellType ) const
|
|
547 |
{
|
|
548 |
const TInt KColuNum[] = { 10, 10, 11, 11, 10, 11, 10, 11, 10, 10, 11, 10, 10, 11, 11 };
|
|
549 |
TSize unitGrid;
|
|
550 |
unitGrid = CPeninputCnGenericVkbLafMgr::GetCellSize( aCellType );
|
|
551 |
// TInt cellUnit = unitGrid.Rect().Width();
|
|
552 |
TInt cellUnit = unitGrid.iWidth;
|
|
553 |
TInt width = EntirePaneRect().Width();
|
|
554 |
TInt cellAidGap = width - cellUnit*KColuNum[aCellType];
|
|
555 |
if (aCellType == EVkbLatin || aCellType == EVkbNumber || aCellType == EVkbAccent)
|
|
556 |
{
|
|
557 |
cellAidGap = cellAidGap - 9;
|
|
558 |
}
|
|
559 |
return cellAidGap;
|
|
560 |
}
|
|
561 |
|
|
562 |
// ---------------------------------------------------------------------------
|
|
563 |
// CPeninputCnQwtLayoutDataInfo::~CPeninputCnQwtLayoutDataInfo
|
|
564 |
// (other items were commented in a header)
|
|
565 |
// ---------------------------------------------------------------------------
|
|
566 |
//
|
|
567 |
CPeninputCnQwtLayoutDataInfo::~CPeninputCnQwtLayoutDataInfo()
|
|
568 |
{
|
|
569 |
iKeypad.iRects.Close();
|
|
570 |
iKeypad.iCharRects.Close();
|
|
571 |
iRangbar.iCellDataArray.Close();
|
|
572 |
}
|
|
573 |
|
|
574 |
// ---------------------------------------------------------------------------
|
|
575 |
// CPeninputLafDataCommon::DestoryDataCommon
|
|
576 |
// (other items were commented in a header)
|
|
577 |
// ---------------------------------------------------------------------------
|
|
578 |
//
|
|
579 |
void MPeninputCnLafDataCommon::DestoryDataCommon()
|
|
580 |
{
|
|
581 |
iLayoutDataInfo.ResetAndDestroy();
|
|
582 |
iLayoutDataInfo.Close();
|
|
583 |
}
|
|
584 |
|
|
585 |
MPeninputCnLafDataCommon::~MPeninputCnLafDataCommon()
|
|
586 |
{
|
|
587 |
|
|
588 |
}
|
|
589 |
// CPeninputLafDataCommon::ButtonLayoutData(TInt aButtonID)
|
|
590 |
// (other items were commented in a header)
|
|
591 |
// ---------------------------------------------------------------------------
|
|
592 |
//
|
|
593 |
const TPeninputCnButtonLayoutData& MPeninputCnLafDataCommon::
|
|
594 |
ButtonLayoutData( TInt aButtonID ) const
|
|
595 |
{
|
|
596 |
ASSERT( IsValid() );
|
|
597 |
const TPeninputCnButtonLayoutData* pData = NULL;
|
|
598 |
|
|
599 |
switch( aButtonID )
|
|
600 |
{
|
|
601 |
case EPeninutWindowCtrlIdMoveBtn:
|
|
602 |
{
|
|
603 |
pData = &(iLayoutDataInfo[iLayoutType]->iMoveButton);
|
|
604 |
}
|
|
605 |
break;
|
|
606 |
case EPeninutWindowCtrlIdCloseBtn:
|
|
607 |
{
|
|
608 |
pData = &(iLayoutDataInfo[iLayoutType]->iCloseButton);
|
|
609 |
}
|
|
610 |
break;
|
|
611 |
case EPeninutWindowCtrlIdOptionBtn:
|
|
612 |
{
|
|
613 |
pData = &(iLayoutDataInfo[iLayoutType]->iOptionButton);
|
|
614 |
}
|
|
615 |
break;
|
|
616 |
case EPeninutWindowCtrlIdBackspaceBtn:
|
|
617 |
{
|
|
618 |
pData = &(iLayoutDataInfo[iLayoutType]->iClearButton);
|
|
619 |
}
|
|
620 |
break;
|
|
621 |
case EPeninutWindowCtrlIdEnterBtn:
|
|
622 |
{
|
|
623 |
pData = &(iLayoutDataInfo[iLayoutType]->iEnterButton);
|
|
624 |
}
|
|
625 |
break;
|
|
626 |
case EPeninutWindowCtrlIdSwitchToHwrBtn:
|
|
627 |
{
|
|
628 |
pData = &(iLayoutDataInfo[iLayoutType]->iSwitchButton);
|
|
629 |
}
|
|
630 |
break;
|
|
631 |
case EPeninutWindowCtrlIdSpaceBtn:
|
|
632 |
{
|
|
633 |
pData = &(iLayoutDataInfo[iLayoutType]->iSpaceButton);
|
|
634 |
}
|
|
635 |
break;
|
|
636 |
case EPeninutWindowCtrlIdShiftBtn:
|
|
637 |
{
|
|
638 |
pData = &(iLayoutDataInfo[iLayoutType]->iShiftButton);
|
|
639 |
}
|
|
640 |
break;
|
|
641 |
case EPeninupWindowCtrlIdArrowLeftBtn:
|
|
642 |
{
|
|
643 |
pData = &(iLayoutDataInfo[iLayoutType]->iLeftButton);
|
|
644 |
}
|
|
645 |
break;
|
|
646 |
case EPeninupWindowCtrlIdArrowRightBtn:
|
|
647 |
{
|
|
648 |
pData = &(iLayoutDataInfo[iLayoutType]->iRightButton);
|
|
649 |
}
|
|
650 |
break;
|
|
651 |
default:
|
|
652 |
ASSERT(EFalse);
|
|
653 |
break;
|
|
654 |
}
|
|
655 |
ASSERT(pData);
|
|
656 |
return *pData;
|
|
657 |
}
|
|
658 |
// ---------------------------------------------------------------------------
|
|
659 |
// CPeninputLafDataCommon::ICFLayoutData()
|
|
660 |
// (other items were commented in a header)
|
|
661 |
// ---------------------------------------------------------------------------
|
|
662 |
//
|
|
663 |
const TPeninputCnEntryLayoutData& MPeninputCnLafDataCommon::ICFLayoutData() const
|
|
664 |
{
|
|
665 |
ASSERT( IsValid() );
|
|
666 |
return iLayoutDataInfo[iLayoutType]->iICF;
|
|
667 |
}
|
|
668 |
|
|
669 |
// ---------------------------------------------------------------------------
|
|
670 |
// CPeninputLafDataCommon::KeypadLayoutData()
|
|
671 |
// (other items were commented in a header)
|
|
672 |
// ---------------------------------------------------------------------------
|
|
673 |
//
|
|
674 |
const TPeninputCnKeyLayoutData& MPeninputCnLafDataCommon::KeypadLayoutData() const
|
|
675 |
{
|
|
676 |
ASSERT( IsValid() );
|
|
677 |
return iLayoutDataInfo[iLayoutType]->iKeypad;
|
|
678 |
}
|
|
679 |
|
|
680 |
// ---------------------------------------------------------------------------
|
|
681 |
// CPeninputLafDataCommon::RangbarLayoutData(TInt aRangbarID)
|
|
682 |
// (other items were commented in a header)
|
|
683 |
// ---------------------------------------------------------------------------
|
|
684 |
//
|
|
685 |
const TPeninputCnRangeBarLayoutData& MPeninputCnLafDataCommon::RangbarLayoutData() const
|
|
686 |
{
|
|
687 |
ASSERT( IsValid() );
|
|
688 |
return iLayoutDataInfo[iLayoutType]->iRangbar;
|
|
689 |
}
|
|
690 |
|
|
691 |
// ---------------------------------------------------------------------------
|
|
692 |
// CPeninputLafDataCommon::RangbarLayoutData(TInt aRangbarID)
|
|
693 |
// (other items were commented in a header)
|
|
694 |
// ---------------------------------------------------------------------------
|
|
695 |
//
|
|
696 |
const CPeninputCnQwtLayoutDataInfo& MPeninputCnLafDataCommon::QwtLayoutData() const
|
|
697 |
{
|
|
698 |
ASSERT( IsValid() );
|
|
699 |
return *iLayoutDataInfo[iLayoutType];
|
|
700 |
}
|
|
701 |
|
|
702 |
// ---------------------------------------------------------------------------
|
|
703 |
// CPeninputLafDataCommon::ConstructL()
|
|
704 |
// (other items were commented in a header)
|
|
705 |
// ---------------------------------------------------------------------------
|
|
706 |
//
|
|
707 |
void MPeninputCnLafDataCommon::ConstructL()
|
|
708 |
{
|
|
709 |
ReadLafInfoL();
|
|
710 |
}
|
|
711 |
|
|
712 |
// ---------------------------------------------------------------------------
|
|
713 |
// CPeninputLafDataCommon::ConstructL()
|
|
714 |
// (other items were commented in a header)
|
|
715 |
// ---------------------------------------------------------------------------
|
|
716 |
//
|
|
717 |
TBool MPeninputCnLafDataCommon::IsValid() const
|
|
718 |
{
|
|
719 |
return ( iLayoutDataInfo.Count() && iLayoutType != ELayoutNone ) ? ETrue : EFalse;
|
|
720 |
}
|
|
721 |
|
|
722 |
|
|
723 |
// ---------------------------------------------------------------------------
|
|
724 |
// CPeninputLafDataCommon::GetTopAndBottomPaneInfo
|
|
725 |
// (other items were commented in a header)
|
|
726 |
// ---------------------------------------------------------------------------
|
|
727 |
//
|
|
728 |
void MPeninputCnLafDataCommon::GetTopAndBottomPaneInfo( const TRect& aParentWndRect,
|
|
729 |
TInt aLayoutType,
|
|
730 |
TInt aLayoutParam,
|
|
731 |
CPeninputCnQwtLayoutDataInfo& aDataInfo )
|
|
732 |
{
|
|
733 |
// judge which case
|
|
734 |
const TInt endFSQType = 2;
|
|
735 |
|
|
736 |
|
|
737 |
TBool isVKB = aLayoutParam > endFSQType ? ETrue : EFalse;
|
|
738 |
|
|
739 |
TAknWindowLineLayout toppane, bottompane, bottomgrid;
|
|
740 |
TAknWindowLineLayout topleftpane, topentrypane, toprightpane;
|
|
741 |
TAknWindowLineLayout cellBtn, cellBtnInner;
|
|
742 |
|
|
743 |
TAknLayoutRect toppaneRect, bottompaneRect, bottomgridRect;
|
|
744 |
TAknLayoutRect topleftpaneRect, topentrypaneRect, toprightpaneRect;
|
|
745 |
TAknLayoutRect cellBtnRect, cellBtnInnerRect;
|
|
746 |
TAknTextLineLayout cellText;
|
|
747 |
TAknLayoutText txt;
|
|
748 |
TRect keypadRect;
|
|
749 |
// top pane
|
|
750 |
if( isVKB )
|
|
751 |
{
|
|
752 |
toppane = AknLayoutScalable_Avkon::
|
|
753 |
vkb2_area_top_pane(KVkbTopAndBottomParam[aLayoutType]).LayoutLine();
|
|
754 |
}
|
|
755 |
else
|
|
756 |
{
|
|
757 |
toppane = AknLayoutScalable_Avkon::vkb2_area_top_pane(aLayoutParam).LayoutLine();
|
|
758 |
}
|
|
759 |
toppaneRect.LayoutRect(aParentWndRect, toppane);
|
|
760 |
aDataInfo.iTitlebarRect = toppaneRect.Rect();
|
|
761 |
topleftpane = AknLayoutScalable_Avkon::vkb2_top_grid_left_pane(aLayoutParam).LayoutLine();
|
|
762 |
topleftpaneRect.LayoutRect(toppaneRect.Rect(), topleftpane);
|
|
763 |
|
|
764 |
// close button
|
|
765 |
cellBtn = AknLayoutScalable_Avkon::vkb2_top_cell_left_pane(aLayoutParam, 0 ,0).LayoutLine();
|
|
766 |
cellBtnRect.LayoutRect(topleftpaneRect.Rect(), cellBtn);
|
|
767 |
cellBtnInner = AknLayoutScalable_Avkon::vkb2_top_cell_left_pane_g1().LayoutLine();
|
|
768 |
cellBtnInnerRect.LayoutRect(cellBtnRect.Rect(), cellBtnInner);
|
|
769 |
aDataInfo.iCloseButton.iRect = cellBtnRect.Rect();
|
|
770 |
aDataInfo.iCloseButton.iInnerRect = cellBtnInnerRect.Rect();
|
|
771 |
// option button
|
|
772 |
cellBtn = AknLayoutScalable_Avkon::vkb2_top_cell_left_pane(aLayoutParam, 0 ,1).LayoutLine();
|
|
773 |
cellBtnRect.LayoutRect(topleftpaneRect.Rect(), cellBtn);
|
|
774 |
cellBtnInner = AknLayoutScalable_Avkon::vkb2_top_cell_left_pane_g1().LayoutLine();
|
|
775 |
cellBtnInnerRect.LayoutRect(cellBtnRect.Rect(), cellBtnInner);
|
|
776 |
aDataInfo.iOptionButton.iRect = cellBtnRect.Rect();
|
|
777 |
aDataInfo.iOptionButton.iInnerRect = cellBtnInnerRect.Rect();
|
|
778 |
|
|
779 |
TRect rect;
|
|
780 |
AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen, rect);
|
|
781 |
TBool landscape = rect.Size().iWidth < rect.Size().iHeight ? EFalse : ETrue;
|
|
782 |
|
|
783 |
// entry pane
|
|
784 |
// Just one row for ICF on PinYin layout
|
|
785 |
if( aLayoutType == ELayout11x4 && !isVKB && landscape )
|
|
786 |
{
|
|
787 |
topentrypane = AknLayoutScalable_Avkon::vkb2_top_entry_pane(8).LayoutLine();
|
|
788 |
}
|
|
789 |
else
|
|
790 |
{
|
|
791 |
topentrypane = AknLayoutScalable_Avkon::vkb2_top_entry_pane(aLayoutParam).LayoutLine();
|
|
792 |
}
|
|
793 |
topentrypaneRect.LayoutRect(toppaneRect.Rect(), topentrypane);
|
|
794 |
aDataInfo.iICF.iRect = topentrypaneRect.Rect();
|
|
795 |
if( aLayoutType == ELayout11x4 && !isVKB && landscape )
|
|
796 |
{
|
|
797 |
cellText = AknLayoutScalable_Avkon::vkb2_top_entry_pane_t1(5).LayoutLine();
|
|
798 |
}
|
|
799 |
else
|
|
800 |
{
|
|
801 |
cellText = AknLayoutScalable_Avkon::vkb2_top_entry_pane_t1(aLayoutParam).LayoutLine();
|
|
802 |
}
|
|
803 |
aDataInfo.iICF.iPromptTextFont = AknLayoutUtils::FontFromId(cellText.iFont, NULL);
|
|
804 |
txt.LayoutText( topentrypaneRect.Rect(), cellText );
|
|
805 |
aDataInfo.iICF.iPromptTextRect = txt.TextRect();
|
|
806 |
|
|
807 |
if( aLayoutType == ELayout11x4 && !isVKB && landscape )
|
|
808 |
{
|
|
809 |
cellText = AknLayoutScalable_Avkon::vkb2_top_entry_pane_t1(5).LayoutLine();
|
|
810 |
}
|
|
811 |
else
|
|
812 |
{
|
|
813 |
cellText = AknLayoutScalable_Avkon::vkb2_top_entry_pane_t2(aLayoutParam).LayoutLine();
|
|
814 |
}
|
|
815 |
|
|
816 |
aDataInfo.iICF.iTextFont = AknLayoutUtils::FontFromId(cellText.iFont, NULL);
|
|
817 |
txt.LayoutText( topentrypaneRect.Rect(), cellText );
|
|
818 |
aDataInfo.iICF.iTextRect = txt.TextRect();
|
|
819 |
|
|
820 |
// ?? need modified later. inner rect is same as outter rect.
|
|
821 |
toprightpane = AknLayoutScalable_Avkon::vkb2_top_grid_right_pane(aLayoutParam).LayoutLine();
|
|
822 |
toprightpaneRect.LayoutRect(toppaneRect.Rect(), toprightpane);
|
|
823 |
if( isVKB )
|
|
824 |
{
|
|
825 |
// clear button
|
|
826 |
cellBtn = AknLayoutScalable_Avkon::
|
|
827 |
vkb2_top_grid_right_pane_g1(aLayoutParam).LayoutLine();
|
|
828 |
cellBtnRect.LayoutRect(toprightpaneRect.Rect(), cellBtn);
|
|
829 |
aDataInfo.iClearButton.iRect = cellBtnRect.Rect();
|
|
830 |
aDataInfo.iClearButton.iInnerRect = cellBtnRect.Rect();
|
|
831 |
// move button (VKB)
|
|
832 |
cellBtn = AknLayoutScalable_Avkon::
|
|
833 |
vkb2_top_grid_right_pane_g4(aLayoutParam).LayoutLine();
|
|
834 |
cellBtnRect.LayoutRect(toprightpaneRect.Rect(), cellBtn);
|
|
835 |
aDataInfo.iMoveButton.iRect = cellBtnRect.Rect();
|
|
836 |
aDataInfo.iMoveButton.iInnerRect = cellBtnRect.Rect();
|
|
837 |
}
|
|
838 |
else
|
|
839 |
{
|
|
840 |
// clear button
|
|
841 |
cellBtn = AknLayoutScalable_Avkon::
|
|
842 |
vkb2_top_grid_right_pane_g1(aLayoutType).LayoutLine();
|
|
843 |
cellBtnRect.LayoutRect(toprightpaneRect.Rect(), cellBtn);
|
|
844 |
aDataInfo.iClearButton.iRect = cellBtnRect.Rect();
|
|
845 |
aDataInfo.iClearButton.iInnerRect = cellBtnRect.Rect();
|
|
846 |
// left button (FSQ)
|
|
847 |
cellBtn = AknLayoutScalable_Avkon::vkb2_top_grid_right_pane_g2(aLayoutType).LayoutLine();
|
|
848 |
cellBtnRect.LayoutRect(toprightpaneRect.Rect(), cellBtn);
|
|
849 |
aDataInfo.iLeftButton.iRect = cellBtnRect.Rect();
|
|
850 |
aDataInfo.iLeftButton.iInnerRect = cellBtnRect.Rect();
|
|
851 |
// right button (FSQ)
|
|
852 |
cellBtn = AknLayoutScalable_Avkon::vkb2_top_grid_right_pane_g3(aLayoutType).LayoutLine();
|
|
853 |
cellBtnRect.LayoutRect(toprightpaneRect.Rect(), cellBtn);
|
|
854 |
aDataInfo.iRightButton.iRect = cellBtnRect.Rect();
|
|
855 |
aDataInfo.iRightButton.iInnerRect = cellBtnRect.Rect();
|
|
856 |
}
|
|
857 |
|
|
858 |
// bottom pane
|
|
859 |
const TInt VKBParamBottom2Range[] = { 6, 8, 8 };
|
|
860 |
const TInt FSQParamBottom2Range[] = { 0, 2, 4 };
|
|
861 |
const TInt VKBParamBottom3Range[] = { 7, 9, 9 };
|
|
862 |
const TInt FSQParamBottom3Range[] = { 1, 3, 5 };
|
|
863 |
|
|
864 |
|
|
865 |
if( isVKB )
|
|
866 |
{
|
|
867 |
bottompane = AknLayoutScalable_Avkon::
|
|
868 |
vkb2_area_bottom_pane(KVkbTopAndBottomParam[aLayoutType]).LayoutLine();
|
|
869 |
}
|
|
870 |
else
|
|
871 |
{
|
|
872 |
bottompane = AknLayoutScalable_Avkon::vkb2_area_bottom_pane(aLayoutParam).LayoutLine();
|
|
873 |
}
|
|
874 |
bottompaneRect.LayoutRect(aParentWndRect, bottompane);
|
|
875 |
|
|
876 |
// Get keypad rect
|
|
877 |
keypadRect.SetRect( toppaneRect.Rect().iTl.iX,
|
|
878 |
toppaneRect.Rect().iBr.iY,
|
|
879 |
bottompaneRect.Rect().iBr.iX,
|
|
880 |
bottompaneRect.Rect().iTl.iY);
|
|
881 |
aDataInfo.iClientRect.SetRect( toppaneRect.Rect().iTl.iX,
|
|
882 |
toppaneRect.Rect().iBr.iY,
|
|
883 |
bottompaneRect.Rect().iBr.iX,
|
|
884 |
bottompaneRect.Rect().iBr.iY);
|
|
885 |
aDataInfo.iQwtRect.SetRect( toppaneRect.Rect().iTl.iX,
|
|
886 |
toppaneRect.Rect().iTl.iY,
|
|
887 |
bottompaneRect.Rect().iBr.iX ,
|
|
888 |
bottompaneRect.Rect().iBr.iY );
|
|
889 |
TInt bottomLayoutType = 0;
|
|
890 |
if( isVKB )
|
|
891 |
{
|
|
892 |
bottomLayoutType = iLafOption & EOption3CellRange ?
|
|
893 |
VKBParamBottom3Range[aLayoutType] : VKBParamBottom2Range[aLayoutType];
|
|
894 |
}
|
|
895 |
else
|
|
896 |
{
|
|
897 |
bottomLayoutType = iLafOption & EOption3CellRange ?
|
|
898 |
FSQParamBottom3Range[aLayoutType] : FSQParamBottom2Range[aLayoutType];
|
|
899 |
}
|
|
900 |
bottomgrid = AknLayoutScalable_Avkon::vkb2_area_bottom_grid_pane(bottomLayoutType).LayoutLine();
|
|
901 |
bottomgridRect.LayoutRect(bottompaneRect.Rect(), bottomgrid);
|
|
902 |
|
|
903 |
TInt maxParam = iLafOption & EOption3CellRange ? 4 : 3;
|
|
904 |
// shift button
|
|
905 |
cellBtn = AknLayoutScalable_Avkon::vkb2_cell_bottom_grid_pane(aLayoutParam, 0, 0).LayoutLine();
|
|
906 |
cellBtnRect.LayoutRect(bottomgridRect.Rect(), cellBtn);
|
|
907 |
cellBtnInner = AknLayoutScalable_Avkon::vkb2_cell_bottom_grid_pane_g1().LayoutLine();
|
|
908 |
cellBtnInnerRect.LayoutRect(cellBtnRect.Rect(), cellBtnInner);
|
|
909 |
aDataInfo.iShiftButton.iRect = cellBtnRect.Rect();
|
|
910 |
aDataInfo.iShiftButton.iInnerRect = cellBtnInnerRect.Rect();
|
|
911 |
|
|
912 |
TPeninputCnButtonLayoutData btnLayoutData;
|
|
913 |
for( TInt i = 1; i < maxParam; i++ )
|
|
914 |
{
|
|
915 |
#ifdef LAF_MODIFY
|
|
916 |
if( i == 3 )
|
|
917 |
{
|
|
918 |
btnLayoutData.iRect = aDataInfo.iRangbar.iCellDataArray[i-2].iRect;
|
|
919 |
btnLayoutData.iRect.Move( btnLayoutData.iRect.Width(), 0 );
|
|
920 |
btnLayoutData.iInnerRect = btnLayoutData.iRect;
|
|
921 |
aDataInfo.iRangbar.iCellDataArray.Append( btnLayoutData );
|
|
922 |
break;
|
|
923 |
}
|
|
924 |
#endif //LAF_MODIFY
|
|
925 |
// range cell
|
|
926 |
cellBtn = AknLayoutScalable_Avkon::vkb2_cell_bottom_grid_pane(aLayoutParam, i, 0).LayoutLine();
|
|
927 |
cellBtnRect.LayoutRect(bottomgridRect.Rect(), cellBtn);
|
|
928 |
cellBtnInner = AknLayoutScalable_Avkon::vkb2_cell_bottom_grid_pane_g1().LayoutLine();
|
|
929 |
cellBtnInnerRect.LayoutRect(cellBtnRect.Rect(), cellBtnInner);
|
|
930 |
btnLayoutData.iRect = cellBtnRect.Rect();
|
|
931 |
btnLayoutData.iInnerRect = cellBtnInnerRect.Rect();
|
|
932 |
aDataInfo.iRangbar.iCellDataArray.Append( btnLayoutData );
|
|
933 |
}
|
|
934 |
|
|
935 |
TInt count = aDataInfo.iRangbar.iCellDataArray.Count();
|
|
936 |
aDataInfo.iRangbar.iRect = TRect( aDataInfo.iRangbar.iCellDataArray[0].iRect.iTl,
|
|
937 |
aDataInfo.iRangbar.iCellDataArray[count - 1].iRect.iBr );
|
|
938 |
|
|
939 |
// input mode button ?? need modified later. inner rect is same as outter rect
|
|
940 |
cellBtn = AknLayoutScalable_Avkon::vkb2_area_bottom_pane_g1(bottomLayoutType).LayoutLine();
|
|
941 |
cellBtnRect.LayoutRect(bottompaneRect.Rect(), cellBtn);
|
|
942 |
aDataInfo.iSwitchButton.iRect = cellBtnRect.Rect();
|
|
943 |
aDataInfo.iSwitchButton.iInnerRect = cellBtnRect.Rect();
|
|
944 |
// enter button
|
|
945 |
cellBtn = AknLayoutScalable_Avkon::vkb2_area_bottom_pane_g2(bottomLayoutType).LayoutLine();
|
|
946 |
cellBtnRect.LayoutRect(bottompaneRect.Rect(), cellBtn);
|
|
947 |
aDataInfo.iEnterButton.iRect = cellBtnRect.Rect();
|
|
948 |
aDataInfo.iEnterButton.iInnerRect = cellBtnRect.Rect();
|
|
949 |
// space button
|
|
950 |
cellBtn = AknLayoutScalable_Avkon::vkb2_area_bottom_pane_g3(bottomLayoutType).LayoutLine();
|
|
951 |
cellBtnRect.LayoutRect(bottompaneRect.Rect(), cellBtn);
|
|
952 |
aDataInfo.iSpaceButton.iRect = cellBtnRect.Rect();
|
|
953 |
aDataInfo.iSpaceButton.iRect.iTl = TPoint( aDataInfo.iRangbar.iRect.iBr.iX,
|
|
954 |
aDataInfo.iRangbar.iRect.iTl.iY );
|
|
955 |
aDataInfo.iSpaceButton.iInnerRect = cellBtnRect.Rect();
|
|
956 |
// 3 pieces graphics laf info
|
|
957 |
TRect spaceRect, iconRect;
|
|
958 |
cellBtn =
|
|
959 |
AknLayoutScalable_Avkon::vkb2_area_bottom_space_btn_pane(bottomLayoutType).LayoutLine();
|
|
960 |
cellBtnRect.LayoutRect(bottompaneRect.Rect(), cellBtn);
|
|
961 |
spaceRect = cellBtnRect.Rect();
|
|
962 |
cellBtn =
|
|
963 |
AknLayoutScalable_Avkon::vkb2_area_bottom_space_btn_pane_g1(bottomLayoutType).LayoutLine();
|
|
964 |
cellBtnRect.LayoutRect(spaceRect, cellBtn);
|
|
965 |
iconRect = cellBtnRect.Rect();
|
|
966 |
aDataInfo.iSpaceIconLayout.iIconOffset.iWidth = iconRect.iTl.iX - spaceRect.iTl.iX;
|
|
967 |
aDataInfo.iSpaceIconLayout.iIconOffset.iHeight = iconRect.iTl.iY- spaceRect.iTl.iY;
|
|
968 |
aDataInfo.iSpaceIconLayout.iSideIconWidth = iconRect.Width();
|
|
969 |
|
|
970 |
// preview popup window
|
|
971 |
TAknWindowLineLayout previewWnd, previewWndInner;
|
|
972 |
TAknLayoutRect previewWndRect, previewWndInnerRect;
|
|
973 |
TAknLayoutText previewWndText;
|
|
974 |
previewWnd = AknLayoutScalable_Avkon::popup_fep_char_preview_window(aLayoutParam).LayoutLine();
|
|
975 |
previewWndRect.LayoutRect( aParentWndRect, previewWnd );
|
|
976 |
previewWndInner = AknLayoutScalable_Avkon::bg_popup_fep_char_preview_window_g9().LayoutLine();
|
|
977 |
previewWndInnerRect.LayoutRect( previewWndRect.Rect(), previewWndInner );
|
|
978 |
aDataInfo.iPreviewWndRect = previewWndRect.Rect();
|
|
979 |
aDataInfo.iPreviewWndInnerRect = previewWndInnerRect.Rect();
|
|
980 |
aDataInfo.iPreviewWndText =
|
|
981 |
AknLayoutScalable_Avkon::popup_fep_char_preview_window_t1(aLayoutParam).LayoutLine();
|
|
982 |
previewWndText.LayoutText(previewWndRect.Rect(), aDataInfo.iPreviewWndText);
|
|
983 |
aDataInfo.iPreviewFont = const_cast<CFont*>(previewWndText.Font());
|
|
984 |
}
|
|
985 |
|
|
986 |
// ---------------------------------------------------------------------------
|
|
987 |
// CPeninputLafDataCommon::SetLayoutType( TInt aLayoutType )
|
|
988 |
// (other items were commented in a header)
|
|
989 |
// ---------------------------------------------------------------------------
|
|
990 |
//
|
|
991 |
inline void MPeninputCnLafDataCommon::SetLayoutType( TInt aLayoutType )
|
|
992 |
{
|
|
993 |
iLayoutType = aLayoutType;
|
|
994 |
}
|
|
995 |
|
|
996 |
// ---------------------------------------------------------------------------
|
|
997 |
// CPeninputLafDataCommon::LayoutType
|
|
998 |
// (other items were commented in a header)
|
|
999 |
// ---------------------------------------------------------------------------
|
|
1000 |
//
|
|
1001 |
inline TInt MPeninputCnLafDataCommon::LayoutType() const
|
|
1002 |
{
|
|
1003 |
return iLayoutType;
|
|
1004 |
}
|
|
1005 |
|
|
1006 |
// ---------------------------------------------------------------------------
|
|
1007 |
// CPeninputLafDataCommon::SetLafOption
|
|
1008 |
// (other items were commented in a header)
|
|
1009 |
// ---------------------------------------------------------------------------
|
|
1010 |
//
|
|
1011 |
inline void MPeninputCnLafDataCommon::SetLafOption( TPeninputCnVkbLafOption aLafOption )
|
|
1012 |
{
|
|
1013 |
iLafOption = aLafOption;
|
|
1014 |
}
|
|
1015 |
|
|
1016 |
// ---------------------------------------------------------------------------
|
|
1017 |
// CPeninputLafDataCommon::SetLafOption
|
|
1018 |
// (other items were commented in a header)
|
|
1019 |
// ---------------------------------------------------------------------------
|
|
1020 |
//
|
|
1021 |
inline TPeninputCnVkbLafOption MPeninputCnLafDataCommon::LafOption() const
|
|
1022 |
{
|
|
1023 |
return iLafOption;
|
|
1024 |
}
|
|
1025 |
|
|
1026 |
// ---------------------------------------------------------------------------
|
|
1027 |
// CPeninputCnLafDataVKB::NewL( TInt aLayoutType )
|
|
1028 |
// (other items were commented in a header)
|
|
1029 |
// ---------------------------------------------------------------------------
|
|
1030 |
//
|
|
1031 |
CPeninputCnLafDataVKB* CPeninputCnLafDataVKB::NewL( TInt aLayoutType )
|
|
1032 |
{
|
|
1033 |
CPeninputCnLafDataVKB* self = NewLC( aLayoutType );
|
|
1034 |
CleanupStack::Pop();
|
|
1035 |
return self;
|
|
1036 |
}
|
|
1037 |
// ---------------------------------------------------------------------------
|
|
1038 |
// CPeninputCnLafDataVKB::NewL( TInt aLayoutType )
|
|
1039 |
// (other items were commented in a header)
|
|
1040 |
// ---------------------------------------------------------------------------
|
|
1041 |
//
|
|
1042 |
CPeninputCnLafDataVKB* CPeninputCnLafDataVKB::NewLC( TInt aLayoutType )
|
|
1043 |
{
|
|
1044 |
CPeninputCnLafDataVKB* self = new ( ELeave ) CPeninputCnLafDataVKB( aLayoutType );
|
|
1045 |
CleanupStack::PushL( self );
|
|
1046 |
self->ConstructL();
|
|
1047 |
|
|
1048 |
return self;
|
|
1049 |
}
|
|
1050 |
CPeninputCnLafDataVKB::~CPeninputCnLafDataVKB()
|
|
1051 |
{
|
|
1052 |
DestoryDataCommon();
|
|
1053 |
}
|
|
1054 |
|
|
1055 |
|
|
1056 |
// ---------------------------------------------------------------------------
|
|
1057 |
// CPeninputCnLafDataVKB::NewL( TInt aLayoutType )
|
|
1058 |
// (other items were commented in a header)
|
|
1059 |
// ---------------------------------------------------------------------------
|
|
1060 |
//
|
|
1061 |
CPeninputCnLafDataVKB::CPeninputCnLafDataVKB( TInt aLayoutType )
|
|
1062 |
{
|
|
1063 |
SetLayoutType( aLayoutType );
|
|
1064 |
}
|
|
1065 |
// ---------------------------------------------------------------------------
|
|
1066 |
// CPeninputCnLafDataVKB::NewL( TInt aLayoutType )
|
|
1067 |
// (other items were commented in a header)
|
|
1068 |
// ---------------------------------------------------------------------------
|
|
1069 |
//
|
|
1070 |
void CPeninputCnLafDataVKB::ReadLafInfoL()
|
|
1071 |
{
|
|
1072 |
// clean up all the data
|
|
1073 |
iLayoutDataInfo.ResetAndDestroy();
|
|
1074 |
|
|
1075 |
CPeninputCnQwtLayoutDataInfo* dataInfo = new( ELeave ) CPeninputCnQwtLayoutDataInfo;
|
|
1076 |
|
|
1077 |
TAknWindowLineLayout appWnd;
|
|
1078 |
TAknWindowLineLayout wndLayout;
|
|
1079 |
TAknWindowLineLayout keypad, rowpane, cellpane;
|
|
1080 |
|
|
1081 |
TAknLayoutRect keypadRect, rowpaneRect, cellpaneRect;
|
|
1082 |
TAknLayoutRect wndRect;
|
|
1083 |
TAknLayoutText keyTextLayout;
|
|
1084 |
TAknTextLineLayout keyText;
|
|
1085 |
TRect keyRect, keyCharRect;
|
|
1086 |
// -----------------------Portray Mode--------------------------
|
|
1087 |
appWnd = AknLayoutScalable_Avkon::application_window(0).LayoutLine();
|
|
1088 |
//iAppWndRect = appWnd.Rect();
|
|
1089 |
|
|
1090 |
// ==================10x3====================
|
|
1091 |
wndLayout = AknLayoutScalable_Avkon::popup_fep_vkb2_window(3).LayoutLine();
|
|
1092 |
wndRect.LayoutRect(appWnd.Rect(), wndLayout);
|
|
1093 |
// top pane and bottom pane
|
|
1094 |
GetTopAndBottomPaneInfo( wndRect.Rect(), ELayout10x3, 3, *dataInfo );
|
|
1095 |
// keypad
|
|
1096 |
keyText = AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_t1(0).LayoutLine();
|
|
1097 |
dataInfo->iKeypad.iTextLayout = keyText;
|
|
1098 |
dataInfo->iKeypad.iFont = AknLayoutUtils::FontFromId(keyText.iFont, NULL);
|
|
1099 |
//dataInfo->iKeypad.iTxtRect = keyText.TextRect();
|
|
1100 |
|
|
1101 |
keypad = AknLayoutScalable_Avkon::
|
|
1102 |
vkb2_area_keypad_pane(KVkbTopAndBottomParam[ELayout10x3]).LayoutLine();
|
|
1103 |
keypadRect.LayoutRect(wndRect.Rect(), keypad);
|
|
1104 |
dataInfo->iKeypad.iKaypadRect = keypadRect.Rect();
|
|
1105 |
|
|
1106 |
//iKeypadRect10x3 = keypadRect.Rect();
|
|
1107 |
for( TInt i = 0; i < KKeypadLayoutCn[0][1]; i++)
|
|
1108 |
{
|
|
1109 |
for( TInt j = 0; j < KKeypadLayoutCn[0][0]; j++)
|
|
1110 |
{
|
|
1111 |
rowpane = AknLayoutScalable_Avkon::vkb2_row_keypad_pane(2, 0, i).LayoutLine();
|
|
1112 |
rowpaneRect.LayoutRect(keypadRect.Rect(), rowpane);
|
|
1113 |
cellpane = (*cell_pane_func_cn[j])(0).LayoutLine();
|
|
1114 |
cellpaneRect.LayoutRect(rowpaneRect.Rect(), cellpane);
|
|
1115 |
keyRect = cellpaneRect.Rect();
|
|
1116 |
keyRect.Move( -keypadRect.Rect().iTl.iX, -keypadRect.Rect().iTl.iY );
|
|
1117 |
#ifdef LAF_MODIFY
|
|
1118 |
keyRect.iTl.iX = KKeypadRectXPoint10x[j];
|
|
1119 |
keyRect.SetWidth( KKeypadCellWidth10x[j] );
|
|
1120 |
#endif //LAF_MODIFY
|
|
1121 |
dataInfo->iKeypad.iRects.AppendL(keyRect);
|
|
1122 |
keyTextLayout.LayoutText(keyRect, keyText);
|
|
1123 |
dataInfo->iKeypad.iCharRects.AppendL(keyTextLayout.TextRect());
|
|
1124 |
}
|
|
1125 |
}
|
|
1126 |
iLayoutDataInfo.AppendL( dataInfo );
|
|
1127 |
|
|
1128 |
// ==================11x3====================
|
|
1129 |
dataInfo = new( ELeave ) CPeninputCnQwtLayoutDataInfo;
|
|
1130 |
wndLayout = AknLayoutScalable_Avkon::popup_fep_vkb2_window(1).LayoutLine();
|
|
1131 |
wndRect.LayoutRect(appWnd.Rect(), wndLayout);
|
|
1132 |
// top pane and bottom pane
|
|
1133 |
GetTopAndBottomPaneInfo( wndRect.Rect(), ELayout11x3, 4, *dataInfo );
|
|
1134 |
// keypad
|
|
1135 |
keyText = AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_t1(0).LayoutLine();
|
|
1136 |
dataInfo->iKeypad.iTextLayout = keyText;
|
|
1137 |
dataInfo->iKeypad.iFont = AknLayoutUtils::FontFromId(keyText.iFont, NULL);
|
|
1138 |
|
|
1139 |
keypad = AknLayoutScalable_Avkon::
|
|
1140 |
vkb2_area_keypad_pane(KVkbTopAndBottomParam[ELayout11x3]).LayoutLine();
|
|
1141 |
keypadRect.LayoutRect(wndRect.Rect(), keypad);
|
|
1142 |
dataInfo->iKeypad.iKaypadRect = keypadRect.Rect();
|
|
1143 |
|
|
1144 |
for( TInt i = 0; i < KKeypadLayoutCn[1][1]; i++)
|
|
1145 |
{
|
|
1146 |
for( TInt j = 0; j < KKeypadLayoutCn[1][0]; j++)
|
|
1147 |
{
|
|
1148 |
rowpane = AknLayoutScalable_Avkon::vkb2_row_keypad_pane(0, 0, i).LayoutLine();
|
|
1149 |
rowpaneRect.LayoutRect(keypadRect.Rect(), rowpane);
|
|
1150 |
cellpane = (*cell_pane_func_cn[j])(1).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 = KKeypadRectXPoint11x[j];
|
|
1156 |
keyRect.SetWidth( KKeypadCellWidth11x[j] );
|
|
1157 |
#endif //LAF_MODIFY
|
|
1158 |
dataInfo->iKeypad.iRects.AppendL(keyRect);
|
|
1159 |
keyTextLayout.LayoutText(keyRect, keyText);
|
|
1160 |
dataInfo->iKeypad.iCharRects.AppendL(keyTextLayout.TextRect());
|
|
1161 |
}
|
|
1162 |
}
|
|
1163 |
iLayoutDataInfo.AppendL( dataInfo );
|
|
1164 |
|
|
1165 |
// ==================11x4====================
|
|
1166 |
dataInfo = new( ELeave ) CPeninputCnQwtLayoutDataInfo;
|
|
1167 |
wndLayout = AknLayoutScalable_Avkon::popup_fep_vkb2_window(2).LayoutLine();
|
|
1168 |
wndRect.LayoutRect(appWnd.Rect(), wndLayout);
|
|
1169 |
// top pane and bottom pane
|
|
1170 |
GetTopAndBottomPaneInfo( wndRect.Rect(), ELayout11x4, 4, *dataInfo );
|
|
1171 |
// keypad
|
|
1172 |
keyText = AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_t1(0).LayoutLine();
|
|
1173 |
dataInfo->iKeypad.iTextLayout = keyText;
|
|
1174 |
dataInfo->iKeypad.iFont = AknLayoutUtils::FontFromId(keyText.iFont, NULL);
|
|
1175 |
|
|
1176 |
keypad = AknLayoutScalable_Avkon::
|
|
1177 |
vkb2_area_keypad_pane(KVkbTopAndBottomParam[ELayout11x4]).LayoutLine();
|
|
1178 |
keypadRect.LayoutRect(wndRect.Rect(), keypad);
|
|
1179 |
dataInfo->iKeypad.iKaypadRect = keypadRect.Rect();
|
|
1180 |
|
|
1181 |
for( TInt i = 0; i < KKeypadLayoutCn[2][1]; i++)
|
|
1182 |
{
|
|
1183 |
for( TInt j = 0; j < KKeypadLayoutCn[2][0]; j++)
|
|
1184 |
{
|
|
1185 |
rowpane = AknLayoutScalable_Avkon::vkb2_row_keypad_pane(1, 0, i).LayoutLine();
|
|
1186 |
rowpaneRect.LayoutRect(keypadRect.Rect(), rowpane);
|
|
1187 |
cellpane = (*cell_pane_func_cn[j])(1).LayoutLine();
|
|
1188 |
cellpaneRect.LayoutRect(rowpaneRect.Rect(), cellpane);
|
|
1189 |
keyRect = cellpaneRect.Rect();
|
|
1190 |
keyRect.Move( -keypadRect.Rect().iTl.iX, -keypadRect.Rect().iTl.iY );
|
|
1191 |
#ifdef LAF_MODIFY
|
|
1192 |
keyRect.iTl.iX = KKeypadRectXPoint11x[j];
|
|
1193 |
keyRect.SetWidth( KKeypadCellWidth11x[j] );
|
|
1194 |
#endif //LAF_MODIFY
|
|
1195 |
dataInfo->iKeypad.iRects.AppendL(keyRect);
|
|
1196 |
keyTextLayout.LayoutText(keyRect, keyText);
|
|
1197 |
dataInfo->iKeypad.iCharRects.AppendL(keyTextLayout.TextRect());
|
|
1198 |
}
|
|
1199 |
}
|
|
1200 |
iLayoutDataInfo.AppendL( dataInfo );
|
|
1201 |
|
|
1202 |
// ==================10x3 with candi pane====================
|
|
1203 |
dataInfo = new( ELeave ) CPeninputCnQwtLayoutDataInfo;
|
|
1204 |
wndLayout = AknLayoutScalable_Avkon::popup_fep_vkb2_window(4).LayoutLine();
|
|
1205 |
wndRect.LayoutRect(appWnd.Rect(), wndLayout);
|
|
1206 |
GetTopAndBottomPaneInfo( wndRect.Rect(), ELayout10x3, 3, *dataInfo );
|
|
1207 |
// keypad
|
|
1208 |
keyText = AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_t1(0).LayoutLine();
|
|
1209 |
dataInfo->iKeypad.iTextLayout = keyText;
|
|
1210 |
dataInfo->iKeypad.iFont = AknLayoutUtils::FontFromId(keyText.iFont, NULL);
|
|
1211 |
|
|
1212 |
keypad = AknLayoutScalable_Avkon::
|
|
1213 |
vkb2_area_keypad_pane(KVkbTopAndBottomParam[ELayout10x3_withCandi]).LayoutLine();
|
|
1214 |
keypadRect.LayoutRect(wndRect.Rect(), keypad);
|
|
1215 |
dataInfo->iKeypad.iKaypadRect = keypadRect.Rect();
|
|
1216 |
|
|
1217 |
for( TInt i = 0; i < KKeypadLayoutCn[0][1]; i++)
|
|
1218 |
{
|
|
1219 |
for( TInt j = 0; j < KKeypadLayoutCn[0][0]; j++)
|
|
1220 |
{
|
|
1221 |
rowpane = AknLayoutScalable_Avkon::vkb2_row_keypad_pane(2, 0, i).LayoutLine();
|
|
1222 |
rowpaneRect.LayoutRect(keypadRect.Rect(), rowpane);
|
|
1223 |
cellpane = (*cell_pane_func_cn[j])(0).LayoutLine();
|
|
1224 |
cellpaneRect.LayoutRect(rowpaneRect.Rect(), cellpane);
|
|
1225 |
keyRect = cellpaneRect.Rect();
|
|
1226 |
keyRect.Move( -keypadRect.Rect().iTl.iX, -keypadRect.Rect().iTl.iY );
|
|
1227 |
#ifdef LAF_MODIFY
|
|
1228 |
keyRect.iTl.iX = KKeypadRectXPoint10x[j];
|
|
1229 |
keyRect.SetWidth( KKeypadCellWidth10x[j] );
|
|
1230 |
#endif //LAF_MODIFY
|
|
1231 |
dataInfo->iKeypad.iRects.AppendL(keyRect);
|
|
1232 |
keyTextLayout.LayoutText(keyRect, keyText);
|
|
1233 |
dataInfo->iKeypad.iCharRects.AppendL(keyTextLayout.TextRect());
|
|
1234 |
}
|
|
1235 |
}
|
|
1236 |
iLayoutDataInfo.AppendL( dataInfo );
|
|
1237 |
|
|
1238 |
// ==================10x4(not create by laf)====================
|
|
1239 |
dataInfo = new( ELeave ) CPeninputCnQwtLayoutDataInfo;
|
|
1240 |
wndLayout = AknLayoutScalable_Avkon::popup_fep_vkb2_window(4).LayoutLine();
|
|
1241 |
wndRect.LayoutRect(appWnd.Rect(), wndLayout);
|
|
1242 |
// top pane and bottom pane
|
|
1243 |
GetTopAndBottomPaneInfo( wndRect.Rect(), ELayout10x3, 3, *dataInfo );
|
|
1244 |
// keypad
|
|
1245 |
keyText = AknLayoutScalable_Avkon::vkb2_cell_t_keypad_pane_t1(0).LayoutLine();
|
|
1246 |
dataInfo->iKeypad.iTextLayout = keyText;
|
|
1247 |
dataInfo->iKeypad.iFont = AknLayoutUtils::FontFromId(keyText.iFont, NULL);
|
|
1248 |
//dataInfo->iKeypad.iTxtRect = keyText.TextRect();
|
|
1249 |
|
|
1250 |
keypad = AknLayoutScalable_Avkon::
|
|
1251 |
vkb2_area_keypad_pane(KVkbTopAndBottomParam[ELayout10x3]).LayoutLine();
|
|
1252 |
keypadRect.LayoutRect(wndRect.Rect(), keypad);
|
|
1253 |
dataInfo->iKeypad.iKaypadRect = keypadRect.Rect();
|
|
1254 |
|
|
1255 |
TInt keyLastRowHeight = 0;
|
|
1256 |
TBool bLastRow = EFalse;
|
|
1257 |
for( TInt i = 0; i < KKeypadLayoutCn[3][1]; i++)
|
|
1258 |
{
|
|
1259 |
if( i == KKeypadLayoutCn[3][1] -1 )
|
|
1260 |
bLastRow = ETrue;
|
|
1261 |
for( TInt j = 0; j < KKeypadLayoutCn[3][0]; j++)
|
|
1262 |
{
|
|
1263 |
TInt index = bLastRow ? i-1 : i;
|
|
1264 |
rowpane = AknLayoutScalable_Avkon::vkb2_row_keypad_pane(2, 0, index).LayoutLine();
|
|
1265 |
rowpaneRect.LayoutRect(keypadRect.Rect(), rowpane);
|
|
1266 |
cellpane = (*cell_pane_func_cn[j])(0).LayoutLine();
|
|
1267 |
cellpaneRect.LayoutRect(rowpaneRect.Rect(), cellpane);
|
|
1268 |
keyRect = cellpaneRect.Rect();
|
|
1269 |
keyRect.Move( -keypadRect.Rect().iTl.iX, -keypadRect.Rect().iTl.iY );
|
|
1270 |
#ifdef LAF_MODIFY
|
|
1271 |
keyRect.iTl.iX = KKeypadRectXPoint10x[j];
|
|
1272 |
keyRect.SetWidth( KKeypadCellWidth10x[j] );
|
|
1273 |
if( bLastRow )
|
|
1274 |
{
|
|
1275 |
keyRect.Move(0, keyRect.Height());
|
|
1276 |
keyLastRowHeight = keyRect.Height();
|
|
1277 |
}
|
|
1278 |
#endif //LAF_MODIFY
|
|
1279 |
dataInfo->iKeypad.iRects.AppendL(keyRect);
|
|
1280 |
keyTextLayout.LayoutText(keyRect, keyText);
|
|
1281 |
dataInfo->iKeypad.iCharRects.AppendL(keyTextLayout.TextRect());
|
|
1282 |
}
|
|
1283 |
}
|
|
1284 |
dataInfo->iKeypad.iKaypadRect = keypadRect.Rect();
|
|
1285 |
dataInfo->iKeypad.iKaypadRect.iBr.iY += keyLastRowHeight;
|
|
1286 |
iLayoutDataInfo.AppendL( dataInfo );
|
|
1287 |
}
|
|
1288 |
// ---------------------------------------------------------------------------
|
|
1289 |
// CPeninputCnLafDataFSQ::NewL( TInt aLayoutType )
|
|
1290 |
// (other items were commented in a header)
|
|
1291 |
// ---------------------------------------------------------------------------
|
|
1292 |
//
|
|
1293 |
CPeninputCnLafDataFSQ* CPeninputCnLafDataFSQ::NewL( TInt aLayoutType )
|
|
1294 |
{
|
|
1295 |
CPeninputCnLafDataFSQ* self = NewLC( aLayoutType );
|
|
1296 |
CleanupStack::Pop();
|
|
1297 |
return self;
|
|
1298 |
}
|
|
1299 |
// ---------------------------------------------------------------------------
|
|
1300 |
// CPeninputCnLafDataFSQ::NewLC( TInt aLayoutType )
|
|
1301 |
// (other items were commented in a header)
|
|
1302 |
// ---------------------------------------------------------------------------
|
|
1303 |
//
|
|
1304 |
CPeninputCnLafDataFSQ* CPeninputCnLafDataFSQ::NewLC( TInt aLayoutType )
|
|
1305 |
{
|
|
1306 |
CPeninputCnLafDataFSQ* self = new ( ELeave ) CPeninputCnLafDataFSQ( aLayoutType );
|
|
1307 |
CleanupStack::PushL( self );
|
|
1308 |
self->ConstructL();
|
|
1309 |
|
|
1310 |
return self;
|
|
1311 |
|
|
1312 |
}
|
|
1313 |
|
|
1314 |
CPeninputCnLafDataFSQ::~CPeninputCnLafDataFSQ()
|
|
1315 |
{
|
|
1316 |
DestoryDataCommon();
|
|
1317 |
}
|
|
1318 |
|
|
1319 |
// ---------------------------------------------------------------------------
|
|
1320 |
// CPeninputCnLafDataFSQ::CPeninputCnLafDataFSQ( TInt aLayoutType )
|
|
1321 |
// (other items were commented in a header)
|
|
1322 |
// ---------------------------------------------------------------------------
|
|
1323 |
//
|
|
1324 |
CPeninputCnLafDataFSQ::CPeninputCnLafDataFSQ( TInt aLayoutType )
|
|
1325 |
{
|
|
1326 |
SetLayoutType( aLayoutType );
|
|
1327 |
}
|
|
1328 |
// ---------------------------------------------------------------------------
|
|
1329 |
// CPeninputCnLafDataFSQ::ReadLafInfo()
|
|
1330 |
// (other items were commented in a header)
|
|
1331 |
// ---------------------------------------------------------------------------
|
|
1332 |
//
|
|
1333 |
void CPeninputCnLafDataFSQ::ReadLafInfoL()
|
|
1334 |
{
|
|
1335 |
// clean up all the data
|
|
1336 |
iLayoutDataInfo.ResetAndDestroy();
|
|
1337 |
|
|
1338 |
CPeninputCnQwtLayoutDataInfo* dataInfo = new( ELeave ) CPeninputCnQwtLayoutDataInfo;
|
|
1339 |
TAknWindowLineLayout appWnd;
|
|
1340 |
TAknWindowLineLayout wndLayout;
|
|
1341 |
TAknWindowLineLayout keypad, cellpane;
|
|
1342 |
|
|
1343 |
// Modify begin
|
|
1344 |
//TAknWindowLineLayout cellPaneBK;
|
|
1345 |
//TAknLayoutRect cellPaneBKRect;
|
|
1346 |
//TRect keyBKRect;
|
|
1347 |
// Modify end
|
|
1348 |
|
|
1349 |
TAknLayoutRect keypadRect, cellpaneRect;
|
|
1350 |
TAknLayoutRect wndRect;
|
|
1351 |
TAknLayoutText keyTextLayout;
|
|
1352 |
TAknTextLineLayout keyText;
|
|
1353 |
TRect keyRect;
|
|
1354 |
|
|
1355 |
// -----------------------Landscape Mode--------------------------
|
|
1356 |
appWnd = AknLayoutScalable_Avkon::application_window(0).LayoutLine();
|
|
1357 |
wndLayout = AknLayoutScalable_Avkon::popup_fep_vkb2_window(0).LayoutLine();
|
|
1358 |
wndRect.LayoutRect(appWnd.Rect(), wndLayout);
|
|
1359 |
// ==================10x3====================
|
|
1360 |
// top pane and bottom pane
|
|
1361 |
GetTopAndBottomPaneInfo( wndRect.Rect(), ELayout10x3, 0, *dataInfo );
|
|
1362 |
dataInfo->iQwtRect = wndRect.Rect();
|
|
1363 |
// keypad
|
|
1364 |
keyText = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane_t1(0).LayoutLine();
|
|
1365 |
|
|
1366 |
keyText.iB -= 3;
|
|
1367 |
|
|
1368 |
dataInfo->iKeypad.iTextLayout = keyText;
|
|
1369 |
dataInfo->iKeypad.iFont = AknLayoutUtils::FontFromId(keyText.iFont, NULL);
|
|
1370 |
//dataInfo->iKeypad.iTxtRect = keyText.TextRect();
|
|
1371 |
|
|
1372 |
keypad = AknLayoutScalable_Avkon::vkb2_area_keypad_pane(0).LayoutLine();
|
|
1373 |
keypadRect.LayoutRect(wndRect.Rect(), keypad);
|
|
1374 |
dataInfo->iKeypad.iKaypadRect = keypadRect.Rect();
|
|
1375 |
|
|
1376 |
// Modify begin
|
|
1377 |
//cellPaneBK = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane_g1(0, 0, 0).LayoutLine();
|
|
1378 |
// Modify end
|
|
1379 |
|
|
1380 |
//iKeypadRect10x3 = keypadRect.Rect();
|
|
1381 |
for( TInt i = 0; i < KKeypadLayoutCn[0][1]; i++)
|
|
1382 |
{
|
|
1383 |
for( TInt j = 0; j < KKeypadLayoutCn[0][0]; j++)
|
|
1384 |
{
|
|
1385 |
cellpane = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane(0, j, i).LayoutLine();
|
|
1386 |
cellpaneRect.LayoutRect(keypadRect.Rect(), cellpane);
|
|
1387 |
keyRect = cellpaneRect.Rect();
|
|
1388 |
keyRect.Move( -keypadRect.Rect().iTl.iX, -keypadRect.Rect().iTl.iY );
|
|
1389 |
|
|
1390 |
// Modify begin
|
|
1391 |
//cellPaneBKRect.LayoutRect( keyRect, cellPaneBK );
|
|
1392 |
//keyBKRect = cellPaneBKRect.Rect();
|
|
1393 |
//dataInfo->iKeypad.iRects.AppendL( keyBKRect );
|
|
1394 |
// Modify end
|
|
1395 |
dataInfo->iKeypad.iRects.AppendL( keyRect );
|
|
1396 |
|
|
1397 |
keyTextLayout.LayoutText(keyRect, keyText);
|
|
1398 |
dataInfo->iKeypad.iCharRects.AppendL(keyTextLayout.TextRect());
|
|
1399 |
}
|
|
1400 |
}
|
|
1401 |
dataInfo->iKeypad.iFont = AknLayoutUtils::FontFromId(keyText.iFont, NULL);
|
|
1402 |
|
|
1403 |
// Add candate list laf data for ITI features
|
|
1404 |
// Candidate list's parent Layout window is ITUT window
|
|
1405 |
TPeninputCnCandidateListLayoutData candidateListLAF;
|
|
1406 |
TAknWindowLineLayout parentWnd;
|
|
1407 |
TBool isLandscape = Layout_Meta_Data::IsLandscapeOrientation();
|
|
1408 |
// Add tooltip box laf data for ITI features.
|
|
1409 |
TPeninputCnTooltipBoxLayoutData tooltipBoxLAF;
|
|
1410 |
if (isLandscape)
|
|
1411 |
{
|
|
1412 |
parentWnd
|
|
1413 |
= AknLayoutScalable_Apps::popup_vitu2_window( 1 ).LayoutLine();
|
|
1414 |
TAknLayoutRect parentRectLayout;
|
|
1415 |
parentRectLayout.LayoutRect( appWnd.Rect(), parentWnd );
|
|
1416 |
candidateListLAF = ReadLafForCandidateList( parentRectLayout.Rect() );
|
|
1417 |
dataInfo->iCandidateList = candidateListLAF;
|
|
1418 |
tooltipBoxLAF = ReadLafForTooltipBox( wndRect.Rect() );
|
|
1419 |
dataInfo->iTooltipBox = tooltipBoxLAF;
|
|
1420 |
}
|
|
1421 |
|
|
1422 |
iLayoutDataInfo.AppendL( dataInfo );
|
|
1423 |
|
|
1424 |
// ==================11x3====================
|
|
1425 |
dataInfo = new( ELeave ) CPeninputCnQwtLayoutDataInfo;
|
|
1426 |
wndLayout = AknLayoutScalable_Avkon::popup_fep_vkb2_window(0).LayoutLine();
|
|
1427 |
wndRect.LayoutRect(appWnd.Rect(), wndLayout);
|
|
1428 |
// top pane and bottom pane
|
|
1429 |
GetTopAndBottomPaneInfo( wndRect.Rect(), ELayout11x3, 1, *dataInfo );
|
|
1430 |
dataInfo->iQwtRect = wndRect.Rect();
|
|
1431 |
// keypad
|
|
1432 |
keypad = AknLayoutScalable_Avkon::vkb2_area_keypad_pane(1).LayoutLine();
|
|
1433 |
keypadRect.LayoutRect(wndRect.Rect(), keypad);
|
|
1434 |
dataInfo->iKeypad.iKaypadRect = keypadRect.Rect();
|
|
1435 |
|
|
1436 |
keyText = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane_t1(1).LayoutLine();
|
|
1437 |
dataInfo->iKeypad.iTextLayout = keyText;
|
|
1438 |
dataInfo->iKeypad.iFont = AknLayoutUtils::FontFromId(keyText.iFont, NULL);
|
|
1439 |
|
|
1440 |
// Modify begin
|
|
1441 |
//cellPaneBK = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane_g1(1, 0, 0).LayoutLine();
|
|
1442 |
// Modify end
|
|
1443 |
|
|
1444 |
for( TInt i = 0; i < KKeypadLayoutCn[1][1]; i++)
|
|
1445 |
{
|
|
1446 |
for( TInt j = 0; j < KKeypadLayoutCn[1][0]; j++)
|
|
1447 |
{
|
|
1448 |
cellpane = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane(1, j, i).LayoutLine();
|
|
1449 |
cellpaneRect.LayoutRect(keypadRect.Rect(), cellpane);
|
|
1450 |
keyRect = cellpaneRect.Rect();
|
|
1451 |
keyRect.Move( -keypadRect.Rect().iTl.iX, -keypadRect.Rect().iTl.iY );
|
|
1452 |
|
|
1453 |
// Modify begin
|
|
1454 |
//cellPaneBKRect.LayoutRect( keyRect, cellPaneBK );
|
|
1455 |
//keyBKRect = cellPaneBKRect.Rect();
|
|
1456 |
//dataInfo->iKeypad.iRects.AppendL( keyBKRect );
|
|
1457 |
// Modify end
|
|
1458 |
dataInfo->iKeypad.iRects.AppendL( keyRect );
|
|
1459 |
|
|
1460 |
keyTextLayout.LayoutText(keyRect, keyText);
|
|
1461 |
dataInfo->iKeypad.iCharRects.AppendL(keyTextLayout.TextRect());
|
|
1462 |
}
|
|
1463 |
}
|
|
1464 |
|
|
1465 |
if ( isLandscape )
|
|
1466 |
{
|
|
1467 |
// Add candate list laf data for ITI features
|
|
1468 |
dataInfo->iCandidateList = candidateListLAF;
|
|
1469 |
// Add tooltip box laf data for ITI features.
|
|
1470 |
dataInfo->iTooltipBox = tooltipBoxLAF;
|
|
1471 |
}
|
|
1472 |
|
|
1473 |
iLayoutDataInfo.AppendL( dataInfo );
|
|
1474 |
|
|
1475 |
// ==================11x4====================
|
|
1476 |
dataInfo = new( ELeave ) CPeninputCnQwtLayoutDataInfo;
|
|
1477 |
wndLayout = AknLayoutScalable_Avkon::popup_fep_vkb2_window(0).LayoutLine();
|
|
1478 |
wndRect.LayoutRect(appWnd.Rect(), wndLayout);
|
|
1479 |
// top pane and bottom pane
|
|
1480 |
GetTopAndBottomPaneInfo( wndRect.Rect(), ELayout11x4, 2, *dataInfo );
|
|
1481 |
dataInfo->iQwtRect = wndRect.Rect();
|
|
1482 |
// keypad
|
|
1483 |
keypad = AknLayoutScalable_Avkon::vkb2_area_keypad_pane(2).LayoutLine();
|
|
1484 |
keypadRect.LayoutRect(wndRect.Rect(), keypad);
|
|
1485 |
dataInfo->iKeypad.iKaypadRect = keypadRect.Rect();
|
|
1486 |
|
|
1487 |
keyText = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane_t1(2).LayoutLine();
|
|
1488 |
|
|
1489 |
//keyText.iB += 3;
|
|
1490 |
|
|
1491 |
dataInfo->iKeypad.iTextLayout = keyText;
|
|
1492 |
dataInfo->iKeypad.iFont = AknLayoutUtils::FontFromId(keyText.iFont, NULL);
|
|
1493 |
|
|
1494 |
// Modify begin
|
|
1495 |
//cellPaneBK = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane_g1(2, 0, 0).LayoutLine();
|
|
1496 |
// Modify end
|
|
1497 |
|
|
1498 |
for( TInt i = 0; i < KKeypadLayoutCn[2][1]; i++)
|
|
1499 |
{
|
|
1500 |
for( TInt j = 0; j < KKeypadLayoutCn[2][0]; j++)
|
|
1501 |
{
|
|
1502 |
cellpane = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane(2, j, i).LayoutLine();
|
|
1503 |
cellpaneRect.LayoutRect(keypadRect.Rect(), cellpane);
|
|
1504 |
keyRect = cellpaneRect.Rect();
|
|
1505 |
keyRect.Move( -keypadRect.Rect().iTl.iX, -keypadRect.Rect().iTl.iY );
|
|
1506 |
|
|
1507 |
// Modify begin
|
|
1508 |
//cellPaneBKRect.LayoutRect( keyRect, cellPaneBK );
|
|
1509 |
//keyBKRect = cellPaneBKRect.Rect();
|
|
1510 |
//dataInfo->iKeypad.iRects.AppendL( keyBKRect );
|
|
1511 |
// Modify end
|
|
1512 |
dataInfo->iKeypad.iRects.AppendL( keyRect );
|
|
1513 |
|
|
1514 |
keyTextLayout.LayoutText(keyRect, keyText);
|
|
1515 |
dataInfo->iKeypad.iCharRects.AppendL(keyTextLayout.TextRect());
|
|
1516 |
}
|
|
1517 |
}
|
|
1518 |
|
|
1519 |
if ( isLandscape )
|
|
1520 |
{
|
|
1521 |
// Add candate list laf data for ITI features
|
|
1522 |
dataInfo->iCandidateList = candidateListLAF;
|
|
1523 |
// Add tooltip box laf data for ITI features.
|
|
1524 |
dataInfo->iTooltipBox = tooltipBoxLAF;
|
|
1525 |
}
|
|
1526 |
|
|
1527 |
iLayoutDataInfo.AppendL( dataInfo );
|
|
1528 |
|
|
1529 |
// ==================10x3 with candi pane====================
|
|
1530 |
dataInfo = new( ELeave ) CPeninputCnQwtLayoutDataInfo;
|
|
1531 |
wndLayout = AknLayoutScalable_Avkon::popup_fep_vkb2_window(0).LayoutLine();
|
|
1532 |
wndRect.LayoutRect(appWnd.Rect(), wndLayout);
|
|
1533 |
GetTopAndBottomPaneInfo( wndRect.Rect(), ELayout10x3, 0, *dataInfo );
|
|
1534 |
dataInfo->iQwtRect = wndRect.Rect();
|
|
1535 |
|
|
1536 |
keyText = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane_t1(0).LayoutLine();
|
|
1537 |
|
|
1538 |
keyText.iB -= 3;
|
|
1539 |
|
|
1540 |
dataInfo->iKeypad.iTextLayout = keyText;
|
|
1541 |
dataInfo->iKeypad.iFont = AknLayoutUtils::FontFromId(keyText.iFont, NULL);
|
|
1542 |
|
|
1543 |
keypad = AknLayoutScalable_Avkon::vkb2_area_keypad_pane(6).LayoutLine();
|
|
1544 |
keypadRect.LayoutRect(wndRect.Rect(), keypad);
|
|
1545 |
dataInfo->iKeypad.iKaypadRect = keypadRect.Rect();
|
|
1546 |
|
|
1547 |
// Modify begin
|
|
1548 |
//cellPaneBK = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane_g1(0, 0, 0).LayoutLine();
|
|
1549 |
// Modify end
|
|
1550 |
|
|
1551 |
TInt keyHeight = keypadRect.Rect().Height()/3;
|
|
1552 |
for( TInt i = 0; i < KKeypadLayoutCn[0][1]; i++)
|
|
1553 |
{
|
|
1554 |
for( TInt j = 0; j < KKeypadLayoutCn[0][0]; j++)
|
|
1555 |
{
|
|
1556 |
cellpane = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane(0, j, 0).LayoutLine();
|
|
1557 |
cellpaneRect.LayoutRect(keypadRect.Rect(), cellpane);
|
|
1558 |
keyRect = cellpaneRect.Rect();
|
|
1559 |
keyRect.SetHeight( keyHeight );
|
|
1560 |
keyRect.Move( -keypadRect.Rect().iTl.iX, -keypadRect.Rect().iTl.iY + keyHeight*i);
|
|
1561 |
|
|
1562 |
// Modify begin
|
|
1563 |
//cellPaneBKRect.LayoutRect( keyRect, cellPaneBK );
|
|
1564 |
//keyBKRect = cellPaneBKRect.Rect();
|
|
1565 |
//dataInfo->iKeypad.iRects.AppendL( keyBKRect );
|
|
1566 |
// Modify end
|
|
1567 |
dataInfo->iKeypad.iRects.AppendL( keyRect );
|
|
1568 |
|
|
1569 |
keyTextLayout.LayoutText(keyRect, keyText);
|
|
1570 |
dataInfo->iKeypad.iCharRects.AppendL(keyTextLayout.TextRect());
|
|
1571 |
}
|
|
1572 |
}
|
|
1573 |
dataInfo->iKeypad.iKaypadRect = keypadRect.Rect();
|
|
1574 |
dataInfo->iKeypad.iKaypadRect.SetHeight( keyHeight* 3 );
|
|
1575 |
// calculate the text pos offset since no right laf for it
|
|
1576 |
TInt offsetTextY = cellpaneRect.Rect().Height() - keyHeight;
|
|
1577 |
dataInfo->iKeypad.iTextLayout.iB += offsetTextY - 2;
|
|
1578 |
|
|
1579 |
if ( isLandscape )
|
|
1580 |
{
|
|
1581 |
// Add candate list laf data for ITI features
|
|
1582 |
dataInfo->iCandidateList = candidateListLAF;
|
|
1583 |
// Add tooltip box laf data for ITI features.
|
|
1584 |
dataInfo->iTooltipBox = tooltipBoxLAF;
|
|
1585 |
}
|
|
1586 |
|
|
1587 |
iLayoutDataInfo.AppendL( dataInfo );
|
|
1588 |
|
|
1589 |
// ==================10x4(not create by laf)====================
|
|
1590 |
dataInfo = new( ELeave ) CPeninputCnQwtLayoutDataInfo;
|
|
1591 |
wndLayout = AknLayoutScalable_Avkon::popup_fep_vkb2_window(0).LayoutLine();
|
|
1592 |
wndRect.LayoutRect(appWnd.Rect(), wndLayout);
|
|
1593 |
GetTopAndBottomPaneInfo( wndRect.Rect(), ELayout10x3, 0, *dataInfo );
|
|
1594 |
dataInfo->iQwtRect = wndRect.Rect();
|
|
1595 |
|
|
1596 |
// keypad
|
|
1597 |
keyText = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane_t1(0).LayoutLine();
|
|
1598 |
|
|
1599 |
keyText.iB -= 3;
|
|
1600 |
|
|
1601 |
dataInfo->iKeypad.iTextLayout = keyText;
|
|
1602 |
dataInfo->iKeypad.iFont = AknLayoutUtils::FontFromId(keyText.iFont, NULL);
|
|
1603 |
|
|
1604 |
keypad = AknLayoutScalable_Avkon::vkb2_area_keypad_pane(6).LayoutLine();
|
|
1605 |
keypadRect.LayoutRect(wndRect.Rect(), keypad);
|
|
1606 |
dataInfo->iKeypad.iKaypadRect = keypadRect.Rect();
|
|
1607 |
|
|
1608 |
// Modify begin
|
|
1609 |
//cellPaneBK = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane_g1(0, 0, 0).LayoutLine();
|
|
1610 |
// Modify end
|
|
1611 |
|
|
1612 |
keyHeight = keypadRect.Rect().Height()/3;
|
|
1613 |
for( TInt i = 0; i < KKeypadLayoutCn[3][1]; i++)
|
|
1614 |
{
|
|
1615 |
for( TInt j = 0; j < KKeypadLayoutCn[3][0]; j++)
|
|
1616 |
{
|
|
1617 |
cellpane = AknLayoutScalable_Avkon::vkb2_cell_keypad_pane(0, j, 0).LayoutLine();
|
|
1618 |
cellpaneRect.LayoutRect(keypadRect.Rect(), cellpane);
|
|
1619 |
keyRect = cellpaneRect.Rect();
|
|
1620 |
keyRect.SetHeight( keyHeight );
|
|
1621 |
keyRect.Move( -keypadRect.Rect().iTl.iX, -keypadRect.Rect().iTl.iY + keyHeight*i);
|
|
1622 |
|
|
1623 |
// Modify begin
|
|
1624 |
//cellPaneBKRect.LayoutRect( keyRect, cellPaneBK );
|
|
1625 |
//keyBKRect = cellPaneBKRect.Rect();
|
|
1626 |
//dataInfo->iKeypad.iRects.AppendL( keyBKRect );
|
|
1627 |
// Modify end
|
|
1628 |
dataInfo->iKeypad.iRects.AppendL( keyRect );
|
|
1629 |
|
|
1630 |
keyTextLayout.LayoutText(keyRect, keyText);
|
|
1631 |
dataInfo->iKeypad.iCharRects.AppendL(keyTextLayout.TextRect());
|
|
1632 |
}
|
|
1633 |
}
|
|
1634 |
dataInfo->iKeypad.iKaypadRect = keypadRect.Rect();
|
|
1635 |
dataInfo->iKeypad.iKaypadRect.SetHeight( keyHeight*4 );
|
|
1636 |
// calculate the text pos offset since no right laf for it
|
|
1637 |
offsetTextY = cellpaneRect.Rect().Height() - keyHeight;
|
|
1638 |
dataInfo->iKeypad.iTextLayout.iB += offsetTextY - 2;
|
|
1639 |
|
|
1640 |
if ( isLandscape )
|
|
1641 |
{
|
|
1642 |
// Add candate list laf data for ITI features
|
|
1643 |
dataInfo->iCandidateList = candidateListLAF;
|
|
1644 |
// Add tooltip box laf data for ITI features.
|
|
1645 |
dataInfo->iTooltipBox = tooltipBoxLAF;
|
|
1646 |
}
|
|
1647 |
|
|
1648 |
iLayoutDataInfo.AppendL( dataInfo );
|
|
1649 |
}
|
|
1650 |
|
|
1651 |
// ---------------------------------------------------------------------------
|
|
1652 |
// Read LAF data for candidate list
|
|
1653 |
// ---------------------------------------------------------------------------
|
|
1654 |
//
|
|
1655 |
TPeninputCnCandidateListLayoutData CPeninputCnLafDataFSQ::
|
|
1656 |
ReadLafForCandidateList( const TRect& aRect )
|
|
1657 |
{
|
|
1658 |
// candidate list
|
|
1659 |
TAknWindowLineLayout candidateList
|
|
1660 |
= AknLayoutScalable_Apps::popup_vitu2_match_list_window( 3 )
|
|
1661 |
.LayoutLine();
|
|
1662 |
TAknLayoutRect candidateListRect;
|
|
1663 |
candidateListRect.LayoutRect( aRect, candidateList );
|
|
1664 |
|
|
1665 |
// list pane, its parent is candidate list
|
|
1666 |
TAknWindowLineLayout listpane
|
|
1667 |
= AknLayoutScalable_Apps::list_vitu2_match_list_pane( 1 )
|
|
1668 |
.LayoutLine();
|
|
1669 |
TAknLayoutRect listpaneRect;
|
|
1670 |
listpaneRect.LayoutRect( candidateListRect.Rect(), listpane );
|
|
1671 |
|
|
1672 |
// scroll pane, its parent is candidate list
|
|
1673 |
TAknWindowLineLayout scrollpane
|
|
1674 |
= AknLayoutScalable_Apps::vitu2_page_scroll_pane( 1 )
|
|
1675 |
.LayoutLine();
|
|
1676 |
TAknLayoutRect scrollRect;
|
|
1677 |
scrollRect.LayoutRect( candidateListRect.Rect(), scrollpane );
|
|
1678 |
|
|
1679 |
// Item pane, its parent is list pane
|
|
1680 |
TAknWindowLineLayout itemPane
|
|
1681 |
= AknLayoutScalable_Apps::list_vitu2_match_list_item_pane( 0, 0, 0 )
|
|
1682 |
.LayoutLine();
|
|
1683 |
TAknLayoutRect itemPaneRect;
|
|
1684 |
itemPaneRect.LayoutRect( listpaneRect.Rect(), itemPane );
|
|
1685 |
|
|
1686 |
TPeninputCnCandidateListLayoutData layoutData;
|
|
1687 |
layoutData.iSelectionHorMargin = listpaneRect.Rect().iTl.iX;
|
|
1688 |
layoutData.iSelectionVerMargin = listpaneRect.Rect().iTl.iY;
|
|
1689 |
layoutData.iSelectionItemSize = itemPaneRect.Rect().Size();
|
|
1690 |
|
|
1691 |
// Up button image. its parent is scroll pane
|
|
1692 |
TAknWindowLineLayout arrowUpImagePane
|
|
1693 |
= AknLayoutScalable_Apps::vitu2_page_scroll_pane_g1()
|
|
1694 |
.LayoutLine();
|
|
1695 |
TAknLayoutRect arrowUpImageRect;
|
|
1696 |
arrowUpImageRect.LayoutRect( scrollRect.Rect(), arrowUpImagePane );
|
|
1697 |
// Up button, its parent is scroll pane
|
|
1698 |
TAknWindowLineLayout arrowUpPane
|
|
1699 |
= AknLayoutScalable_Apps::bg_button_pane_cp023().LayoutLine();
|
|
1700 |
TAknLayoutRect arrowUpRect;
|
|
1701 |
arrowUpRect.LayoutRect( scrollRect.Rect(), arrowUpPane );
|
|
1702 |
|
|
1703 |
// Down button image, its parent is scroll pane
|
|
1704 |
TAknWindowLineLayout arrowDownImagePane
|
|
1705 |
= AknLayoutScalable_Apps::vitu2_page_scroll_pane_g2().LayoutLine();
|
|
1706 |
TAknLayoutRect arrowDownImageRect;
|
|
1707 |
arrowDownImageRect.LayoutRect( scrollRect.Rect(), arrowDownImagePane );
|
|
1708 |
|
|
1709 |
// Down button, its parent is scroll pane
|
|
1710 |
TAknWindowLineLayout arrowDownPane
|
|
1711 |
= AknLayoutScalable_Apps::bg_button_pane_cp024().LayoutLine();
|
|
1712 |
TAknLayoutRect arrowDownRect;
|
|
1713 |
arrowDownRect.LayoutRect( scrollRect.Rect(), arrowDownPane );
|
|
1714 |
|
|
1715 |
layoutData.iSelectionNaviSize = arrowUpRect.Rect().Size();
|
|
1716 |
layoutData.iSelectionNaviInnerSize = arrowUpImagePane.Rect().Size();
|
|
1717 |
|
|
1718 |
layoutData.iSelectionTextLine
|
|
1719 |
= AknLayoutScalable_Apps::list_vitu2_match_list_item_pane_t1()
|
|
1720 |
.LayoutLine();
|
|
1721 |
layoutData.iSelectionPageTextLine
|
|
1722 |
= AknLayoutScalable_Apps::vitu2_page_scroll_pane_t1().LayoutLine();
|
|
1723 |
|
|
1724 |
TAknLayoutText list_item_pane_t1_layout_text;
|
|
1725 |
list_item_pane_t1_layout_text.LayoutText( listpaneRect.Rect(),
|
|
1726 |
layoutData.iSelectionTextLine );
|
|
1727 |
layoutData.iFont = list_item_pane_t1_layout_text.Font();
|
|
1728 |
return layoutData;
|
|
1729 |
}
|
|
1730 |
|
|
1731 |
// ---------------------------------------------------------------------------
|
|
1732 |
// Read LAF data for tooltip box
|
|
1733 |
// ---------------------------------------------------------------------------
|
|
1734 |
//
|
|
1735 |
TPeninputCnTooltipBoxLayoutData CPeninputCnLafDataFSQ::
|
|
1736 |
ReadLafForTooltipBox( const TRect& aRect )
|
|
1737 |
{
|
|
1738 |
TAknWindowLineLayout tooltipBoxLayout
|
|
1739 |
= AknLayoutScalable_Avkon::popup_fep_tooltip_window( 0 ).LayoutLine();
|
|
1740 |
|
|
1741 |
TAknLayoutRect tooltipBoxRect;
|
|
1742 |
tooltipBoxRect.LayoutRect( aRect, tooltipBoxLayout );
|
|
1743 |
|
|
1744 |
TPeninputCnTooltipBoxLayoutData layoutData;
|
|
1745 |
layoutData.iRect = tooltipBoxRect.Rect();
|
|
1746 |
|
|
1747 |
layoutData.iTooltipTextLayout
|
|
1748 |
= AknLayoutScalable_Avkon::popup_fep_tooltip_window_t1( 0 )
|
|
1749 |
.LayoutLine();
|
|
1750 |
|
|
1751 |
layoutData.iFont = AknLayoutUtils::FontFromId
|
|
1752 |
( layoutData.iTooltipTextLayout.iFont, NULL );
|
|
1753 |
return layoutData;
|
|
1754 |
}
|