libgda-uimm: Gnome::GdaUI::DataEntry Class Reference

DataEntry - Data entry widget. More...

#include <libgda-uimm/dataentry.h>

Inheritance diagram for Gnome::GdaUI::DataEntry:

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 set_reference_value (const Glib::ValueBase&value)
 Push a value into the GdauiDataEntry in the same way as set_value() but also sets this value as the reference value.

template<class DataType >
void set_reference_value (const DataType&value)
 Push a value into the DataEntry in the same way as set_value() but also sets this value as the reference value.

void get_reference_value (Glib::ValueBase&value) const
 Fetch the reference value held in the GdauiDataEntry widget.

void set_reference_current ()
 Tells that the current value in de is to be considered as the reference value.

template<class DataType >
void get_reference_value (DataType&value) const
 Fetch the reference value held in the GdauiDataEntry widget.

void set_default_value (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_default_value (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 Gdaui::DataEntry.

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 can_expand (bool horiz) const
 Used for the layout of Gda::DataEntry widgets in containers: queries if de requires horizontal or vertical expansion, depending on horiz.

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_expand_changed ()
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_ref_value_vfunc (const Glib::ValueBase&value)
void get_ref_value_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 can_expand_vfunc (bool horiz) 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< DataEntrycreate (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_expand_changed ()
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() 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::can_expand ( bool  horiz) const

Used for the layout of Gda::DataEntry widgets in containers: queries if de requires horizontal or vertical expansion, depending on horiz.

Since libgda-uimm 4.2:
Parameters:
horiztrue to query horizontal expansion requirements, or false for vertical.
Returns:
true if the widget requires expansion.
virtual bool Gnome::GdaUI::DataEntry::can_expand_vfunc ( bool  horiz) const [virtual]
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>

Since libgda-uimm 4.2:
Returns:
true if de's contents is valid.
static Glib::RefPtr<DataEntry> Gnome::GdaUI::DataEntry::create ( 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:
typeA Type.
plugin_nameThe name of an entry plugin, or 0.
Returns:
A new Gdaui::DataEntry widget, _NEVER_ 0.
Gnome::Gda::ValueAttribute Gnome::GdaUI::DataEntry::get_attributes ( ) const

Retrieves the parameters of the GdauiDataEntry widget.

Since libgda-uimm 4.2:
Returns:
The OR'ed bits corresponding to the attributes.
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.

Since libgda-uimm 4.2:
Returns:
true if de is editable.
Glib::RefPtr<Gnome::Gda::DataHandler> Gnome::GdaUI::DataEntry::get_handler ( )

Fetch the GdaDataHandler the GdauiDataEntry is using.

Since libgda-uimm 4.2:
Returns:
The GdaDataHandler object.
Glib::RefPtr<const Gnome::Gda::DataHandler> Gnome::GdaUI::DataEntry::get_handler ( ) const

Fetch the GdaDataHandler the GdauiDataEntry is using.

Since libgda-uimm 4.2:
Returns:
The GdaDataHandler object.
virtual Glib::RefPtr<Gnome::Gda::DataHandler> Gnome::GdaUI::DataEntry::get_handler_vfunc ( ) const [virtual]
void Gnome::GdaUI::DataEntry::get_ref_value_vfunc ( Glib::ValueBase value) const
template <class DataType >
void Gnome::GdaUI::DataEntry::get_reference_value ( DataType &  value) const

Fetch the reference value held in the GdauiDataEntry widget.

Parameters:
valueA 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_reference_value ( Glib::ValueBase value) const

Fetch the reference value held in the GdauiDataEntry widget.

Parameters:
valueA 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_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:
valueA place in which to store the value. The value must be uninitialized.
Since libgda-uimm 4.2:
template <class DataType >
void Gnome::GdaUI::DataEntry::get_value ( DataType &  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:
valueA place in which to store the value. The value must be uninitialized.
Since libgda-uimm 4.2:
GType Gnome::GdaUI::DataEntry::get_value_type ( ) const

Fetch the type of data the GdauiDataEntry handles.

Since libgda-uimm 4.2:
Returns:
The GType type.
virtual GType Gnome::GdaUI::DataEntry::get_value_type_vfunc ( ) const [virtual]
void Gnome::GdaUI::DataEntry::get_value_vfunc ( Glib::ValueBase value) const
GdauiDataEntry* Gnome::GdaUI::DataEntry::gobj ( ) [inline]

Provides access to the underlying C GObject.

Reimplemented from Glib::Interface.

const GdauiDataEntry* Gnome::GdaUI::DataEntry::gobj ( ) const [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_expand_changed ( ) [protected, virtual]
virtual void Gnome::GdaUI::DataEntry::on_status_changed ( ) [protected, virtual]
void Gnome::GdaUI::DataEntry::set_attributes ( Gnome::Gda::ValueAttribute  attrs,
Gnome::Gda::ValueAttribute  mask 
)

Sets the parameters of the Gdaui::DataEntry.

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

Since libgda-uimm 4.2:
Parameters:
attrsThe attributes to set (OR'ed between them).
maskThe mask corresponding to the considered attributes.
virtual void Gnome::GdaUI::DataEntry::set_attributes_vfunc ( Gnome::Gda::ValueAttribute  attrs,
Gnome::Gda::ValueAttribute  mask 
) [virtual]
template <class DataType >
void Gnome::GdaUI::DataEntry::set_default_value ( const DataType &  value)

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:
valueThe value to set.
Since libgda-uimm 4.2:
void Gnome::GdaUI::DataEntry::set_default_value ( 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:
valueA Value, or 0.
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:
editableSet to true to have an editable data entry.
virtual void Gnome::GdaUI::DataEntry::set_editable_vfunc ( bool  editable) [virtual]
virtual void Gnome::GdaUI::DataEntry::set_ref_value_vfunc ( const Glib::ValueBase value) [virtual]
void Gnome::GdaUI::DataEntry::set_reference_current ( )

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

Since libgda-uimm 4.2:
void Gnome::GdaUI::DataEntry::set_reference_value ( const Glib::ValueBase value)

Push a value into the GdauiDataEntry in the same way as set_value() but also sets this value as the reference value.

Since libgda-uimm 4.2:
Parameters:
valueA Value, or 0.
template <class DataType >
void Gnome::GdaUI::DataEntry::set_reference_value ( const DataType &  value)

Push a value into the DataEntry in the same way as set_value() but also sets this value as the reference value.

Parameters:
valueThe value to set.
Since libgda-uimm 4.2:
template <class DataType >
void Gnome::GdaUI::DataEntry::set_value ( const DataType &  value)

Push a value into the DataEntry.

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

Parameters:
valueThe 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:
valueA Value, or 0.
virtual void Gnome::GdaUI::DataEntry::set_value_default_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:
Parameters:
typeThe Type of the data to be displayed.
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_expand_changed ( )
Prototype:
void on_my_expand_changed()
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:
objectThe C instance.
take_copyFalse 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.