diff -r 000000000000 -r 2f259fa3e83a uifw/EikStd/coctlsrc/EIKBCTRL.CPP --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uifw/EikStd/coctlsrc/EIKBCTRL.CPP Tue Feb 02 01:00:49 2010 +0200 @@ -0,0 +1,139 @@ +/* +* Copyright (c) 1997-1999 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include + +/** + * Gets the list of logical colors employed in the drawing of the control, + * paired with an explanation of how they are used. Appends the list to aColorUseList. + * + * @since ER5U + */ +EXPORT_C void CEikBorderedControl::GetColorUseListL(CArrayFix& /*aColorUseList*/) const + { + } + +/** + * Handles a change to the control's resources of type aType + * which are shared across the environment, e.g. colors or fonts. + * + * @since ER5U + */ +EXPORT_C void CEikBorderedControl::HandleResourceChange(TInt aType) + { + CCoeControl::HandleResourceChange(aType); + } + +EXPORT_C CEikBorderedControl::CEikBorderedControl() + {} + +EXPORT_C CEikBorderedControl::CEikBorderedControl(const TGulBorder& aBorder) + : iBorder(aBorder) + {} + +EXPORT_C TBool CEikBorderedControl::HasBorder() const + { + return iBorder.HasBorder(); + } + +EXPORT_C void CEikBorderedControl::SetAdjacent(TInt aAdjacent) + { + iBorder.SetAdjacent(aAdjacent); + } + +/** + * Overloaded method which sets the border type to aBorderType for a value from the enum TGulBorder::TBorderType. + */ +EXPORT_C void CEikBorderedControl::SetBorder(TGulBorder::TBorderType aBorderType) + { + iBorder=TGulBorder(aBorderType); + } + +/** + * Sets the border type to aBorderType. Any one of the values from the enums TGulBorder::TBorderType + * or TGulBorder::TLogicalType specifies a valid border type. Custom border types can be created by selecting + * + * and ORing these values together. + * + * @since Uikon1.2 + */ +EXPORT_C void CEikBorderedControl::SetBorder(TInt aBorderType) + { + iBorder=TGulBorder(aBorderType); + } + +EXPORT_C TGulBorder CEikBorderedControl::Border() const + { + return iBorder; + } + +EXPORT_C void CEikBorderedControl::Draw(const TRect& /*aRect*/) const + { + TRect rect=Rect(); + CGraphicsContext& gc=SystemGc(); + iBorder.Draw(gc,rect); + if (IsBlank()) + { + TRect innerRect=iBorder.InnerRect(rect); + gc.SetPenStyle(CGraphicsContext::ENullPen); + gc.SetBrushStyle(CGraphicsContext::ESolidBrush); + gc.DrawRect(innerRect); + } + } + +/** + * Writes the internal state of the control and its components to aStream. + * Does nothing in release mode. + * Designed to be overidden and base called by subclasses. + * + * @internal + * @since App-Framework_6.1 + */ +#ifndef _DEBUG +EXPORT_C void CEikBorderedControl::WriteInternalStateL(RWriteStream&) const + {} +#else +EXPORT_C void CEikBorderedControl::WriteInternalStateL(RWriteStream& aWriteStream) const + { + _LIT(KEikLitBrdrCtlSt,""); + _LIT(KEikLitBrdrCtlEnd,"<\\CEikBorderedControl>"); + _LIT(KEikLitBrdrCtlBorder,""); + _LIT(KEikLitBrdrCtlBorderEnd,"<\\iBorder>"); + + aWriteStream << KEikLitBrdrCtlSt; + aWriteStream << KEikLitBrdrCtlBorder; + aWriteStream.WriteInt32L(iBorder.Type()); + aWriteStream << KEikLitBrdrCtlBorderEnd; + CCoeControl::WriteInternalStateL(aWriteStream); + aWriteStream << KEikLitBrdrCtlEnd; + } +#endif + +EXPORT_C void CEikBorderedControl::HandlePointerEventL(const TPointerEvent& aPointerEvent) + { + CAknControl::HandlePointerEventL(aPointerEvent); + } + +EXPORT_C void* CEikBorderedControl::ExtensionInterface( TUid /*aInterface*/ ) + { + return NULL; + }