EphyTreeModelNode
3
EPIPHANY Library

# EphyTreeModelNode

a GtkTreeModel of EphyNode elements

## Synopsis

                        EphyTreeModelNode;
    EphyTreeModelNode * ephy_tree_model_node_new            (EphyNode *root);
    int                 ephy_tree_model_node_add_prop_column
                                                            (EphyTreeModelNode *model,
                                                             GType value_type,
                                                             int prop_id);
    int                 ephy_tree_model_node_add_func_column
                                                            (EphyTreeModelNode *model,
                                                             GType value_type,
                                                             EphyTreeModelNodeValueFunc func,
                                                             gpointer user_data);
    EphyNode *          ephy_tree_model_node_node_from_iter (EphyTreeModelNode *model,
                                                             GtkTreeIter *iter);
    void                ephy_tree_model_node_iter_from_node (EphyTreeModelNode *model,
                                                             EphyNode *node,
                                                             GtkTreeIter *iter);

## Object Hierarchy

      GObject
       +----EphyTreeModelNode

## Implemented Interfaces

EphyTreeModelNode implements GtkTreeModel.

## Properties

      "root"                     gpointer              : Read / Write / Construct Only

## Description

EphyTreeModelNode implements a GtkTreeModel that holds EphyNode elements. It can be used with EphyNodeView and EphyTreeModelFilter.

## Details

### EphyTreeModelNode

    typedef struct _EphyTreeModelNode EphyTreeModelNode;

### ephy_tree_model_node_new ()

    EphyTreeModelNode * ephy_tree_model_node_new            (EphyNode *root);

Create a new EphyTreeModelNode object and set `root` as its root node.

`root` :

  root EphyNode of the model

Returns :

  a new EphyTreeModelNode

### ephy_tree_model_node_add_prop_column ()

    int                 ephy_tree_model_node_add_prop_column
                                                            (EphyTreeModelNode *model,
                                                             GType value_type,
                                                             int prop_id);

Add a new column to `model` obtaining its value from `prop_id` in `model`.

`model` :

  an EphyTreeModelNode

`value_type` :

  type held by the new column

`prop_id` :

  column in `model` to get the value for this column

Returns :

  the id of the new column

### ephy_tree_model_node_add_func_column ()

    int                 ephy_tree_model_node_add_func_column
                                                            (EphyTreeModelNode *model,
                                                             GType value_type,
                                                             EphyTreeModelNodeValueFunc func,
                                                             gpointer user_data);

Adds a new column to `model` with its value determined by `func`.

`model` :

  an EphyTreeModelNode

`value_type` :

  type held by the new column

`func` :

  data function to be used to provide the value of the new column

`user_data` :

  optional user data for `func`

Returns :

  the id of the new column

### ephy_tree_model_node_node_from_iter ()

    EphyNode *          ephy_tree_model_node_node_from_iter (EphyTreeModelNode *model,
                                                             GtkTreeIter *iter);

Gets the EphyNode corresponding to `iter` from `model`.

`model` :

  an EphyTreeModelNode

`iter` :

  iter from where to get the node

Returns :

  the EphyNode corresponding to `iter`

### ephy_tree_model_node_iter_from_node ()

    void                ephy_tree_model_node_iter_from_node (EphyTreeModelNode *model,
                                                             EphyNode *node,
                                                             GtkTreeIter *iter);

Gets the corresponding GtkTreeIter for `node` from `model`.

`model` :

  an EphyTreeModelNode

`node` :

  the EphyNode from which we want the iter to be obtained

`iter` :

  location to return the GtkTreeIter

## Property Details

### The `"root"` property

      "root"                     gpointer              : Read / Write / Construct Only

The root EphyNode of the model.