LibreOffice Module extensions (master) 1
|
#include <sane.hxx>
Public Member Functions | |
Sane () | |
~Sane () | |
bool | IsOpen () const |
OUString | GetOptionName (int n) |
OUString | GetOptionTitle (int n) |
SANE_Value_Type | GetOptionType (int n) |
SANE_Unit | GetOptionUnit (int n) |
OUString | GetOptionUnitName (int n) |
SANE_Int | GetOptionCap (int n) |
SANE_Constraint_Type | GetOptionConstraintType (int n) |
const char ** | GetStringConstraint (int n) |
int | GetRange (int, std::unique_ptr< double[]> &) |
int | GetOptionElements (int n) |
int | GetOptionByName (const char *) |
bool | GetOptionValue (int, bool &) |
bool | GetOptionValue (int, OString &) |
bool | GetOptionValue (int, double &, int nElement=0) |
bool | GetOptionValue (int, double *) |
void | SetOptionValue (int, bool) |
void | SetOptionValue (int, std::u16string_view) |
void | SetOptionValue (int, double, int nElement=0) |
void | SetOptionValue (int, double const *) |
bool | ActivateButtonOption (int) |
int | CountOptions () |
int | GetDeviceNumber () const |
bool | Open (const char *) |
bool | Open (int) |
void | Close () |
void | ReloadDevices () |
void | ReloadOptions () |
bool | Start (BitmapTransporter &) |
Link< Sane &, void > | SetReloadOptionsHdl (const Link< Sane &, void > &rLink) |
Static Public Member Functions | |
static bool | IsSane () |
static int | CountDevices () |
static OUString | GetName (int n) |
static OUString | GetVendor (int n) |
static OUString | GetModel (int n) |
static OUString | GetType (int n) |
Private Member Functions | |
SANE_Status | ControlOption (int, SANE_Action, void *) |
bool | CheckConsistency (const char *, bool bInit=false) |
Static Private Member Functions | |
static oslGenericFunction | LoadSymbol (const char *) |
static void | Init () |
static void | DeInit () |
Private Attributes | |
std::unique_ptr< const SANE_Option_Descriptor *[]> | mppOptions |
int | mnOptions |
int | mnDevice |
SANE_Handle | maHandle |
Link< Sane &, void > | maReloadOptionsLink |
Static Private Attributes | |
static int | nRefCount = 0 |
static oslModule | pSaneLib = nullptr |
static SANE_Status(* | p_init )(SANE_Int *, SANE_Auth_Callback) = nullptr |
static void(* | p_exit )() = nullptr |
static SANE_Status(* | p_get_devices )(const SANE_Device ***, SANE_Bool) = nullptr |
static SANE_Status(* | p_open )(SANE_String_Const, SANE_Handle) = nullptr |
static void(* | p_close )(SANE_Handle) = nullptr |
static const SANE_Option_Descriptor *(* | p_get_option_descriptor )(SANE_Handle, SANE_Int) = nullptr |
static SANE_Status(* | p_control_option )(SANE_Handle, SANE_Int, SANE_Action, void *, SANE_Int *) = nullptr |
static SANE_Status(* | p_get_parameters )(SANE_Handle, SANE_Parameters *) = nullptr |
static SANE_Status(* | p_start )(SANE_Handle) = nullptr |
static SANE_Status(* | p_read )(SANE_Handle, SANE_Byte *, SANE_Int, SANE_Int *) = nullptr |
static void(* | p_cancel )(SANE_Handle) = nullptr |
static SANE_Status(* | p_set_io_mode )(SANE_Handle, SANE_Bool) = nullptr |
static SANE_Status(* | p_get_select_fd )(SANE_Handle, SANE_Int *) = nullptr |
static SANE_String_Const(* | p_strstatus )(SANE_Status) = nullptr |
static SANE_Int | nVersion = 0 |
static SANE_Device ** | ppDevices = nullptr |
static int | nDevices = 0 |
Sane::~Sane | ( | ) |
bool Sane::ActivateButtonOption | ( | int | n | ) |
Definition at line 990 of file sane.cxx.
References ControlOption(), and n.
|
private |
Definition at line 511 of file sane.cxx.
References dbg_msg(), and mppOptions.
Referenced by ReloadOptions(), and Start().
void Sane::Close | ( | ) |
Definition at line 320 of file sane.cxx.
References maHandle, mnDevice, mppOptions, and p_close.
Referenced by SaneDlg::InitDevices(), SaneDlg::LoadState(), ReloadDevices(), and ~Sane().
|
private |
Definition at line 120 of file sane.cxx.
References dbg_msg(), DUMP_STATE, GetOptionName(), maHandle, OUStringToOString(), p_control_option, pData, and ReloadOptions().
Referenced by ActivateButtonOption(), GetOptionValue(), and SetOptionValue().
|
inlinestatic |
Definition at line 115 of file sane.hxx.
References nDevices.
Referenced by IMPL_LINK(), SaneDlg::InitDevices(), and SaneDlg::LoadState().
|
inline |
|
staticprivate |
|
inline |
|
inlinestatic |
|
inlinestatic |
Definition at line 117 of file sane.hxx.
References n, name, and ppDevices.
Referenced by IMPL_LINK(), SaneDlg::InitDevices(), and SaneDlg::LoadState().
int Sane::GetOptionByName | ( | const char * | rName | ) |
Definition at line 331 of file sane.cxx.
References i, mnOptions, mppOptions, and name.
Referenced by SaneDlg::AcquirePreview(), SaneDlg::InitFields(), SaneDlg::LoadState(), SaneDlg::SaveState(), SaneDlg::SetAdjustedNumericalValue(), and Start().
|
inline |
Definition at line 135 of file sane.hxx.
References mppOptions, and n.
Referenced by SaneDlg::InitFields().
|
inline |
Definition at line 137 of file sane.hxx.
References mppOptions, and n.
Definition at line 172 of file sane.hxx.
References mppOptions, n, and type.
Referenced by SaneDlg::SaveState(), and SaneDlg::SetAdjustedNumericalValue().
|
inline |
Definition at line 126 of file sane.hxx.
References mppOptions, n, and name.
Referenced by ControlOption(), SaneDlg::EstablishBoolOption(), SaneDlg::EstablishButtonOption(), SaneDlg::EstablishNumericOption(), SaneDlg::EstablishQuantumRange(), SaneDlg::EstablishStringOption(), SaneDlg::EstablishStringRange(), and SaneDlg::InitFields().
|
inline |
Definition at line 128 of file sane.hxx.
References mppOptions, and n.
Referenced by SaneDlg::InitFields().
|
inline |
Definition at line 130 of file sane.hxx.
References mppOptions, and n.
Referenced by SaneDlg::InitFields(), and SaneDlg::SaveState().
|
inline |
Definition at line 132 of file sane.hxx.
References mppOptions, and n.
Referenced by SaneDlg::InitFields(), and Start().
OUString Sane::GetOptionUnitName | ( | int | n | ) |
Definition at line 978 of file sane.cxx.
References mppOptions, n, ppUnits, and SAL_N_ELEMENTS.
Referenced by SaneDlg::EstablishNumericOption(), and SaneDlg::EstablishQuantumRange().
bool Sane::GetOptionValue | ( | int | n, |
bool & | rRet | ||
) |
Definition at line 343 of file sane.cxx.
References ControlOption(), maHandle, mppOptions, n, and type.
Referenced by SaneDlg::EstablishBoolOption(), SaneDlg::EstablishNumericOption(), SaneDlg::EstablishQuantumRange(), SaneDlg::EstablishStringOption(), SaneDlg::EstablishStringRange(), SaneDlg::InitFields(), SaneDlg::SaveState(), and Start().
Definition at line 371 of file sane.cxx.
References ControlOption(), maHandle, mppOptions, n, size, and type.
bool Sane::GetOptionValue | ( | int | n, |
double * | pSet | ||
) |
Definition at line 392 of file sane.cxx.
References ControlOption(), i, maHandle, mppOptions, n, size, and type.
bool Sane::GetOptionValue | ( | int | n, |
OString & | rRet | ||
) |
Definition at line 356 of file sane.cxx.
References ControlOption(), maHandle, mppOptions, n, size, and type.
Definition at line 902 of file sane.cxx.
References dbg_msg(), i, mppOptions, n, and name.
Referenced by SaneDlg::EstablishQuantumRange(), SaneDlg::InitFields(), and SaneDlg::SetAdjustedNumericalValue().
|
inline |
Definition at line 139 of file sane.hxx.
References mppOptions, and n.
Referenced by SaneDlg::EstablishStringRange().
|
inlinestatic |
|
inlinestatic |
|
staticprivate |
Definition at line 170 of file sane.cxx.
References bSaneSymbolLoadFailed, DeInit(), FAIL_SHUTDOWN_STATE, LoadSymbol(), nDevices, nVersion, p_cancel, p_close, p_control_option, p_exit, p_get_devices, p_get_option_descriptor, p_get_parameters, p_get_select_fd, p_init, p_open, p_read, p_set_io_mode, p_start, p_strstatus, ppDevices, pSaneLib, and SAL_DLLEXTENSION.
Referenced by ReloadDevices(), and Sane().
|
inline |
Definition at line 113 of file sane.hxx.
References maHandle.
Referenced by SaneDlg::AcquirePreview(), SaneDlg::InitDevices(), SaneDlg::InitFields(), SaneDlg::LoadState(), ReloadDevices(), ReloadOptions(), SaneDlg::SetAdjustedNumericalValue(), SaneDlg::UpdateScanArea(), and ~Sane().
|
inlinestatic |
Definition at line 111 of file sane.hxx.
References pSaneLib.
Referenced by ScannerManager::getAvailableScanners(), IMPL_LINK(), IMPL_LINK_NOARG(), SaneDlg::InitDevices(), SaneDlg::InitFields(), SaneDlg::LoadState(), SaneDlg::run(), SaneDlg::SaneDlg(), SaneDlg::SaveState(), and SaneDlg::SetAdjustedNumericalValue().
|
inlinestaticprivate |
Definition at line 108 of file sane.cxx.
References bSaneSymbolLoadFailed, and pSaneLib.
Referenced by Init().
bool Sane::Open | ( | const char * | name | ) |
Definition at line 287 of file sane.cxx.
References FAIL_STATE, i, maHandle, mnDevice, name, nDevices, p_open, ppDevices, and ReloadOptions().
Referenced by SaneDlg::InitDevices(), SaneDlg::LoadState(), and Open().
bool Sane::Open | ( | int | n | ) |
void Sane::ReloadDevices | ( | ) |
void Sane::ReloadOptions | ( | ) |
Definition at line 262 of file sane.cxx.
References Link< typename Arg, typename Ret >::Call(), CheckConsistency(), i, IsOpen(), maHandle, o3tl::make_unsigned(), maReloadOptionsLink, mnOptions, mppOptions, p_control_option, p_get_option_descriptor, and p_strstatus.
Referenced by ControlOption(), Open(), and Start().
void Sane::SetOptionValue | ( | int | n, |
bool | bSet | ||
) |
Definition at line 412 of file sane.cxx.
References ControlOption(), maHandle, mppOptions, n, and type.
Referenced by SaneDlg::AcquirePreview(), SaneDlg::LoadState(), and SaneDlg::SetAdjustedNumericalValue().
void Sane::SetOptionValue | ( | int | n, |
double const * | pSet | ||
) |
Definition at line 455 of file sane.cxx.
References ControlOption(), i, maHandle, mppOptions, n, size, and type.
Definition at line 428 of file sane.cxx.
References ControlOption(), maHandle, mppOptions, n, size, and type.
void Sane::SetOptionValue | ( | int | n, |
std::u16string_view | rSet | ||
) |
Definition at line 420 of file sane.cxx.
References ControlOption(), maHandle, mppOptions, n, OUStringToOString(), rSet, and type.
Definition at line 183 of file sane.hxx.
References maReloadOptionsLink.
Referenced by SaneDlg::SaneDlg(), and SaneDlg::~SaneDlg().
bool Sane::Start | ( | BitmapTransporter & | rBitmap | ) |
Definition at line 537 of file sane.cxx.
References BYTE_BUFFER_SIZE, CheckConsistency(), dbg_msg(), DUMP_STATE, utl::TempFileNamed::EnableKillingFile(), eType, FILE, utl::TempFileNamed::GetFileName(), GetOptionByName(), GetOptionUnit(), GetOptionValue(), BitmapTransporter::getStream(), i, BitmapTransporter::lock(), maHandle, nPos, nValue, OUStringToOString(), p_cancel, p_get_parameters, p_get_select_fd, p_read, p_set_io_mode, p_start, ReadValue(), ReloadOptions(), SAL_INFO, SAL_WARN, SvStream::Seek(), SvStream::SeekRel(), SvStream::SetEndian(), SvStream::Tell(), SvMemoryStream::TellEnd(), BitmapTransporter::unlock(), SvStream::WriteBytes(), SvStream::WriteChar(), SvStream::WriteUChar(), SvStream::WriteUInt16(), and SvStream::WriteUInt32().
Referenced by SaneDlg::AcquirePreview().
|
private |
Definition at line 94 of file sane.hxx.
Referenced by Close(), ControlOption(), GetOptionValue(), IsOpen(), Open(), ReloadOptions(), SetOptionValue(), and Start().
Definition at line 96 of file sane.hxx.
Referenced by ReloadOptions(), and SetReloadOptionsHdl().
|
private |
Definition at line 93 of file sane.hxx.
Referenced by Close(), GetDeviceNumber(), and Open().
|
private |
Definition at line 92 of file sane.hxx.
Referenced by CountOptions(), GetOptionByName(), and ReloadOptions().
|
private |
Definition at line 91 of file sane.hxx.
Referenced by CheckConsistency(), Close(), GetOptionByName(), GetOptionCap(), GetOptionConstraintType(), GetOptionElements(), GetOptionName(), GetOptionTitle(), GetOptionType(), GetOptionUnit(), GetOptionUnitName(), GetOptionValue(), GetRange(), GetStringConstraint(), ReloadOptions(), and SetOptionValue().
|
staticprivate |
Definition at line 89 of file sane.hxx.
Referenced by CountDevices(), Init(), and Open().
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
Definition at line 74 of file sane.hxx.
Referenced by ControlOption(), Init(), and ReloadOptions().
|
staticprivate |
|
staticprivate |
|
staticprivate |
Definition at line 72 of file sane.hxx.
Referenced by Init(), and ReloadOptions().
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
Definition at line 85 of file sane.hxx.
Referenced by Init(), and ReloadOptions().
|
staticprivate |
Definition at line 88 of file sane.hxx.
Referenced by GetModel(), GetName(), GetType(), GetVendor(), Init(), and Open().
|
staticprivate |