# Gnome::GdaUI::DataEntry Class Reference

DataEntry - Data entry widget. More...

Inherits Glib::Interface.

Collaboration diagram for Gnome::GdaUI::DataEntry:
[legend]

List of all members.

## Public Member Functions

virtual | ~DataEntry ()
GdauiDataEntry* | gobj ()
| Provides access to the underlying C GObject.
const GdauiDataEntry* | gobj () const
| Provides access to the underlying C GObject.
void | set_value_type (GType type)
| Sets the type of value the GdauiDataEntry will handle.
GType | get_value_type () const
| Fetch the type of data the GdauiDataEntry handles.
void | set_value (const Glib::ValueBase&value)
| Push a value into the Gdaui::DataEntry.
template<class DataType >
void | set_value (const DataType&value)
| Push a value into the DataEntry.
void | get_value (Glib::ValueBase&value) const
| Fetch the value held in the DataEntry widget.
template<class DataType >
void | get_value (DataType&value) const
| Fetch the value held in the DataEntry widget.
bool | content_is_valid ()
| Tests the validity of de's contents.
void | get_original_value (Glib::ValueBase&value) const
| Fetch the original value held in the GdauiDataEntry widget.
template<class DataType >
void | get_original_value (DataType&value) const
| Fetch the original value held in the GdauiDataEntry widget.
void | reset ()
| Tells that the current value in de is to be considered as the original value.
void | set_value_default (const Glib::ValueBase&value)
| Sets the default value for the GdauiDataEntry which gets displayed when the user forces the default value.
template<class DataType >
void | set_value_default (const DataType&value)
| Sets the default value for the DataEntry which gets displayed when the user forces the default value.
void | set_attributes (Gnome::Gda::ValueAttribute attrs, Gnome::Gda::ValueAttribute mask)
| Sets the parameters of the GdauiDataEntry.
Gnome::Gda::ValueAttribute | get_attributes () const
| Retrieves the parameters of the GdauiDataEntry widget.
Glib::RefPtr < Gnome::Gda::DataHandler > | get_handler ()
| Fetch the GdaDataHandler the GdauiDataEntry is using.
Glib::RefPtr< const Gnome::Gda::DataHandler > | get_handler () const
| Fetch the GdaDataHandler the GdauiDataEntry is using.
bool | expand_in_layout () const
| Used for the layout of the widget in containers.
void | set_editable (bool editable)
| Set if de can be modified or not by the user.
bool | get_editable () const
| Tells if de can be edited by the user.
void | grab_focus ()
| Makes de grab the focus for the window it's in.
Glib::SignalProxy0< void > | signal_contents_activated ()
Glib::SignalProxy0< void > | signal_contents_modified ()
Glib::SignalProxy0< void > | signal_status_changed ()
virtual void | set_value_type_vfunc (GType type)
virtual GType | get_value_type_vfunc () const
virtual void | set_value_vfunc (const Glib::ValueBase&value)
void | get_value_vfunc (Glib::ValueBase&value) const
virtual void | set_value_orig_vfunc (const Glib::ValueBase&value)
void | get_value_orig_vfunc (Glib::ValueBase&value) const
virtual void | set_value_default_vfunc (const Glib::ValueBase&value)
virtual void | set_attributes_vfunc (Gnome::Gda::ValueAttribute attrs, Gnome::Gda::ValueAttribute mask)
virtual Gnome::Gda::ValueAttribute | get_attributes_vfunc () const
virtual Glib::RefPtr < Gnome::Gda::DataHandler > | get_handler_vfunc () const
virtual bool | expand_in_layout_vfunc () const
virtual void | set_editable_vfunc (bool editable)
virtual void | grab_focus_vfunc ()

## Static Public Member Functions

static void | add_interface (GType gtype_implementer)
static Glib::RefPtr< DataEntry > | create_data_entry (GType type, const Glib::ustring& plugin_name=Glib::ustring())
| Creates a new Gdaui::DataEntry widget, taking into account the requested entry name if plugin_name is not `0` (if no entry of that name is found, then the default data entry widget will be created).

