root/trunk/src/gio/InitableIF.d

Revision 938, 5.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  = GInitable.html
27  * outPack = gio
28  * outFile = InitableIF
29  * strct   = GInitable
30  * realStrct=
31  * ctorStrct=
32  * clss    = InitableT
33  * interf  = InitableIF
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.Cancellable
51  * structWrap:
52  *  - GCancellable* -> Cancellable
53  *  - GObject* -> ObjectG
54  * module aliases:
55  * local aliases:
56  * overrides:
57  */
58
59 module gio.InitableIF;
60
61 public  import gtkc.giotypes;
62
63 private import gtkc.gio;
64 private import glib.ConstructionException;
65
66
67 private import glib.Str;
68 private import glib.ErrorG;
69 private import glib.GException;
70 private import gobject.ObjectG;
71 private import gio.Cancellable;
72
73
74
75
76 /**
77  * Description
78  * GInitable is implemented by objects that can fail during
79  * initialization. If an object implements this interface the
80  * g_initable_init() function must be called as the first thing
81  * after construction. If g_initable_init() is not called, or if
82  * it returns an error, all further operations on the object
83  * should fail, generally with a G_IO_ERROR_NOT_INITIALIZED error.
84  * Users of objects implementing this are not intended to use
85  * the interface method directly, instead it will be used automatically
86  * in various ways. For C applications you generally just call
87  * g_initable_new() directly, or indirectly via a foo_thing_new() wrapper.
88  * This will call g_initable_init() under the cover, returning NULL and
89  * setting a GError on failure (at which point the instance is
90  * unreferenced).
91  * For bindings in languages where the native constructor supports
92  * exceptions the binding could check for objects implemention GInitable
93  * during normal construction and automatically initialize them, throwing
94  * an exception on failure.
95  */
96 public interface InitableIF
97 {
98    
99    
100     public GInitable* getInitableTStruct();
101    
102     /** the main Gtk struct as a void* */
103     protected void* getStruct();
104    
105    
106     /**
107      */
108    
109     /**
110      * Initializes the object implementing the interface. This must be
111      * done before any real use of the object after initial construction.
112      * Implementations may also support cancellation. If cancellable is not NULL,
113      * then initialization can be cancelled by triggering the cancellable object
114      * from another thread. If the operation was cancelled, the error
115      * G_IO_ERROR_CANCELLED will be returned. If cancellable is not NULL and
116      * the object doesn't support cancellable initialization the error
117      * G_IO_ERROR_NOT_SUPPORTED will be returned.
118      * If this function is not called, or returns with an error then all
119      * operations on the object should fail, generally returning the
120      * error G_IO_ERROR_NOT_INITIALIZED.
121      * Implementations of this method must be idempotent, i.e. multiple calls
122      * to this function with the same argument should return the same results.
123      * Only the first call initializes the object, further calls return the result
124      * of the first call. This is so that its safe to implement the singleton
125      * pattern in the GObject constructor function.
126      * Since 2.22
127      * Params:
128      * cancellable = optional GCancellable object, NULL to ignore.
129      * Returns: TRUE if successful. If an error has occurred, this function will return FALSE and set error appropriately if present.
130      * Throws: GException on failure.
131      */
132     public int init(Cancellable cancellable);
133    
134     /**
135      * Helper function for constructing GInitiable object. This is
136      * similar to g_object_new_valist() but also initializes the object
137      * and returns NULL, setting an error on failure.
138      * Since 2.22
139      * Params:
140      * objectType = a GType supporting GInitable.
141      * firstPropertyName = the name of the first property, followed by
142      * the value, and other property value pairs, and ended by NULL.
143      * varArgs = The var args list generated from first_property_name.
144      * cancellable = optional GCancellable object, NULL to ignore.
145      * Returns: a newly allocated GObject, or NULL on error. [transfer full]
146      * Throws: GException on failure.
147      */
148     public static ObjectG newValist(GType objectType, string firstPropertyName, void* varArgs, Cancellable cancellable);
149    
150     /**
151      * Helper function for constructing GInitiable object. This is
152      * similar to g_object_newv() but also initializes the object
153      * and returns NULL, setting an error on failure.
154      * Since 2.22
155      * Params:
156      * objectType = a GType supporting GInitable.
157      * parameters = the parameters to use to construct the object
158      * cancellable = optional GCancellable object, NULL to ignore.
159      * Returns: a newly allocated GObject, or NULL on error. [transfer full]
160      * Throws: GException on failure.
161      */
162     public static void* newv(GType objectType, GParameter[] parameters, Cancellable cancellable);
163 }
Note: See TracBrowser for help on using the browser.