@girs/gda-5.0 5.0.0-4.0.0-beta.2 → 5.0.0-4.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -19
- package/gda-5.0.d.ts +1103 -17
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|

|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
GJS TypeScript type definitions for Gda-5.0, generated from library version 5.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.
|
|
8
|
+
GJS TypeScript type definitions for Gda-5.0, generated from library version 5.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.3.
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
## Install
|
|
@@ -22,11 +22,6 @@ You can import this package into your project like this:
|
|
|
22
22
|
import Gda from '@girs/gda-5.0';
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
Or if you prefer CommonJS, you can also use this:
|
|
26
|
-
```ts
|
|
27
|
-
const Gda = require('@girs/gda-5.0');
|
|
28
|
-
```
|
|
29
|
-
|
|
30
25
|
### Ambient Modules
|
|
31
26
|
|
|
32
27
|
You can also use [ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules) to import this module like you would do this in JavaScript.
|
|
@@ -81,19 +76,6 @@ Now you have also type support for this, too:
|
|
|
81
76
|
const Gda = imports.gi.Gda;
|
|
82
77
|
```
|
|
83
78
|
|
|
84
|
-
|
|
85
|
-
### ESM vs. CommonJS
|
|
86
|
-
|
|
87
|
-
GJS supports two different import syntaxes. The new modern ESM syntax and the old global imports syntax.
|
|
88
|
-
|
|
89
|
-
In TypeScript projects for GJS and GNOME Shell extensions, you have the flexibility to use `ESM` syntax and then decide the import syntax for your bundled file. If your bundler is configured to use `CommonJS`, it will convert to the GJS-specific global imports syntax, like `const moduleName = imports.gi[moduleName]`. This is different from the traditional `require` syntax seen in Node.js. The global imports syntax is chosen because it aligns with the CommonJS format supported by NPM, which is used for the generated type definitions and this package.
|
|
90
|
-
|
|
91
|
-
On the other hand, if you configure your bundler to use ESM, it will retain the ESM import syntax. It's crucial to ensure that your bundler is set up to correctly translate and bundle these imports into either CommonJS or ESM format, depending on your project's requirements.
|
|
92
|
-
|
|
93
|
-
This approach is particularly important due to the `@girs` types, which include both `*.cjs `files, using the GJS global imports syntax, and `*.js` files, which utilize the ESM syntax. By appropriately setting up your bundler, you can control which syntax—CommonJS or ESM—is used in your project. The choice of CommonJS in this context is also due to the similarity between the GJS-specific global imports and CommonJS syntax, allowing for easier management and bundling in these specific types of projects.
|
|
94
|
-
|
|
95
|
-
Since GNOME Shell 45, you should only use ESM, even for GNOME Shell extensions. Before that, extensions had to use the global import syntax, unlike normal GJS applications, where ESM has been available for some time.
|
|
96
|
-
|
|
97
79
|
### Bundle
|
|
98
80
|
|
|
99
81
|
Depending on your project configuration, it is recommended to use a bundler like [esbuild](https://esbuild.github.io/). You can find examples using different bundlers [here](https://github.com/gjsify/ts-for-gir/tree/main/examples).
|
package/gda-5.0.d.ts
CHANGED
|
@@ -3318,7 +3318,7 @@ export namespace Gda {
|
|
|
3318
3318
|
* static void
|
|
3319
3319
|
* my_object_class_init (MyObjectClass *klass)
|
|
3320
3320
|
* {
|
|
3321
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
3321
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
3322
3322
|
* 0, 100,
|
|
3323
3323
|
* 50,
|
|
3324
3324
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -4491,7 +4491,7 @@ export namespace Gda {
|
|
|
4491
4491
|
* static void
|
|
4492
4492
|
* my_object_class_init (MyObjectClass *klass)
|
|
4493
4493
|
* {
|
|
4494
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
4494
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
4495
4495
|
* 0, 100,
|
|
4496
4496
|
* 50,
|
|
4497
4497
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -5672,7 +5672,1084 @@ export namespace Gda {
|
|
|
5672
5672
|
* static void
|
|
5673
5673
|
* my_object_class_init (MyObjectClass *klass)
|
|
5674
5674
|
* {
|
|
5675
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
5675
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
5676
|
+
* 0, 100,
|
|
5677
|
+
* 50,
|
|
5678
|
+
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
5679
|
+
* g_object_class_install_property (gobject_class,
|
|
5680
|
+
* PROP_FOO,
|
|
5681
|
+
* properties[PROP_FOO]);
|
|
5682
|
+
* }
|
|
5683
|
+
* ```
|
|
5684
|
+
*
|
|
5685
|
+
*
|
|
5686
|
+
* and then notify a change on the "foo" property with:
|
|
5687
|
+
*
|
|
5688
|
+
*
|
|
5689
|
+
* ```c
|
|
5690
|
+
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
|
|
5691
|
+
* ```
|
|
5692
|
+
*
|
|
5693
|
+
* @param pspec the #GParamSpec of a property installed on the class of @object.
|
|
5694
|
+
*/
|
|
5695
|
+
notify_by_pspec(pspec: GObject.ParamSpec): void;
|
|
5696
|
+
/**
|
|
5697
|
+
* Increases the reference count of `object`.
|
|
5698
|
+
*
|
|
5699
|
+
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
|
|
5700
|
+
* of `object` will be propagated to the return type (using the GCC typeof()
|
|
5701
|
+
* extension), so any casting the caller needs to do on the return type must be
|
|
5702
|
+
* explicit.
|
|
5703
|
+
* @returns the same @object
|
|
5704
|
+
*/
|
|
5705
|
+
ref(): GObject.Object;
|
|
5706
|
+
/**
|
|
5707
|
+
* Increase the reference count of `object,` and possibly remove the
|
|
5708
|
+
* [floating][floating-ref] reference, if `object` has a floating reference.
|
|
5709
|
+
*
|
|
5710
|
+
* In other words, if the object is floating, then this call "assumes
|
|
5711
|
+
* ownership" of the floating reference, converting it to a normal
|
|
5712
|
+
* reference by clearing the floating flag while leaving the reference
|
|
5713
|
+
* count unchanged. If the object is not floating, then this call
|
|
5714
|
+
* adds a new normal reference increasing the reference count by one.
|
|
5715
|
+
*
|
|
5716
|
+
* Since GLib 2.56, the type of `object` will be propagated to the return type
|
|
5717
|
+
* under the same conditions as for g_object_ref().
|
|
5718
|
+
* @returns @object
|
|
5719
|
+
*/
|
|
5720
|
+
ref_sink(): GObject.Object;
|
|
5721
|
+
/**
|
|
5722
|
+
* Releases all references to other objects. This can be used to break
|
|
5723
|
+
* reference cycles.
|
|
5724
|
+
*
|
|
5725
|
+
* This function should only be called from object system implementations.
|
|
5726
|
+
*/
|
|
5727
|
+
run_dispose(): void;
|
|
5728
|
+
/**
|
|
5729
|
+
* Each object carries around a table of associations from
|
|
5730
|
+
* strings to pointers. This function lets you set an association.
|
|
5731
|
+
*
|
|
5732
|
+
* If the object already had an association with that name,
|
|
5733
|
+
* the old association will be destroyed.
|
|
5734
|
+
*
|
|
5735
|
+
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
|
|
5736
|
+
* This means a copy of `key` is kept permanently (even after `object` has been
|
|
5737
|
+
* finalized) — so it is recommended to only use a small, bounded set of values
|
|
5738
|
+
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
|
|
5739
|
+
* @param key name of the key
|
|
5740
|
+
* @param data data to associate with that key
|
|
5741
|
+
*/
|
|
5742
|
+
set_data(key: string, data?: any | null): void;
|
|
5743
|
+
set_property(property_name: string, value: any): void;
|
|
5744
|
+
/**
|
|
5745
|
+
* Remove a specified datum from the object's data associations,
|
|
5746
|
+
* without invoking the association's destroy handler.
|
|
5747
|
+
* @param key name of the key
|
|
5748
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
5749
|
+
*/
|
|
5750
|
+
steal_data(key: string): any | null;
|
|
5751
|
+
/**
|
|
5752
|
+
* This function gets back user data pointers stored via
|
|
5753
|
+
* g_object_set_qdata() and removes the `data` from object
|
|
5754
|
+
* without invoking its destroy() function (if any was
|
|
5755
|
+
* set).
|
|
5756
|
+
* Usually, calling this function is only required to update
|
|
5757
|
+
* user data pointers with a destroy notifier, for example:
|
|
5758
|
+
*
|
|
5759
|
+
* ```c
|
|
5760
|
+
* void
|
|
5761
|
+
* object_add_to_user_list (GObject *object,
|
|
5762
|
+
* const gchar *new_string)
|
|
5763
|
+
* {
|
|
5764
|
+
* // the quark, naming the object data
|
|
5765
|
+
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
|
|
5766
|
+
* // retrieve the old string list
|
|
5767
|
+
* GList *list = g_object_steal_qdata (object, quark_string_list);
|
|
5768
|
+
*
|
|
5769
|
+
* // prepend new string
|
|
5770
|
+
* list = g_list_prepend (list, g_strdup (new_string));
|
|
5771
|
+
* // this changed 'list', so we need to set it again
|
|
5772
|
+
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
|
|
5773
|
+
* }
|
|
5774
|
+
* static void
|
|
5775
|
+
* free_string_list (gpointer data)
|
|
5776
|
+
* {
|
|
5777
|
+
* GList *node, *list = data;
|
|
5778
|
+
*
|
|
5779
|
+
* for (node = list; node; node = node->next)
|
|
5780
|
+
* g_free (node->data);
|
|
5781
|
+
* g_list_free (list);
|
|
5782
|
+
* }
|
|
5783
|
+
* ```
|
|
5784
|
+
*
|
|
5785
|
+
* Using g_object_get_qdata() in the above example, instead of
|
|
5786
|
+
* g_object_steal_qdata() would have left the destroy function set,
|
|
5787
|
+
* and thus the partial string list would have been freed upon
|
|
5788
|
+
* g_object_set_qdata_full().
|
|
5789
|
+
* @param quark A #GQuark, naming the user data pointer
|
|
5790
|
+
* @returns The user data pointer set, or %NULL
|
|
5791
|
+
*/
|
|
5792
|
+
steal_qdata(quark: GLib.Quark): any | null;
|
|
5793
|
+
/**
|
|
5794
|
+
* Reverts the effect of a previous call to
|
|
5795
|
+
* g_object_freeze_notify(). The freeze count is decreased on `object`
|
|
5796
|
+
* and when it reaches zero, queued "notify" signals are emitted.
|
|
5797
|
+
*
|
|
5798
|
+
* Duplicate notifications for each property are squashed so that at most one
|
|
5799
|
+
* #GObject::notify signal is emitted for each property, in the reverse order
|
|
5800
|
+
* in which they have been queued.
|
|
5801
|
+
*
|
|
5802
|
+
* It is an error to call this function when the freeze count is zero.
|
|
5803
|
+
*/
|
|
5804
|
+
thaw_notify(): void;
|
|
5805
|
+
/**
|
|
5806
|
+
* Decreases the reference count of `object`. When its reference count
|
|
5807
|
+
* drops to 0, the object is finalized (i.e. its memory is freed).
|
|
5808
|
+
*
|
|
5809
|
+
* If the pointer to the #GObject may be reused in future (for example, if it is
|
|
5810
|
+
* an instance variable of another object), it is recommended to clear the
|
|
5811
|
+
* pointer to %NULL rather than retain a dangling pointer to a potentially
|
|
5812
|
+
* invalid #GObject instance. Use g_clear_object() for this.
|
|
5813
|
+
*/
|
|
5814
|
+
unref(): void;
|
|
5815
|
+
/**
|
|
5816
|
+
* This function essentially limits the life time of the `closure` to
|
|
5817
|
+
* the life time of the object. That is, when the object is finalized,
|
|
5818
|
+
* the `closure` is invalidated by calling g_closure_invalidate() on
|
|
5819
|
+
* it, in order to prevent invocations of the closure with a finalized
|
|
5820
|
+
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
|
|
5821
|
+
* added as marshal guards to the `closure,` to ensure that an extra
|
|
5822
|
+
* reference count is held on `object` during invocation of the
|
|
5823
|
+
* `closure`. Usually, this function will be called on closures that
|
|
5824
|
+
* use this `object` as closure data.
|
|
5825
|
+
* @param closure #GClosure to watch
|
|
5826
|
+
*/
|
|
5827
|
+
watch_closure(closure: GObject.Closure): void;
|
|
5828
|
+
vfunc_constructed(): void;
|
|
5829
|
+
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
|
|
5830
|
+
vfunc_dispose(): void;
|
|
5831
|
+
vfunc_finalize(): void;
|
|
5832
|
+
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
|
|
5833
|
+
/**
|
|
5834
|
+
* Emits a "notify" signal for the property `property_name` on `object`.
|
|
5835
|
+
*
|
|
5836
|
+
* When possible, eg. when signaling a property change from within the class
|
|
5837
|
+
* that registered the property, you should use g_object_notify_by_pspec()
|
|
5838
|
+
* instead.
|
|
5839
|
+
*
|
|
5840
|
+
* Note that emission of the notify signal may be blocked with
|
|
5841
|
+
* g_object_freeze_notify(). In this case, the signal emissions are queued
|
|
5842
|
+
* and will be emitted (in reverse order) when g_object_thaw_notify() is
|
|
5843
|
+
* called.
|
|
5844
|
+
* @param pspec
|
|
5845
|
+
*/
|
|
5846
|
+
vfunc_notify(pspec: GObject.ParamSpec): void;
|
|
5847
|
+
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
|
|
5848
|
+
disconnect(id: number): void;
|
|
5849
|
+
set(properties: { [key: string]: any }): void;
|
|
5850
|
+
block_signal_handler(id: number): any;
|
|
5851
|
+
unblock_signal_handler(id: number): any;
|
|
5852
|
+
stop_emission_by_name(detailedName: string): any;
|
|
5853
|
+
}
|
|
5854
|
+
|
|
5855
|
+
module DataModelBdb {
|
|
5856
|
+
// Constructor properties interface
|
|
5857
|
+
|
|
5858
|
+
interface ConstructorProps extends GObject.Object.ConstructorProps, DataModel.ConstructorProps {
|
|
5859
|
+
db_name: string;
|
|
5860
|
+
dbName: string;
|
|
5861
|
+
filename: string;
|
|
5862
|
+
}
|
|
5863
|
+
}
|
|
5864
|
+
|
|
5865
|
+
class DataModelBdb extends GObject.Object implements DataModel {
|
|
5866
|
+
static $gtype: GObject.GType<DataModelBdb>;
|
|
5867
|
+
|
|
5868
|
+
// Own properties of Gda.DataModelBdb
|
|
5869
|
+
|
|
5870
|
+
get db_name(): string;
|
|
5871
|
+
get dbName(): string;
|
|
5872
|
+
get filename(): string;
|
|
5873
|
+
|
|
5874
|
+
// Own fields of Gda.DataModelBdb
|
|
5875
|
+
|
|
5876
|
+
object: GObject.Object;
|
|
5877
|
+
|
|
5878
|
+
// Constructors of Gda.DataModelBdb
|
|
5879
|
+
|
|
5880
|
+
constructor(properties?: Partial<DataModelBdb.ConstructorProps>, ...args: any[]);
|
|
5881
|
+
|
|
5882
|
+
_init(...args: any[]): void;
|
|
5883
|
+
|
|
5884
|
+
// Own static methods of Gda.DataModelBdb
|
|
5885
|
+
|
|
5886
|
+
/**
|
|
5887
|
+
* Creates a new #GdaDataModel object to access the contents of the Berkeley DB file `file,`
|
|
5888
|
+
* for the database `db_name` if not %NULL
|
|
5889
|
+
* @param filename name of the file containing the database
|
|
5890
|
+
* @param db_name the name of the database within @filename, or %NULL
|
|
5891
|
+
*/
|
|
5892
|
+
static ['new'](filename: string, db_name?: string | null): DataModel;
|
|
5893
|
+
|
|
5894
|
+
// Own virtual methods of Gda.DataModelBdb
|
|
5895
|
+
|
|
5896
|
+
vfunc_get_data_part(data: any | null, length: number, part: number): unknown;
|
|
5897
|
+
vfunc_get_key_part(data: any | null, length: number, part: number): unknown;
|
|
5898
|
+
vfunc_update_data_part(data: any | null, length: number, part: number, value: GObject.Value | any): boolean;
|
|
5899
|
+
vfunc_update_key_part(data: any | null, length: number, part: number, value: GObject.Value | any): boolean;
|
|
5900
|
+
|
|
5901
|
+
// Own methods of Gda.DataModelBdb
|
|
5902
|
+
|
|
5903
|
+
/**
|
|
5904
|
+
* Reset the list of errors which have occurred while using `model`
|
|
5905
|
+
*/
|
|
5906
|
+
clean_errors(): void;
|
|
5907
|
+
/**
|
|
5908
|
+
* Get the list of errors which have occurred while using `model`
|
|
5909
|
+
* @returns a read-only list of #GError pointers, or %NULL if no error has occurred
|
|
5910
|
+
*/
|
|
5911
|
+
get_errors(): GLib.Error[];
|
|
5912
|
+
|
|
5913
|
+
// Inherited methods
|
|
5914
|
+
/**
|
|
5915
|
+
* Adds the data from an XML node to the given data model (see the DTD for that node
|
|
5916
|
+
* in the $prefix/share/libgda/dtd/libgda-array.dtd file).
|
|
5917
|
+
*
|
|
5918
|
+
* Upon errors FALSE will be returned and `error` will be assigned a
|
|
5919
|
+
* #GError from the #GDA_DATA_MODEL_ERROR domain.
|
|
5920
|
+
* @param node an XML node representing a <gda_array_data> XML node.
|
|
5921
|
+
* @returns %TRUE if successful, %FALSE otherwise.
|
|
5922
|
+
*/
|
|
5923
|
+
add_data_from_xml_node(node: libxml2.NodePtr): boolean;
|
|
5924
|
+
/**
|
|
5925
|
+
* Appends a row to the data model (the new row will possibly have NULL values for all columns,
|
|
5926
|
+
* or some other values depending on the data model implementation)
|
|
5927
|
+
*
|
|
5928
|
+
* Upon errors -1 will be returned and `error` will be assigned a
|
|
5929
|
+
* #GError from the #GDA_DATA_MODEL_ERROR domain.
|
|
5930
|
+
* @returns the number of the added row, or -1 if an error occurred
|
|
5931
|
+
*/
|
|
5932
|
+
append_row(): number;
|
|
5933
|
+
/**
|
|
5934
|
+
* Appends a row to the given data model. If any value in `values` is actually %NULL, then
|
|
5935
|
+
* it is considered as a default value. If `values` is %NULL then all values are set to their default value.
|
|
5936
|
+
*
|
|
5937
|
+
* Upon errors -1 will be returned and `error` will be assigned a
|
|
5938
|
+
* #GError from the #GDA_DATA_MODEL_ERROR domain.
|
|
5939
|
+
* @param values #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).
|
|
5940
|
+
* @returns the number of the added row, or -1 if an error occurred
|
|
5941
|
+
*/
|
|
5942
|
+
append_values(values?: GObject.Value[] | null): number;
|
|
5943
|
+
/**
|
|
5944
|
+
* Makes a copy of `src` into a new #GdaDataModelArray object
|
|
5945
|
+
* @returns a new data model, or %NULL if an error occurred
|
|
5946
|
+
*/
|
|
5947
|
+
array_copy_model(): DataModelArray | null;
|
|
5948
|
+
/**
|
|
5949
|
+
* Like gda_data_model_array_copy_model(), makes a copy of `src,` but copies only some
|
|
5950
|
+
* columns.
|
|
5951
|
+
* @param cols array of @src's columns to copy into the new array, not %NULL
|
|
5952
|
+
* @returns a new data model, or %NULL if an error occurred
|
|
5953
|
+
*/
|
|
5954
|
+
array_copy_model_ext(cols: number[]): DataModelArray | null;
|
|
5955
|
+
/**
|
|
5956
|
+
* Creates a new iterator object #GdaDataModelIter object which can be used to iterate through
|
|
5957
|
+
* rows in `model`. The new #GdaDataModelIter does not hold any reference to `model` (ie. if `model`
|
|
5958
|
+
* is destroyed at some point, the new iterator will become useless but in any case it will not prevent
|
|
5959
|
+
* the data model from being destroyed).
|
|
5960
|
+
*
|
|
5961
|
+
* Depending on the data model's implementation, a new #GdaDataModelIter object may be created,
|
|
5962
|
+
* or a reference to an already existing #GdaDataModelIter may be returned. For example if `model` only
|
|
5963
|
+
* supports being accessed using a forward moving cursor (say a the result of a SELECT executed by SQLite
|
|
5964
|
+
* with a cursor access mode specified), then this method will always return the same iterator.
|
|
5965
|
+
*
|
|
5966
|
+
* If a new #GdaDataModelIter is created, then the row it represents is undefined.
|
|
5967
|
+
*
|
|
5968
|
+
* For models which can be accessed
|
|
5969
|
+
* randomly, any row can be set using gda_data_model_iter_move_to_row(),
|
|
5970
|
+
* and for models which are accessible sequentially only then use
|
|
5971
|
+
* gda_data_model_iter_move_next() (and gda_data_model_iter_move_prev() if
|
|
5972
|
+
* supported).
|
|
5973
|
+
*
|
|
5974
|
+
* Note: for the #GdaDataProxy data model (which proxies any #GdaDataModel for modifications and
|
|
5975
|
+
* has twice the number of columns of the proxied data model), this method will create an iterator
|
|
5976
|
+
* in which only the columns of the proxied data model appear. If you need to have a #GdaDataModelIter
|
|
5977
|
+
* in which all the proxy's columns appear, create it using:
|
|
5978
|
+
* <programlisting><![CDATA[iter = g_object_new (GDA_TYPE_DATA_MODEL_ITER, "data-model", proxy, NULL);]]></programlisting>
|
|
5979
|
+
* @returns a #GdaDataModelIter object, or %NULL if an error occurred
|
|
5980
|
+
*/
|
|
5981
|
+
create_iter(): DataModelIter;
|
|
5982
|
+
/**
|
|
5983
|
+
* Queries the underlying data model implementation for a description
|
|
5984
|
+
* of a given column. That description is returned in the form of
|
|
5985
|
+
* a #GdaColumn structure, which contains all the information
|
|
5986
|
+
* about the given column in the data model.
|
|
5987
|
+
*
|
|
5988
|
+
* WARNING: the returned #GdaColumn object belongs to the `model` model and
|
|
5989
|
+
* and should not be destroyed; any modification will affect the whole data model.
|
|
5990
|
+
* @param col column number.
|
|
5991
|
+
* @returns the description of the column.
|
|
5992
|
+
*/
|
|
5993
|
+
describe_column(col: number): Column | null;
|
|
5994
|
+
/**
|
|
5995
|
+
* Dumps a textual representation of the `model` to the `to_stream` stream
|
|
5996
|
+
*
|
|
5997
|
+
* The following environment variables can affect the resulting output:
|
|
5998
|
+
* <itemizedlist>
|
|
5999
|
+
* <listitem><para>GDA_DATA_MODEL_DUMP_ROW_NUMBERS: if set, the first column of the output will contain row numbers</para></listitem>
|
|
6000
|
+
* <listitem><para>GDA_DATA_MODEL_DUMP_ATTRIBUTES: if set, also dump the data model's columns' types and value's attributes</para></listitem>
|
|
6001
|
+
* <listitem><para>GDA_DATA_MODEL_DUMP_TITLE: if set, also dump the data model's title</para></listitem>
|
|
6002
|
+
* <listitem><para>GDA_DATA_MODEL_NULL_AS_EMPTY: if set, replace the 'NULL' string with an empty string for NULL values </para></listitem>
|
|
6003
|
+
* <listitem><para>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</para></listitem>
|
|
6004
|
+
* </itemizedlist>
|
|
6005
|
+
* @param to_stream where to dump the data model
|
|
6006
|
+
*/
|
|
6007
|
+
dump(to_stream?: any | null): void;
|
|
6008
|
+
/**
|
|
6009
|
+
* Dumps a textual representation of the `model` into a new string. The main differences with gda_data_model_export_to_string() are that
|
|
6010
|
+
* the formatting options are passed using environment variables, and that the data is dumped regardless of the user locale (e.g. dates
|
|
6011
|
+
* are not formatted according to the locale).
|
|
6012
|
+
*
|
|
6013
|
+
* The following environment variables can affect the resulting output:
|
|
6014
|
+
* <itemizedlist>
|
|
6015
|
+
* <listitem><para>GDA_DATA_MODEL_DUMP_ROW_NUMBERS: if set, the first column of the output will contain row numbers</para></listitem>
|
|
6016
|
+
* <listitem><para>GDA_DATA_MODEL_DUMP_TITLE: if set, also dump the data model's title</para></listitem>
|
|
6017
|
+
* <listitem><para>GDA_DATA_MODEL_NULL_AS_EMPTY: if set, replace the 'NULL' string with an empty string for NULL values </para></listitem>
|
|
6018
|
+
* <listitem><para>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</para></listitem>
|
|
6019
|
+
* </itemizedlist>
|
|
6020
|
+
* @returns a new string.
|
|
6021
|
+
*/
|
|
6022
|
+
dump_as_string(): string;
|
|
6023
|
+
/**
|
|
6024
|
+
* Exports data contained in `model` to the `file` file; the format is specified using the `format` argument. Note that
|
|
6025
|
+
* the date format used is the one used by the connection from which the data model has been made (as the result of a
|
|
6026
|
+
* SELECT statement), or, for other kinds of data models, the default format (refer to gda_data_handler_get_default()) unless
|
|
6027
|
+
* the "cnc" property has been set and points to a #GdaConnection to use that connection's date format.
|
|
6028
|
+
*
|
|
6029
|
+
* Specifically, the parameters in the `options` list can be:
|
|
6030
|
+
* <itemizedlist>
|
|
6031
|
+
* <listitem><para>"SEPARATOR": a string value of which the first character is used as a separator in case of CSV export
|
|
6032
|
+
* </para></listitem>
|
|
6033
|
+
* <listitem><para>"QUOTE": a string value of which the first character is used as a quote character in case of CSV export. The
|
|
6034
|
+
* default if not specified is the double quote character</para></listitem>
|
|
6035
|
+
* <listitem><para>"FIELD_QUOTE": a boolean value which can be set to FALSE if no quote around the individual fields
|
|
6036
|
+
* is requeted, in case of CSV export</para></listitem>
|
|
6037
|
+
* <listitem><para>"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)</para></listitem>
|
|
6038
|
+
* <listitem><para>"NAME": a string value used to name the exported data if the export format is XML or %GDA_DATA_MODEL_IO_TEXT_TABLE</para></listitem>
|
|
6039
|
+
* <listitem><para>"OVERWRITE": a boolean value which tells if the file must be over-written if it already exists.</para></listitem>
|
|
6040
|
+
* <listitem><para>"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)</para></listitem>
|
|
6041
|
+
* <listitem><para>"INVALID_AS_NULL": a boolean value which, if set to %TRUE, considers any invalid data (for example for the date related values) as NULL</para></listitem>
|
|
6042
|
+
* <listitem><para>"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
|
|
6043
|
+
* </para></listitem>
|
|
6044
|
+
* <listitem><para>"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
|
|
6045
|
+
* </para></listitem>
|
|
6046
|
+
* <listitem><para>"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
|
|
6047
|
+
* </para></listitem>
|
|
6048
|
+
* <listitem><para>"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
|
|
6049
|
+
* </para></listitem>
|
|
6050
|
+
* </itemizedlist>
|
|
6051
|
+
*
|
|
6052
|
+
* Warning: this function uses a #GdaDataModelIter iterator, and if `model` does not offer a random access
|
|
6053
|
+
* (check using gda_data_model_get_access_flags()), the iterator will be the same as normally used
|
|
6054
|
+
* to access data in `model` previously to calling this method, and this iterator will be moved (point to
|
|
6055
|
+
* another row).
|
|
6056
|
+
*
|
|
6057
|
+
* Upon errors %FALSE will be returned and `error` will be assigned a
|
|
6058
|
+
* #GError from the #GDA_DATA_MODEL_ERROR domain.
|
|
6059
|
+
* @param format the format in which to export data
|
|
6060
|
+
* @param file the filename to export to
|
|
6061
|
+
* @param cols an array containing which columns of @model will be exported, or %NULL for all columns
|
|
6062
|
+
* @param rows an array containing which rows of @model will be exported, or %NULL for all rows
|
|
6063
|
+
* @param options list of options for the export
|
|
6064
|
+
* @returns TRUE if no error occurred
|
|
6065
|
+
*/
|
|
6066
|
+
export_to_file(
|
|
6067
|
+
format: DataModelIOFormat,
|
|
6068
|
+
file: string,
|
|
6069
|
+
cols: number[] | null,
|
|
6070
|
+
rows: number[] | null,
|
|
6071
|
+
options: Set,
|
|
6072
|
+
): boolean;
|
|
6073
|
+
/**
|
|
6074
|
+
* Exports data contained in `model` to a string; the format is specified using the `format` argument, see the
|
|
6075
|
+
* gda_data_model_export_to_file() documentation for more information about the `options` argument (except for the
|
|
6076
|
+
* "OVERWRITE" option).
|
|
6077
|
+
*
|
|
6078
|
+
* Warning: this function uses a #GdaDataModelIter iterator, and if `model` does not offer a random access
|
|
6079
|
+
* (check using gda_data_model_get_access_flags()), the iterator will be the same as normally used
|
|
6080
|
+
* to access data in `model` previously to calling this method, and this iterator will be moved (point to
|
|
6081
|
+
* another row).
|
|
6082
|
+
*
|
|
6083
|
+
* See also gda_data_model_dump_as_string();
|
|
6084
|
+
* @param format the format in which to export data
|
|
6085
|
+
* @param cols an array containing which columns of @model will be exported, or %NULL for all columns
|
|
6086
|
+
* @param rows an array containing which rows of @model will be exported, or %NULL for all rows
|
|
6087
|
+
* @param options list of options for the export
|
|
6088
|
+
* @returns a new string, use g_free() when no longer needed
|
|
6089
|
+
*/
|
|
6090
|
+
export_to_string(format: DataModelIOFormat, cols: number[] | null, rows: number[] | null, options: Set): string;
|
|
6091
|
+
/**
|
|
6092
|
+
* Disables notifications of changes on the given data model. To
|
|
6093
|
+
* re-enable notifications again, you should call the
|
|
6094
|
+
* #gda_data_model_thaw function.
|
|
6095
|
+
*/
|
|
6096
|
+
freeze(): void;
|
|
6097
|
+
/**
|
|
6098
|
+
* Get the attributes of `model` such as how to access the data it contains if it's modifiable, etc.
|
|
6099
|
+
* @returns an ORed value of #GdaDataModelAccessFlags flags
|
|
6100
|
+
*/
|
|
6101
|
+
get_access_flags(): DataModelAccessFlags;
|
|
6102
|
+
/**
|
|
6103
|
+
* Get the attributes of the value stored at (row, col) in `model,` which
|
|
6104
|
+
* is an ORed value of #GdaValueAttribute flags. As a special case, if
|
|
6105
|
+
* `row` is -1, then the attributes returned correspond to a "would be" value
|
|
6106
|
+
* if a row was added to `model`.
|
|
6107
|
+
* @param col a valid column number
|
|
6108
|
+
* @param row a valid row number, or -1
|
|
6109
|
+
* @returns the attributes as an ORed value of #GdaValueAttribute
|
|
6110
|
+
*/
|
|
6111
|
+
get_attributes_at(col: number, row: number): ValueAttribute;
|
|
6112
|
+
/**
|
|
6113
|
+
* Get the index of the first column named `name` in `model`.
|
|
6114
|
+
* @param name a column name
|
|
6115
|
+
* @returns the column index, or -1 if no column named @name was found
|
|
6116
|
+
*/
|
|
6117
|
+
get_column_index(name: string): number;
|
|
6118
|
+
get_column_name(col: number): string;
|
|
6119
|
+
get_column_title(col: number): string;
|
|
6120
|
+
/**
|
|
6121
|
+
* Get the global data model exception(s) that occurred when using `model`.
|
|
6122
|
+
* This is useful for example for the LDAP related
|
|
6123
|
+
* data models where some rows may be missing because the LDAP search has reached a limit
|
|
6124
|
+
* imposed by the LDAP server.
|
|
6125
|
+
* @returns a pointer to a %NULL terminated array of #GError, or %NULL.
|
|
6126
|
+
*/
|
|
6127
|
+
get_exceptions(): GLib.Error[];
|
|
6128
|
+
get_n_columns(): number;
|
|
6129
|
+
get_n_rows(): number;
|
|
6130
|
+
/**
|
|
6131
|
+
* Returns the status of notifications changes on the given data model.
|
|
6132
|
+
*/
|
|
6133
|
+
get_notify(): boolean;
|
|
6134
|
+
/**
|
|
6135
|
+
* Returns the first row where all the values in `values` at the columns identified at
|
|
6136
|
+
* `cols_index` match. If the row can't be identified, then returns -1;
|
|
6137
|
+
*
|
|
6138
|
+
* NOTE: the `cols_index` array MUST contain a column index for each value in `values`
|
|
6139
|
+
* @param values a list of #GValue values (no %NULL is allowed)
|
|
6140
|
+
* @param cols_index an array of #gint containing the column number to match each value of @values
|
|
6141
|
+
* @returns the requested row number, of -1 if not found
|
|
6142
|
+
*/
|
|
6143
|
+
get_row_from_values(values: (GObject.Value | any)[], cols_index: number[]): number;
|
|
6144
|
+
/**
|
|
6145
|
+
* Upon errors %NULL will be returned and `error` will be assigned a
|
|
6146
|
+
* #GError from the #GDA_DATA_MODEL_ERROR domain.
|
|
6147
|
+
*
|
|
6148
|
+
* This method is similar to gda_data_model_get_value_at(), except that it also allows one to specify the expected
|
|
6149
|
+
* #GType of the value to get: if the data model returned a #GValue of a type different than the expected one, then
|
|
6150
|
+
* this method returns %NULL and an error code.
|
|
6151
|
+
*
|
|
6152
|
+
* Note: the same limitations and usage instructions apply as for gda_data_model_get_value_at().
|
|
6153
|
+
*
|
|
6154
|
+
* Upon errors %NULL will be returned and `error` will be assigned a
|
|
6155
|
+
* #GError from the #GDA_DATA_MODEL_ERROR domain.
|
|
6156
|
+
* @param col a valid column number.
|
|
6157
|
+
* @param row a valid row number.
|
|
6158
|
+
* @param expected_type the expected data type of the returned value
|
|
6159
|
+
* @param nullok if TRUE, then NULL values (value of type %GDA_TYPE_NULL) will not generate any error
|
|
6160
|
+
* @returns a #GValue containing the value stored in the given position, or %NULL on error (out-of-bound position, wrong data type, etc).
|
|
6161
|
+
*/
|
|
6162
|
+
get_typed_value_at(
|
|
6163
|
+
col: number,
|
|
6164
|
+
row: number,
|
|
6165
|
+
expected_type: GObject.GType,
|
|
6166
|
+
nullok: boolean,
|
|
6167
|
+
): GObject.Value | null;
|
|
6168
|
+
/**
|
|
6169
|
+
* Retrieves the data stored in the given position (identified by
|
|
6170
|
+
* the `col` and `row` parameters) on a data model.
|
|
6171
|
+
*
|
|
6172
|
+
* Upon errors %NULL will be returned and `error` will be assigned a
|
|
6173
|
+
* #GError from the #GDA_DATA_MODEL_ERROR domain.
|
|
6174
|
+
*
|
|
6175
|
+
* This is the main function for accessing data in a model which allows random access to its data.
|
|
6176
|
+
* To access data in a data model using a cursor, use a #GdaDataModelIter object, obtained using
|
|
6177
|
+
* gda_data_model_create_iter().
|
|
6178
|
+
*
|
|
6179
|
+
* Note1: the returned #GValue must not be modified directly (unexpected behaviours may
|
|
6180
|
+
* occur if you do so).
|
|
6181
|
+
*
|
|
6182
|
+
* Note2: the returned value may become invalid as soon as any Libgda part is executed again,
|
|
6183
|
+
* which means if you want to keep the value, a copy must be made, however it will remain valid
|
|
6184
|
+
* as long as the only Libgda usage is calling gda_data_model_get_value_at() for different values
|
|
6185
|
+
* of the same row.
|
|
6186
|
+
*
|
|
6187
|
+
* If you want to modify a value stored in a #GdaDataModel, use the gda_data_model_set_value_at() or
|
|
6188
|
+
* gda_data_model_set_values() methods.
|
|
6189
|
+
*
|
|
6190
|
+
* Upon errors %NULL will be returned and `error` will be assigned a
|
|
6191
|
+
* #GError from the #GDA_DATA_MODEL_ERROR domain.
|
|
6192
|
+
* @param col a valid column number.
|
|
6193
|
+
* @param row a valid row number.
|
|
6194
|
+
* @returns a #GValue containing the value stored in the given position, or %NULL on error (out-of-bound position, etc).
|
|
6195
|
+
*/
|
|
6196
|
+
get_value_at(col: number, row: number): GObject.Value | null;
|
|
6197
|
+
/**
|
|
6198
|
+
* Imports data contained in the `file` file into `model;` the format is detected.
|
|
6199
|
+
*
|
|
6200
|
+
* Upon errors FALSE will be returned and `error` will be assigned a
|
|
6201
|
+
* #GError from the #GDA_DATA_MODEL_ERROR domain.
|
|
6202
|
+
* @param file the filename to import from
|
|
6203
|
+
* @param cols_trans a #GHashTable for columns translating, or %NULL, see gda_data_model_import_from_model()
|
|
6204
|
+
* @param options list of options for the export
|
|
6205
|
+
* @returns TRUE if no error occurred
|
|
6206
|
+
*/
|
|
6207
|
+
import_from_file(file: string, cols_trans: GLib.HashTable<number, number> | null, options: Set): boolean;
|
|
6208
|
+
/**
|
|
6209
|
+
* Copy the contents of the `from` data model to the `to` data model. The copy stops as soon as an error
|
|
6210
|
+
* orrurs.
|
|
6211
|
+
*
|
|
6212
|
+
* The `cols_trans` is a hash table for which keys are `to` columns numbers and the values are
|
|
6213
|
+
* the corresponding column numbers in the `from` data model. To set the values of a column in `to` to NULL,
|
|
6214
|
+
* create an entry in the hash table with a negative value. For example:
|
|
6215
|
+
* <programlisting><![CDATA[GHashTable *hash;
|
|
6216
|
+
* gint *ptr;
|
|
6217
|
+
* hash = g_hash_table_new_full (g_int_hash, g_int_equal, g_free, NULL);
|
|
6218
|
+
* ptr = g_new (gint, 1);
|
|
6219
|
+
* *ptr = 2;
|
|
6220
|
+
* g_hash_table_insert (hash, ptr, GINT_TO_POINTER (3));
|
|
6221
|
+
* gda_data_model_import_from_model (...);
|
|
6222
|
+
* g_hash_table_free (hash);
|
|
6223
|
+
* ]]></programlisting>
|
|
6224
|
+
*
|
|
6225
|
+
* Upon errors FALSE will be returned and `error` will be assigned a
|
|
6226
|
+
* #GError from the #GDA_DATA_MODEL_ERROR domain.
|
|
6227
|
+
* @param from the source #GdaDataModel
|
|
6228
|
+
* @param overwrite TRUE if @to is completely overwritten by @from's data, and FALSE if @from's data is appended to @to
|
|
6229
|
+
* @param cols_trans a #GHashTable for columns translating, or %NULL
|
|
6230
|
+
* @returns TRUE if no error occurred.
|
|
6231
|
+
*/
|
|
6232
|
+
import_from_model(
|
|
6233
|
+
from: DataModel,
|
|
6234
|
+
overwrite: boolean,
|
|
6235
|
+
cols_trans?: GLib.HashTable<number, number> | null,
|
|
6236
|
+
): boolean;
|
|
6237
|
+
/**
|
|
6238
|
+
* Loads the data from `string` into `model`.
|
|
6239
|
+
*
|
|
6240
|
+
* Upon errors FALSE will be returned and `error` will be assigned a
|
|
6241
|
+
* #GError from the #GDA_DATA_MODEL_ERROR domain.
|
|
6242
|
+
* @param string the string to import data from
|
|
6243
|
+
* @param cols_trans a hash table containing which columns of @model will be imported, or %NULL for all columns, see gda_data_model_import_from_model()
|
|
6244
|
+
* @param options list of options for the export
|
|
6245
|
+
* @returns TRUE if no error occurred.
|
|
6246
|
+
*/
|
|
6247
|
+
import_from_string(string: string, cols_trans: GLib.HashTable<number, number> | null, options: Set): boolean;
|
|
6248
|
+
/**
|
|
6249
|
+
* Moves `iter` to the row number given by `row`.
|
|
6250
|
+
* @param iter a #GdaDataModelIter object.
|
|
6251
|
+
* @param row a row to point to with @iter
|
|
6252
|
+
*/
|
|
6253
|
+
iter_at_row(iter: DataModelIter, row: number): boolean;
|
|
6254
|
+
/**
|
|
6255
|
+
* Moves `iter` to the next row in `model`.
|
|
6256
|
+
* @param iter a #GdaDataModelIter object.
|
|
6257
|
+
*/
|
|
6258
|
+
iter_next(iter: DataModelIter): boolean;
|
|
6259
|
+
/**
|
|
6260
|
+
* Moves `iter` to the next row in `model`.
|
|
6261
|
+
* @param iter a #GdaDataModelIter object.
|
|
6262
|
+
*/
|
|
6263
|
+
iter_prev(iter: DataModelIter): boolean;
|
|
6264
|
+
/**
|
|
6265
|
+
* Set `value` to the given `column` and row pointed by `iter` in the given `model`.
|
|
6266
|
+
* @param iter a #GdaDataModelIter object.
|
|
6267
|
+
* @param col the number of column to set value to
|
|
6268
|
+
* @param value the to use to set on
|
|
6269
|
+
*/
|
|
6270
|
+
iter_set_value(iter: DataModelIter, col: number, value: GObject.Value | any): boolean;
|
|
6271
|
+
/**
|
|
6272
|
+
* Removes a row from the data model.
|
|
6273
|
+
*
|
|
6274
|
+
* Upon errors FALSE will be returned and `error` will be assigned a
|
|
6275
|
+
* #GError from the #GDA_DATA_MODEL_ERROR domain.
|
|
6276
|
+
* @param row the row number to be removed.
|
|
6277
|
+
* @returns %TRUE if successful, %FALSE otherwise.
|
|
6278
|
+
*/
|
|
6279
|
+
remove_row(row: number): boolean;
|
|
6280
|
+
/**
|
|
6281
|
+
* Emits the 'reset' and 'changed' signal on `model`.
|
|
6282
|
+
*/
|
|
6283
|
+
reset(): void;
|
|
6284
|
+
/**
|
|
6285
|
+
* Emits the 'row_inserted' and 'changed' signals on `model`.
|
|
6286
|
+
*
|
|
6287
|
+
* This method should only be used by #GdaDataModel implementations to
|
|
6288
|
+
* signal that a row has been inserted.
|
|
6289
|
+
* @param row row number.
|
|
6290
|
+
*/
|
|
6291
|
+
row_inserted(row: number): void;
|
|
6292
|
+
/**
|
|
6293
|
+
* Emits the 'row_removed' and 'changed' signal on `model`.
|
|
6294
|
+
*
|
|
6295
|
+
* This method should only be used by #GdaDataModel implementations to
|
|
6296
|
+
* signal that a row has been removed
|
|
6297
|
+
* @param row row number.
|
|
6298
|
+
*/
|
|
6299
|
+
row_removed(row: number): void;
|
|
6300
|
+
/**
|
|
6301
|
+
* Emits the 'row_updated' and 'changed' signals on `model`.
|
|
6302
|
+
*
|
|
6303
|
+
* This method should only be used by #GdaDataModel implementations to
|
|
6304
|
+
* signal that a row has been updated.
|
|
6305
|
+
* @param row row number.
|
|
6306
|
+
*/
|
|
6307
|
+
row_updated(row: number): void;
|
|
6308
|
+
/**
|
|
6309
|
+
* Sends a hint to the data model. The hint may or may not be handled by the data
|
|
6310
|
+
* model, depending on its implementation
|
|
6311
|
+
* @param hint a hint to send to the model
|
|
6312
|
+
* @param hint_value an optional value to specify the hint, or %NULL
|
|
6313
|
+
*/
|
|
6314
|
+
send_hint(hint: DataModelHint, hint_value?: GObject.Value | null): void;
|
|
6315
|
+
/**
|
|
6316
|
+
* Sets the `name` of the given `col` in `model,` and if its title is not set, also sets the
|
|
6317
|
+
* title to `name`.
|
|
6318
|
+
* @param col column number
|
|
6319
|
+
* @param name name for the given column.
|
|
6320
|
+
*/
|
|
6321
|
+
set_column_name(col: number, name: string): void;
|
|
6322
|
+
/**
|
|
6323
|
+
* Sets the `title` of the given `col` in `model`.
|
|
6324
|
+
* @param col column number
|
|
6325
|
+
* @param title title for the given column.
|
|
6326
|
+
*/
|
|
6327
|
+
set_column_title(col: number, title: string): void;
|
|
6328
|
+
/**
|
|
6329
|
+
* Enable or disable notifications changes on the given data model.
|
|
6330
|
+
* @param do_notify_changes Set to TRUE if you require notifications.
|
|
6331
|
+
*/
|
|
6332
|
+
set_notify(do_notify_changes: boolean): void;
|
|
6333
|
+
/**
|
|
6334
|
+
* Modifies a value in `model,` at (`col,` `row)`.
|
|
6335
|
+
*
|
|
6336
|
+
* Upon errors FALSE will be returned and `error` will be assigned a
|
|
6337
|
+
* #GError from the #GDA_DATA_MODEL_ERROR domain.
|
|
6338
|
+
* @param col column number.
|
|
6339
|
+
* @param row row number.
|
|
6340
|
+
* @param value a #GValue (not %NULL)
|
|
6341
|
+
* @returns TRUE if the value in the data model has been updated and no error occurred
|
|
6342
|
+
*/
|
|
6343
|
+
set_value_at(col: number, row: number, value: GObject.Value | any): boolean;
|
|
6344
|
+
/**
|
|
6345
|
+
* In a similar way to gda_data_model_set_value_at(), this method modifies a data model's contents
|
|
6346
|
+
* by setting several values at once.
|
|
6347
|
+
*
|
|
6348
|
+
* If any value in `values` is actually %NULL, then the value in the corresponding column is left
|
|
6349
|
+
* unchanged.
|
|
6350
|
+
*
|
|
6351
|
+
* Upon errors FALSE will be returned and `error` will be assigned a
|
|
6352
|
+
* #GError from the #GDA_DATA_MODEL_ERROR domain.
|
|
6353
|
+
* @param row row number.
|
|
6354
|
+
* @param values a list of #GValue (or %NULL), one for at most the number of columns of @model
|
|
6355
|
+
* @returns %TRUE if the value in the data model has been updated and no error occurred
|
|
6356
|
+
*/
|
|
6357
|
+
set_values(row: number, values?: GObject.Value[] | null): boolean;
|
|
6358
|
+
/**
|
|
6359
|
+
* Re-enables notifications of changes on the given data model.
|
|
6360
|
+
*/
|
|
6361
|
+
thaw(): void;
|
|
6362
|
+
vfunc_access_changed(): void;
|
|
6363
|
+
vfunc_changed(): void;
|
|
6364
|
+
/**
|
|
6365
|
+
* Appends a row to the data model (the new row will possibly have NULL values for all columns,
|
|
6366
|
+
* or some other values depending on the data model implementation)
|
|
6367
|
+
*
|
|
6368
|
+
* Upon errors -1 will be returned and `error` will be assigned a
|
|
6369
|
+
* #GError from the #GDA_DATA_MODEL_ERROR domain.
|
|
6370
|
+
*/
|
|
6371
|
+
vfunc_i_append_row(): number;
|
|
6372
|
+
/**
|
|
6373
|
+
* Appends a row to the given data model. If any value in `values` is actually %NULL, then
|
|
6374
|
+
* it is considered as a default value. If `values` is %NULL then all values are set to their default value.
|
|
6375
|
+
*
|
|
6376
|
+
* Upon errors -1 will be returned and `error` will be assigned a
|
|
6377
|
+
* #GError from the #GDA_DATA_MODEL_ERROR domain.
|
|
6378
|
+
* @param values #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).
|
|
6379
|
+
*/
|
|
6380
|
+
vfunc_i_append_values(values?: GObject.Value[] | null): number;
|
|
6381
|
+
/**
|
|
6382
|
+
* Creates a new iterator object #GdaDataModelIter object which can be used to iterate through
|
|
6383
|
+
* rows in `model`. The new #GdaDataModelIter does not hold any reference to `model` (ie. if `model`
|
|
6384
|
+
* is destroyed at some point, the new iterator will become useless but in any case it will not prevent
|
|
6385
|
+
* the data model from being destroyed).
|
|
6386
|
+
*
|
|
6387
|
+
* Depending on the data model's implementation, a new #GdaDataModelIter object may be created,
|
|
6388
|
+
* or a reference to an already existing #GdaDataModelIter may be returned. For example if `model` only
|
|
6389
|
+
* supports being accessed using a forward moving cursor (say a the result of a SELECT executed by SQLite
|
|
6390
|
+
* with a cursor access mode specified), then this method will always return the same iterator.
|
|
6391
|
+
*
|
|
6392
|
+
* If a new #GdaDataModelIter is created, then the row it represents is undefined.
|
|
6393
|
+
*
|
|
6394
|
+
* For models which can be accessed
|
|
6395
|
+
* randomly, any row can be set using gda_data_model_iter_move_to_row(),
|
|
6396
|
+
* and for models which are accessible sequentially only then use
|
|
6397
|
+
* gda_data_model_iter_move_next() (and gda_data_model_iter_move_prev() if
|
|
6398
|
+
* supported).
|
|
6399
|
+
*
|
|
6400
|
+
* Note: for the #GdaDataProxy data model (which proxies any #GdaDataModel for modifications and
|
|
6401
|
+
* has twice the number of columns of the proxied data model), this method will create an iterator
|
|
6402
|
+
* in which only the columns of the proxied data model appear. If you need to have a #GdaDataModelIter
|
|
6403
|
+
* in which all the proxy's columns appear, create it using:
|
|
6404
|
+
* <programlisting><![CDATA[iter = g_object_new (GDA_TYPE_DATA_MODEL_ITER, "data-model", proxy, NULL);]]></programlisting>
|
|
6405
|
+
*/
|
|
6406
|
+
vfunc_i_create_iter(): DataModelIter;
|
|
6407
|
+
/**
|
|
6408
|
+
* Queries the underlying data model implementation for a description
|
|
6409
|
+
* of a given column. That description is returned in the form of
|
|
6410
|
+
* a #GdaColumn structure, which contains all the information
|
|
6411
|
+
* about the given column in the data model.
|
|
6412
|
+
*
|
|
6413
|
+
* WARNING: the returned #GdaColumn object belongs to the `model` model and
|
|
6414
|
+
* and should not be destroyed; any modification will affect the whole data model.
|
|
6415
|
+
* @param col column number.
|
|
6416
|
+
*/
|
|
6417
|
+
vfunc_i_describe_column(col: number): Column | null;
|
|
6418
|
+
/**
|
|
6419
|
+
* Returns the first row where all the values in `values` at the columns identified at
|
|
6420
|
+
* `cols_index` match. If the row can't be identified, then returns -1;
|
|
6421
|
+
*
|
|
6422
|
+
* NOTE: the `cols_index` array MUST contain a column index for each value in `values`
|
|
6423
|
+
* @param values a list of #GValue values (no %NULL is allowed)
|
|
6424
|
+
* @param cols_index an array of #gint containing the column number to match each value of @values
|
|
6425
|
+
*/
|
|
6426
|
+
vfunc_i_find_row(values: (GObject.Value | any)[], cols_index: number[]): number;
|
|
6427
|
+
/**
|
|
6428
|
+
* Get the attributes of `model` such as how to access the data it contains if it's modifiable, etc.
|
|
6429
|
+
*/
|
|
6430
|
+
vfunc_i_get_access_flags(): DataModelAccessFlags;
|
|
6431
|
+
/**
|
|
6432
|
+
* Get the attributes of the value stored at (row, col) in `model,` which
|
|
6433
|
+
* is an ORed value of #GdaValueAttribute flags. As a special case, if
|
|
6434
|
+
* `row` is -1, then the attributes returned correspond to a "would be" value
|
|
6435
|
+
* if a row was added to `model`.
|
|
6436
|
+
* @param col a valid column number
|
|
6437
|
+
* @param row a valid row number, or -1
|
|
6438
|
+
*/
|
|
6439
|
+
vfunc_i_get_attributes_at(col: number, row: number): ValueAttribute;
|
|
6440
|
+
/**
|
|
6441
|
+
* Get the global data model exception(s) that occurred when using `model`.
|
|
6442
|
+
* This is useful for example for the LDAP related
|
|
6443
|
+
* data models where some rows may be missing because the LDAP search has reached a limit
|
|
6444
|
+
* imposed by the LDAP server.
|
|
6445
|
+
*/
|
|
6446
|
+
vfunc_i_get_exceptions(): GLib.Error[];
|
|
6447
|
+
vfunc_i_get_n_columns(): number;
|
|
6448
|
+
vfunc_i_get_n_rows(): number;
|
|
6449
|
+
/**
|
|
6450
|
+
* Returns the status of notifications changes on the given data model.
|
|
6451
|
+
*/
|
|
6452
|
+
vfunc_i_get_notify(): boolean;
|
|
6453
|
+
/**
|
|
6454
|
+
* Retrieves the data stored in the given position (identified by
|
|
6455
|
+
* the `col` and `row` parameters) on a data model.
|
|
6456
|
+
*
|
|
6457
|
+
* Upon errors %NULL will be returned and `error` will be assigned a
|
|
6458
|
+
* #GError from the #GDA_DATA_MODEL_ERROR domain.
|
|
6459
|
+
*
|
|
6460
|
+
* This is the main function for accessing data in a model which allows random access to its data.
|
|
6461
|
+
* To access data in a data model using a cursor, use a #GdaDataModelIter object, obtained using
|
|
6462
|
+
* gda_data_model_create_iter().
|
|
6463
|
+
*
|
|
6464
|
+
* Note1: the returned #GValue must not be modified directly (unexpected behaviours may
|
|
6465
|
+
* occur if you do so).
|
|
6466
|
+
*
|
|
6467
|
+
* Note2: the returned value may become invalid as soon as any Libgda part is executed again,
|
|
6468
|
+
* which means if you want to keep the value, a copy must be made, however it will remain valid
|
|
6469
|
+
* as long as the only Libgda usage is calling gda_data_model_get_value_at() for different values
|
|
6470
|
+
* of the same row.
|
|
6471
|
+
*
|
|
6472
|
+
* If you want to modify a value stored in a #GdaDataModel, use the gda_data_model_set_value_at() or
|
|
6473
|
+
* gda_data_model_set_values() methods.
|
|
6474
|
+
*
|
|
6475
|
+
* Upon errors %NULL will be returned and `error` will be assigned a
|
|
6476
|
+
* #GError from the #GDA_DATA_MODEL_ERROR domain.
|
|
6477
|
+
* @param col a valid column number.
|
|
6478
|
+
* @param row a valid row number.
|
|
6479
|
+
*/
|
|
6480
|
+
vfunc_i_get_value_at(col: number, row: number): GObject.Value | null;
|
|
6481
|
+
/**
|
|
6482
|
+
* Moves `iter` to the row number given by `row`.
|
|
6483
|
+
* @param iter a #GdaDataModelIter object.
|
|
6484
|
+
* @param row a row to point to with @iter
|
|
6485
|
+
*/
|
|
6486
|
+
vfunc_i_iter_at_row(iter: DataModelIter, row: number): boolean;
|
|
6487
|
+
/**
|
|
6488
|
+
* Moves `iter` to the next row in `model`.
|
|
6489
|
+
* @param iter a #GdaDataModelIter object.
|
|
6490
|
+
*/
|
|
6491
|
+
vfunc_i_iter_next(iter: DataModelIter): boolean;
|
|
6492
|
+
/**
|
|
6493
|
+
* Moves `iter` to the next row in `model`.
|
|
6494
|
+
* @param iter a #GdaDataModelIter object.
|
|
6495
|
+
*/
|
|
6496
|
+
vfunc_i_iter_prev(iter: DataModelIter): boolean;
|
|
6497
|
+
/**
|
|
6498
|
+
* Set `value` to the given `column` and row pointed by `iter` in the given `model`.
|
|
6499
|
+
* @param iter a #GdaDataModelIter object.
|
|
6500
|
+
* @param col the number of column to set value to
|
|
6501
|
+
* @param value the to use to set on
|
|
6502
|
+
*/
|
|
6503
|
+
vfunc_i_iter_set_value(iter: DataModelIter, col: number, value: GObject.Value | any): boolean;
|
|
6504
|
+
/**
|
|
6505
|
+
* Removes a row from the data model.
|
|
6506
|
+
*
|
|
6507
|
+
* Upon errors FALSE will be returned and `error` will be assigned a
|
|
6508
|
+
* #GError from the #GDA_DATA_MODEL_ERROR domain.
|
|
6509
|
+
* @param row the row number to be removed.
|
|
6510
|
+
*/
|
|
6511
|
+
vfunc_i_remove_row(row: number): boolean;
|
|
6512
|
+
/**
|
|
6513
|
+
* Sends a hint to the data model. The hint may or may not be handled by the data
|
|
6514
|
+
* model, depending on its implementation
|
|
6515
|
+
* @param hint a hint to send to the model
|
|
6516
|
+
* @param hint_value an optional value to specify the hint, or %NULL
|
|
6517
|
+
*/
|
|
6518
|
+
vfunc_i_send_hint(hint: DataModelHint, hint_value?: GObject.Value | null): void;
|
|
6519
|
+
/**
|
|
6520
|
+
* Enable or disable notifications changes on the given data model.
|
|
6521
|
+
* @param do_notify_changes Set to TRUE if you require notifications.
|
|
6522
|
+
*/
|
|
6523
|
+
vfunc_i_set_notify(do_notify_changes: boolean): void;
|
|
6524
|
+
/**
|
|
6525
|
+
* Modifies a value in `model,` at (`col,` `row)`.
|
|
6526
|
+
*
|
|
6527
|
+
* Upon errors FALSE will be returned and `error` will be assigned a
|
|
6528
|
+
* #GError from the #GDA_DATA_MODEL_ERROR domain.
|
|
6529
|
+
* @param col column number.
|
|
6530
|
+
* @param row row number.
|
|
6531
|
+
* @param value a #GValue (not %NULL)
|
|
6532
|
+
*/
|
|
6533
|
+
vfunc_i_set_value_at(col: number, row: number, value: GObject.Value | any): boolean;
|
|
6534
|
+
/**
|
|
6535
|
+
* In a similar way to gda_data_model_set_value_at(), this method modifies a data model's contents
|
|
6536
|
+
* by setting several values at once.
|
|
6537
|
+
*
|
|
6538
|
+
* If any value in `values` is actually %NULL, then the value in the corresponding column is left
|
|
6539
|
+
* unchanged.
|
|
6540
|
+
*
|
|
6541
|
+
* Upon errors FALSE will be returned and `error` will be assigned a
|
|
6542
|
+
* #GError from the #GDA_DATA_MODEL_ERROR domain.
|
|
6543
|
+
* @param row row number.
|
|
6544
|
+
* @param values a list of #GValue (or %NULL), one for at most the number of columns of @model
|
|
6545
|
+
*/
|
|
6546
|
+
vfunc_i_set_values(row: number, values?: GObject.Value[] | null): boolean;
|
|
6547
|
+
/**
|
|
6548
|
+
* Emits the 'reset' and 'changed' signal on `model`.
|
|
6549
|
+
*/
|
|
6550
|
+
vfunc_reset(): void;
|
|
6551
|
+
/**
|
|
6552
|
+
* Emits the 'row_inserted' and 'changed' signals on `model`.
|
|
6553
|
+
*
|
|
6554
|
+
* This method should only be used by #GdaDataModel implementations to
|
|
6555
|
+
* signal that a row has been inserted.
|
|
6556
|
+
* @param row row number.
|
|
6557
|
+
*/
|
|
6558
|
+
vfunc_row_inserted(row: number): void;
|
|
6559
|
+
/**
|
|
6560
|
+
* Emits the 'row_removed' and 'changed' signal on `model`.
|
|
6561
|
+
*
|
|
6562
|
+
* This method should only be used by #GdaDataModel implementations to
|
|
6563
|
+
* signal that a row has been removed
|
|
6564
|
+
* @param row row number.
|
|
6565
|
+
*/
|
|
6566
|
+
vfunc_row_removed(row: number): void;
|
|
6567
|
+
/**
|
|
6568
|
+
* Emits the 'row_updated' and 'changed' signals on `model`.
|
|
6569
|
+
*
|
|
6570
|
+
* This method should only be used by #GdaDataModel implementations to
|
|
6571
|
+
* signal that a row has been updated.
|
|
6572
|
+
* @param row row number.
|
|
6573
|
+
*/
|
|
6574
|
+
vfunc_row_updated(row: number): void;
|
|
6575
|
+
/**
|
|
6576
|
+
* Creates a binding between `source_property` on `source` and `target_property`
|
|
6577
|
+
* on `target`.
|
|
6578
|
+
*
|
|
6579
|
+
* Whenever the `source_property` is changed the `target_property` is
|
|
6580
|
+
* updated using the same value. For instance:
|
|
6581
|
+
*
|
|
6582
|
+
*
|
|
6583
|
+
* ```c
|
|
6584
|
+
* g_object_bind_property (action, "active", widget, "sensitive", 0);
|
|
6585
|
+
* ```
|
|
6586
|
+
*
|
|
6587
|
+
*
|
|
6588
|
+
* Will result in the "sensitive" property of the widget #GObject instance to be
|
|
6589
|
+
* updated with the same value of the "active" property of the action #GObject
|
|
6590
|
+
* instance.
|
|
6591
|
+
*
|
|
6592
|
+
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
|
|
6593
|
+
* if `target_property` on `target` changes then the `source_property` on `source`
|
|
6594
|
+
* will be updated as well.
|
|
6595
|
+
*
|
|
6596
|
+
* The binding will automatically be removed when either the `source` or the
|
|
6597
|
+
* `target` instances are finalized. To remove the binding without affecting the
|
|
6598
|
+
* `source` and the `target` you can just call g_object_unref() on the returned
|
|
6599
|
+
* #GBinding instance.
|
|
6600
|
+
*
|
|
6601
|
+
* Removing the binding by calling g_object_unref() on it must only be done if
|
|
6602
|
+
* the binding, `source` and `target` are only used from a single thread and it
|
|
6603
|
+
* is clear that both `source` and `target` outlive the binding. Especially it
|
|
6604
|
+
* is not safe to rely on this if the binding, `source` or `target` can be
|
|
6605
|
+
* finalized from different threads. Keep another reference to the binding and
|
|
6606
|
+
* use g_binding_unbind() instead to be on the safe side.
|
|
6607
|
+
*
|
|
6608
|
+
* A #GObject can have multiple bindings.
|
|
6609
|
+
* @param source_property the property on @source to bind
|
|
6610
|
+
* @param target the target #GObject
|
|
6611
|
+
* @param target_property the property on @target to bind
|
|
6612
|
+
* @param flags flags to pass to #GBinding
|
|
6613
|
+
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
|
|
6614
|
+
*/
|
|
6615
|
+
bind_property(
|
|
6616
|
+
source_property: string,
|
|
6617
|
+
target: GObject.Object,
|
|
6618
|
+
target_property: string,
|
|
6619
|
+
flags: GObject.BindingFlags,
|
|
6620
|
+
): GObject.Binding;
|
|
6621
|
+
/**
|
|
6622
|
+
* Complete version of g_object_bind_property().
|
|
6623
|
+
*
|
|
6624
|
+
* Creates a binding between `source_property` on `source` and `target_property`
|
|
6625
|
+
* on `target,` allowing you to set the transformation functions to be used by
|
|
6626
|
+
* the binding.
|
|
6627
|
+
*
|
|
6628
|
+
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
|
|
6629
|
+
* if `target_property` on `target` changes then the `source_property` on `source`
|
|
6630
|
+
* will be updated as well. The `transform_from` function is only used in case
|
|
6631
|
+
* of bidirectional bindings, otherwise it will be ignored
|
|
6632
|
+
*
|
|
6633
|
+
* The binding will automatically be removed when either the `source` or the
|
|
6634
|
+
* `target` instances are finalized. This will release the reference that is
|
|
6635
|
+
* being held on the #GBinding instance; if you want to hold on to the
|
|
6636
|
+
* #GBinding instance, you will need to hold a reference to it.
|
|
6637
|
+
*
|
|
6638
|
+
* To remove the binding, call g_binding_unbind().
|
|
6639
|
+
*
|
|
6640
|
+
* A #GObject can have multiple bindings.
|
|
6641
|
+
*
|
|
6642
|
+
* The same `user_data` parameter will be used for both `transform_to`
|
|
6643
|
+
* and `transform_from` transformation functions; the `notify` function will
|
|
6644
|
+
* be called once, when the binding is removed. If you need different data
|
|
6645
|
+
* for each transformation function, please use
|
|
6646
|
+
* g_object_bind_property_with_closures() instead.
|
|
6647
|
+
* @param source_property the property on @source to bind
|
|
6648
|
+
* @param target the target #GObject
|
|
6649
|
+
* @param target_property the property on @target to bind
|
|
6650
|
+
* @param flags flags to pass to #GBinding
|
|
6651
|
+
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
|
|
6652
|
+
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
|
|
6653
|
+
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
|
|
6654
|
+
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
|
|
6655
|
+
*/
|
|
6656
|
+
bind_property_full(
|
|
6657
|
+
source_property: string,
|
|
6658
|
+
target: GObject.Object,
|
|
6659
|
+
target_property: string,
|
|
6660
|
+
flags: GObject.BindingFlags,
|
|
6661
|
+
transform_to?: GObject.BindingTransformFunc | null,
|
|
6662
|
+
transform_from?: GObject.BindingTransformFunc | null,
|
|
6663
|
+
notify?: GLib.DestroyNotify | null,
|
|
6664
|
+
): GObject.Binding;
|
|
6665
|
+
// Conflicted with GObject.Object.bind_property_full
|
|
6666
|
+
bind_property_full(...args: never[]): any;
|
|
6667
|
+
/**
|
|
6668
|
+
* This function is intended for #GObject implementations to re-enforce
|
|
6669
|
+
* a [floating][floating-ref] object reference. Doing this is seldom
|
|
6670
|
+
* required: all #GInitiallyUnowneds are created with a floating reference
|
|
6671
|
+
* which usually just needs to be sunken by calling g_object_ref_sink().
|
|
6672
|
+
*/
|
|
6673
|
+
force_floating(): void;
|
|
6674
|
+
/**
|
|
6675
|
+
* Increases the freeze count on `object`. If the freeze count is
|
|
6676
|
+
* non-zero, the emission of "notify" signals on `object` is
|
|
6677
|
+
* stopped. The signals are queued until the freeze count is decreased
|
|
6678
|
+
* to zero. Duplicate notifications are squashed so that at most one
|
|
6679
|
+
* #GObject::notify signal is emitted for each property modified while the
|
|
6680
|
+
* object is frozen.
|
|
6681
|
+
*
|
|
6682
|
+
* This is necessary for accessors that modify multiple properties to prevent
|
|
6683
|
+
* premature notification while the object is still being modified.
|
|
6684
|
+
*/
|
|
6685
|
+
freeze_notify(): void;
|
|
6686
|
+
/**
|
|
6687
|
+
* Gets a named field from the objects table of associations (see g_object_set_data()).
|
|
6688
|
+
* @param key name of the key for that association
|
|
6689
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
6690
|
+
*/
|
|
6691
|
+
get_data(key: string): any | null;
|
|
6692
|
+
get_property(property_name: string): any;
|
|
6693
|
+
/**
|
|
6694
|
+
* This function gets back user data pointers stored via
|
|
6695
|
+
* g_object_set_qdata().
|
|
6696
|
+
* @param quark A #GQuark, naming the user data pointer
|
|
6697
|
+
* @returns The user data pointer set, or %NULL
|
|
6698
|
+
*/
|
|
6699
|
+
get_qdata(quark: GLib.Quark): any | null;
|
|
6700
|
+
/**
|
|
6701
|
+
* Gets `n_properties` properties for an `object`.
|
|
6702
|
+
* Obtained properties will be set to `values`. All properties must be valid.
|
|
6703
|
+
* Warnings will be emitted and undefined behaviour may result if invalid
|
|
6704
|
+
* properties are passed in.
|
|
6705
|
+
* @param names the names of each property to get
|
|
6706
|
+
* @param values the values of each property to get
|
|
6707
|
+
*/
|
|
6708
|
+
getv(names: string[], values: (GObject.Value | any)[]): void;
|
|
6709
|
+
/**
|
|
6710
|
+
* Checks whether `object` has a [floating][floating-ref] reference.
|
|
6711
|
+
* @returns %TRUE if @object has a floating reference
|
|
6712
|
+
*/
|
|
6713
|
+
is_floating(): boolean;
|
|
6714
|
+
/**
|
|
6715
|
+
* Emits a "notify" signal for the property `property_name` on `object`.
|
|
6716
|
+
*
|
|
6717
|
+
* When possible, eg. when signaling a property change from within the class
|
|
6718
|
+
* that registered the property, you should use g_object_notify_by_pspec()
|
|
6719
|
+
* instead.
|
|
6720
|
+
*
|
|
6721
|
+
* Note that emission of the notify signal may be blocked with
|
|
6722
|
+
* g_object_freeze_notify(). In this case, the signal emissions are queued
|
|
6723
|
+
* and will be emitted (in reverse order) when g_object_thaw_notify() is
|
|
6724
|
+
* called.
|
|
6725
|
+
* @param property_name the name of a property installed on the class of @object.
|
|
6726
|
+
*/
|
|
6727
|
+
notify(property_name: string): void;
|
|
6728
|
+
/**
|
|
6729
|
+
* Emits a "notify" signal for the property specified by `pspec` on `object`.
|
|
6730
|
+
*
|
|
6731
|
+
* This function omits the property name lookup, hence it is faster than
|
|
6732
|
+
* g_object_notify().
|
|
6733
|
+
*
|
|
6734
|
+
* One way to avoid using g_object_notify() from within the
|
|
6735
|
+
* class that registered the properties, and using g_object_notify_by_pspec()
|
|
6736
|
+
* instead, is to store the GParamSpec used with
|
|
6737
|
+
* g_object_class_install_property() inside a static array, e.g.:
|
|
6738
|
+
*
|
|
6739
|
+
*
|
|
6740
|
+
* ```c
|
|
6741
|
+
* typedef enum
|
|
6742
|
+
* {
|
|
6743
|
+
* PROP_FOO = 1,
|
|
6744
|
+
* PROP_LAST
|
|
6745
|
+
* } MyObjectProperty;
|
|
6746
|
+
*
|
|
6747
|
+
* static GParamSpec *properties[PROP_LAST];
|
|
6748
|
+
*
|
|
6749
|
+
* static void
|
|
6750
|
+
* my_object_class_init (MyObjectClass *klass)
|
|
6751
|
+
* {
|
|
6752
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
5676
6753
|
* 0, 100,
|
|
5677
6754
|
* 50,
|
|
5678
6755
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -6736,7 +7813,7 @@ export namespace Gda {
|
|
|
6736
7813
|
* static void
|
|
6737
7814
|
* my_object_class_init (MyObjectClass *klass)
|
|
6738
7815
|
* {
|
|
6739
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
7816
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
6740
7817
|
* 0, 100,
|
|
6741
7818
|
* 50,
|
|
6742
7819
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -7883,7 +8960,7 @@ export namespace Gda {
|
|
|
7883
8960
|
* static void
|
|
7884
8961
|
* my_object_class_init (MyObjectClass *klass)
|
|
7885
8962
|
* {
|
|
7886
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
8963
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
7887
8964
|
* 0, 100,
|
|
7888
8965
|
* 50,
|
|
7889
8966
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -9180,7 +10257,7 @@ export namespace Gda {
|
|
|
9180
10257
|
* static void
|
|
9181
10258
|
* my_object_class_init (MyObjectClass *klass)
|
|
9182
10259
|
* {
|
|
9183
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
10260
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
9184
10261
|
* 0, 100,
|
|
9185
10262
|
* 50,
|
|
9186
10263
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -10284,7 +11361,7 @@ export namespace Gda {
|
|
|
10284
11361
|
* static void
|
|
10285
11362
|
* my_object_class_init (MyObjectClass *klass)
|
|
10286
11363
|
* {
|
|
10287
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
11364
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
10288
11365
|
* 0, 100,
|
|
10289
11366
|
* 50,
|
|
10290
11367
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -11663,7 +12740,7 @@ export namespace Gda {
|
|
|
11663
12740
|
* static void
|
|
11664
12741
|
* my_object_class_init (MyObjectClass *klass)
|
|
11665
12742
|
* {
|
|
11666
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
12743
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
11667
12744
|
* 0, 100,
|
|
11668
12745
|
* 50,
|
|
11669
12746
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -12927,7 +14004,7 @@ export namespace Gda {
|
|
|
12927
14004
|
* static void
|
|
12928
14005
|
* my_object_class_init (MyObjectClass *klass)
|
|
12929
14006
|
* {
|
|
12930
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
14007
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
12931
14008
|
* 0, 100,
|
|
12932
14009
|
* 50,
|
|
12933
14010
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -13442,7 +14519,7 @@ export namespace Gda {
|
|
|
13442
14519
|
* static void
|
|
13443
14520
|
* my_object_class_init (MyObjectClass *klass)
|
|
13444
14521
|
* {
|
|
13445
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
14522
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
13446
14523
|
* 0, 100,
|
|
13447
14524
|
* 50,
|
|
13448
14525
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -13957,7 +15034,7 @@ export namespace Gda {
|
|
|
13957
15034
|
* static void
|
|
13958
15035
|
* my_object_class_init (MyObjectClass *klass)
|
|
13959
15036
|
* {
|
|
13960
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
15037
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
13961
15038
|
* 0, 100,
|
|
13962
15039
|
* 50,
|
|
13963
15040
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -14472,7 +15549,7 @@ export namespace Gda {
|
|
|
14472
15549
|
* static void
|
|
14473
15550
|
* my_object_class_init (MyObjectClass *klass)
|
|
14474
15551
|
* {
|
|
14475
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
15552
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
14476
15553
|
* 0, 100,
|
|
14477
15554
|
* 50,
|
|
14478
15555
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -14994,7 +16071,7 @@ export namespace Gda {
|
|
|
14994
16071
|
* static void
|
|
14995
16072
|
* my_object_class_init (MyObjectClass *klass)
|
|
14996
16073
|
* {
|
|
14997
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
16074
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
14998
16075
|
* 0, 100,
|
|
14999
16076
|
* 50,
|
|
15000
16077
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -15566,7 +16643,7 @@ export namespace Gda {
|
|
|
15566
16643
|
* static void
|
|
15567
16644
|
* my_object_class_init (MyObjectClass *klass)
|
|
15568
16645
|
* {
|
|
15569
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
16646
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
15570
16647
|
* 0, 100,
|
|
15571
16648
|
* 50,
|
|
15572
16649
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -16081,7 +17158,7 @@ export namespace Gda {
|
|
|
16081
17158
|
* static void
|
|
16082
17159
|
* my_object_class_init (MyObjectClass *klass)
|
|
16083
17160
|
* {
|
|
16084
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
17161
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
16085
17162
|
* 0, 100,
|
|
16086
17163
|
* 50,
|
|
16087
17164
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -16859,7 +17936,7 @@ export namespace Gda {
|
|
|
16859
17936
|
* static void
|
|
16860
17937
|
* my_object_class_init (MyObjectClass *klass)
|
|
16861
17938
|
* {
|
|
16862
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
17939
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
16863
17940
|
* 0, 100,
|
|
16864
17941
|
* 50,
|
|
16865
17942
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -19118,7 +20195,7 @@ export namespace Gda {
|
|
|
19118
20195
|
* static void
|
|
19119
20196
|
* my_object_class_init (MyObjectClass *klass)
|
|
19120
20197
|
* {
|
|
19121
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
20198
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
19122
20199
|
* 0, 100,
|
|
19123
20200
|
* 50,
|
|
19124
20201
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -20568,6 +21645,15 @@ export namespace Gda {
|
|
|
20568
21645
|
_init(...args: any[]): void;
|
|
20569
21646
|
}
|
|
20570
21647
|
|
|
21648
|
+
type DataModelBdbClass = typeof DataModelBdb;
|
|
21649
|
+
abstract class DataModelBdbPrivate {
|
|
21650
|
+
static $gtype: GObject.GType<DataModelBdbPrivate>;
|
|
21651
|
+
|
|
21652
|
+
// Constructors of Gda.DataModelBdbPrivate
|
|
21653
|
+
|
|
21654
|
+
_init(...args: any[]): void;
|
|
21655
|
+
}
|
|
21656
|
+
|
|
20571
21657
|
type DataModelDirClass = typeof DataModelDir;
|
|
20572
21658
|
abstract class DataModelDirPrivate {
|
|
20573
21659
|
static $gtype: GObject.GType<DataModelDirPrivate>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@girs/gda-5.0",
|
|
3
|
-
"version": "5.0.0-4.0.0-beta.
|
|
3
|
+
"version": "5.0.0-4.0.0-beta.3",
|
|
4
4
|
"description": "GJS TypeScript type definitions for Gda-5.0, generated from library version 5.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "gda-5.0.js",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"test": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit gda-5.0.d.ts"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@girs/gjs": "^4.0.0-beta.
|
|
30
|
-
"@girs/glib-2.0": "^2.80.0-4.0.0-beta.
|
|
31
|
-
"@girs/gobject-2.0": "^2.80.0-4.0.0-beta.
|
|
32
|
-
"@girs/libxml2-2.0": "^2.0.0-4.0.0-beta.
|
|
29
|
+
"@girs/gjs": "^4.0.0-beta.3",
|
|
30
|
+
"@girs/glib-2.0": "^2.80.0-4.0.0-beta.3",
|
|
31
|
+
"@girs/gobject-2.0": "^2.80.0-4.0.0-beta.3",
|
|
32
|
+
"@girs/libxml2-2.0": "^2.0.0-4.0.0-beta.3"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"typescript": "*"
|