libgnomedbmm Reference Documentation
Main Page   Namespaces   Book  

Gnome::Db::DataStore Class Reference

This object implements the Gtk::TreeModel interface, to make it easy to display a Gda::DataModel in a Gtk::TreeView widget. More...

Inheritance diagram for Gnome::Db::DataStore:

Inheritance graph
[legend]
List of all members.

Public Member Functions

bool append (Gtk::TreeModel::iterator& iter)
 Appends a new row.
void erase (const Gtk::TreeModel::iterator& iter)
 Marks the row pointed by iter to be deleted.
bool get_iter_from_values (Gtk::TreeModel::iterator& iter, const Glib::SListHandle<Gda::Value>& values, const Glib::ArrayHandle<int>& cols_index) const
 Sets iter to the first row where all the values in values at the columns identified at cols_index match.
Glib::RefPtr<const Gda::DataProxy> get_proxy () const
 
Returns:
The internal Gda::DataProxy being used by store .

Glib::RefPtr<Gda::DataProxy> get_proxy ()
 
Returns:
The internal Gda::DataProxy being used by store .

int get_row_from_iter (const Gtk::TreeModel::iterator& iter) const
 Get the number of the row represented by iter.
const GnomeDbDataStore* gobj () const
 Provides access to the underlying C GObject.
GnomeDbDataStore* gobj ()
 Provides access to the underlying C GObject.
GnomeDbDataStore* gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Glib::PropertyProxy_ReadOnly<
Glib::RefPtr<Gda::DataModel >> 
property_model () const
 You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<
bool > 
property_prepend_null_entry () const
 You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<bool> property_prepend_null_entry ()
 You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<
Glib::RefPtr<Gda::DataProxy >> 
property_proxy () const
 You rarely need to use properties because there are get_ and set_ methods for almost all of them.
bool set_value (const Gtk::TreeModel::iterator& iter, int col, const Gda::Value& value)
 Stores a value in the store data model.
void unerase (const Gtk::TreeModel::iterator& iter)
 Remove the "to be deleted" mark the row pointed by iter , if it existed.
virtual ~DataStore ()

Static Public Member Functions

static Glib::RefPtr<DataStorecreate (const Glib::RefPtr<Gda::DataModel>& model)

Protected Member Functions

 DataStore (const Glib::RefPtr<Gda::DataModel>& model)

Related Functions

(Note that these are not member functions.)

Glib::RefPtr<Gnome::Db::DataStorewrap (GnomeDbDataStore* object, bool take_copy=false)
 
Parameters:
object The C instance


Detailed Description

This object implements the Gtk::TreeModel interface, to make it easy to display a Gda::DataModel in a Gtk::TreeView widget.

Internally, a Gda::DataProxy is used so it is possible to adjust the range of displayed data using that object.

Specifically, for a Gda::DataModel object containing nb_cols columns,the DataStore object provides the following columns, for a given row:


Constructor & Destructor Documentation

virtual Gnome::Db::DataStore::~DataStore (  )  [virtual]

Gnome::Db::DataStore::DataStore ( const Glib::RefPtr< Gda::DataModel > &  model  )  [explicit, protected]


Member Function Documentation

bool Gnome::Db::DataStore::append ( Gtk::TreeModel::iterator iter  ) 

Appends a new row.

Parameters:
iter An unset Gtk::TreeIter to set to the appended row.
Returns:
true if no error occurred.

static Glib::RefPtr<DataStore> Gnome::Db::DataStore::create ( const Glib::RefPtr< Gda::DataModel > &  model  )  [static]

void Gnome::Db::DataStore::erase ( const Gtk::TreeModel::iterator iter  ) 

Marks the row pointed by iter to be deleted.

Parameters:
iter The considered row.

bool Gnome::Db::DataStore::get_iter_from_values ( Gtk::TreeModel::iterator iter,
const Glib::SListHandle< Gda::Value > &  values,
const Glib::ArrayHandle< int > &  cols_index 
) const

Sets iter to the first row where all the values in values at the columns identified at cols_index match.

If the row can't be identified, then the contents of iter is not modified.

NOTE: the cols_index array MUST contain a column index for each value in values

Parameters:
iter An unset Gtk::TreeIter to set to the requested row.
values A list of G::Value values.
cols_index An array of int containing the column number to match each value of values .
Returns:
true if the row has been identified iter was set.

Glib::RefPtr<const Gda::DataProxy> Gnome::Db::DataStore::get_proxy (  )  const

Returns:
The internal Gda::DataProxy being used by store .

Glib::RefPtr<Gda::DataProxy> Gnome::Db::DataStore::get_proxy (  ) 

Returns:
The internal Gda::DataProxy being used by store .

int Gnome::Db::DataStore::get_row_from_iter ( const Gtk::TreeModel::iterator iter  )  const

Get the number of the row represented by iter.

Parameters:
iter A valid Gtk::TreeIter.
Returns:
The row number, or -1 if an error occurred.

const GnomeDbDataStore* Gnome::Db::DataStore::gobj (  )  const [inline]

Provides access to the underlying C GObject.

Reimplemented from Gtk::TreeModel.

GnomeDbDataStore* Gnome::Db::DataStore::gobj (  )  [inline]

Provides access to the underlying C GObject.

Reimplemented from Gtk::TreeModel.

GnomeDbDataStore* Gnome::Db::DataStore::gobj_copy (  ) 

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gda::DataModel> > Gnome::Db::DataStore::property_model (  )  const

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<bool> Gnome::Db::DataStore::property_prepend_null_entry (  )  const

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<bool> Gnome::Db::DataStore::property_prepend_null_entry (  ) 

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gda::DataProxy> > Gnome::Db::DataStore::property_proxy (  )  const

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

bool Gnome::Db::DataStore::set_value ( const Gtk::TreeModel::iterator iter,
int  col,
const Gda::Value &  value 
)

Stores a value in the store data model.

Parameters:
iter The considered row.
col The considered column.
value The value to store (gets copied).
Returns:
true on succes.

void Gnome::Db::DataStore::unerase ( const Gtk::TreeModel::iterator iter  ) 

Remove the "to be deleted" mark the row pointed by iter , if it existed.

Parameters:
iter The considered row.


Friends And Related Function Documentation

Glib::RefPtr<Gnome::Db::DataStore> wrap ( GnomeDbDataStore *  object,
bool  take_copy = false 
) [related]

Parameters:
object The C instance

Parameters:
take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns:
A C++ instance that wraps this C instance.


The documentation for this class was generated from the following file:
Generated for libgnomedbmm by Doxygen 1.5.1 © 1997-2001