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

/*************************************************************************/
/*! @brief Dialog class for saving an image to SD card.

	CDlgSaveImage is non-modal.\n
	The user can save an image as *.png, *.jpg or *.bmp. The filename
	contains a prefix, which is up to 5 chars long, and a 3 digit number.
	This number can be incremented automatically. The path of the filename
	is taken from the \p Config instance #m_VicPs.
	@image html CDlgSaveImage.png
**************************************************************************/
class CDlgSaveImage: public CDlg
{
protected:
	//! @brief Dialog identifier of CDlgSaveImage.
	//!
	//! They are reused as array index together with the INDEX() and ICON() macros.
	enum eDlgSaveImage_ID
	{
		// 0x100 <= ICON <= 0x1FF
		ID_SAVE = 0x100,	//!< Save button
		ID_BACK,			//!< Back button
		ID_XXX,				//!< End marker

		// 0x200 <= ITEM <= 0x2FF
		ID_FORMAT = 0x200,	//!< File-format \e ChoiceBox
		ID_COUNT_CK,		//!< Filename counter \e CheckBox
		ID_COUNT_EB,		//!< Filename counter \e EditBox
		ID_FN_PREF_EB,		//!< Filename prefix \e EditBox
		ID_LOAD				//!< Load button
	};

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

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

	int OnUserIO(int nKey);

	//! Returns dirty flag.
	bool GetDirty() const { return m_bDirty; }
	//! Sets dirty flag.
	void SetDirty(bool bState) { m_bDirty = bState; }

protected:
	Config *m_VicPs;					//!< Stores the current information from #m_pSI
	CPSApp::SAVE_IMAGE_SETTINGS *m_pSI;	//!< Image filename and image specific settings
	bool m_bDirty;						//!< Values changed
};

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