uiresources_pub/skins_api/inc/AknsLayeredBackgroundControlContext.h
changeset 0 05e9090e2422
equal deleted inserted replaced
-1:000000000000 0:05e9090e2422
       
     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 a concrete public class 
       
    15 *                CAknsLayeredBackgroundControlContext.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef AKNSLAYEREDBACKGROUNDCONTROLCONTEXT_H
       
    21 #define AKNSLAYEREDBACKGROUNDCONTROLCONTEXT_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <AknsBasicBackgroundControlContext.h>
       
    25 
       
    26 // CLASS DECLARATION
       
    27 
       
    28 /**
       
    29 *  Implementation of a control context that provides one or more layered
       
    30 *  backgrounds with their layout rectangles.
       
    31 *
       
    32 *  This is a public class with exported functions.
       
    33 *  The class is not intended for derivation outside the library.
       
    34 *
       
    35 *  @lib AknSkins.lib
       
    36 *
       
    37 *  @since 2.0
       
    38 */
       
    39 NONSHARABLE_CLASS(CAknsLayeredBackgroundControlContext) : 
       
    40     public CAknsBasicBackgroundControlContext
       
    41     {
       
    42     public:  // Constructors and destructor
       
    43         
       
    44         /**
       
    45         * Two-phased constructor.
       
    46         *
       
    47         * @since 2.0
       
    48         *
       
    49         * @param aImageID Item ID of the first background bitmap.
       
    50         *
       
    51         * @param aRect Rectangle where the first bitmap should be laid out.
       
    52         *
       
    53         * @param aParentAbsolute ETrue if parent absolute layout should be
       
    54         *   used, EFalse otherwise. If a parent absolute layout is used,
       
    55         *   the parent position must be set and updated using SetParentPos.
       
    56         *
       
    57         * @param aNumberOfLayers Total number of layers as an integer.
       
    58         *   This must be 1 or more.
       
    59         *
       
    60         * @return Newly constructed object.
       
    61         */
       
    62         IMPORT_C static CAknsLayeredBackgroundControlContext* NewL(
       
    63             const TAknsItemID& aImageID, const TRect& aRect, 
       
    64             const TBool aParentAbsolute, const TInt aNumberOfLayers );
       
    65         
       
    66         /**
       
    67         * Destructor.
       
    68         */
       
    69         virtual ~CAknsLayeredBackgroundControlContext();
       
    70 
       
    71     public: // New functions
       
    72         
       
    73         /**
       
    74         * Sets the item ID of the specified layer.
       
    75         *
       
    76         * @since 2.0
       
    77         *
       
    78         * @param aLayer Index of the layer, where 0 is the first one.
       
    79         *   The index must be less than aNumberOfLayers given to @c NewL().
       
    80         *
       
    81         * @param aID Item ID of the image.
       
    82         */
       
    83         IMPORT_C void SetLayerImage( const TInt aLayer, 
       
    84             const TAknsItemID& aID );
       
    85 
       
    86         /**
       
    87         * Sets the layout rectangle of the specified layer.
       
    88         *
       
    89         * @since 2.0
       
    90         *
       
    91         * @param aLayer Index of the layer, where 0 is the first one.
       
    92         *   The index must be less than aNumberOfLayers given to @c NewL().
       
    93         *
       
    94         * @param aRect Rectangle where the image should be laid out.
       
    95         */
       
    96         IMPORT_C void SetLayerRect( const TInt aLayer, 
       
    97             const TRect& aRect );
       
    98 
       
    99     public: // From MAknsControlContext
       
   100 
       
   101         /**
       
   102         * @copydoc MAknsControlContext::IsCompatibleWithType
       
   103         */
       
   104         TBool IsCompatibleWithType( const TAknsControlContextType aType ) const;
       
   105 
       
   106     protected:
       
   107 
       
   108         /**
       
   109         * C++ constructor.
       
   110         */
       
   111         CAknsLayeredBackgroundControlContext();
       
   112 
       
   113         /**
       
   114         * Symbian 2nd phase constructor.
       
   115         */
       
   116         void ConstructL( const TRect& aRect, const TBool aParentAbsolute,
       
   117             const TAknsItemID& aImageID, const TInt aNumberOfLayers );
       
   118     
       
   119     protected:  // Data
       
   120         
       
   121         /**
       
   122         * Array of layered layouts.
       
   123         */
       
   124         TAknsBackground* iLayoutArray;
       
   125 
       
   126         /**
       
   127         * Size of the layer array.
       
   128         */
       
   129         TInt iLayoutArraySize;
       
   130 
       
   131     };
       
   132 
       
   133 #endif      // AKNSLAYEREDBACKGROUNDCONTROLCONTEXT_H
       
   134             
       
   135 // End of File