GnomeScannerOption

GnomeScannerOption — An object representing a device option

Synopsis




enum                GnomeScannerOptionFlags;
                    GnomeScannerOption;
enum                GnomeScannerOptionError;
gint                gnome_scanner_option_get_int        (GnomeScannerOption *option);
void                gnome_scanner_option_set_int        (GnomeScannerOption *option,
                                                         gint value);
gfloat              gnome_scanner_option_get_float      (GnomeScannerOption *option);
void                gnome_scanner_option_set_float      (GnomeScannerOption *option,
                                                         gfloat value);
gpointer            gnome_scanner_option_get_id         (GnomeScannerOption *option);
const gchar*        gnome_scanner_option_get_name       (GnomeScannerOption *option);
const gchar*        gnome_scanner_option_get_title      (GnomeScannerOption *option);
const gchar*        gnome_scanner_option_get_desc       (GnomeScannerOption *option);
GValue*             gnome_scanner_option_get_value      (GnomeScannerOption *option);
GType               gnome_scanner_option_get_value_type (GnomeScannerOption *option);
GnomeScannerOptionFlags gnome_scanner_option_get_flags  (GnomeScannerOption *option);
GnomeScanUnit       gnome_scanner_option_get_unit       (GnomeScannerOption *option);
GnomeScannerOptionConstraint* gnome_scanner_option_get_constraint
                                                        (GnomeScannerOption *option);
void                gnome_scanner_option_set_value      (GnomeScannerOption *option,
                                                         GValue *value);

Object Hierarchy


  GObject
   +----GnomeScannerOption

Properties


  "constraint"               gpointer              : Read / Write / Construct Only
  "desc"                     gchararray            : Read / Write / Construct Only
  "flags"                    GnomeScannerOptionFlags  : Read / Write / Construct Only
  "id"                       gpointer              : Read / Write / Construct Only
  "name"                     gchararray            : Read / Write / Construct Only
  "title"                    gchararray            : Read / Write / Construct Only
  "type"                     GType                 : Read / Write / Construct Only
  "unit"                     gint                  : Read / Write / Construct Only
  "value"                    gpointer              : Read / Write

Signals


  "changed"                                        : Run First

Description

Each devices has a variable list of options. Each option is represented by a GnomeScannerOption widget which hold meta-data and data concerning one option. This object must be instanciate only by the GnomeScanBackend.

The GnomeScan project distinguish two kind of options. Device options and Scan options. GnomeScannerOption handle both because of a sane heritage. This is not intend to continue like this. Device option are light management and such. They are un common and often misdocumented. Applications must not us GnomeScannerOption to handle Scan option such as resolution or area, because GnomeScannerOption depend on one device. If the user choose another device, option value is lost. See GnomeScanContext to handle Scan options.

Details

enum GnomeScannerOptionFlags

typedef enum {
  GNOME_SCANNER_OPTION_READONLY 	= 1 << 0,
  GNOME_SCANNER_OPTION_INACTIVE		= 1 << 1,
  GNOME_SCANNER_OPTION_ADVANCED		= 1 << 2,
  GNOME_SCANNER_OPTION_AUTOMATIC	= 1 << 3,
  GNOME_SCANNER_OPTION_ENUMERATION	= 1 << 4,
  GNOME_SCANNER_OPTION_RANGE		= 1 << 5,
  /* Emulated ? soft detect ? */
} GnomeScannerOptionFlags;


GnomeScannerOption

typedef struct _GnomeScannerOption GnomeScannerOption;


enum GnomeScannerOptionError

typedef enum {
  GNOME_SCANNER_OPTION_ERROR_FAILED
} GnomeScannerOptionError;


gnome_scanner_option_get_int ()

gint                gnome_scanner_option_get_int        (GnomeScannerOption *option);

Convenient function similar to g_value_get_int() to get an integer value from a GnomeScannerOption.

option : a GnomeScannerOption
Returns : An integer value or 0 if the option doesn't holds an integer

gnome_scanner_option_set_int ()

void                gnome_scanner_option_set_int        (GnomeScannerOption *option,
                                                         gint value);

Convenient function to set an integer value to an option.

option : a GnomeScannerOption
value : an integer

gnome_scanner_option_get_float ()

