![]() |
![]() |
![]() |
GNOME Data Access 5 manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
GdaDataModelIter; const GValue * gda_data_model_iter_get_value_at (GdaDataModelIter *iter
,gint col
); const GValue * gda_data_model_iter_get_value_for_field (GdaDataModelIter *iter
,const gchar *field_name
); gboolean gda_data_model_iter_set_value_at (GdaDataModelIter *iter
,gint col
,const GValue *value
,GError **error
); gboolean gda_data_model_iter_is_valid (GdaDataModelIter *iter
); gboolean gda_data_model_iter_move_to_row (GdaDataModelIter *iter
,gint row
); gboolean gda_data_model_iter_move_next (GdaDataModelIter *iter
); gboolean gda_data_model_iter_move_prev (GdaDataModelIter *iter
); gint gda_data_model_iter_get_row (GdaDataModelIter *iter
); GdaHolder * gda_data_model_iter_get_holder_for_field (GdaDataModelIter *iter
,gint col
); void gda_data_model_iter_invalidate_contents (GdaDataModelIter *iter
);
"current-row" gint : Read / Write "data-model" GdaDataModel* : Read / Write / Construct Only "forced-model" GdaDataModel* : Read / Write "update-model" gboolean : Read / Write
const GValue * gda_data_model_iter_get_value_at (GdaDataModelIter *iter
,gint col
);
Get the value stored at the column col
in iter
. The returned value must not be modified.
|
a GdaDataModelIter object |
|
the requested column |
Returns : |
the GValue, or NULL if the value could not be fetched. [transfer none]
|
const GValue * gda_data_model_iter_get_value_for_field (GdaDataModelIter *iter
,const gchar *field_name
);
Get the value stored at the column field_name
in iter
|
a GdaDataModelIter object |
|
the requested column name |
Returns : |
the GValue, or NULL . [transfer none]
|
gboolean gda_data_model_iter_set_value_at (GdaDataModelIter *iter
,gint col
,const GValue *value
,GError **error
);
Sets a value in iter
, at the column specified by col
|
a GdaDataModelIter object |
|
the column number |
|
a GValue (not NULL ) |
|
a place to store errors, or NULL
|
Returns : |
TRUE if no error occurred |
gboolean gda_data_model_iter_is_valid (GdaDataModelIter *iter
);
Tells if iter
is a valid iterator (if it actually corresponds to a valid row in the model)
|
a GdaDataModelIter object |
Returns : |
TRUE if iter is valid |
gboolean gda_data_model_iter_move_to_row (GdaDataModelIter *iter
,gint row
);
Synchronizes the values of the parameters in iter
with the values at the row
row.
If row
is not a valid row, then the returned value is FALSE, and the "current-row"
property is set to -1 (which means that gda_data_model_iter_is_valid()
would return FALSE)
If any other error occurred then the returned value is FALSE, but the "current-row"
property is set to the row
row. In this case
each GdaHolder composing iter
for which an error occurred will be invalid (see gda_holder_is_valid()
).
|
a GdaDataModelIter object |
|
the row to set iter to |
Returns : |
TRUE if no error occurred |
gboolean gda_data_model_iter_move_next (GdaDataModelIter *iter
);
Moves iter
one row further than where it already is
(synchronizes the values of the parameters in iter
with the values at the new row).
If the iterator was on the data model's last row, then it can't be moved forward
anymore, and the returned value is FALSE; nore also that the "current-row" property
is set to -1 (which means that gda_data_model_iter_is_valid()
would return FALSE)
If any other error occurred then the returned value is FALSE, but the "current-row"
property is set to the new current row (one row more than it was before the call). In this case
each GdaHolder composing iter
for which an error occurred will be invalid (see gda_holder_is_valid()
).
|
a GdaDataModelIter object |
Returns : |
TRUE if the iterator is now at the next row |
gboolean gda_data_model_iter_move_prev (GdaDataModelIter *iter
);
Moves iter
one row before where it already is (synchronizes the values of the parameters in iter
with the values at the new row).
If the iterator was on the data model's first row, then it can't be moved backwards
anymore, and the returned value is FALSE; note also that the "current-row" property
is set to -1 (which means that gda_data_model_iter_is_valid()
would return FALSE).
If any other error occurred then the returned value is FALSE, but the "current-row"
property is set to the new current row (one row less than it was before the call). In this case
each GdaHolder composing iter
for which an error occurred will be invalid (see gda_holder_is_valid()
).
|
a GdaDataModelIter object |
Returns : |
TRUE if the iterator is now at the previous row |
gint gda_data_model_iter_get_row (GdaDataModelIter *iter
);
Get the row which iter
represents in the data model
|
a GdaDataModelIter object |
Returns : |
the row number, or -1 if iter is invalid |
GdaHolder * gda_data_model_iter_get_holder_for_field (GdaDataModelIter *iter
,gint col
);
Fetch a pointer to the GdaHolder object which is synchronized with data at
column col
|
a GdaDataModelIter object |
|
the requested column |
Returns : |
the GdaHolder, or NULL if an error occurred. [transfer none]
|
void gda_data_model_iter_invalidate_contents
(GdaDataModelIter *iter
);
Declare all the parameters in iter
invalid, without modifying the
GdaDataModel iter
is for or changing the row it represents. This method
is for internal usage. Note that for gda_data_model_iter_is_valid()
to return FALSE
,
it is also necessary to set the "current-row" property to -1.
|
a GdaDataModelIter object |
"current-row"
property "current-row" gint : Read / Write
Current represented row in the data model.
Allowed values: >= -1
Default value: -1
"data-model"
property"data-model" GdaDataModel* : Read / Write / Construct Only
Data model for which the iter is for.
"forced-model"
property"forced-model" GdaDataModel* : Read / Write
Overrides the data model the iter is attached to (reserved for internal usage).
"end-of-data"
signalvoid user_function (GdaDataModelIter *iter,
gpointer user_data) : Run First
Gets emitted when iter
has reached the end of available data (which means the previous
row it was on was the last one).
@:
|
the GdaDataModelIter |
|
user data set when the signal handler was connected. |
"row-changed"
signalvoid user_function (GdaDataModelIter *iter,
gint row,
gpointer user_data) : Run First
Gets emitted when the row iter
is currently pointing has changed
@: @:
|
the GdaDataModelIter |
|
the new iter's row |
|
user data set when the signal handler was connected. |