DataProxy

class DataProxy : ObjectWrap , DataModel {}

Constructors

this
this(void* ptr, Flag!"Take" take)
this
this(gda.data_model.DataModel model)

Creates a new proxy for model. For bindings use gda_data_proxy_new_with_data_model.

Members

Functions

alterValueAttributes
void alterValueAttributes(int proxyRow, int col, gda.types.ValueAttribute alterFlags)

Alters the attributes of the value stored at (proxy_row, col) in proxy. the alter_flags can only contain the GDA_VALUE_ATTR_IS_NULL, GDA_VALUE_ATTR_IS_DEFAULT and GDA_VALUE_ATTR_IS_UNCHANGED flags (other flags are ignored).

applyAllChanges
bool applyAllChanges()

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.

applyRowChanges
bool applyRowChanges(int proxyRow)

Commits the modified data in the proxy back into the #GdaDataModel.

cancelAllChanges
bool cancelAllChanges()

Cancel all the changes stored in the proxy (the proxy will be reset to its state as it was just after creation). Note that if there are some cached changes (i.e. not applied to the current proxied data model), then these cached changes are not cleared (set the "cache-changes" property to false for this).

cancelRowChanges
void cancelRowChanges(int proxyRow, 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.

connectFilterChanged
ulong connectFilterChanged(T callback, Flag!"After" after)

Connect to FilterChanged signal.

connectRowChangesApplied
ulong connectRowChangesApplied(T callback, Flag!"After" after)

Connect to RowChangesApplied signal.

connectRowDeleteChanged
ulong connectRowDeleteChanged(T callback, Flag!"After" after)

Connect to RowDeleteChanged signal.

connectSampleChanged
ulong connectSampleChanged(T callback, Flag!"After" after)

Connect to SampleChanged signal.

connectSampleSizeChanged
ulong connectSampleSizeChanged(T callback, Flag!"After" after)

Connect to SampleSizeChanged signal.

connectValidateRowChanges
ulong connectValidateRowChanges(T callback, Flag!"After" after)

Connect to ValidateRowChanges signal.

delete_
void delete_(int proxyRow)

Marks the row proxy_row to be deleted

getFilterExpr
string getFilterExpr()

Get the current filter expression used by proxy.

getFilteredNRows
int getFilteredNRows()

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 references to new rows and rows to be removed.

getNModifiedRows
int getNModifiedRows()

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).

getNNewRows
int getNNewRows()

Get the number of rows which have been added to proxy and which are not part of the proxied data model.

getProxiedModel
gda.data_model.DataModel getProxiedModel()

Fetch the #GdaDataModel which proxy does proxy

getProxiedModelNCols
int getProxiedModelNCols()

Get the number of columns in the proxied data model

getProxiedModelNRows
int getProxiedModelNRows()

Get the number of rows in the proxied data model

getProxiedModelRow
int getProxiedModelRow(int proxyRow)

Get the proxy's proxied model row corresponding to proxy_row

getSampleEnd
int getSampleEnd()

Get the number of the last row to be available in proxy (in reference to the proxied data model)

getSampleSize
int getSampleSize()

Get the size of each chunk of data displayed at a time.

getSampleStart
int getSampleStart()

Get the number of the first row to be available in proxy (in reference to the proxied data model)

getValueAttributes
gda.types.ValueAttribute getValueAttributes(int proxyRow, int col)

Get the attributes of the value stored at (proxy_row, col) in proxy, which is an ORed value of #GdaValueAttribute flags

getValues
gobject.value.Value[] getValues(int proxyRow, int[] colsIndex)

Retrieve a whole list of values from the proxy data model. This function calls gda_data_proxy_get_value() for each column index specified in cols_index, and generates a #GSList on the way.

hasChanged
bool hasChanged()

Tells if proxy contains any modifications not applied to the proxied data model.

isReadOnly
bool isReadOnly()
rowHasChanged
bool rowHasChanged(int proxyRow)

