#include <dataproxy.h>
Inheritance diagram for Gnome::Gda::DataProxy:
Public Member Functions | |
virtual | ~DataProxy () |
GdaDataProxy* | gobj () |
Provides access to the underlying C GObject. | |
const GdaDataProxy* | gobj () const |
Provides access to the underlying C GObject. | |
GdaDataProxy* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
Glib::RefPtr<DataModel> | get_proxied_model () |
Fetch the Gda::DataModel which proxy does proxy. | |
Glib::RefPtr<const DataModel> | get_proxied_model () const |
Fetch the Gda::DataModel which proxy does proxy. | |
int | get_proxied_model_n_cols () const |
Get the number of columns in the proxied data model. | |
int | get_proxied_model_n_rows () const |
Get the number of rows in the proxied data model. | |
bool | is_read_only () const |
ValueSList | get_values (int proxy_row, const Glib::ArrayHandle<int>& cols_index) const |
ValueAttribute | get_value_attributes (int proxy_row, int col) const |
Get the attributes of the value stored at (proxy_row, col) in proxy , which is an ORed value of Gda::ValueAttribute flags. | |
void | alter_value_attributes (int proxy_row, int col, ValueAttribute alter_flags) |
Alters the attributes of the value stored at (proxy_row, col) in proxy . | |
int | get_proxied_model_row (int proxy_row) const |
Get the proxy 's proxied model row corresponding to proxy_row. | |
void | erase (int proxy_row) |
Marks the row proxy_row to be deleted. | |
void | unerase (int proxy_row) |
Remove the "to be deleted" mark at the row proxy_row , if it existed. | |
bool | row_is_deleted (int proxy_row) const |
Tells if the row number proxy_row is marked to be deleted. | |
bool | row_is_inserted (int proxy_row) const |
Tells if the row number proxy_row is a row which has been inserted in proxy (and is thus not in the proxied data model). | |
int | find_row_from_values (const ValueSList& values, const Glib::ArrayHandle<int>& cols_index) const |
Find the first row where all the values in values at the columns identified at cols_index match. | |
void | cancel_row_changes (int proxy_row, int col) |
Resets data at the corresponding row and column. | |
void | apply_row_changes (int proxy_row, std::auto_ptr<Glib::Error>& error) |
Commits the modified data in the proxy back into the Gda::DataModel. | |
bool | has_changed () const |
Tells if proxy contains any modifications not applied to the proxied data model. | |
bool | row_has_changed (int proxy_row) const |
Tells if the row number proxy_row has changed. | |
int | get_n_new_rows () const |
Get the number of rows which have been added to proxy and which are not part of the proxied data model. | |
void | set_sample_size (int sample_size) |
Sets the size of each chunck of fata to display: the maximum number of rows which can be displayed at a time. | |
int | get_sample_size () const |
Get the size of each chunk of data displayed at a time. | |
void | set_sample_start (int sample_start) |
Sets the number of the first row to be displayed. | |
int | get_sample_start () const |
Get the row number of the first row to be displayed. | |
int | get_sample_end () const |
Get the row number of the last row to be displayed. | |
bool | apply_all_changes (std::auto_ptr<Glib::Error>& error) |
Apply all the changes stored in the proxy to the proxied data model. | |
bool | cancel_all_changes () |
Cancel all the changes stored in the proxy (the proxy will be reset to its state as it was just after creation). | |
Glib::SignalProxy2< void, int, bool > | signal_row_delete_changed () |
Glib::SignalProxy2< void, int, int > | signal_sample_changed () |
Glib::SignalProxy1< void, int > | signal_sample_size_changed () |
Static Public Member Functions | |
static Glib::RefPtr<DataProxy> | create (const Glib::RefPtr<DataModel>& model) |
Protected Member Functions | |
DataProxy (const Glib::RefPtr<DataModel>& model) | |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr<Gnome::Gda::DataProxy> | wrap (GdaDataProxy* object, bool take_copy=false) |
This object stores modifications made to a DataModel object which is proxied until asked to make the changes inside the DataModel. It also filters the proxied data model to show only a sample (a defined number of continuous rows) of it.
Specifically, for a proxied data model having nb_cols columns and nb_rows rows, the DataProxy object has the following attributes:
Note that unless explicitely mentioned, the columns are read-only.
virtual Gnome::Gda::DataProxy::~DataProxy | ( | ) | [virtual] |
Gnome::Gda::DataProxy::DataProxy | ( | const Glib::RefPtr<DataModel>& | model | ) | [explicit, protected] |
void Gnome::Gda::DataProxy::alter_value_attributes | ( | int | proxy_row, | |
int | col, | |||
ValueAttribute | alter_flags | |||
) |
Alters the attributes of the value stored at (proxy_row, col) in proxy .
the alter_flags can only contain the GDA_VALUE_ATTR_IS_0
, GDA_VALUE_ATTR_IS_DEFAULT and GDA_VALUE_ATTR_IS_UNCHANGED flags (other flags are ignored).
proxy_row | A proxy row number. | |
col | A valid column number. | |
alter_flags | Flags to alter the attributes. |
bool Gnome::Gda::DataProxy::apply_all_changes | ( | std::auto_ptr< Glib::Error > & | error | ) |
Apply all the changes stored in the proxy to the proxied data model.
The changes are done row after row, and if an error occurs, then it is possible that not all the changes to all the rows have been applied.
error | A place to store errors, or 0 . |
true
if no error occurred. void Gnome::Gda::DataProxy::apply_row_changes | ( | int | proxy_row, | |
std::auto_ptr< Glib::Error > & | error | |||
) |
Commits the modified data in the proxy back into the Gda::DataModel.
proxy_row | The row number to commit. | |
error | Place to store the error, or 0 . |
true
if no error occurred. bool Gnome::Gda::DataProxy::cancel_all_changes | ( | ) |
Cancel all the changes stored in the proxy (the proxy will be reset to its state as it was just after creation).
true
if no error occurred. void Gnome::Gda::DataProxy::cancel_row_changes | ( | int | proxy_row, | |
int | col | |||
) |
Resets data at the corresponding row and column.
proxy_row | The row to cancel changes. | |
col | The column to cancel changes, or less than 0 to cancel any change on the row row. |
static Glib::RefPtr<DataProxy> Gnome::Gda::DataProxy::create | ( | const Glib::RefPtr<DataModel>& | model | ) | [static] |
void Gnome::Gda::DataProxy::erase | ( | int | proxy_row | ) |
Marks the row proxy_row to be deleted.
proxy_row | A proxy row number. |
int Gnome::Gda::DataProxy::find_row_from_values | ( | const ValueSList & | values, | |
const Glib::ArrayHandle< int > & | cols_index | |||
) | const |
Find the first row where all the values in values at the columns identified at cols_index match.
NOTE: the cols_index array MUST contain a column index for each value in values
values | A list of G::Value values. | |
cols_index | An array of int containing the column number to match each value of values . |
int Gnome::Gda::DataProxy::get_n_new_rows | ( | ) | const |
Get the number of rows which have been added to proxy and which are not part of the proxied data model.
Glib::RefPtr<const DataModel> Gnome::Gda::DataProxy::get_proxied_model | ( | ) | const |
Glib::RefPtr<DataModel> Gnome::Gda::DataProxy::get_proxied_model | ( | ) |
int Gnome::Gda::DataProxy::get_proxied_model_n_cols | ( | ) | const |
Get the number of columns in the proxied data model.
int Gnome::Gda::DataProxy::get_proxied_model_n_rows | ( | ) | const |
Get the number of rows in the proxied data model.
int Gnome::Gda::DataProxy::get_proxied_model_row | ( | int | proxy_row | ) | const |
Get the proxy 's proxied model row corresponding to proxy_row.
proxy_row | A proxy row number. |
int Gnome::Gda::DataProxy::get_sample_end | ( | ) | const |
Get the row number of the last row to be displayed.
int Gnome::Gda::DataProxy::get_sample_size | ( | ) | const |
Get the size of each chunk of data displayed at a time.
int Gnome::Gda::DataProxy::get_sample_start | ( | ) | const |
Get the row number of the first row to be displayed.
ValueAttribute Gnome::Gda::DataProxy::get_value_attributes | ( | int | proxy_row, | |
int | col | |||
) | const |
Get the attributes of the value stored at (proxy_row, col) in proxy , which is an ORed value of Gda::ValueAttribute flags.
proxy_row | A proxy row. | |
col | A valid proxy column. |
ValueSList Gnome::Gda::DataProxy::get_values | ( | int | proxy_row, | |
const Glib::ArrayHandle< int > & | cols_index | |||
) | const |
const GdaDataProxy* Gnome::Gda::DataProxy::gobj | ( | ) | const [inline] |
GdaDataProxy* Gnome::Gda::DataProxy::gobj | ( | ) | [inline] |
GdaDataProxy* Gnome::Gda::DataProxy::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Reimplemented from Gnome::Gda::Object.
bool Gnome::Gda::DataProxy::has_changed | ( | ) | const |
Tells if proxy contains any modifications not applied to the proxied data model.
true
if there are some modifications in proxy . bool Gnome::Gda::DataProxy::is_read_only | ( | ) | const |
true
if the proxied data model is itself read-only. bool Gnome::Gda::DataProxy::row_has_changed | ( | int | proxy_row | ) | const |
Tells if the row number proxy_row has changed.
proxy_row | A proxy row number. |
bool Gnome::Gda::DataProxy::row_is_deleted | ( | int | proxy_row | ) | const |
Tells if the row number proxy_row is marked to be deleted.
proxy_row | A proxy row number. |
true
if the row is marked to be deleted. bool Gnome::Gda::DataProxy::row_is_inserted | ( | int | proxy_row | ) | const |
Tells if the row number proxy_row is a row which has been inserted in proxy (and is thus not in the proxied data model).
proxy_row | A proxy row number. |
true
if the row is an inserted row. void Gnome::Gda::DataProxy::set_sample_size | ( | int | sample_size | ) |
Sets the size of each chunck of fata to display: the maximum number of rows which can be displayed at a time.
The default value is arbitrary 300 as it is big enough to be able to display quite a lot of data, but small enough to avoid too much data displayed at the same time.
sample_size | The requested size of a chunck, or 0. |
void Gnome::Gda::DataProxy::set_sample_start | ( | int | sample_start | ) |
Sets the number of the first row to be displayed.
sample_start | The number of the first row to be displayed. |
Glib::SignalProxy2< void,int,bool > Gnome::Gda::DataProxy::signal_row_delete_changed | ( | ) |
void row_delete_changed(int row, bool to_be_deleted)
Glib::SignalProxy2< void,int,int > Gnome::Gda::DataProxy::signal_sample_changed | ( | ) |
void sample_changed(int sample_start, int sample_end)
Glib::SignalProxy1< void,int > Gnome::Gda::DataProxy::signal_sample_size_changed | ( | ) |
void sample_size_changed(int sample_size)
void Gnome::Gda::DataProxy::unerase | ( | int | proxy_row | ) |
Remove the "to be deleted" mark at the row proxy_row , if it existed.
proxy_row | A proxy row number. |
Glib::RefPtr<Gnome::Gda::DataProxy> wrap | ( | GdaDataProxy * | object, | |
bool | take_copy = false | |||
) | [related] |
object | The C instance | |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |