Dee.Filter¶
Fields¶
Name  | 
Type  | 
Access  | 
Description  | 
|---|---|---|---|
destroy  | 
r/w  | 
Callback for freeing the user_data userdata (closure): Free form user data associated with the filter. This pointer will be passed to map_func and map_notify  | 
|
map_func  | 
r/w  | 
The #DeeModelMapFunc used to construct the initial contents of a   | 
|
map_notify  | 
r/w  | 
Callback invoked when the original model changes  | 
|
userdata  | 
r/w  | 
Methods¶
class  | 
  | 
class  | 
  | 
class  | 
  | 
class  | 
  | 
class  | 
  | 
class  | 
  | 
class  | 
  | 
  | 
|
  | 
Details¶
- class Dee.Filter¶
 Structure encapsulating the mapping logic used to construct a
Dee.FilterModel- classmethod new(map_func, map_notify, *userdata)¶
 - Parameters:
 map_func (
Dee.FilterMapFunc) – TheDee.FilterMapFuncto use for the filtermap_notify (
Dee.FilterMapNotify) – TheDee.FilterMapNotifyto use for the filteruserdata (
objectorNone) – The user data to pass to map_func and map_notify
- Returns:
 A pointer to an uninitialized
Dee.Filterstruct. This struct will zeroed and configured with the filter parameters- Return type:
 out_filter:
Dee.Filter
Create a new
Dee.Filterwith the given parameters. This call will zero the out_filter struct.
- classmethod new_collator(column)¶
 - Parameters:
 column (
int) – The index of a column containing the strings to sort after- Returns:
 A pointer to an uninitialized
Dee.Filterstruct. This struct will zeroed and configured with the filter parameters- Return type:
 out_filter:
Dee.Filter
Create a
Dee.Filterthat takes string values from a column in the model and builds aDee.FilterModelwith the rows sorted according to the collation rules of the current locale.
- classmethod new_collator_desc(column)¶
 - Parameters:
 column (
int) – The index of a column containing the strings to sort after- Returns:
 A pointer to an uninitialized
Dee.Filterstruct. This struct will zeroed and configured with the filter parameters- Return type:
 out_filter:
Dee.Filter
Create a
Dee.Filterthat takes string values from a column in the model and builds aDee.FilterModelwith the rows sorted descending according to the collation rules of the current locale.
- classmethod new_for_any_column(column, value)¶
 - Parameters:
 column (
int) – The index of a column containing the string to matchvalue (
GLib.Variant) – AGLib.Variantvalue columns must match exactly. The matching semantics are those ofGLib.Variant.equal(). If value is floating the ownership will be transfered to the filter
- Returns:
 A pointer to an uninitialized
Dee.Filterstruct. This struct will zeroed and configured with the filter parameters- Return type:
 out_filter:
Dee.Filter
Create a
Dee.Filterthat only includes rows from the original model which match a variant value in a given column. ADee.FilterModelcreated with this filter will be ordered in accordance with its parent model.This method will work on any column, disregarding its schema, since the value comparison is done using
GLib.Variant.equal(). This means you can use this filter as a convenient fallback when there is no predefined filter for your column type if raw performance is not paramount.
- classmethod new_for_key_column(column, key)¶
 - Parameters:
 - Returns:
 A pointer to an uninitialized
Dee.Filterstruct. This struct will zeroed and configured with the filter parameters- Return type:
 out_filter:
Dee.Filter
Create a
Dee.Filterthat only includes rows from the original model which has an exact match on some string column. ADee.FilterModelcreated with this filter will be ordered in accordance with its parent model.
- classmethod new_regex(column, regex)¶
 - Parameters:
 column (
int) – The index of a column containing the string to matchregex (
GLib.Regex) – The regular expression column must match
- Returns:
 A pointer to an uninitialized
Dee.Filterstruct. This struct will zeroed and configured with the filter parameters- Return type:
 out_filter:
Dee.Filter
Create a
Dee.Filterthat only includes rows from the original model which match a regular expression on some string column. ADee.FilterModelcreated with this filter will be ordered in accordance with its parent model.
- classmethod new_sort(cmp_row, *cmp_user_data)¶
 - Parameters:
 cmp_row (
Dee.CompareRowFunc) – ADee.CompareRowFuncto use for sortingcmp_user_data (
objectorNone) – User data passed to cmp_row
- Returns:
 A pointer to an uninitialized
Dee.Filterstruct. This struct will zeroed and configured with the filter parameters- Return type:
 out_filter:
Dee.Filter
Create a new
Dee.Filtersorting a model according to aDee.CompareRowFunc.
- map(orig_model, filter_model)¶
 - Parameters:
 orig_model (
Dee.Model) – The model that is being filteredfilter_model (
Dee.FilterModel) – TheDee.FilterModelthat holds the filtered subset of orig_model
Call the
Dee.FilterMapFuncfunction of aDee.Filter. When using aDee.FilterModelyou should not call this method yourself.
- notify(orig_iter, orig_model, filter_model)¶
 - Parameters:
 orig_iter (
Dee.ModelIter) – TheDee.ModelIteradded to orig_modelorig_model (
Dee.Model) – The model that is being filteredfilter_model (
Dee.FilterModel) – TheDee.FilterModelthat holds the filtered subset of orig_model
- Returns:
 The return value from the
Dee.FilterMapNotify. That is;Trueif orig_iter was added to filter_model- Return type:
 
Call the
Dee.FilterMapNotifyfunction of aDee.Filter. When using aDee.FilterModelyou should not call this method yourself.