Sane Class Reference

#include <sane.hxx>

List of all members.

Public Member Functions

 Sane ()
 ~Sane ()
BOOL IsOpen ()
String GetOptionName (int n)
String GetOptionTitle (int n)
SANE_Value_Type GetOptionType (int n)
SANE_Unit GetOptionUnit (int n)
String GetOptionUnitName (int n)
SANE_Int GetOptionCap (int n)
SANE_Constraint_Type GetOptionConstraintType (int n)
const char ** GetStringConstraint (int n)
int GetRange (int, double *&)
int GetOptionElements (int n)
int GetOptionByName (const char *)
BOOL GetOptionValue (int, BOOL &)
BOOL GetOptionValue (int, ByteString &)
BOOL GetOptionValue (int, double &, int nElement=0)
BOOL GetOptionValue (int, double *)
BOOL SetOptionValue (int, BOOL)
BOOL SetOptionValue (int, const String &)
BOOL SetOptionValue (int, double, int nElement=0)
BOOL SetOptionValue (int, double *)
BOOL ActivateButtonOption (int)
int CountOptions ()
int GetDeviceNumber ()
BOOL Open (const char *)
BOOL Open (int)
void Close ()
void ReloadDevices ()
void ReloadOptions ()
BOOL Start (BitmapTransporter &)
Link SetReloadOptionsHdl (const Link &rLink)

Static Public Member Functions

static BOOL IsSane ()
static int CountDevices ()
static String GetName (int n)
static String GetVendor (int n)
static String GetModel (int n)
static String GetType (int n)

Private Member Functions

oslGenericFunction LoadSymbol (const char *)
void Init ()
void DeInit ()
void Stop ()
SANE_Status ControlOption (int, SANE_Action, void *)
BOOL CheckConsistency (const char *, BOOL bInit=FALSE)

Private Attributes

const SANE_Option_Descriptor ** mppOptions
int mnOptions
int mnDevice
SANE_Handle maHandle
Link maReloadOptionsLink

Static Private Attributes

static int nRefCount
static oslModule pSaneLib
static SANE_Status(* p_init )(SANE_Int *, SANE_Auth_Callback)
static void(* p_exit )()
static SANE_Status(* p_get_devices )(const SANE_Device ***, SANE_Bool)
static SANE_Status(* p_open )(SANE_String_Const, SANE_Handle)
static void(* p_close )(SANE_Handle)
static const SANE_Option_Descriptor *(* p_get_option_descriptor )(SANE_Handle, SANE_Int)
static SANE_Status(* p_control_option )(SANE_Handle, SANE_Int, SANE_Action, void *, SANE_Int *)
static SANE_Status(* p_get_parameters )(SANE_Handle, SANE_Parameters *)
static SANE_Status(* p_start )(SANE_Handle)
static SANE_Status(* p_read )(SANE_Handle, SANE_Byte *, SANE_Int, SANE_Int *)
static void(* p_cancel )(SANE_Handle)
static SANE_Status(* p_set_io_mode )(SANE_Handle, SANE_Bool)
static SANE_Status(* p_get_select_fd )(SANE_Handle, SANE_Int *)
static const SANE_String_Const(* p_strstatus )(SANE_Status)
static SANE_Int nVersion
static SANE_Device ** ppDevices
static int nDevices


Detailed Description

Definition at line 79 of file sane.hxx.


Constructor & Destructor Documentation

Sane::Sane (  ) 

Definition at line 175 of file sane.cxx.

References Init(), nRefCount, and pSaneLib.

Sane::~Sane (  ) 

Definition at line 186 of file sane.cxx.

References Close(), DeInit(), IsOpen(), nRefCount, and pSaneLib.


Member Function Documentation

oslGenericFunction Sane::LoadSymbol ( const char *   )  [inline, private]

Definition at line 130 of file sane.cxx.

References bSaneSymbolLoadFailed, and pSaneLib.

Referenced by Init().

void Sane::Init (  )  [private]

Definition at line 195 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, and pSaneLib.

Referenced by ReloadDevices(), and Sane().

void Sane::DeInit (  )  [private]

Definition at line 266 of file sane.cxx.

References p_exit, and pSaneLib.

Referenced by Init(), ReloadDevices(), and ~Sane().

void Sane::Stop (  )  [private]

Definition at line 360 of file sane.cxx.

References Close(), maHandle, mnDevice, and Open().

SANE_Status Sane::ControlOption ( int  ,
SANE_Action  ,
void *   
) [private]

Definition at line 142 of file sane.cxx.

References dbg_msg(), DUMP_STATE, GetOptionName(), maHandle, p_control_option, and ReloadOptions().

Referenced by ActivateButtonOption(), GetOptionValue(), and SetOptionValue().

