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