libgdamm Reference Documentation |
Public Member Functions | |
Glib::RefPtr<Holder> | copy () const |
Copy constructor. | |
void | force_invalid () |
Forces a holder to be invalid; to set it valid again, a new value must be assigned to it using set_value() or take_value(). | |
Value | get_attribute (const Glib::ustring& attribute) const |
Get the value associated to a named attribute. | |
Glib::RefPtr<const Holder> | get_bind () const |
Get the holder which makes holder change its value when the holder's value is changed. | |
Glib::RefPtr<Holder> | get_bind () |
Get the holder which makes holder change its value when the holder's value is changed. | |
Value | get_default_value () const |
Get the default value held into the holder. | |
GType | get_g_type () const |
Get holder's type. | |
Glib::ustring | get_id () const |
Get the ID of holder. | |
bool | get_not_null () const |
Get wether the holder can be 0 or not. | |
Glib::RefPtr<const DataModel> | get_source_model (int& col) const |
Tells if holder has its values sourceed by a Gda::DataModel, and optionnaly allows to fetch the resteictions. | |
Glib::RefPtr<DataModel> | get_source_model (int& col) |
Tells if holder has its values sourceed by a Gda::DataModel, and optionnaly allows to fetch the resteictions. | |
Value | get_value () const |
Get the value held into the holder. | |
Glib::ustring | get_value_str (const Glib::RefPtr<DataHandler>& dh) const |
Same functionality as get_value() except that it returns the value as a string (the conversion is done using dh if not 0 , or the default data handler otherwise). | |
const GdaHolder* | gobj () const |
Provides access to the underlying C GObject. | |
GdaHolder* | gobj () |
Provides access to the underlying C GObject. | |
GdaHolder* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
bool | is_valid () const |
Get the validity of holder (that is, of the value held by holder). | |
Glib::PropertyProxy_ReadOnly <Glib::ustring> | property_description () const |
Holder's description. | |
Glib::PropertyProxy <Glib::ustring> | property_description () |
Holder's description. | |
Glib::PropertyProxy_ReadOnly <Glib::RefPtr<Holder>> | property_full_bind () const |
Make value holder follow other GdaHolder's changes and the other way around. | |
Glib::PropertyProxy <Glib::RefPtr<Holder>> | property_full_bind () |
Make value holder follow other GdaHolder's changes and the other way around. | |
Glib::PropertyProxy_ReadOnly <gulong> | property_g_type () const |
Holder's GType. | |
Glib::PropertyProxy<gulong> | property_g_type () |
Holder's GType. | |
Glib::PropertyProxy_ReadOnly <Glib::ustring> | property_id () const |
Holder's ID. | |
Glib::PropertyProxy <Glib::ustring> | property_id () |
Holder's ID. | |
Glib::PropertyProxy_ReadOnly <Glib::ustring> | property_name () const |
Holder's name. | |
Glib::PropertyProxy <Glib::ustring> | property_name () |
Holder's name. | |
Glib::PropertyProxy_ReadOnly <bool> | property_not_null () const |
Can the value holder be NULL?. | |
Glib::PropertyProxy<bool> | property_not_null () |
Can the value holder be NULL?. | |
Glib::PropertyProxy_ReadOnly <Glib::RefPtr<Holder>> | property_simple_bind () const |
Make value holder follow other GdaHolder's changes. | |
Glib::PropertyProxy <Glib::RefPtr<Holder>> | property_simple_bind () |
Make value holder follow other GdaHolder's changes. | |
Glib::PropertyProxy_ReadOnly<int> | property_source_column () const |
Column number to use in coordination with the source-model property. | |
Glib::PropertyProxy<int> | property_source_column () |
Column number to use in coordination with the source-model property. | |
Glib::PropertyProxy_ReadOnly <Glib::RefPtr<DataModel>> | property_source_model () const |
Data model among which the holder's value should be. | |
Glib::PropertyProxy <Glib::RefPtr<DataModel>> | property_source_model () |
Data model among which the holder's value should be. | |
void | set_attribute (const Glib::ustring& attribute, const Value& value) |
void | set_bind (const Glib::RefPtr<Holder>& bind_to) |
Sets holder to change when bind_to changes (and does not make bind_to change when holder changes). | |
void | set_default_value (const Value& value) |
Sets the default value within the holder. | |
void | set_not_null (bool not_null=true) |
Sets if the holder can have a 0 value. | |
bool | set_source_model (const Glib::RefPtr<DataModel>& model, int col) |
Sets a limit on the possible values for the holder holder: the value must be among the values contained in the col column of the model data model. | |
template<class ValueType> | |
bool | set_value (const ValueType& value) |
bool | set_value_as_value (const Value& value) |
Sets the value within the holder. | |
bool | set_value_str (const Glib::RefPtr<DataHandler>& dh, const Glib::ustring& value) |
Same functionality as set_value() except that it uses a string representation of the value to set, which will be converted into a GValue first (using default data handler if dh is 0 ). | |
bool | set_value_to_default () |
Set holder's value to its default value. | |
Glib::SignalProxy2< void, Glib::ustring, Value > | signal_attribute_changed () |
Glib::SignalProxy0<void> | signal_changed () |
Glib::SignalProxy0<void> | signal_source_changed () |
Glib::SignalProxy1<Error, Value> | signal_validate_change () |
Value | take_static_value (const Value& value, bool& value_changed) |
Sets the const value within the holder. | |
bool | take_value (const Value& value) |
Sets the value within the holder. | |
bool | value_is_default () const |
Tells if holder's current value is the default one. | |
virtual | ~Holder () |
Static Public Member Functions | |
static Glib::RefPtr<Holder> | create (GType g_type, const Glib::ustring& id) |
Protected Member Functions | |
Holder (GType g_type, const Glib::ustring& id) | |
virtual void | on_changed () |
virtual void | on_source_changed () |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr<Gnome::Gda::Holder> | wrap (GdaHolder* object, bool take_copy=false) |
A Glib::wrap() method for this object. |
The GdaHolder is a container for a single Gda::Value value. It also specifies various attributes of the contained value (default value, ...)
virtual Gnome::Gda::Holder::~Holder | ( | ) | [virtual] |
Gnome::Gda::Holder::Holder | ( | GType | g_type, | |
const Glib::ustring & | id | |||
) | [protected] |
Glib::RefPtr<Holder> Gnome::Gda::Holder::copy | ( | ) | const |
Copy constructor.
static Glib::RefPtr<Holder> Gnome::Gda::Holder::create | ( | GType | g_type, | |
const Glib::ustring & | id | |||
) | [static] |
void Gnome::Gda::Holder::force_invalid | ( | ) |
Forces a holder to be invalid; to set it valid again, a new value must be assigned to it using set_value() or take_value().
holder's value is set to 0
.
Value Gnome::Gda::Holder::get_attribute | ( | const Glib::ustring & | attribute | ) | const |
Get the value associated to a named attribute.
Attributes can have any name, but Libgda proposes some default names, see this section.
attribute | Attribute name as a string. |
0
if not attribute named attribute has been set for holder. Glib::RefPtr<const Holder> Gnome::Gda::Holder::get_bind | ( | ) | const |
Get the holder which makes holder change its value when the holder's value is changed.
0
. Glib::RefPtr<Holder> Gnome::Gda::Holder::get_bind | ( | ) |
Get the holder which makes holder change its value when the holder's value is changed.
0
. Value Gnome::Gda::Holder::get_default_value | ( | ) | const |
Get the default value held into the holder.
WARNING: the default value does not need to be of the same type as the one required by holder.
GType Gnome::Gda::Holder::get_g_type | ( | ) | const |
Get holder's type.
Glib::ustring Gnome::Gda::Holder::get_id | ( | ) | const |
Get the ID of holder.
The ID can be set using holder's "id" property
bool Gnome::Gda::Holder::get_not_null | ( | ) | const |
Get wether the holder can be 0
or not.
true
if the holder cannot be 0
. Glib::RefPtr<const DataModel> Gnome::Gda::Holder::get_source_model | ( | int & | col | ) | const |
Tells if holder has its values sourceed by a Gda::DataModel, and optionnaly allows to fetch the resteictions.
col | A place to store the column in the model sourceing the holder, or 0 . |
Glib::RefPtr<DataModel> Gnome::Gda::Holder::get_source_model | ( | int & | col | ) |
Tells if holder has its values sourceed by a Gda::DataModel, and optionnaly allows to fetch the resteictions.
col | A place to store the column in the model sourceing the holder, or 0 . |
Value Gnome::Gda::Holder::get_value | ( | ) | const |
Get the value held into the holder.
If holder is set to use its default value and that default value is not of the same type as holder, then 0
is returned.
If holder is set to 0
, then the returned value is a Gda::TYPE_<tt>0 GValue.
0
. Glib::ustring Gnome::Gda::Holder::get_value_str | ( | const Glib::RefPtr<DataHandler>& | dh | ) | const |
Same functionality as get_value() except that it returns the value as a string (the conversion is done using dh if not 0
, or the default data handler otherwise).
dh | A Gda::DataHandler to use, or 0 . |
0
. const GdaHolder* Gnome::Gda::Holder::gobj | ( | ) | const [inline] |
Provides access to the underlying C GObject.
Reimplemented from Glib::ObjectBase.
References Glib::ValueBase::gobject_.
GdaHolder* Gnome::Gda::Holder::gobj | ( | ) | [inline] |
Provides access to the underlying C GObject.
Reimplemented from Glib::ObjectBase.
References Glib::ValueBase::gobject_.
GdaHolder* Gnome::Gda::Holder::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
bool Gnome::Gda::Holder::is_valid | ( | ) | const |
Get the validity of holder (that is, of the value held by holder).
true
if holder's value can safely be used. virtual void Gnome::Gda::Holder::on_changed | ( | ) | [protected, virtual] |
virtual void Gnome::Gda::Holder::on_source_changed | ( | ) | [protected, virtual] |
Glib::PropertyProxy_ReadOnly<Glib::ustring> Gnome::Gda::Holder::property_description | ( | ) | const |
Holder's description.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<Glib::ustring> Gnome::Gda::Holder::property_description | ( | ) |
Holder's description.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<Glib::RefPtr<Holder>> Gnome::Gda::Holder::property_full_bind | ( | ) | const |
Make value holder follow other GdaHolder's changes and the other way around.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<Glib::RefPtr<Holder>> Gnome::Gda::Holder::property_full_bind | ( | ) |
Make value holder follow other GdaHolder's changes and the other way around.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<gulong> Gnome::Gda::Holder::property_g_type | ( | ) | const |
Holder's GType.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<gulong> Gnome::Gda::Holder::property_g_type | ( | ) |
Holder's GType.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<Glib::ustring> Gnome::Gda::Holder::property_id | ( | ) | const |
Holder's ID.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<Glib::ustring> Gnome::Gda::Holder::property_id | ( | ) |
Holder's ID.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<Glib::ustring> Gnome::Gda::Holder::property_name | ( | ) | const |
Holder's name.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<Glib::ustring> Gnome::Gda::Holder::property_name | ( | ) |
Holder's name.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<bool> Gnome::Gda::Holder::property_not_null | ( | ) | const |
Can the value holder be NULL?.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<bool> Gnome::Gda::Holder::property_not_null | ( | ) |
Can the value holder be NULL?.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<Glib::RefPtr<Holder>> Gnome::Gda::Holder::property_simple_bind | ( | ) | const |
Make value holder follow other GdaHolder's changes.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<Glib::RefPtr<Holder>> Gnome::Gda::Holder::property_simple_bind | ( | ) |
Make value holder follow other GdaHolder's changes.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<int> Gnome::Gda::Holder::property_source_column | ( | ) | const |
Column number to use in coordination with the source-model property.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<int> Gnome::Gda::Holder::property_source_column | ( | ) |
Column number to use in coordination with the source-model property.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<Glib::RefPtr<DataModel>> Gnome::Gda::Holder::property_source_model | ( | ) | const |
Data model among which the holder's value should be.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<Glib::RefPtr<DataModel>> Gnome::Gda::Holder::property_source_model | ( | ) |
Data model among which the holder's value should be.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
void Gnome::Gda::Holder::set_attribute | ( | const Glib::ustring & | attribute, | |
const Value& | value | |||
) |
void Gnome::Gda::Holder::set_bind | ( | const Glib::RefPtr<Holder>& | bind_to | ) |
Sets holder to change when bind_to changes (and does not make bind_to change when holder changes).
If bind_to is 0
, then holder will not be bound anymore.
bind_to | A Gda::Holder or 0 . |
void Gnome::Gda::Holder::set_default_value | ( | const Value& | value | ) |
Sets the default value within the holder.
If value is 0
then holder won't have a default value anymore. To set a default value to 0
, then pass a Value created using gda_value_new_null().
NOTE: the default value does not need to be of the same type as the one required by holder.
value | A value to set the holder's default value, or 0 . |
void Gnome::Gda::Holder::set_not_null | ( | bool | not_null = true |
) |
Sets if the holder can have a 0
value.
If not_null is true
, then that won't be allowed
bool Gnome::Gda::Holder::set_source_model | ( | const Glib::RefPtr<DataModel>& | model, | |
int | col | |||
) |
Sets a limit on the possible values for the holder holder: the value must be among the values contained in the col column of the model data model.
model | A Gda::DataModel object or 0 . | |
col | The reference column in model. |
true
if no error occurred. bool Gnome::Gda::Holder::set_value | ( | const ValueType & | value | ) | [inline] |
bool Gnome::Gda::Holder::set_value_as_value | ( | const Value& | value | ) |
Sets the value within the holder.
If holder is an alias for another holder, then the value is also set for that other holder.
On success, the action of any call to force_invalid() is cancelled as soon as this method is called (even if holder's value does not actually change)
If the value is not different from the one already contained within holder, then holder is not changed and no signal is emitted.
0
or if it is a Gda::TYPE_<tt>0 value
if holder can't accept the value value, then this method returns false
, and holder will be left in an invalid state.
before the change is accepted by holder, the "validate-change" signal will be emitted (the value of which can prevent the change from happening) which can be connected to to have a greater control of which values holder can have, or implement some business rules.
value | A value to set the holder to, or 0 . |
true
if value has been set. bool Gnome::Gda::Holder::set_value_str | ( | const Glib::RefPtr<DataHandler>& | dh, | |
const Glib::ustring & | value | |||
) |
Same functionality as set_value() except that it uses a string representation of the value to set, which will be converted into a GValue first (using default data handler if dh is 0
).
0
or is the "<tt>0</tt>" string, then holder's value is set to 0
.
if holder can't accept the value value, then this method returns false
, and holder will be left in an invalid state.
dh | A Gda::DataHandler to use, or 0 . | |
value | A value to set the holder to, as a string. |
true
if value has been set. bool Gnome::Gda::Holder::set_value_to_default | ( | ) |
Glib::SignalProxy2<void,Glib::ustring,Value> Gnome::Gda::Holder::signal_attribute_changed | ( | ) |
void on_my_attribute_changed(Glib::ustring attr_name, Value value)
Glib::SignalProxy0< void > Gnome::Gda::Holder::signal_changed | ( | ) |
void on_my_changed()
Glib::SignalProxy0< void > Gnome::Gda::Holder::signal_source_changed | ( | ) |
void on_my_source_changed()
Glib::SignalProxy1<Error,Value> Gnome::Gda::Holder::signal_validate_change | ( | ) |
Sets the const value within the holder.
If holder is an alias for another holder, then the value is also set for that other holder.
The value will not be freed, and user should take care of it, either for its freeing or for its correct value at the moment of query.
If the value is not different from the one already contained within holder, then holder is not chaged and no signal is emitted.
0
, and holder will be left in an invalid state.before the change is accepted by holder, the "validate-change" signal will be emitted (the value of which can prevent the change from happening) which can be connected to to have a greater control of which values holder can have, or implement some business rules.
value | A const value to set the holder to. | |
value_changed | A boolean set with true if the value changes, false elsewhere. |
0
if an error occurred or if the previous GValue was 0
itself. It returns the static GValue user set previously, so that he can free it. bool Gnome::Gda::Holder::take_value | ( | const Value& | value | ) |
Sets the value within the holder.
If holder is an alias for another holder, then the value is also set for that other holder.
On success, the action of any call to force_invalid() is cancelled as soon as this method is called (even if holder's value does not actually change).
If the value is not different from the one already contained within holder, then holder is not chaged and no signal is emitted.
false
, and holder will be left in an invalid state.before the change is accepted by holder, the "validate-change" signal will be emitted (the value of which can prevent the change from happening) which can be connected to to have a greater control of which values holder can have, or implement some business rules.
if user previously set this holder with take_static_value() the GValue stored internally will be forgiven and replaced by the value. User should then take care of the 'old' static GValue.
value | A value to set the holder to. |
true
if value has been set. bool Gnome::Gda::Holder::value_is_default | ( | ) | const |
Tells if holder's current value is the default one.
true
if holder holder's current value is the default one.
Glib::RefPtr<Gnome::Gda::Holder> wrap | ( | GdaHolder * | object, | |
bool | take_copy = false | |||
) | [related] |
A Glib::wrap() method for this object.
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. |