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 private import gobject.ObjectG;
68 
69 
70 private import glib.Str;
71 private import glib.ErrorG;
72 private import glib.GException;
73 private import gobject.ObjectG;
74 private import gio.AsyncResultIF;
75 private import gio.Cancellable;
76 
77 
78 
79 
80 /**
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  *
85  * A class may implement both the GInitable and GAsyncInitable interfaces.
86  *
87  * Users of objects implementing this are not intended to use the interface
88  * method directly; instead it will be used automatically in various ways.
89  * For C applications you generally just call g_async_initable_new_async()
90  * directly, or indirectly via a foo_thing_new_async() wrapper. This will call
91  * g_async_initable_init_async() under the cover, calling back with NULL and
92  * a set GError on failure.
93  *
94  * A typical implementation might look something like this:
95  *
96  * $(DDOC_COMMENT example)
97  */
98 public interface AsyncInitableIF
99 {
100 	
101 	
102 	public GAsyncInitable* getAsyncInitableTStruct();
103 	
104 	/** the main Gtk struct as a void* */
105 	protected void* getStruct();
106 	
107 	
108 	/**
109 	 */
110 	
111 	/**
112 	 * Starts asynchronous initialization of the object implementing the
113 	 * interface. This must be done before any real use of the object after
114 	 * initial construction. If the object also implements GInitable you can
115 	 * optionally call g_initable_init() instead.
116 	 * When the initialization is finished, callback will be called. You can
117 	 * then call g_async_initable_init_finish() to get the result of the
118 	 * initialization.
119 	 * Implementations may also support cancellation. If cancellable is not
120 	 * NULL, then initialization can be cancelled by triggering the cancellable
121 	 * object from another thread. If the operation was cancelled, the error
122 	 * G_IO_ERROR_CANCELLED will be returned. If cancellable is not NULL, and
123 	 * the object doesn't support cancellable initialization, the error
124 	 * G_IO_ERROR_NOT_SUPPORTED will be returned.
125 	 * As with GInitable, if the object is not initialized, or initialization
126 	 * Since 2.22
127 	 * Params:
128 	 * ioPriority = the I/O priority
129 	 * of the operation.
130 	 * cancellable = optional GCancellable object, NULL to ignore.
131 	 * callback = a GAsyncReadyCallback to call when the request is satisfied
132 	 * userData = the data to pass to callback function
133 	 * Returns: with an error, then all operations on the object except g_object_ref() and g_object_unref() are considered to be invalid, and have undefined behaviour. They will often fail with g_critical() or g_warning(), but this must not be relied on. Implementations of this method must be idempotent: i.e. multiple calls to this function with the same argument should return the same results. Only the first call initializes the object; further calls return the result of the first call. This is so that it's safe to implement the singleton pattern in the GObject constructor function. For classes that also support the GInitable interface, the default implementation of this method will run the g_initable_init() function in a thread, so if you want to support asynchronous initialization via threads, just implement the GAsyncInitable interface without overriding any interface methods.
134 	 */
135 	public void gAsyncInitableInitAsync(int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
136 	
137 	/**
138 	 * Finishes asynchronous initialization and returns the result.
139 	 * See g_async_initable_init_async().
140 	 * Since 2.22
141 	 * Params:
142 	 * res = a GAsyncResult.
143 	 * Returns: TRUE if successful. If an error has occurred, this function will return FALSE and set error appropriately if present.
144 	 * Throws: GException on failure.
145 	 */
146 	public int gAsyncInitableInitFinish(AsyncResultIF res);
147 	
148 	/**
149 	 * Finishes the async construction for the various g_async_initable_new
150 	 * calls, returning the created object or NULL on error.
151 	 * Since 2.22
152 	 * Params:
153 	 * res = the GAsyncResult from the callback
154 	 * Returns: a newly created GObject, or NULL on error. Free with g_object_unref(). [type GObject.Object][transfer full]
155 	 * Throws: GException on failure.
156 	 */
157 	public ObjectG gAsyncInitableNewFinish(AsyncResultIF res);
158 	
159 	/**
160 	 * Helper function for constructing GAsyncInitable object. This is
161 	 * similar to g_object_new_valist() but also initializes the object
162 	 * asynchronously.
163 	 * When the initialization is finished, callback will be called. You can
164 	 * then call g_async_initable_new_finish() to get the new object and check
165 	 * for any errors.
166 	 * Since 2.22
167 	 * Params:
168 	 * objectType = a GType supporting GAsyncInitable.
169 	 * firstPropertyName = the name of the first property, followed by
170 	 * the value, and other property value pairs, and ended by NULL.
171 	 * varArgs = The var args list generated from first_property_name.
172 	 * ioPriority = the I/O priority
173 	 * of the operation.
174 	 * cancellable = optional GCancellable object, NULL to ignore.
175 	 * callback = a GAsyncReadyCallback to call when the initialization is
176 	 * finished
177 	 * userData = the data to pass to callback function
178 	 */
179 	public static void gAsyncInitableNewValistAsync(GType objectType, string firstPropertyName, void* varArgs, int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
180 	
181 	/**
182 	 * Helper function for constructing GAsyncInitable object. This is
183 	 * similar to g_object_newv() but also initializes the object asynchronously.
184 	 * When the initialization is finished, callback will be called. You can
185 	 * then call g_async_initable_new_finish() to get the new object and check
186 	 * for any errors.
187 	 * Since 2.22
188 	 * Params:
189 	 * objectType = a GType supporting GAsyncInitable.
190 	 * parameters = the parameters to use to construct the object
191 	 * ioPriority = the I/O priority
192 	 * of the operation.
193 	 * cancellable = optional GCancellable object, NULL to ignore.
194 	 * callback = a GAsyncReadyCallback to call when the initialization is
195 	 * finished
196 	 * userData = the data to pass to callback function
197 	 */
198 	public static void gAsyncInitableNewvAsync(GType objectType, GParameter[] parameters, int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
199 }