skins/AknSkins/inc/AknsItemDataFactory.h
changeset 0 05e9090e2422
equal deleted inserted replaced
-1:000000000000 0:05e9090e2422
       
     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:  Defines an internal static factory class AknsItemDataFactory.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef AKNSITEMDATAFACTORY_H
       
    20 #define AKNSITEMDATAFACTORY_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <AknsItemData.h>
       
    24 #include <AknsItemDef.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 struct TAknsImageAttributeData;
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32 * Static factory class that creates item data objects based on item definitions.
       
    33 *
       
    34 * This is an internal static class with no exported functions.
       
    35 * The class is not intended for derivation outside the library.
       
    36 *
       
    37 * @since 2.0
       
    38 *
       
    39 * @internal
       
    40 */
       
    41 class AknsItemDataFactory
       
    42     {
       
    43     public: // New functions
       
    44 
       
    45         /**
       
    46         * Creates new item data object specified by given item definition.
       
    47         *
       
    48         * @param aDef Item definition that specifies the item data to be
       
    49         *   constructed.
       
    50         *
       
    51         * @return Newly created item data. Type of the item data matches
       
    52         *   the one of the given item definition and pointer can be
       
    53         *   casted to the corresponding derived type.
       
    54         *
       
    55         * @par Exceptions:
       
    56         *   If construction fails, leaves with an error code.
       
    57         *
       
    58         * @internal
       
    59         */
       
    60         static CAknsItemData* CreateL( const CAknsItemDef* aDef );
       
    61 
       
    62     protected: // New functions
       
    63 
       
    64         /**
       
    65         * Creates a bitmap item data object. This is an internal method used by
       
    66         * AknsItemDataFactory::CreateL() to construct item data objects of type
       
    67         * ::EAknsITBitmap.
       
    68         *
       
    69         * @param aFilename Filename of the MBM file.
       
    70         *
       
    71         * @param aIndex Index of the bitmap in the file.
       
    72         *
       
    73         * @param aAttributes Image attributes.
       
    74         *
       
    75         * @return Newly created bitmap item data object.
       
    76         *
       
    77         * @par Exceptions:
       
    78         *   If construction fails, leaves with an error code.
       
    79         *
       
    80         * @internal
       
    81         */
       
    82         static CAknsBitmapItemData* CreateBitmapL(
       
    83             const TDesC& aFilename, const TInt aIndex,
       
    84             const TAknsImageAttributeData* aAttributes );
       
    85 
       
    86         /**
       
    87         * Creates a masked bitmap item data object. This is an internal method
       
    88         * used by AknsItemDataFactory::CreateL() to construct item data objects
       
    89         * of type ::EAknsITMaskedBitmap.
       
    90         *
       
    91         * @param aFilename Filename of the MBM file.
       
    92         *
       
    93         * @param aIndex Index of the bitmap in the file.
       
    94         *
       
    95         * @param aMaskIndex Index of the bitmap mask in the file.
       
    96         *
       
    97         * @param aAttributes Image attributes.
       
    98         *
       
    99         * @return Newly created masked bitmap item data object.
       
   100         *
       
   101         * @par Exceptions:
       
   102         *   If construction fails, leaves with an error code.
       
   103         *
       
   104         * @internal
       
   105         */
       
   106         static CAknsMaskedBitmapItemData* CreateMaskedBitmapL(
       
   107             const TDesC& aFilename, const TInt aIndex, const TInt aMaskIndex,
       
   108             const TAknsImageAttributeData* aAttributes );
       
   109 
       
   110         /**
       
   111         * Creates a color table item data object. This is an internal method
       
   112         * used by AknsItemDataFactory::CreateL() to construct item data objects
       
   113         * of type ::EAknsITColorTable.
       
   114         *
       
   115         * @param aNumberOfColors Number of colors in color table.
       
   116         *
       
   117         * @param aColors Pointer to the first color.
       
   118         *
       
   119         * @param aAttributes Image attributes.
       
   120         *
       
   121         * @return Newly created color table item data object.
       
   122         *
       
   123         * @par Exceptions:
       
   124         *   If construction fails, leaves with an error code.
       
   125         *
       
   126         * @internal
       
   127         */
       
   128         static CAknsColorTableItemData* CreateColorTableL(
       
   129             const TInt aNumberOfColors, const TAknsColorTableEntry* aColors,
       
   130             const TAknsImageAttributeData* aAttributes );
       
   131 
       
   132         /**
       
   133         * Creates an image table item data object. This is an internal
       
   134         * method used by AknsItemDataFactory::CreateL() to construct item
       
   135         * data objects of type
       
   136         * ::EAknsITImageTable.
       
   137         *
       
   138         * @param aNumberOfImages Number of images in the array.
       
   139         *
       
   140         * @param aImages Pointer to the first image item ID.
       
   141         *
       
   142         * @param aAttributes Image attributes.
       
   143         *
       
   144         * @return Newly created image table item data object.
       
   145         *
       
   146         * @par Exceptions:
       
   147         *   If construction fails, leaves with an error code.
       
   148         *
       
   149         * @internal
       
   150         */
       
   151         static CAknsImageTableItemData* CreateImageTableL(
       
   152             const TInt aNumberOfImages, const TAknsItemID* aImages,
       
   153             const TAknsImageAttributeData* aAttributes );
       
   154 
       
   155         /**
       
   156         * Creates a bitmap animation item data object. This is an internal
       
   157         * method used by AknsItemDataFactory::CreateL() to construct item
       
   158         * data objects of type
       
   159         * ::EAknsITBmpAnim.
       
   160         *
       
   161         * @param aNumberOfImages Number of images in the array.
       
   162         *
       
   163         * @param aImages Pointer to the first image item ID.
       
   164         *
       
   165         * @param aFrameInfos Pointer to the first frame entry.
       
   166         *
       
   167         * @param aLastFrameBg Boolean value.
       
   168         *
       
   169         * @param aFrameInterval TInt16 value.
       
   170         *
       
   171         * @param aPlayMode TInt16 value.
       
   172         *
       
   173         * @param aFlash Boolean value.
       
   174         *
       
   175         * @param aAttributes Image attributes.
       
   176         *
       
   177         * @return Newly created bitmap animation item data object.
       
   178         *
       
   179         * @par Exceptions:
       
   180         *   If construction fails, leaves with an error code.
       
   181         *
       
   182         * @internal
       
   183         */
       
   184         static CAknsBmpAnimItemData* CreateBmpAnimL(
       
   185             const TInt aNumberOfImages, const TAknsItemID* aImages,
       
   186             const TAknsBmpAnimFrameInfo* aFrameInfos,
       
   187             const TBool aLastFrameBg, const TInt16 aFrameInterval,
       
   188             const TInt16 aPlayMode, const TBool aFlash,
       
   189             const TAknsImageAttributeData* aAttributes );
       
   190 
       
   191         /**
       
   192         * Creates a string item data object. This is an internal method
       
   193         * used by AknsItemDataDataFactory::CreateL() to construct item
       
   194         * data objects of type
       
   195         * ::EAknsITString.
       
   196         *
       
   197         * @since 2.6
       
   198         *
       
   199         * @param aString The string value.
       
   200         *
       
   201         * @par Exceptions:
       
   202         *   If construction fails, leaves with an error code.
       
   203         *
       
   204         * @internal
       
   205         */
       
   206         static CAknsStringItemData* CreateStringL(
       
   207             const TDesC& aString );
       
   208 
       
   209         /**
       
   210         * Creates an effect queue item data object. This is an internal method
       
   211         * used by AknsItemDataDataFactory::CreateL() to construct item
       
   212         * data objects of type
       
   213         * ::EAknsITEffectQueue.
       
   214         *
       
   215         * @since 2.8
       
   216         *
       
   217         * @param aDef item definition to base the effect queue item data object.
       
   218         *
       
   219         * @par Exceptions:
       
   220         *   If construction fails, leaves with an error code.
       
   221         *
       
   222         * @internal
       
   223         */
       
   224         static CAknsEffectQueueItemData* CreateEffectQueueL(
       
   225             const CAknsEffectQueueItemDef* aDef );
       
   226 
       
   227         /**
       
   228         * Creates an animation item data object. This is an internal method
       
   229         * used by AknsItemDataDataFactory::CreateL() to construct item data
       
   230         * objects of type
       
   231         * ::EAknsITAnimation.
       
   232         *
       
   233         * @since 3.0
       
   234         *
       
   235         * @par Exceptions:
       
   236         *   If construction fails, leaves with an error code.
       
   237         *
       
   238         * @internal
       
   239         */
       
   240         static CAknsAnimationItemData* CreateAnimationL(
       
   241             const CAknsAnimationItemDef* aDef );
       
   242 
       
   243         /**
       
   244         * Internal utility method for setting image attributes.
       
   245         *
       
   246         * @param aItemData Image item data object.
       
   247         *
       
   248         * @param aAttributes Attributes to be set. If @c NULL is given,
       
   249         *   default attributes are set.
       
   250         */
       
   251         static void SetAttributesL( CAknsImageItemData* aItemData,
       
   252             const TAknsImageAttributeData* aAttributes );
       
   253 
       
   254     private: // Prohibited constructors and destructor
       
   255 
       
   256         // Static class, prohibited.
       
   257         AknsItemDataFactory();
       
   258         // Static class, prohibited.
       
   259         ~AknsItemDataFactory();
       
   260 
       
   261     };
       
   262 
       
   263 #endif // AKNSITEMDATAFACTORY_H
       
   264 
       
   265 // End of File