21
|
1 |
/*
|
|
2 |
* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0""
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: peninput vkb laf manager
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef C_PENINPUTVKBCNLAFDATAMGR_H
|
|
20 |
#define C_PENINPUTVKBCNLAFDATAMGR_H
|
|
21 |
|
|
22 |
// System includes
|
|
23 |
#include <e32base.h>
|
|
24 |
#include <w32std.h>
|
|
25 |
#include <AknFepGlobalEnums.h>
|
|
26 |
// User includes
|
|
27 |
|
|
28 |
// Forward decalaration
|
|
29 |
|
|
30 |
// laf type definition
|
|
31 |
enum TPeninputCnQwtLayoutType
|
|
32 |
{
|
|
33 |
ELayoutNone = -1,
|
|
34 |
ELayout10x3,
|
|
35 |
ELayout11x3,
|
|
36 |
ELayout11x4,
|
|
37 |
ELayout10x3_withCandi,
|
|
38 |
ELayout10x4
|
|
39 |
};
|
|
40 |
|
|
41 |
enum TPeninputCnCellType
|
|
42 |
{
|
|
43 |
EVkbCangjieAndPinying, // 10
|
|
44 |
EVkbStroke, // 10
|
|
45 |
EVkbZhuyin, // 11
|
|
46 |
EVkbLatin_Zhuyin, // 11
|
|
47 |
EVkbLatin, // 10
|
|
48 |
EVkbAccent,
|
|
49 |
EVkbNumber, // 10
|
|
50 |
EVkbNumber_Zhuyin, // 11
|
|
51 |
EVkbCangjieAndPinying_FSQ, // 10
|
|
52 |
EVkbStroke_FSQ, // 10
|
|
53 |
EVkbZhuyin_FSQ, // 11
|
|
54 |
EVkbLatin_FSQ, // 10
|
|
55 |
EVkbNumber_FSQ, // 10
|
|
56 |
EVkbLatin_Zhuyin_FSQ, // 11
|
|
57 |
EVkbNumber_Zhuyin_FSQ // 11
|
|
58 |
};
|
|
59 |
|
|
60 |
enum TPeninputCnVkbLafOption
|
|
61 |
{
|
|
62 |
EOptionNone, // Default option setting
|
|
63 |
EOption3CellRange = 0x0001,
|
|
64 |
EOptionWithSmily = 0x0002
|
|
65 |
};
|
|
66 |
|
|
67 |
struct TPeninputCnButtonLayoutData
|
|
68 |
{
|
|
69 |
TRect iRect;
|
|
70 |
TRect iInnerRect;
|
|
71 |
};
|
|
72 |
|
|
73 |
struct TPeninputCnKeyLayoutData
|
|
74 |
{
|
|
75 |
TRect iKaypadRect;
|
|
76 |
RArray<TRect> iRects;
|
|
77 |
RArray<TRect> iCharRects;
|
|
78 |
TAknTextLineLayout iTextLayout;
|
|
79 |
const CFont* iFont;
|
|
80 |
};
|
|
81 |
|
|
82 |
struct TPeninputCnEntryLayoutData
|
|
83 |
{
|
|
84 |
TRect iRect;
|
|
85 |
TRect iPromptTextRect;
|
|
86 |
TRect iTextRect;
|
|
87 |
const CFont* iPromptTextFont;
|
|
88 |
const CFont* iTextFont;
|
|
89 |
};
|
|
90 |
|
|
91 |
struct TPeninputCnICFConfig
|
|
92 |
{
|
|
93 |
TInt iLeftMargin;
|
|
94 |
TInt iRightMargin;
|
|
95 |
TInt iTopMargin;
|
|
96 |
TInt iTextLineHeight;
|
|
97 |
TInt iLineSpaceMargin;
|
|
98 |
};
|
|
99 |
|
|
100 |
|
|
101 |
struct TPeninputCnRangeBarLayoutData
|
|
102 |
{
|
|
103 |
TRect iRect;
|
|
104 |
RArray<TPeninputCnButtonLayoutData> iCellDataArray;
|
|
105 |
};
|
|
106 |
|
|
107 |
struct TPeninputCnSpaceIconLayoutDataEx
|
|
108 |
{
|
|
109 |
TSize iIconOffset; // The offset to the left and top border of frame
|
|
110 |
TInt iSideIconWidth; // The width of two sizes'subicon
|
|
111 |
};
|
|
112 |
|
|
113 |
/*
|
|
114 |
* Store LAF data for candidate list
|
|
115 |
*/
|
|
116 |
struct TPeninputCnCandidateListLayoutData
|
|
117 |
{
|
|
118 |
TSize iSelectionItemSize;
|
|
119 |
TInt iSelectionHorMargin;
|
|
120 |
TInt iSelectionVerMargin;
|
|
121 |
TSize iSelectionNaviSize;
|
|
122 |
TSize iSelectionNaviInnerSize;
|
|
123 |
TAknTextLineLayout iSelectionTextLine;
|
|
124 |
TAknTextLineLayout iSelectionPageTextLine;
|
|
125 |
const CFont* iFont;
|
|
126 |
};
|
|
127 |
|
|
128 |
/*
|
|
129 |
* Stroe LAF data for tooltip box
|
|
130 |
*/
|
|
131 |
struct TPeninputCnTooltipBoxLayoutData
|
|
132 |
{
|
|
133 |
TRect iRect;
|
|
134 |
TAknTextLineLayout iTooltipTextLayout;
|
|
135 |
const CFont* iFont;
|
|
136 |
};
|
|
137 |
|
|
138 |
class CPeninputCnQwtLayoutDataInfo : public CBase
|
|
139 |
{
|
|
140 |
public:
|
|
141 |
virtual ~CPeninputCnQwtLayoutDataInfo();
|
|
142 |
TPeninputCnButtonLayoutData iCloseButton;
|
|
143 |
TPeninputCnButtonLayoutData iOptionButton;
|
|
144 |
TPeninputCnEntryLayoutData iICF;
|
|
145 |
TPeninputCnButtonLayoutData iMoveButton;
|
|
146 |
TPeninputCnButtonLayoutData iLeftButton;
|
|
147 |
TPeninputCnButtonLayoutData iRightButton;
|
|
148 |
TPeninputCnButtonLayoutData iClearButton;
|
|
149 |
TPeninputCnKeyLayoutData iKeypad;
|
|
150 |
TPeninputCnButtonLayoutData iShiftButton;
|
|
151 |
TPeninputCnRangeBarLayoutData iRangbar;
|
|
152 |
TPeninputCnButtonLayoutData iSmillyButton;
|
|
153 |
TPeninputCnButtonLayoutData iSpaceButton;
|
|
154 |
TPeninputCnButtonLayoutData iEnterButton;
|
|
155 |
TPeninputCnButtonLayoutData iSwitchButton;
|
|
156 |
TRect iTitlebarRect;
|
|
157 |
TRect iClientRect;
|
|
158 |
TRect iQwtRect;
|
|
159 |
TRect iPreviewWndRect;
|
|
160 |
TRect iPreviewWndInnerRect;
|
|
161 |
TAknTextLineLayout iPreviewWndText;
|
|
162 |
CFont* iPreviewFont;
|
|
163 |
TPeninputCnSpaceIconLayoutDataEx iSpaceIconLayout;
|
|
164 |
|
|
165 |
/*
|
|
166 |
* LAF data for candidate list
|
|
167 |
*/
|
|
168 |
TPeninputCnCandidateListLayoutData iCandidateList;
|
|
169 |
|
|
170 |
/*
|
|
171 |
* LAF data for tooltip box
|
|
172 |
*/
|
|
173 |
TPeninputCnTooltipBoxLayoutData iTooltipBox;
|
|
174 |
};
|
|
175 |
|
|
176 |
class MPeninputCnLafDataBase
|
|
177 |
{
|
|
178 |
public:
|
|
179 |
virtual const TPeninputCnButtonLayoutData& ButtonLayoutData( TInt aButtonID ) const = 0;
|
|
180 |
virtual const TPeninputCnEntryLayoutData& ICFLayoutData() const = 0;
|
|
181 |
virtual const TPeninputCnKeyLayoutData& KeypadLayoutData() const = 0;
|
|
182 |
virtual const TPeninputCnRangeBarLayoutData& RangbarLayoutData() const = 0;
|
|
183 |
|
|
184 |
virtual const CPeninputCnQwtLayoutDataInfo& QwtLayoutData() const = 0;
|
|
185 |
virtual void SetLayoutType( TInt aLayoutType ) = 0;
|
|
186 |
virtual TInt LayoutType() const = 0;
|
|
187 |
};
|
|
188 |
|
|
189 |
class MPeninputCnLafDataCommon : public MPeninputCnLafDataBase
|
|
190 |
{
|
|
191 |
public:
|
|
192 |
virtual ~MPeninputCnLafDataCommon();
|
|
193 |
void DestoryDataCommon();
|
|
194 |
const TPeninputCnButtonLayoutData& ButtonLayoutData( TInt aButtonID ) const;
|
|
195 |
const TPeninputCnEntryLayoutData& ICFLayoutData() const ;
|
|
196 |
const TPeninputCnKeyLayoutData& KeypadLayoutData() const ;
|
|
197 |
const TPeninputCnRangeBarLayoutData& RangbarLayoutData() const;
|
|
198 |
const CPeninputCnQwtLayoutDataInfo& QwtLayoutData() const;
|
|
199 |
|
|
200 |
/*
|
|
201 |
* Return layout data for candidate list;
|
|
202 |
*
|
|
203 |
* @return The layout data for candidate list
|
|
204 |
*/
|
|
205 |
const TPeninputCnCandidateListLayoutData& CandidateListLayoutData() const;
|
|
206 |
|
|
207 |
/*
|
|
208 |
* Return layout data for tooltip box;
|
|
209 |
*
|
|
210 |
* @return The layout data for tooltip box
|
|
211 |
*/
|
|
212 |
const TPeninputCnTooltipBoxLayoutData& TooltipBoxLayoutData() const;
|
|
213 |
|
|
214 |
inline void SetLayoutType( TInt aLayoutType );
|
|
215 |
inline TInt LayoutType() const;
|
|
216 |
inline void SetLafOption( TPeninputCnVkbLafOption aLafOption );
|
|
217 |
inline TPeninputCnVkbLafOption LafOption() const;
|
|
218 |
void ConstructL();
|
|
219 |
TBool IsValid() const;
|
|
220 |
protected:
|
|
221 |
void GetTopAndBottomPaneInfo( const TRect& aParentWndRect,
|
|
222 |
TInt aLayoutType,
|
|
223 |
TInt aLayoutParam,
|
|
224 |
CPeninputCnQwtLayoutDataInfo& aDataInfo );
|
|
225 |
virtual void ReadLafInfoL() = 0;
|
|
226 |
|
|
227 |
TInt iLayoutType;
|
|
228 |
TPeninputCnVkbLafOption iLafOption;
|
|
229 |
RPointerArray<CPeninputCnQwtLayoutDataInfo> iLayoutDataInfo;
|
|
230 |
};
|
|
231 |
|
|
232 |
class CPeninputCnLafDataVKB : public CBase,
|
|
233 |
public MPeninputCnLafDataCommon
|
|
234 |
|
|
235 |
{
|
|
236 |
public:
|
|
237 |
static CPeninputCnLafDataVKB* NewL( TInt aLayoutType );
|
|
238 |
static CPeninputCnLafDataVKB* NewLC( TInt aLayoutType );
|
|
239 |
virtual ~CPeninputCnLafDataVKB();
|
|
240 |
|
|
241 |
protected:
|
|
242 |
CPeninputCnLafDataVKB( TInt aLayoutType );
|
|
243 |
|
|
244 |
void ReadLafInfoL();
|
|
245 |
};
|
|
246 |
|
|
247 |
class CPeninputCnLafDataFSQ : public CBase,
|
|
248 |
public MPeninputCnLafDataCommon
|
|
249 |
|
|
250 |
{
|
|
251 |
public:
|
|
252 |
static CPeninputCnLafDataFSQ* NewL( TInt aLayoutType );
|
|
253 |
static CPeninputCnLafDataFSQ* NewLC( TInt aLayoutType );
|
|
254 |
virtual ~CPeninputCnLafDataFSQ();
|
|
255 |
|
|
256 |
protected:
|
|
257 |
CPeninputCnLafDataFSQ( TInt aLayoutType );
|
|
258 |
|
|
259 |
void ReadLafInfoL();
|
|
260 |
|
|
261 |
private:
|
|
262 |
|
|
263 |
/**
|
|
264 |
* Read LAF data for candidate list
|
|
265 |
*
|
|
266 |
* @param aRect the parent window's rect
|
|
267 |
* @return candidate list layout data
|
|
268 |
*/
|
|
269 |
TPeninputCnCandidateListLayoutData ReadLafForCandidateList( const TRect& aRect );
|
|
270 |
|
|
271 |
/**
|
|
272 |
* Read LAF data for tooltip box
|
|
273 |
*
|
|
274 |
* @param aRect the parent window's rect
|
|
275 |
* @return tooltip box layout data
|
|
276 |
*/
|
|
277 |
TPeninputCnTooltipBoxLayoutData ReadLafForTooltipBox( const TRect& aRect );
|
|
278 |
};
|
|
279 |
|
|
280 |
/**
|
|
281 |
* Peninput VKB data management class
|
|
282 |
* This class manager the data of VKB
|
|
283 |
*
|
|
284 |
* @lib peninputgenericvkb.lib
|
|
285 |
* @since S60 v3.2
|
|
286 |
*/
|
|
287 |
class CPeninputCnGenericVkbLafMgr : public CBase
|
|
288 |
{
|
|
289 |
|
|
290 |
public:
|
|
291 |
|
|
292 |
/**
|
|
293 |
* Two-phased constructor
|
|
294 |
*
|
|
295 |
* @since S60 v3.2
|
|
296 |
* @return The pointer to CPeninputCnGenericVkbLafMgr object
|
|
297 |
*/
|
|
298 |
static CPeninputCnGenericVkbLafMgr* NewL();
|
|
299 |
|
|
300 |
/**
|
|
301 |
* Two-phased constructor
|
|
302 |
*
|
|
303 |
* @since S60 v3.2
|
|
304 |
* @return The pointer to CPeninputCnGenericVkbLafMgr object
|
|
305 |
*/
|
|
306 |
static CPeninputCnGenericVkbLafMgr* NewLC();
|
|
307 |
|
|
308 |
/**
|
|
309 |
* Destructor
|
|
310 |
*
|
|
311 |
* @since S60 v3.2
|
|
312 |
* @return None
|
|
313 |
*/
|
|
314 |
virtual ~CPeninputCnGenericVkbLafMgr();
|
|
315 |
|
|
316 |
/**
|
|
317 |
* ConstructL
|
|
318 |
*
|
|
319 |
* @since S60 v3.2
|
|
320 |
* @return None
|
|
321 |
*/
|
|
322 |
void ConstructL();
|
|
323 |
|
|
324 |
/**
|
|
325 |
* Set layout type
|
|
326 |
*
|
|
327 |
* @since S60 v3.2
|
|
328 |
* @param aLayoutType Layout type index
|
|
329 |
* @return None
|
|
330 |
*/
|
|
331 |
void SetInputModeL( TPluginInputMode aInputMode );
|
|
332 |
|
|
333 |
/**
|
|
334 |
* Get layout type
|
|
335 |
*
|
|
336 |
* @since S60 v3.2
|
|
337 |
* @return Input mode
|
|
338 |
*/
|
|
339 |
TPluginInputMode InputMode() const;
|
|
340 |
|
|
341 |
/**
|
|
342 |
* Set layout type
|
|
343 |
*
|
|
344 |
* @since S60 v3.2
|
|
345 |
* @param aLayoutType Layout type index
|
|
346 |
* @return None
|
|
347 |
*/
|
|
348 |
void SetLayoutType( TPeninputCnQwtLayoutType aLayoutType );
|
|
349 |
|
|
350 |
/**
|
|
351 |
* Set option ( option change will cause reloading laf )
|
|
352 |
*
|
|
353 |
* @since S60 v3.2
|
|
354 |
* @param aOption option type
|
|
355 |
* @return None
|
|
356 |
*/
|
|
357 |
void SetLafOption( TPeninputCnVkbLafOption aOption );
|
|
358 |
TPeninputCnVkbLafOption OptionType() const;
|
|
359 |
|
|
360 |
/**
|
|
361 |
* Get button laf data
|
|
362 |
*
|
|
363 |
* @since S60 v3.2
|
|
364 |
* @param aButtonID button id
|
|
365 |
* @param aOutterRect button rect
|
|
366 |
* @param aInnerRect button forground rect
|
|
367 |
* @return None
|
|
368 |
*/
|
|
369 |
void GetButtonRect( TPeninputCommonCtrlID aButtonID,
|
|
370 |
TRect& aOutterRect,
|
|
371 |
TRect& aInnerRect );
|
|
372 |
|
|
373 |
/**
|
|
374 |
* Get key laf data
|
|
375 |
*
|
|
376 |
* @since S60 v3.2
|
|
377 |
* @param aColume the colume index of the key
|
|
378 |
* @param aRow the row index of the key
|
|
379 |
* @return Key rect
|
|
380 |
*/
|
|
381 |
void GetKeyRect( TInt aColume, TInt aRow, TRect& aKeyRect, TRect& aCharRect ) const;
|
|
382 |
const CFont* KeyTextFont() const;
|
|
383 |
const TRect& KeypadRect() const;
|
|
384 |
const TRect& ICFRect() const;
|
|
385 |
const CFont* ICFPromptTextFont() const;
|
|
386 |
const CFont* ICFTextFont() const;
|
|
387 |
TAknTextLineLayout KeyTextLayout() const;
|
|
388 |
void GetICFConfig( TPeninputCnICFConfig& aICFConfig );
|
|
389 |
const TRect& EntirePaneRect() const;
|
|
390 |
const TRect& RangbarRect() const;
|
|
391 |
TInt RangbarCellCount() const;
|
|
392 |
void RangbarCellAt( TInt aIndex, TRect& aOutterRect, TRect& aInnerRect );
|
|
393 |
|
|
394 |
TPeninputCnQwtLayoutType LayoutTypeFromRowsColumns(const TInt aRows, const TInt aColumns);
|
|
395 |
const TRect& TitlebarRect() const;
|
|
396 |
|
|
397 |
TBool IsValid();
|
|
398 |
const TRect& ClientRect() const;
|
|
399 |
|
|
400 |
/**
|
|
401 |
* Get gap value for cell calc
|
|
402 |
*
|
|
403 |
* @since S60 v3.2
|
|
404 |
* @return gap value
|
|
405 |
*/
|
|
406 |
static TSize GetCellSize( TPeninputCnCellType aCellType );
|
|
407 |
|
|
408 |
/**
|
|
409 |
* Get gap value for cell calc
|
|
410 |
*
|
|
411 |
* @since S60 v3.2
|
|
412 |
* @return gap value
|
|
413 |
*/
|
|
414 |
TInt CellAidGap( TPeninputCnCellType aCellType ) const;
|
|
415 |
|
|
416 |
inline void GetPreviewWndRect( TRect& aOutRect, TRect& aInnerRect ) const;
|
|
417 |
inline TAknTextLineLayout PreviewWndText() const;
|
|
418 |
inline CFont* PreviewFont() const;
|
|
419 |
inline TSize GetSpaceIconOffset() const;
|
|
420 |
inline TInt GetSpaceSideIconWidth() const;
|
|
421 |
|
|
422 |
/**
|
|
423 |
* Return layout data for candidate list
|
|
424 |
*
|
|
425 |
* @return The layout data for candidate list
|
|
426 |
*/
|
|
427 |
const TPeninputCnCandidateListLayoutData& CandidateListLayoutData() const;
|
|
428 |
|
|
429 |
/*
|
|
430 |
* Return layout data for candidate list
|
|
431 |
*
|
|
432 |
* @return The layout data for tooltip box
|
|
433 |
*/
|
|
434 |
const TPeninputCnTooltipBoxLayoutData& TooltipBoxLayoutData() const;
|
|
435 |
protected:
|
|
436 |
|
|
437 |
/**
|
|
438 |
* Set laf data base type
|
|
439 |
*
|
|
440 |
* @since S60 v3.2
|
|
441 |
* @param aLafData The exact laf data
|
|
442 |
* @return None
|
|
443 |
*/
|
|
444 |
void SetLafData( MPeninputCnLafDataBase* aLafData );
|
|
445 |
|
|
446 |
/**
|
|
447 |
* Constructor
|
|
448 |
*
|
|
449 |
* @since S60 v3.2
|
|
450 |
* @param aContext The layout context
|
|
451 |
* @return None
|
|
452 |
*/
|
|
453 |
CPeninputCnGenericVkbLafMgr();
|
|
454 |
|
|
455 |
private:
|
|
456 |
MPeninputCnLafDataCommon* iLafData;
|
|
457 |
TPluginInputMode iInputMode;
|
|
458 |
};
|
|
459 |
|
|
460 |
inline void CPeninputCnGenericVkbLafMgr::GetPreviewWndRect( TRect& aOutRect,
|
|
461 |
TRect& aInnerRect ) const
|
|
462 |
{
|
|
463 |
aOutRect = iLafData->QwtLayoutData().iPreviewWndRect;
|
|
464 |
aInnerRect = iLafData->QwtLayoutData().iPreviewWndInnerRect;
|
|
465 |
}
|
|
466 |
|
|
467 |
inline TAknTextLineLayout CPeninputCnGenericVkbLafMgr::PreviewWndText() const
|
|
468 |
{
|
|
469 |
return iLafData->QwtLayoutData().iPreviewWndText;
|
|
470 |
}
|
|
471 |
|
|
472 |
inline CFont* CPeninputCnGenericVkbLafMgr::PreviewFont() const
|
|
473 |
{
|
|
474 |
return iLafData->QwtLayoutData().iPreviewFont;
|
|
475 |
}
|
|
476 |
|
|
477 |
inline TSize CPeninputCnGenericVkbLafMgr::GetSpaceIconOffset() const
|
|
478 |
{
|
|
479 |
return iLafData->QwtLayoutData().iSpaceIconLayout.iIconOffset;
|
|
480 |
}
|
|
481 |
|
|
482 |
inline TInt CPeninputCnGenericVkbLafMgr::GetSpaceSideIconWidth() const
|
|
483 |
{
|
|
484 |
return iLafData->QwtLayoutData().iSpaceIconLayout.iSideIconWidth;
|
|
485 |
}
|
|
486 |
#endif // C_PENINPUTVKBCNLAFDATAMGR_H
|