/*************************************************************************\
* "$RCSfile: CDlgPassword.hpp,v $"                                        *
***************************************************************************
* Information by CVS or VSS:                                              *
*     Last check in on: $Date: 2010/06/16 10:19:54 $                      *
*     by                $Author: schluckebier $
*     Revision        : $Revision: 1.4 $                                  *
\*************************************************************************/
/*! \file CDlgPassword.hpp
*	\brief Header CDlgPassword Class
**************************************************************************/

/*************************************************************************/
/*! @brief Dialog class to enter a password.

	@image html CDlgPassword.png
	CDlgPassword is modal.\n
	Provides a dialog for entering a password. There are two passwords
	available: \e User and \e Administrator
**************************************************************************/
class CDlgPassword
{
protected:
	//! Icon list
	enum eICONS
	{
		IB_B1, IB_B2, IB_B3, IB_B4, IB_B5, IB_B6, IB_B7, IB_B8, IB_B9, IB_B0,
		IB_XXX,		//!< End marker

		IB_OK,		//!< Button OK
		IB_CANCEL	//!< Button cancel
	};

private:
	CDlgPassword();
	~CDlgPassword();
	static CDlgPassword *m_pThis;

public:
	static CDlgPassword *CreateInstance();
	//! Gets CDlgPassword instance.
	static CDlgPassword *GetInstance() { return m_pThis; }
	static void DisposeInstance();
	int CheckPassword(FILE *fKB, int Level=0);

protected:
	char m_PasswordA[16];		//!< Password Admin
	char m_PasswordU[16];		//!< Password User
	char m_SValue[16];			//!< String value
	GUI_DLG *m_pDlg;			//!< Password dialog
	DLG_ITEMS *m_pText;			//!< Label
	CIMAGE m_Icon[IB_XXX];		//!< All icons
};

/*************************************************************************/
