![]() |
![]() |
![]() |
GNOME Data Access 4.0 manual | ![]() |
---|---|---|---|---|
GdaSet; enum GdaSetHint; GdaSetNode; GdaSetGroup; GdaSetSource; GdaSet* gda_set_new (GSList *holders); GdaSet* gda_set_copy (GdaSet *set); GdaSet* gda_set_new_inline (gint nb, ...); GdaSet* gda_set_new_from_spec_string (const gchar *xml_spec, GError **error); GdaSet* gda_set_new_from_spec_node (xmlNodePtr xml_spec, GError **error); gchar* gda_set_get_spec (GdaSet *set); const GValue* gda_set_get_holder_value (GdaSet *set, const gchar *holder_id); gboolean gda_set_set_holder_value (GdaSet *set, const gchar *holder_id, ...); GdaHolder* gda_set_get_holder (GdaSet *set, const gchar *holder_id); gboolean gda_set_add_holder (GdaSet *set, GdaHolder *holder); void gda_set_remove_holder (GdaSet *set, GdaHolder *holder); void gda_set_merge_with_set (GdaSet *set, GdaSet *set_to_merge); gboolean gda_set_is_valid (GdaSet *set); GdaSetNode* gda_set_get_node (GdaSet *set, GdaHolder *param); GdaSetSource* gda_set_get_source_for_model (GdaSet *set, GdaDataModel *model); GdaSetSource* gda_set_get_source (GdaSet *set, GdaHolder *param); GdaSetGroup* gda_set_get_group (GdaSet *set, GdaHolder *param);
"description" gchar* : Read / Write "holders" gpointer : Write / Construct Only "id" gchar* : Read / Write "name" gchar* : Read / Write
"holder-attr-changed" : Run First "holder-changed" : Run First "holder-plugin-changed" : Run First "public-data-changed" : Run First
The GdaSet object is a container for several values (as GdaHolder objects), which also offers different classifications of the group of GdaHolder values.
typedef enum { GDA_SET_HOLDER_READ_ONLY = 1 << 0, /* holder should not be affected by user modifications */ GDA_SET_HOLDER_HIDE = 1 << 1 /* holder should not be shown to the user */ } GdaSetHint;
typedef struct { GdaHolder *holder; /* Can't be NULL */ GdaDataModel *source_model; /* may be NULL if @holder does not have any source */ gint source_column; /* unused is @source_model is NULL */ GdaSetHint hint; } GdaSetNode;
For each GdaHolder object in the GdaSet object, there is a GdaSetNode structure which sums up all the information for each GdaHolder.
typedef struct { GSList *nodes; /* list of GdaSetNode, at least one entry */ GdaSetSource *nodes_source; /* if NULL, then @nodes contains exactly one entry */ } GdaSetGroup;
The GdaSetGroup is another view of the GdaHolder objects contained in the "" there is one such structure for each _independant_ parameter (parameters which have the same source data model all appear in the same GdaSetGroup structure).
typedef struct { GdaDataModel *data_model; /* Can't be NULL */ GSList *nodes; /* list of #GdaSetNode for which source_model == @data_model */ /* displayed columns in 'data_model' */ gint shown_n_cols; gint *shown_cols_index; /* columns used as a reference (corresponding to PK values) in 'data_model' */ gint ref_n_cols; gint *ref_cols_index; } GdaSetSource;
There is a GdaSetSource structure for each GdaDataModel which is a source for least one GdaHolder in the GdaSet object.
GdaSet* gda_set_new (GSList *holders);
Creates a new GdaSet object, and populates it with the list given as argument.
The list can then be freed as it is copied. All the value holders in holders
are referenced counted
and modified, so they should not be used anymore afterwards.
GdaSet* gda_set_new_inline (gint nb, ...);
Creates a new GdaSet containing holders defined by each triplet in ... For each triplet (id, Glib type and value), the value must be of the correct type (gchar * if type is G_STRING, ...)
Note that this function is a utility function and that anly a limited set of types are supported. Trying to use an unsupported type will result in a warning, and the returned value holder holding a safe default value.
GdaSet* gda_set_new_from_spec_string (const gchar *xml_spec, GError **error);
Creates a new GdaSet object from the xml_spec
specifications
|
a string |
|
a place to store the error, or NULL
|
Returns : |
a new object, or NULL if an error occurred
|
GdaSet* gda_set_new_from_spec_node (xmlNodePtr xml_spec, GError **error);
Creates a new GdaSet object from the xml_spec
specifications
|
a xmlNodePtr for a <holders> tag |
|
a place to store the error, or NULL
|
Returns : |
a new object, or NULL if an error occurred
|
gchar* gda_set_get_spec (GdaSet *set);
Get the specification as an XML string. See the gda_set_new_from_spec_string()
form more information about the XML specification string format.
|
a GdaSet object |
Returns : |
a new string |
const GValue* gda_set_get_holder_value (GdaSet *set, const gchar *holder_id);
Get the value of the GdaHolder which ID is holder_id
|
a GdaSet object |
|
the ID of the holder to set the value |
Returns : |
the requested GValue, or NULL (see gda_holder_get_value() )
|
gboolean gda_set_set_holder_value (GdaSet *set, const gchar *holder_id, ...);
Set the value of the GdaHolder which ID is holder_id
to a specified value
|
a GdaSet object |
|
the ID of the holder to set the value |
|
value, of the correct type, depending on the requested holder's type |
Returns : |
TRUE if no error occurred and the value was set correctly |
GdaHolder* gda_set_get_holder (GdaSet *set, const gchar *holder_id);
Finds a GdaHolder using its ID
gboolean gda_set_add_holder (GdaSet *set, GdaHolder *holder);
Adds holder
to the list of holders managed within set
.
NOTE: if set
already has a GdaHolder with the same ID as holder
, then holder
will not be added to the set (even if holder
's type or value is not the same as the
one already in set
).
void gda_set_remove_holder (GdaSet *set, GdaHolder *holder);
|
|
|
void gda_set_merge_with_set (GdaSet *set, GdaSet *set_to_merge);
Add to set
all the holders of set_to_merge
.
Note1: only the GdaHolder of set_to_merge
for which no holder in set
has the same ID are merged
Note2: all the GdaHolder merged in set
are still used by set_to_merge
.
gboolean gda_set_is_valid (GdaSet *set);
Tells if all the set's holders have valid data
|
a GdaSet object |
Returns : |
TRUE if the set is valid |
GdaSetNode* gda_set_get_node (GdaSet *set, GdaHolder *param);
Finds a GdaSetNode holding information for holder
, don't modify the returned structure
|
a GdaSet object |
|
|
Returns : |
a GdaSetNode or NULL
|
GdaSetSource* gda_set_get_source_for_model (GdaSet *set, GdaDataModel *model);
Finds the GdaSetSource structure used in set
for which model
is a
the data model, don't modify the returned structure
|
a GdaSet object |
|
a GdaDataModel object |
Returns : |
a GdaSetSource pointer or NULL .
|
GdaSetSource* gda_set_get_source (GdaSet *set, GdaHolder *param);
Finds a GdaSetSource which contains the GdaDataModel restricting the possible values of
holder
, don't modify the returned structure.
|
a GdaSet object |
|
|
Returns : |
a GdaSetSource or NULL
|
GdaSetGroup* gda_set_get_group (GdaSet *set, GdaHolder *param);
Finds a GdaSetGroup which lists a GdaSetNode containing holder
,
don't modify the returned structure.
|
a GdaSet object |
|
|
Returns : |
a GdaSetGroup or NULL
|
"holder-attr-changed"
signalvoid user_function (GdaSet *gdaset, GdaHolder *arg1, gpointer user_data) : Run First
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |
"holder-changed"
signalvoid user_function (GdaSet *gdaset, GdaHolder *arg1, gpointer user_data) : Run First
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |
"holder-plugin-changed"
signalvoid user_function (GdaSet *gdaset, GdaHolder *arg1, gpointer user_data) : Run First
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |
"public-data-changed"
signalvoid user_function (GdaSet *gdaset, gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |