// EIKBORDR.H
//
// Copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
//

#if !defined(__EIKBORDR_H__)
#define __EIKBORDR_H__

#if !defined(__E32DEF_H__)
#include <e32def.h>
#endif

#if !defined(__COEDEF_H__)
#include <coedef.h>
#endif

class CGraphicsContext;
class TRect;
class TSize;
class TMargins;

class TEikBorder
    {
private:
	enum 
		{ENoBorder=0x00,
		EFlat=0x01,EShallow=0x02,EDeep=0x04,
		/*EShadow=0x04,*/
		EHorizontal=0x08,
		EWithOutline=0x10,EWithOverlap=0x20,
		ESunken=0x40,ERaised=0x80,
		EThick=0x100,
		EGray=0x200};
public:
	enum TBorderType
		{
		ENone=ENoBorder,
		ESingleGray=EFlat|EGray,
		ESingleBlack=EFlat,
		EShallowRaised=EShallow|ERaised,
		EDeepRaised=EDeep|ERaised,
		EDeepRaisedWithOutline=EDeep|ERaised|EWithOutline,
		EThickDeepRaisedWithOutline=EThick|EDeep|ERaised|EWithOutline,  
		EShallowSunken=EShallow|ESunken,
		EDeepSunken=EDeep|ESunken,
		EDeepSunkenWithOutline=EDeep|ESunken|EWithOutline,
		EVerticalBar=EShallow|EWithOverlap,
		EHorizontalBar=EShallow|EHorizontal|EWithOverlap
		//EShallowRaisedWithShadow=EShallow|ERaised|EShadow,
		//EDeepRaisedWithShadow=EDeep|ERaised|EShadow
		};
public:
    IMPORT_C TEikBorder();
    IMPORT_C TEikBorder(TBorderType aType);
    IMPORT_C TEikBorder(TBorderType aType,TCoeAdjacent aAdjacent);
	IMPORT_C void Draw(CGraphicsContext& aGc,const TRect& aOuterRect) const;
    IMPORT_C TRect InnerRect(const TRect& aOuterRect) const;
    IMPORT_C TRect OuterRect(const TRect& aInnerRect) const;
	IMPORT_C void SetType(TBorderType aType);
	IMPORT_C void SetAdjacent(TInt aAdjacent);
	IMPORT_C TSize SizeDelta() const;
    IMPORT_C TMargins Margins() const;
	IMPORT_C TBool HasBorder() const;
	IMPORT_C TInt Adjacent() const;
private:
	TBool IsSunken() const;
	//TBool HasShadow() const;
	TInt Depth() const;
	TBorderType Type() const;
	// !!! following temporary functions to ease experimentation
	void DrawShallowRaised(CGraphicsContext& aGc,const TRect& aOuterRect) const;
	void DrawShallowSunken(CGraphicsContext& aGc,const TRect& aOuterRect) const;
	void DrawDeepRaised(CGraphicsContext& aGc,const TRect& aRect) const;
	void DrawDeepRaisedWithOutline(CGraphicsContext& aGc,const TRect& aRect) const;
	void DrawThickDeepRaisedWithOutline(CGraphicsContext& aGc,const TRect& aRect) const;
	void DrawDeepSunken(CGraphicsContext& aGc,const TRect& aRect) const;
	void DrawDeepSunkenWithOutline(CGraphicsContext& aGc,const TRect& aRect) const;
	void DrawVerticalBar(CGraphicsContext& aGc,const TRect& aRect) const;
	void DrawHorizontalBar(CGraphicsContext& aGc,const TRect& aRect) const;
private:
    TInt iType;
    };

#endif
