// EIKSECED.H
// Started by NeilD January 1996
// (C) Copyright Psion PLC 1996
//
// Header file for Secret Editor control class

#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();
public: // **** CHANGED TO ALLOW "SECRET EDITOR WITH SET" - subclass ****
	typedef TBuf<EMaxSecEdLength> TSecEdBuf;
	TInt iSecPos;
	TInt iMaxLen;
	TInt iCharWidth;
	TInt iAscent;
	TSecEdBuf iSecCharArr;
	};

#endif
