// EIKCLBD.H
//
// Copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
//
#if !defined(__EIKCLBD_H__)
#define __EIKCLBD_H__

#include <e32base.h>
#include <gdi.h>

class CWindowGc;

class CColumnListBoxData : public CBase
	{
public:
	IMPORT_C static CColumnListBoxData* NewL();
	IMPORT_C ~CColumnListBoxData();
public:
	IMPORT_C TInt LastColumn() const;
	//
	IMPORT_C TInt ColumnWidthPixel(TInt aColumn) const;
	IMPORT_C void SetColumnWidthPixelL(TInt aColumn,TInt aWidth);
	//
	IMPORT_C const CFont* ColumnFont(TInt aColumn) const;
	IMPORT_C void SetColumnFontL(TInt aColumn,const CFont* aFont);
	//
	IMPORT_C CGraphicsContext::TTextAlign ColumnAlignment(TInt aColumn) const;
	IMPORT_C void SetColumnAlignmentL(TInt aColumn,CGraphicsContext::TTextAlign aAlign);
	//
	IMPORT_C TBool ColumnIsGraphics(TInt aColumn) const;
	IMPORT_C void SetGraphicsColumnL(TInt aColumn,TBool aIsGraphics);
	//
	IMPORT_C CArrayPtr<CFbsBitmap>* BitmapArray() const;
	IMPORT_C void SetBitmapArray(CArrayPtr<CFbsBitmap>* aArray);
	//
	IMPORT_C void Draw(CWindowGc& aGc,const TDesC* aText,const TRect& aRect,TBool aHighlight) const;
private:
	struct SColumn
		{
		TInt iColumn; // Must be first entry
		TInt iWidth;
		const CFont* iFont;
		TBool iGraphics;
		CGraphicsContext::TTextAlign iAlign;
		};
private:
	CColumnListBoxData();
	void ConstructLD();
	void AddColumnL(TInt aColumn);
	SColumn& At(TInt aArrayIndex);
	const SColumn& At(TInt aArrayIndex) const;
	TInt FindColumnIndex(TInt& aArrayIndex,TInt aColumn) const;
	void FindColumnIndexOrAddL(TInt& aArrayIndex,TInt aColumn);
private:
	CArrayFix<SColumn>* iColumnArray;
	CArrayPtr<CFbsBitmap>* iBitmapArray;
	};

#endif
