#pragma once

 #include "bombax.h"
 //#include "..\incs\sst\ucb.h"


//该类支持硬件扫码枪进行扫码，串口
//该类目前只是定义了一些基本变量，并没有实际扫描功能
//需要子类完成具体的扫描功能，Trigger接口
class  BOMBAX_API CBarcodeScanner/*: public CCaliber*/
{
public:
	CBarcodeScanner(void); 
	virtual ~CBarcodeScanner(void);
	
	enum
	{
		BS_UNKNOWN     =      -1,
		BS_PARTIAL     =      1,  /**< intermediate status */
		BS_EAN8        =      8,  /**< EAN-8 */
		BS_UPCE        =      9,  /**< UPC-E */
		BS_ISBN10      =     10,  /**< ISBN-10 (from EAN-13). @since 0.4 */
		BS_UPCA        =     12,  /**< UPC-A */
		BS_EAN13       =     13,  /**< EAN-13 */
		BS_ISBN13      =     14,  /**< ISBN-13 (from EAN-13). @since 0.4 */
		BS_I25         =     25,  /**< Interleaved 2 of 5. @since 0.4 */
		BS_CODE39      =     39,  /**< Code 39. @since 0.4 */
		BS_PDF417      =     57,  /**< PDF417. @since 0.6 (当前版本并不支持)*/ 
		BS_QRCODE      =     64,  /**< QR Code. @since 0.10 */
		BS_CODE128     =    128,  /**< Code 128 */
		BS_DATAMATRIX  =    200,  /*DataMatrix*/
	};
	 
	BOOL   Open(int portIndex);
	void   Close();

	BOOL    Trigger(int timeout);

	int         GetCodeType(){ return m_nCodeType;};
	const TCHAR* GetContent(){ return m_strContent; };

public:
	int m_nTimeout ;
	int m_nVendor; //厂家,保留
	int m_nPortIndex;

protected:
	//下面的不需要保存临时变量
	CUtString m_strContent;

	int       m_nCodeType;

	HANDLE m_hPort;

};


