Gjsify LogoGjsify Logo

Hierarchy

Index

Constructors

Properties

gTypeInstance: TypeInstance
model: Gda.DataModel
parentInstance: GObject.Object
name: string

Methods

  • Specifies that field has to be included in the analysis. field is a field specification with the following accepted syntaxes: a column name in the source data model (see gda_data_model_get_column_index()); or an SQL expression involving a column name in the source data model, for examples: price firstname || ' ' || lastname nb BETWEEN 5 AND 10

    It is also possible to specify several fields to be added, while separating them by a comma (in effect still forming a valid SQL syntax).

    Parameters

    • aggregateType: Gda.DataPivotAggregate

      the type of aggregate operation to perform

    • field: string

      the field description, see below

    • alias: string

      the field alias, or %NULL

    Returns boolean

  • addDataFromXmlNode(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

  • Specifies that field has to be included in the analysis. field is a field specification with the following accepted syntaxes: a column name in the source data model (see gda_data_model_get_column_index()); or an SQL expression involving a column name in the source data model, for example: price firstname || ' ' || lastname nb BETWEEN 5 AND 10

    It is also possible to specify several fields to be added, while separating them by a comma (in effect still forming a valid SQL syntax).

    Parameters

    • fieldType: Gda.DataPivotFieldType

      the type of field to add

    • field: string

      the field description, see below

    • alias: string

      the field alias, or %NULL

    Returns boolean

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

  • appendValues(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

  • 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

    • sourceProperty: string

      the property on source to bind

    • target: GObject.Object

      the target #GObject

    • targetProperty: 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

    • sourceProperty: string

      the property on source to bind

    • target: GObject.Object

      the target #GObject

    • targetProperty: string

      the property on target to bind

    • flags: BindingFlags

      flags to pass to #GBinding

    • transformTo: TClosure<any, any>

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

    • transformFrom: TClosure<any, any>

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

    Returns Binding

  • connect(sigName: "notify::model", callback: ((...args: any[]) => void)): number
  • connect(sigName: string, callback: ((...args: any[]) => void)): number
  • Parameters

    • sigName: "notify::model"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns number

  • Parameters

    • sigName: string
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns number

  • 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

  • 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

  • dump(toStream: 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

    • toStream: object

      where to dump the data model

    Returns void

  • dumpAsString(): 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: "notify::model", ...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

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

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

  • getColumnIndex(name: string): number
  • getColumnName(col: number): string
  • getColumnTitle(col: number): string
  • getData(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[]

  • getNColumns(): number
  • getNRows(): number
  • getNotify(): boolean
  • getProperty(propertyName?: 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 propertyName: string

      the name of the property to get

    • Optional value: any

      return location for the property value

    Returns void

  • getQdata(quark: number): object
  • This function gets back user data pointers stored via g_object_set_qdata().

    Parameters

    • quark: number

      A #GQuark, naming the user data pointer

    Returns object

  • getRowFromValues(values: any[], colsIndex: 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)

    • colsIndex: number[]

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

    Returns number

  • getTypedValueAt(col: number, row: number, expectedType: 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.

    • expectedType: 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

  • getValueAt(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

  • 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

  • importFromFile(file: string, colsTrans: 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

    • colsTrans: 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

  • importFromModel(from: Gda.DataModel, overwrite: boolean, colsTrans: 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

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

      a #GHashTable for columns translating, or %NULL

    Returns boolean

  • importFromString(string: string, colsTrans: 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

    • colsTrans: 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

  • isFloating(): boolean
  • notify(propertyName: 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

    • propertyName: 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

  • off(sigName: "notify::model", callback: ((...args: any[]) => void)): EventEmitter
  • off(sigName: string, callback: ((...args: any[]) => void)): EventEmitter
  • Parameters

    • sigName: "notify::model"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns EventEmitter

  • Parameters

    • sigName: string
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns EventEmitter

  • on(sigName: "notify::model", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • on(sigName: string, callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • Parameters

    • sigName: "notify::model"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: string
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • once(sigName: "notify::model", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • once(sigName: string, callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • Parameters

    • sigName: "notify::model"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: string
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • populate(): boolean
  • Acutally populates pivot by analysing the data from the provided data model.

    Returns boolean

  • 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

  • removeRow(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
  • rowInserted(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

  • rowRemoved(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

  • rowUpdated(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

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

    • hintValue: any

      an optional value to specify the hint, or %NULL

    Returns void

  • setColumnName(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

  • setColumnTitle(col: number, title: string): void
  • Sets the title of the given col in model.

    Parameters

    • col: number

      column number

    • title: string

      title for the given column.

    Returns void

  • setData(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

  • setProperty(propertyName: string, value?: any): void
  • Sets a property on an object.

    Parameters

    • propertyName: string

      the name of the property to set

    • Optional value: any

      the value

    Returns void

  • setValueAt(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

  • setValues(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

  • stealData(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

  • stealQdata(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
  • thawNotify(): 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

  • 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

  • watchClosure(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

  • compatControl(what: number, data: object): number
  • errorQuark(): 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

    • gIface: TypeInterface

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

    • propertyName: 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

    • gIface: 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

    • gIface: 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

    • objectType: 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