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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Defines a public class CAknsBasicBackgroundControlContext.
19 #ifndef AKNSBASICBACKGROUNDCONTROLCONTEXT_H
20 #define AKNSBASICBACKGROUNDCONTROLCONTEXT_H
23 #include <AknsControlContext.h>
25 // FORWARD DECLARATIONS
26 class TAknsBackground;
31 * Implementation of a control context that provides a layout background with
32 * a background bitmap and its layout rectangle.
34 * This is a public class with exported functions.
35 * The class is not intended for derivation outside the library.
41 NONSHARABLE_CLASS(CAknsBasicBackgroundControlContext) : public CBase,
42 public MAknsControlContext
44 public: // Constructors and destructor
47 * Two-phased constructor.
51 * @param aImageID Item ID of the background bitmap.
53 * @param aRect Rectangle where the bitmap should be laid out.
55 * @param aParentAbsolute ETrue if parent absolute layout should be
56 * used, EFalse otherwise. If a parent absolute layout is used,
57 * the parent position must be set and updated using SetParentPos.
59 * @return Newly constructed object.
61 IMPORT_C static CAknsBasicBackgroundControlContext* NewL(
62 const TAknsItemID& aImageID, const TRect& aRect,
63 TBool aParentAbsolute );
68 virtual ~CAknsBasicBackgroundControlContext();
70 public: // New functions
73 * Sets the item ID of the background bitmap.
77 * @param aID Item ID of the bitmap.
79 IMPORT_C void SetBitmap( const TAknsItemID& aID );
82 * Sets the layout rectangle of the bitmap.
86 * @param aRect Rectangle where the bitmap should be laid out.
88 IMPORT_C void SetRect( const TRect& aRect );
91 * Sets the parent position for the layout. This is only
92 * used if parent absolute layout was enabled during construction.
96 * @param aPos Parent position in screen relative coordinates.
98 IMPORT_C void SetParentPos( const TPoint& aPos );
101 * Sets the parent context (drawn beneath the context itself).
102 * No ownership is claimed. The parent context object must be
103 * valid as long as it is set as parent context.
107 * @param aParentContext Pointer to the parent context, or
108 * @c NULL (default value) if none used.
110 IMPORT_C void SetParentContext( MAknsControlContext* aParentContext );
112 public: // Functions from MAknsControlContext
115 * @copydoc MAknsControlContext::SupplySkinParameter
117 TInt SupplySkinParameter( TAknsCCParameter aParam );
120 * @copydoc MAknsControlContext::SupplySkinObject
122 TAny* SupplySkinObject( TAknsCCObject aObject );
125 * @copydoc MAknsControlContext::IsCompatibleWithType
127 TBool IsCompatibleWithType( const TAknsControlContextType aType ) const;
134 CAknsBasicBackgroundControlContext();
137 * Symbian 2nd phase constructor.
139 void ConstructL( const TRect& aRect, TBool aParentAbsolute,
140 const TAknsItemID& aImageID );
144 TAknsBackground* iLayout; //<! Background layout structure.
145 MAknsControlContext* iParentContext; //<! Parent context (not owned).
149 #endif // AKNSBASICBACKGROUNDCONTROLCONTEXT_H