Class
GcrUiCollectionModel
Description [src]
class GcrUi.CollectionModel : GObject.Object {
parent: GObject
}
Ain implementation of a GtkTreeModel
which contains a row for each
object in a GcrCollection
.
As objects are added or removed from the collection, rows are added and removed from this model.
The row values come from the properties of the objects in the collection. Use
gcr_collection_model_new()
to create a new collection model. To have more
control over the values use a set of GcrColumn
structures to
define the columns. This can be done with gcr_collection_model_new_full()
or
gcr_collection_model_set_columns()
.
Each row can have a selected state, which is represented by a boolean column.
The selected state can be toggled with gcr_collection_model_toggle_selected()
or set with gcr_collection_model_set_selected_objects()
and retrieved with
gcr_collection_model_get_selected_objects()
.
To determine which object a row represents and vice versa, use the
gcr_collection_model_iter_for_object()
or
gcr_collection_model_object_for_iter()
functions.
Constructors
gcr_collection_model_new
Create a new GcrCollectionModel
. The variable argument list should contain
pairs of property names, and GType
values. The variable argument list should
be terminated with NULL
.
gcr_collection_model_new_full
Create a new GcrCollectionModel
.
Instance methods
gcr_collection_model_change_selected
Set whether a given row is toggled selected or not.
gcr_collection_model_column_for_selected
Get the column identifier for the column that contains the values of the selected state.
gcr_collection_model_get_collection
Get the collection which this model represents.
gcr_collection_model_get_selected_objects
Get a list of checked/selected objects.
gcr_collection_model_is_selected
Check whether a given row has been toggled as selected.
gcr_collection_model_iter_for_object
Set iter
to the row for the given object. If the object is not in this
model, then FALSE
will be returned.
gcr_collection_model_object_for_iter
Get the object that is represented by the given row in the model.
gcr_collection_model_set_collection
Set the collection which this model represents.
gcr_collection_model_set_columns
Set the columns that the model should contain. columns
is an array of
GcrColumn
structures, with the last one containing NULL
for all values.
gcr_collection_model_set_selected_objects
Set the checked/selected objects.
gcr_collection_model_toggle_selected
Toggle the selected state of a given row.