#define MSG_RECEIVE_CHECK    _T("WOOSIM_PRT_OK")

/****************************************************************************
CONST DEFINE
****************************************************************************/

#define DATA					0x44		//Response of Card data or Model name
#define STATUS_ANSWER			0x53		//Response of printer status

//Return Message
#define SUCCESS									1
#define ALREADY_OPENED							-1
#define TIMEOUT									-7
#define NOT_OPEN_THE_PORT						-11

//Serial, Bluetooth Err message
#define UNABLE_TO_OPEN_THE_PORT					-2
#define UNABLE_TO_CONFIGURE_THE_SERIAL_PORT		-3 
#define UNABLE_TO_SET_THE_TIMEOUT_PARAMETERS	-4

//Wireless Err message
#undef SOCKET_ERROR
#define SOCKET_ERROR							-2
#define CONNECT_FAIL							-3

//USB Err message
#define UNABLE_TO_MAKE_CONNECTION				-2
#define UNABLE_TO_GET_INFOMATION				-3 
#define NOT_WOOSIM_PRINTER						-4

enum Barcode: int
{
	UPCA=65,
	UPCE,
	EAN13,
	EAN8,
	CODE39,
	ITF,
	CODABAR,
	CODE93,
	CODE128
};

enum WIDTH: int
{
	_1INCH=192,
	_2INCH=384,
	_3INCH=576,
	_4INCH=768
};

enum MCU: int
{
	M16C = 0,
	ARM,
	RX
};

enum TEXTWIDTH: BYTE
{
	TEXTWIDTH01 = 0x00,
	TEXTWIDTH02,
	TEXTWIDTH03,
	TEXTWIDTH04,
	TEXTWIDTH05,
	TEXTWIDTH06,
	TEXTWIDTH07,
	TEXTWIDTH08
};

enum TEXTHIGHT: BYTE
{
	TEXTHIGHT01 = 0x00,
	TEXTHIGHT02,
	TEXTHIGHT03,
	TEXTHIGHT04,
	TEXTHIGHT05,
	TEXTHIGHT06,
	TEXTHIGHT07,
	TEXTHIGHT08
};

/*
//barcode type
#define UPCA				65
#define UPCE				66
#define EAN13				67
#define EAN8				68
#define CODE39				69
#define ITF					70
#define CODABAR				71
#define CODE93				72
#define CODE128				73

//printer width
#define _1INCH				192
#define _2INCH				384
#define _3INCH				576
#define _4INCH				768

//MCU
#define MCU_RX				2
#define MCU_ARM				1
#define MCU_M16C			0
*/

/****************************************************************************
END 
****************************************************************************/



/******************************************************************************************
IMPORT
******************************************************************************************/
//1. Printable Data Handling APIs
extern "C" __declspec(dllimport) void __stdcall ClearSpool();
extern "C" __declspec(dllimport) void __stdcall CompressedBmpSaveSpool(char *bmpFilePath); 
extern "C" __declspec(dllimport) int  __stdcall ControlCommand(BYTE *Cmds, int iLength); 
extern "C" __declspec(dllimport) void __stdcall DataMatrixSaveSpool(int width, int height, int module, char *barcodeData);
extern "C" __declspec(dllimport) void __stdcall GS1DatabarSaveSpool(int type, int n, char * barcodeData);
extern "C" __declspec(dllimport) void __stdcall LoadLogoSaveSpool(int n);
extern "C" __declspec(dllimport) void __stdcall MaxicodeSaveSpool(int mode, char *barcodeData);
extern "C" __declspec(dllimport) void __stdcall MicroPDF417SaveSpool(int width, int column, int row, int ratio, char *barcodeData, BOOL HRI);
extern "C" __declspec(dllimport) void __stdcall NormalBmpSaveSpool(char* bmpFilePath);
extern "C" __declspec(dllimport) void __stdcall OneDimensionBarcodeSaveSpool(BYTE ucBarcodeType,
											int ucBarWidth, int ucBarHeight, BOOL HRI_On, char* barcodeData);
