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 indexedrow2 ([
GLib.Variant]) – The row to extract terms foruser_data (
objectorNone) – 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 datarow2 ([
GLib.Variant]) – Row data to compare withuser_data (
objectorNone) – 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() andDee.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 filterfilter_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 invokeduser_data (
objectorNone) – 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 methodsDee.FilterModel.append_iter(),Dee.FilterModel.prepend_iter(),Dee.FilterModel.insert_iter(), andDee.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 roworig_iter (
Dee.ModelIter) – ADee.ModelIterpointing to the new row in orig_modelfilter_model (
Dee.FilterModel) – The model that was also passed to the #DeeModelMapFunc of theDee.Filterthis functions is a part ofuser_data (
objectorNone) – User data for theDee.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(), andDee.FilterModel.insert_iter_before().
- Dee.IndexIterFunc(key, rows, *userdata)¶
- Parameters:
key (
str) – A key in the index being traversedrows (
Dee.ResultSet) – ADee.ResultSet. Do not free or modify.userdata (
objectorNone) – The pointer passed toDee.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 indexediter (
Dee.ModelIter) – The row to extract terms foruserdata (
objectorNone) – 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) – AGLib.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 theGObject.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. ThusNoneis not a valid return value.- Return type:
- Dee.TermFilterFunc(terms_in, terms_out, *filter_data)¶
- Parameters:
terms_in (
Dee.TermList) – ADee.TermListwith the terms to filterterms_out (
Dee.TermList) – ADee.TermListto write the filtered terms tofilter_data (
objectorNone) – 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.AnalyzerwithDee.Analyzer.add_term_filter().