BOOL Sane::CheckConsistency ( const char *  ,
BOOL  bInit = FALSE 
) [private]

Definition at line 557 of file sane.cxx.

References dbg_msg(), and mppOptions.

Referenced by ReloadOptions(), and Start().

static BOOL Sane::IsSane (  )  [inline, static]

Definition at line 132 of file sane.hxx.

References pSaneLib.

Referenced by SaneDlg::Execute(), IMPL_LINK(), SaneDlg::InitDevices(), SaneDlg::InitFields(), SaneDlg::LoadState(), SaneDlg::SaneDlg(), SaneDlg::SaveState(), SEQ(), and SaneDlg::SetAdjustedNumericalValue().

BOOL Sane::IsOpen (  )  [inline]

Definition at line 134 of file sane.hxx.

References maHandle.

Referenced by SaneDlg::AcquirePreview(), SaneDlg::InitDevices(), SaneDlg::InitFields(), SaneDlg::LoadState(), ReloadDevices(), ReloadOptions(), ScannerThread::run(), SaneDlg::SetAdjustedNumericalValue(), SaneDlg::UpdateScanArea(), and ~Sane().

static int Sane::CountDevices (  )  [inline, static]

Definition at line 136 of file sane.hxx.

References nDevices.

Referenced by IMPL_LINK(), SaneDlg::InitDevices(), and SaneDlg::LoadState().

static String Sane::GetName ( int  n  )  [inline, static]

Definition at line 138 of file sane.hxx.

References ppDevices.

Referenced by IMPL_LINK(), SaneDlg::InitDevices(), and SaneDlg::LoadState().

static String Sane::GetVendor ( int  n  )  [inline, static]

Definition at line 140 of file sane.hxx.

References ppDevices.

Referenced by IMPL_LINK().

static String Sane::GetModel ( int  n  )  [inline, static]

Definition at line 142 of file sane.hxx.

References ppDevices.

Referenced by IMPL_LINK().

static String Sane::GetType ( int  n  )  [inline, static]

Definition at line 144 of file sane.hxx.

References ppDevices.

Referenced by IMPL_LINK().

String Sane::GetOptionName ( int  n  )  [inline]

Definition at line 147 of file sane.hxx.

References mppOptions.

Referenced by ControlOption(), SaneDlg::EstablishBoolOption(), SaneDlg::EstablishButtonOption(), SaneDlg::EstablishNumericOption(), SaneDlg::EstablishQuantumRange(), SaneDlg::EstablishStringOption(), SaneDlg::EstablishStringRange(), SaneDlg::InitFields(), and SaneDlg::SaveState().

String Sane::GetOptionTitle ( int  n  )  [inline]

Definition at line 149 of file sane.hxx.

References mppOptions.

Referenced by SaneDlg::InitFields().

SANE_Value_Type Sane::GetOptionType ( int  n  )  [inline]

Definition at line 151 of file sane.hxx.

References mppOptions.

Referenced by SaneDlg::InitFields(), and SaneDlg::SaveState().

SANE_Unit Sane::GetOptionUnit ( int  n  )  [inline]

Definition at line 153 of file sane.hxx.

References mppOptions.

Referenced by SaneDlg::InitFields(), and Start().

String Sane::GetOptionUnitName ( int  n  ) 

Definition at line 999 of file sane.cxx.

References mppOptions.

Referenced by SaneDlg::EstablishNumericOption(), and SaneDlg::EstablishQuantumRange().

SANE_Int Sane::GetOptionCap ( int  n  )  [inline]

Definition at line 156 of file sane.hxx.

References mppOptions.

Referenced by SaneDlg::InitFields().

SANE_Constraint_Type Sane::GetOptionConstraintType ( int  n  )  [inline]

Definition at line 158 of file sane.hxx.

References mppOptions.

const char** Sane::GetStringConstraint ( int  n  )  [inline]

Definition at line 160 of file sane.hxx.

References mppOptions.

Referenced by SaneDlg::EstablishStringRange().

int Sane::GetRange ( int  ,
double *&   
)

Definition at line 923 of file sane.cxx.

References dbg_msg(), and mppOptions.

Referenced by SaneDlg::EstablishQuantumRange(), SaneDlg::InitFields(), and SaneDlg::SetAdjustedNumericalValue().

int Sane::GetOptionElements ( int  n  )  [inline]

Definition at line 192 of file sane.hxx.

References mppOptions.

Referenced by SaneDlg::SaveState(), and SaneDlg::SetAdjustedNumericalValue().

int Sane::GetOptionByName ( const char *   ) 

Definition at line 370 of file sane.cxx.

References mnOptions, and mppOptions.

Referenced by SaneDlg::AcquirePreview(), SaneDlg::InitFields(), SaneDlg::LoadState(), ScannerThread::run(), SaneDlg::SaveState(), SaneDlg::SetAdjustedNumericalValue(), and Start().

BOOL Sane::GetOptionValue ( int  ,
BOOL &   
)

Definition at line 382 of file sane.cxx.

References ControlOption(), maHandle, and mppOptions.

Referenced by SaneDlg::EstablishBoolOption(), SaneDlg::EstablishNumericOption(), SaneDlg::EstablishQuantumRange(), SaneDlg::EstablishStringOption(), SaneDlg::EstablishStringRange(), SaneDlg::InitFields(), SaneDlg::SaveState(), and Start().

BOOL Sane::GetOptionValue ( int  ,
ByteString &   
)

Definition at line 395 of file sane.cxx.

References ControlOption(), maHandle, and mppOptions.

BOOL Sane::GetOptionValue ( int  ,
double &  ,
int  nElement = 0 
)

Definition at line 411 of file sane.cxx.

References ControlOption(), maHandle, and mppOptions.

BOOL Sane::GetOptionValue ( int  ,
double *   
)

Definition at line 433 of file sane.cxx.

References ControlOption(), maHandle, and mppOptions.

BOOL Sane::SetOptionValue ( int  ,
BOOL   
)

Definition at line 457 of file sane.cxx.

References ControlOption(), maHandle, and mppOptions.

Referenced by SaneDlg::AcquirePreview(), SaneDlg::LoadState(), ScannerThread::run(), and SaneDlg::SetAdjustedNumericalValue().

BOOL Sane::SetOptionValue ( int  ,
const String &   
)

Definition at line 468 of file sane.cxx.

References ControlOption(), maHandle, and mppOptions.

BOOL Sane::SetOptionValue ( int  ,
double  ,
int  nElement = 0 
)

Definition at line 479 of file sane.cxx.

References ControlOption(), maHandle, and mppOptions.

BOOL Sane::SetOptionValue ( int  ,
double *   
)

Definition at line 513 of file sane.cxx.

References ControlOption(), maHandle, and mppOptions.

BOOL Sane::ActivateButtonOption ( int   ) 

Definition at line 1011 of file sane.cxx.

References ControlOption().

int Sane::CountOptions (  )  [inline]

Definition at line 178 of file sane.hxx.

References mnOptions.

Referenced by SaneDlg::InitFields(), and SaneDlg::SaveState().

int Sane::GetDeviceNumber (  )  [inline]

Definition at line 179 of file sane.hxx.

References mnDevice.

BOOL Sane::Open ( const char *   ) 

Definition at line 313 of file sane.cxx.

References FAIL_STATE, maHandle, mnDevice, nDevices, p_open, ppDevices, and ReloadOptions().

Referenced by SaneDlg::InitDevices(), SaneDlg::LoadState(), Open(), and Stop().

BOOL Sane::Open ( int   ) 

Definition at line 338 of file sane.cxx.

References mnDevice, nDevices, Open(), and ppDevices.

void Sane::Close (  ) 

Definition at line 348 of file sane.cxx.

References maHandle, mnDevice, mppOptions, and p_close.

Referenced by SaneDlg::InitDevices(), SaneDlg::LoadState(), ReloadDevices(), Stop(), and ~Sane().

void Sane::ReloadDevices (  ) 

Definition at line 276 of file sane.cxx.

References Close(), DeInit(), Init(), and IsOpen().

Referenced by SaneDlg::InitDevices().

void Sane::ReloadOptions (  ) 

Definition at line 284 of file sane.cxx.

References CheckConsistency(), IsOpen(), maHandle, maReloadOptionsLink, mnOptions, mppOptions, p_control_option, p_get_option_descriptor, and p_strstatus.

Referenced by ControlOption(), and Open().

BOOL Sane::Start ( BitmapTransporter  ) 

Definition at line 583 of file sane.cxx.

References _ReadValue(), BYTE_BUFFER_SIZE, CheckConsistency(), DUMP_STATE, FrameStyle_BW, FrameStyle_Gray, FrameStyle_RGB, FrameStyle_Separated, GetOptionByName(), GetOptionUnit(), GetOptionValue(), BitmapTransporter::getStream(), BitmapTransporter::lock(), maHandle, p_get_parameters, p_get_select_fd, p_read, p_set_io_mode, and p_start.

Referenced by SaneDlg::AcquirePreview(), and ScannerThread::run().

Link Sane::SetReloadOptionsHdl ( const Link &  rLink  )  [inline]

Definition at line 202 of file sane.hxx.

References maReloadOptionsLink.

Referenced by SaneDlg::SaneDlg().


Member Data Documentation

int Sane::nRefCount [static, private]

Definition at line 82 of file sane.hxx.

