/*************************************************************************\
* "$RCSfile: CDlgApp.hpp,v $"                                             *
***************************************************************************
* Information by CVS or VSS:                                              *
*     Last check in on: $Date: 2009-04-23 12:28:15 $                      *
*     by                $Author: schluckebier $
*     Revision        : $Revision: 1.7 $                                  *
\*************************************************************************/
/*! \file CDlgApp.hpp
*	\brief Header CDlgApp Class
*	\author (c) 2007 - 2013 IMAGO Technologies GmbH
*
*	$Revision: 1.7 $
*	$Date: 2009-04-23 12:28:15 $
**************************************************************************/

#define APP_MAILBOXSIZE 1

//! Dialog identifier of SDK user interface.
//! They are reused as array index
//! together with the "INDEX" and "ICON" macro
enum eDlgApp_ID
{
// 0x100 <= ICON <= 0x1FF
	ID_APP_ROI		= 0x100,
	ID_APP_BACK,				//!< Back button
	ID_APP_OK					//!< OK button
}; 

//! Message between grab task and main task
typedef struct sAPPMSG_GUI2WORK
{
	int command;
} APPMSG_GUI2WORK;

//! Message between grab task and main task
typedef struct sAPPMSG_WORK2GUI
{
	int result;
} APPMSG_WORK2GUI;

//! Command from UI(main)task to grab task
enum eAPP_COMMAND
{
	APPCMD_A	= 1,
	APPCMD_B
};

/*************************************************************************/
/*! @brief Class for implementing an Imaging Application

	Provides the user interface and a container for a SDK user application.
	@image html CDlgApp.png

	The Dialog of CDlgApp is non modal. The constructor of CDlgApp is
	called by the application framework as well as all other functions to
	display and handle it. All user interface related functions run
	as a part of the task task_main inside the function CDlgApp::OnUserIO().
	Only the function CDlgApp.OnImage() is called by the task task_grab. 

	@image html VIB_PS_SDK_Tasks.png Functions used by CDlgApp of SDK project.
**************************************************************************/
class CDlgApp: public CDlg
{
public:
	CDlgApp(int x, int y, int Width, int Height);
	~CDlgApp();
	int OnUserIO(int nKey);
	int OnImage(YIMAGE *pSrc, CIMAGE *pDst);

protected:
	CRegion m_ROI;				//!< ROI of m_CurrNode
	int m_SetROI;				//!< Flag to handle the Dialog CDlgPreviewSettings
	POINT m_Cursor;				//!< Cursor position for selection of ROI
	int m_ShowCursor;			//!< Flag to enable/disable the drawing of the cursor cross
	int m_ShowROI;				//!< Flag to enable/disable the drawing of the ROI
	MBX_Handle 	m_MbxGui2Work;	//!< Mailbox for communication between user interface and grab/work task
	MBX_Handle 	m_MbxWork2Gui;	//!< Mailbox for communication between user interface and grab/work task
};

extern CDlgApp *pDlgApp;
/*************************************************************************/

