williamr@2: /* williamr@2: * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: Defines a concrete public class williamr@2: * CAknsListBoxBackgroundControlContext. williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef AKNSLISTBOXBACKGROUNDCONTROLCONTEXT_H williamr@2: #define AKNSLISTBOXBACKGROUNDCONTROLCONTEXT_H williamr@2: williamr@2: // INCLUDES williamr@2: #include williamr@2: williamr@2: // CLASS DECLARATION williamr@2: williamr@2: /** williamr@2: * Implementation of a control context that provides a layout background with williamr@2: * a background bitmap, its layout rectangle, a secondary bitmap that will williamr@2: * be tiled in its own layout rectangle and third bitmap for the bottom part williamr@2: * with its layout rectangle. williamr@2: * williamr@2: * This is a public class with exported functions. williamr@2: * The class is not intended for derivation outside the library. williamr@2: * williamr@2: * @lib AknSkins.lib williamr@2: * williamr@2: * @since 2.0 williamr@2: */ williamr@2: NONSHARABLE_CLASS(CAknsListBoxBackgroundControlContext) : williamr@2: public CAknsBasicBackgroundControlContext williamr@2: { williamr@2: public: // Constructors and destructor williamr@2: williamr@2: /** williamr@2: * Two-phased constructor. williamr@2: * williamr@2: * @since 2.0 williamr@2: * williamr@2: * @param aImageID Item ID of the background bitmap. williamr@2: * williamr@2: * @param aRect Rectangle where the bitmap should be laid out. williamr@2: * williamr@2: * @param aParentAbsolute ETrue if parent absolute layout should be williamr@2: * used, EFalse otherwise. If a parent absolute layout is used, williamr@2: * the parent position must be set and updated using SetParentPos. williamr@2: * williamr@2: * @param aTiledBitmapID Item ID of the second bitmap that will williamr@2: * be tiled in another layout rectangle. williamr@2: * williamr@2: * @param aTiledRect Rectangle where the second bitmap should be williamr@2: * tiled to. williamr@2: * williamr@2: * @return Newly constructed object. williamr@2: */ williamr@2: IMPORT_C static CAknsListBoxBackgroundControlContext* NewL( williamr@2: const TAknsItemID& aImageID, const TRect& aRect, williamr@2: const TBool aParentAbsolute, const TAknsItemID& aTiledBitmapID, williamr@2: const TRect& aTiledRect ); williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: virtual ~CAknsListBoxBackgroundControlContext(); williamr@2: williamr@2: public: // New functions williamr@2: williamr@2: /** williamr@2: * Sets the item ID of the tiled bitmap. williamr@2: * williamr@2: * @since 2.0 williamr@2: * williamr@2: * @param aID Item ID of the bitmap. williamr@2: */ williamr@2: IMPORT_C void SetTiledBitmap( const TAknsItemID& aID ); williamr@2: williamr@2: /** williamr@2: * Sets the layout rectangle of the tiled bitmap. williamr@2: * williamr@2: * @since 2.0 williamr@2: * williamr@2: * @param aRect Rectangle where the bitmap should be laid out. williamr@2: */ williamr@2: IMPORT_C void SetTiledRect( const TRect& aRect ); williamr@2: williamr@2: /** williamr@2: * Sets the item ID of the bottom part bitmap. williamr@2: * williamr@2: * @since 2.0 williamr@2: * williamr@2: * @param aID Item ID of the bitmap. williamr@2: */ williamr@2: IMPORT_C void SetBottomBitmap( const TAknsItemID& aID ); williamr@2: williamr@2: /** williamr@2: * Sets the layout rectangle of the bottom part bitmap. williamr@2: * williamr@2: * @since 2.0 williamr@2: * williamr@2: * @param aRect Rectangle where the bitmap should be laid out. williamr@2: */ williamr@2: IMPORT_C void SetBottomRect( const TRect& aRect ); williamr@2: williamr@2: public: // From MAknsControlContext williamr@2: williamr@2: /** williamr@2: * @copydoc MAknsControlContext::IsCompatibleWithType williamr@2: */ williamr@2: TBool IsCompatibleWithType( const TAknsControlContextType aType ) const; williamr@2: williamr@2: /** williamr@2: * Updates the control context, if necessary. williamr@2: * This method is called by the framework before drawing with the williamr@2: * context. williamr@2: * williamr@2: * Implementation in CAknsListBoxBackgroundControlContext williamr@2: * disables any non-existing levels. williamr@2: * williamr@2: * @since 2.8 williamr@2: * williamr@2: * @return Return value reserved for future use. Currently returns 0. williamr@2: */ williamr@2: TInt UpdateContext(); williamr@2: williamr@2: protected: williamr@2: williamr@2: /** williamr@2: * C++ constructor. williamr@2: */ williamr@2: CAknsListBoxBackgroundControlContext(); williamr@2: williamr@2: /** williamr@2: * Symbian 2nd phase constructor. williamr@2: */ williamr@2: void ConstructL( const TRect& aRect, const TBool aParentAbsolute, williamr@2: const TAknsItemID& aImageID, williamr@2: const TAknsItemID& aTiledBitmapID, const TRect& aTiledRect ); williamr@2: williamr@2: protected: // Data williamr@2: williamr@2: /** williamr@2: * Structure for tiled layout. williamr@2: */ williamr@2: TAknsBackground* iTiledLayout; williamr@2: williamr@2: /** williamr@2: * Structure for bottom part layout. williamr@2: */ williamr@2: TAknsBackground* iBottomLayout; williamr@2: williamr@2: }; williamr@2: williamr@2: #endif // AKNSLISTBOXBACKGROUNDCONTROLCONTEXT_H williamr@2: williamr@2: // End of File