43 lines
1.3 KiB
C++
43 lines
1.3 KiB
C++
#ifndef __HGLIBDEVICEIMPL_HPP__
|
|
#define __HGLIBDEVICEIMPL_HPP__
|
|
|
|
#include "HGScannerLib.h"
|
|
#include "base/HGLock.h"
|
|
#include "sane/sane_ex.h"
|
|
#include "sane/sane_option_definitions.h"
|
|
#include <vector>
|
|
#include <string>
|
|
|
|
class HGLibDeviceImpl
|
|
{
|
|
public:
|
|
HGLibDeviceImpl();
|
|
~HGLibDeviceImpl();
|
|
|
|
static HGBool Init(HGLibDeviceHotPlugEventFunc func, HGPointer param);
|
|
static HGBool Deinit();
|
|
static HGChar** GetNameList();
|
|
static HGBool ReleaseNameList(HGChar** deviceName);
|
|
|
|
HGBool Open(const HGChar* deviceName);
|
|
HGBool Close();
|
|
HGBool SetParam(const HGLibDeviceSetParam* param, HGUInt count);
|
|
HGLibDeviceGetParamGroup* GetParamGroupList(HGUInt* count);
|
|
static HGBool ReleaseParamGroupList(HGLibDeviceGetParamGroup* paramGroup, HGUInt count);
|
|
HGBool ResetParam();
|
|
HGBool StartScan(HGLibDeviceScanEventFunc eventFunc, HGPointer eventParam,
|
|
HGLibDeviceScanImageFunc imageFunc, HGPointer imageParam);
|
|
HGBool StopScan();
|
|
|
|
private:
|
|
static int sane_ex_callback(SANE_Handle hdev, int code, void* data, unsigned int* len, void* param);
|
|
|
|
private:
|
|
static HGLock m_lock;
|
|
static HGLibDeviceHotPlugEventFunc m_hotPlugEventFunc;
|
|
static HGPointer m_hotPlugEventParam;
|
|
static HGBool m_init;
|
|
static std::vector<std::string> m_devNameList;
|
|
};
|
|
|
|
#endif /* __HGLIBDEVICEIMPL_HPP__ */ |