Callbacks¶
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | 
Details¶
- Dee.CollatorFunc(input, *data)¶
- Parameters:
- Returns:
- The collation key. Free with - GLib.free() when done using it.
- Return type:
 - A collator takes an input string, most often a term produced from a - Dee.Analyzer, and outputs a collation key.
- Dee.CompareRowFunc(row1, row2, *user_data)¶
- Parameters:
- row1 ([ - GLib.Variant]) – The model being indexed
- row2 ([ - GLib.Variant]) – The row to extract terms for
- user_data ( - objector- None) – User data to pass to comparison function
 
- Returns:
- -1, 0, or 1 if row1 is respectively less than, equal, or greater than row2. 
- Return type:
 - Compares row1 and row2. Mainly used with dee_model_insert_sorted() and dee_model_find_sorted(). 
- Dee.CompareRowSizedFunc(row1, row2, *user_data)¶
- Parameters:
- row1 ([ - GLib.Variant]) – Row data
- row2 ([ - GLib.Variant]) – Row data to compare with
- user_data ( - objector- None) – User data passed to comparison function
 
- Returns:
- -1, 0, or 1 if row1 is respectively less than, equal, or greater than row2. 
- Return type:
 - Compares row1 and row2. Mainly used with - Dee.Model.insert_row_sorted_with_sizes() and- Dee.Model.find_row_sorted_with_sizes().
- Dee.FilterMapFunc(orig_model, filter_model, *user_data)¶
- Parameters:
- orig_model ( - Dee.Model) – The model containing the original data to filter
- filter_model ( - Dee.FilterModel) – The model that will contain the filtered results. The filter func must iterate over orig_model and add all relevant rows to filter_model. This model is guaranteed to be empty when the filter func is invoked
- user_data ( - objector- None) – User data passed together with the filter func
 
 - Function used to collect the rows from a model that should be included in a - Dee.FilterModel. To add rows to filter_model use the methods- Dee.FilterModel.append_iter(),- Dee.FilterModel.prepend_iter(),- Dee.FilterModel.insert_iter(), and- Dee.FilterModel.insert_iter_before().- The iteration over the original model is purposely left to the map func in order to allow optimized iterations if the the caller has a priori knowledge of the sorting and grouping of the data in the original model. 
- Dee.FilterMapNotify(orig_model, orig_iter, filter_model, *user_data)¶
- Parameters:
- orig_model ( - Dee.Model) – The model containing the added row
- orig_iter ( - Dee.ModelIter) – A- Dee.ModelIterpointing to the new row in orig_model
- filter_model ( - Dee.FilterModel) – The model that was also passed to the #DeeModelMapFunc of the- Dee.Filterthis functions is a part of
- user_data ( - objector- None) – User data for the- Dee.Filter
 
- Returns:
- Trueif orig_iter was added to filter_model
- Return type:
 - Callback invoked when a row is added to orig_model. To add rows to filter_model use the methods - Dee.FilterModel.append_iter(),- Dee.FilterModel.prepend_iter(),- Dee.FilterModel.insert_iter(), and- Dee.FilterModel.insert_iter_before().
- Dee.IndexIterFunc(key, rows, *userdata)¶
- Parameters:
- key ( - str) – A key in the index being traversed
- rows ( - Dee.ResultSet) – A- Dee.ResultSet. Do not free or modify.
- userdata ( - objector- None) – The pointer passed to- Dee.Index.foreach()
 
- Returns:
- Return type:
 - The signature of the function passed to - Dee.Index.foreach().- Be cautious if you plan on modifying the rows in the model via the - Dee.ModelIters you find. Your code may have to be reentrant since the index may change in reaction to the changes in the model. It’s not impossible to do this in a non-broken manner, but it may likely require you calling dee_model_freeze_signals() and dee_model_thaw_signals() at strategic points.
- Dee.ModelReaderFunc(model, iter, *userdata)¶
- Parameters:
- model ( - Dee.Model) – The model being indexed
- iter ( - Dee.ModelIter) – The row to extract terms for
- userdata ( - objector- None) – The data set when registering the reader
 
- Returns:
- A newly allocated string with the row data to be indexed. Free with - GLib.free().
- Return type:
 - Extracts a string from a row in a model. 
- Dee.SerializableParseFunc(data)¶
- Parameters:
- data ( - GLib.Variant) – A- GLib.Variantwith type signature as passed to dee_serializable_register_parser() when the parser was registered. The variant is not referenced.
- Returns:
- A newly constructed - GObject.Objectof the- GObject.GTypeused when registering the parser. Note that since the environment guarantees that the input data is valid according to the registration information this function can not fail. Thus- Noneis not a valid return value.
- Return type:
 
- Dee.TermFilterFunc(terms_in, terms_out, *filter_data)¶
- Parameters:
- terms_in ( - Dee.TermList) – A- Dee.TermListwith the terms to filter
- terms_out ( - Dee.TermList) – A- Dee.TermListto write the filtered terms to
- filter_data ( - objector- None) – User data set when registering the filter
 
 - A term filter takes a list of terms and runs it through a filtering and/or set of transformations and stores the output in a - Dee.TermList.- You can register term filters on a - Dee.Analyzerwith- Dee.Analyzer.add_term_filter().