gtkutil::TreeModel Class Reference

#include <TreeModel.h>

Data Structures

class  SelectionFinder

Static Public Member Functions

static std::string getString (GtkTreeModel *model, GtkTreeIter *iter, gint colNo)
static bool getBoolean (GtkTreeModel *model, GtkTreeIter *iter, gint colNo)
static int getInt (GtkTreeModel *model, GtkTreeIter *iter, gint colNo)
static gpointer getPointer (GtkTreeModel *model, GtkTreeIter *iter, gint colNo)
static std::string getSelectedString (GtkTreeSelection *selection, gint colNo)
static std::string getSelectedParentString (GtkTreeSelection *sel, gint colNo)
static bool getSelectedBoolean (GtkTreeSelection *selection, gint colNo)
static gpointer getSelectedPointer (GtkTreeSelection *selection, gint colNo)
static gboolean equalFuncStringContains (GtkTreeModel *model, gint column, const gchar *key, GtkTreeIter *iter, gpointer search_data)

Detailed Description

Utility class for operation on GtkTreeModels. This class provides methods to retrieve strings and other values from a tree model without having to manually use GValues etc.

Definition at line 17 of file TreeModel.h.


Member Function Documentation

static gboolean gtkutil::TreeModel::equalFuncStringContains ( GtkTreeModel *  model,
gint  column,
const gchar *  key,
GtkTreeIter *  iter,
gpointer  search_data 
) [static]

greebo: Utility callback for use in gtk_tree_view_set_search_equal_func, which enables some sort of "full string" search in treeviews.

The equalFuncStringContains returns "match" as soon as the given key occurs somewhere in the string in question, not only at the beginning (GTK default).

Prerequisites: The search column must contain a string.

static bool gtkutil::TreeModel::getBoolean ( GtkTreeModel *  model,
GtkTreeIter *  iter,
gint  colNo 
) [static]

Extract a boolean from the given row of the provided TreeModel.

Parameters:
model The TreeModel* to examine.
iter A GtkTreeIter pointing to the row to look up.
colNo The column number to look up.
static int gtkutil::TreeModel::getInt ( GtkTreeModel *  model,
GtkTreeIter *  iter,
gint  colNo 
) [static]

Extract an integer from the given row of the provided TreeModel.

Parameters:
model The TreeModel* to examine.
iter A GtkTreeIter pointing to the row to look up.
colNo The column number to look up.
static gpointer gtkutil::TreeModel::getPointer ( GtkTreeModel *  model,
GtkTreeIter *  iter,
gint  colNo 
) [static]

Extract a pointer from the given row of the provided TreeModel.

Parameters:
model The TreeModel* to examine.
iter A GtkTreeIter pointing to the row to look up.
colNo The column number to look up.
static bool gtkutil::TreeModel::getSelectedBoolean ( GtkTreeSelection selection,
gint  colNo 
) [static]

Extract the selected boolean from the given column in the TreeModel. The selection object will be queried for a selection.

Parameters:
selection GtkTreeSelection object to be tested for a selection.
colNo The column number to extract data from if the selection is valid.
Returns:
: the boolean of the selected iter. If nothing is selected, the method will return false.
static std::string gtkutil::TreeModel::getSelectedParentString ( GtkTreeSelection sel,
gint  colNo 
) [static]

Extract the parent string from the selected entry from the given column in the TreeModel. The selection object will be queried for a selection. After that we are trying to get the parent, if there is one, return the string for the given column, if there is none an empty string will be returned.

Parameters:
sel GtkTreeSelection object to be tested for a selection.
colNo The column number to extract data from if the selection is valid.
static gpointer gtkutil::TreeModel::getSelectedPointer ( GtkTreeSelection selection,
gint  colNo 
) [static]

Extract the selected pointer from the given column in the TreeModel. The selection object will be queried for a selection, and the pointer returned if present, otherwise NULL will be returned.

Parameters:
selection GtkTreeSelection object to be tested for a selection.
colNo The column number to extract data from if the selection is valid.
static std::string gtkutil::TreeModel::getSelectedString ( GtkTreeSelection selection,
gint  colNo 
) [static]

Extract the selected string from the given column in the TreeModel. The selection object will be queried for a selection, and the string returned if present, otherwise an empty string will be returned.

Parameters:
selection GtkTreeSelection object to be tested for a selection.
colNo The column number to extract data from if the selection is valid.
static std::string gtkutil::TreeModel::getString ( GtkTreeModel *  model,
GtkTreeIter *  iter,
gint  colNo 
) [static]

Extract a string from the given row of the provided TreeModel.

Parameters:
model The TreeModel* to examine.
iter A GtkTreeIter pointing to the row to look up.
colNo The column number to look up.

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

Generated by  doxygen 1.6.2