1.1 --- a/epoc32/include/mw/eikbctrl.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/mw/eikbctrl.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,202 @@
1.4 -eikbctrl.h
1.5 +/*
1.6 +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* 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
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description: Class declaration for EIKON bordered control.
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +#ifndef __EIKBCTRL_H__
1.24 +#define __EIKBCTRL_H__
1.25 +
1.26 +#include <gulbordr.h>
1.27 +#include <coecntrl.h>
1.28 +#include <akncontrol.h>
1.29 +
1.30 +/**
1.31 + * A control which is drawn surrounded by a rectangular border.
1.32 + *
1.33 + * The screen appearance of derived classes can be changed by overriding
1.34 + * the protected method @c Draw(). By default, this draws a border of the
1.35 + * appropriate type around the control.
1.36 + *
1.37 + * @lib eikcoctl.lib
1.38 + * @since S60 0.9
1.39 + */
1.40 +class CEikBorderedControl : public CAknControl
1.41 + {
1.42 +public:
1.43 +
1.44 + /**
1.45 + * Default C++ Constructor.
1.46 + * Constructs a new bordered control that has no border.
1.47 + */
1.48 + IMPORT_C CEikBorderedControl();
1.49 +
1.50 + /**
1.51 + * Constructor that creates a new bordered control with
1.52 + * a specified border.
1.53 + *
1.54 + * @param aBorder The border of the control.
1.55 + */
1.56 + IMPORT_C CEikBorderedControl(const TGulBorder& aBorder);
1.57 +
1.58 +public: /** From @c CCoeControl. */
1.59 +
1.60 + /**
1.61 + * Checks whether the control has a border.
1.62 + *
1.63 + * From @c CCoeControl.
1.64 + *
1.65 + * @return @c ETrue if the control has a border, @c EFalse otherwise.
1.66 + */
1.67 + IMPORT_C TBool HasBorder() const;
1.68 +
1.69 + /**
1.70 + * Sets the control's adjacency.
1.71 + *
1.72 + * Declares that a control abuts another control along one edge,
1.73 + * and does not need to be drawn with a full border along that side.
1.74 + * This is for use by layout engines or any user code which lays out
1.75 + * controls next to one another.
1.76 + *
1.77 + * Its intended use is to remove the double border that may occur if
1.78 + * two controls, both with borders, are adjacent within a
1.79 + * container control.
1.80 + *
1.81 + * From @c CCoeControl.
1.82 + *
1.83 + * @param aAdjacent A value from @c TGulAdjacent declaring
1.84 + * which edge of this control is shared.
1.85 + *
1.86 + * @see CCoeControl::SetAdjacent()
1.87 + */
1.88 + IMPORT_C void SetAdjacent(TInt aAdjacent);
1.89 +
1.90 + /**
1.91 + * <b> Not used in S60. </b>
1.92 + *
1.93 + * From @c CCoeControl.
1.94 + *
1.95 + * @param aColorUseList Not used.
1.96 + */
1.97 + IMPORT_C void GetColorUseListL(CArrayFix<TCoeColorUse>& aColorUseList) const;
1.98 +
1.99 + /**
1.100 + * Handles a change to the control's resources.
1.101 + *
1.102 + * The types of resources handled are those which are shared across
1.103 + * the environment, e.g. colours or fonts. For colour scheme changes,
1.104 + * @c DrawDeferred() is called in order to redraw the control.
1.105 + *
1.106 + * If overriding this method, the implementation must
1.107 + * include a base call to this method.
1.108 + *
1.109 + * From @c CCoeControl.
1.110 + *
1.111 + * @param aType The type of resource that has changed.
1.112 + */
1.113 + IMPORT_C void HandleResourceChange(TInt aType);
1.114 +
1.115 + /**
1.116 + * Handles pointer events.
1.117 + *
1.118 + * This function gets called whenever a pointer event occurs in the
1.119 + * control, i.e. when the pointer is within the control's extent, or when
1.120 + * the control has grabbed the pointer.
1.121 + *
1.122 + * If overriding this method, the implementation must
1.123 + * include a base call to this method.
1.124 + *
1.125 + * From @c CCoeControl.
1.126 + *
1.127 + * @param aPointerEvent The pointer event.
1.128 + */
1.129 + IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
1.130 +
1.131 +public:
1.132 +
1.133 + /**
1.134 + * Sets the border type of the control to a type defined in
1.135 + * @c TGulBorder::TBorderType.
1.136 + *
1.137 + * @param aBorderType The border type to be set.
1.138 + */
1.139 + IMPORT_C void SetBorder(TGulBorder::TBorderType aBorderType);
1.140 +
1.141 + /**
1.142 + * Sets the border type.
1.143 + * Any one of the values from the enums @c TGulBorder::TBorderType
1.144 + * or @c TGulBorder::TLogicalType specifies a valid border type.
1.145 + *
1.146 + * Custom border types can be created by selecting
1.147 + * one value from enum @c TGulBorder::T3DStyle,
1.148 + * one value from enum @c TGulBorder::TConstructionStyle,
1.149 + * at most one value from enum @c TGulBorder::TOutlineStyle,
1.150 + * at most one value from enum @c TGulBorder::TInlineStyle,
1.151 + * at least one value from enum @c TGulBorder::TThickness and
1.152 + * at least one value from enum @c TGulBorder::TRounding
1.153 + * and performing an OR operation to these.
1.154 + *
1.155 + * @param aBorderType The border type to be set.
1.156 + */
1.157 + IMPORT_C void SetBorder(TInt aBorderType);
1.158 +
1.159 + /**
1.160 + * Gets the control's border.
1.161 + *
1.162 + * @return The border of the control.
1.163 + */
1.164 + IMPORT_C TGulBorder Border() const;
1.165 +
1.166 +protected: /** From @c CCoeControl. */
1.167 +
1.168 + /**
1.169 + * Draws the border around the control. This function also clears the
1.170 + * central area if the @c IsBlank() method returns @c ETrue.
1.171 + *
1.172 + * From @c CCoeControl
1.173 + *
1.174 + * @param aRect Not used.
1.175 + *
1.176 + * @see CCoeControl::IsBlank()
1.177 + * @see Border()
1.178 + */
1.179 + IMPORT_C void Draw(const TRect& aRect) const;
1.180 +
1.181 + /**
1.182 + * Writes the internal state of the control and its components to @c aWriteStream.
1.183 + * Does nothing in release mode.
1.184 + *
1.185 + * Designed to be overridden and base called from subclasses.
1.186 + *
1.187 + * From @c CCoeControl
1.188 + *
1.189 + * @param[in,out] aWriteStream A connected write stream.
1.190 + */
1.191 + IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const;
1.192 +
1.193 +private: /** From @c CAknControl. */
1.194 +
1.195 + IMPORT_C void* ExtensionInterface( TUid aInterface );
1.196 +
1.197 +protected:
1.198 +
1.199 + /** The control's border. */
1.200 + TGulBorder iBorder;
1.201 +
1.202 +private:
1.203 + TInt iSpare[2];
1.204 + };
1.205 +
1.206 +#endif // __EIKBCTRL_H__