Xfce Foundation Classes
Main Page | Index | Namespace List | Alphabetical List | Class List | File List

# Xfc::Gtk::TreeRowValues Class Reference

An object used to set multiple values in a list store row. More...

`#include <xfc/gtk/liststore.hh>`

Inheritance diagram for Xfc::Gtk::TreeRowValues:

List of all members.

## Public Member Functions

Constructors

- TreeRowValues ()
    Construct a new TreeRowValues object.
- ~TreeRowValues ()
    Destructor.

Accessors

- const GValue * gvalues () const
    Returns a pointer to the internal GValue array that holds the values to set in each column in a newly inserted row.
- const int * columns () const
    Returns a pointer to the internal integer array that holds the column numbers of the values in the GValue array.
- unsigned int size () const
    Returns the size of the internal 'integer' and 'GValue' arrays.

Methods
@ }

- void clear ()
    Removes all values added to the object and frees any resources.
- void add (int column, const G::Value &value)
    Adds the data value to be set in the cell identified column in the new row.
- void add (int column, const char *str)
    Adds the string value to be set in the cell identified column in the new row.
- void add (int column, const std::string &str)
    Adds the string value to be set in the cell identified column in the new row.
- template<typename DataType> void add (GType type, int column, const DataType &data)
    Adds the data to be set in the cell identified column in the new row.
- template<typename DataType> void add_enum (GType type, int column, const DataType &data)
    Adds the enum data to be set in the cell identified column in the new row.
- template<typename DataType> void add_object (GType type, int column, const DataType &data)
    Adds the object pointer data to be set in the cell identified column in the new row.
- template<typename DataType> void add_pointer (GType type, int column, const DataType &data)
    Adds the pointer data to be set in the cell identified column in the new row.

## Detailed Description

An object used to set multiple values in a list store row.

TreeRowValues is a wrapper object for the 'integer' and 'GValue' arrays that would otherwise have to be passed to the insert_with_values() method. Rather than pass these raw arrays, passing a TreeRowValues object provides a convenient way to set a new row's values when inserting a new row into a list store (see insert_with_values()).

## Member Function Documentation

template<typename DataType>
void Xfc::Gtk::TreeRowValues::add | ( | GType | type,
|  | int | column,
|  | const DataType & | data
| ) |

Adds the data to be set in the cell identified column in the new row.

Parameters:

  | type | The GType for the column column.
  | column | The column number to modify.
  | data | The data to set for the cell.

This method is used to add values corresponding to the standard data types used by G::Value, such as bool, int, double, String and unsigned int.

void Xfc::Gtk::TreeRowValues::add | ( | int | column,
|  | const std::string & | str
| ) |

Adds the string value to be set in the cell identified column in the new row.

Parameters:

  | column | The column number to modify.
  | str | The string for the cell.

void Xfc::Gtk::TreeRowValues::add | ( | int | column,
|  | const char * | str
| ) |

Adds the string value to be set in the cell identified column in the new row.

Parameters:

  | column | The column number to modify.
  | str | The string for the cell.

void Xfc::Gtk::TreeRowValues::add | ( | int | column,
|  | const G::Value & | value
| ) |

Adds the data value to be set in the cell identified column in the new row.

Parameters:

  | column | The column number to modify.
  | value | The new value for the cell.

template<typename DataType>
void Xfc::Gtk::TreeRowValues::add_enum | ( | GType | type,
|  | int | column,
|  | const DataType & | data
| ) |

Adds the enum data to be set in the cell identified column in the new row.

Parameters:

  | type | The GType for the column column.
  | column | The column number to modify.
  | data | The enum value to set.

This method is used to set enumeration values. The DataType is the type of the enumeration being set.

template<typename DataType>
void Xfc::Gtk::TreeRowValues::add_object | ( | GType | type,
|  | int | column,
|  | const DataType & | data
| ) |

Adds the object pointer data to be set in the cell identified column in the new row.

Parameters:

  | type | The GType for the column column.
  | column | The column number to modify.
  | data | A pointer to an object derived from G::Object, passed by reference.

template<typename DataType>
void Xfc::Gtk::TreeRowValues::add_pointer | ( | GType | type,
|  | int | column,
|  | const DataType & | data
| ) |

Adds the pointer data to be set in the cell identified column in the new row.

Parameters:

  | type | The GType for the column column.
  | column | The column number to modify.
  | data | The pointer to set in the cell.

The data argument can be a pointer to any object. The pointer is managed internally as a generic (void*) pointer. Unlike add_object() which passes the G::Object pointer internally as a GObject pointer, add_pointer() passes the pointer as is, without interpretation.

void Xfc::Gtk::TreeRowValues::clear | ( |  | ) |

| Removes all values added to the object and frees any resources. After calling this method the TreeRowValues object is empty and can be used again.

const int* Xfc::Gtk::TreeRowValues::columns | ( |  | ) | const

Returns a pointer to the internal integer array that holds the column numbers of the values in the GValue array.

Returns:
  An array of column numbers.

const GValue* Xfc::Gtk::TreeRowValues::gvalues | ( |  | ) | const

Returns a pointer to the internal GValue array that holds the values to set in each column in a newly inserted row.

Returns:
  An array of GValues.

unsigned int Xfc::Gtk::TreeRowValues::size | ( |  | ) | const

Returns the size of the internal 'integer' and 'GValue' arrays.

Returns:
  The number of values added.

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

- liststore.hh

Xfce Foundation Classes

Copyright © 2004-2005 The XFC Development Team | XFC 4.3