## Protected Member Functions

virtual void | on_contents_activated ()
virtual void | on_contents_modified ()
virtual void | on_status_changed ()

## Related Functions

(Note that these are not member functions.)
Glib::RefPtr < Gnome::GdaUI::DataEntry > | wrap (GdauiDataEntry* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

DataEntry - Data entry widget.

The DataEntry is an interface for widgets (simple or complex) which lets the user view and/or modify a GValue.

This interface is implemented by widgets which feature data editing (usually composed of an editing area and a button to have some more control on the value being edited). The interface allows to control how the widget works and to query the value and the attributes of the data held by the widget.

The widget can store the original value (to be able to tell if the value has been changed by the user) and a default value (which will be returned if the user explicitly forces the widget to be set to the default value). Control methods allow to set the type of value to be edited (the requested type must be compatible with what the widget can handle), set the value (which replaces the currently edited value), set the value and the original value (the value passed as argument is set and is also considered to be the original value).

DataEntry widgets are normally created using the create_data_entry() method.

## Constructor & Destructor Documentation

virtual Gnome::GdaUI::DataEntry::~DataEntry | ( |  | ) | `[virtual]`

## Member Function Documentation

static void Gnome::GdaUI::DataEntry::add_interface | ( | GType | gtype_implementer | ) | `[static]`

bool Gnome::GdaUI::DataEntry::content_is_valid | ( |  | ) |

Tests the validity of de's contents.

The validity is a determined from: <itemizedlist> <listitem>

the de widget itself if it is capable of doing it (depending on the implementation)

</listitem> <listitem>

the results of the "contents-valid" signal which can be connected from

</listitem> </itemizedlist>

Returns:
  `true` if de's contents is valid

Since libgda-uimm 4.2:

static Glib::RefPtr<DataEntry> Gnome::GdaUI::DataEntry::create_data_entry | ( | GType | type,
|  | const Glib::ustring & | plugin_name = `Glib::ustring()` |
| ) |  |  | `[static]`

Creates a new Gdaui::DataEntry widget, taking into account the requested entry name if plugin_name is not `0` (if no entry of that name is found, then the default data entry widget will be created).

plugin_name format is interpreted as two parts: <plugin name>="">:<plugin options>="">, and if the plugins has no option, then the ":<plugin options>" part may be omitted.

Parameters:

  | type | A Type.
  | plugin_name | The name of an entry plugin, or `0`.

Returns:
  A new Gdaui::DataEntry widget, _NEVER_ `0`.

bool Gnome::GdaUI::DataEntry::expand_in_layout | ( |  | ) | const

Used for the layout of the widget in containers.

Returns:
  `true` if the widget should expand

Since libgda-uimm 4.2:

virtual bool Gnome::GdaUI::DataEntry::expand_in_layout_vfunc | ( |  | ) | const`[virtual]`

Gnome::Gda::ValueAttribute Gnome::GdaUI::DataEntry::get_attributes | ( |  | ) | const

Retrieves the parameters of the GdauiDataEntry widget.

Returns:
  The OR'ed bits corresponding to the attributes.

Since libgda-uimm 4.2:

virtual Gnome::Gda::ValueAttribute Gnome::GdaUI::DataEntry::get_attributes_vfunc | ( |  | ) | const`[virtual]`

bool Gnome::GdaUI::DataEntry::get_editable | ( |  | ) | const

Tells if de can be edited by the user.

Returns:
  `true` if de is editable

Since libgda-uimm 4.2:

Glib::RefPtr<const Gnome::Gda::DataHandler> Gnome::GdaUI::DataEntry::get_handler | ( |  | ) | const

Fetch the GdaDataHandler the GdauiDataEntry is using.

Returns:
  The GdaDataHandler object

Since libgda-uimm 4.2:

Glib::RefPtr<Gnome::Gda::DataHandler> Gnome::GdaUI::DataEntry::get_handler | ( |  | ) |

Fetch the GdaDataHandler the GdauiDataEntry is using.

Returns:
  The GdaDataHandler object

Since libgda-uimm 4.2:

virtual Glib::RefPtr<Gnome::Gda::DataHandler> Gnome::GdaUI::DataEntry::get_handler_vfunc | ( |  | ) | const`[virtual]`

template <class DataType >

void Gnome::GdaUI::DataEntry::get_original_value | ( | DataType & | value | ) | const`[inline]`

Fetch the original value held in the GdauiDataEntry widget.

Parameters:

  | value | A place in which to store the value. The value must be uninitialized and should not be modified.

Since libgda-uimm 4.2:

void Gnome::GdaUI::DataEntry::get_original_value | ( | Glib::ValueBase & | value | ) | const

Fetch the original value held in the GdauiDataEntry widget.

Parameters:

  | value | A place in which to store the value. The value must be uninitialized and should not be modified.

Since libgda-uimm 4.2:

template <class DataType >

void Gnome::GdaUI::DataEntry::get_value | ( | DataType & | value | ) | const`[inline]`

Fetch the value held in the DataEntry widget.

If the value is set to NULL, the returned value is of type GDA_TYPE_NULL. If the value is set to default, then the returned value is of type GDA_TYPE_NULL or is the default value if it has been provided to the widget (and is of the same type as the one provided by the data entry).

Parameters:

  | value | A place in which to store the value. The value must be uninitialized.

Since libgda-uimm 4.2:

void Gnome::GdaUI::DataEntry::get_value | ( | Glib::ValueBase & | value | ) | const

Fetch the value held in the DataEntry widget.

If the value is set to NULL, the returned value is of type GDA_TYPE_NULL. If the value is set to default, then the returned value is of type GDA_TYPE_NULL or is the default value if it has been provided to the widget (and is of the same type as the one provided by the data entry).

Parameters:

  | value | A place in which to store the value. The value must be uninitialized.

Since libgda-uimm 4.2:

void Gnome::GdaUI::DataEntry::get_value_orig_vfunc | ( | Glib::ValueBase & | value | ) | const

GType Gnome::GdaUI::DataEntry::get_value_type | ( |  | ) | const

Fetch the type of data the GdauiDataEntry handles.

Returns:
  The GType type

Since libgda-uimm 4.2:

virtual GType Gnome::GdaUI::DataEntry::get_value_type_vfunc | ( |  | ) | const`[virtual]`

void Gnome::GdaUI::DataEntry::get_value_vfunc | ( | Glib::ValueBase & | value | ) | const

const GdauiDataEntry* Gnome::GdaUI::DataEntry::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GObject.

Reimplemented from Glib::Interface.

GdauiDataEntry* Gnome::GdaUI::DataEntry::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GObject.

Reimplemented from Glib::Interface.

void Gnome::GdaUI::DataEntry::grab_focus | ( |  | ) |

Makes de grab the focus for the window it's in.

Since libgda-uimm 4.2:

virtual void Gnome::GdaUI::DataEntry::grab_focus_vfunc | ( |  | ) | `[virtual]`

virtual void Gnome::GdaUI::DataEntry::on_contents_activated | ( |  | ) | `[protected, virtual]`

virtual void Gnome::GdaUI::DataEntry::on_contents_modified | ( |  | ) | `[protected, virtual]`

virtual void Gnome::GdaUI::DataEntry::on_status_changed | ( |  | ) | `[protected, virtual]`

void Gnome::GdaUI::DataEntry::reset | ( |  | ) |

Tells that the current value in de is to be considered as the original value.

Since libgda-uimm 4.2:

void Gnome::GdaUI::DataEntry::set_attributes | ( | Gnome::Gda::ValueAttribute | attrs,
|  | Gnome::Gda::ValueAttribute | mask |
| ) |  |  |

Sets the parameters of the GdauiDataEntry.

Only the attributes corresponding to the mask are set, the other ones are ignored.

Since libgda-uimm 4.2:

Parameters:

  | attrs | The attributes to set (OR'ed between them).
  | mask | The mask corresponding to the considered attributes.

virtual void Gnome::GdaUI::DataEntry::set_attributes_vfunc | ( | Gnome::Gda::ValueAttribute | attrs,
|  | Gnome::Gda::ValueAttribute | mask |
| ) |  |  | `[virtual]`

void Gnome::GdaUI::DataEntry::set_editable | ( | bool | editable | ) |

Set if de can be modified or not by the user.

Since libgda-uimm 4.2:

Parameters:

  | editable | Set to `true` to have an editable data entry.

virtual void Gnome::GdaUI::DataEntry::set_editable_vfunc | ( | bool | editable | ) | `[virtual]`

template <class DataType >

void Gnome::GdaUI::DataEntry::set_value | ( | const DataType & | value | ) | `[inline]`

Push a value into the DataEntry.

The value parameter must be of the type specified using set_value_type().

Parameters:

  | value | The value to set.

Since libgda-uimm 4.2:

void Gnome::GdaUI::DataEntry::set_value | ( | const Glib::ValueBase & | value | ) |

Push a value into the Gdaui::DataEntry.

The value parameter must either be: <itemizedlist> <listitem>

of type GDA_TYPE_`0` (may be created using gda_value_new_null()) to represent a `0` value (SQL `0`), or

</listitem> <listitem>

of type specified using set_value_type(), or

</listitem> <listitem>

`0` to represent an undetermined value (usually an error)

</listitem> </itemizedlist>

Since libgda-uimm 4.2:

Parameters:

  | value | A Value, or `0`.

template <class DataType >

void Gnome::GdaUI::DataEntry::set_value_default | ( | const DataType & | value | ) | `[inline]`

Sets the default value for the DataEntry which gets displayed when the user forces the default value.

If it is not set then it is set to type GDA_TYPE_NULL. The value parameter must be of the type specified using set_value_type().

Parameters:

  | value | The value to set.

Since libgda-uimm 4.2:

void Gnome::GdaUI::DataEntry::set_value_default | ( | const Glib::ValueBase & | value | ) |

Sets the default value for the GdauiDataEntry which gets displayed when the user forces the default value.

If it is not set then it is set to type GDA_TYPE_`0`. The value parameter must either be: <itemizedlist> <listitem>

`0` or of type GDA_TYPE_`0`, or

</listitem> <listitem>

of type specified using set_value_type().

</listitem> </itemizedlist>

Since libgda-uimm 4.2:

Parameters:

  | value | A Value, or `0`.

virtual void Gnome::GdaUI::DataEntry::set_value_default_vfunc | ( | const Glib::ValueBase & | value | ) | `[virtual]`

virtual void Gnome::GdaUI::DataEntry::set_value_orig_vfunc | ( | const Glib::ValueBase & | value | ) | `[virtual]`

void Gnome::GdaUI::DataEntry::set_value_type | ( | GType | type | ) |

Sets the type of value the GdauiDataEntry will handle.

The type must be compatible with what the widget can handle.

Since libgda-uimm 4.2:

virtual void Gnome::GdaUI::DataEntry::set_value_type_vfunc | ( | GType | type | ) | `[virtual]`

virtual void Gnome::GdaUI::DataEntry::set_value_vfunc | ( | const Glib::ValueBase & | value | ) | `[virtual]`

Glib::SignalProxy0< void > Gnome::GdaUI::DataEntry::signal_contents_activated | ( |  | ) |

Prototype:
  `void on_my_contents_activated()`

Glib::SignalProxy0< void > Gnome::GdaUI::DataEntry::signal_contents_modified | ( |  | ) |

Prototype:
  `void on_my_contents_modified()`

Glib::SignalProxy0< void > Gnome::GdaUI::DataEntry::signal_status_changed | ( |  | ) |

Prototype:
  `void on_my_status_changed()`

## Friends And Related Function Documentation

Glib::RefPtr< Gnome::GdaUI::DataEntry > wrap | ( | GdauiDataEntry * | object,
|  | bool | take_copy = `false` |
| ) |  |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  | object | The C instance.
  | take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- libgda-uimm/dataentry.h