code_app/app/scanner/device_user.h

128 lines
2.7 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef __DEVICE_USER_H__
#define __DEVICE_USER_H__
#include "base/HGDef.h"
#include <QDialog>
#if defined (HG_CMP_MSC)
#include "twain_user/HGTwain.h"
class DeviceUserMgr : public QObject
{
Q_OBJECT
public:
DeviceUserMgr(QString password, QWidget *wnd);
~DeviceUserMgr();
// 弹出设备选择对话框选择twain源
class DeviceUser* OpenDeviceUser();
private:
QWidget *m_wnd;
HGTwainDSM m_twainDSM;
QString m_password;
};
class DeviceUser : public QObject
{
Q_OBJECT
friend class DeviceUserMgr;
DeviceUser(QWidget *wnd, HGTwainDS ds, QString password);
public:
~DeviceUser();
// 获取设备名字
QString GetName();
// 弹出配置对话框
HGResult ShowSettingDlg();
// 弹出扫描对话框
HGResult StartScan();
HGResult StartSingleScan();
HGResult StopScan();
HGResult GetDeviceCustomInfo(HGTwainDeviceCustomInfo *info);
HGResult Login();
HGResult Logout();
HGResult ClearRollerCount();
QString GetDriverLog();
HGResult ClearDriverLog();
QString GetDeviceLog();
HGResult ClearDeviceLog();
private:
static void HGAPI DSCloseReqFunc(HGTwainDS ds, HGPointer param);
static void HGAPI DSImageFunc(HGTwainDS ds, HGImage image, HGPointer param);
signals:
void newImage(void *image);
private:
QWidget *m_wnd;
HGTwainDS m_twainDS;
QString m_password;
};
#else
#include "sane_user/HGSane.h"
class DeviceUserMgr : public QObject
{
Q_OBJECT
public:
DeviceUserMgr(QString password, QWidget *wnd);
~DeviceUserMgr();
// 弹出设备选择对话框,选择设备
class DeviceUser* OpenDeviceUser();
private:
QWidget *m_wnd;
QString m_password;
HGSaneManager m_saneMgr;
};
class DeviceUser : public QObject
{
Q_OBJECT
friend class DeviceUserMgr;
DeviceUser(QWidget *wnd, HGSaneSource source, HGSaneDevice dev, QString password);
public:
~DeviceUser();
// 获取设备名字
QString GetName();
// 弹出配置对话框
HGResult ShowSettingDlg();
// 弹出扫描对话框
HGResult StartScan();
HGResult StartSingleScan();
HGResult StopScan();
HGResult GetDeviceCustomInfo(HGSaneCustomInfo *info);
HGResult Login();
HGResult Logout();
HGResult ClearRollerCount();
QString GetDriverLogPath();
HGResult ClearDriverLog();
QString GetDeviceLogPath();
HGResult ClearDeviceLog();
private:
static void HGAPI DeviceImageFunc(HGSaneDevice dev, HGImage image, HGPointer param);
signals:
void newImage(void *image);
private:
QWidget *m_wnd;
HGSaneSource m_source;
HGSaneDevice m_saneDev;
QString m_password;
};
#endif
#endif /* __DEVICE_USER_H__ */