epoc32/include/mw/aknslistboxbackgroundcontrolcontext.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 aknslistboxbackgroundcontrolcontext.h
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Defines a concrete public class 
       
    15 *                CAknsListBoxBackgroundControlContext.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef AKNSLISTBOXBACKGROUNDCONTROLCONTEXT_H
       
    21 #define AKNSLISTBOXBACKGROUNDCONTROLCONTEXT_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <AknsBasicBackgroundControlContext.h>
       
    25 
       
    26 // CLASS DECLARATION
       
    27 
       
    28 /**
       
    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.
       
    33 *
       
    34 *  This is a public class with exported functions.
       
    35 *  The class is not intended for derivation outside the library.
       
    36 *
       
    37 *  @lib AknSkins.lib
       
    38 *
       
    39 *  @since 2.0
       
    40 */
       
    41 NONSHARABLE_CLASS(CAknsListBoxBackgroundControlContext) : 
       
    42     public CAknsBasicBackgroundControlContext
       
    43     {
       
    44     public:  // Constructors and destructor
       
    45         
       
    46         /**
       
    47         * Two-phased constructor.
       
    48         *
       
    49         * @since 2.0
       
    50         *
       
    51         * @param aImageID Item ID of the background bitmap.
       
    52         *
       
    53         * @param aRect Rectangle where the bitmap should be laid out.
       
    54         *
       
    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.
       
    58         *
       
    59         * @param aTiledBitmapID Item ID of the second bitmap that will
       
    60         *   be tiled in another layout rectangle.
       
    61         *
       
    62         * @param aTiledRect Rectangle where the second bitmap should be
       
    63         *   tiled to.
       
    64         *
       
    65         * @return Newly constructed object.
       
    66         */
       
    67         IMPORT_C static CAknsListBoxBackgroundControlContext* NewL(
       
    68             const TAknsItemID& aImageID, const TRect& aRect, 
       
    69             const TBool aParentAbsolute, const TAknsItemID& aTiledBitmapID,
       
    70             const TRect& aTiledRect );
       
    71         
       
    72         /**
       
    73         * Destructor.
       
    74         */
       
    75         virtual ~CAknsListBoxBackgroundControlContext();
       
    76 
       
    77     public: // New functions
       
    78         
       
    79         /**
       
    80         * Sets the item ID of the tiled bitmap.
       
    81         *
       
    82         * @since 2.0
       
    83         *
       
    84         * @param aID Item ID of the bitmap.
       
    85         */
       
    86         IMPORT_C void SetTiledBitmap( const TAknsItemID& aID );
       
    87 
       
    88         /**
       
    89         * Sets the layout rectangle of the tiled bitmap.
       
    90         *
       
    91         * @since 2.0
       
    92         *
       
    93         * @param aRect Rectangle where the bitmap should be laid out.
       
    94         */
       
    95         IMPORT_C void SetTiledRect( const TRect& aRect );
       
    96 
       
    97         /**
       
    98         * Sets the item ID of the bottom part bitmap.
       
    99         *
       
   100         * @since 2.0
       
   101         *
       
   102         * @param aID Item ID of the bitmap.
       
   103         */
       
   104         IMPORT_C void SetBottomBitmap( const TAknsItemID& aID );
       
   105 
       
   106         /**
       
   107         * Sets the layout rectangle of the bottom part bitmap.
       
   108         *
       
   109         * @since 2.0
       
   110         *
       
   111         * @param aRect Rectangle where the bitmap should be laid out.
       
   112         */
       
   113         IMPORT_C void SetBottomRect( const TRect& aRect );
       
   114 
       
   115     public: // From MAknsControlContext
       
   116 
       
   117         /**
       
   118         * @copydoc MAknsControlContext::IsCompatibleWithType
       
   119         */
       
   120         TBool IsCompatibleWithType( const TAknsControlContextType aType ) const;
       
   121 
       
   122         /**
       
   123         * Updates the control context, if necessary.
       
   124         * This method is called by the framework before drawing with the 
       
   125         * context.
       
   126         *
       
   127         * Implementation in CAknsListBoxBackgroundControlContext 
       
   128         * disables any non-existing levels.
       
   129         *
       
   130         * @since 2.8
       
   131         *
       
   132         * @return Return value reserved for future use. Currently returns 0.
       
   133         */
       
   134         TInt UpdateContext();
       
   135         
       
   136     protected:
       
   137 
       
   138         /**
       
   139         * C++ constructor.
       
   140         */
       
   141         CAknsListBoxBackgroundControlContext();
       
   142 
       
   143         /**
       
   144         * Symbian 2nd phase constructor.
       
   145         */
       
   146         void ConstructL( const TRect& aRect, const TBool aParentAbsolute,
       
   147             const TAknsItemID& aImageID,
       
   148             const TAknsItemID& aTiledBitmapID, const TRect& aTiledRect );
       
   149     
       
   150     protected:  // Data
       
   151         
       
   152         /**
       
   153         * Structure for tiled layout.
       
   154         */
       
   155         TAknsBackground* iTiledLayout;
       
   156 
       
   157         /**
       
   158         * Structure for bottom part layout.
       
   159         */
       
   160         TAknsBackground* iBottomLayout;
       
   161 
       
   162     };
       
   163 
       
   164 #endif      // AKNSLISTBOXBACKGROUNDCONTROLCONTEXT_H
       
   165             
       
   166 // End of File