epoc32/include/mw/AknsFrameBackgroundControlContext.h
branchSymbian3
changeset 4 837f303aceeb
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
       
     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 "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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Defines a concrete public class 
       
    15 *                CAknsFrameBackgroundControlContext.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef AKNSFRAMEBACKGROUNDCONTROLCONTEXT_H
       
    21 #define AKNSFRAMEBACKGROUNDCONTROLCONTEXT_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <AknsLayeredBackgroundControlContext.h>
       
    25 
       
    26 // CLASS DECLARATION
       
    27 
       
    28 /**
       
    29 *  Implementation of a control context that provides a layout background 
       
    30 *  generated from a frame item.
       
    31 *
       
    32 *  This is a public class with exported functions.
       
    33 *  The class is not intended for derivation outside the library.
       
    34 *
       
    35 *  @lib AknSkins.lib
       
    36 *
       
    37 *  @since 2.0
       
    38 */
       
    39 NONSHARABLE_CLASS(CAknsFrameBackgroundControlContext) : 
       
    40     public CAknsLayeredBackgroundControlContext
       
    41     {
       
    42     public:  // Constructors and destructor
       
    43         
       
    44         /**
       
    45         * Two-phased constructor.
       
    46         *
       
    47         * @since 2.0
       
    48         *
       
    49         * @param aFrameID Item ID of the entire frame.
       
    50         *
       
    51         * @param aOuterRect Outer rectangle of the frame.
       
    52         *
       
    53         * @param aInnerRect Inner rectangle of the frame.
       
    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 CAknsFrameBackgroundControlContext* NewL(
       
    62             const TAknsItemID& aFrameID, const TRect& aOuterRect, 
       
    63             const TRect& aInnerRect, const TBool aParentAbsolute );
       
    64         
       
    65         /**
       
    66         * Destructor.
       
    67         */
       
    68         virtual ~CAknsFrameBackgroundControlContext();
       
    69 
       
    70     public: // New functions
       
    71         
       
    72         /**
       
    73         * Reconstructs the entire frame from the given item ID.
       
    74         *
       
    75         * @since 2.0
       
    76         *
       
    77         * @param aID Item ID of the entire frame.
       
    78         */
       
    79         IMPORT_C void SetFrame( const TAknsItemID& aFrameID );
       
    80 
       
    81         /**
       
    82         * Sets the outer and the inner rectangles of the frame. 
       
    83         *
       
    84         * @since 2.0
       
    85         *
       
    86         * @param aOuterRect The outer rectangle of the frame.
       
    87         *
       
    88         * @param aInnerRect The inner rectangle of the frame.
       
    89         */
       
    90         IMPORT_C void SetFrameRects( const TRect& aOuterRect, 
       
    91             const TRect& aInnerRect );
       
    92 
       
    93         /**
       
    94         * Overrides the center part of the frame.
       
    95         *
       
    96         * @since 2.0
       
    97         *
       
    98         * @param aID Item ID of the center part to be used.
       
    99         */
       
   100         IMPORT_C void SetCenter( const TAknsItemID& aID );
       
   101 
       
   102         /**
       
   103         * Sets the rectangle of a single part of the frame.
       
   104         *
       
   105         * @since 2.0
       
   106         *
       
   107         * @param aRect Rectangle of the specific part of the frame.
       
   108         *
       
   109         * @param aFrameElement Element (index) of the frame element 
       
   110         *   to which the rectangle is applied.
       
   111         *
       
   112         */
       
   113         IMPORT_C void SetFramePartRect( const TRect& aRect,
       
   114             const TAknsFrameElementIndex aFrameElement );
       
   115 
       
   116     public: // From MAknsControlContext
       
   117 
       
   118         /**
       
   119         * @copydoc MAknsControlContext::IsCompatibleWithType
       
   120         */
       
   121         TBool IsCompatibleWithType( const TAknsControlContextType aType ) const;
       
   122 
       
   123         /**
       
   124         * Updates the control context, if necessary.
       
   125         * This method is called by the framework before drawing with the 
       
   126         * context.
       
   127         *
       
   128         * Implementation in CAknsFrameBackgroundControlContext updates the
       
   129         * items to ensure that transition between single-bitmap and 
       
   130         * multi-bitmap frames work as expected.
       
   131         *
       
   132         * @since 2.6
       
   133         *
       
   134         * @return Return value reserved for future use. Currently returns 0.
       
   135         */
       
   136         TInt UpdateContext();
       
   137 
       
   138     protected: // New methods
       
   139 
       
   140         /**
       
   141         * Updates the type-dependant parameters of the frame.
       
   142         *
       
   143         * @since 2.6
       
   144         *
       
   145         * @internal
       
   146         */
       
   147         void UpdateFrame();
       
   148         
       
   149     protected:
       
   150 
       
   151         /**
       
   152         * C++ constructor.
       
   153         */
       
   154         CAknsFrameBackgroundControlContext();
       
   155 
       
   156         /**
       
   157         * Symbian 2nd phase constructor.
       
   158         */
       
   159         void ConstructL( const TAknsItemID& aFrameID, const TRect& aOuterRect, 
       
   160             const TRect& aInnerRect, const TBool aParentAbsolute );
       
   161 
       
   162     protected: // Data
       
   163         TAknsItemID iFrameID;
       
   164         TAknsItemID iCenterID;
       
   165 
       
   166         TRect iInnerRect;
       
   167         TRect iOuterRect;
       
   168 
       
   169         TBool iSingleElementFrame;
       
   170 
       
   171     };
       
   172 
       
   173 #endif      // AKNSFRAMEBACKGROUNDCONTROLCONTEXT_H
       
   174             
       
   175 // End of File