Tells if the row number proxy_row has changed

rowIsDeleted
bool rowIsDeleted(int proxyRow)

Tells if the row number proxy_row is marked to be deleted.

rowIsInserted
bool rowIsInserted(int proxyRow)

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).

self
DataProxy self()

Returns this, for use in with statements.

setFilterExpr
bool setFilterExpr(string filterExpr)

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.

setOrderingColumn
bool setOrderingColumn(int col)

Orders by the col column

setSampleSize
void setSampleSize(int sampleSize)

Sets the size of each chunk of data to display: the maximum number of rows which can be "displayed" at a time (the maximum number of rows which proxy pretends to have). 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.

setSampleStart
void setSampleStart(int sampleStart)

Sets the number of the first row to be available in proxy (in reference to the proxied data model)

undelete
void undelete(int proxyRow)

Remove the "to be deleted" mark at the row proxy_row, if it existed.

Properties

_gType
GType _gType [@property getter]
cacheChanges
bool cacheChanges [@property getter]

Get cacheChanges property.

cacheChanges
bool cacheChanges [@property setter]

Set cacheChanges property.

deferSync
bool deferSync [@property getter]
deferSync
bool deferSync [@property setter]
model
gda.data_model.DataModel model [@property getter]
model
gda.data_model.DataModel model [@property setter]
prependNullEntry
bool prependNullEntry [@property getter]
prependNullEntry
bool prependNullEntry [@property setter]
sampleSize
int sampleSize [@property getter]
sampleSize
int sampleSize [@property setter]

Static functions

_getGType
GType _getGType()
errorQuark
glib.types.Quark errorQuark()
newWithDataModel
gda.data_proxy.DataProxy newWithDataModel(gda.data_model.DataModel model)

Creates a new proxy for model. This is the preferred method to create #GdaDataProxy objects by bindings.

Mixed In Members

From mixin DataModelT!()

addDataFromXmlNode
bool addDataFromXmlNode(libxml2.types.NodePtr node)

Adds the data from an XML node to the given data model (see the DTD for that node in the $prefix/share/libgda/dtd/libgda-array.dtd file).

appendRow
int appendRow()

Appends a row to the data model (the new row will possibly have NULL values for all columns, or some other values depending on the data model implementation)

appendValues
int appendValues(gobject.value.Value[] values)

Appends a row to the given data model. If any value in values is actually null, then it is considered as a default value. If values is null then all values are set to their default value.

arrayCopyModel
gda.data_model_array.DataModelArray arrayCopyModel()

Makes a copy of src into a new #GdaDataModelArray object

arrayCopyModelExt
gda.data_model_array.DataModelArray arrayCopyModelExt(int[] cols)

Like gda.data_model.DataModel.arrayCopyModel, makes a copy of src, but copies only some columns.

createIter
gda.data_model_iter.DataModelIter createIter()

Creates a new iterator object #GdaDataModelIter object which can be used to iterate through rows in model. The new #GdaDataModelIter does not hold any reference to model (ie. if model is destroyed at some point, the new iterator will become useless but in any case it will not prevent the data model from being destroyed).

describeColumn
gda.column.Column describeColumn(int col)

Queries the underlying data model implementation for a description of a given column. That description is returned in the form of a #GdaColumn structure, which contains all the information about the given column in the data model.

dump
void dump(void* toStream)

Dumps a textual representation of the model to the to_stream stream

dumpAsString
string dumpAsString()

Dumps a textual representation of the model into a new string. The main differences with gda.data_model.DataModel.exportToString are that the formatting options are passed using environment variables, and that the data is dumped regardless of the user locale (e.g. dates are not formatted according to the locale).

exportToFile
bool exportToFile(gda.types.DataModelIOFormat format, string file, int[] cols, int[] rows, gda.set.Set options)

