2022-05-03 10:25:52 +00:00
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
#include "sane/sane_ex.h"
|
2022-10-28 01:03:22 +00:00
|
|
|
|
#include "cfg/gb_json.h"
|
2022-05-03 10:25:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class sane_dev
|
|
|
|
|
{
|
|
|
|
|
SANE_Handle hdev_;
|
|
|
|
|
bool offline_;
|
|
|
|
|
std::string name_;
|
|
|
|
|
std::string cfg_name_;
|
|
|
|
|
|
|
|
|
|
enum act_result
|
|
|
|
|
{
|
|
|
|
|
ACT_RESULT_NO_NEED = 0,
|
|
|
|
|
ACT_RESULT_FAILED,
|
|
|
|
|
ACT_RESULT_SUCCESS,
|
|
|
|
|
};
|
|
|
|
|
|
2022-10-28 01:03:22 +00:00
|
|
|
|
bool apply(gb::sane_config_schm* schm);
|
2022-05-03 10:25:52 +00:00
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
sane_dev();
|
|
|
|
|
~sane_dev();
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
std::string name(void);
|
|
|
|
|
std::string current_configuration_name(void);
|
|
|
|
|
bool is_online(void);
|
|
|
|
|
SANE_Handle handle(void);
|
|
|
|
|
|
|
|
|
|
bool open(const std::string& name);
|
|
|
|
|
void set_online(bool online);
|
|
|
|
|
void close(void);
|
|
|
|
|
};
|