williamr@2: /* williamr@2: * Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * 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 williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: Class declaration for EIKON bordered control. williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef __EIKBCTRL_H__ williamr@2: #define __EIKBCTRL_H__ williamr@2: williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: williamr@2: /** williamr@2: * A control which is drawn surrounded by a rectangular border. williamr@2: * williamr@2: * The screen appearance of derived classes can be changed by overriding williamr@2: * the protected method @c Draw(). By default, this draws a border of the williamr@2: * appropriate type around the control. williamr@2: * williamr@2: * @lib eikcoctl.lib williamr@2: * @since S60 0.9 williamr@2: */ williamr@2: class CEikBorderedControl : public CAknControl williamr@2: { williamr@2: public: williamr@2: williamr@2: /** williamr@2: * Default C++ Constructor. williamr@2: * Constructs a new bordered control that has no border. williamr@2: */ williamr@2: IMPORT_C CEikBorderedControl(); williamr@2: williamr@2: /** williamr@2: * Constructor that creates a new bordered control with williamr@2: * a specified border. williamr@2: * williamr@2: * @param aBorder The border of the control. williamr@2: */ williamr@2: IMPORT_C CEikBorderedControl(const TGulBorder& aBorder); williamr@2: williamr@2: public: /** From @c CCoeControl. */ williamr@2: williamr@2: /** williamr@2: * Checks whether the control has a border. williamr@2: * williamr@2: * From @c CCoeControl. williamr@2: * williamr@2: * @return @c ETrue if the control has a border, @c EFalse otherwise. williamr@2: */ williamr@2: IMPORT_C TBool HasBorder() const; williamr@2: williamr@2: /** williamr@2: * Sets the control's adjacency. williamr@2: * williamr@2: * Declares that a control abuts another control along one edge, williamr@2: * and does not need to be drawn with a full border along that side. williamr@2: * This is for use by layout engines or any user code which lays out williamr@2: * controls next to one another. williamr@2: * williamr@2: * Its intended use is to remove the double border that may occur if williamr@2: * two controls, both with borders, are adjacent within a williamr@2: * container control. williamr@2: * williamr@2: * From @c CCoeControl. williamr@2: * williamr@2: * @param aAdjacent A value from @c TGulAdjacent declaring williamr@2: * which edge of this control is shared. williamr@2: * williamr@2: * @see CCoeControl::SetAdjacent() williamr@2: */ williamr@2: IMPORT_C void SetAdjacent(TInt aAdjacent); williamr@2: williamr@2: /** williamr@2: * Not used in S60. williamr@2: * williamr@2: * From @c CCoeControl. williamr@2: * williamr@2: * @param aColorUseList Not used. williamr@2: */ williamr@2: IMPORT_C void GetColorUseListL(CArrayFix& aColorUseList) const; williamr@2: williamr@2: /** williamr@2: * Handles a change to the control's resources. williamr@2: * williamr@2: * The types of resources handled are those which are shared across williamr@2: * the environment, e.g. colours or fonts. For colour scheme changes, williamr@2: * @c DrawDeferred() is called in order to redraw the control. williamr@2: * williamr@2: * If overriding this method, the implementation must williamr@2: * include a base call to this method. williamr@2: * williamr@2: * From @c CCoeControl. williamr@2: * williamr@2: * @param aType The type of resource that has changed. williamr@2: */ williamr@2: IMPORT_C void HandleResourceChange(TInt aType); williamr@2: williamr@2: /** williamr@2: * Handles pointer events. williamr@2: * williamr@2: * This function gets called whenever a pointer event occurs in the williamr@2: * control, i.e. when the pointer is within the control's extent, or when williamr@2: * the control has grabbed the pointer. williamr@2: * williamr@2: * If overriding this method, the implementation must williamr@2: * include a base call to this method. williamr@2: * williamr@2: * From @c CCoeControl. williamr@2: * williamr@2: * @param aPointerEvent The pointer event. williamr@2: */ williamr@2: IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); williamr@2: williamr@2: public: williamr@2: williamr@2: /** williamr@2: * Sets the border type of the control to a type defined in williamr@2: * @c TGulBorder::TBorderType. williamr@2: * williamr@2: * @param aBorderType The border type to be set. williamr@2: */ williamr@2: IMPORT_C void SetBorder(TGulBorder::TBorderType aBorderType); williamr@2: williamr@2: /** williamr@2: * Sets the border type. williamr@2: * Any one of the values from the enums @c TGulBorder::TBorderType williamr@2: * or @c TGulBorder::TLogicalType specifies a valid border type. williamr@2: * williamr@2: * Custom border types can be created by selecting williamr@2: * one value from enum @c TGulBorder::T3DStyle, williamr@2: * one value from enum @c TGulBorder::TConstructionStyle, williamr@2: * at most one value from enum @c TGulBorder::TOutlineStyle, williamr@2: * at most one value from enum @c TGulBorder::TInlineStyle, williamr@2: * at least one value from enum @c TGulBorder::TThickness and williamr@2: * at least one value from enum @c TGulBorder::TRounding williamr@2: * and performing an OR operation to these. williamr@2: * williamr@2: * @param aBorderType The border type to be set. williamr@2: */ williamr@2: IMPORT_C void SetBorder(TInt aBorderType); williamr@2: williamr@2: /** williamr@2: * Gets the control's border. williamr@2: * williamr@2: * @return The border of the control. williamr@2: */ williamr@2: IMPORT_C TGulBorder Border() const; williamr@2: williamr@2: protected: /** From @c CCoeControl. */ williamr@2: williamr@2: /** williamr@2: * Draws the border around the control. This function also clears the williamr@2: * central area if the @c IsBlank() method returns @c ETrue. williamr@2: * williamr@2: * From @c CCoeControl williamr@2: * williamr@2: * @param aRect Not used. williamr@2: * williamr@2: * @see CCoeControl::IsBlank() williamr@2: * @see Border() williamr@2: */ williamr@2: IMPORT_C void Draw(const TRect& aRect) const; williamr@2: williamr@2: /** williamr@2: * Writes the internal state of the control and its components to @c aWriteStream. williamr@2: * Does nothing in release mode. williamr@2: * williamr@2: * Designed to be overridden and base called from subclasses. williamr@2: * williamr@2: * From @c CCoeControl williamr@2: * williamr@2: * @param[in,out] aWriteStream A connected write stream. williamr@2: */ williamr@2: IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const; williamr@2: williamr@2: private: /** From @c CAknControl. */ williamr@2: williamr@2: IMPORT_C void* ExtensionInterface( TUid aInterface ); williamr@2: williamr@2: protected: williamr@2: williamr@2: /** The control's border. */ williamr@2: TGulBorder iBorder; williamr@2: williamr@2: private: williamr@2: TInt iSpare[2]; williamr@2: }; williamr@2: williamr@2: #endif // __EIKBCTRL_H__