libgda-uimm: Gnome::GdaUI::DataStore Class Reference

DataStore - Bridge between a Gnome::Gda::DataModel and a Gtk::TreeModel. More...

#include <libgda-uimm/datastore.h>

Inheritance diagram for Gnome::GdaUI::DataStore:

List of all members.

Public Member Functions

virtual ~DataStore ()
GdauiDataStore* gobj ()
 Provides access to the underlying C GObject.

const GdauiDataStore* gobj () const
 Provides access to the underlying C GObject.

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

 DataStore (const Glib::RefPtr< Gnome::Gda::DataModel >& model)
 Creates a Gtk::TreeModel interface with a Gda::DataModel.

Glib::RefPtr

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

Gnome::Gda::DataProxy > 
get_proxy () const
int get_row_from_iter (const Gtk::TreeModel::const_iterator& iter) const
 Get the number of the row represented by iter.

bool set_value (const Gtk::TreeModel::iterator& iter, int col, const Glib::ValueBase&value)
 Stores a value in the store data model.

template<class DataType >
bool set_value (const Gtk::TreeModel::iterator& iter, int col, const DataType&value)
 Stores a value in the store data model.

void remove (const Gtk::TreeModel::iterator& iter)
 Marks the row pointed by iter to be deleted.

void restore (const Gtk::TreeModel::iterator& iter)
 Remove the "to be deleted" mark the row pointed by iter, if it existed.

bool append (const Gtk::TreeModel::iterator& iter)
 Appends a new row.

Glib::PropertyProxy_ReadOnly

< Glib::RefPtr

< Gnome::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< 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

< 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_ReadOnly

< Glib::RefPtr

< Gnome::Gda::DataProxy > > 
property_proxy () const
 You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Related Functions

(Note that these are not member functions.)

Glib::RefPtr

< Gnome::GdaUI::DataStore
wrap (GdauiDataStore* object, bool take_copy=false)
 A Glib::wrap() method for this object.


Detailed Description

DataStore - Bridge between a Gnome::Gda::DataModel and a Gtk::TreeModel.

The DataStore object implements the Gtk::TreeModel interface on top of a Gnome::Gda::DataModel to be able to display its contents in a GtkTreeView.


Constructor & Destructor Documentation

virtual Gnome::GdaUI::DataStore::~DataStore ( ) [virtual]
Gnome::GdaUI::DataStore::DataStore ( const Glib::RefPtr< Gnome::Gda::DataModel > &  model) [explicit]

Creates a Gtk::TreeModel interface with a Gda::DataModel.

Since libgda-uimm 4.2:
Parameters:
modelA Gda::DataModel object.
Returns:
The new object.

Member Function Documentation

bool Gnome::GdaUI::DataStore::append ( const Gtk::TreeModel::iterator iter)

Appends a new row.

Since libgda-uimm 4.2:
Parameters:
iterAn unset Gtk::TreeIter to set to the appended row.
Returns:
true if no error occurred.
Glib::RefPtr<Gnome::Gda::DataProxy> Gnome::GdaUI::DataStore::get_proxy ( )
Since libgda-uimm 4.2:
Returns:
The internal Gda::DataProxy being used by store.
Glib::RefPtr<const Gnome::Gda::DataProxy> Gnome::GdaUI::DataStore::get_proxy ( ) const
Since libgda-uimm 4.2:
Returns:
The internal Gda::DataProxy being used by store.
int Gnome::GdaUI::DataStore::get_row_from_iter ( const Gtk::TreeModel::const_iterator iter) const

Get the number of the row represented by iter.

Since libgda-uimm 4.2:
Parameters:
iterA valid Gtk::TreeIter.
Returns:
The row number, or -1 if an error occurred.
const GdauiDataStore* Gnome::GdaUI::DataStore::gobj ( ) const [inline]

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

GdauiDataStore* Gnome::GdaUI::DataStore::gobj ( ) [inline]

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

GdauiDataStore* Gnome::GdaUI::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<Gnome::Gda::DataModel> > Gnome::GdaUI::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<bool> Gnome::GdaUI::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<bool> Gnome::GdaUI::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_ReadOnly< Glib::RefPtr<Gnome::Gda::DataProxy> > Gnome::GdaUI::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.
void Gnome::GdaUI::DataStore::remove ( const Gtk::TreeModel::iterator iter)

Marks the row pointed by iter to be deleted.

Since libgda-uimm 4.2:
Parameters:
iterThe considered row.
void Gnome::GdaUI::DataStore::restore ( const Gtk::TreeModel::iterator iter)

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

Since libgda-uimm 4.2:
Parameters:
iterThe considered row.
bool Gnome::GdaUI::DataStore::set_value ( const Gtk::TreeModel::iterator iter,
int  col,
const Glib::ValueBase value 
)

Stores a value in the store data model.

Since libgda-uimm 4.2:
Parameters:
iterThe considered row.
colThe data model column.
valueThe value to store (gets copied).
Returns:
true on success.
template <class DataType >
bool Gnome::GdaUI::DataStore::set_value ( const Gtk::TreeModel::iterator iter,
int  col,
const DataType &  value 
)

Stores a value in the store data model.

Parameters:
iterThe considered row.
colThe column.
valueThe value to store.
Returns:
true on success, false otherwise.

Friends And Related Function Documentation

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

A Glib::wrap() method for this object.

Parameters:
objectThe C instance.
take_copyFalse 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.