2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Defines a concrete public class
15 * CAknsLayeredBackgroundControlContext.
20 #ifndef AKNSLAYEREDBACKGROUNDCONTROLCONTEXT_H
21 #define AKNSLAYEREDBACKGROUNDCONTROLCONTEXT_H
24 #include <AknsBasicBackgroundControlContext.h>
29 * Implementation of a control context that provides one or more layered
30 * backgrounds with their layout rectangles.
32 * This is a public class with exported functions.
33 * The class is not intended for derivation outside the library.
39 NONSHARABLE_CLASS(CAknsLayeredBackgroundControlContext) :
40 public CAknsBasicBackgroundControlContext
42 public: // Constructors and destructor
45 * Two-phased constructor.
49 * @param aImageID Item ID of the first background bitmap.
51 * @param aRect Rectangle where the first bitmap should be laid out.
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.
57 * @param aNumberOfLayers Total number of layers as an integer.
58 * This must be 1 or more.
60 * @return Newly constructed object.
62 IMPORT_C static CAknsLayeredBackgroundControlContext* NewL(
63 const TAknsItemID& aImageID, const TRect& aRect,
64 const TBool aParentAbsolute, const TInt aNumberOfLayers );
69 virtual ~CAknsLayeredBackgroundControlContext();
71 public: // New functions
74 * Sets the item ID of the specified layer.
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().
81 * @param aID Item ID of the image.
83 IMPORT_C void SetLayerImage( const TInt aLayer,
84 const TAknsItemID& aID );
87 * Sets the layout rectangle of the specified layer.
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().
94 * @param aRect Rectangle where the image should be laid out.
96 IMPORT_C void SetLayerRect( const TInt aLayer,
99 public: // From MAknsControlContext
102 * @copydoc MAknsControlContext::IsCompatibleWithType
104 TBool IsCompatibleWithType( const TAknsControlContextType aType ) const;
111 CAknsLayeredBackgroundControlContext();
114 * Symbian 2nd phase constructor.
116 void ConstructL( const TRect& aRect, const TBool aParentAbsolute,
117 const TAknsItemID& aImageID, const TInt aNumberOfLayers );
122 * Array of layered layouts.
124 TAknsBackground* iLayoutArray;
127 * Size of the layer array.
129 TInt iLayoutArraySize;
133 #endif // AKNSLAYEREDBACKGROUNDCONTROLCONTEXT_H