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 * CAknsFrameBackgroundControlContext.
20 #ifndef AKNSFRAMEBACKGROUNDCONTROLCONTEXT_H
21 #define AKNSFRAMEBACKGROUNDCONTROLCONTEXT_H
24 #include <AknsLayeredBackgroundControlContext.h>
29 * Implementation of a control context that provides a layout background
30 * generated from a frame item.
32 * This is a public class with exported functions.
33 * The class is not intended for derivation outside the library.
39 NONSHARABLE_CLASS(CAknsFrameBackgroundControlContext) :
40 public CAknsLayeredBackgroundControlContext
42 public: // Constructors and destructor
45 * Two-phased constructor.
49 * @param aFrameID Item ID of the entire frame.
51 * @param aOuterRect Outer rectangle of the frame.
53 * @param aInnerRect Inner rectangle of the frame.
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 * @return Newly constructed object.
61 IMPORT_C static CAknsFrameBackgroundControlContext* NewL(
62 const TAknsItemID& aFrameID, const TRect& aOuterRect,
63 const TRect& aInnerRect, const TBool aParentAbsolute );
68 virtual ~CAknsFrameBackgroundControlContext();
70 public: // New functions
73 * Reconstructs the entire frame from the given item ID.
77 * @param aID Item ID of the entire frame.
79 IMPORT_C void SetFrame( const TAknsItemID& aFrameID );
82 * Sets the outer and the inner rectangles of the frame.
86 * @param aOuterRect The outer rectangle of the frame.
88 * @param aInnerRect The inner rectangle of the frame.
90 IMPORT_C void SetFrameRects( const TRect& aOuterRect,
91 const TRect& aInnerRect );
94 * Overrides the center part of the frame.
98 * @param aID Item ID of the center part to be used.
100 IMPORT_C void SetCenter( const TAknsItemID& aID );
103 * Sets the rectangle of a single part of the frame.
107 * @param aRect Rectangle of the specific part of the frame.
109 * @param aFrameElement Element (index) of the frame element
110 * to which the rectangle is applied.
113 IMPORT_C void SetFramePartRect( const TRect& aRect,
114 const TAknsFrameElementIndex aFrameElement );
116 public: // From MAknsControlContext
119 * @copydoc MAknsControlContext::IsCompatibleWithType
121 TBool IsCompatibleWithType( const TAknsControlContextType aType ) const;
124 * Updates the control context, if necessary.
125 * This method is called by the framework before drawing with the
128 * Implementation in CAknsFrameBackgroundControlContext updates the
129 * items to ensure that transition between single-bitmap and
130 * multi-bitmap frames work as expected.
134 * @return Return value reserved for future use. Currently returns 0.
136 TInt UpdateContext();
138 protected: // New methods
141 * Updates the type-dependant parameters of the frame.
154 CAknsFrameBackgroundControlContext();
157 * Symbian 2nd phase constructor.
159 void ConstructL( const TAknsItemID& aFrameID, const TRect& aOuterRect,
160 const TRect& aInnerRect, const TBool aParentAbsolute );
163 TAknsItemID iFrameID;
164 TAknsItemID iCenterID;
169 TBool iSingleElementFrame;
173 #endif // AKNSFRAMEBACKGROUNDCONTROLCONTEXT_H