Exports data contained in model to the file file; the format is specified using the format argument. Note that the date format used is the one used by the connection from which the data model has been made (as the result of a SELECT statement), or, for other kinds of data models, the default format (refer to gda.data_handler.DataHandler.getDefault) unless the "cnc" property has been set and points to a #GdaConnection to use that connection's date format.

exportToString
string exportToString(gda.types.DataModelIOFormat format, int[] cols, int[] rows, gda.set.Set options)

Exports data contained in model to a string; the format is specified using the format argument, see the gda.data_model.DataModel.exportToFile documentation for more information about the options argument (except for the "OVERWRITE" option).

freeze
void freeze()

Disables notifications of changes on the given data model. To re-enable notifications again, you should call the #gda_data_model_thaw function.

getAccessFlags
gda.types.DataModelAccessFlags getAccessFlags()

Get the attributes of model such as how to access the data it contains if it's modifiable, etc.

getAttributesAt
gda.types.ValueAttribute getAttributesAt(int col, int row)

Get the attributes of the value stored at (row, col) in model, which is an ORed value of #GdaValueAttribute flags. As a special case, if row is -1, then the attributes returned correspond to a "would be" value if a row was added to model.

getColumnIndex
int getColumnIndex(string name)

Get the index of the first column named name in model.

getColumnName
string getColumnName(int col)
getColumnTitle
string getColumnTitle(int col)
getNColumns
int getNColumns()
getNRows
int getNRows()
getNotify
bool getNotify()

Returns the status of notifications changes on the given data model.

getTypedValueAt
gobject.value.Value getTypedValueAt(int col, int row, gobject.types.GType expectedType, bool nullok)

Upon errors null will be returned and error will be assigned a #GError from the #GDA_DATA_MODEL_ERROR domain.

getValueAt
gobject.value.Value getValueAt(int col, int row)

Retrieves the data stored in the given position (identified by the col and row parameters) on a data model.

iterAtRow
bool iterAtRow(gda.data_model_iter.DataModelIter iter, int row)

Moves iter to the row number given by row.

iterNext
bool iterNext(gda.data_model_iter.DataModelIter iter)

Moves iter to the next row in model.

iterPrev
bool iterPrev(gda.data_model_iter.DataModelIter iter)

Moves iter to the next row in model.

iterSetValue
bool iterSetValue(gda.data_model_iter.DataModelIter iter, int col, gobject.value.Value value)

Set value to the given column and row pointed by iter in the given model.

removeRow
bool removeRow(int row)

Removes a row from the data model.

reset
void reset()

Emits the 'reset' and 'changed' signal on model.

rowInserted
void rowInserted(int row)

Emits the 'row_inserted' and 'changed' signals on model.

rowRemoved
void rowRemoved(int row)

Emits the 'row_removed' and 'changed' signal on model.

rowUpdated
void rowUpdated(int row)

Emits the 'row_updated' and 'changed' signals on model.

sendHint
void sendHint(gda.types.DataModelHint hint, gobject.value.Value hintValue)

Sends a hint to the data model. The hint may or may not be handled by the data model, depending on its implementation

setColumnName
void setColumnName(int col, string name)

Sets the name of the given col in model, and if its title is not set, also sets the title to name.

setColumnTitle
void setColumnTitle(int col, string title)

Sets the title of the given col in model.

setNotify
void setNotify(bool doNotifyChanges)

Enable or disable notifications changes on the given data model.

setValueAt
bool setValueAt(int col, int row, gobject.value.Value value)

Modifies a value in model, at (col, row).

setValues
bool setValues(int row, gobject.value.Value[] values)

In a similar way to gda.data_model.DataModel.setValueAt, this method modifies a data model's contents by setting several values at once.

thaw
void thaw()

Re-enables notifications of changes on the given data model.

connectAccessChanged
ulong connectAccessChanged(T callback, Flag!"After" after)

Connect to AccessChanged signal.

connectChanged
ulong connectChanged(T callback, Flag!"After" after)

Connect to Changed signal.

connectReset
ulong connectReset(T callback, Flag!"After" after)

