/*************************************************************************\
* "$RCSfile: CDlgTools.hpp,v $"                                           *
***************************************************************************
* Information by CVS or VSS:                                              *
*     Last check in on: $Date: 2011-10-20 07:53:57 $                      *
*     by                $Author: schluckebier $
*     Revision        : $Revision: 1.15 $                                 *
\*************************************************************************/
/*! \file CDlgTools.hpp
*	\brief Header CDlgTools Class
**************************************************************************/

/*************************************************************************/
/*! @brief Tools dialog class

	CDlgTools is non-modal.\n
	The user can:\n
	- Set time and date by pressing the \e Clock button. This will open a
	modal clock setting dialog.
	- View the log by pressing the \e Log button. This gives focus to CDlgLog.
	- Reboot by pressing the \e Reboot button. This will terminate the
	application and reboot. If JTAG is connected, the program will halt
	after termination.
	- Read/set the digital IOs by pressing the \e DigIO button. This gives
	focus to CDlgDigIO.
	- Show camera live image in \e FullScreen mode.
	- Display program and hardware information by pressing the
	\e Information button.
	- Edit a \p Config instance by choosing  it with the ChoiceBox and
	pressing the \e Parameter button. This gives focus to the CDlgConfig.
	- Start a \e FileManager to manage file data on the SD card.
	.
	@image html CDlgTools.png
**************************************************************************/
class CDlgTools: public CDlg
{
protected:
	//! @brief Dialog identifier of tools dialog.
	//!
	//! They are reused as array index together with the INDEX() and ICON() macro.
	enum eDlgTools_ID
	{
		// 0x100 <= ICON <= 0x1FF
		ID_PARAMETER = 0x100,	//!< Parameter button
		ID_REBOOT,				//!< Reboot button
		ID_LOG,					//!< Log button
		ID_CLOCK,				//!< Clock button
		ID_DIGIO,				//!< Digital IO button
		ID_FULLSCREEN,			//!< Full screen mode button
		ID_INFO,				//!< Info button
		ID_FILEMANAGER,			//!< File manager button
		ID_XXX,					//!< End marker

		ID_CHOICE,				//!< \e ChoiceBox to select parameter set to edit
		ID_PRESEL				//!< \e SelectBox for Preset Tools
	};

	//! Selection of \e ChoiceBox for parameter set
	enum eChoice
	{
		ID_APP_INI = 1,	//!< Application parameters
		ID_STR_INI,		//!< String table
		ID_SIG_INI,		//!< Save image parameters
		ID_ETH_INI		//!< Ethernet parameters
	};

private:
	CDlgTools(int x, int y, int Width, int Height);
	~CDlgTools();
	static CDlgTools *m_pThis;

public:
	static CDlgTools *CreateInstance(int x, int y, int Width, int Height);
	//! Gets CDlgTools instance.
	static CDlgTools *GetInstance() { return m_pThis; }
	static void DisposeInstance();
	int OnUserIO(int nKey);

protected:
	void SetTime();
	void ShowInfo();

	int m_Choice;		//!< Value of \e ChoiceBox
};

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