// EIKPARAD.H
//
// Copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
//

#if !defined(__EIKPARAD_H__)
#define __EIKPARAD_H__

#if !defined(__EIKDIALG_H__)
#include <eikdialg.h>
#endif

#if !defined(__TXTFRMAT_H__)
#include <txtfrmat.h>
#endif

#if !defined(__GDI_H__)
#include <gdi.h>
#endif

class CParaFormat;
class TParaFormatMask;
class TParaBorder;

class CEikAlignDialog : public CEikDialog
	{
public:
	IMPORT_C CEikAlignDialog(CParaFormat* aFormat, TParaFormatMask& aAttribChangedMask, TParaFormatMask& aUndeterminedMask);
private: // from CEikDialog
	void PreLayoutDynInitL();
	TBool OkToExitL(TInt aKeyCode);
private:
	TParaFormatMask* iAttribChangedMask;
	TParaFormatMask* iUndeterminedMask;
    CParaFormat::TAlignment* iAlignment;
	};

class CEikIndentDialog : public CEikDialog
	{
public:
	IMPORT_C CEikIndentDialog(CParaFormat* aFormat, TParaFormatMask& aAttribChangedMask, TParaFormatMask& aUndeterminedMask,const TInt aPageWidth);
private: // from CEikDialog
	void PreLayoutDynInitL();
	TBool OkToExitL(TInt aKeyCode);
private:
    void SetEditorStateL(TTextFormatAttribute aAtt,TInt aControlId,TInt32* aValue);
private:
	TParaFormatMask* iAttribChangedMask;
	TParaFormatMask* iUndeterminedMask;
	TInt32* iLeftMargin;
	TInt32* iRightMargin;
	TInt32* iIndent;
	TInt iPageWidth;
	};

class CEikSpaceDialog : public CEikDialog
	{
public:
	IMPORT_C CEikSpaceDialog(CParaFormat* aFormat, TParaFormatMask& aAttribChangedMask, TParaFormatMask& aUndeterminedMask);
private: // from CEikDialog
	void PreLayoutDynInitL();
	TBool OkToExitL(TInt aKeyCode);
private:
	TParaFormatMask* iAttribChangedMask;
	TParaFormatMask* iUndeterminedMask;
    CParaFormat::TLineSpacingControl* iLineSpacingControl;
	TInt32* iLineSpacing;
	TInt32* iSpaceBefore;
	TInt32* iSpaceAfter;
	TBool* iWidowOrphan;
	TBool* iKeepTogether;
	TBool* iKeepWithNext;
	TBool* iStartNewPage;
	};

class CEikBorderDialog : public CEikDialog
	{
public:
	IMPORT_C CEikBorderDialog(CParaFormat* aFormat, TParaFormatMask& aAttribChangedMask, TParaFormatMask& aUndeterminedMask);
private: // from CEikDialog
	void PreLayoutDynInitL();
	TBool OkToExitL(TInt aKeyCode);
	void HandleControlStateChangeL(TInt aControlId);
private:
	enum TBorderStyle {ENullLineStyle,ESolid1,ESolid2,ESolid3,ESolid4,ESolid5,ESolid6,EDouble1,EDouble2,EDouble3,EDotted,EDashed,EDotDash,EDotDotDash};
private:
	void SetBorderLineStyleAndColor(const TParaBorder& aBorder, TTextFormatAttribute aAttribute,TInt aControlId, TInt aColorControlId);
	void DoPreview();
	TBorderStyle GetTBorderStyle(TParaBorder aBorder);
	TParaBorder::TLineStyle GetLineStyle(TBorderStyle aLineStyle);
	TInt GetLineThickness(TBorderStyle aLineStyle);
	//color
	TRgb ConvertGrayToTRgb(TUint aGray);
	TInt ConvertTRgbToGray(TRgb aTRgb);
private:
	CParaFormat* iFormat;
	TParaFormatMask* iAttribChangedMask;
	TParaFormatMask* iUndeterminedMask;
	TParaBorder iRightBorder;
	TParaBorder iLeftBorder;
	TParaBorder iTopBorder;
	TParaBorder iBottomBorder;
	TInt32* iBorderMargin;
	const TParaBorder iOldLeftBorder;
	const TParaBorder iOldRightBorder;
	const TParaBorder iOldTopBorder;
	const TParaBorder iOldBottomBorder;
	//color
	TRgb iFillColor;
	const TRgb iOldFillColor;
//	TInt iLineStyleCount;
//	TInt iColorCount;
	};

#endif
