Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Xfc::Gtk::TreeModelSort Class Reference

A GtkTreeModelSort C++ wrapper class. More...

#include <xfc/gtk/treemodelsort.hh>

Inheritance diagram for Xfc::Gtk::TreeModelSort:

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

Public Member Functions

Accessors
Methods

Detailed Description

A GtkTreeModelSort C++ wrapper class.

TreeModelSort implements a model that can be sorted.


Constructor & Destructor Documentation

Xfc::Gtk::TreeModelSort::TreeModelSort ( GtkTreeModelSort *  tree_model,
bool  owns_reference = true 
) [explicit, protected]

Construct a new TreeModelSort from an existing GtkTreeModelSort.

Parameters:
tree_model A pointer to a GtkTreeModelSort.
owns_reference Set false if the initial reference count is floating, set true if it's not.
The tree_model can be a newly created GtkTreeModelSort or an existing GtkTreeModelSort (see G::Object::Object).

Xfc::Gtk::TreeModelSort::TreeModelSort ( TreeModel child_model  ) 

Constructs a new tree model, with child_model as the child model.

Parameters:
child_model A TreeModel.
TreeModelSort is created with a reference count of 1 that the caller owns.

Xfc::Gtk::TreeModelSort::TreeModelSort ( GtkTreeModelSort *  tree_model,
bool  owns_reference = true 
) [explicit, protected]

Construct a new TreeModelSort from an existing GtkTreeModelSort.

Parameters:
tree_model A pointer to a GtkTreeModelSort.
owns_reference Set false if the initial reference count is floating, set true if it's not.
The tree_model can be a newly created GtkTreeModelSort or an existing GtkTreeModelSort (see G::Object::Object).

Xfc::Gtk::TreeModelSort::TreeModelSort ( TreeModel child_model  ) 

Constructs a new tree model, with child_model as the child model.

Parameters:
child_model A TreeModel.
TreeModelSort is created with a reference count of 1 that the caller owns.


Member Function Documentation

TreeModel* Xfc::Gtk::TreeModelSort::get_model (  )  const

Returns the model the TreeModelSort is sorting.

Returns:
The "child model" being sorted.

bool Xfc::Gtk::TreeModelSort::iter_is_valid ( const TreeIter iter  )  const

Checks if the given iter is a valid iter for this TreeModelSort.

Parameters:
iter A TreeIter.
Returns:
true if the iter is valid, false if the iter is invalid.
WARNING: This function is slow. Only use it for debugging and/or testing purposes.

Pointer<TreePath> Xfc::Gtk::TreeModelSort::convert_child_path_to_path ( const TreePath child_path  ) 

Converts child_path to a path relative to the TreeModelSort.

Parameters:
child_path A TreePath to convert.
Returns:
A newly allocated TreePath, or null.
child_path points to a path in the child model. The returned path will point to the same row in the sorted model. If child_path isn't a valid path on the child model, then null is returned.

TreeIter Xfc::Gtk::TreeModelSort::convert_child_iter_to_iter ( const TreeIter child_iter  ) 

Returns a TreeIter that points to the row in the TreeModelSort 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 sorted.

Pointer<TreePath> Xfc::Gtk::TreeModelSort::convert_path_to_child_path ( const TreePath sorted_path  ) 

Converts sorted_path to a path on the child model of the TreeModelSort.

Parameters:
sorted_path A TreePath to convert.
Returns:
A newly allocated TreePath, or null.
sorted_path points to a location in the TreeModelSort. The returned path will point to the same location in the model not being sorted. If sorted_path does not point to a location in the child model, null is returned.

TreeIter Xfc::Gtk::TreeModelSort::convert_iter_to_child_iter ( const TreeIter sorted_iter  ) 

Returns a TreeIter that points to the row on the model being sorted that corresponds to the row on the TreeModelSort pointed to by sorted_iter.

Parameters:
sorted_iter A valid TreeIter pointing to a row on the TreeModelSort.
Returns:
A TreeIter pointing to the row on the model being sorted.

void Xfc::Gtk::TreeModelSort::reset_default_sort_func (  ) 

This resets the default sort function to be in the 'unsorted' state.

That is, it is in the same order as the child model. It will re-sort the model to be in the same order as the child model only if the TreeModelSort is in 'unsorted' state.

Reimplemented from Xfc::Gtk::TreeSortable.

void Xfc::Gtk::TreeModelSort::clear_cache (  ) 

This method should almost never be called.

It clears the TreeModelSort of any cached iterators that haven't been reffed with ref_node(). This might be useful if the child model being sorted 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.


The documentation for this class was generated from the following file: Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC 4.3