67 lines
1.2 KiB
C++
67 lines
1.2 KiB
C++
#pragma once
|
|
|
|
|
|
// CDlgTwain dialog
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
|
|
typedef struct _san_opt
|
|
{
|
|
std::wstring name_key;
|
|
std::wstring name;
|
|
std::wstring title_key;
|
|
std::wstring title;
|
|
}SANEOPT;
|
|
typedef struct _opt_used
|
|
{
|
|
std::wstring name_key; // same as SANEOPT::name_key
|
|
std::string id_key;
|
|
int id; // ID of CAP_SANE_EX_xxx
|
|
|
|
bool operator==(const wchar_t* key)
|
|
{
|
|
return name_key == key;
|
|
}
|
|
bool operator==(const char* key)
|
|
{
|
|
return id_key == key;
|
|
}
|
|
bool operator==(const int eid)
|
|
{
|
|
return eid == id;
|
|
}
|
|
bool operator<(const struct _opt_used& r)
|
|
{
|
|
return id < r.id;
|
|
}
|
|
}OPTUSED;
|
|
|
|
class CDlgTwain : public CDialogEx
|
|
{
|
|
DECLARE_DYNAMIC(CDlgTwain)
|
|
|
|
public:
|
|
CDlgTwain(CWnd* pParent = NULL); // standard constructor
|
|
virtual ~CDlgTwain();
|
|
|
|
// Dialog Data
|
|
enum { IDD = IDD_ADD_TWAIN_ATTR };
|
|
|
|
std::vector<SANEOPT> opts_;
|
|
std::vector<OPTUSED> used_;
|
|
std::wstring root_;
|
|
|
|
protected:
|
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
|
virtual BOOL OnInitDialog();
|
|
void on_sln_path_changed(void);
|
|
void synchronize_opt(const SANEOPT& opt);
|
|
|
|
DECLARE_MESSAGE_MAP()
|
|
public:
|
|
afx_msg void OnBnClickedButtonBrowse();
|
|
afx_msg void OnBnClickedButtonAdd();
|
|
CComboBox sane_;
|
|
};
|