gfloat              gnome_scanner_option_get_float      (GnomeScannerOption *option);

Convenient function similar to g_value_get_float() for a GnomeScannerOption.

option : a GnomeScannerOption
Returns : a float or 0

gnome_scanner_option_set_float ()

void                gnome_scanner_option_set_float      (GnomeScannerOption *option,
                                                         gfloat value);

Convenient function similar to g_value_set_float() for a GnomeScannerOption.

option : a GnomeScannerOption
value : a float

gnome_scanner_option_get_id ()

gpointer            gnome_scanner_option_get_id         (GnomeScannerOption *option);

Return the unique id of the option. This function should be called only by GnomeScanBackend.

option : a GnomeScannerOption
Returns : The option unique id

gnome_scanner_option_get_name ()

const gchar*        gnome_scanner_option_get_name       (GnomeScannerOption *option);

Returns a string containing the name of the option.

option : a GnomeScannerOption
Returns : The option's name

gnome_scanner_option_get_title ()

const gchar*        gnome_scanner_option_get_title      (GnomeScannerOption *option);

Returns a string containing the title of the option.

option : a GnomeScannerOption
Returns : The option's title

gnome_scanner_option_get_desc ()

const gchar*        gnome_scanner_option_get_desc       (GnomeScannerOption *option);

Returns a string containing a description of the option

option : a GnomeScannerOption
Returns : The option's description

gnome_scanner_option_get_value ()

GValue*             gnome_scanner_option_get_value      (GnomeScannerOption *option);

Return the value of the option as a GValue..

option : a GnomeScannerOption
Returns : The option's value

gnome_scanner_option_get_value_type ()

GType               gnome_scanner_option_get_value_type (GnomeScannerOption *option);

Retreive the type of the option's value.

option : a GnomeScannerOption
Returns : The type of the option's value

gnome_scanner_option_get_flags ()

GnomeScannerOptionFlags gnome_scanner_option_get_flags  (GnomeScannerOption *option);

Get Option's flags.

option : a GnomeScannerOption
Returns : Option's flags See: GnomeScannerOptionFlags

gnome_scanner_option_get_unit ()

GnomeScanUnit       gnome_scanner_option_get_unit       (GnomeScannerOption *option);

Retreive the unit of the option value.

option : a GnomeScannerOption
Returns : the unit of the option

gnome_scanner_option_get_constraint ()

GnomeScannerOptionConstraint* gnome_scanner_option_get_constraint
                                                        (GnomeScannerOption *option);

The option constraint or NULL.

option : a GnomeScannerOption
Returns : The option constraint.

gnome_scanner_option_set_value ()

void                gnome_scanner_option_set_value      (GnomeScannerOption *option,
                                                         GValue *value);

The value is copied to the option value this mean that value's types must correspond.

option : a GnomeScannerOption
value : a GValue to copy to the option value

Property Details

The "constraint" property

  "constraint"               gpointer              : Read / Write / Construct Only

The constraint value.


The "desc" property

  "desc"                     gchararray            : Read / Write / Construct Only

Long description of the option.

Default value: ""


The "flags" property

  "flags"                    GnomeScannerOptionFlags  : Read / Write / Construct Only

Options flags.

Default value: GNOME_SCANNER_OPTION_INACTIVE


The "id" property

  "id"                       gpointer              : Read / Write / Construct Only

Unique identifier used by the backend.


The "name" property

  "name"                     gchararray            : Read / Write / Construct Only

String without spaces nor special characters describing the option.

Default value: ""


The "title" property

  "title"                    gchararray            : Read / Write / Construct Only

String containing the title of the option.

Default value: ""


The "type" property

  "type"                     GType                 : Read / Write / Construct Only

The type of the option.


The "unit" property

  "unit"                     gint                  : Read / Write / Construct Only

Physical unit of options value if float or integer.

Allowed values: >= 0

Default value: 0


The "value" property

  "value"                    gpointer              : Read / Write

#GValue containing the value of the option.

Signal Details

The "changed" signal

void                user_function                      (GnomeScannerOption *option,
                                                        gpointer            user_data)      : Run First

Emitted when the value is changed.

option : The emitting GnomeScannerOption
user_data : user data set when the signal handler was connected.

See Also

GnomeScanner, GnomeScannerOptionSet