GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

GFC::Gtk::TreeModelFilter Class Reference

A GtkTreeModelFilter C++ wrapper class. More...

#include <gfc/gtk/treemodelfilter.hh>

Inheritance diagram for GFC::Gtk::TreeModelFilter:

GFC::G::Object GFC::Gtk::TreeModel GFC::Gtk::TreeDragSource GFC::G::TypeInstance GFC::G::TypeInterface GFC::G::TypeInterface GFC::Trackable GFC::G::TypeInstance GFC::G::TypeInstance GFC::Trackable GFC::Trackable List of all members.

Public Types

Public Member Functions

Constructors
Accessors
Methods

Protected Member Functions

Constructors

Detailed Description

A GtkTreeModelFilter C++ wrapper class.

A TreeModelFilter is a tree model which wraps another tree model, and can do the following things:


Member Typedef Documentation

typedef sigc::slot<void, const TreeModel&, const TreeIter&, G::Value&, int> GFC::Gtk::TreeModelFilter::ModifySlot
 

Signature of the callback slot which calculates display values from raw values in the model.

Example: Method signature for ModifySlot.

             void method(const TreeModel& model, const TreeIter& iter, G::Value& value, int column);
             // model: The Gtk::TreeModelFilter.
             // iter: A Gtk::TreeIter pointing to the row whose display values are determined.
             // value: A G::Value already initialized with the correct type for the specifed column. 
             // column: The column whose display value is determined. 

The slot must fill the G::Value with the display value for the specified column in the row indicated by TreeIter. Since this slot is called for each data access, it's not a particularly efficient operation.

typedef sigc::slot<bool, const TreeModel&, const TreeIter&> GFC::Gtk::TreeModelFilter::VisibleSlot
 

Signature of the callback slot which decides whether the row indicated by TreeIter is visible.

Example: Method signature for VisibleSlot.

             bool method(const TreeModel& model, const TreeIter& iter);
             // model: The Gtk::TreeModelFilter.
             // iter: A Gtk::TreeIter pointing to the row whose visibility is determined.
             // return: Whether the row indicated by iter is visible.


Constructor & Destructor Documentation

GFC::Gtk::TreeModelFilter::TreeModelFilter GtkTreeModelFilter *  filter,
bool  owns_reference = true
[explicit, protected]
 

Construct a new TreeModelFilter from an existing GtkTreeModelFilter.

Parameters:
filter A pointer to a GtkTreeModelFilter.
owns_reference Set false if the initial reference count is floating, set true if it's not.

The filter can be a newly created GtkTreeModelFilter or an existing GtkTreeModelFilter (see G::Object::Object).

GFC::Gtk::TreeModelFilter::TreeModelFilter TreeModel child_model,
const TreePath root = 0
 

Constructs a new TreeModel, with child_model as the child_model and root as the virtual root.

Parameters:
child_model A Gtk::TreeModel.
root A Gtk::TreePath or null.


Member Function Documentation

void GFC::Gtk::TreeModelFilter::clear_cache  ) 
 

This method should almost never be called.

It clears the filter of any cached iterators that haven't been reffed with ref_node(). This might be useful if the child model being filtered is static (and doesn't change often) and there has been a lot of unreffed access to nodes. As a side effect of this function, all unreffed iters will become invalid.

TreeIter GFC::Gtk::TreeModelFilter::convert_child_iter_to_iter const TreeIter child_iter  ) 
 

Returns a TreeIter that points to the row in the TreeModelFilter that corresponds to the row pointed at by child_iter.

Parameters:
child_iter A valid TreeIter pointing to a row on the child model.
Returns:
A TreeIter pointing to the row in the model being filtered.

Pointer<TreePath> GFC::Gtk::TreeModelFilter::convert_child_path_to_path const TreePath child_path  ) 
 

Converts child_path to a path relative to the TreeModelFilter.

Parameters:
child_path A TreePath to convert.
Returns:
A newly allocated TreePath, or null.

The returned path will point to the same row in the filtered model. If child_path isn't a valid path on the child model, then null is returned.

TreeIter GFC::Gtk::TreeModelFilter::convert_iter_to_child_iter const TreeIter filter_iter  ) 
 

Returns a TreeIter that points to the row on the child model that corresponds to the row pointed to by filter_iter.

Parameters:
filter_iter A valid TreeIter pointing to a row in the TreeModelFilter.
Returns:
A TreeIter pointing to the row in the child model.

Pointer<TreePath> GFC::Gtk::TreeModelFilter::convert_path_to_child_path const TreePath filter_path  ) 
 

Converts filter_path to a path in the child model of the TreeModelFilter.

Parameters:
filter_path A TreePath to convert.
Returns:
A newly allocated TreePath, or null.

The returned path will point to the same row in the filtered model. If child_path isn't a valid path in the child model, then null is returned.

TreeModel* GFC::Gtk::TreeModelFilter::get_model  )  const
 

Gets a pointer to the child model of the filter.

Returns:
The child model of the filter.

void GFC::Gtk::TreeModelFilter::set_modify_func int  n_columns,
const GType  types[],
const ModifySlot slot
 

With the n_columns and types parameters, you give an array of column types for this model (which will be exposed to the parent model/view).

Parameters:
n_columns The number of columns in the filter model.
types The GTypes of the columns.
slot A Gtk::TreeModelFilter::ModifySlot, the modify callack function.

The modify slot will get called for each data access, the goal of the modify slot is to return the data which should be displayed at the location specified using the parameters of the modify slot.

void GFC::Gtk::TreeModelFilter::set_visible_column int  column  ) 
 

Sets column of the filter's child model to be the column where the filter should look for visibility information.

Parameters:
column An integer which is the column containing the visible information.

The columns should be a column of type G_TYPE_BOOLEAN, where true means that a row is visible, and false if not.

void GFC::Gtk::TreeModelFilter::set_visible_func const VisibleSlot slot  ) 
 

Sets the visible function used when filtering the filter to be slot.

Parameters:
slot A Gtk::TreeModelFilter::VisibleSlot, the visible callack function.

The visible slot should return true if the given row should be visible and false otherwise.


The documentation for this class was generated from the following file:
Generated on Tue Aug 24 00:34:43 2004 for GFC-UI by doxygen 1.3.8