| Libgnomedb 4.0 Reference Manual | ||||
|---|---|---|---|---|
GnomeDbDataStore;
GnomeDbDataStoreClass;
GnomeDbDataStorePriv;
GtkTreeModel* gnome_db_data_store_new (GdaDataModel *model);
gboolean gnome_db_data_store_set_value (GnomeDbDataStore *store,
GtkTreeIter *iter,
gint col,
const GValue *value);
void gnome_db_data_store_delete (GnomeDbDataStore *store,
GtkTreeIter *iter);
void gnome_db_data_store_undelete (GnomeDbDataStore *store,
GtkTreeIter *iter);
gboolean gnome_db_data_store_append (GnomeDbDataStore *store,
GtkTreeIter *iter);
GdaDataProxy* gnome_db_data_store_get_proxy (GnomeDbDataStore *store);
gint gnome_db_data_store_get_row_from_iter
(GnomeDbDataStore *store,
GtkTreeIter *iter);
gboolean gnome_db_data_store_get_iter_from_values
(GnomeDbDataStore *store,
GtkTreeIter *iter,
GSList *values,
gint *cols_index);
"model" gpointer : Read / Write / Construct Only "prepend-null-entry" gboolean : Read / Write "proxy" gpointer : Read
This object implements the GtkTreeModel interface, to make it easy to display a GdaDataModel in a GtkTreeView widget. Internally a GdaDataProxy is used so it is possible to adjust the range of displayed data using that object.
Specifically, for a GdaDataModel object containing nb_cols columns,the GnomeDbDataStore object
provides the following columns, for a given row:
negative column number DATA_STORE_COL_MODEL_N_COLUMNS: always contains nb_cols
negative column number DATA_STORE_COL_MODEL_POINTER: always contains a pointer to the GdaDataModel
negative column number DATA_STORE_COL_MODEL_ROW: contains the GdaDataModel's row number (-1 if the row has been added and is not yet present in the data model)
negative column number DATA_STORE_COL_MODIFIED: contains TRUE if the row has been modified in the proxy
negative column number DATA_STORE_COL_TO_DELETE: contains TRUE if the row has been marked to be removed in the proxy
column such as 0 <= column < nb_cols: contains the current value
in the proxy
column such as nb_cols <= column < 2*nb_cols:
contains the value in the GdaDataModel at column column-nb_cols (which
may be different than the one in the proxy)
GtkTreeModel* gnome_db_data_store_new (GdaDataModel *model);
Creates a GtkTreeModel interface with a GdaDataModel
|
a GdaDataModel object |
Returns : |
the new object |
gboolean gnome_db_data_store_set_value (GnomeDbDataStore *store, GtkTreeIter *iter, gint col, const GValue *value);
Stores a value in the store data model.
|
a GnomeDbDataStore object |
|
the considered row |
|
|
|
the value to store (gets copied) |
Returns : |
TRUE on succes |
void gnome_db_data_store_delete (GnomeDbDataStore *store, GtkTreeIter *iter);
Marks the row pointed by iter to be deleted
|
a GnomeDbDataStore object |
|
the considered row |
void gnome_db_data_store_undelete (GnomeDbDataStore *store, GtkTreeIter *iter);
Remove the "to be deleted" mark the row pointed by iter, if it existed.
|
a GnomeDbDataStore object |
|
the considered row |
gboolean gnome_db_data_store_append (GnomeDbDataStore *store, GtkTreeIter *iter);
Appends a new row.
|
a GnomeDbDataStore object |
|
an unset GtkTreeIter to set to the appended row |
Returns : |
TRUE if no error occurred |
GdaDataProxy* gnome_db_data_store_get_proxy (GnomeDbDataStore *store);
|
a GnomeDbDataStore object |
Returns : |
the internal GdaDataProxy being used by store
|
gint gnome_db_data_store_get_row_from_iter
(GnomeDbDataStore *store,
GtkTreeIter *iter);
Get the number of the row represented by iter
|
a GnomeDbDataStore object |
|
a valid GtkTreeIter |
Returns : |
the row number, or -1 if an error occurred |
gboolean gnome_db_data_store_get_iter_from_values
(GnomeDbDataStore *store,
GtkTreeIter *iter,
GSList *values,
gint *cols_index);
Sets iter to the first row where all the values in values at the columns identified at
cols_index match. If the row can't be identified, then the contents of iter is not modified.
NOTE: the cols_index array MUST contain a column index for each value in values
|
a GnomeDbDataStore object |
|
an unset GtkTreeIter to set to the requested row |
|
a list of GValue values |
|
an array of gint containing the column number to match each value of values
|
Returns : |
TRUE if the row has been identified iter was set
|