libgdamm Reference Documentation |
Public Member Functions | |
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. | |
bool | apply_all_changes () |
Apply all the changes stored in the proxy to the proxied data model. | |
void | apply_row_changes (int proxy_row) |
Commits the modified data in the proxy back into the Gda::DataModel. | |
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). | |
void | cancel_row_changes (int proxy_row, int col) |
Resets data at the corresponding row and column. | |
void | erase (int proxy_row) |
Marks the row proxy_row to be deleted. | |
void | get_filter_expr (const Glib::ustring& filter_expr) |
Sets a filter among the rows presented by proxy. | |
Glib::ustring | get_filter_expr () |
Get the current filter expression used by proxy. | |
int | get_filtered_n_rows () |
Get the total number of filtered rows in proxy if a filter has been applied. | |
int | get_n_modified_rows () const |
Get the number of rows which have been modified in the proxy (the sum of rows existing in the proxied data model which have been modified, and new rows). | |
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. | |
Glib::RefPtr<const DataModel> | get_proxied_model () const |
Fetch the Gda::DataModel which proxy does proxy. | |
Glib::RefPtr<DataModel> | get_proxied_model () |
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. | |
int | get_proxied_model_row (int proxy_row) const |
Get the proxy's proxied model row corresponding to proxy_row. | |
int | get_sample_end () const |
Get the row number of the last row to be displayed. | |
int | get_sample_size () const |
Get the size of each chunk of data displayed at a time. | |
int | get_sample_start () const |
Get the row number of the first row to be displayed. | |
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. | |
ValueSList | get_values (int proxy_row, const Glib::ArrayHandle<int>& cols_index) const |
Retreive a whole list of values from the proxy store. | |
const GdaDataProxy* | gobj () const |
Provides access to the underlying C GObject. | |
GdaDataProxy* | gobj () |
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. | |
bool | has_changed () const |
Tells if proxy contains any modifications not applied to the proxied data model. | |
bool | is_read_only () const |
Glib::PropertyProxy_ReadOnly <bool> | property_defer_sync () const |
Tells if changes to the sample of rows displayed is done in background in several steps or if it's done in one step. | |
Glib::PropertyProxy<bool> | property_defer_sync () |
Tells if changes to the sample of rows displayed is done in background in several steps or if it's done in one step. | |
Glib::PropertyProxy_ReadOnly <Glib::RefPtr<DataModel>> | property_model () const |
Proxied data model. | |
Glib::PropertyProxy <Glib::RefPtr<DataModel>> | property_model () |
Proxied data model. | |
Glib::PropertyProxy_ReadOnly <bool> | property_prepend_null_entry () const |
Tells if a row composed of NULL values is inserted as the proxy's first row. | |
Glib::PropertyProxy<bool> | property_prepend_null_entry () |
Tells if a row composed of NULL values is inserted as the proxy's first row. | |
Glib::PropertyProxy_ReadOnly<int> | property_sample_size () const |
Number of rows which the proxy will contain at any time. | |
Glib::PropertyProxy<int> | property_sample_size () |
Number of rows which the proxy will contain at any time. | |
bool | row_has_changed (int proxy_row) const |
Tells if the row number proxy_row has changed. | |
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). | |
void | set_ordering_column (int col) |
Orders by the col column. | |
void | set_sample_size (int sample_size) |
Sets the size of each chunk of fata to display: the maximum number of rows which can be displayed at a time. | |
void | set_sample_start (int sample_start) |
Sets the number of the first row to be displayed. | |
Glib::SignalProxy0<void> | signal_filter_changed () |
Glib::SignalProxy2< void, int, int > | signal_row_changes_applied () |
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 () |
Glib::SignalProxy2< Error, int, int > | signal_validate_row_changes () |
void | unerase (int proxy_row) |
Remove the "to be deleted" mark at the row proxy_row, if it existed. | |
virtual | ~DataProxy () |
Static Public Member Functions | |
static Glib::RefPtr<DataProxy> | create (const Glib::RefPtr<DataModel>& model) |
Protected Member Functions | |
DataProxy (const Glib::RefPtr<DataModel>& model) | |
virtual void | on_row_changes_applied (int row, int proxied_row) |
virtual void | on_row_delete_changed (int row, bool to_be_deleted) |
virtual void | on_sample_changed (int sample_start, int sample_end) |
virtual void | on_sample_size_changed (int sample_size) |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr <Gnome::Gda::DataProxy> | wrap (GdaDataProxy* object, bool take_copy=false) |
A Glib::wrap() method for this object. |
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 | ( | ) |
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.
true
if no error occurred. void Gnome::Gda::DataProxy::apply_row_changes | ( | int | proxy_row | ) |
Commits the modified data in the proxy back into the Gda::DataModel.
proxy_row | The row number to commit. |
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.
If proxy_row corresponds to a new row, then that new row is deleted from proxy.
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. |
void Gnome::Gda::DataProxy::get_filter_expr | ( | const Glib::ustring & | filter_expr | ) |
Sets a filter among the rows presented by proxy.
The filter is defined by a filter expression which can be any SQL valid expression using proxy's columns. For instance if proxy has the "id" and "name" columns, then a filter can be "length(name) < 5" to filter only the rows where the length of the name is strictly inferior to 5, or "id >= 1000 and id < 2000 order by name limit 50" to filter only the rows where the id is between 1000 and 2000, ordered by name and limited to 50 rows.
Note about column names: real column names can be used (double quoted if necessary), but columns can also be named "_<column number>" with colmun numbers starting at 1.
Note that any previous filter expression is replaced with the new filter_expr if no error occurs (if an error occurs, then any previous filter is left unchanged).
filter_expr | An SQL based expression which will filter the contents of proxy, or 0 to remove any previous filter. |
true
if no error occurred. Glib::ustring Gnome::Gda::DataProxy::get_filter_expr | ( | ) |
Get the current filter expression used by proxy.
0
if no filter has been set. int Gnome::Gda::DataProxy::get_filtered_n_rows | ( | ) |
Get the total number of filtered rows in proxy if a filter has been applied.
As new rows (rows added to the proxy and not yet added to the proxied data model) and rows to remove (rows marked for removal but not yet removed from the proxied data model) are also filtered, the returned number also contains reefrences to new rows and rows to be removed.
int Gnome::Gda::DataProxy::get_n_modified_rows | ( | ) | const |
Get the number of rows which have been modified in the proxy (the sum of rows existing in the proxied data model which have been modified, and new rows).
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 |
Retreive a whole list of values from the proxy store.
This function calls gda_data_proxy_get_value() for each column index specified in cols_index, and generates a Slist on the way.
proxy_row | A proxy row. |
0
if an error occurred. 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.
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. virtual void Gnome::Gda::DataProxy::on_row_changes_applied | ( | int | row, | |
int | proxied_row | |||
) | [protected, virtual] |
virtual void Gnome::Gda::DataProxy::on_row_delete_changed | ( | int | row, | |
bool | to_be_deleted | |||
) | [protected, virtual] |
virtual void Gnome::Gda::DataProxy::on_sample_changed | ( | int | sample_start, | |
int | sample_end | |||
) | [protected, virtual] |
virtual void Gnome::Gda::DataProxy::on_sample_size_changed | ( | int | sample_size | ) | [protected, virtual] |
Glib::PropertyProxy_ReadOnly<bool> Gnome::Gda::DataProxy::property_defer_sync | ( | ) | const |
Tells if changes to the sample of rows displayed is done in background in several steps or if it's done in one step.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<bool> Gnome::Gda::DataProxy::property_defer_sync | ( | ) |
Tells if changes to the sample of rows displayed is done in background in several steps or if it's done in one step.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<Glib::RefPtr<DataModel>> Gnome::Gda::DataProxy::property_model | ( | ) | const |
Proxied data model.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<Glib::RefPtr<DataModel>> Gnome::Gda::DataProxy::property_model | ( | ) |
Proxied data model.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<bool> Gnome::Gda::DataProxy::property_prepend_null_entry | ( | ) | const |
Tells if a row composed of NULL values is inserted as the proxy's first row.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<bool> Gnome::Gda::DataProxy::property_prepend_null_entry | ( | ) |
Tells if a row composed of NULL values is inserted as the proxy's first row.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<int> Gnome::Gda::DataProxy::property_sample_size | ( | ) | const |
Number of rows which the proxy will contain at any time.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<int> Gnome::Gda::DataProxy::property_sample_size | ( | ) |
Number of rows which the proxy will contain at any time.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
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_ordering_column | ( | int | col | ) |
Orders by the col column.
col | The column number to order from. |
true
if no error occurred. void Gnome::Gda::DataProxy::set_sample_size | ( | int | sample_size | ) |
Sets the size of each chunk 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 chunk, 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::SignalProxy0< void > Gnome::Gda::DataProxy::signal_filter_changed | ( | ) |
void on_my_filter_changed()
Glib::SignalProxy2< void,int,int > Gnome::Gda::DataProxy::signal_row_changes_applied | ( | ) |
void on_my_row_changes_applied(int row, int proxied_row)
Glib::SignalProxy2< void,int,bool > Gnome::Gda::DataProxy::signal_row_delete_changed | ( | ) |
void on_my_row_delete_changed(int row, bool to_be_deleted)
Glib::SignalProxy2< void,int,int > Gnome::Gda::DataProxy::signal_sample_changed | ( | ) |
void on_my_sample_changed(int sample_start, int sample_end)
Glib::SignalProxy1< void,int > Gnome::Gda::DataProxy::signal_sample_size_changed | ( | ) |
void on_my_sample_size_changed(int sample_size)
Glib::SignalProxy2<Error,int,int> Gnome::Gda::DataProxy::signal_validate_row_changes | ( | ) |
Error on_my_validate_row_changes(int row, int proxied_row)
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] |
A Glib::wrap() method for this object.
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. |