1 /* |
|
2 * Copyright (c) 2007 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: Active Palette utilities* |
|
15 */ |
|
16 |
|
17 |
|
18 /** |
|
19 * @file ActivePalette2Utils.h |
|
20 * Active Palette utilities |
|
21 */ |
|
22 |
|
23 #ifndef _ACTIVE_PALETTE_2_UTILS_H |
|
24 #define _ACTIVE_PALETTE_2_UTILS_H |
|
25 |
|
26 // INCLUDES |
|
27 #include <e32std.h> |
|
28 #include <gdi.h> |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class CFbsBitmap; |
|
32 class CFbsBitmapDevice; |
|
33 class CBitmapContext; |
|
34 |
|
35 |
|
36 // CLASS DECLARATIONS |
|
37 |
|
38 /** |
|
39 * General utility class for Active Palette |
|
40 */ |
|
41 class ActivePalette2Utils |
|
42 { |
|
43 public: |
|
44 // Enum declarations |
|
45 // General AP dimensions |
|
46 enum TAPDimension |
|
47 { |
|
48 EItemWidth, |
|
49 EItemHeight, |
|
50 EPaletteWidth, |
|
51 ETopSectionHeight, |
|
52 EBottomSectionHeight, |
|
53 EGapBetweenItems, |
|
54 EItemXOffset, |
|
55 EFocusRingWidth, |
|
56 EFocusRingHeight, |
|
57 EFocusRingXOffset, |
|
58 EFocusRingYOffset, |
|
59 ETooltipYOffset, |
|
60 ETooltipHeight, |
|
61 ETooltipWidth, |
|
62 ETooltipBaseline, |
|
63 ETooltipTail, |
|
64 ETooltipNose, |
|
65 E3dTooltipTextYOffset, |
|
66 E3dTooltipMaxWidth, |
|
67 EGenericParam |
|
68 }; |
|
69 |
|
70 // Size AP dimensions |
|
71 enum TAPDimensionSize |
|
72 { |
|
73 EItemSize, |
|
74 E3dPaletteTextureSize, |
|
75 E3dScrollIconSize, |
|
76 E3dFocusRingSize |
|
77 }; |
|
78 |
|
79 // Point AP dimensions |
|
80 enum TAPDimensionPoint |
|
81 { |
|
82 EDefault2dPaletteOffset, |
|
83 EDefault3dPaletteOffset, |
|
84 E3dScrollIconOffset, |
|
85 E3dFocusRingOffset, |
|
86 E3dTooltipOffset |
|
87 }; |
|
88 |
|
89 public: |
|
90 /* |
|
91 * Create drawing objects |
|
92 * @param aSize Bitmap size |
|
93 * @param aBitmap Pointer in which to store created CFbsBitmap |
|
94 * @param aDevice Pointer in which to store created aDevice |
|
95 * @param aGc Pointer in which to store created aGc |
|
96 */ |
|
97 static void CreateDrawingObjectsL(const TSize aSize, |
|
98 CFbsBitmap** aBitmap, |
|
99 CFbsBitmapDevice** aDevice, |
|
100 CBitmapContext** aGc); |
|
101 |
|
102 /* |
|
103 * Create drawing objects |
|
104 * @param aDisplayMode The colour depth to use |
|
105 * @param aSize Bitmap size |
|
106 * @param aBitmap Pointer in which to store created CFbsBitmap |
|
107 * @param aDevice Pointer in which to store created aDevice |
|
108 * @param aGc Pointer in which to store created aGc |
|
109 */ |
|
110 static void CreateDrawingObjectsL(const TDisplayMode aDisplayMode, |
|
111 const TSize aSize, |
|
112 CFbsBitmap** aBitmap, |
|
113 CFbsBitmapDevice** aDevice, |
|
114 CBitmapContext** aGc); |
|
115 |
|
116 /* |
|
117 * Create drawing objects and push created items onto the cleanup stack |
|
118 * @param aSize Bitmap size |
|
119 * @param aBitmap Pointer in which to store created CFbsBitmap |
|
120 * @param aDevice Pointer in which to store created aDevice |
|
121 * @param aGc Pointer in which to store created aGc |
|
122 */ |
|
123 static void CreateDrawingObjectsLC(const TDisplayMode aDisplayMode, |
|
124 const TSize aSize, |
|
125 CFbsBitmap** aBitmap, |
|
126 CFbsBitmapDevice** aDevice, |
|
127 CBitmapContext** aGc); |
|
128 |
|
129 /* |
|
130 * Delete drawing objects |
|
131 * @param aBitmap Pointer to CFbsBitmap to delete |
|
132 * @param aDevice Pointer to aDevice to delete |
|
133 * @param aGc Pointer to aGc to delete |
|
134 */ |
|
135 static void DeleteDrawingObjects(CFbsBitmap** aBitmap, |
|
136 CFbsBitmapDevice** aDevice, |
|
137 CBitmapContext** aGc); |
|
138 |
|
139 /* |
|
140 * Return the dimension of a requested type of active palette |
|
141 * part. Dimensions scale according to device resolution. |
|
142 * @param aDimensionType a type which determines which dimension to return |
|
143 * @param aGeneric a parameter to convert any TInt to the correct size |
|
144 */ |
|
145 static TInt APDimension( TAPDimension aDimensionType, TInt aGeneric = 0 ); |
|
146 |
|
147 /* |
|
148 * Return the dimension size of a requested type of active palette |
|
149 * part. Dimensions scale according to device resolution. |
|
150 * @param aDimensionSizeType type which determines which dimension to return |
|
151 */ |
|
152 static TSize APDimensionSize( TAPDimensionSize aDimensionSize ); |
|
153 |
|
154 /* |
|
155 * Return the dimension point of a requested type of active palette |
|
156 * part. Dimensions scale according to device resolution. |
|
157 * @param aDimensionPoint type which determines which point to return |
|
158 */ |
|
159 static TPoint APDimensionPoint( TAPDimensionPoint aDimensionPoint ); |
|
160 |
|
161 |
|
162 }; |
|
163 |
|
164 #endif // _ACTIVE_PALETTE_2_UTILS_H |
|
165 |
|
166 // End of File |
|