Gjsify LogoGjsify Logo

Hierarchy

Index

Constructors

Properties

Methods

Constructors

Properties

cache_changes: boolean

Defines how changes kept in the data proxy are handled when the proxied data model is changed (using the "model" property). The default is to silently discard all the changes, but if this property is set to %TRUE, then the changes are cached.

If set to %TRUE, each cached change will be re-applied to a newly set proxied data model if the change's number of columns match the proxied data model's number of columns and based on: the contents of the proxied data model's modified row for updates and deletes the inserts are always kept

defer_sync: boolean
g_type_instance: TypeInstance
model: Gda.DataModel
parent_instance: GObject.Object
prepend_null_entry: boolean
sample_size: number
name: string

Methods

  • add_data_from_xml_node(node: NodePtr): boolean
  • 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).

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

    Parameters

    • node: NodePtr

      an XML node representing a <gda_array_data> XML node.

    Returns boolean

  • alter_value_attributes(proxy_row: number, col: number, alter_flags: Gda.ValueAttribute): void
  • 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).

    Parameters

    • proxy_row: number

      A proxy row number

    • col: number

      a valid column number

    • alter_flags: Gda.ValueAttribute

      flags to alter the attributes

    Returns void

  • append_row(): number
  • 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)

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

    Returns number

  • append_values(values: any[]): number
  • 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.

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

    Parameters

    • values: any[]

      #GList of #GValue* representing the row to add. The length must match model's column count. These #GValue are value-copied (the user is still responsible for freeing them).

    Returns number

  • apply_all_changes(): boolean
  • 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.

    Returns boolean

  • apply_row_changes(proxy_row: number): boolean
  • Commits the modified data in the proxy back into the #GdaDataModel.

    Parameters

    • proxy_row: number

      the row number to commit

    Returns boolean

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

    Whenever the source_property is changed the target_property is updated using the same value. For instance:

      g_object_bind_property (action, "active", widget, "sensitive", 0);
    

    Will result in the "sensitive" property of the widget #GObject instance to be updated with the same value of the "active" property of the action #GObject instance.

    If flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: if target_property on target changes then the source_property on source will be updated as well.

    The binding will automatically be removed when either the source or the target instances are finalized. To remove the binding without affecting the source and the target you can just call g_object_unref() on the returned #GBinding instance.

    Removing the binding by calling g_object_unref() on it must only be done if the binding, source and target are only used from a single thread and it is clear that both source and target outlive the binding. Especially it is not safe to rely on this if the binding, source or target can be finalized from different threads. Keep another reference to the binding and use g_binding_unbind() instead to be on the safe side.

    A #GObject can have multiple bindings.

    Parameters

    • source_property: string

      the property on source to bind

    • target: GObject.Object

      the target #GObject

    • target_property: string

      the property on target to bind

    • flags: BindingFlags

      flags to pass to #GBinding

    Returns Binding

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

    This function is the language bindings friendly version of g_object_bind_property_full(), using #GClosures instead of function pointers.

    Parameters

    • source_property: string

      the property on source to bind

    • target: GObject.Object

      the target #GObject

    • target_property: string

      the property on target to bind

    • flags: BindingFlags

      flags to pass to #GBinding

    • transform_to: TClosure<any, any>

      a #GClosure wrapping the transformation function from the source to the target, or %NULL to use the default

    • transform_from: TClosure<any, any>

      a #GClosure wrapping the transformation function from the target to the source, or %NULL to use the default

    Returns Binding

  • cancel_all_changes(): boolean
  • 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).

    Returns boolean

  • cancel_row_changes(proxy_row: number, col: number): void
  • Resets data at the corresponding row and column. If proxy_row corresponds to a new row, then that new row is deleted from proxy.

    Parameters

    • proxy_row: number

      the row to cancel changes

    • col: number

      the column to cancel changes, or less than 0 to cancel any change on the row row

    Returns void

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

    Depending on the data model's implementation, a new #GdaDataModelIter object may be created, or a reference to an already existing #GdaDataModelIter may be returned. For example if model only supports being accessed using a forward moving cursor (say a the result of a SELECT executed by SQLite with a cursor access mode specified), then this method will always return the same iterator.

    If a new #GdaDataModelIter is created, then the row it represents is undefined.

    For models which can be accessed randomly, any row can be set using gda_data_model_iter_move_to_row(), and for models which are accessible sequentially only then use gda_data_model_iter_move_next() (and gda_data_model_iter_move_prev() if supported).

    Note: for the #GdaDataProxy data model (which proxies any #GdaDataModel for modifications and has twice the number of columns of the proxied data model), this method will create an iterator in which only the columns of the proxied data model appear. If you need to have a #GdaDataModelIter in which all the proxy's columns appear, create it using:

    Returns Gda.DataModelIter

  • delete(proxy_row: number): void
  • 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.

    WARNING: the returned #GdaColumn object belongs to the model model and and should not be destroyed; any modification will affect the whole data model.

    Parameters

    • col: number

      column number.

    Returns Gda.Column

  • disconnect(id: number): void
  • dump(to_stream: object): void
  • Dumps a textual representation of the model to the to_stream stream

    The following environment variables can affect the resulting output: GDA_DATA_MODEL_DUMP_ROW_NUMBERS: if set, the first column of the output will contain row numbers GDA_DATA_MODEL_DUMP_ATTRIBUTES: if set, also dump the data model's columns' types and value's attributes GDA_DATA_MODEL_DUMP_TITLE: if set, also dump the data model's title GDA_DATA_MODEL_NULL_AS_EMPTY: if set, replace the 'NULL' string with an empty string for NULL values GDA_DATA_MODEL_DUMP_TRUNCATE: if set to a numeric value, truncates the output to the width specified by the value. If the value is -1 then the actual terminal size (if it can be determined) is used

    Parameters

    • to_stream: object

      where to dump the data model

    Returns void

  • dump_as_string(): string
  • Dumps a textual representation of the model into a new string. The main differences with gda_data_model_export_to_string() 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).

    The following environment variables can affect the resulting output: GDA_DATA_MODEL_DUMP_ROW_NUMBERS: if set, the first column of the output will contain row numbers GDA_DATA_MODEL_DUMP_TITLE: if set, also dump the data model's title GDA_DATA_MODEL_NULL_AS_EMPTY: if set, replace the 'NULL' string with an empty string for NULL values GDA_DATA_MODEL_DUMP_TRUNCATE: if set to a numeric value, truncates the output to the width specified by the value. If the value is -1 then the actual terminal size (if it can be determined) is used

    Returns string

  • emit(sigName: "filter-changed", ...args: any[]): void
  • emit(sigName: "row-changes-applied", row: number, proxied_row: number, ...args: any[]): void
  • emit(sigName: "row-delete-changed", row: number, to_be_deleted: boolean, ...args: any[]): void
  • emit(sigName: "sample-changed", sample_start: number, sample_end: number, ...args: any[]): void
  • emit(sigName: "sample-size-changed", sample_size: number, ...args: any[]): void
  • emit(sigName: "validate-row-changes", row: number, proxied_row: number, ...args: any[]): void
  • emit(sigName: "notify::cache-changes", ...args: any[]): void
  • emit(sigName: "notify::defer-sync", ...args: any[]): void
  • emit(sigName: "notify::model", ...args: any[]): void
  • emit(sigName: "notify::prepend-null-entry", ...args: any[]): void
  • emit(sigName: "notify::sample-size", ...args: any[]): void
  • emit(sigName: string, ...args: any[]): void
  • 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_get_default()) unless the "cnc" property has been set and points to a #GdaConnection to use that connection's date format.

    Specifically, the parameters in the options list can be: "SEPARATOR": a string value of which the first character is used as a separator in case of CSV export "QUOTE": a string value of which the first character is used as a quote character in case of CSV export. The default if not specified is the double quote character "FIELD_QUOTE": a boolean value which can be set to FALSE if no quote around the individual fields is requeted, in case of CSV export "NAMES_ON_FIRST_LINE": a boolean value which, if set to %TRUE and in case of a CSV or %GDA_DATA_MODEL_IO_TEXT_TABLE export, will add a first line with the name each exported field (note that "FIELDS_NAME" is also accepted as a synonym) "NAME": a string value used to name the exported data if the export format is XML or %GDA_DATA_MODEL_IO_TEXT_TABLE "OVERWRITE": a boolean value which tells if the file must be over-written if it already exists. "NULL_AS_EMPTY": a boolean value which, if set to %TRUE and in case of a CSV or %GDA_DATA_MODEL_IO_TEXT_TABLE export, will render and NULL value as the empty string (instead of the 'NULL' string) "INVALID_AS_NULL": a boolean value which, if set to %TRUE, considers any invalid data (for example for the date related values) as NULL "COLUMN_SEPARATORS": a boolean value which, if set to %TRUE, adds a separators lines between each column, if the export format is %GDA_DATA_MODEL_IO_TEXT_TABLE "SEPARATOR_LINE": a boolean value which, if set to %TRUE, adds an horizontal line between column titles and values, if the export format is %GDA_DATA_MODEL_IO_TEXT_TABLE "ROW_NUMBERS": a boolean value which, if set to %TRUE, prepends a column with row numbers, if the export format is %GDA_DATA_MODEL_IO_TEXT_TABLE "MAX_WIDTH": an integer value which, if greater than 0, makes all the lines truncated to have at most that number of characters, if the export format is %GDA_DATA_MODEL_IO_TEXT_TABLE

    Warning: this function uses a #GdaDataModelIter iterator, and if model does not offer a random access (check using gda_data_model_get_access_flags()), the iterator will be the same as normally used to access data in model previously to calling this method, and this iterator will be moved (point to another row).

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

    Parameters

    • format: Gda.DataModelIOFormat

      the format in which to export data

    • file: string

      the filename to export to

    • cols: number[]

      an array containing which columns of model will be exported, or %NULL for all columns

    • rows: number[]

      an array containing which rows of model will be exported, or %NULL for all rows

    • options: Gda.Set

      list of options for the export

    Returns boolean

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

    Warning: this function uses a #GdaDataModelIter iterator, and if model does not offer a random access (check using gda_data_model_get_access_flags()), the iterator will be the same as normally used to access data in model previously to calling this method, and this iterator will be moved (point to another row).

    See also gda_data_model_dump_as_string();

    Parameters

    • format: Gda.DataModelIOFormat

      the format in which to export data

    • cols: number[]

      an array containing which columns of model will be exported, or %NULL for all columns

    • rows: number[]

      an array containing which rows of model will be exported, or %NULL for all rows

    • options: Gda.Set

      list of options for the export

    Returns string

  • force_floating(): void
  • 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 g_object_ref_sink().

    Returns void

  • freeze(): void
  • Disables notifications of changes on the given data model. To re-enable notifications again, you should call the #gda_data_model_thaw function.

    Returns void

  • freeze_notify(): void
  • 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.

    This is necessary for accessors that modify multiple properties to prevent premature notification while the object is still being modified.

    Returns void

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

    Parameters

    • col: number

      a valid column number

    • row: number

      a valid row number, or -1

    Returns Gda.ValueAttribute

  • get_column_index(name: string): number
  • get_column_name(col: number): string
  • get_column_title(col: number): string
  • get_data(key?: string): object
  • Gets a named field from the objects table of associations (see g_object_set_data()).

    Parameters

    • Optional key: string

      name of the key for that association

    Returns object

  • Get the global data model exception(s) that occurred when using model. This is useful for example for the LDAP related data models where some rows may be missing because the LDAP search has reached a limit imposed by the LDAP server.

    Returns GLib.Error[]

  • get_filter_expr(): string
  • get_filtered_n_rows(): number
  • 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.

    Returns number

  • get_n_columns(): number
  • get_n_modified_rows(): number
  • 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).

    Returns number

  • get_n_new_rows(): number
  • Get the number of rows which have been added to proxy and which are not part of the proxied data model.

    Returns number

  • get_n_rows(): number
  • get_notify(): boolean
  • get_property(property_name?: string, value?: any): void
  • Gets a property of an object.

    The value can be:

    • an empty #GValue initialized by %G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
    • a #GValue initialized with the expected type of the property
    • a #GValue initialized with a type to which the expected type of the property can be transformed

    In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling g_value_unset().

    Note that g_object_get_property() is really intended for language bindings, g_object_get() is much more convenient for C programming.

    Parameters

    • Optional property_name: string

      the name of the property to get

    • Optional value: any

      return location for the property value

    Returns void

  • get_proxied_model_n_cols(): number
  • get_proxied_model_n_rows(): number
  • get_proxied_model_row(proxy_row: number): number
  • Get the proxy's proxied model row corresponding to proxy_row

    Parameters

    • proxy_row: number

      A proxy row number

    Returns number

  • get_qdata(quark: number): object
  • get_row_from_values(values: any[], cols_index: number[]): number
  • Returns 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 returns -1;

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

    Parameters

    • values: any[]

      a list of #GValue values (no %NULL is allowed)

    • cols_index: number[]

      an array of #gint containing the column number to match each value of values

    Returns number

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

    Returns number

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

    Returns number

  • get_typed_value_at(col: number, row: number, expected_type: GType<unknown>, nullok: boolean): any
  • Upon errors %NULL will be returned and error will be assigned a #GError from the #GDA_DATA_MODEL_ERROR domain.

    This method is similar to gda_data_model_get_value_at(), except that it also allows one to specify the expected #GType of the value to get: if the data model returned a #GValue of a type different than the expected one, then this method returns %NULL and an error code.

    Note: the same limitations and usage instructions apply as for gda_data_model_get_value_at().

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

    Parameters

    • col: number

      a valid column number.

    • row: number

      a valid row number.

    • expected_type: GType<unknown>

      the expected data type of the returned value

    • nullok: boolean

      if TRUE, then NULL values (value of type %GDA_TYPE_NULL) will not generate any error

    Returns any

  • get_value_at(col: number, row: number): any
  • Retrieves the data stored in the given position (identified by the col and row parameters) on a data model.

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

    This is the main function for accessing data in a model which allows random access to its data. To access data in a data model using a cursor, use a #GdaDataModelIter object, obtained using gda_data_model_create_iter().

    Note1: the returned #GValue must not be modified directly (unexpected behaviours may occur if you do so).

    Note2: the returned value may become invalid as soon as any Libgda part is executed again, which means if you want to keep the value, a copy must be made, however it will remain valid as long as the only Libgda usage is calling gda_data_model_get_value_at() for different values of the same row.

    If you want to modify a value stored in a #GdaDataModel, use the gda_data_model_set_value_at() or gda_data_model_set_values() methods.

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

    Parameters

    • col: number

      a valid column number.

    • row: number

      a valid row number.

    Returns any

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

    Parameters

    • proxy_row: number

      a proxy row

    • col: number

      a valid proxy column

    Returns Gda.ValueAttribute

  • get_values(proxy_row: number, cols_index: number[]): any[]
  • 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.

    Parameters

    • proxy_row: number

      a proxy row

    • cols_index: number[]

      array containing the columns for which the values are requested

    Returns any[]

  • getv(names: string[], values: any[]): void
  • 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.

    Parameters

    • names: string[]

      the names of each property to get

    • values: any[]

      the values of each property to get

    Returns void

  • has_changed(): boolean
  • import_from_file(file: string, cols_trans: HashTable<string | number | symbol, string | number | boolean>, options: Gda.Set): boolean
  • Imports data contained in the file file into model; the format is detected.

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

    Parameters

    • file: string

      the filename to import from

    • cols_trans: HashTable<string | number | symbol, string | number | boolean>

      a #GHashTable for columns translating, or %NULL, see gda_data_model_import_from_model()

    • options: Gda.Set

      list of options for the export

    Returns boolean

  • import_from_model(from: Gda.DataModel, overwrite: boolean, cols_trans: HashTable<string | number | symbol, string | number | boolean>): boolean
  • Copy the contents of the from data model to the to data model. The copy stops as soon as an error orrurs.

    The cols_trans is a hash table for which keys are to columns numbers and the values are the corresponding column numbers in the from data model. To set the values of a column in to to NULL, create an entry in the hash table with a negative value. For example:

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

    Parameters

    • from: Gda.DataModel

      the source #GdaDataModel

    • overwrite: boolean

      TRUE if to is completely overwritten by from's data, and FALSE if from's data is appended to to

    • cols_trans: HashTable<string | number | symbol, string | number | boolean>

      a #GHashTable for columns translating, or %NULL

    Returns boolean

  • import_from_string(string: string, cols_trans: HashTable<string | number | symbol, string | number | boolean>, options: Gda.Set): boolean
  • Loads the data from string into model.

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

    Parameters

    • string: string

      the string to import data from

    • cols_trans: HashTable<string | number | symbol, string | number | boolean>

      a hash table containing which columns of model will be imported, or %NULL for all columns, see gda_data_model_import_from_model()

    • options: Gda.Set

      list of options for the export

    Returns boolean

  • is_floating(): boolean
  • is_read_only(): boolean
  • notify(property_name: string): void
  • Emits a "notify" signal for the property property_name on object.

    When possible, eg. when signaling a property change from within the class that registered the property, you should use g_object_notify_by_pspec() instead.

    Note that emission of the notify signal may be blocked with g_object_freeze_notify(). In this case, the signal emissions are queued and will be emitted (in reverse order) when g_object_thaw_notify() is called.

    Parameters

    • property_name: string

      the name of a property installed on the class of object.

    Returns void

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

    This function omits the property name lookup, hence it is faster than g_object_notify().

    One way to avoid using g_object_notify() from within the class that registered the properties, and using g_object_notify_by_pspec() instead, is to store the GParamSpec used with g_object_class_install_property() inside a static array, e.g.:

      enum
    {
    PROP_0,
    PROP_FOO,
    PROP_LAST
    };

    static GParamSpec *properties[PROP_LAST];

    static void
    my_object_class_init (MyObjectClass *klass)
    {
    properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
    0, 100,
    50,
    G_PARAM_READWRITE);
    g_object_class_install_property (gobject_class,
    PROP_FOO,
    properties[PROP_FOO]);
    }

    and then notify a change on the "foo" property with:

      g_object_notify_by_pspec (self, properties[PROP_FOO]);
    

    Parameters

    • pspec: ParamSpec

      the #GParamSpec of a property installed on the class of object.

    Returns void

  • Increases the reference count of object.

    Since GLib 2.56, if GLIB_VERSION_MAX_ALLOWED is 2.56 or greater, the type of object will be propagated to the return type (using the GCC typeof() extension), so any casting the caller needs to do on the return type must be explicit.

    Returns GObject.Object

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

    In other words, if the object is floating, then this call "assumes ownership" of the floating reference, converting it to a normal reference by clearing the floating flag while leaving the reference count unchanged. If the object is not floating, then this call adds a new normal reference increasing the reference count by one.

    Since GLib 2.56, the type of object will be propagated to the return type under the same conditions as for g_object_ref().

    Returns GObject.Object

  • remove_row(row: number): boolean
  • Removes a row from the data model.

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

    Parameters

    • row: number

      the row number to be removed.

    Returns boolean

  • reset(): void
  • row_has_changed(proxy_row: number): boolean
  • Tells if the row number proxy_row has changed

    Parameters

    • proxy_row: number

      A proxy row number

    Returns boolean

  • row_inserted(row: number): void
  • Emits the 'row_inserted' and 'changed' signals on model.

    This method should only be used by #GdaDataModel implementations to signal that a row has been inserted.

    Parameters

    • row: number

      row number.

    Returns void

  • row_is_deleted(proxy_row: number): boolean
  • Tells if the row number proxy_row is marked to be deleted.

    Parameters

    • proxy_row: number

      A proxy row number

    Returns boolean

  • row_is_inserted(proxy_row: number): boolean
  • 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).

    Parameters

    • proxy_row: number

      A proxy row number

    Returns boolean

  • row_removed(row: number): void
  • Emits the 'row_removed' and 'changed' signal on model.

    This method should only be used by #GdaDataModel implementations to signal that a row has been removed

    Parameters

    • row: number

      row number.

    Returns void

  • row_updated(row: number): void
  • Emits the 'row_updated' and 'changed' signals on model.

    This method should only be used by #GdaDataModel implementations to signal that a row has been updated.

    Parameters

    • row: number

      row number.

    Returns void

  • run_dispose(): void
  • Releases all references to other objects. This can be used to break reference cycles.

    This function should only be called from object system implementations.

    Returns void

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

    Parameters

    • hint: Gda.DataModelHint

      a hint to send to the model

    • hint_value: any

      an optional value to specify the hint, or %NULL

    Returns void

  • set_column_name(col: number, name: string): void
  • Sets the name of the given col in model, and if its title is not set, also sets the title to name.

    Parameters

    • col: number

      column number

    • name: string

      name for the given column.

    Returns void

  • set_column_title(col: number, title: string): void
  • set_data(key: string, data?: object): void
  • Each object carries around a table of associations from strings to pointers. This function lets you set an association.

    If the object already had an association with that name, the old association will be destroyed.

    Internally, the key is converted to a #GQuark using g_quark_from_string(). This means a copy of key is kept permanently (even after object has been finalized) — so it is recommended to only use a small, bounded set of values for key in your program, to avoid the #GQuark storage growing unbounded.

    Parameters

    • key: string

      name of the key

    • Optional data: object

      data to associate with that key

    Returns void

  • set_filter_expr(filter_expr: string): boolean
  • 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 column 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).

    Parameters

    • filter_expr: string

      an SQL based expression which will filter the contents of proxy, or %NULL to remove any previous filter

    Returns boolean

  • set_ordering_column(col: number): boolean
  • set_property(property_name: string, value?: any): void
  • set_sample_size(sample_size: number): void
  • 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.

    Note: the rows which have been added but not yet committed will always be displayed regardless of the current chunk of data, and the modified rows which are not visible when the displayed chunk of data changes are still held as modified rows.

    To remove the chunking of the data to display, simply pass sample_size the %0 value.

    Parameters

    • sample_size: number

      the requested size of a chunk, or 0

    Returns void

  • set_sample_start(sample_start: number): void
  • Sets the number of the first row to be available in proxy (in reference to the proxied data model)

    Parameters

    • sample_start: number

      the number of the first row to be displayed

    Returns void

  • set_value_at(col: number, row: number, value: any): boolean
  • Modifies a value in model, at (col, row).

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

    Parameters

    • col: number

      column number.

    • row: number

      row number.

    • value: any

      a #GValue (not %NULL)

    Returns boolean

  • set_values(row: number, values: any[]): boolean
  • In a similar way to gda_data_model_set_value_at(), this method modifies a data model's contents by setting several values at once.

    If any value in values is actually %NULL, then the value in the corresponding column is left unchanged.

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

    Parameters

    • row: number

      row number.

    • values: any[]

      a list of #GValue (or %NULL), one for at most the number of columns of model

    Returns boolean

  • steal_data(key?: string): object
  • Remove a specified datum from the object's data associations, without invoking the association's destroy handler.

    Parameters

    • Optional key: string

      name of the key

    Returns object

  • steal_qdata(quark: number): object
  • This function gets back user data pointers stored via g_object_set_qdata() 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:

    void
    object_add_to_user_list (GObject *object,
    const gchar *new_string)
    {
    // the quark, naming the object data
    GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
    // retrieve the old string list
    GList *list = g_object_steal_qdata (object, quark_string_list);

    // prepend new string
    list = g_list_prepend (list, g_strdup (new_string));
    // this changed 'list', so we need to set it again
    g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
    }
    static void
    free_string_list (gpointer data)
    {
    GList *node, *list = data;

    for (node = list; node; node = node->next)
    g_free (node->data);
    g_list_free (list);
    }

    Using g_object_get_qdata() in the above example, instead of g_object_steal_qdata() would have left the destroy function set, and thus the partial string list would have been freed upon g_object_set_qdata_full().

    Parameters

    • quark: number

      A #GQuark, naming the user data pointer

    Returns object

  • thaw(): void
  • thaw_notify(): void
  • Reverts the effect of a previous call to g_object_freeze_notify(). The freeze count is decreased on object and when it reaches zero, queued "notify" signals are emitted.

    Duplicate notifications for each property are squashed so that at most one #GObject::notify signal is emitted for each property, in the reverse order in which they have been queued.

    It is an error to call this function when the freeze count is zero.

    Returns void

  • undelete(proxy_row: number): void
  • Remove the "to be deleted" mark at the row proxy_row, if it existed.

    Parameters

    • proxy_row: number

      A proxy row number

    Returns void

  • unref(): void
  • Decreases the reference count of object. When its reference count drops to 0, the object is finalized (i.e. its memory is freed).

    If the pointer to the #GObject may be reused in future (for example, if it is an instance variable of another object), it is recommended to clear the pointer to %NULL rather than retain a dangling pointer to a potentially invalid #GObject instance. Use g_clear_object() for this.

    Returns void

  • vfunc_constructed(): void
  • vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: ParamSpec): void
  • vfunc_dispose(): void
  • vfunc_filter_changed(): void
  • vfunc_finalize(): void
  • vfunc_get_property(property_id: number, value?: any, pspec?: ParamSpec): void
  • Emits a "notify" signal for the property property_name on object.

    When possible, eg. when signaling a property change from within the class that registered the property, you should use g_object_notify_by_pspec() instead.

    Note that emission of the notify signal may be blocked with g_object_freeze_notify(). In this case, the signal emissions are queued and will be emitted (in reverse order) when g_object_thaw_notify() is called.

    virtual

    Parameters

    Returns void

  • vfunc_row_changes_applied(row: number, proxied_row: number): void
  • vfunc_row_delete_changed(row: number, to_be_deleted: boolean): void
  • vfunc_sample_changed(sample_start: number, sample_end: number): void
  • vfunc_sample_size_changed(sample_size: number): void
  • vfunc_set_property(property_id: number, value?: any, pspec?: ParamSpec): void
  • vfunc_validate_row_changes(row: number, proxied_row: number): GLib.Error
  • watch_closure(closure: TClosure<any, any>): void
  • 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 g_closure_invalidate() on it, in order to prevent invocations of the closure with a finalized (nonexisting) object. Also, g_object_ref() and g_object_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.

    Parameters

    • closure: TClosure<any, any>

      #GClosure to watch

    Returns void

  • compat_control(what: number, data: object): number
  • error_quark(): number
  • Find the #GParamSpec with the given name for an interface. Generally, the interface vtable passed in as g_iface will be the default vtable from g_type_default_interface_ref(), or, if you know the interface has already been loaded, g_type_default_interface_peek().

    Parameters

    • g_iface: TypeInterface

      any interface vtable for the interface, or the default vtable for the interface

    • property_name: string

      name of a property to look up.

    Returns ParamSpec

  • Add a property to an interface; this is only useful for interfaces that are added to GObject-derived types. Adding a property to an interface forces all objects classes with that interface to have a compatible property. The compatible property could be a newly created #GParamSpec, but normally g_object_class_override_property() will be used so that the object class only needs to provide an implementation and inherits the property description, default value, bounds, and so forth from the interface property.

    This function is meant to be called from the interface's default vtable initialization function (the class_init member of #GTypeInfo.) It must not be called after after class_init has been called for any object types implementing this interface.

    If pspec is a floating reference, it will be consumed.

    Parameters

    • g_iface: TypeInterface

      any interface vtable for the interface, or the default vtable for the interface.

    • pspec: ParamSpec

      the #GParamSpec for the new property

    Returns void

  • Lists the properties of an interface.Generally, the interface vtable passed in as g_iface will be the default vtable from g_type_default_interface_ref(), or, if you know the interface has already been loaded, g_type_default_interface_peek().

    Parameters

    • g_iface: TypeInterface

      any interface vtable for the interface, or the default vtable for the interface

    Returns ParamSpec[]

  • Creates a new instance of a #GObject subtype and sets its properties.

    Construction parameters (see %G_PARAM_CONSTRUCT, %G_PARAM_CONSTRUCT_ONLY) which are not explicitly specified are set to their default values.

    Parameters

    • object_type: GType<unknown>

      the type id of the #GObject subtype to instantiate

    • parameters: GObject.Parameter[]

      an array of #GParameter

    Returns GObject.Object

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method