code_twain/sane/DlgSetting.h

65 lines
1.3 KiB
C
Raw Normal View History

#pragma once
#include <Windows.h>
#include <string>
#include <vector>
#include <sane/sane_ex.h>
#include "DlgPage.h"
// CDlgIndicator 对话框
//#define USE_SOLE_WIN_THREAD
#ifdef USE_SOLE_WIN_THREAD
#include <thread>
#include <memory>
#endif
2022-07-01 07:24:58 +00:00
namespace gb
{
class sane_config;
}
class dlg_setting : public dlg_base
{
SANEAPI sane_api_;
SANE_Handle sane_dev_;
bool with_scan_;
unsigned int papers_;
unsigned int images_;
bool err_;
2022-06-21 09:23:26 +00:00
int id_help_;
int id_restore_;
2022-07-01 07:24:58 +00:00
gb::sane_config* cfg_;
std::wstring cfg_file_;
HWND tab_;
#ifdef USE_SOLE_WIN_THREAD
std::unique_ptr<std::thread> thread_;
#endif
BOOL handle_message(UINT msg, WPARAM wp, LPARAM lp) override;
void handle_command(WORD code, WORD id, HANDLE ctrl);
void notify_over(void);
void on_init_dialog(void);
2022-06-21 09:23:26 +00:00
BOOL on_notify(int ctrl_id, LPNMHDR pnmh);
int get_tab_count(void);
dlg_page* add_tab(const char* utf8_title);
dlg_page* get_page(int index);
dlg_page* get_page(const char* utf8_title);
dlg_page* select_page(int index);
void refresh_controls(int src_sn);
public:
dlg_setting(HWND parent, LPSANEAPI api, SANE_Handle dev, bool with_scan, const wchar_t* name);
~dlg_setting();
public:
2022-07-01 07:24:58 +00:00
void set_config(gb::sane_config* cfg, const wchar_t* file);
HWND window(void);
HWND parent(void);
2022-07-01 07:24:58 +00:00
//void show(void);
void hide(void);
void notify_scan_over(void);
};