Top | ![]() |
![]() |
![]() |
![]() |
GtkFilterListModel * | gtk_filter_list_model_new () |
GtkFilterListModel * | gtk_filter_list_model_new_for_type () |
void | gtk_filter_list_model_set_model () |
GListModel * | gtk_filter_list_model_get_model () |
void | gtk_filter_list_model_set_filter_func () |
gboolean | gtk_filter_list_model_has_filter () |
void | gtk_filter_list_model_refilter () |
gboolean | has-filter | Read |
GType * | item-type | Read / Write / Construct Only |
GListModel * | model | Read / Write / Construct Only |
GtkFilterListModel is a list model that filters a given other listmodel. It hides some elements from the other model according to criteria given by a GtkFilterListModelFilterFunc.
GtkFilterListModel * gtk_filter_list_model_new (GListModel *model
,GtkFilterListModelFilterFunc filter_func
,gpointer user_data
,GDestroyNotify user_destroy
);
Creates a new GtkFilterListModel that will filter model
using the given
filter_func
.
GtkFilterListModel *
gtk_filter_list_model_new_for_type (GType item_type
);
Creates a new empty filter list model set up to return items of type item_type
.
It is up to the application to set a proper filter function and model to ensure
the item type is matched.
void gtk_filter_list_model_set_model (GtkFilterListModel *self
,GListModel *model
);
Sets the model to be filtered.
Note that GTK makes no effort to ensure that model
conforms to
the item type of self
. It assumes that the caller knows what they
are doing and have set up an appropriate filter function to ensure
that item types match.
GListModel *
gtk_filter_list_model_get_model (GtkFilterListModel *self
);
Gets the model currently filtered or NULL
if none.
void gtk_filter_list_model_set_filter_func (GtkFilterListModel *self
,GtkFilterListModelFilterFunc filter_func
,gpointer user_data
,GDestroyNotify user_destroy
);
Sets the function used to filter items. The function will be called for every
item and if it returns TRUE
the item is considered visible.
gboolean
gtk_filter_list_model_has_filter (GtkFilterListModel *self
);
Checks if a filter function is currently set on self
void
gtk_filter_list_model_refilter (GtkFilterListModel *self
);
Causes self
to refilter all items in the model.
Calling this function is necessary when data used by the filter function has changed.
“has-filter”
property “has-filter” gboolean
If a filter is set for this model
Owner: GtkFilterListModel
Flags: Read
Default value: FALSE
“item-type”
property “item-type” GType *
The GType for elements of this object
Owner: GtkFilterListModel
Flags: Read / Write / Construct Only
Allowed values: GObject