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 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  * This is the asynchronous version of GInitable; it behaves the same
80  * in all ways except that initialization is asynchronous. For more details
81  * see the descriptions on GInitable.
82  *
83  * A class may implement both the GInitable and GAsyncInitable interfaces.
84  *
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  *
92  * A typical implementation might look something like this:
93  *
94  * $(DDOC_COMMENT example)
95  */
96 public interface AsyncInitableIF
97 {
98 	
99 	
100 	/** Get the main Gtk struct */
101 	public GAsyncInitable* getAsyncInitableTStruct();
102 	
103 	/** the main Gtk struct as a void* */
104 	protected void* getStruct();
105 	
106 	
107 	/**
108 	 */
109 	
110 	/**
111 	 * Starts asynchronous initialization of the object implementing the
112 	 * interface. This must be done before any real use of the object after
113 	 * initial construction. If the object also implements GInitable you can
114 	 * optionally call g_initable_init() instead.
115 	 * When the initialization is finished, callback will be called. You can
116 	 * then call g_async_initable_init_finish() to get the result of the
117 	 * initialization.
118 	 * Implementations may also support cancellation. If cancellable is not
119 	 * NULL, then initialization can be cancelled by triggering the cancellable
120 	 * object from another thread. If the operation was cancelled, the error
121 	 * G_IO_ERROR_CANCELLED will be returned. If cancellable is not NULL, and
122 	 * the object doesn't support cancellable initialization, the error
123 	 * G_IO_ERROR_NOT_SUPPORTED will be returned.
124 	 * As with GInitable, if the object is not initialized, or initialization
125 	 * Since 2.22
126 	 * Params:
127 	 * ioPriority = the I/O priority
128 	 * of the operation.
129 	 * cancellable = optional GCancellable object, NULL to ignore.
130 	 * callback = a GAsyncReadyCallback to call when the request is satisfied
131 	 * userData = the data to pass to callback function
132 	 * 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.
133 	 */
134 	public void gAsyncInitableInitAsync(int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
135 	
136 	/**
137 	 * Finishes asynchronous initialization and returns the result.
138 	 * See g_async_initable_init_async().
139 	 * Since 2.22
140 	 * Params:
141 	 * res = a GAsyncResult.
142 	 * Returns: TRUE if successful. If an error has occurred, this function will return FALSE and set error appropriately if present.
143 	 * Throws: GException on failure.
144 	 */
145 	public int gAsyncInitableInitFinish(AsyncResultIF res);
146 	
147 	/**
148 	 * Finishes the async construction for the various g_async_initable_new
149 	 * calls, returning the created object or NULL on error.
150 	 * Since 2.22
151 	 * Params:
152 	 * res = the GAsyncResult from the callback
153 	 * Returns: a newly created GObject, or NULL on error. Free with g_object_unref(). [type GObject.Object][transfer full]
154 	 * Throws: GException on failure.
155 	 */
156 	public ObjectG gAsyncInitableNewFinish(AsyncResultIF res);
157 	
158 	/**
159 	 * Helper function for constructing GAsyncInitable object. This is
160 	 * similar to g_object_new_valist() but also initializes the object
161 	 * asynchronously.
162 	 * When the initialization is finished, callback will be called. You can
163 	 * then call g_async_initable_new_finish() to get the new object and check
164 	 * for any errors.
165 	 * Since 2.22
166 	 * Params:
167 	 * objectType = a GType supporting GAsyncInitable.
168 	 * firstPropertyName = the name of the first property, followed by
169 	 * the value, and other property value pairs, and ended by NULL.
170 	 * varArgs = The var args list generated from first_property_name.
171 	 * ioPriority = the I/O priority
172 	 * of the operation.
173 	 * cancellable = optional GCancellable object, NULL to ignore.
174 	 * callback = a GAsyncReadyCallback to call when the initialization is
175 	 * finished
176 	 * userData = the data to pass to callback function
177 	 */
178 	public static void gAsyncInitableNewValistAsync(GType objectType, string firstPropertyName, void* varArgs, int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
179 	
180 	/**
181 	 * Helper function for constructing GAsyncInitable object. This is
182 	 * similar to g_object_newv() but also initializes the object asynchronously.
183 	 * When the initialization is finished, callback will be called. You can
184 	 * then call g_async_initable_new_finish() to get the new object and check
185 	 * for any errors.
186 	 * Since 2.22
187 	 * Params:
188 	 * objectType = a GType supporting GAsyncInitable.
189 	 * parameters = the parameters to use to construct the object
190 	 * ioPriority = the I/O priority
191 	 * of the operation.
192 	 * cancellable = optional GCancellable object, NULL to ignore.
193 	 * callback = a GAsyncReadyCallback to call when the initialization is
194 	 * finished
195 	 * userData = the data to pass to callback function
196 	 */
197 	public static void gAsyncInitableNewvAsync(GType objectType, GParameter[] parameters, int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
198 }