1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/mw/AknsItemData.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,1328 @@
1.4 +/*
1.5 +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description: Defines public item data classes.
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +#ifndef AKNSITEMDATA_H
1.23 +#define AKNSITEMDATA_H
1.24 +
1.25 +// INCLUDES
1.26 +#include <AknsItemID.h>
1.27 +#include <AknsRlEffect.h>
1.28 +#include <gdi.h>
1.29 +
1.30 +// FORWARD DECLARATIONS
1.31 +class CFbsBitmap;
1.32 +struct TAknsAppIconInfo;
1.33 +struct TAknsImageAttributeData;
1.34 +struct TAknsColorTableEntry;
1.35 +struct TAknsBmpAnimFrameInfo;
1.36 +class CAknsEffectParameter;
1.37 +class MAknsRlCommandIterator;
1.38 +class MAknsAlIterator;
1.39 +class CAknsNamedReference;
1.40 +class CAknsSizeBoundParameter;
1.41 +struct TAknsAlAnimationCommandData;
1.42 +struct TAknsAlTimingModelData;
1.43 +struct TAknsAlAnimationValueData;
1.44 +struct TAknsAlNamedReferenceData;
1.45 +struct TAknsAlSizeBoundParameterData;
1.46 +
1.47 +// CLASS DECLARATIONS
1.48 +
1.49 +/**
1.50 +* Base class for item data classes.
1.51 +* Item data encapsulates type information and resource instance (such as
1.52 +* CFbsBitmap object) of a specific skin item. Since actual data entries vary
1.53 +* depending on the type of the item, CAknsItemData contains only type
1.54 +* information and can not be instantiated.
1.55 +*
1.56 +* This is a public class with exported functions.
1.57 +* The class is not intended for derivation outside the library.
1.58 +*
1.59 +* @lib AknSkins.lib
1.60 +*
1.61 +* @since 2.0
1.62 +*/
1.63 +NONSHARABLE_CLASS(CAknsItemData) : public CBase
1.64 + {
1.65 + public: // Constructors and destructor
1.66 +
1.67 + /**
1.68 + * Destructor.
1.69 + * CAknsItemData itself has no dynamically allocated members, but
1.70 + * derived classes may have them.
1.71 + */
1.72 + virtual ~CAknsItemData();
1.73 +
1.74 + public: // New functions
1.75 +
1.76 + /**
1.77 + * Sets the perceived type of this item without affecting the
1.78 + * real instance inheritance.
1.79 + *
1.80 + * @since 2.8
1.81 + *
1.82 + * @internal
1.83 + *
1.84 + * @param aType New type.
1.85 + */
1.86 + void SetType( const TAknsItemType aType );
1.87 +
1.88 + /**
1.89 + * Returns the type of the item data object.
1.90 + * This method can be used to provide run-time type information.
1.91 + * Corresponding classes are listed in definition of ::TAknsItemType.
1.92 + *
1.93 + * @since 2.0
1.94 + *
1.95 + * @return Type of the item data as TAknsItemType.
1.96 + */
1.97 + IMPORT_C TAknsItemType Type() const;
1.98 +
1.99 + protected: // C++ protected constructor for derived classes
1.100 +
1.101 + /**
1.102 + * C++ constructor for derived classes.
1.103 + * Constructs item data object with given item type.
1.104 + *
1.105 + * @param aType Item type of the new item data object.
1.106 + *
1.107 + * @internal
1.108 + */
1.109 + CAknsItemData( const TAknsItemType aType );
1.110 +
1.111 + protected: // Data
1.112 +
1.113 + TAknsItemType iType; //!< Type of the item data object.
1.114 +
1.115 + };
1.116 +
1.117 +/**
1.118 +* Image item data.
1.119 +* Image item data contains (in addition to base class members) image
1.120 +* attributes, such as size or alignment. Item type for image item data
1.121 +* objects is ::EAknsITImage.
1.122 +*
1.123 +* This is a public class with exported functions.
1.124 +* The class is not intended for derivation outside the library.
1.125 +*
1.126 +* @lib AknSkins.lib
1.127 +*
1.128 +* @since 2.0
1.129 +*/
1.130 +NONSHARABLE_CLASS(CAknsImageItemData) : public CAknsItemData
1.131 + {
1.132 + public: // Constructors and destructor
1.133 +
1.134 + /**
1.135 + * Destructor.
1.136 + */
1.137 + virtual ~CAknsImageItemData();
1.138 +
1.139 + public: // New functions
1.140 +
1.141 + /**
1.142 + * Sets the image attributes for this image item data object.
1.143 + *
1.144 + * @since 2.0
1.145 + *
1.146 + * @param aAttributes Attribute data structure containing the new
1.147 + * values.
1.148 + */
1.149 + IMPORT_C void SetAttributesL(
1.150 + const TAknsImageAttributeData& aAttributes );
1.151 +
1.152 + /**
1.153 + * Returns a pointer to the image attribute structure owned by the
1.154 + * item data object.
1.155 + *
1.156 + * @since 2.0
1.157 + *
1.158 + * @return Pointer to the image attribute structure, or @c NULL if
1.159 + * there is none.
1.160 + */
1.161 + IMPORT_C const TAknsImageAttributeData* Attributes() const;
1.162 +
1.163 + IMPORT_C void SetParentIID(const TAknsItemID& aIID);
1.164 + IMPORT_C void SetDrawRect(const TRect& aRect);
1.165 + IMPORT_C TAknsItemID ParentIID();
1.166 + IMPORT_C TRect DrawRect();
1.167 +
1.168 +
1.169 + protected: // C++ protected constructor for derived classes
1.170 +
1.171 + /**
1.172 + * C++ constructor for derived classes.
1.173 + * Constructs an image item data object with given item type.
1.174 + *
1.175 + * @param aType Item type of the new item data object.
1.176 + *
1.177 + * @internal
1.178 + */
1.179 + CAknsImageItemData( const TAknsItemType aType );
1.180 +
1.181 + protected: // Data
1.182 +
1.183 + TAknsImageAttributeData* iAttributeData;
1.184 + TAknsItemID iParentIID;
1.185 + TRect iDrawRect;
1.186 +
1.187 +
1.188 + };
1.189 +
1.190 +/**
1.191 +* Bitmap item data.
1.192 +* Bitmap item data contains (in addition to base class members) CFbsBitmap
1.193 +* instance of the bitmap. Item type for bitmap item data is always
1.194 +* ::EAknsITBitmap.
1.195 +*
1.196 +* This is a public class with exported functions.
1.197 +* The class is not intended for derivation outside the library.
1.198 +*
1.199 +* @lib AknSkins.lib
1.200 +*
1.201 +* @since 2.0
1.202 +*/
1.203 +NONSHARABLE_CLASS(CAknsBitmapItemData) : public CAknsImageItemData
1.204 + {
1.205 + public: // Constructors and destructor
1.206 +
1.207 + /**
1.208 + * Two-phased constructor.
1.209 + * Constructs a new CAknsBitmapItemData object with bitmap set to
1.210 + * @c NULL. Bitmap must be set afterwards by using
1.211 + * SetBitmap(CFbsBitmap* aBitmap) method.
1.212 + *
1.213 + * @return Newly constructed CAknsBitmapItemData object.
1.214 + *
1.215 + * @par Exceptions:
1.216 + * If allocation fails, function leaves with a system-wide error
1.217 + * code.
1.218 + */
1.219 + IMPORT_C static CAknsBitmapItemData* NewL();
1.220 +
1.221 + /**
1.222 + * Destructor.
1.223 + * Deletes bitmap object, if present.
1.224 + */
1.225 + virtual ~CAknsBitmapItemData();
1.226 +
1.227 + public: // New functions
1.228 +
1.229 + /**
1.230 + * Sets the bitmap object for this item data instance.
1.231 + *
1.232 + * @since 2.0
1.233 + *
1.234 + * @c NULL value can be used to detach bitmap from item data.
1.235 + *
1.236 + * @param aBitmap Pointer to bitmap instance. Ownership of the bitmap
1.237 + * object is transferred to item data. @c NULL value is also valid.
1.238 + */
1.239 + IMPORT_C void SetBitmap( CFbsBitmap* aBitmap );
1.240 +
1.241 + /**
1.242 + * Sets the bitmap object for this item data instance and destroys
1.243 + * previous one, if any.
1.244 + *
1.245 + * @since 2.0
1.246 + *
1.247 + * @param aBitmap Pointer to bitmap instance. Ownership of the bitmap
1.248 + * object is transferred to item data. @c NULL value is also valid.
1.249 + */
1.250 + IMPORT_C void DestroyAndSetBitmap( CFbsBitmap* aBitmap );
1.251 +
1.252 + /**
1.253 + * Returns the current bitmap object owned by item data instance.
1.254 + *
1.255 + * @since 2.0
1.256 + *
1.257 + * @return Pointer to bitmap instance, or @c NULL if none is currently
1.258 + * associated with this item data.
1.259 + */
1.260 + IMPORT_C CFbsBitmap* Bitmap();
1.261 +
1.262 + protected: // C++ protected constructor
1.263 +
1.264 + /**
1.265 + * C++ protected constructor.
1.266 + * Constructs a new CAknsBitmapItemData with bitmap set to @c NULL.
1.267 + *
1.268 + * @param aType Item type of the new item data object. While this
1.269 + * is always ::EAknsITBitmap for instances of this class, derived
1.270 + * classes may specify another value.
1.271 + *
1.272 + * @internal
1.273 + */
1.274 + CAknsBitmapItemData( const TAknsItemType aType );
1.275 +
1.276 + protected: // Data
1.277 + CFbsBitmap* iBitmap; //!< Pointer to associated bitmap instance.
1.278 +
1.279 + };
1.280 +
1.281 +/**
1.282 +* Masked bitmap item data.
1.283 +* Masked bitmap item data contains (in addition to base class members) an
1.284 +* additional member of type CFbsBitmap for the bitmap mask.
1.285 +* Item type for bitmap item data is always ::EAknsITMaskedBitmap.
1.286 +*
1.287 +* This is a public class with exported functions.
1.288 +* The class is not intended for derivation outside the library.
1.289 +*
1.290 +* @lib AknSkins.lib
1.291 +*
1.292 +* @since 2.0
1.293 +*/
1.294 +NONSHARABLE_CLASS(CAknsMaskedBitmapItemData) : public CAknsBitmapItemData
1.295 + {
1.296 + public: // Constructors and destructor
1.297 +
1.298 + /**
1.299 + * Two-phased constructor.
1.300 + * Constructs a new CAknsMaskedBitmapItemData object with bitmaps set to
1.301 + * @c NULL. Bitmaps must be set afterwards by using
1.302 + * SetBitmap(CFbsBitmap* aBitmap) and SetMask(CFbsBitmap* aBitmap) methods.
1.303 + *
1.304 + * @return Newly constructed CAknsMaskedBitmapItemData object.
1.305 + *
1.306 + * @par Exceptions:
1.307 + * If allocation fails, function leaves with a system-wide error
1.308 + * code.
1.309 + */
1.310 + IMPORT_C static CAknsMaskedBitmapItemData* NewL();
1.311 +
1.312 + /**
1.313 + * Destructor.
1.314 + * Deletes bitmap objects, if present.
1.315 + */
1.316 + virtual ~CAknsMaskedBitmapItemData();
1.317 +
1.318 + public: // New functions
1.319 +
1.320 + /**
1.321 + * Sets the mask bitmap object for this item data instance.
1.322 + * @c NULL value can be used to detach bitmap mask from item data.
1.323 + *
1.324 + * @since 2.0
1.325 + *
1.326 + * @param aMask Pointer to mask instance. Ownership of the bitmap
1.327 + * object is transferred to item data. @c NULL value is also valid.
1.328 + */
1.329 + IMPORT_C void SetMask( CFbsBitmap* aMask );
1.330 +
1.331 + /**
1.332 + * Sets the mask bitmap object for this item data instance and destroys
1.333 + * previous one, if any.
1.334 + *
1.335 + * @since 2.0
1.336 + *
1.337 + * @param aMask Pointer to mask instance. Ownership of the bitmap
1.338 + * object is transferred to item data. @c NULL value is also valid.
1.339 + */
1.340 + IMPORT_C void DestroyAndSetMask( CFbsBitmap* aMask );
1.341 +
1.342 + /**
1.343 + * Returns the current bitmap mask object owned by item data instance.
1.344 + *
1.345 + * @since 2.0
1.346 + *
1.347 + * @return Pointer to mask instance, or @c NULL if none is currently
1.348 + * associated with this item data.
1.349 + */
1.350 + IMPORT_C CFbsBitmap* Mask();
1.351 +
1.352 + protected: // C++ protected constructor
1.353 +
1.354 + /**
1.355 + * C++ protected constructor.
1.356 + * Constructs a new CAknsMaskedBitmapItemData with bitmaps set to @c NULL.
1.357 + *
1.358 + * @param aType Item type of the new item data object. While this
1.359 + * is always ::EAknsITMaskedBitmap for instances of this class, derived
1.360 + * classes may specify another value.
1.361 + *
1.362 + * @internal
1.363 + */
1.364 + CAknsMaskedBitmapItemData( const TAknsItemType aType );
1.365 +
1.366 + protected: // Data
1.367 + CFbsBitmap* iMask; //!< Pointer to associated mask bitmap instance.
1.368 +
1.369 + };
1.370 +
1.371 +/**
1.372 +* Color table item data.
1.373 +* Color table item data contains (in addition to base class members) color
1.374 +* array of TRGB values. Item type for color item data is always
1.375 +* ::EAknsITColorTable.
1.376 +*
1.377 +* This is a public class with exported functions.
1.378 +* The class is not intended for derivation outside the library.
1.379 +*
1.380 +* @lib AknSkins.lib
1.381 +*
1.382 +* @since 2.0
1.383 +*/
1.384 +NONSHARABLE_CLASS(CAknsColorTableItemData) : public CAknsImageItemData
1.385 + {
1.386 + public: // Constructors and destructor
1.387 +
1.388 + /**
1.389 + * Two-phased constructor.
1.390 + * Constructs a new CAknsColorTableItemData object. Values must
1.391 + * be set separately using SetColorsL.
1.392 + *
1.393 + * @return Newly constructed CAknsColorTableItemData object.
1.394 + *
1.395 + * @par Exceptions:
1.396 + * If allocation fails, function leaves with a system-wide error
1.397 + * code.
1.398 + */
1.399 + IMPORT_C static CAknsColorTableItemData* NewL();
1.400 +
1.401 + /**
1.402 + * Destructor.
1.403 + * Destroys color value array.
1.404 + */
1.405 + virtual ~CAknsColorTableItemData();
1.406 +
1.407 + public: // New functions
1.408 +
1.409 + /**
1.410 + * Sets color values for this item data instance.
1.411 + *
1.412 + * @since 2.0
1.413 + *
1.414 + * @param aNumberOfColors Number of colors in aColors.
1.415 + *
1.416 + * @param aColors Pointer to first color value. Values are copied
1.417 + * into an internal array.
1.418 + */
1.419 + IMPORT_C void SetColorsL( const TInt aNumberOfColors,
1.420 + const TAknsColorTableEntry* aColors );
1.421 +
1.422 + /**
1.423 + * Returns the indexed color value.
1.424 + *
1.425 + * @since 2.0
1.426 + *
1.427 + * @param aIndex Index of the color to be retrieved. This must
1.428 + * be within 0 (inclusive) and aNumberOfColors (exclusive).
1.429 + *
1.430 + * @return Color value as TInt. If the value is -1, RGB value
1.431 + * should be queried instead.
1.432 + *
1.433 + * @par Note:
1.434 + * This method does not perform any bounds checking. An access
1.435 + * violation or panic will occur, if the given index is not
1.436 + * within the bounds of the internal array. Use @c GetColorL
1.437 + * instead, if such checking is required.
1.438 + */
1.439 + IMPORT_C TInt ColorIndexed( const TInt aIndex ) const;
1.440 +
1.441 + /**
1.442 + * Returns the RGB color value.
1.443 + *
1.444 + * @since 2.0
1.445 + *
1.446 + * @param aIndex Index of the color to be retrieved. This must
1.447 + * be within 0 (inclusive) and aNumberOfColors (exclusive).
1.448 + *
1.449 + * @return Color value as TRgb. Note that the value is only
1.450 + * valid if ColorIndexed() returned -1.
1.451 + *
1.452 + * @par Note:
1.453 + * This method does not perform any bounds checking. An access
1.454 + * violation or panic will occur, if the given index is not
1.455 + * within the bounds of the internal array. Use @c GetColorL
1.456 + * instead, if such checking is required.
1.457 + */
1.458 + IMPORT_C TRgb ColorRgb( const TInt aIndex ) const;
1.459 +
1.460 + /**
1.461 + * Retrieves a color value (indexed or RGB) with bounds checking.
1.462 + *
1.463 + * @since 2.6
1.464 + *
1.465 + * @param aIndex Index of the color to be retrieved.
1.466 + *
1.467 + * @param aColor On return, contains the color as an RGB value.
1.468 + * If the color is indexed, the appropriate mapping using current
1.469 + * palette is used.
1.470 + *
1.471 + * @par Exceptions:
1.472 + * If the given index is outside the bounds of the array,
1.473 + * the method leaves with an error code.
1.474 + */
1.475 + IMPORT_C void GetColorL( const TInt aIndex, TRgb& aColor ) const;
1.476 +
1.477 + protected: // C++ protected constructor
1.478 +
1.479 + /**
1.480 + * C++ protected constructor.
1.481 + * Constructs a new CAknsColorItemData without an array.
1.482 + *
1.483 + * @param aType Item type of the new item data object. While this
1.484 + * is always ::EAknsITColorTable for instances of this class, derived
1.485 + * classes may specify another value.
1.486 + *
1.487 + * @internal
1.488 + */
1.489 + CAknsColorTableItemData( const TAknsItemType aType );
1.490 +
1.491 + protected: // Data
1.492 +
1.493 + TAknsColorTableEntry* iColorArray; //!< Color array.
1.494 + TInt iColorArraySize;
1.495 +
1.496 + };
1.497 +
1.498 +/**
1.499 +* Icon table item data.
1.500 +* Icon table item data contains (in addition to base class members), an
1.501 +* array containing item IDs of images. Item type for
1.502 +* image table item data objects is always ::EAknsITImageTable.
1.503 +*
1.504 +* This is a public class with exported functions.
1.505 +* The class is not intended for derivation outside the library.
1.506 +*
1.507 +* @lib AknSkins.lib
1.508 +*
1.509 +* @since 2.0
1.510 +*/
1.511 +NONSHARABLE_CLASS(CAknsImageTableItemData) : public CAknsImageItemData
1.512 + {
1.513 + public: // Constructors and destructor
1.514 +
1.515 + /**
1.516 + * Two-phased constructor.
1.517 + * Constructs a new CAknsImageTableItemData object. Values must
1.518 + * be set separately using SetImagesL.
1.519 + *
1.520 + * @return Newly constructed CAknsImageTableItemData object.
1.521 + *
1.522 + * @par Exceptions:
1.523 + * If allocation fails, function leaves with a system-wide error
1.524 + * code.
1.525 + */
1.526 + IMPORT_C static CAknsImageTableItemData* NewL();
1.527 +
1.528 + /**
1.529 + * Destructor.
1.530 + * Destroys image array.
1.531 + */
1.532 + virtual ~CAknsImageTableItemData();
1.533 +
1.534 + public: // New functions
1.535 +
1.536 + /**
1.537 + * Sets image table values for this item data instance.
1.538 + *
1.539 + * @since 2.0
1.540 + *
1.541 + * @param aNumberOfImages Number of images in aImages.
1.542 + *
1.543 + * @param aImages Pointer to first image ID. Values are
1.544 + * copied into an internal array.
1.545 + */
1.546 + IMPORT_C void SetImagesL( const TInt aNumberOfImages,
1.547 + const TAknsItemID* aImages );
1.548 +
1.549 + /**
1.550 + * Returns the item ID of an image.
1.551 + *
1.552 + * @since 2.0
1.553 + *
1.554 + * @param aIndex Index of the image. This value must
1.555 + * be within 0 (inclusive) and NumberOfImages (exclusive).
1.556 + *
1.557 + * @return Item ID of the image.
1.558 + */
1.559 + IMPORT_C TAknsItemID ImageIID( const TInt aIndex ) const;
1.560 +
1.561 + /**
1.562 + * Returns pointer to the first entry in the image array,
1.563 + * owned by this object.
1.564 + *
1.565 + * @since 2.0
1.566 + *
1.567 + * @return Pointer to TAknsItemID.
1.568 + */
1.569 + IMPORT_C TAknsItemID* Images() const;
1.570 +
1.571 + /**
1.572 + * Returns the number of images.
1.573 + *
1.574 + * @since 2.0
1.575 + *
1.576 + * @return Number of images as an integer.
1.577 + */
1.578 + IMPORT_C TInt NumberOfImages() const;
1.579 +
1.580 + protected: // C++ protected constructor
1.581 +
1.582 + /**
1.583 + * C++ protected constructor.
1.584 + * Constructs a new CAknsImageTableItemData without an array.
1.585 + *
1.586 + * @param aType Item type of the new item data object. While this
1.587 + * is always ::EAknsITImageTable for instances of this class, derived
1.588 + * classes may specify another value.
1.589 + *
1.590 + * @internal
1.591 + */
1.592 + CAknsImageTableItemData( const TAknsItemType aType );
1.593 +
1.594 + protected: // Data
1.595 +
1.596 + TInt iNumberOfImages; //!< Number of images.
1.597 + TAknsItemID* iImageArray; //!< Image array.
1.598 +
1.599 + };
1.600 +
1.601 +/**
1.602 +* Bitmap animation item data.
1.603 +* Bitmap animation item data contains (in addition to base class members),
1.604 +* animation properties as well as an array containing frame properties
1.605 +* Item type for bitmap animation item data objects is always ::EAknsITBmpAnim.
1.606 +*
1.607 +* This is a public class with exported functions.
1.608 +* The class is not intended for derivation outside the library.
1.609 +*
1.610 +* @lib AknSkins.lib
1.611 +*
1.612 +* @since 2.0
1.613 +*/
1.614 +NONSHARABLE_CLASS(CAknsBmpAnimItemData) : public CAknsImageTableItemData
1.615 + {
1.616 + public: // Constructors and destructor
1.617 +
1.618 + /**
1.619 + * Two-phased constructor.
1.620 + * Constructs a new CAknsBmpAnimItemData object. Values must
1.621 + * be set separately using SetImagesL and SetFrameInfosL.
1.622 + *
1.623 + * @return Newly constructed CAknsBmpAnimItemData object.
1.624 + *
1.625 + * @par Exceptions:
1.626 + * If allocation fails, function leaves with a system-wide error
1.627 + * code.
1.628 + */
1.629 + IMPORT_C static CAknsBmpAnimItemData* NewL();
1.630 +
1.631 + /**
1.632 + * Destructor.
1.633 + * Destroys arrays.
1.634 + */
1.635 + virtual ~CAknsBmpAnimItemData();
1.636 +
1.637 + public: // New functions
1.638 +
1.639 + /**
1.640 + * Sets frame property values for this item data instance.
1.641 + *
1.642 + * The number of entries in the given array must match
1.643 + * the number of images in the image table. Therefore
1.644 + * SetFrameInfosL must be called only after SetImagesL
1.645 + * has already been called.
1.646 + *
1.647 + * @since 2.0
1.648 + *
1.649 + * @param aFrameInfos Pointer to first frame info. Values are
1.650 + * copied into an internal array.
1.651 + */
1.652 + IMPORT_C void SetFrameInfosL( const TAknsBmpAnimFrameInfo* aFrameInfos );
1.653 +
1.654 + /**
1.655 + * Returns pointer to the first entry in the frame property array,
1.656 + * owned by this object.
1.657 + *
1.658 + * @since 2.0
1.659 + *
1.660 + * @return Pointer to TAknsBmpAnimFrameInfo.
1.661 + */
1.662 + IMPORT_C TAknsBmpAnimFrameInfo* FrameInfos() const;
1.663 +
1.664 + /**
1.665 + * Sets the flag indicating whether the last frame should be
1.666 + * interpreted as the background (i.e. excluded from the animation
1.667 + * itself).
1.668 + *
1.669 + * @since 2.0
1.670 + *
1.671 + * @param aLastFrameBg Boolean value.
1.672 + */
1.673 + IMPORT_C void SetLastFrameBackground( TBool aLastFrameBg );
1.674 +
1.675 + /**
1.676 + * Retrieves the flag value indicating whether the last frame
1.677 + * should be interpreted as the background.
1.678 + *
1.679 + * @since 2.0
1.680 + *
1.681 + * @return Boolean value.
1.682 + */
1.683 + IMPORT_C TBool LastFrameBackground() const;
1.684 +
1.685 + /**
1.686 + * Sets the frame interval for the entire animation.
1.687 + *
1.688 + * @since 2.0
1.689 + *
1.690 + * @param aFrameInterval Frame interval in milliseconds or -1.
1.691 + */
1.692 + IMPORT_C void SetFrameInterval( const TInt16 aFrameInterval );
1.693 +
1.694 + /**
1.695 + * Retrieves the frame interval.
1.696 + *
1.697 + * @since 2.0
1.698 + *
1.699 + * @return Frame interval in milliseconds or -1.
1.700 + */
1.701 + IMPORT_C TInt16 FrameInterval() const;
1.702 +
1.703 + /**
1.704 + * Sets the play mode for the entire animation.
1.705 + *
1.706 + * @since 2.0
1.707 + *
1.708 + * @param aPlayMode Play mode.
1.709 + */
1.710 + IMPORT_C void SetPlayMode( const TInt16 aPlayMode );
1.711 +
1.712 + /**
1.713 + * Retrieves the play mode.
1.714 + *
1.715 + * @since 2.0
1.716 + *
1.717 + * @return Play mode.
1.718 + */
1.719 + IMPORT_C TInt16 PlayMode() const;
1.720 +
1.721 + /**
1.722 + * Sets the flash property for the entire animation.
1.723 + *
1.724 + * @since 2.0
1.725 + *
1.726 + * @param aFlash Flash flag value.
1.727 + */
1.728 + IMPORT_C void SetFlash( const TBool aFlash );
1.729 +
1.730 + /**
1.731 + * Retrieves the flash property.
1.732 + *
1.733 + * @since 2.0
1.734 + *
1.735 + * @return Flash flag value.
1.736 + */
1.737 + IMPORT_C TBool Flash() const;
1.738 +
1.739 + protected: // C++ protected constructor
1.740 +
1.741 + /**
1.742 + * C++ protected constructor.
1.743 + * Constructs a new CAknsBmpAnimItemData without an array.
1.744 + *
1.745 + * @param aType Item type of the new item data object. While this
1.746 + * is always ::EAknsITBmpAnim for instances of this class, derived
1.747 + * classes may specify another value.
1.748 + *
1.749 + * @internal
1.750 + */
1.751 + CAknsBmpAnimItemData( const TAknsItemType aType );
1.752 +
1.753 + protected: // Data
1.754 +
1.755 + TAknsBmpAnimFrameInfo* iFrameArray; //!< Frame info array.
1.756 +
1.757 + TBool iLastFrameBackground; //!< Last frame used as background flag.
1.758 + TInt16 iFrameInterval; //!< Frame interval.
1.759 + TInt16 iPlayMode; //!< Play mode.
1.760 + TBool iFlash; //!< Flash flag.
1.761 +
1.762 + };
1.763 +
1.764 +/**
1.765 +* String item data.
1.766 +* String item data contains (in addition to base class members),
1.767 +* a single string value.
1.768 +* Item type for string item data objects is always ::EAknsITString.
1.769 +*
1.770 +* This is a public class with exported functions.
1.771 +* The class is not intended for derivation outside the library.
1.772 +*
1.773 +* @lib AknSkins.lib
1.774 +*
1.775 +* @since 2.6
1.776 +*/
1.777 +NONSHARABLE_CLASS(CAknsStringItemData) : public CAknsItemData
1.778 + {
1.779 + public: // Constructors and destructor
1.780 +
1.781 + /**
1.782 + * Two-phased constructor.
1.783 + * Constructs a new CAknsStringItemData object. String value must
1.784 + * be set separately using SetStringL.
1.785 + *
1.786 + * @return Newly constructed CAknsStringItemData object.
1.787 + *
1.788 + * @par Exceptions:
1.789 + * If allocation fails, function leaves with a system-wide error
1.790 + * code.
1.791 + */
1.792 + IMPORT_C static CAknsStringItemData* NewL();
1.793 +
1.794 + /**
1.795 + * Destructor.
1.796 + * Destroys owned string instance.
1.797 + */
1.798 + virtual ~CAknsStringItemData();
1.799 +
1.800 + public: // New functions
1.801 +
1.802 + /**
1.803 + * Sets the string value of this item data instance.
1.804 + *
1.805 + * @since 2.6
1.806 + *
1.807 + * @param aValue New value. The value is copied to a newly created
1.808 + * internal buffer, and any previous value is discarded.
1.809 + */
1.810 + IMPORT_C void SetStringL( const TDesC& aValue );
1.811 +
1.812 + /**
1.813 + * Returns a reference to the string value. The value is still owned
1.814 + * by the item data object and caller must take its lifetime properly
1.815 + * into account.
1.816 + *
1.817 + * @since 2.6
1.818 + *
1.819 + * @return Reference to the value.
1.820 + */
1.821 + IMPORT_C const TDesC& String() const;
1.822 +
1.823 + protected: // C++ protected constructor
1.824 +
1.825 + /**
1.826 + * C++ protected constructor.
1.827 + * Constructs a new CAknsStringItemData without an array.
1.828 + *
1.829 + * @param aType Item type of the new item data object. While this
1.830 + * is always ::EAknsITString for instances of this class, derived
1.831 + * classes may specify another value.
1.832 + *
1.833 + * @internal
1.834 + */
1.835 + CAknsStringItemData( const TAknsItemType aType );
1.836 +
1.837 + protected: // Data
1.838 +
1.839 + HBufC* iString; //!< Buffer for string value.
1.840 +
1.841 + };
1.842 +
1.843 +/**
1.844 +* Effect command data class.
1.845 +* Effect command class encapsulates the information of a single effect
1.846 +* command that is used with effect queue item data objects.
1.847 +*
1.848 +* This is a public class with exported functions.
1.849 +* The class is not intended for derivation outside the library.
1.850 +*
1.851 +* @lib AknSkins.lib
1.852 +*
1.853 +* @since 2.8
1.854 +*/
1.855 +NONSHARABLE_CLASS(CAknsEffectCommand) : public CBase
1.856 + {
1.857 + public: // Constructors and destructor
1.858 +
1.859 + /**
1.860 + * Two-phased constructor.
1.861 + *
1.862 + * @return Newly constructed object.
1.863 + *
1.864 + * @par Exceptions:
1.865 + * If allocation fails, function leaves with a system-wide error
1.866 + * code.
1.867 + */
1.868 + IMPORT_C static CAknsEffectCommand* NewL();
1.869 +
1.870 + /**
1.871 + * Destructor.
1.872 + */
1.873 + virtual ~CAknsEffectCommand();
1.874 +
1.875 + public: // New functions
1.876 +
1.877 + /**
1.878 + * Sets the effect UID.
1.879 + *
1.880 + * @since 2.8
1.881 + *
1.882 + * @param aValue New effect UID.
1.883 + */
1.884 + IMPORT_C void SetEffectUid( const TUid aValue );
1.885 +
1.886 + /**
1.887 + * Returns the effect UID.
1.888 + *
1.889 + * @since 2.8
1.890 + *
1.891 + * @return Effect UID.
1.892 + */
1.893 + IMPORT_C TUid EffectUid() const;
1.894 +
1.895 + /**
1.896 + * Sets the layer configuration.
1.897 + *
1.898 + * @since 2.8
1.899 + *
1.900 + * @param aValue New layer configuration.
1.901 + */
1.902 + IMPORT_C void SetLayerConf( const TAknsRlRenderOpParam aValue );
1.903 +
1.904 + /**
1.905 + * Returns the layer configuration.
1.906 + *
1.907 + * @since 2.8
1.908 + *
1.909 + * @return Layer configuration.
1.910 + */
1.911 + IMPORT_C TAknsRlRenderOpParam LayerConf() const;
1.912 +
1.913 + /**
1.914 + * Appends a paramater to this effect command.
1.915 + *
1.916 + * @since 2.8
1.917 + *
1.918 + * @param aParameter Parameter to be appended. The given data is copied,
1.919 + * and thus no ownership is transferred.
1.920 + */
1.921 + IMPORT_C void AppendParameterL(
1.922 + const TAknsRlParameterData& aParameter );
1.923 +
1.924 + /**
1.925 + * Creates and returns a new parameter iterator.
1.926 + *
1.927 + * @since 2.8
1.928 + *
1.929 + * @return A new parameter iterator. Multiple iterators can be created.
1.930 + * The ownership of the iterator is transferred to the caller, and
1.931 + * the caller must ensure that the lifetime of the iterator
1.932 + * does not exceed the lifetime of this object.
1.933 + */
1.934 + IMPORT_C MAknsRlParameterIterator* CreateParameterIteratorL();
1.935 +
1.936 + protected: // C++ protected constructor
1.937 +
1.938 + /**
1.939 + * C++ protected constructor.
1.940 + *
1.941 + * @internal
1.942 + */
1.943 + CAknsEffectCommand();
1.944 +
1.945 + protected: // Data
1.946 +
1.947 + TUid iUid; //!< Effect UID.
1.948 + TAknsRlRenderOpParam iLayerConf; //!< Layer configuration.
1.949 + RPointerArray<CAknsEffectParameter> iParameters; //!< Parameters array.
1.950 +
1.951 + };
1.952 +
1.953 +/**
1.954 +* Effect queue item data.
1.955 +* Effect queue item data contains (in addition to base class members),
1.956 +* the information required to render a single effect queue based
1.957 +* skin element.
1.958 +*
1.959 +* Item type for effect queue item data objects is always ::EAknsITEffectQueue.
1.960 +*
1.961 +* This is a public class with exported functions.
1.962 +* The class is not intended for derivation outside the library.
1.963 +*
1.964 +* @lib AknSkins.lib
1.965 +*
1.966 +* @since 2.8
1.967 +*/
1.968 +NONSHARABLE_CLASS(CAknsEffectQueueItemData) : public CAknsItemData
1.969 + {
1.970 + public: // Constructors and destructor
1.971 +
1.972 + /**
1.973 + * Two-phased constructor.
1.974 + * Constructs a new CAknsEffectQueueItemData object.
1.975 + *
1.976 + * @return Newly constructed CAknsEffectQueueItemData object.
1.977 + *
1.978 + * @par Exceptions:
1.979 + * If allocation fails, function leaves with a system-wide error
1.980 + * code.
1.981 + */
1.982 + IMPORT_C static CAknsEffectQueueItemData* NewL();
1.983 +
1.984 + /**
1.985 + * Destructor.
1.986 + */
1.987 + virtual ~CAknsEffectQueueItemData();
1.988 +
1.989 + public: // New functions
1.990 +
1.991 + /**
1.992 + * Sets the referenced item ID.
1.993 + *
1.994 + * @since 2.8
1.995 + *
1.996 + * @param aValue
1.997 + */
1.998 + IMPORT_C void SetRefItem( const TAknsItemID aValue );
1.999 +
1.1000 + /**
1.1001 + * Returns the referenced item ID.
1.1002 + *
1.1003 + * @since 2.8
1.1004 + *
1.1005 + * @return Referenced item ID, or @c KAknsIIDDefault if none.
1.1006 + */
1.1007 + IMPORT_C TAknsItemID RefItem() const;
1.1008 +
1.1009 + /**
1.1010 + * Sets the input layer index value.
1.1011 + *
1.1012 + * @since 2.8
1.1013 + *
1.1014 + * @param aValue
1.1015 + */
1.1016 + IMPORT_C void SetInputLayer( const TInt aValue );
1.1017 +
1.1018 + /**
1.1019 + * Returns the input layer index value.
1.1020 + *
1.1021 + * @since 2.8
1.1022 + *
1.1023 + * @return Input layer index, or -1 if not used.
1.1024 + */
1.1025 + IMPORT_C TInt InputLayer() const;
1.1026 +
1.1027 + /**
1.1028 + * Sets the input layer mode value.
1.1029 + *
1.1030 + * @since 2.8
1.1031 + *
1.1032 + * @param aValue
1.1033 + */
1.1034 + IMPORT_C void SetInputLayerMode( const TInt aValue );
1.1035 +
1.1036 + /**
1.1037 + * Returns the input layer mode value.
1.1038 + *
1.1039 + * @since 2.8
1.1040 + *
1.1041 + * @return Input layer mode.
1.1042 + */
1.1043 + IMPORT_C TInt InputLayerMode() const;
1.1044 +
1.1045 + /**
1.1046 + * Sets the output layer index value.
1.1047 + *
1.1048 + * @since 2.8
1.1049 + *
1.1050 + * @param aValue
1.1051 + */
1.1052 + IMPORT_C void SetOutputLayer( const TInt aValue );
1.1053 +
1.1054 + /**
1.1055 + * Returns the output layer index value.
1.1056 + *
1.1057 + * @since 2.8
1.1058 + *
1.1059 + * @return Output layer index.
1.1060 + */
1.1061 + IMPORT_C TInt OutputLayer() const;
1.1062 +
1.1063 + /**
1.1064 + * Sets the output layer mode value.
1.1065 + *
1.1066 + * @since 2.8
1.1067 + *
1.1068 + * @param aValue
1.1069 + */
1.1070 + IMPORT_C void SetOutputLayerMode( const TInt aValue );
1.1071 +
1.1072 + /**
1.1073 + * Returns the output layer mode value.
1.1074 + *
1.1075 + * @since 2.8
1.1076 + *
1.1077 + * @return Output layer mode.
1.1078 + */
1.1079 + IMPORT_C TInt OutputLayerMode() const;
1.1080 +
1.1081 + /**
1.1082 + * Appends a command to this effect queue.
1.1083 + *
1.1084 + * @since 2.8
1.1085 + *
1.1086 + * @param aCommand Command to be appended. The ownership of the
1.1087 + * given instance is transferred to this object, even if the method
1.1088 + * leaves.
1.1089 + */
1.1090 + IMPORT_C void AppendCommandL( const CAknsEffectCommand* aCommand );
1.1091 +
1.1092 + /**
1.1093 + * Creates and returns a new command iterator.
1.1094 + *
1.1095 + * @since 2.8
1.1096 + *
1.1097 + * @return A new command iterator. Multiple iterators can be created.
1.1098 + * The ownership of the iterator is transferred to the caller, and
1.1099 + * the caller must ensure that the lifetime of the iterator
1.1100 + * does not exceed the lifetime of this object.
1.1101 + */
1.1102 + IMPORT_C MAknsRlCommandIterator* CreateCommandIteratorL();
1.1103 +
1.1104 + protected: // C++ protected constructor
1.1105 +
1.1106 + /**
1.1107 + * C++ protected constructor.
1.1108 + * Constructs a new CAknsEffectQueueItemData.
1.1109 + *
1.1110 + * @param aType Item type of the new item data object. While this
1.1111 + * is always ::EAknsITEffectQueue for instances of this class, derived
1.1112 + * classes may specify another value.
1.1113 + *
1.1114 + * @internal
1.1115 + */
1.1116 + CAknsEffectQueueItemData( const TAknsItemType aType );
1.1117 +
1.1118 + protected: // Data
1.1119 +
1.1120 + TAknsItemID iRefId; //!< Referenced item ID.
1.1121 + TInt iInputLayer; //!< Input layer value.
1.1122 + TInt iInputLayerMode; //!< Input layer mode value.
1.1123 + TInt iOutputLayer; //!< Output layer value.
1.1124 + TInt iOutputLayerMode; //!< Output layer mode value.
1.1125 + RPointerArray<CAknsEffectCommand> iCommands; //!< Commands array.
1.1126 +
1.1127 + };
1.1128 +
1.1129 +/**
1.1130 +* Timing model data class.
1.1131 +* Timing model class encapsulates the information of a single timing model that
1.1132 +* is used with animation command item data objects.
1.1133 +*
1.1134 +* The class is not intended for derivation outside the library.
1.1135 +*
1.1136 +* @lib AknSkins.lib
1.1137 +*
1.1138 +* @since 3.0
1.1139 +*/
1.1140 +class CAknsTimingModel: public CBase
1.1141 + {
1.1142 + public: // Constructors and destructor
1.1143 + static CAknsTimingModel* NewL();
1.1144 + virtual ~CAknsTimingModel();
1.1145 +
1.1146 + protected: // C++ protected constructor
1.1147 + CAknsTimingModel();
1.1148 +
1.1149 + public:
1.1150 + void SetTimingModelUid( const TUid aValue );
1.1151 + TUid TimingModelUid() const;
1.1152 +
1.1153 + void AppendParameterL( const TAknsRlParameterData& aParameter );
1.1154 + MAknsRlParameterIterator* CreateParameterIteratorL();
1.1155 +
1.1156 + public: // Iteration support (internal)
1.1157 + void AssignOutL( TAknsAlTimingModelData& aData );
1.1158 +
1.1159 + static void InitializeOut( TAknsAlTimingModelData& aData );
1.1160 + static void ReleaseOut( TAknsAlTimingModelData& aData );
1.1161 +
1.1162 + private: // Data
1.1163 + TUid iTimingModelUid;
1.1164 + RPointerArray<CAknsEffectParameter> iParameters;
1.1165 + };
1.1166 +
1.1167 +/**
1.1168 +* Animation value data class.
1.1169 +* Animation value class encapsulates the information of a single animation
1.1170 +* value (animation value uid, parameters for animation value and timing model
1.1171 +* reference id) that is used with animation command item data objects.
1.1172 +*
1.1173 +* The class is not intended for derivation outside the library.
1.1174 +*
1.1175 +* @lib AknSkins.lib
1.1176 +*
1.1177 +* @since 3.0
1.1178 +*/
1.1179 +class CAknsAnimationValue: public CBase
1.1180 + {
1.1181 + public:
1.1182 + static CAknsAnimationValue* NewL();
1.1183 + virtual ~CAknsAnimationValue();
1.1184 +
1.1185 + private:
1.1186 + CAknsAnimationValue();
1.1187 +
1.1188 + public:
1.1189 + void SetAnimationValueUid( const TUid aValue );
1.1190 + TUid AnimationValueUid() const;
1.1191 +
1.1192 + void SetTimingModelId( const TInt aId );
1.1193 + TInt TimingModelId() const;
1.1194 +
1.1195 + void AppendParameterL( const TAknsRlParameterData& aParameter );
1.1196 + MAknsRlParameterIterator* CreateParameterIteratorL();
1.1197 +
1.1198 + public: // Iteration support (internal)
1.1199 + void AssignOutL( TAknsAlAnimationValueData& aData );
1.1200 +
1.1201 + static void InitializeOut( TAknsAlAnimationValueData& aData );
1.1202 + static void ReleaseOut( TAknsAlAnimationValueData& aData );
1.1203 +
1.1204 + private:
1.1205 + TInt iTimingModelId;
1.1206 + TUid iAnimationValueUid;
1.1207 + RPointerArray<CAknsEffectParameter> iParameters;
1.1208 + };
1.1209 +
1.1210 +/**
1.1211 +* Animation command data class.
1.1212 +* Animation command class encapsulates the information of a single animation
1.1213 +* command (in addition to base class members) that is used with animation item
1.1214 +* data objects.
1.1215 +*
1.1216 +* The class is not intended for derivation outside the library.
1.1217 +*
1.1218 +* @lib AknSkins.lib
1.1219 +*
1.1220 +* @since 3.0
1.1221 +*/
1.1222 +class CAknsAnimationCommand: public CAknsEffectCommand
1.1223 + {
1.1224 + public:
1.1225 + static CAknsAnimationCommand* NewL();
1.1226 + virtual ~CAknsAnimationCommand();
1.1227 +
1.1228 + private:
1.1229 + CAknsAnimationCommand();
1.1230 +
1.1231 + public:
1.1232 + void AppendNamedReferenceL( const TAknsAlNamedReferenceData& aData );
1.1233 + MAknsAlIterator* CreateNamedReferenceIteratorL();
1.1234 +
1.1235 + public: // Iteration support (internal)
1.1236 + void AssignOutL( TAknsAlAnimationCommandData& aData );
1.1237 +
1.1238 + static void InitializeOut( TAknsAlAnimationCommandData& aData );
1.1239 + static void ReleaseOut( TAknsAlAnimationCommandData& aData );
1.1240 +
1.1241 + private:
1.1242 + RPointerArray<CAknsNamedReference> iNamedReferences;
1.1243 + };
1.1244 +
1.1245 +/**
1.1246 +* Animation item data.
1.1247 +* Animation item data contains (in addition to base class members) the
1.1248 +* information required to create an AnimationLibrary animation.
1.1249 +*
1.1250 +* Item type for animation item data objects is always ::EAknsITAnimation.
1.1251 +*
1.1252 +* The class is not intended for derivation outside the library.
1.1253 +*
1.1254 +* @lib AknSkins.lib
1.1255 +*
1.1256 +* @since 3.0
1.1257 +*/
1.1258 +class CAknsAnimationItemData: public CAknsItemData
1.1259 + {
1.1260 + public:
1.1261 + static CAknsAnimationItemData* NewL();
1.1262 + virtual ~CAknsAnimationItemData();
1.1263 +
1.1264 + protected: // C++ protected constructor
1.1265 + CAknsAnimationItemData();
1.1266 +
1.1267 + public: // New functions
1.1268 + void SetMinInterval( TInt aMin );
1.1269 + TInt MinInterval() const;
1.1270 +
1.1271 + void SetMorphing( TBool aMorphing );
1.1272 + TBool Morphing() const;
1.1273 +
1.1274 + void SetInputLayer( const TInt aValue );
1.1275 + TInt InputLayer() const;
1.1276 +
1.1277 + void SetInputLayerMode( const TInt aValue );
1.1278 + TInt InputLayerMode() const;
1.1279 +
1.1280 + void SetOutputLayer( const TInt aValue );
1.1281 + TInt OutputLayer() const;
1.1282 +
1.1283 + void SetOutputLayerMode( const TInt aValue );
1.1284 + TInt OutputLayerMode() const;
1.1285 +
1.1286 + /**
1.1287 + * @param aCommand Ownership is transferred
1.1288 + */
1.1289 + void AppendPreprocessCommandL( CAknsEffectCommand* aCommand );
1.1290 + MAknsRlCommandIterator* PreprocessCommandIteratorL() const;
1.1291 +
1.1292 + /**
1.1293 + * @param aCommand Ownership is transferred
1.1294 + */
1.1295 + void AppendCommandL( CAknsAnimationCommand* aCommand );
1.1296 + MAknsAlIterator* CommandIteratorL() const;
1.1297 +
1.1298 + /**
1.1299 + * @param aValue Ownership is transferred
1.1300 + */
1.1301 + void AppendTimingModelL( CAknsTimingModel* aModel );
1.1302 + MAknsAlIterator* TimingModelIteratorL() const;
1.1303 +
1.1304 + /**
1.1305 + * @param aValue Ownership is transferred
1.1306 + */
1.1307 + void AppendAnimationValueL( CAknsAnimationValue* aValue );
1.1308 + MAknsAlIterator* AnimationValueIteratorL() const;
1.1309 +
1.1310 + void AppendSizeBoundParamL( const TAknsAlSizeBoundParameterData& aParam );
1.1311 + MAknsAlIterator* SizeBoundParamIteratorL() const;
1.1312 +
1.1313 + private:
1.1314 + TInt iMinInterval; // In milliseconds
1.1315 + TBool iMorphing;
1.1316 +
1.1317 + TInt iInputLayer;
1.1318 + TInt iInputLayerMode;
1.1319 + TInt iOutputLayer;
1.1320 + TInt iOutputLayerMode;
1.1321 +
1.1322 + RPointerArray<CAknsEffectCommand> iPreprocessCommands;
1.1323 + RPointerArray<CAknsAnimationCommand> iAnimationCommands;
1.1324 + RPointerArray<CAknsTimingModel> iTimingModels;
1.1325 + RPointerArray<CAknsAnimationValue> iAnimationValues;
1.1326 + RPointerArray<CAknsSizeBoundParameter> iSizeBoundParams;
1.1327 + };
1.1328 +
1.1329 +#endif // AKNSITEMDATA_H
1.1330 +
1.1331 +// End of File