Connect to Reset signal.

connectRowInserted
ulong connectRowInserted(T callback, Flag!"After" after)

Connect to RowInserted signal.

connectRowRemoved
ulong connectRowRemoved(T callback, Flag!"After" after)

Connect to RowRemoved signal.

connectRowUpdated
ulong connectRowUpdated(T callback, Flag!"After" after)

Connect to RowUpdated signal.

Inherited Members

From ObjectWrap

_setGObject
void _setGObject(void* cObj, Flag!"Take" take)

Set the GObject of a D ObjectWrap wrapper.

_cPtr
void* _cPtr(Flag!"Dup" dup)

Get a pointer to the underlying C object.

_ref
void* _ref(void* gObj)

Calls g_object_ref() on a GObject.

_unref
_unref(void* gObj)

Calls g_object_unref() on a GObject.

_getGType
GType _getGType()

Get the GType of an object.

_gType
GType _gType [@property getter]

GObject GType property.

self
ObjectWrap self()

Convenience method to return this cast to a type. For use in D with statements.

_getDObject
T _getDObject(void* cptr, Flag!"Take" take)

Template to get the D object from a C GObject and cast it to the given D object type.

connectSignalClosure
ulong connectSignalClosure(string signalDetail, DClosure closure, Flag!"After" after)

Connect a D closure to an object signal.

setProperty
void setProperty(string propertyName, T val)

Template for setting a GObject property.

getProperty
T getProperty(string propertyName)

Template for getting a GObject property.

compatControl
size_t compatControl(size_t what, void* data)
bindProperty
gobject.binding.Binding bindProperty(string sourceProperty, gobject.object.ObjectWrap target, string targetProperty, gobject.types.BindingFlags flags)

Creates a binding between source_property on source and target_property on target.

bindPropertyFull
gobject.binding.Binding bindPropertyFull(string sourceProperty, gobject.object.ObjectWrap target, string targetProperty, gobject.types.BindingFlags flags, gobject.closure.Closure transformTo, gobject.closure.Closure transformFrom)

Creates a binding between source_property on source and target_property on target, allowing you to set the transformation functions to be used by the binding.

forceFloating
void forceFloating()

This function is intended for #GObject implementations to re-enforce a floating[floating-ref] object reference. Doing this is seldom required: all #GInitiallyUnowneds are created with a floating reference which usually just needs to be sunken by calling gobject.object.ObjectWrap.refSink.

freezeNotify
void freezeNotify()

Increases the freeze count on object. If the freeze count is non-zero, the emission of "notify" signals on object is stopped. The signals are queued until the freeze count is decreased to zero. Duplicate notifications are squashed so that at most one #GObject::notify signal is emitted for each property modified while the object is frozen.

getData
void* getData(string key)

Gets a named field from the objects table of associations (see gobject.object.ObjectWrap.setData).

getProperty
void getProperty(string propertyName, gobject.value.Value value)

Gets a property of an object.

getQdata
void* getQdata(glib.types.Quark quark)

This function gets back user data pointers stored via gobject.object.ObjectWrap.setQdata.

getv
void getv(string[] names, gobject.value.Value[] values)

Gets n_properties properties for an object. Obtained properties will be set to values. All properties must be valid. Warnings will be emitted and undefined behaviour may result if invalid properties are passed in.

isFloating
bool isFloating()

Checks whether object has a floating[floating-ref] reference.

notify
void notify(string propertyName)

Emits a "notify" signal for the property property_name on object.

notifyByPspec
void notifyByPspec(gobject.param_spec.ParamSpec pspec)

Emits a "notify" signal for the property specified by pspec on object.

refSink
gobject.object.ObjectWrap refSink()

Increase the reference count of object, and possibly remove the floating[floating-ref] reference, if object has a floating reference.

runDispose
void runDispose()

Releases all references to other objects. This can be used to break reference cycles.

setData
void setData(string key, void* data)