Referenced by Sane(), and ~Sane().

oslModule Sane::pSaneLib [static, private]

Definition at line 83 of file sane.hxx.

Referenced by DeInit(), Init(), IsSane(), LoadSymbol(), Sane(), and ~Sane().

SANE_Status(* Sane::p_init)(SANE_Int *, SANE_Auth_Callback)=0 [static, private]

Definition at line 106 of file sane.cxx.

Referenced by Init().

void(* Sane::p_exit)()=0 [static, private]

Definition at line 108 of file sane.cxx.

Referenced by DeInit(), and Init().

SANE_Status(* Sane::p_get_devices)(const SANE_Device ***, SANE_Bool)=0 [static, private]

Definition at line 109 of file sane.cxx.

Referenced by Init().

SANE_Status(* Sane::p_open)(SANE_String_Const, SANE_Handle)=0 [static, private]

Definition at line 111 of file sane.cxx.

Referenced by Init(), and Open().

void(* Sane::p_close)(SANE_Handle)=0 [static, private]

Definition at line 112 of file sane.cxx.

Referenced by Close(), and Init().

const SANE_Option_Descriptor *(* Sane::p_get_option_descriptor)(SANE_Handle, SANE_Int)=0 [static, private]

Definition at line 113 of file sane.cxx.

Referenced by Init(), and ReloadOptions().

SANE_Status(* Sane::p_control_option)(SANE_Handle, SANE_Int, SANE_Action, void *, SANE_Int *)=0 [static, private]

Definition at line 115 of file sane.cxx.

Referenced by ControlOption(), Init(), and ReloadOptions().

SANE_Status(* Sane::p_get_parameters)(SANE_Handle, SANE_Parameters *)=0 [static, private]

Definition at line 118 of file sane.cxx.

Referenced by Init(), and Start().

SANE_Status(* Sane::p_start)(SANE_Handle)=0 [static, private]

Definition at line 120 of file sane.cxx.

Referenced by Init(), and Start().

SANE_Status(* Sane::p_read)(SANE_Handle, SANE_Byte *, SANE_Int, SANE_Int *)=0 [static, private]

Definition at line 121 of file sane.cxx.

Referenced by Init(), and Start().

void(* Sane::p_cancel)(SANE_Handle)=0 [static, private]

Definition at line 123 of file sane.cxx.

Referenced by Init().

SANE_Status(* Sane::p_set_io_mode)(SANE_Handle, SANE_Bool)=0 [static, private]

Definition at line 124 of file sane.cxx.

Referenced by Init(), and Start().

SANE_Status(* Sane::p_get_select_fd)(SANE_Handle, SANE_Int *)=0 [static, private]

Definition at line 125 of file sane.cxx.

Referenced by Init(), and Start().

const SANE_String_Const(* Sane::p_strstatus)(SANE_Status)=0 [static, private]

Definition at line 126 of file sane.cxx.

Referenced by Init(), and ReloadOptions().

SANE_Int Sane::nVersion [static, private]

Definition at line 107 of file sane.hxx.

Referenced by Init().

SANE_Device ** Sane::ppDevices [static, private]

Definition at line 108 of file sane.hxx.

Referenced by GetModel(), GetName(), GetType(), GetVendor(), Init(), and Open().

int Sane::nDevices [static, private]

Definition at line 109 of file sane.hxx.

Referenced by CountDevices(), Init(), and Open().

const SANE_Option_Descriptor** Sane::mppOptions [private]

Definition at line 111 of file sane.hxx.

Referenced by CheckConsistency(), Close(), GetOptionByName(), GetOptionCap(), GetOptionConstraintType(), GetOptionElements(), GetOptionName(), GetOptionTitle(), GetOptionType(), GetOptionUnit(), GetOptionUnitName(), GetOptionValue(), GetRange(), GetStringConstraint(), ReloadOptions(), and SetOptionValue().

int Sane::mnOptions [private]

Definition at line 112 of file sane.hxx.

Referenced by CountOptions(), GetOptionByName(), and ReloadOptions().

int Sane::mnDevice [private]

Definition at line 113 of file sane.hxx.

Referenced by Close(), GetDeviceNumber(), Open(), and Stop().

SANE_Handle Sane::maHandle [private]

Definition at line 114 of file sane.hxx.

Referenced by Close(), ControlOption(), GetOptionValue(), IsOpen(), Open(), ReloadOptions(), SetOptionValue(), Start(), and Stop().

Link Sane::maReloadOptionsLink [private]

Definition at line 116 of file sane.hxx.

Referenced by ReloadOptions(), and SetReloadOptionsHdl().


The documentation for this class was generated from the following files:
Generated on Thu Feb 28 17:53:33 2008 for AquaScanner by  doxygen 1.5.1