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