## ETreeModelGenerator

ETreeModelGenerator

## Synopsis

    gint                (*ETreeModelGeneratorGenerateFunc)  (GtkTreeModel *model,
                                                             GtkTreeIter *child_iter,
                                                             gpointer data);
    void                (*ETreeModelGeneratorModifyFunc)    (GtkTreeModel *model,
                                                             GtkTreeIter *child_iter,
                                                             gint permutation_n,
                                                             gint column,
                                                             GValue *value,
                                                             gpointer data);
                        ETreeModelGenerator;
    ETreeModelGenerator * e_tree_model_generator_new        (GtkTreeModel *child_model);
    GtkTreeModel *      e_tree_model_generator_get_model    (ETreeModelGenerator *tree_model_generator);
    void                e_tree_model_generator_set_generate_func
                                                            (ETreeModelGenerator *tree_model_generator,
                                                             ETreeModelGeneratorGenerateFunc func,
                                                             gpointer data,
                                                             GDestroyNotify destroy);
    void                e_tree_model_generator_set_modify_func
                                                            (ETreeModelGenerator *tree_model_generator,
                                                             ETreeModelGeneratorModifyFunc func,
                                                             gpointer data,
                                                             GDestroyNotify destroy);
    GtkTreePath *       e_tree_model_generator_convert_child_path_to_path
                                                            (ETreeModelGenerator *tree_model_generator,
                                                             GtkTreePath *child_path);
    void                e_tree_model_generator_convert_child_iter_to_iter
                                                            (ETreeModelGenerator *tree_model_generator,
                                                             GtkTreeIter *generator_iter,
                                                             GtkTreeIter *child_iter);
    GtkTreePath *       e_tree_model_generator_convert_path_to_child_path
                                                            (ETreeModelGenerator *tree_model_generator,
                                                             GtkTreePath *generator_path);
    void                e_tree_model_generator_convert_iter_to_child_iter
                                                            (ETreeModelGenerator *tree_model_generator,
                                                             GtkTreeIter *child_iter,
                                                             gint *permutation_n,
                                                             GtkTreeIter *generator_iter);

## Object Hierarchy

      GObject
       +----ETreeModelGenerator

## Implemented Interfaces

ETreeModelGenerator implements GtkTreeModel.

## Properties

      "child-model"              GObject*              : Read / Write / Construct Only

## Description

## Details

### ETreeModelGeneratorGenerateFunc ()

    gint                (*ETreeModelGeneratorGenerateFunc)  (GtkTreeModel *model,
                                                             GtkTreeIter *child_iter,
                                                             gpointer data);

`model` : |
`child_iter` : |
`data` : |
Returns : |

### ETreeModelGeneratorModifyFunc ()

    void                (*ETreeModelGeneratorModifyFunc)    (GtkTreeModel *model,
                                                             GtkTreeIter *child_iter,
                                                             gint permutation_n,
                                                             gint column,
                                                             GValue *value,
                                                             gpointer data);

`model` : |
`child_iter` : |
`permutation_n` : |
`column` : |
`value` : |
`data` : |

### ETreeModelGenerator

    typedef struct _ETreeModelGenerator ETreeModelGenerator;

### e_tree_model_generator_new ()

    ETreeModelGenerator * e_tree_model_generator_new        (GtkTreeModel *child_model);

Creates a new ETreeModelGenerator wrapping `child_model`.

`child_model` : | a GtkTreeModel
Returns : | A new ETreeModelGenerator.

### e_tree_model_generator_get_model ()

    GtkTreeModel *      e_tree_model_generator_get_model    (ETreeModelGenerator *tree_model_generator);

Gets the child model being wrapped by `tree_model_generator`.

`tree_model_generator` : | an ETreeModelGenerator
Returns : | A GtkTreeModel being wrapped.

### e_tree_model_generator_set_generate_func ()

    void                e_tree_model_generator_set_generate_func
                                                            (ETreeModelGenerator *tree_model_generator,
                                                             ETreeModelGeneratorGenerateFunc func,
                                                             gpointer data,
                                                             GDestroyNotify destroy);

Sets the callback function used to filter or generate additional rows based on the child model's data. This function is called for each child row, and returns a value indicating the number of rows that will be used to represent the child row - 0 or more.

If `func` is `NULL`, a filtering/generating function will not be applied.

`tree_model_generator` : | an ETreeModelGenerator
`func` : | an ETreeModelGeneratorGenerateFunc, or `NULL`
`data` : | user data to pass to `func`

### e_tree_model_generator_set_modify_func ()

    void                e_tree_model_generator_set_modify_func
                                                            (ETreeModelGenerator *tree_model_generator,
                                                             ETreeModelGeneratorModifyFunc func,
                                                             gpointer data,
                                                             GDestroyNotify destroy);

Sets the callback function used to override values for the child row's columns and specify values for generated rows' columns.

If `func` is `NULL`, the child model's values will always be used.

`tree_model_generator` : | an ETreeModelGenerator
`func` : | an `ETreeModelGeneratorModifyFunc`, or `NULL`
`data` : | user data to pass to `func`

### e_tree_model_generator_convert_child_path_to_path ()

    GtkTreePath *       e_tree_model_generator_convert_child_path_to_path
                                                            (ETreeModelGenerator *tree_model_generator,
                                                             GtkTreePath *child_path);

Convert a path to a child row to a path to a `tree_model_generator` row.

`tree_model_generator` : | an ETreeModelGenerator
`child_path` : | a GtkTreePath
Returns : | A new GtkTreePath, owned by the caller.

### e_tree_model_generator_convert_child_iter_to_iter ()

    void                e_tree_model_generator_convert_child_iter_to_iter
                                                            (ETreeModelGenerator *tree_model_generator,
                                                             GtkTreeIter *generator_iter,
                                                             GtkTreeIter *child_iter);

Convert `child_iter` to a corresponding GtkTreeIter for `tree_model_generator`, storing the result in `generator_iter`.

`tree_model_generator` : | an ETreeModelGenerator
`generator_iter` : | a GtkTreeIter to set
`child_iter` : | a GtkTreeIter to convert

### e_tree_model_generator_convert_path_to_child_path ()

    GtkTreePath *       e_tree_model_generator_convert_path_to_child_path
                                                            (ETreeModelGenerator *tree_model_generator,
                                                             GtkTreePath *generator_path);

Converts `generator_path` to a corresponding GtkTreePath in the child model.

`tree_model_generator` : | an ETreeModelGenerator
`generator_path` : | a GtkTreePath to a `tree_model_generator` row
Returns : | A new GtkTreePath, owned by the caller.

### e_tree_model_generator_convert_iter_to_child_iter ()

    void                e_tree_model_generator_convert_iter_to_child_iter
                                                            (ETreeModelGenerator *tree_model_generator,
                                                             GtkTreeIter *child_iter,
                                                             gint *permutation_n,
                                                             GtkTreeIter *generator_iter);

Converts a `tree_model_generator` row into a child row and permutation index. The permutation index is the index of the generated row based on this child row, with the first generated row based on this child row being 0.

`tree_model_generator` : | an ETreeModelGenerator
`child_iter` : | a GtkTreeIter to set
`permutation_n` : | a permutation index to set
`generator_iter` : | a GtkTreeIter indicating the row to convert

## Property Details

### The `"child-model"` property

      "child-model"              GObject*              : Read / Write / Construct Only

The child model to extend.