/****************************************************************************
	Aplikace pro konfiguraci serioveho portu

*****************************************************************************/
#ifndef SERIAL_SETUP_H
#define SERIAL_SETUP_H



/****************************************************************************
	Definice geometrickych rozmeru aplikace

*****************************************************************************/
#define SERIAL_SETUP_DIVISOR_LEFT 30
#define SERIAL_SETUP_DIVISOR_TOP 80
#define SERIAL_SETUP_DIVISOR_WIDTH 420
#define SERIAL_SETUP_DIVISOR_HEIGHT 120

#define SERIAL_SETUP_YA SERIAL_SETUP_DIVISOR_TOP
#define SERIAL_SETUP_XA SERIAL_SETUP_DIVISOR_LEFT
#define SERIAL_SETUP_XC SERIAL_SETUP_DIVISOR_WIDTH+SERIAL_SETUP_DIVISOR_LEFT
#define SERIAL_SETUP_YC SERIAL_SETUP_DIVISOR_TOP+SERIAL_SETUP_DIVISOR_HEIGHT

#define SERIAL_SETUP_SHOW_FIELD_LEFT 45
#define SERIAL_SETUP_SHOW_FIELD_TOP 25
#define SERIAL_SETUP_SHOW_FIELD_WIDTH 120
#define SERIAL_SETUP_SHOW_FIELD_HEIGHT 35

/****************************************************************************
	Definice objektu aplikace

*****************************************************************************/
typedef enum SERIAL_SETUP_OBJECT
{
	SERIAL_SETUP_DIVISOR,
	SERIAL_SETUP_BAUDRATE_UP,
	SERIAL_SETUP_BAUDRATE_DOWN,
	SERIAL_SETUP_SHOW_BAUDRATE,
	SERIAL_SETUP_SHOW_STOPS,
	SERIAL_SETUP_SHOW_PARITY,
	SERIAL_SETUP_END,
	SERIAL_SETUP_SAVE,
	SERIAL_SETUP_OBJECT_COUNT,
}SERIAL_SETUP_OBJECT;

/****************************************************************************
	Definice stavu aplikace

*****************************************************************************/
typedef enum SERIAL_SETUP_STATE
{
	SERIAL_SETUP_NOT_INITIALIZED = M_TASK_NOT_INITIALIZED,
	SERIAL_SETUP_INITIALIZE,
	SERIAL_SETUP_RESTART = M_TASK_RESTART,
	SERIAL_SETUP_DRAW,
	SERIAL_SETUP_ACTIVE = M_TASK_RUNNING,
	SERIAL_SETUP_WAITING = M_TASK_WAITING,
	SERIAL_SETUP_DIALOG_WAITING = M_TASK_DIALOG_WAITING,
	SERIAL_SETUP_SWITCH,
	SERIAL_SETUP_READY = M_TASK_READY,
	SERIAL_SETUP_STOP,
	SERIAL_SETUP_ERROR = M_TASK_FAILED,
}SERIAL_SETUP_STATE;


extern char baudIndex;
extern int baudRates[5];

RESULT SSMsgBox(MESSAGE * msg);
void AppSerialSetup(void);

#endif