|
1 /* |
|
2 * Copyright (c) 2002 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: Defines public item data classes. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef AKNSITEMDATA_H |
|
20 #define AKNSITEMDATA_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <AknsItemID.h> |
|
24 #include <AknsRlEffect.h> |
|
25 #include <gdi.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CFbsBitmap; |
|
29 struct TAknsAppIconInfo; |
|
30 struct TAknsImageAttributeData; |
|
31 struct TAknsColorTableEntry; |
|
32 struct TAknsBmpAnimFrameInfo; |
|
33 class CAknsEffectParameter; |
|
34 class MAknsRlCommandIterator; |
|
35 class MAknsAlIterator; |
|
36 class CAknsNamedReference; |
|
37 class CAknsSizeBoundParameter; |
|
38 struct TAknsAlAnimationCommandData; |
|
39 struct TAknsAlTimingModelData; |
|
40 struct TAknsAlAnimationValueData; |
|
41 struct TAknsAlNamedReferenceData; |
|
42 struct TAknsAlSizeBoundParameterData; |
|
43 |
|
44 // CLASS DECLARATIONS |
|
45 |
|
46 /** |
|
47 * Base class for item data classes. |
|
48 * Item data encapsulates type information and resource instance (such as |
|
49 * CFbsBitmap object) of a specific skin item. Since actual data entries vary |
|
50 * depending on the type of the item, CAknsItemData contains only type |
|
51 * information and can not be instantiated. |
|
52 * |
|
53 * This is a public class with exported functions. |
|
54 * The class is not intended for derivation outside the library. |
|
55 * |
|
56 * @lib AknSkins.lib |
|
57 * |
|
58 * @since 2.0 |
|
59 */ |
|
60 NONSHARABLE_CLASS(CAknsItemData) : public CBase |
|
61 { |
|
62 public: // Constructors and destructor |
|
63 |
|
64 /** |
|
65 * Destructor. |
|
66 * CAknsItemData itself has no dynamically allocated members, but |
|
67 * derived classes may have them. |
|
68 */ |
|
69 virtual ~CAknsItemData(); |
|
70 |
|
71 public: // New functions |
|
72 |
|
73 /** |
|
74 * Sets the perceived type of this item without affecting the |
|
75 * real instance inheritance. |
|
76 * |
|
77 * @since 2.8 |
|
78 * |
|
79 * @internal |
|
80 * |
|
81 * @param aType New type. |
|
82 */ |
|
83 void SetType( const TAknsItemType aType ); |
|
84 |
|
85 /** |
|
86 * Returns the type of the item data object. |
|
87 * This method can be used to provide run-time type information. |
|
88 * Corresponding classes are listed in definition of ::TAknsItemType. |
|
89 * |
|
90 * @since 2.0 |
|
91 * |
|
92 * @return Type of the item data as TAknsItemType. |
|
93 */ |
|
94 IMPORT_C TAknsItemType Type() const; |
|
95 |
|
96 protected: // C++ protected constructor for derived classes |
|
97 |
|
98 /** |
|
99 * C++ constructor for derived classes. |
|
100 * Constructs item data object with given item type. |
|
101 * |
|
102 * @param aType Item type of the new item data object. |
|
103 * |
|
104 * @internal |
|
105 */ |
|
106 CAknsItemData( const TAknsItemType aType ); |
|
107 |
|
108 protected: // Data |
|
109 |
|
110 TAknsItemType iType; //!< Type of the item data object. |
|
111 |
|
112 }; |
|
113 |
|
114 /** |
|
115 * Image item data. |
|
116 * Image item data contains (in addition to base class members) image |
|
117 * attributes, such as size or alignment. Item type for image item data |
|
118 * objects is ::EAknsITImage. |
|
119 * |
|
120 * This is a public class with exported functions. |
|
121 * The class is not intended for derivation outside the library. |
|
122 * |
|
123 * @lib AknSkins.lib |
|
124 * |
|
125 * @since 2.0 |
|
126 */ |
|
127 NONSHARABLE_CLASS(CAknsImageItemData) : public CAknsItemData |
|
128 { |
|
129 public: // Constructors and destructor |
|
130 |
|
131 /** |
|
132 * Destructor. |
|
133 */ |
|
134 virtual ~CAknsImageItemData(); |
|
135 |
|
136 public: // New functions |
|
137 |
|
138 /** |
|
139 * Sets the image attributes for this image item data object. |
|
140 * |
|
141 * @since 2.0 |
|
142 * |
|
143 * @param aAttributes Attribute data structure containing the new |
|
144 * values. |
|
145 */ |
|
146 IMPORT_C void SetAttributesL( |
|
147 const TAknsImageAttributeData& aAttributes ); |
|
148 |
|
149 /** |
|
150 * Returns a pointer to the image attribute structure owned by the |
|
151 * item data object. |
|
152 * |
|
153 * @since 2.0 |
|
154 * |
|
155 * @return Pointer to the image attribute structure, or @c NULL if |
|
156 * there is none. |
|
157 */ |
|
158 IMPORT_C const TAknsImageAttributeData* Attributes() const; |
|
159 |
|
160 IMPORT_C void SetParentIID(const TAknsItemID& aIID); |
|
161 IMPORT_C void SetDrawRect(const TRect& aRect); |
|
162 IMPORT_C TAknsItemID ParentIID(); |
|
163 IMPORT_C TRect DrawRect(); |
|
164 |
|
165 |
|
166 protected: // C++ protected constructor for derived classes |
|
167 |
|
168 /** |
|
169 * C++ constructor for derived classes. |
|
170 * Constructs an image item data object with given item type. |
|
171 * |
|
172 * @param aType Item type of the new item data object. |
|
173 * |
|
174 * @internal |
|
175 */ |
|
176 CAknsImageItemData( const TAknsItemType aType ); |
|
177 |
|
178 protected: // Data |
|
179 |
|
180 TAknsImageAttributeData* iAttributeData; |
|
181 TAknsItemID iParentIID; |
|
182 TRect iDrawRect; |
|
183 |
|
184 |
|
185 }; |
|
186 |
|
187 /** |
|
188 * Bitmap item data. |
|
189 * Bitmap item data contains (in addition to base class members) CFbsBitmap |
|
190 * instance of the bitmap. Item type for bitmap item data is always |
|
191 * ::EAknsITBitmap. |
|
192 * |
|
193 * This is a public class with exported functions. |
|
194 * The class is not intended for derivation outside the library. |
|
195 * |
|
196 * @lib AknSkins.lib |
|
197 * |
|
198 * @since 2.0 |
|
199 */ |
|
200 NONSHARABLE_CLASS(CAknsBitmapItemData) : public CAknsImageItemData |
|
201 { |
|
202 public: // Constructors and destructor |
|
203 |
|
204 /** |
|
205 * Two-phased constructor. |
|
206 * Constructs a new CAknsBitmapItemData object with bitmap set to |
|
207 * @c NULL. Bitmap must be set afterwards by using |
|
208 * SetBitmap(CFbsBitmap* aBitmap) method. |
|
209 * |
|
210 * @return Newly constructed CAknsBitmapItemData object. |
|
211 * |
|
212 * @par Exceptions: |
|
213 * If allocation fails, function leaves with a system-wide error |
|
214 * code. |
|
215 */ |
|
216 IMPORT_C static CAknsBitmapItemData* NewL(); |
|
217 |
|
218 /** |
|
219 * Destructor. |
|
220 * Deletes bitmap object, if present. |
|
221 */ |
|
222 virtual ~CAknsBitmapItemData(); |
|
223 |
|
224 public: // New functions |
|
225 |
|
226 /** |
|
227 * Sets the bitmap object for this item data instance. |
|
228 * |
|
229 * @since 2.0 |
|
230 * |
|
231 * @c NULL value can be used to detach bitmap from item data. |
|
232 * |
|
233 * @param aBitmap Pointer to bitmap instance. Ownership of the bitmap |
|
234 * object is transferred to item data. @c NULL value is also valid. |
|
235 */ |
|
236 IMPORT_C void SetBitmap( CFbsBitmap* aBitmap ); |
|
237 |
|
238 /** |
|
239 * Sets the bitmap object for this item data instance and destroys |
|
240 * previous one, if any. |
|
241 * |
|
242 * @since 2.0 |
|
243 * |
|
244 * @param aBitmap Pointer to bitmap instance. Ownership of the bitmap |
|
245 * object is transferred to item data. @c NULL value is also valid. |
|
246 */ |
|
247 IMPORT_C void DestroyAndSetBitmap( CFbsBitmap* aBitmap ); |
|
248 |
|
249 /** |
|
250 * Returns the current bitmap object owned by item data instance. |
|
251 * |
|
252 * @since 2.0 |
|
253 * |
|
254 * @return Pointer to bitmap instance, or @c NULL if none is currently |
|
255 * associated with this item data. |
|
256 */ |
|
257 IMPORT_C CFbsBitmap* Bitmap(); |
|
258 |
|
259 protected: // C++ protected constructor |
|
260 |
|
261 /** |
|
262 * C++ protected constructor. |
|
263 * Constructs a new CAknsBitmapItemData with bitmap set to @c NULL. |
|
264 * |
|
265 * @param aType Item type of the new item data object. While this |
|
266 * is always ::EAknsITBitmap for instances of this class, derived |
|
267 * classes may specify another value. |
|
268 * |
|
269 * @internal |
|
270 */ |
|
271 CAknsBitmapItemData( const TAknsItemType aType ); |
|
272 |
|
273 protected: // Data |
|
274 CFbsBitmap* iBitmap; //!< Pointer to associated bitmap instance. |
|
275 |
|
276 }; |
|
277 |
|
278 /** |
|
279 * Masked bitmap item data. |
|
280 * Masked bitmap item data contains (in addition to base class members) an |
|
281 * additional member of type CFbsBitmap for the bitmap mask. |
|
282 * Item type for bitmap item data is always ::EAknsITMaskedBitmap. |
|
283 * |
|
284 * This is a public class with exported functions. |
|
285 * The class is not intended for derivation outside the library. |
|
286 * |
|
287 * @lib AknSkins.lib |
|
288 * |
|
289 * @since 2.0 |
|
290 */ |
|
291 NONSHARABLE_CLASS(CAknsMaskedBitmapItemData) : public CAknsBitmapItemData |
|
292 { |
|
293 public: // Constructors and destructor |
|
294 |
|
295 /** |
|
296 * Two-phased constructor. |
|
297 * Constructs a new CAknsMaskedBitmapItemData object with bitmaps set to |
|
298 * @c NULL. Bitmaps must be set afterwards by using |
|
299 * SetBitmap(CFbsBitmap* aBitmap) and SetMask(CFbsBitmap* aBitmap) methods. |
|
300 * |
|
301 * @return Newly constructed CAknsMaskedBitmapItemData object. |
|
302 * |
|
303 * @par Exceptions: |
|
304 * If allocation fails, function leaves with a system-wide error |
|
305 * code. |
|
306 */ |
|
307 IMPORT_C static CAknsMaskedBitmapItemData* NewL(); |
|
308 |
|
309 /** |
|
310 * Destructor. |
|
311 * Deletes bitmap objects, if present. |
|
312 */ |
|
313 virtual ~CAknsMaskedBitmapItemData(); |
|
314 |
|
315 public: // New functions |
|
316 |
|
317 /** |
|
318 * Sets the mask bitmap object for this item data instance. |
|
319 * @c NULL value can be used to detach bitmap mask from item data. |
|
320 * |
|
321 * @since 2.0 |
|
322 * |
|
323 * @param aMask Pointer to mask instance. Ownership of the bitmap |
|
324 * object is transferred to item data. @c NULL value is also valid. |
|
325 */ |
|
326 IMPORT_C void SetMask( CFbsBitmap* aMask ); |
|
327 |
|
328 /** |
|
329 * Sets the mask bitmap object for this item data instance and destroys |
|
330 * previous one, if any. |
|
331 * |
|
332 * @since 2.0 |
|
333 * |
|
334 * @param aMask Pointer to mask instance. Ownership of the bitmap |
|
335 * object is transferred to item data. @c NULL value is also valid. |
|
336 */ |
|
337 IMPORT_C void DestroyAndSetMask( CFbsBitmap* aMask ); |
|
338 |
|
339 /** |
|
340 * Returns the current bitmap mask object owned by item data instance. |
|
341 * |
|
342 * @since 2.0 |
|
343 * |
|
344 * @return Pointer to mask instance, or @c NULL if none is currently |
|
345 * associated with this item data. |
|
346 */ |
|
347 IMPORT_C CFbsBitmap* Mask(); |
|
348 |
|
349 protected: // C++ protected constructor |
|
350 |
|
351 /** |
|
352 * C++ protected constructor. |
|
353 * Constructs a new CAknsMaskedBitmapItemData with bitmaps set to @c NULL. |
|
354 * |
|
355 * @param aType Item type of the new item data object. While this |
|
356 * is always ::EAknsITMaskedBitmap for instances of this class, derived |
|
357 * classes may specify another value. |
|
358 * |
|
359 * @internal |
|
360 */ |
|
361 CAknsMaskedBitmapItemData( const TAknsItemType aType ); |
|
362 |
|
363 protected: // Data |
|
364 CFbsBitmap* iMask; //!< Pointer to associated mask bitmap instance. |
|
365 |
|
366 }; |
|
367 |
|
368 /** |
|
369 * Color table item data. |
|
370 * Color table item data contains (in addition to base class members) color |
|
371 * array of TRGB values. Item type for color item data is always |
|
372 * ::EAknsITColorTable. |
|
373 * |
|
374 * This is a public class with exported functions. |
|
375 * The class is not intended for derivation outside the library. |
|
376 * |
|
377 * @lib AknSkins.lib |
|
378 * |
|
379 * @since 2.0 |
|
380 */ |
|
381 NONSHARABLE_CLASS(CAknsColorTableItemData) : public CAknsImageItemData |
|
382 { |
|
383 public: // Constructors and destructor |
|
384 |
|
385 /** |
|
386 * Two-phased constructor. |
|
387 * Constructs a new CAknsColorTableItemData object. Values must |
|
388 * be set separately using SetColorsL. |
|
389 * |
|
390 * @return Newly constructed CAknsColorTableItemData object. |
|
391 * |
|
392 * @par Exceptions: |
|
393 * If allocation fails, function leaves with a system-wide error |
|
394 * code. |
|
395 */ |
|
396 IMPORT_C static CAknsColorTableItemData* NewL(); |
|
397 |
|
398 /** |
|
399 * Destructor. |
|
400 * Destroys color value array. |
|
401 */ |
|
402 virtual ~CAknsColorTableItemData(); |
|
403 |
|
404 public: // New functions |
|
405 |
|
406 /** |
|
407 * Sets color values for this item data instance. |
|
408 * |
|
409 * @since 2.0 |
|
410 * |
|
411 * @param aNumberOfColors Number of colors in aColors. |
|
412 * |
|
413 * @param aColors Pointer to first color value. Values are copied |
|
414 * into an internal array. |
|
415 */ |
|
416 IMPORT_C void SetColorsL( const TInt aNumberOfColors, |
|
417 const TAknsColorTableEntry* aColors ); |
|
418 |
|
419 /** |
|
420 * Returns the indexed color value. |
|
421 * |
|
422 * @since 2.0 |
|
423 * |
|
424 * @param aIndex Index of the color to be retrieved. This must |
|
425 * be within 0 (inclusive) and aNumberOfColors (exclusive). |
|
426 * |
|
427 * @return Color value as TInt. If the value is -1, RGB value |
|
428 * should be queried instead. |
|
429 * |
|
430 * @par Note: |
|
431 * This method does not perform any bounds checking. An access |
|
432 * violation or panic will occur, if the given index is not |
|
433 * within the bounds of the internal array. Use @c GetColorL |
|
434 * instead, if such checking is required. |
|
435 */ |
|
436 IMPORT_C TInt ColorIndexed( const TInt aIndex ) const; |
|
437 |
|
438 /** |
|
439 * Returns the RGB color value. |
|
440 * |
|
441 * @since 2.0 |
|
442 * |
|
443 * @param aIndex Index of the color to be retrieved. This must |
|
444 * be within 0 (inclusive) and aNumberOfColors (exclusive). |
|
445 * |
|
446 * @return Color value as TRgb. Note that the value is only |
|
447 * valid if ColorIndexed() returned -1. |
|
448 * |
|
449 * @par Note: |
|
450 * This method does not perform any bounds checking. An access |
|
451 * violation or panic will occur, if the given index is not |
|
452 * within the bounds of the internal array. Use @c GetColorL |
|
453 * instead, if such checking is required. |
|
454 */ |
|
455 IMPORT_C TRgb ColorRgb( const TInt aIndex ) const; |
|
456 |
|
457 /** |
|
458 * Retrieves a color value (indexed or RGB) with bounds checking. |
|
459 * |
|
460 * @since 2.6 |
|
461 * |
|
462 * @param aIndex Index of the color to be retrieved. |
|
463 * |
|
464 * @param aColor On return, contains the color as an RGB value. |
|
465 * If the color is indexed, the appropriate mapping using current |
|
466 * palette is used. |
|
467 * |
|
468 * @par Exceptions: |
|
469 * If the given index is outside the bounds of the array, |
|
470 * the method leaves with an error code. |
|
471 */ |
|
472 IMPORT_C void GetColorL( const TInt aIndex, TRgb& aColor ) const; |
|
473 |
|
474 protected: // C++ protected constructor |
|
475 |
|
476 /** |
|
477 * C++ protected constructor. |
|
478 * Constructs a new CAknsColorItemData without an array. |
|
479 * |
|
480 * @param aType Item type of the new item data object. While this |
|
481 * is always ::EAknsITColorTable for instances of this class, derived |
|
482 * classes may specify another value. |
|
483 * |
|
484 * @internal |
|
485 */ |
|
486 CAknsColorTableItemData( const TAknsItemType aType ); |
|
487 |
|
488 protected: // Data |
|
489 |
|
490 TAknsColorTableEntry* iColorArray; //!< Color array. |
|
491 TInt iColorArraySize; |
|
492 |
|
493 }; |
|
494 |
|
495 /** |
|
496 * Icon table item data. |
|
497 * Icon table item data contains (in addition to base class members), an |
|
498 * array containing item IDs of images. Item type for |
|
499 * image table item data objects is always ::EAknsITImageTable. |
|
500 * |
|
501 * This is a public class with exported functions. |
|
502 * The class is not intended for derivation outside the library. |
|
503 * |
|
504 * @lib AknSkins.lib |
|
505 * |
|
506 * @since 2.0 |
|
507 */ |
|
508 NONSHARABLE_CLASS(CAknsImageTableItemData) : public CAknsImageItemData |
|
509 { |
|
510 public: // Constructors and destructor |
|
511 |
|
512 /** |
|
513 * Two-phased constructor. |
|
514 * Constructs a new CAknsImageTableItemData object. Values must |
|
515 * be set separately using SetImagesL. |
|
516 * |
|
517 * @return Newly constructed CAknsImageTableItemData object. |
|
518 * |
|
519 * @par Exceptions: |
|
520 * If allocation fails, function leaves with a system-wide error |
|
521 * code. |
|
522 */ |
|
523 IMPORT_C static CAknsImageTableItemData* NewL(); |
|
524 |
|
525 /** |
|
526 * Destructor. |
|
527 * Destroys image array. |
|
528 */ |
|
529 virtual ~CAknsImageTableItemData(); |
|
530 |
|
531 public: // New functions |
|
532 |
|
533 /** |
|
534 * Sets image table values for this item data instance. |
|
535 * |
|
536 * @since 2.0 |
|
537 * |
|
538 * @param aNumberOfImages Number of images in aImages. |
|
539 * |
|
540 * @param aImages Pointer to first image ID. Values are |
|
541 * copied into an internal array. |
|
542 */ |
|
543 IMPORT_C void SetImagesL( const TInt aNumberOfImages, |
|
544 const TAknsItemID* aImages ); |
|
545 |
|
546 /** |
|
547 * Returns the item ID of an image. |
|
548 * |
|
549 * @since 2.0 |
|
550 * |
|
551 * @param aIndex Index of the image. This value must |
|
552 * be within 0 (inclusive) and NumberOfImages (exclusive). |
|
553 * |
|
554 * @return Item ID of the image. |
|
555 */ |
|
556 IMPORT_C TAknsItemID ImageIID( const TInt aIndex ) const; |
|
557 |
|
558 /** |
|
559 * Returns pointer to the first entry in the image array, |
|
560 * owned by this object. |
|
561 * |
|
562 * @since 2.0 |
|
563 * |
|
564 * @return Pointer to TAknsItemID. |
|
565 */ |
|
566 IMPORT_C TAknsItemID* Images() const; |
|
567 |
|
568 /** |
|
569 * Returns the number of images. |
|
570 * |
|
571 * @since 2.0 |
|
572 * |
|
573 * @return Number of images as an integer. |
|
574 */ |
|
575 IMPORT_C TInt NumberOfImages() const; |
|
576 |
|
577 protected: // C++ protected constructor |
|
578 |
|
579 /** |
|
580 * C++ protected constructor. |
|
581 * Constructs a new CAknsImageTableItemData without an array. |
|
582 * |
|
583 * @param aType Item type of the new item data object. While this |
|
584 * is always ::EAknsITImageTable for instances of this class, derived |
|
585 * classes may specify another value. |
|
586 * |
|
587 * @internal |
|
588 */ |
|
589 CAknsImageTableItemData( const TAknsItemType aType ); |
|
590 |
|
591 protected: // Data |
|
592 |
|
593 TInt iNumberOfImages; //!< Number of images. |
|
594 TAknsItemID* iImageArray; //!< Image array. |
|
595 |
|
596 }; |
|
597 |
|
598 /** |
|
599 * Bitmap animation item data. |
|
600 * Bitmap animation item data contains (in addition to base class members), |
|
601 * animation properties as well as an array containing frame properties |
|
602 * Item type for bitmap animation item data objects is always ::EAknsITBmpAnim. |
|
603 * |
|
604 * This is a public class with exported functions. |
|
605 * The class is not intended for derivation outside the library. |
|
606 * |
|
607 * @lib AknSkins.lib |
|
608 * |
|
609 * @since 2.0 |
|
610 */ |
|
611 NONSHARABLE_CLASS(CAknsBmpAnimItemData) : public CAknsImageTableItemData |
|
612 { |
|
613 public: // Constructors and destructor |
|
614 |
|
615 /** |
|
616 * Two-phased constructor. |
|
617 * Constructs a new CAknsBmpAnimItemData object. Values must |
|
618 * be set separately using SetImagesL and SetFrameInfosL. |
|
619 * |
|
620 * @return Newly constructed CAknsBmpAnimItemData object. |
|
621 * |
|
622 * @par Exceptions: |
|
623 * If allocation fails, function leaves with a system-wide error |
|
624 * code. |
|
625 */ |
|
626 IMPORT_C static CAknsBmpAnimItemData* NewL(); |
|
627 |
|
628 /** |
|
629 * Destructor. |
|
630 * Destroys arrays. |
|
631 */ |
|
632 virtual ~CAknsBmpAnimItemData(); |
|
633 |
|
634 public: // New functions |
|
635 |
|
636 /** |
|
637 * Sets frame property values for this item data instance. |
|
638 * |
|
639 * The number of entries in the given array must match |
|
640 * the number of images in the image table. Therefore |
|
641 * SetFrameInfosL must be called only after SetImagesL |
|
642 * has already been called. |
|
643 * |
|
644 * @since 2.0 |
|
645 * |
|
646 * @param aFrameInfos Pointer to first frame info. Values are |
|
647 * copied into an internal array. |
|
648 */ |
|
649 IMPORT_C void SetFrameInfosL( const TAknsBmpAnimFrameInfo* aFrameInfos ); |
|
650 |
|
651 /** |
|
652 * Returns pointer to the first entry in the frame property array, |
|
653 * owned by this object. |
|
654 * |
|
655 * @since 2.0 |
|
656 * |
|
657 * @return Pointer to TAknsBmpAnimFrameInfo. |
|
658 */ |
|
659 IMPORT_C TAknsBmpAnimFrameInfo* FrameInfos() const; |
|
660 |
|
661 /** |
|
662 * Sets the flag indicating whether the last frame should be |
|
663 * interpreted as the background (i.e. excluded from the animation |
|
664 * itself). |
|
665 * |
|
666 * @since 2.0 |
|
667 * |
|
668 * @param aLastFrameBg Boolean value. |
|
669 */ |
|
670 IMPORT_C void SetLastFrameBackground( TBool aLastFrameBg ); |
|
671 |
|
672 /** |
|
673 * Retrieves the flag value indicating whether the last frame |
|
674 * should be interpreted as the background. |
|
675 * |
|
676 * @since 2.0 |
|
677 * |
|
678 * @return Boolean value. |
|
679 */ |
|
680 IMPORT_C TBool LastFrameBackground() const; |
|
681 |
|
682 /** |
|
683 * Sets the frame interval for the entire animation. |
|
684 * |
|
685 * @since 2.0 |
|
686 * |
|
687 * @param aFrameInterval Frame interval in milliseconds or -1. |
|
688 */ |
|
689 IMPORT_C void SetFrameInterval( const TInt16 aFrameInterval ); |
|
690 |
|
691 /** |
|
692 * Retrieves the frame interval. |
|
693 * |
|
694 * @since 2.0 |
|
695 * |
|
696 * @return Frame interval in milliseconds or -1. |
|
697 */ |
|
698 IMPORT_C TInt16 FrameInterval() const; |
|
699 |
|
700 /** |
|
701 * Sets the play mode for the entire animation. |
|
702 * |
|
703 * @since 2.0 |
|
704 * |
|
705 * @param aPlayMode Play mode. |
|
706 */ |
|
707 IMPORT_C void SetPlayMode( const TInt16 aPlayMode ); |
|
708 |
|
709 /** |
|
710 * Retrieves the play mode. |
|
711 * |
|
712 * @since 2.0 |
|
713 * |
|
714 * @return Play mode. |
|
715 */ |
|
716 IMPORT_C TInt16 PlayMode() const; |
|
717 |
|
718 /** |
|
719 * Sets the flash property for the entire animation. |
|
720 * |
|
721 * @since 2.0 |
|
722 * |
|
723 * @param aFlash Flash flag value. |
|
724 */ |
|
725 IMPORT_C void SetFlash( const TBool aFlash ); |
|
726 |
|
727 /** |
|
728 * Retrieves the flash property. |
|
729 * |
|
730 * @since 2.0 |
|
731 * |
|
732 * @return Flash flag value. |
|
733 */ |
|
734 IMPORT_C TBool Flash() const; |
|
735 |
|
736 protected: // C++ protected constructor |
|
737 |
|
738 /** |
|
739 * C++ protected constructor. |
|
740 * Constructs a new CAknsBmpAnimItemData without an array. |
|
741 * |
|
742 * @param aType Item type of the new item data object. While this |
|
743 * is always ::EAknsITBmpAnim for instances of this class, derived |
|
744 * classes may specify another value. |
|
745 * |
|
746 * @internal |
|
747 */ |
|
748 CAknsBmpAnimItemData( const TAknsItemType aType ); |
|
749 |
|
750 protected: // Data |
|
751 |
|
752 TAknsBmpAnimFrameInfo* iFrameArray; //!< Frame info array. |
|
753 |
|
754 TBool iLastFrameBackground; //!< Last frame used as background flag. |
|
755 TInt16 iFrameInterval; //!< Frame interval. |
|
756 TInt16 iPlayMode; //!< Play mode. |
|
757 TBool iFlash; //!< Flash flag. |
|
758 |
|
759 }; |
|
760 |
|
761 /** |
|
762 * String item data. |
|
763 * String item data contains (in addition to base class members), |
|
764 * a single string value. |
|
765 * Item type for string item data objects is always ::EAknsITString. |
|
766 * |
|
767 * This is a public class with exported functions. |
|
768 * The class is not intended for derivation outside the library. |
|
769 * |
|
770 * @lib AknSkins.lib |
|
771 * |
|
772 * @since 2.6 |
|
773 */ |
|
774 NONSHARABLE_CLASS(CAknsStringItemData) : public CAknsItemData |
|
775 { |
|
776 public: // Constructors and destructor |
|
777 |
|
778 /** |
|
779 * Two-phased constructor. |
|
780 * Constructs a new CAknsStringItemData object. String value must |
|
781 * be set separately using SetStringL. |
|
782 * |
|
783 * @return Newly constructed CAknsStringItemData object. |
|
784 * |
|
785 * @par Exceptions: |
|
786 * If allocation fails, function leaves with a system-wide error |
|
787 * code. |
|
788 */ |
|
789 IMPORT_C static CAknsStringItemData* NewL(); |
|
790 |
|
791 /** |
|
792 * Destructor. |
|
793 * Destroys owned string instance. |
|
794 */ |
|
795 virtual ~CAknsStringItemData(); |
|
796 |
|
797 public: // New functions |
|
798 |
|
799 /** |
|
800 * Sets the string value of this item data instance. |
|
801 * |
|
802 * @since 2.6 |
|
803 * |
|
804 * @param aValue New value. The value is copied to a newly created |
|
805 * internal buffer, and any previous value is discarded. |
|
806 */ |
|
807 IMPORT_C void SetStringL( const TDesC& aValue ); |
|
808 |
|
809 /** |
|
810 * Returns a reference to the string value. The value is still owned |
|
811 * by the item data object and caller must take its lifetime properly |
|
812 * into account. |
|
813 * |
|
814 * @since 2.6 |
|
815 * |
|
816 * @return Reference to the value. |
|
817 */ |
|
818 IMPORT_C const TDesC& String() const; |
|
819 |
|
820 protected: // C++ protected constructor |
|
821 |
|
822 /** |
|
823 * C++ protected constructor. |
|
824 * Constructs a new CAknsStringItemData without an array. |
|
825 * |
|
826 * @param aType Item type of the new item data object. While this |
|
827 * is always ::EAknsITString for instances of this class, derived |
|
828 * classes may specify another value. |
|
829 * |
|
830 * @internal |
|
831 */ |
|
832 CAknsStringItemData( const TAknsItemType aType ); |
|
833 |
|
834 protected: // Data |
|
835 |
|
836 HBufC* iString; //!< Buffer for string value. |
|
837 |
|
838 }; |
|
839 |
|
840 /** |
|
841 * Effect command data class. |
|
842 * Effect command class encapsulates the information of a single effect |
|
843 * command that is used with effect queue item data objects. |
|
844 * |
|
845 * This is a public class with exported functions. |
|
846 * The class is not intended for derivation outside the library. |
|
847 * |
|
848 * @lib AknSkins.lib |
|
849 * |
|
850 * @since 2.8 |
|
851 */ |
|
852 NONSHARABLE_CLASS(CAknsEffectCommand) : public CBase |
|
853 { |
|
854 public: // Constructors and destructor |
|
855 |
|
856 /** |
|
857 * Two-phased constructor. |
|
858 * |
|
859 * @return Newly constructed object. |
|
860 * |
|
861 * @par Exceptions: |
|
862 * If allocation fails, function leaves with a system-wide error |
|
863 * code. |
|
864 */ |
|
865 IMPORT_C static CAknsEffectCommand* NewL(); |
|
866 |
|
867 /** |
|
868 * Destructor. |
|
869 */ |
|
870 virtual ~CAknsEffectCommand(); |
|
871 |
|
872 public: // New functions |
|
873 |
|
874 /** |
|
875 * Sets the effect UID. |
|
876 * |
|
877 * @since 2.8 |
|
878 * |
|
879 * @param aValue New effect UID. |
|
880 */ |
|
881 IMPORT_C void SetEffectUid( const TUid aValue ); |
|
882 |
|
883 /** |
|
884 * Returns the effect UID. |
|
885 * |
|
886 * @since 2.8 |
|
887 * |
|
888 * @return Effect UID. |
|
889 */ |
|
890 IMPORT_C TUid EffectUid() const; |
|
891 |
|
892 /** |
|
893 * Sets the layer configuration. |
|
894 * |
|
895 * @since 2.8 |
|
896 * |
|
897 * @param aValue New layer configuration. |
|
898 */ |
|
899 IMPORT_C void SetLayerConf( const TAknsRlRenderOpParam aValue ); |
|
900 |
|
901 /** |
|
902 * Returns the layer configuration. |
|
903 * |
|
904 * @since 2.8 |
|
905 * |
|
906 * @return Layer configuration. |
|
907 */ |
|
908 IMPORT_C TAknsRlRenderOpParam LayerConf() const; |
|
909 |
|
910 /** |
|
911 * Appends a paramater to this effect command. |
|
912 * |
|
913 * @since 2.8 |
|
914 * |
|
915 * @param aParameter Parameter to be appended. The given data is copied, |
|
916 * and thus no ownership is transferred. |
|
917 */ |
|
918 IMPORT_C void AppendParameterL( |
|
919 const TAknsRlParameterData& aParameter ); |
|
920 |
|
921 /** |
|
922 * Creates and returns a new parameter iterator. |
|
923 * |
|
924 * @since 2.8 |
|
925 * |
|
926 * @return A new parameter iterator. Multiple iterators can be created. |
|
927 * The ownership of the iterator is transferred to the caller, and |
|
928 * the caller must ensure that the lifetime of the iterator |
|
929 * does not exceed the lifetime of this object. |
|
930 */ |
|
931 IMPORT_C MAknsRlParameterIterator* CreateParameterIteratorL(); |
|
932 |
|
933 protected: // C++ protected constructor |
|
934 |
|
935 /** |
|
936 * C++ protected constructor. |
|
937 * |
|
938 * @internal |
|
939 */ |
|
940 CAknsEffectCommand(); |
|
941 |
|
942 protected: // Data |
|
943 |
|
944 TUid iUid; //!< Effect UID. |
|
945 TAknsRlRenderOpParam iLayerConf; //!< Layer configuration. |
|
946 RPointerArray<CAknsEffectParameter> iParameters; //!< Parameters array. |
|
947 |
|
948 }; |
|
949 |
|
950 /** |
|
951 * Effect queue item data. |
|
952 * Effect queue item data contains (in addition to base class members), |
|
953 * the information required to render a single effect queue based |
|
954 * skin element. |
|
955 * |
|
956 * Item type for effect queue item data objects is always ::EAknsITEffectQueue. |
|
957 * |
|
958 * This is a public class with exported functions. |
|
959 * The class is not intended for derivation outside the library. |
|
960 * |
|
961 * @lib AknSkins.lib |
|
962 * |
|
963 * @since 2.8 |
|
964 */ |
|
965 NONSHARABLE_CLASS(CAknsEffectQueueItemData) : public CAknsItemData |
|
966 { |
|
967 public: // Constructors and destructor |
|
968 |
|
969 /** |
|
970 * Two-phased constructor. |
|
971 * Constructs a new CAknsEffectQueueItemData object. |
|
972 * |
|
973 * @return Newly constructed CAknsEffectQueueItemData object. |
|
974 * |
|
975 * @par Exceptions: |
|
976 * If allocation fails, function leaves with a system-wide error |
|
977 * code. |
|
978 */ |
|
979 IMPORT_C static CAknsEffectQueueItemData* NewL(); |
|
980 |
|
981 /** |
|
982 * Destructor. |
|
983 */ |
|
984 virtual ~CAknsEffectQueueItemData(); |
|
985 |
|
986 public: // New functions |
|
987 |
|
988 /** |
|
989 * Sets the referenced item ID. |
|
990 * |
|
991 * @since 2.8 |
|
992 * |
|
993 * @param aValue |
|
994 */ |
|
995 IMPORT_C void SetRefItem( const TAknsItemID aValue ); |
|
996 |
|
997 /** |
|
998 * Returns the referenced item ID. |
|
999 * |
|
1000 * @since 2.8 |
|
1001 * |
|
1002 * @return Referenced item ID, or @c KAknsIIDDefault if none. |
|
1003 */ |
|
1004 IMPORT_C TAknsItemID RefItem() const; |
|
1005 |
|
1006 /** |
|
1007 * Sets the input layer index value. |
|
1008 * |
|
1009 * @since 2.8 |
|
1010 * |
|
1011 * @param aValue |
|
1012 */ |
|
1013 IMPORT_C void SetInputLayer( const TInt aValue ); |
|
1014 |
|
1015 /** |
|
1016 * Returns the input layer index value. |
|
1017 * |
|
1018 * @since 2.8 |
|
1019 * |
|
1020 * @return Input layer index, or -1 if not used. |
|
1021 */ |
|
1022 IMPORT_C TInt InputLayer() const; |
|
1023 |
|
1024 /** |
|
1025 * Sets the input layer mode value. |
|
1026 * |
|
1027 * @since 2.8 |
|
1028 * |
|
1029 * @param aValue |
|
1030 */ |
|
1031 IMPORT_C void SetInputLayerMode( const TInt aValue ); |
|
1032 |
|
1033 /** |
|
1034 * Returns the input layer mode value. |
|
1035 * |
|
1036 * @since 2.8 |
|
1037 * |
|
1038 * @return Input layer mode. |
|
1039 */ |
|
1040 IMPORT_C TInt InputLayerMode() const; |
|
1041 |
|
1042 /** |
|
1043 * Sets the output layer index value. |
|
1044 * |
|
1045 * @since 2.8 |
|
1046 * |
|
1047 * @param aValue |
|
1048 */ |
|
1049 IMPORT_C void SetOutputLayer( const TInt aValue ); |
|
1050 |
|
1051 /** |
|
1052 * Returns the output layer index value. |
|
1053 * |
|
1054 * @since 2.8 |
|
1055 * |
|
1056 * @return Output layer index. |
|
1057 */ |
|
1058 IMPORT_C TInt OutputLayer() const; |
|
1059 |
|
1060 /** |
|
1061 * Sets the output layer mode value. |
|
1062 * |
|
1063 * @since 2.8 |
|
1064 * |
|
1065 * @param aValue |
|
1066 */ |
|
1067 IMPORT_C void SetOutputLayerMode( const TInt aValue ); |
|
1068 |
|
1069 /** |
|
1070 * Returns the output layer mode value. |
|
1071 * |
|
1072 * @since 2.8 |
|
1073 * |
|
1074 * @return Output layer mode. |
|
1075 */ |
|
1076 IMPORT_C TInt OutputLayerMode() const; |
|
1077 |
|
1078 /** |
|
1079 * Appends a command to this effect queue. |
|
1080 * |
|
1081 * @since 2.8 |
|
1082 * |
|
1083 * @param aCommand Command to be appended. The ownership of the |
|
1084 * given instance is transferred to this object, even if the method |
|
1085 * leaves. |
|
1086 */ |
|
1087 IMPORT_C void AppendCommandL( const CAknsEffectCommand* aCommand ); |
|
1088 |
|
1089 /** |
|
1090 * Creates and returns a new command iterator. |
|
1091 * |
|
1092 * @since 2.8 |
|
1093 * |
|
1094 * @return A new command iterator. Multiple iterators can be created. |
|
1095 * The ownership of the iterator is transferred to the caller, and |
|
1096 * the caller must ensure that the lifetime of the iterator |
|
1097 * does not exceed the lifetime of this object. |
|
1098 */ |
|
1099 IMPORT_C MAknsRlCommandIterator* CreateCommandIteratorL(); |
|
1100 |
|
1101 protected: // C++ protected constructor |
|
1102 |
|
1103 /** |
|
1104 * C++ protected constructor. |
|
1105 * Constructs a new CAknsEffectQueueItemData. |
|
1106 * |
|
1107 * @param aType Item type of the new item data object. While this |
|
1108 * is always ::EAknsITEffectQueue for instances of this class, derived |
|
1109 * classes may specify another value. |
|
1110 * |
|
1111 * @internal |
|
1112 */ |
|
1113 CAknsEffectQueueItemData( const TAknsItemType aType ); |
|
1114 |
|
1115 protected: // Data |
|
1116 |
|
1117 TAknsItemID iRefId; //!< Referenced item ID. |
|
1118 TInt iInputLayer; //!< Input layer value. |
|
1119 TInt iInputLayerMode; //!< Input layer mode value. |
|
1120 TInt iOutputLayer; //!< Output layer value. |
|
1121 TInt iOutputLayerMode; //!< Output layer mode value. |
|
1122 RPointerArray<CAknsEffectCommand> iCommands; //!< Commands array. |
|
1123 |
|
1124 }; |
|
1125 |
|
1126 /** |
|
1127 * Timing model data class. |
|
1128 * Timing model class encapsulates the information of a single timing model that |
|
1129 * is used with animation command item data objects. |
|
1130 * |
|
1131 * The class is not intended for derivation outside the library. |
|
1132 * |
|
1133 * @lib AknSkins.lib |
|
1134 * |
|
1135 * @since 3.0 |
|
1136 */ |
|
1137 class CAknsTimingModel: public CBase |
|
1138 { |
|
1139 public: // Constructors and destructor |
|
1140 static CAknsTimingModel* NewL(); |
|
1141 virtual ~CAknsTimingModel(); |
|
1142 |
|
1143 protected: // C++ protected constructor |
|
1144 CAknsTimingModel(); |
|
1145 |
|
1146 public: |
|
1147 void SetTimingModelUid( const TUid aValue ); |
|
1148 TUid TimingModelUid() const; |
|
1149 |
|
1150 void AppendParameterL( const TAknsRlParameterData& aParameter ); |
|
1151 MAknsRlParameterIterator* CreateParameterIteratorL(); |
|
1152 |
|
1153 public: // Iteration support (internal) |
|
1154 void AssignOutL( TAknsAlTimingModelData& aData ); |
|
1155 |
|
1156 static void InitializeOut( TAknsAlTimingModelData& aData ); |
|
1157 static void ReleaseOut( TAknsAlTimingModelData& aData ); |
|
1158 |
|
1159 private: // Data |
|
1160 TUid iTimingModelUid; |
|
1161 RPointerArray<CAknsEffectParameter> iParameters; |
|
1162 }; |
|
1163 |
|
1164 /** |
|
1165 * Animation value data class. |
|
1166 * Animation value class encapsulates the information of a single animation |
|
1167 * value (animation value uid, parameters for animation value and timing model |
|
1168 * reference id) that is used with animation command item data objects. |
|
1169 * |
|
1170 * The class is not intended for derivation outside the library. |
|
1171 * |
|
1172 * @lib AknSkins.lib |
|
1173 * |
|
1174 * @since 3.0 |
|
1175 */ |
|
1176 class CAknsAnimationValue: public CBase |
|
1177 { |
|
1178 public: |
|
1179 static CAknsAnimationValue* NewL(); |
|
1180 virtual ~CAknsAnimationValue(); |
|
1181 |
|
1182 private: |
|
1183 CAknsAnimationValue(); |
|
1184 |
|
1185 public: |
|
1186 void SetAnimationValueUid( const TUid aValue ); |
|
1187 TUid AnimationValueUid() const; |
|
1188 |
|
1189 void SetTimingModelId( const TInt aId ); |
|
1190 TInt TimingModelId() const; |
|
1191 |
|
1192 void AppendParameterL( const TAknsRlParameterData& aParameter ); |
|
1193 MAknsRlParameterIterator* CreateParameterIteratorL(); |
|
1194 |
|
1195 public: // Iteration support (internal) |
|
1196 void AssignOutL( TAknsAlAnimationValueData& aData ); |
|
1197 |
|
1198 static void InitializeOut( TAknsAlAnimationValueData& aData ); |
|
1199 static void ReleaseOut( TAknsAlAnimationValueData& aData ); |
|
1200 |
|
1201 private: |
|
1202 TInt iTimingModelId; |
|
1203 TUid iAnimationValueUid; |
|
1204 RPointerArray<CAknsEffectParameter> iParameters; |
|
1205 }; |
|
1206 |
|
1207 /** |
|
1208 * Animation command data class. |
|
1209 * Animation command class encapsulates the information of a single animation |
|
1210 * command (in addition to base class members) that is used with animation item |
|
1211 * data objects. |
|
1212 * |
|
1213 * The class is not intended for derivation outside the library. |
|
1214 * |
|
1215 * @lib AknSkins.lib |
|
1216 * |
|
1217 * @since 3.0 |
|
1218 */ |
|
1219 class CAknsAnimationCommand: public CAknsEffectCommand |
|
1220 { |
|
1221 public: |
|
1222 static CAknsAnimationCommand* NewL(); |
|
1223 virtual ~CAknsAnimationCommand(); |
|
1224 |
|
1225 private: |
|
1226 CAknsAnimationCommand(); |
|
1227 |
|
1228 public: |
|
1229 void AppendNamedReferenceL( const TAknsAlNamedReferenceData& aData ); |
|
1230 MAknsAlIterator* CreateNamedReferenceIteratorL(); |
|
1231 |
|
1232 public: // Iteration support (internal) |
|
1233 void AssignOutL( TAknsAlAnimationCommandData& aData ); |
|
1234 |
|
1235 static void InitializeOut( TAknsAlAnimationCommandData& aData ); |
|
1236 static void ReleaseOut( TAknsAlAnimationCommandData& aData ); |
|
1237 |
|
1238 private: |
|
1239 RPointerArray<CAknsNamedReference> iNamedReferences; |
|
1240 }; |
|
1241 |
|
1242 /** |
|
1243 * Animation item data. |
|
1244 * Animation item data contains (in addition to base class members) the |
|
1245 * information required to create an AnimationLibrary animation. |
|
1246 * |
|
1247 * Item type for animation item data objects is always ::EAknsITAnimation. |
|
1248 * |
|
1249 * The class is not intended for derivation outside the library. |
|
1250 * |
|
1251 * @lib AknSkins.lib |
|
1252 * |
|
1253 * @since 3.0 |
|
1254 */ |
|
1255 class CAknsAnimationItemData: public CAknsItemData |
|
1256 { |
|
1257 public: |
|
1258 static CAknsAnimationItemData* NewL(); |
|
1259 virtual ~CAknsAnimationItemData(); |
|
1260 |
|
1261 protected: // C++ protected constructor |
|
1262 CAknsAnimationItemData(); |
|
1263 |
|
1264 public: // New functions |
|
1265 void SetMinInterval( TInt aMin ); |
|
1266 TInt MinInterval() const; |
|
1267 |
|
1268 void SetMorphing( TBool aMorphing ); |
|
1269 TBool Morphing() const; |
|
1270 |
|
1271 void SetInputLayer( const TInt aValue ); |
|
1272 TInt InputLayer() const; |
|
1273 |
|
1274 void SetInputLayerMode( const TInt aValue ); |
|
1275 TInt InputLayerMode() const; |
|
1276 |
|
1277 void SetOutputLayer( const TInt aValue ); |
|
1278 TInt OutputLayer() const; |
|
1279 |
|
1280 void SetOutputLayerMode( const TInt aValue ); |
|
1281 TInt OutputLayerMode() const; |
|
1282 |
|
1283 /** |
|
1284 * @param aCommand Ownership is transferred |
|
1285 */ |
|
1286 void AppendPreprocessCommandL( CAknsEffectCommand* aCommand ); |
|
1287 MAknsRlCommandIterator* PreprocessCommandIteratorL() const; |
|
1288 |
|
1289 /** |
|
1290 * @param aCommand Ownership is transferred |
|
1291 */ |
|
1292 void AppendCommandL( CAknsAnimationCommand* aCommand ); |
|
1293 MAknsAlIterator* CommandIteratorL() const; |
|
1294 |
|
1295 /** |
|
1296 * @param aValue Ownership is transferred |
|
1297 */ |
|
1298 void AppendTimingModelL( CAknsTimingModel* aModel ); |
|
1299 MAknsAlIterator* TimingModelIteratorL() const; |
|
1300 |
|
1301 /** |
|
1302 * @param aValue Ownership is transferred |
|
1303 */ |
|
1304 void AppendAnimationValueL( CAknsAnimationValue* aValue ); |
|
1305 MAknsAlIterator* AnimationValueIteratorL() const; |
|
1306 |
|
1307 void AppendSizeBoundParamL( const TAknsAlSizeBoundParameterData& aParam ); |
|
1308 MAknsAlIterator* SizeBoundParamIteratorL() const; |
|
1309 |
|
1310 private: |
|
1311 TInt iMinInterval; // In milliseconds |
|
1312 TBool iMorphing; |
|
1313 |
|
1314 TInt iInputLayer; |
|
1315 TInt iInputLayerMode; |
|
1316 TInt iOutputLayer; |
|
1317 TInt iOutputLayerMode; |
|
1318 |
|
1319 RPointerArray<CAknsEffectCommand> iPreprocessCommands; |
|
1320 RPointerArray<CAknsAnimationCommand> iAnimationCommands; |
|
1321 RPointerArray<CAknsTimingModel> iTimingModels; |
|
1322 RPointerArray<CAknsAnimationValue> iAnimationValues; |
|
1323 RPointerArray<CAknsSizeBoundParameter> iSizeBoundParams; |
|
1324 }; |
|
1325 |
|
1326 #endif // AKNSITEMDATA_H |
|
1327 |
|
1328 // End of File |