Each object carries around a table of associations from strings to pointers. This function lets you set an association.

setProperty
void setProperty(string propertyName, gobject.value.Value value)

Sets a property on an object.

stealData
void* stealData(string key)

Remove a specified datum from the object's data associations, without invoking the association's destroy handler.

stealQdata
void* stealQdata(glib.types.Quark quark)

This function gets back user data pointers stored via gobject.object.ObjectWrap.setQdata and removes the data from object without invoking its destroy() function (if any was set). Usually, calling this function is only required to update user data pointers with a destroy notifier, for example:

thawNotify
void thawNotify()

Reverts the effect of a previous call to gobject.object.ObjectWrap.freezeNotify. The freeze count is decreased on object and when it reaches zero, queued "notify" signals are emitted.

watchClosure
void watchClosure(gobject.closure.Closure closure)

This function essentially limits the life time of the closure to the life time of the object. That is, when the object is finalized, the closure is invalidated by calling gobject.closure.Closure.invalidate on it, in order to prevent invocations of the closure with a finalized (nonexisting) object. Also, gobject.object.ObjectWrap.ref_ and gobject.object.ObjectWrap.unref are added as marshal guards to the closure, to ensure that an extra reference count is held on object during invocation of the closure. Usually, this function will be called on closures that use this object as closure data.

connectNotify
ulong connectNotify(string detail, T callback, Flag!"After" after)

Connect to Notify signal.

From DataModel

_getGType
GType _getGType()
errorQuark
glib.types.Quark errorQuark()
addDataFromXmlNode
bool addDataFromXmlNode(libxml2.types.NodePtr node)

Adds the data from an XML node to the given data model (see the DTD for that node in the $prefix/share/libgda/dtd/libgda-array.dtd file).

appendRow
int appendRow()

Appends a row to the data model (the new row will possibly have NULL values for all columns, or some other values depending on the data model implementation)

appendValues
int appendValues(gobject.value.Value[] values)

Appends a row to the given data model. If any value in values is actually null, then it is considered as a default value. If values is null then all values are set to their default value.

arrayCopyModel
gda.data_model_array.DataModelArray arrayCopyModel()

Makes a copy of src into a new #GdaDataModelArray object

arrayCopyModelExt
gda.data_model_array.DataModelArray arrayCopyModelExt(int[] cols)

Like gda.data_model.DataModel.arrayCopyModel, makes a copy of src, but copies only some columns.

createIter
gda.data_model_iter.DataModelIter createIter()

Creates a new iterator object #GdaDataModelIter object which can be used to iterate through rows in model. The new #GdaDataModelIter does not hold any reference to model (ie. if model is destroyed at some point, the new iterator will become useless but in any case it will not prevent the data model from being destroyed).

describeColumn
gda.column.Column describeColumn(int col)

Queries the underlying data model implementation for a description of a given column. That description is returned in the form of a #GdaColumn structure, which contains all the information about the given column in the data model.

dump
void dump(void* toStream)

Dumps a textual representation of the model to the to_stream stream

dumpAsString
string dumpAsString()

Dumps a textual representation of the model into a new string. The main differences with gda.data_model.DataModel.exportToString are that the formatting options are passed using environment variables, and that the data is dumped regardless of the user locale (e.g. dates are not formatted according to the locale).

exportToFile
bool exportToFile(gda.types.DataModelIOFormat format, string file, int[] cols, int[] rows, gda.set.Set options)

Exports data contained in model to the file file; the format is specified using the format argument. Note that the date format used is the one used by the connection from which the data model has been made (as the result of a SELECT statement), or, for other kinds of data models, the default format (refer to gda.data_handler.DataHandler.getDefault) unless the "cnc" property has been set and points to a #GdaConnection to use that connection's date format.

exportToString
string exportToString(gda.types.DataModelIOFormat format, int[] cols, int[] rows, gda.set.Set options)