extern "C" __declspec(dllimport) void __stdcall Page_DotFeed(int dots);
extern "C" __declspec(dllimport) void __stdcall Page_DrawBox(int iXPos, int iYPos, int width, int height, int thickness);
extern "C" __declspec(dllimport) void __stdcall Page_DrawLine(int x, int y, int x2, int y2, int thickness);
extern "C" __declspec(dllimport) void __stdcall Page_DrawEllipse(int x, int y, int A_length, int B_length, int thickness);
extern "C" __declspec(dllimport) void __stdcall Page_LineFeed(int lines);
extern "C" __declspec(dllimport) void __stdcall Page_Newline();	
extern "C" __declspec(dllimport) void __stdcall Page_Print();
extern "C" __declspec(dllimport) void __stdcall Page_Print_StandardMode();
extern "C" __declspec(dllimport) void __stdcall PDF417SaveSpool(int width, int column, int level, int ratio, char *barcodeData, BOOL HRI);
extern "C" __declspec(dllimport) void __stdcall PrintData();
extern "C" __declspec(dllimport) void __stdcall PrintDotFeed(int dots);
extern "C" __declspec(dllimport) void __stdcall PrintLineFeed(int lines);
extern "C" __declspec(dllimport) int  __stdcall PrintSpool(BOOL bDelete_Spool = TRUE);
extern "C" __declspec(dllimport) int  __stdcall PrintSpoolForTTF(char* sData,BYTE iXFontSize, BYTE iYFontSize);
extern "C" __declspec(dllimport) void __stdcall QRCodeSaveSpool(int version, char level, int module, char *barcodeData);
extern "C" __declspec(dllimport) void __stdcall TextSaveSpool(char *textData);
extern "C" __declspec(dllimport) void __stdcall TruncatedPDF417SaveSpool(int width, int column, int level, int ratio, char *barcodeData, BOOL HRI)	;

//2. Printer Mode & Setting APIs
extern "C" __declspec(dllimport) void __stdcall GetPrinterModelName();
extern "C" __declspec(dllimport) void __stdcall GetFirmwareVersion();
extern "C" __declspec(dllimport) void __stdcall GetPrinterStatus(int iTimeoutMsec);
extern "C" __declspec(dllimport) void __stdcall GetPrinterStatusEx(int iTimeoutMsec);
extern "C" __declspec(dllimport) void __stdcall InitLineSpace();
extern "C" __declspec(dllimport) void __stdcall InitPageMode(int iXPos, int iYPos, int width, int height);
extern "C" __declspec(dllimport) void __stdcall InitPrinterStatus();
extern "C" __declspec(dllimport) void __stdcall Page_ClearCurrentData();
extern "C" __declspec(dllimport) void __stdcall Page_SetArea(int iXPos,int iYPos, int width, int height);
extern "C" __declspec(dllimport) void __stdcall Page_SetDirection(int n);
extern "C" __declspec(dllimport) void __stdcall Page_SetPosition(int iXPos, int iYPos);
extern "C" __declspec(dllimport) void __stdcall Page_SetStandardMode();
extern "C" __declspec(dllimport) void __stdcall SetAbsPosition(int distance);
extern "C" __declspec(dllimport) void __stdcall SetCharCodeTable(int n, int MCU);
extern "C" __declspec(dllimport) void __stdcall SetCharSpace(int n);
extern "C" __declspec(dllimport) void __stdcall SetFontForTTF(char *ttfFile);
extern "C" __declspec(dllimport) void __stdcall SetFontSize(int n);
extern "C" __declspec(dllimport) void __stdcall SetLineSpace(int n);
extern "C" __declspec(dllimport) void __stdcall SetPageMode();
extern "C" __declspec(dllimport) void __stdcall SetTextAlignment(int n);
extern "C" __declspec(dllimport) void __stdcall SetTextStyle(int underline, BOOL emphasize, int width, int height, BOOL reverse);
extern "C" __declspec(dllimport) void __stdcall SetUpsideDown(BOOL set);

//3. Misc Device Handling APIs
extern "C" __declspec(dllimport) void __stdcall CancelMSRMode();
extern "C" __declspec(dllimport) BOOL __stdcall ClosePrinterConnection();
extern "C" __declspec(dllimport) void __stdcall CancelSCRMode();
extern "C" __declspec(dllimport) int  __stdcall ConnectSerialPrinter(char *sPortName, int iBaudRate=57600,int iTimeoutMsec=200, BOOL bProtocol=FALSE);
extern "C" __declspec(dllimport) int  __stdcall ConnectUSBPrinter(int iTimeoutMsec, BOOL Protoco=FALSE);
extern "C" __declspec(dllimport) int  __stdcall ConnectWirelessPrinter(char *sIP_ADDR, int iPortNum, int iTimeoutMsec, BOOL bProtcol = FALSE);
extern "C" __declspec(dllimport) void __stdcall CutPaper(int mode);
extern "C" __declspec(dllimport) void __stdcall EnterMSRMode(int n);
extern "C" __declspec(dllimport) void __stdcall EnterSCRMode();
extern "C" __declspec(dllimport) void __stdcall FeedToMark();
extern "C" __declspec(dllimport) void __stdcall SetPositionFromMark(int distance);

