|
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 internal configuration and constants* |
|
15 */ |
|
16 |
|
17 |
|
18 /** |
|
19 * @file ActivePalette2Cfg.h |
|
20 * Active Palette internal configuration and constants |
|
21 */ |
|
22 |
|
23 /** |
|
24 * @mainpage Active Palette 2 |
|
25 * |
|
26 * @section sec1 Introduction |
|
27 * |
|
28 * Active Palette 2 is a library that can be used to provide an icon-based menu UI component. |
|
29 * |
|
30 * <IMG src="../../SemiTrans.png"> |
|
31 * |
|
32 * This is the documentation for all the code. For just the public API, see |
|
33 * @ref sec_info. |
|
34 * |
|
35 * @section sec2 Typical Usage |
|
36 * |
|
37 * Initialization: |
|
38 * - Create the AP2 control using a ActivePalette2Factory function |
|
39 * - If a CCoeControl is created, set the container window and Mop parent |
|
40 * - Or, if a CHuiControl is created, add it to a control group |
|
41 * - Register an instance of MActivePalette2Observer to receive callbacks |
|
42 * - Install the required plugins |
|
43 * |
|
44 * Normal runtime behaviour: |
|
45 * - Manipulate the control using the MActivePalette2UI interface |
|
46 * - Respond to callbacks to the registered MActivePalette2Observer |
|
47 * |
|
48 * Cleanup: |
|
49 * - Delete the control |
|
50 * |
|
51 * @section sec_groups Classes |
|
52 * |
|
53 * The following classes comprise the public API of the Active Palette 2. |
|
54 * |
|
55 * - ActivePalette2Factory |
|
56 * - MActivePalette2UI |
|
57 * - MActivePalette2Observer |
|
58 * - TActivePalette2NavigationKeys |
|
59 * - TActivePalette2ItemVisible |
|
60 * - TActivePalette2EventData |
|
61 * |
|
62 * A generic, general-purpose plugin is provided. |
|
63 * |
|
64 * - TAP2GenericPluginParams |
|
65 * - TAP2GenericPluginIcon |
|
66 * |
|
67 * Plugin developers will use the following APIs: |
|
68 * |
|
69 * - CActivePalettePluginBase |
|
70 * - MActivePalettePluginObserver |
|
71 * - NActivePalettePluginFactory::TPluginCreationParams |
|
72 * |
|
73 * @section sec_info More Information |
|
74 * |
|
75 * More information is available in the docs/ directory of this release. |
|
76 * |
|
77 * |
|
78 */ |
|
79 |
|
80 |
|
81 #ifndef _ACTIVE_PALETTE_2_CFG_H |
|
82 #define _ACTIVE_PALETTE_2_CFG_H |
|
83 |
|
84 #include "ActivePalette2Const.h" |
|
85 #include <aknenv.h> |
|
86 |
|
87 /// For converting between milliseconds and microseconds |
|
88 const TInt KMicrosecondsPerMillisecond = 1000; |
|
89 |
|
90 /// Used in event data if Item ID is unknown |
|
91 const TInt KInvalidId = -1; |
|
92 /// Used internally for invalid Item indices |
|
93 const TInt KInvalidItemIndex = -1; |
|
94 /// Used internally for invalid screen position |
|
95 const TInt KInvalidScreenPos = -2; |
|
96 |
|
97 /// Return value from timer callbacks signalling that no future callbacks are necessary |
|
98 const TInt KCallbackFinished = 0; |
|
99 /// Return value from timer callbacks signalling that future callbacks are required |
|
100 const TInt KCallbackCallAgain = 1; |
|
101 |
|
102 /// Opacity value for "fully opaque" |
|
103 const TReal KOpacityFull = 1.0; |
|
104 /// Opacity value for "fully transparent" |
|
105 const TReal KOpacityNone = 0.0; |
|
106 |
|
107 namespace NAP2Cfg |
|
108 { |
|
109 // General AP dimensions |
|
110 /// Item icon width, in pixels |
|
111 const TInt KItemWidth = 23; |
|
112 /// Item icon height, in pixels |
|
113 const TInt KItemHeight = 23; |
|
114 /// Width of the AP |
|
115 const TInt KPaletteWidth = 33; |
|
116 /// Height of the top section |
|
117 const TInt KTopSectionHeight = 11; |
|
118 /// Height of the bottom section |
|
119 const TInt KBottomSectionHeight = 11; |
|
120 /// The height of the gap between items |
|
121 const TInt KGapBetweenItems = 4; |
|
122 /// X offset for the items |
|
123 const TInt KItemXOffset = 5; |
|
124 /// Width of the focus ring |
|
125 const TInt KFocusRingWidth = 29; |
|
126 /// Height of the focus ring |
|
127 const TInt KFocusRingHeight = 29; |
|
128 /// X offset from the focused item for the focus ring |
|
129 const TInt KFocusRingXOffset = -3; |
|
130 /// Y offset from the focused item for the focus ring |
|
131 const TInt KFocusRingYOffset = -3; |
|
132 /// Y offset from the focused item for the tooltip |
|
133 const TInt KTooltipYOffset = 2; |
|
134 /// Height of 2D tooltips |
|
135 const TInt KTooltipHeight = 17; |
|
136 /// Width of 2D tooltips |
|
137 const TInt KTooltipWidth = 16; |
|
138 /// Factor for tooltip size |
|
139 const TReal KTooltipFactor = 1.3; |
|
140 /// 2D tooltips: baseline for font |
|
141 const TInt KTooltipBaseline = 13; |
|
142 /// 2D tooltips: width of right, blank area |
|
143 const TInt KTooltipTail = 4; |
|
144 /// 2D tooltips: with of left, blank area |
|
145 const TInt KTooltipNose = 4; |
|
146 |
|
147 // 2D-specific constants |
|
148 /// 2D Tooltip colour |
|
149 const TInt KColourTooltipText = 215; // black |
|
150 |
|
151 // 3D-specific constants |
|
152 /// 3D tooltips: YOffset for text |
|
153 const TInt K3dTooltipTextYOffset = 2; |
|
154 /// 3D tooltips: max width of tooltip |
|
155 const TInt K3dTooltipMaxWidth = 320; |
|
156 |
|
157 /// Default timer tick length |
|
158 const TInt KDefaultTimerTickLength = 40 * KMicrosecondsPerMillisecond; |
|
159 |
|
160 /// Focus change tick length |
|
161 const TInt KFocusChangeTimerTickLength = KDefaultTimerTickLength; |
|
162 /// Total time for a focus change to complete, in microseconds |
|
163 const TInt KFocusChangeTotalTime = 200 * KMicrosecondsPerMillisecond; |
|
164 /// Number of frames needed for a complete focus change |
|
165 const TInt KFocusChangeFrames = KFocusChangeTotalTime / KFocusChangeTimerTickLength; |
|
166 |
|
167 /// Item scroll tick length |
|
168 const TInt KItemScrollTimerTickLength = KFocusChangeTimerTickLength; |
|
169 /// Total time for an item scroll to complete, in microseconds |
|
170 const TInt KItemScrollTotalTime = KFocusChangeTotalTime; |
|
171 /// Number of frames needed for a complete item scroll |
|
172 const TInt KItemScrollFrames = KItemScrollTotalTime / KItemScrollTimerTickLength; |
|
173 |
|
174 /// Palette appearance tick length |
|
175 const TInt KPaletteAppearTimerTickLength = 100 * KMicrosecondsPerMillisecond; |
|
176 /// Total time for a palette appearance to complete, in microseconds |
|
177 const TInt KPaletteAppearTotalTime = 400 * KMicrosecondsPerMillisecond; |
|
178 /// Number of frames needed for a complete palette appearance |
|
179 const TInt KPaletteAppearFrames = KPaletteAppearTotalTime / KPaletteAppearTimerTickLength; |
|
180 |
|
181 /// Tooltip change tick length |
|
182 const TInt KTooltipTimerTickLength = KDefaultTimerTickLength; |
|
183 const TInt KTooltipTimerTickLengthFading = 40 * KMicrosecondsPerMillisecond; |
|
184 /// Delay between an item being focused, and the tooltip being shown (in microseconds) |
|
185 const TInt KTooltipPreshowDelay = 800 * KMicrosecondsPerMillisecond; |
|
186 const TInt KTooltipPreshowDelayFading = 50 * KMicrosecondsPerMillisecond; |
|
187 /// Delay between the tooltip being fully shown, and beginning to disappear (in microseconds) |
|
188 const TInt KTooltipFullshowPeriod = 3000 * KMicrosecondsPerMillisecond; |
|
189 const TInt KTooltipFullshowPeriodFading = 800 * KMicrosecondsPerMillisecond; |
|
190 /// The speed the scrolling tooltips should move, in pixels per timer tick |
|
191 const TInt KTooltipShowSpeed = 40; |
|
192 /// Fading tooltip, shade steps in full in or out animation. |
|
193 const TInt KTooltipFadingSteps = 32; // 1..255 |
|
194 |
|
195 /// The number of frames in an item animation |
|
196 const TInt KItemAnimNoFrames = 8; |
|
197 /// The frame duration for the item animation |
|
198 const TInt KItemAnimFrameDuration = (800 * KMicrosecondsPerMillisecond) / KItemAnimNoFrames; |
|
199 |
|
200 /// Time for arrow indicators to fade in/out: 7/10 of the change animation. In milliseconds |
|
201 const TInt K3dScrollIndicatorFadeTime = (7 * KFocusChangeTotalTime) / (10 * KMicrosecondsPerMillisecond); |
|
202 |
|
203 /// Max number of items that can be shown |
|
204 const TInt KMaxNofItemsInView = 6; |
|
205 |
|
206 /// The virtual screen position above the topmost item |
|
207 const TInt KScreenPosAboveTop = -1; |
|
208 |
|
209 /// SVG background icon file |
|
210 _LIT(KUIGraphics, "z:\\resource\\apps\\activepalette2graphics.mif"); |
|
211 } |
|
212 |
|
213 /// The item's icon size |
|
214 #define KItemSize TSize(NAP2Cfg::KItemWidth, NAP2Cfg::KItemHeight) |
|
215 /// The colour of the 2D focus ring |
|
216 #define KColourFocus AKN_LAF_COLOR_STATIC(198) |
|
217 /// Colour of the whole-palette background |
|
218 #define KColourArea AKN_LAF_COLOR_STATIC(0) |
|
219 /// Colour of the palette's border |
|
220 #define KColourAreaBorder AKN_LAF_COLOR_STATIC(0) |
|
221 /// Default 2D offset |
|
222 #define KDefault2dPaletteOffset TPoint(-50, 6) |
|
223 /// Default 3D offset |
|
224 #define KDefault3dPaletteOffset TPoint(-50, 20) |
|
225 /// Default texture size for 3D palette/tooltip background |
|
226 #define K3dPaletteTextureSize TSize(32, 32) |
|
227 /// Background colour for 3D AP |
|
228 #define K3dPaletteBackgroundColour TRgb(0xFFFFFF) |
|
229 /// 3D scroll arrow bitmap size |
|
230 #define K3dScrollIconSize TSize(7, 4) |
|
231 /// 3D scroll arrow offset |
|
232 #define K3dScrollIconOffset TPoint(13, 3) |
|
233 /// 3D focus ring bitmap size |
|
234 #define K3dFocusRingSize TSize(29, 29) |
|
235 /// 3D focus ring offset |
|
236 #define K3dFocusRingOffset TPoint(-2, -2) |
|
237 /// 3D tooltip offset |
|
238 #define K3dTooltipOffset TPoint(-NAP2Cfg::KItemXOffset, 3) |
|
239 /// Colour of 2D tooltip background |
|
240 #define KColourTooltipBackground AKN_LAF_COLOR_STATIC(0) |
|
241 /// Colour of 2D tooltip border |
|
242 #define KColourTooltipBorder AKN_LAF_COLOR_STATIC(215) |
|
243 /// Colour of 2D tooltip mask transparency |
|
244 #define KColourTooltipTransparency TRgb::Gray256(215) |
|
245 |
|
246 |
|
247 #endif // _ACTIVE_PALETTE_2_CFG_H |
|
248 |
|
249 // End of File |