Exports data contained in model to a string; the format is specified using the format argument, see the gda.data_model.DataModel.exportToFile documentation for more information about the options argument (except for the "OVERWRITE" option).

freeze
void freeze()

Disables notifications of changes on the given data model. To re-enable notifications again, you should call the #gda_data_model_thaw function.

getAccessFlags
gda.types.DataModelAccessFlags getAccessFlags()

Get the attributes of model such as how to access the data it contains if it's modifiable, etc.

getAttributesAt
gda.types.ValueAttribute getAttributesAt(int col, int row)

Get the attributes of the value stored at (row, col) in model, which is an ORed value of #GdaValueAttribute flags. As a special case, if row is -1, then the attributes returned correspond to a "would be" value if a row was added to model.

getColumnIndex
int getColumnIndex(string name)

Get the index of the first column named name in model.

getColumnName
string getColumnName(int col)
getColumnTitle
string getColumnTitle(int col)
getNColumns
int getNColumns()
getNRows
int getNRows()
getNotify
bool getNotify()

Returns the status of notifications changes on the given data model.

getTypedValueAt
gobject.value.Value getTypedValueAt(int col, int row, gobject.types.GType expectedType, bool nullok)

Upon errors null will be returned and error will be assigned a #GError from the #GDA_DATA_MODEL_ERROR domain.

getValueAt
gobject.value.Value getValueAt(int col, int row)

Retrieves the data stored in the given position (identified by the col and row parameters) on a data model.

iterAtRow
bool iterAtRow(gda.data_model_iter.DataModelIter iter, int row)

Moves iter to the row number given by row.

iterNext
bool iterNext(gda.data_model_iter.DataModelIter iter)

Moves iter to the next row in model.

iterPrev
bool iterPrev(gda.data_model_iter.DataModelIter iter)

Moves iter to the next row in model.

iterSetValue
bool iterSetValue(gda.data_model_iter.DataModelIter iter, int col, gobject.value.Value value)

Set value to the given column and row pointed by iter in the given model.

removeRow
bool removeRow(int row)

Removes a row from the data model.

reset
void reset()

Emits the 'reset' and 'changed' signal on model.

rowInserted
void rowInserted(int row)

Emits the 'row_inserted' and 'changed' signals on model.

rowRemoved
void rowRemoved(int row)

Emits the 'row_removed' and 'changed' signal on model.

rowUpdated
void rowUpdated(int row)

Emits the 'row_updated' and 'changed' signals on model.

sendHint
void sendHint(gda.types.DataModelHint hint, gobject.value.Value hintValue)

Sends a hint to the data model. The hint may or may not be handled by the data model, depending on its implementation

setColumnName
void setColumnName(int col, string name)

Sets the name of the given col in model, and if its title is not set, also sets the title to name.

setColumnTitle
void setColumnTitle(int col, string title)

Sets the title of the given col in model.

setNotify
void setNotify(bool doNotifyChanges)

Enable or disable notifications changes on the given data model.

setValueAt
bool setValueAt(int col, int row, gobject.value.Value value)

Modifies a value in model, at (col, row).

setValues
bool setValues(int row, gobject.value.Value[] values)

In a similar way to gda.data_model.DataModel.setValueAt, this method modifies a data model's contents by setting several values at once.

thaw
void thaw()

Re-enables notifications of changes on the given data model.

connectAccessChanged
ulong connectAccessChanged(T callback, Flag!"After" after)

Connect to AccessChanged signal.

connectChanged
ulong connectChanged(T callback, Flag!"After" after)

Connect to Changed signal.

connectReset
ulong connectReset(T callback, Flag!"After" after)

Connect to Reset signal.

connectRowInserted
ulong connectRowInserted(T callback, Flag!"After" after)

Connect to RowInserted signal.

connectRowRemoved
ulong connectRowRemoved(T callback, Flag!"After" after)

Connect to RowRemoved signal.

connectRowUpdated
ulong connectRowUpdated(T callback, Flag!"After" after)

Connect to RowUpdated signal.