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 * CAknsListBoxBackgroundControlContext.
20 #ifndef AKNSLISTBOXBACKGROUNDCONTROLCONTEXT_H
21 #define AKNSLISTBOXBACKGROUNDCONTROLCONTEXT_H
24 #include <AknsBasicBackgroundControlContext.h>
29 * Implementation of a control context that provides a layout background with
30 * a background bitmap, its layout rectangle, a secondary bitmap that will
31 * be tiled in its own layout rectangle and third bitmap for the bottom part
32 * with 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(CAknsListBoxBackgroundControlContext) :
42 public CAknsBasicBackgroundControlContext
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 * @param aTiledBitmapID Item ID of the second bitmap that will
60 * be tiled in another layout rectangle.
62 * @param aTiledRect Rectangle where the second bitmap should be
65 * @return Newly constructed object.
67 IMPORT_C static CAknsListBoxBackgroundControlContext* NewL(
68 const TAknsItemID& aImageID, const TRect& aRect,
69 const TBool aParentAbsolute, const TAknsItemID& aTiledBitmapID,
70 const TRect& aTiledRect );
75 virtual ~CAknsListBoxBackgroundControlContext();
77 public: // New functions
80 * Sets the item ID of the tiled bitmap.
84 * @param aID Item ID of the bitmap.
86 IMPORT_C void SetTiledBitmap( const TAknsItemID& aID );
89 * Sets the layout rectangle of the tiled bitmap.
93 * @param aRect Rectangle where the bitmap should be laid out.
95 IMPORT_C void SetTiledRect( const TRect& aRect );
98 * Sets the item ID of the bottom part bitmap.
102 * @param aID Item ID of the bitmap.
104 IMPORT_C void SetBottomBitmap( const TAknsItemID& aID );
107 * Sets the layout rectangle of the bottom part bitmap.
111 * @param aRect Rectangle where the bitmap should be laid out.
113 IMPORT_C void SetBottomRect( const TRect& aRect );
115 public: // From MAknsControlContext
118 * @copydoc MAknsControlContext::IsCompatibleWithType
120 TBool IsCompatibleWithType( const TAknsControlContextType aType ) const;
123 * Updates the control context, if necessary.
124 * This method is called by the framework before drawing with the
127 * Implementation in CAknsListBoxBackgroundControlContext
128 * disables any non-existing levels.
132 * @return Return value reserved for future use. Currently returns 0.
134 TInt UpdateContext();
141 CAknsListBoxBackgroundControlContext();
144 * Symbian 2nd phase constructor.
146 void ConstructL( const TRect& aRect, const TBool aParentAbsolute,
147 const TAknsItemID& aImageID,
148 const TAknsItemID& aTiledBitmapID, const TRect& aTiledRect );
153 * Structure for tiled layout.
155 TAknsBackground* iTiledLayout;
158 * Structure for bottom part layout.
160 TAknsBackground* iBottomLayout;
164 #endif // AKNSLISTBOXBACKGROUNDCONTROLCONTEXT_H