|
1 /* |
|
2 * Copyright (c) 2002-2008 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: Item definition base class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef AKNSSRVITEMDEF_H |
|
20 #define AKNSSRVITEMDEF_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <AknsItemID.h> |
|
24 #include <AknsPkgID.h> |
|
25 #include <AknsItemDef.h> |
|
26 |
|
27 // CLASS DECLARATIONS |
|
28 |
|
29 /** |
|
30 * Type enumeration for TAknsSrvMPPtr |
|
31 * |
|
32 * @since 2.0 |
|
33 */ |
|
34 enum TAknsSrvMPPtrType |
|
35 { |
|
36 EAknsSrvMPPtrAbsoluteROM = 4, |
|
37 EAknsSrvMPPtrAbsoluteRAM = 2, |
|
38 EAknsSrvMPPtrBaseRelativeRAM = 3 |
|
39 }; |
|
40 |
|
41 /** |
|
42 * Multipurpose pointer template. |
|
43 * |
|
44 * @since 2.0 |
|
45 */ |
|
46 template<class T> struct TAknsSrvMPPtr |
|
47 { |
|
48 /** |
|
49 * The type of the multipurpose pointer. |
|
50 */ |
|
51 TAknsSrvMPPtrType iPtrType; |
|
52 |
|
53 /** |
|
54 * The address or offset (depending on the type) of the pointer. |
|
55 */ |
|
56 T iAddressOrOffset; |
|
57 |
|
58 /** |
|
59 * Converts the value of the multipurpose pointer to the concrete address |
|
60 * using the given base address for relative values. |
|
61 * |
|
62 * @param aBase Base address, used if the type of the pointer is relative. |
|
63 * |
|
64 * @return The concrete address. |
|
65 * |
|
66 * @since 2.0 |
|
67 */ |
|
68 inline T Address( const TAny* aBase ) const |
|
69 { |
|
70 if( iPtrType == EAknsSrvMPPtrBaseRelativeRAM ) |
|
71 { |
|
72 TInt retValue = (TInt)iAddressOrOffset + (TInt)aBase; |
|
73 // Server panic constants not available, values used instead: |
|
74 __ASSERT_DEBUG( retValue%4==0, User::Panic( |
|
75 _L("AknSkinServer"), 7 ) ); |
|
76 // Offset, const qualifiers intentionally ignored |
|
77 return reinterpret_cast<T>( retValue ); |
|
78 } |
|
79 // Otherwise used as address |
|
80 return iAddressOrOffset; |
|
81 }; |
|
82 }; |
|
83 |
|
84 /** |
|
85 * Server item definition structure for typed item definitions. |
|
86 * |
|
87 * @since 2.0 |
|
88 */ |
|
89 struct TAknsSrvDef |
|
90 { |
|
91 public: |
|
92 // IID |
|
93 TAknsItemID iID; |
|
94 // Item type (determines the type of iDef). |
|
95 TAknsItemType iType; |
|
96 // Pointer to item definition. |
|
97 TAknsSrvMPPtr<const TAny*> iDef; |
|
98 //Hash next |
|
99 TInt iHashNext; |
|
100 }; |
|
101 |
|
102 /** |
|
103 * Server item definition structure for bitmaps. |
|
104 * |
|
105 * @since 2.0 |
|
106 */ |
|
107 struct TAknsSrvBitmapDef |
|
108 { |
|
109 public: |
|
110 // Bitmap filename. |
|
111 TAknsSrvMPPtr<const TText*> iFilename; |
|
112 // Index in bitmap file. |
|
113 TInt iIndex; |
|
114 |
|
115 // Image attributes. |
|
116 TInt iImageAttributes; |
|
117 // Image alignment. |
|
118 TInt iImageAlignment; |
|
119 // X-coordinate. |
|
120 TInt iImageCoordX; |
|
121 // Y-coordinate. |
|
122 TInt iImageCoordY; |
|
123 // Width of the size. |
|
124 TInt iImageSizeW; |
|
125 // Height of the size |
|
126 TInt iImageSizeH; |
|
127 }; |
|
128 |
|
129 /** |
|
130 * Server item definition structure for masked bitmaps. |
|
131 * |
|
132 * @since 2.0 |
|
133 */ |
|
134 struct TAknsSrvMaskedBitmapDef |
|
135 { |
|
136 public: |
|
137 // Bitmap filename. |
|
138 TAknsSrvMPPtr<const TText*> iFilename; |
|
139 // Index in bitmap file. |
|
140 TInt iIndex; |
|
141 // Index of mask in bitmap file. |
|
142 TInt iMaskIndex; |
|
143 |
|
144 // Image attributes. |
|
145 TInt iImageAttributes; |
|
146 // Image alignment. |
|
147 TInt iImageAlignment; |
|
148 // X-coordinate. |
|
149 TInt iImageCoordX; |
|
150 // Y-coordinate. |
|
151 TInt iImageCoordY; |
|
152 // Width of the size. |
|
153 TInt iImageSizeW; |
|
154 // Height of the size |
|
155 TInt iImageSizeH; |
|
156 }; |
|
157 |
|
158 /** |
|
159 * Server item definition structure for color tables. |
|
160 * |
|
161 * @since 2.0 |
|
162 */ |
|
163 struct TAknsSrvColorTableDef |
|
164 { |
|
165 public: |
|
166 // Number of colors |
|
167 TInt iNumberOfColors; |
|
168 // Color array |
|
169 TAknsSrvMPPtr<const TAknsColorTableEntry*> iColors; |
|
170 |
|
171 // Image attributes. |
|
172 TInt iImageAttributes; |
|
173 // Image alignment. |
|
174 TInt iImageAlignment; |
|
175 // X-coordinate. |
|
176 TInt iImageCoordX; |
|
177 // Y-coordinate. |
|
178 TInt iImageCoordY; |
|
179 // Width of the size. |
|
180 TInt iImageSizeW; |
|
181 // Height of the size |
|
182 TInt iImageSizeH; |
|
183 }; |
|
184 |
|
185 /** |
|
186 * Server item definition structure for image tables. |
|
187 * |
|
188 * @since 2.0 |
|
189 */ |
|
190 struct TAknsSrvImageTableDef |
|
191 { |
|
192 public: |
|
193 // Number of images |
|
194 TInt iNumberOfImages; |
|
195 // Image information array |
|
196 TAknsSrvMPPtr<const TAknsItemID*> iImages; |
|
197 |
|
198 // Image attributes. |
|
199 TInt iImageAttributes; |
|
200 // Image alignment. |
|
201 TInt iImageAlignment; |
|
202 // X-coordinate. |
|
203 TInt iImageCoordX; |
|
204 // Y-coordinate. |
|
205 TInt iImageCoordY; |
|
206 // Width of the size. |
|
207 TInt iImageSizeW; |
|
208 // Height of the size |
|
209 TInt iImageSizeH; |
|
210 }; |
|
211 |
|
212 /** |
|
213 * Server item definition structure for bitmap animations. |
|
214 * |
|
215 * @since 2.0 |
|
216 */ |
|
217 struct TAknsSrvBmpAnimDef |
|
218 { |
|
219 public: |
|
220 // Number of images |
|
221 TInt iNumberOfImages; |
|
222 // Image information array |
|
223 TAknsSrvMPPtr<const TAknsItemID*> iImages; |
|
224 // Frame property array |
|
225 TAknsSrvMPPtr<const TAknsBmpAnimFrameInfo*> iFrameInfos; |
|
226 // Frame interval |
|
227 TInt16 iFrameInterval; |
|
228 // Play mode |
|
229 TInt16 iPlayMode; |
|
230 // Flash flag |
|
231 TBool iFlash; |
|
232 // Last frame background flag |
|
233 TBool iLastFrameBackground; |
|
234 |
|
235 // Image attributes. |
|
236 TInt iImageAttributes; |
|
237 // Image alignment. |
|
238 TInt iImageAlignment; |
|
239 // X-coordinate. |
|
240 TInt iImageCoordX; |
|
241 // Y-coordinate. |
|
242 TInt iImageCoordY; |
|
243 // Width of the size. |
|
244 TInt iImageSizeW; |
|
245 // Height of the size |
|
246 TInt iImageSizeH; |
|
247 }; |
|
248 |
|
249 /** |
|
250 * Server item definition structure for strings. |
|
251 * |
|
252 * @since 2.6 |
|
253 */ |
|
254 struct TAknsSrvStringDef |
|
255 { |
|
256 public: |
|
257 // String value. |
|
258 TAknsSrvMPPtr<const TText*> iString; |
|
259 }; |
|
260 |
|
261 /** |
|
262 * |
|
263 * |
|
264 * @since 2.8 |
|
265 */ |
|
266 struct TAknsSrvEffectParameterDef |
|
267 { |
|
268 public: |
|
269 TUint32 iParameterLength; |
|
270 TUint32 iParameterType; |
|
271 // parameter data after this |
|
272 }; |
|
273 |
|
274 /** |
|
275 * Note that since 3.0 this structure is also used for AnimationCommands. |
|
276 * |
|
277 * @since 2.8 |
|
278 */ |
|
279 struct TAknsSrvEffectDef |
|
280 { |
|
281 public: |
|
282 TUid iEffectUid; |
|
283 TUint32 iInputLayerAIndex; |
|
284 TUint32 iInputLayerAMode; |
|
285 TUint32 iInputLayerBIndex; |
|
286 TUint32 iInputLayerBMode; |
|
287 TUint32 iOutputLayerIndex; |
|
288 TUint32 iOutputLayerMode; |
|
289 TUint32 iEffectParameterCount; |
|
290 TUint32 iEffectSize; |
|
291 // parameter data after this... |
|
292 }; |
|
293 |
|
294 /** |
|
295 * |
|
296 * |
|
297 * @since 2.8 |
|
298 */ |
|
299 struct TAknsSrvEffectQueueDef |
|
300 { |
|
301 public: |
|
302 TUint32 iEffectQueueSize; |
|
303 TUint32 iInputLayerIndex; |
|
304 TUint32 iInputLayerMode; |
|
305 TUint32 iOutputLayerIndex; |
|
306 TUint32 iOutputLayerMode; |
|
307 TUint32 iEffectCount; |
|
308 TUint32 iRefMajor; |
|
309 TUint32 iRefMinor; |
|
310 // effect data after this |
|
311 }; |
|
312 |
|
313 /** |
|
314 * @since 3.0 |
|
315 */ |
|
316 struct TAknsSrvEffectAnimDef |
|
317 { |
|
318 public: |
|
319 TUint32 iEffectAnimSize; |
|
320 TUint32 iInputLayerIndex; |
|
321 TUint32 iInputLayerMode; |
|
322 TUint32 iOutputLayerIndex; |
|
323 TUint32 iOutputLayerMode; |
|
324 TUint32 iMinInterval; |
|
325 TUint32 iAnimType; |
|
326 TUint32 iPreprocessCount; |
|
327 TUint32 iAnimCommandCount; |
|
328 TUint32 iAnimValueCount; |
|
329 TUint32 iTimingModelCount; |
|
330 TUint32 iSizeBoundCount; |
|
331 }; |
|
332 |
|
333 /** |
|
334 * @since 3.0 |
|
335 */ |
|
336 struct TAknsSrvParamGroupDef |
|
337 { |
|
338 public: |
|
339 TUint32 iGroupSize; |
|
340 TUint32 iParameterCount; |
|
341 TUint32 iValueA; |
|
342 TUint32 iValueB; |
|
343 // parameter data after this... |
|
344 }; |
|
345 |
|
346 /** |
|
347 * |
|
348 * |
|
349 * @since 2.8 |
|
350 */ |
|
351 struct TAknsSrvScalableItemDef |
|
352 { |
|
353 public: |
|
354 TAknsItemID iID; |
|
355 TUint32 iBitmapHandle; |
|
356 TUint32 iMaskHandle; |
|
357 TInt iLayoutType; |
|
358 TBool isMorphing; |
|
359 TTime iTimeStamp; |
|
360 TSize iLayoutSize; |
|
361 }; |
|
362 |
|
363 /** |
|
364 * Server definition structure for item definition set classes. |
|
365 * |
|
366 * @since 2.0 |
|
367 */ |
|
368 struct TAknsSrvClassDef |
|
369 { |
|
370 public: |
|
371 // Definition table (may be NULL if zero definitions) |
|
372 const TAknsSrvDef* iDefTable; |
|
373 // Number of definitions |
|
374 TInt iNumberOfDefs; |
|
375 }; |
|
376 |
|
377 /** |
|
378 * Server definition structure for whole skins. |
|
379 * |
|
380 * @since 2.0 |
|
381 */ |
|
382 struct TAknsSrvSkinDef |
|
383 { |
|
384 public: |
|
385 // Skin package ID |
|
386 TAknsPkgID iPID; |
|
387 // Bitmap class |
|
388 const TAknsSrvClassDef* iBitmapClass; |
|
389 // Application icon class |
|
390 const TAknsSrvClassDef* iAppIconClass; |
|
391 // Color set class |
|
392 const TAknsSrvClassDef* iColorSetClass; |
|
393 // Color set skin package ID (if iColorSetClass is NULL) |
|
394 TAknsPkgID iColorSetPID; |
|
395 // Language override skin package ID |
|
396 TAknsPkgID iLanguageOverridePID; |
|
397 }; |
|
398 |
|
399 #endif // AKNSSRVITEMDEF_H |
|
400 |
|
401 // End of File |