root/trunk/src/gio/AsyncInitableIF.d

Revision 938, 7.7 kB (checked in by Mike Wey, 3 months ago)

Update Gio to 2.28.

Line 
1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19  
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23
24 /*
25  * Conversion parameters:
26  * inFile  = GAsyncInitable.html
27  * outPack = gio
28  * outFile = AsyncInitableIF
29  * strct   = GAsyncInitable
30  * realStrct=
31  * ctorStrct=
32  * clss    = AsyncInitableT
33  * interf  = AsyncInitableIF
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  =
38  * implements:
39  * prefixes:
40  *  - g_initable_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  *  - glib.Str
47  *  - glib.ErrorG
48  *  - glib.GException
49  *  - gobject.ObjectG
50  *  - gio.AsyncResultIF
51  *  - gio.Cancellable
52  * structWrap:
53  *  - GAsyncResult* -> AsyncResultIF
54  *  - GCancellable* -> Cancellable
55  *  - GObject* -> ObjectG
56  * module aliases:
57  * local aliases:
58  * overrides:
59  */
60
61 module gio.AsyncInitableIF;
62
63 public  import gtkc.giotypes;
64
65 private import gtkc.gio;
66 private import glib.ConstructionException;
67
68
69 private import glib.Str;
70 private import glib.ErrorG;
71 private import glib.GException;
72 private import gobject.ObjectG;
73 private import gio.AsyncResultIF;
74 private import gio.Cancellable;
75
76
77
78
79 /**
80  * Description
81  * This is the asynchronous version of GInitable; it behaves the same
82  * in all ways except that initialization is asynchronous. For more details
83  * see the descriptions on GInitable.
84  * A class may implement both the GInitable and GAsyncInitable interfaces.
85  * Users of objects implementing this are not intended to use the interface
86  * method directly; instead it will be used automatically in various ways.
87  * For C applications you generally just call g_async_initable_new_async()
88  * directly, or indirectly via a foo_thing_new_async() wrapper. This will call
89  * g_async_initable_init_async() under the cover, calling back with NULL and
90  * a set GError on failure.
91  * A typical implementation might look something like this:
92  * $(DDOC_COMMENT example)
93  */
94 public interface AsyncInitableIF
95 {
96    
97    
98     public GAsyncInitable* getAsyncInitableTStruct();
99    
100     /** the main Gtk struct as a void* */
101     protected void* getStruct();
102    
103    
104     /**
105      */
106    
107     /**
108      * Starts asynchronous initialization of the object implementing the
109      * interface. This must be done before any real use of the object after
110      * initial construction. If the object also implements GInitable you can
111      * optionally call g_initable_init() instead.
112      * When the initialization is finished, callback will be called. You can
113      * then call g_async_initable_init_finish() to get the result of the
114      * initialization.
115      * Implementations may also support cancellation. If cancellable is not
116      * NULL, then initialization can be cancelled by triggering the cancellable
117      * object from another thread. If the operation was cancelled, the error
118      * G_IO_ERROR_CANCELLED will be returned. If cancellable is not NULL, and
119      * the object doesn't support cancellable initialization, the error
120      * G_IO_ERROR_NOT_SUPPORTED will be returned.
121      * If this function is not called, or returns with an error, then all
122      * operations on the object should fail, generally returning the
123      * error G_IO_ERROR_NOT_INITIALIZED.
124      * Implementations of this method must be idempotent: i.e. multiple calls
125      * to this function with the same argument should return the same results.
126      * Only the first call initializes the object; further calls return the result
127      * of the first call. This is so that it's safe to implement the singleton
128      * pattern in the GObject constructor function.
129      * For classes that also support the GInitable interface, the default
130      * implementation of this method will run the g_initable_init() function
131      * in a thread, so if you want to support asynchronous initialization via
132      * threads, just implement the GAsyncInitable interface without overriding
133      * any interface methods.
134      * Since 2.22
135      * Params:
136      * ioPriority = the I/O priority
137      * of the operation.
138      * cancellable = optional GCancellable object, NULL to ignore.
139      * callback = a GAsyncReadyCallback to call when the request is satisfied
140      * userData = the data to pass to callback function
141      */
142     public void gAsyncInitableInitAsync(int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
143    
144     /**
145      * Finishes asynchronous initialization and returns the result.
146      * See g_async_initable_init_async().
147      * Since 2.22
148      * Params:
149      * res = a GAsyncResult.
150      * Returns: TRUE if successful. If an error has occurred, this function will return FALSE and set error appropriately if present.
151      * Throws: GException on failure.
152      */
153     public int gAsyncInitableInitFinish(AsyncResultIF res);
154    
155     /**
156      * Finishes the async construction for the various g_async_initable_new calls,
157      * returning the created object or NULL on error.
158      * Since 2.22
159      * Params:
160      * res = the GAsyncResult.from the callback
161      * Returns: a newly created GObject, or NULL on error. Free with g_object_unref(). [transfer full]
162      * Throws: GException on failure.
163      */
164     public ObjectG gAsyncInitableNewFinish(AsyncResultIF res);
165    
166     /**
167      * Helper function for constructing GAsyncInitiable object. This is
168      * similar to g_object_new_valist() but also initializes the object
169      * asynchronously.
170      * When the initialization is finished, callback will be called. You can
171      * then call g_async_initable_new_finish() to get the new object and check
172      * for any errors.
173      * Since 2.22
174      * Params:
175      * objectType = a GType supporting GAsyncInitable.
176      * firstPropertyName = the name of the first property, followed by
177      * the value, and other property value pairs, and ended by NULL.
178      * varArgs = The var args list generated from first_property_name.
179      * ioPriority = the I/O priority
180      * of the operation.
181      * cancellable = optional GCancellable object, NULL to ignore.
182      * callback = a GAsyncReadyCallback to call when the initialization is
183      * finished
184      * userData = the data to pass to callback function
185      */
186     public static void gAsyncInitableNewValistAsync(GType objectType, string firstPropertyName, void* varArgs, int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
187    
188     /**
189      * Helper function for constructing GAsyncInitiable object. This is
190      * similar to g_object_newv() but also initializes the object asynchronously.
191      * When the initialization is finished, callback will be called. You can
192      * then call g_async_initable_new_finish() to get the new object and check
193      * for any errors.
194      * Since 2.22
195      * Params:
196      * objectType = a GType supporting GAsyncInitable.
197      * parameters = the parameters to use to construct the object
198      * ioPriority = the I/O priority
199      * of the operation.
200      * cancellable = optional GCancellable object, NULL to ignore.
201      * callback = a GAsyncReadyCallback to call when the initialization is
202      * finished
203      * userData = the data to pass to callback function
204      */
205     public static void gAsyncInitableNewvAsync(GType objectType, GParameter[] parameters, int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
206 }
Note: See TracBrowser for help on using the browser.