
#ifndef ESC_POS_PRINTER_H
#define ESC_POS_PRINTER_H

#include <string>
#if defined(_WIN32) || defined(_WINDOWS) || defined(_BORLAND) || defined(__BORLANDC__)
	#include <windows.h>
#else

#endif

#include "ComPort.h"

class ESC_POS_Printer {
public:

#if defined(_WIN32) || defined(_WINDOWS) || defined(_BORLAND) || defined(__BORLANDC__)
	HANDLE m_hPrinter;
#else
	FILE* m_hPrinter;
#endif
	ComPort* m_Serial;

	ESC_POS_Printer();
	~ESC_POS_Printer();

	bool openSerial(std::string ComNumber);
	bool openUSB(std::wstring printerName);
	bool openUSB(std::string printerName);
	bool close();

	bool Start();
	bool printImage(int width, int height, unsigned char* bitArray);
	bool Feed(); //Прокрутить бумагу
	bool Cut(); //Отрезать бумагу
	bool End();
private:
	bool m_usb;
};

#endif
