epoc32/include/mw/aknsbasicbackgroundcontrolcontext.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 aknsbasicbackgroundcontrolcontext.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 public class CAknsBasicBackgroundControlContext.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef AKNSBASICBACKGROUNDCONTROLCONTEXT_H
       
    20 #define AKNSBASICBACKGROUNDCONTROLCONTEXT_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <AknsControlContext.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class TAknsBackground;
       
    27 
       
    28 // CLASS DECLARATION
       
    29 
       
    30 /**
       
    31 *  Implementation of a control context that provides a layout background with
       
    32 *  a background bitmap and 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(CAknsBasicBackgroundControlContext) : public CBase, 
       
    42     public MAknsControlContext
       
    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         * @return Newly constructed object.
       
    60         */
       
    61         IMPORT_C static CAknsBasicBackgroundControlContext* NewL(
       
    62             const TAknsItemID& aImageID, const TRect& aRect, 
       
    63             TBool aParentAbsolute );
       
    64         
       
    65         /**
       
    66         * Destructor.
       
    67         */
       
    68         virtual ~CAknsBasicBackgroundControlContext();
       
    69 
       
    70     public: // New functions
       
    71         
       
    72         /**
       
    73         * Sets the item ID of the background bitmap.
       
    74         *
       
    75         * @since 2.0
       
    76         *
       
    77         * @param aID Item ID of the bitmap.
       
    78         */
       
    79         IMPORT_C void SetBitmap( const TAknsItemID& aID );
       
    80 
       
    81         /**
       
    82         * Sets the layout rectangle of the bitmap.
       
    83         *
       
    84         * @since 2.0
       
    85         *
       
    86         * @param aRect Rectangle where the bitmap should be laid out.
       
    87         */
       
    88         IMPORT_C void SetRect( const TRect& aRect );
       
    89 
       
    90         /**
       
    91         * Sets the parent position for the layout. This is only
       
    92         * used if parent absolute layout was enabled during construction.
       
    93         *
       
    94         * @since 2.0
       
    95         *
       
    96         * @param aPos Parent position in screen relative coordinates.
       
    97         */
       
    98         IMPORT_C void SetParentPos( const TPoint& aPos );
       
    99 
       
   100         /**
       
   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.
       
   104         *
       
   105         * @since 2.6
       
   106         *
       
   107         * @param aParentContext Pointer to the parent context, or
       
   108         *   @c NULL (default value) if none used.
       
   109         */
       
   110         IMPORT_C void SetParentContext( MAknsControlContext* aParentContext );
       
   111 
       
   112     public: // Functions from MAknsControlContext
       
   113         
       
   114         /**
       
   115         * @copydoc MAknsControlContext::SupplySkinParameter
       
   116         */
       
   117         TInt SupplySkinParameter( TAknsCCParameter aParam );
       
   118 
       
   119         /**
       
   120         * @copydoc MAknsControlContext::SupplySkinObject
       
   121         */
       
   122         TAny* SupplySkinObject( TAknsCCObject aObject );
       
   123 
       
   124         /**
       
   125         * @copydoc MAknsControlContext::IsCompatibleWithType
       
   126         */
       
   127         TBool IsCompatibleWithType( const TAknsControlContextType aType ) const;
       
   128         
       
   129     protected:
       
   130 
       
   131         /**
       
   132         * C++ constructor.
       
   133         */
       
   134         CAknsBasicBackgroundControlContext();
       
   135 
       
   136         /**
       
   137         * Symbian 2nd phase constructor.
       
   138         */
       
   139         void ConstructL( const TRect& aRect, TBool aParentAbsolute,
       
   140             const TAknsItemID& aImageID );
       
   141     
       
   142     protected:  // Data
       
   143         
       
   144         TAknsBackground* iLayout; //<! Background layout structure.
       
   145         MAknsControlContext* iParentContext; //<! Parent context (not owned).
       
   146 
       
   147     };
       
   148 
       
   149 #endif      // AKNSBASICBACKGROUNDCONTROLCONTEXT_H
       
   150             
       
   151 // End of File