2 * Copyright (c) 2002-2006 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: Class declaration for EIKON bordered control.
19 #ifndef __EIKBCTRL_H__
20 #define __EIKBCTRL_H__
24 #include <AknControl.h>
27 * A control which is drawn surrounded by a rectangular border.
29 * The screen appearance of derived classes can be changed by overriding
30 * the protected method @c Draw(). By default, this draws a border of the
31 * appropriate type around the control.
36 class CEikBorderedControl : public CAknControl
41 * Default C++ Constructor.
42 * Constructs a new bordered control that has no border.
44 IMPORT_C CEikBorderedControl();
47 * Constructor that creates a new bordered control with
50 * @param aBorder The border of the control.
52 IMPORT_C CEikBorderedControl(const TGulBorder& aBorder);
54 public: /** From @c CCoeControl. */
57 * Checks whether the control has a border.
59 * From @c CCoeControl.
61 * @return @c ETrue if the control has a border, @c EFalse otherwise.
63 IMPORT_C TBool HasBorder() const;
66 * Sets the control's adjacency.
68 * Declares that a control abuts another control along one edge,
69 * and does not need to be drawn with a full border along that side.
70 * This is for use by layout engines or any user code which lays out
71 * controls next to one another.
73 * Its intended use is to remove the double border that may occur if
74 * two controls, both with borders, are adjacent within a
77 * From @c CCoeControl.
79 * @param aAdjacent A value from @c TGulAdjacent declaring
80 * which edge of this control is shared.
82 * @see CCoeControl::SetAdjacent()
84 IMPORT_C void SetAdjacent(TInt aAdjacent);
87 * <b> Not used in S60. </b>
89 * From @c CCoeControl.
91 * @param aColorUseList Not used.
93 IMPORT_C void GetColorUseListL(CArrayFix<TCoeColorUse>& aColorUseList) const;
96 * Handles a change to the control's resources.
98 * The types of resources handled are those which are shared across
99 * the environment, e.g. colours or fonts. For colour scheme changes,
100 * @c DrawDeferred() is called in order to redraw the control.
102 * If overriding this method, the implementation must
103 * include a base call to this method.
105 * From @c CCoeControl.
107 * @param aType The type of resource that has changed.
109 IMPORT_C void HandleResourceChange(TInt aType);
112 * Handles pointer events.
114 * This function gets called whenever a pointer event occurs in the
115 * control, i.e. when the pointer is within the control's extent, or when
116 * the control has grabbed the pointer.
118 * If overriding this method, the implementation must
119 * include a base call to this method.
121 * From @c CCoeControl.
123 * @param aPointerEvent The pointer event.
125 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
130 * Sets the border type of the control to a type defined in
131 * @c TGulBorder::TBorderType.
133 * @param aBorderType The border type to be set.
135 IMPORT_C void SetBorder(TGulBorder::TBorderType aBorderType);
138 * Sets the border type.
139 * Any one of the values from the enums @c TGulBorder::TBorderType
140 * or @c TGulBorder::TLogicalType specifies a valid border type.
142 * Custom border types can be created by selecting
143 * one value from enum @c TGulBorder::T3DStyle,
144 * one value from enum @c TGulBorder::TConstructionStyle,
145 * at most one value from enum @c TGulBorder::TOutlineStyle,
146 * at most one value from enum @c TGulBorder::TInlineStyle,
147 * at least one value from enum @c TGulBorder::TThickness and
148 * at least one value from enum @c TGulBorder::TRounding
149 * and performing an OR operation to these.
151 * @param aBorderType The border type to be set.
153 IMPORT_C void SetBorder(TInt aBorderType);
156 * Gets the control's border.
158 * @return The border of the control.
160 IMPORT_C TGulBorder Border() const;
162 protected: /** From @c CCoeControl. */
165 * Draws the border around the control. This function also clears the
166 * central area if the @c IsBlank() method returns @c ETrue.
168 * From @c CCoeControl
170 * @param aRect Not used.
172 * @see CCoeControl::IsBlank()
175 IMPORT_C void Draw(const TRect& aRect) const;
178 * Writes the internal state of the control and its components to @c aWriteStream.
179 * Does nothing in release mode.
181 * Designed to be overridden and base called from subclasses.
183 * From @c CCoeControl
185 * @param[in,out] aWriteStream A connected write stream.
187 IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const;
189 private: /** From @c CAknControl. */
191 IMPORT_C void* ExtensionInterface( TUid aInterface );
195 /** The control's border. */
202 #endif // __EIKBCTRL_H__