// EIKSECED.H
//
// Copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
//

#if !defined(__EIKSECED_H__)
#define __EIKSECED_H__

#if !defined(__EIKDEF_H__)
#include <eikdef.h>
#endif

#if !defined(__EIKBCTRL_H__)
#include <eikbctrl.h>
#endif

class TResourceReader;

class CEikSecretEditor : public CEikBorderedControl
	{
public:
	enum { EMaxSecEdLength=32 };
public:	// inherited
	IMPORT_C CEikSecretEditor();
	IMPORT_C virtual void ConstructFromResourceL(TResourceReader& aReader);
	IMPORT_C virtual TSize MinimumSize();
	IMPORT_C virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
public:	// specific
	IMPORT_C void GetText(TDes& aText) const;
	IMPORT_C void Reset();
	IMPORT_C void SetMaxLength(TInt aMaxLength);
protected:	// inherited
	IMPORT_C virtual void FocusChanged(TDrawNow aDrawNow);
private: // virtual
	IMPORT_C virtual void Draw(const TRect& aRect) const;
private: // from CCoeControl
	IMPORT_C void Reserved_1();
	IMPORT_C void Reserved_2();
private: // specific
	void DrawText() const;
	void DrawTextNow() const;
	void DisplayCursor();
private:
	typedef TBuf<EMaxSecEdLength> TSecEdBuf;
protected:
	TInt iSecPos;
private:
	TInt iMaxLen;
	TInt iCharWidth;
	TInt iAscent;
protected:
	TSecEdBuf iSecCharArr;
	};

#endif
