Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# Inti::Gtk::TreeModelSort Class Reference

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

`#include <inti/gtk/treemodelsort.h>`

Inheritance diagram for Inti::Gtk::TreeModelSort:

List of all members.

## Public Member Functions

Constructors

- TreeModelSort (TreeModel &child_model)
    Constructs a new tree model, with child_model as the child model.
- virtual ~TreeModelSort ()
    Destructor.

Accessors

- GtkTreeModelSort * gtk_tree_model_sort () const
    Get a pointer to the GtkTreeModelSort structure.
- GtkTreeModelSortClass * gtk_tree_model_sort_class () const
    Get a pointer to the GtkTreeModelSortClass structure.
- operator GtkTreeModelSort * () const
    Conversion operator; safely converts a TreeModelSort to a GtkTreeModelSort pointer.
- TreeModel * get_model () const
    Returns the model the TreeModelSort is sorting.
- bool iter_is_valid (const TreeIter &iter) const
    Checks if the given iter is a valid iter for this TreeModelSort.

Methods

- Pointer< TreePath > convert_child_path_to_path (const TreePath &child_path)
    Converts child_path to a path relative to the TreeModelSort.
- TreeIter 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.
- Pointer< TreePath > convert_path_to_child_path (const TreePath &sorted_path)
    Converts sorted_path to a path on the child model of the TreeModelSort.
- TreeIter 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.
- void reset_default_sort_func ()
    This resets the default sort function to be in the 'unsorted' state.
- void clear_cache ()
    This method should almost never be called.

Property Proxies

- const ModelPropertyProxy prop_model ()
    The model for the TreeModelSort to sort (TreeModel* : Read / Write / Construct Only).

## Protected Member Functions

Constructors

- TreeModelSort (GtkTreeModelSort *tree_model, bool reference=true)
    Construct a new TreeModelSort from an existing GtkTreeModelSort.

## Detailed Description

A GtkTreeModelSort C++ wrapper class.

TreeModelSort implements a model that can be sorted.

## Constructor & Destructor Documentation

Inti::Gtk::TreeModelSort::TreeModelSort | ( | GtkTreeModelSort * | tree_model,
|  | bool | reference = true
| ) | `[explicit, protected]`

Construct a new TreeModelSort from an existing GtkTreeModelSort.

Parameters:

  tree_model | A pointer to a GtkTreeModelSort.
  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).

Inti::Gtk::TreeModelSort::TreeModelSort | ( | TreeModel & | child_model | ) |

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

Parameters:

  child_model | A TreeModel.

## Member Function Documentation

void Inti::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.

TreeIter Inti::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> Inti::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 Inti::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.

Pointer<TreePath> Inti::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.

TreeModel* Inti::Gtk::TreeModelSort::get_model | ( |  | ) | const

Returns the model the TreeModelSort is sorting.

Returns:
  The "child model" being sorted.

bool Inti::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.

void Inti::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.

The documentation for this class was generated from the following file:

- treemodelsort.h

Main Page - Footer