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 = GAsyncResult.html 27 * outPack = gio 28 * outFile = AsyncResultIF 29 * strct = GAsyncResult 30 * realStrct= 31 * ctorStrct= 32 * clss = AsyncResultT 33 * interf = AsyncResultIF 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - g_async_result_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - gobject.ObjectG 47 * - glib.ErrorG 48 * - glib.GException 49 * structWrap: 50 * - GObject* -> ObjectG 51 * module aliases: 52 * local aliases: 53 * overrides: 54 */ 55 56 module gio.AsyncResultIF; 57 58 public import gtkc.giotypes; 59 60 private import gtkc.gio; 61 private import glib.ConstructionException; 62 private import gobject.ObjectG; 63 64 private import gobject.ObjectG; 65 private import glib.ErrorG; 66 private import glib.GException; 67 68 69 70 /** 71 * Provides a base class for implementing asynchronous function results. 72 * 73 * Asynchronous operations are broken up into two separate operations 74 * which are chained together by a GAsyncReadyCallback. To begin 75 * an asynchronous operation, provide a GAsyncReadyCallback to the 76 * asynchronous function. This callback will be triggered when the 77 * operation has completed, and will be passed a GAsyncResult instance 78 * filled with the details of the operation's success or failure, the 79 * object the asynchronous function was started for and any error codes 80 * returned. The asynchronous callback function is then expected to call 81 * the corresponding "_finish()" function, passing the object the 82 * function was called for, the GAsyncResult instance, and (optionally) 83 * an error to grab any error conditions that may have occurred. 84 * 85 * The "_finish()" function for an operation takes the generic result 86 * (of type GAsyncResult) and returns the specific result that the 87 * operation in question yields (e.g. a GFileEnumerator for a 88 * "enumerate children" operation). If the result or error status of the 89 * operation is not needed, there is no need to call the "_finish()" 90 * function; GIO will take care of cleaning up the result and error 91 * information after the GAsyncReadyCallback returns. You can pass 92 * NULL for the GAsyncReadyCallback if you don't need to take any 93 * action at all after the operation completes. Applications may also 94 * take a reference to the GAsyncResult and call "_finish()" later; 95 * however, the "_finish()" function may be called at most once. 96 * 97 * Example of a typical asynchronous operation flow: 98 * 99 * $(DDOC_COMMENT example) 100 * 101 * The callback for an asynchronous operation is called only once, and is 102 * always called, even in the case of a cancelled operation. On cancellation 103 * the result is a G_IO_ERROR_CANCELLED error. 104 * 105 * Many I/O-related asynchronous 106 * operations have a priority parameter, which is used in certain 107 * cases to determine the order in which operations are executed. They 108 * are not used to determine system-wide I/O 109 * scheduling. Priorities are integers, with lower numbers indicating 110 * higher priority. It is recommended to choose priorities between 111 * G_PRIORITY_LOW and G_PRIORITY_HIGH, with G_PRIORITY_DEFAULT as a 112 * default. 113 */ 114 public interface AsyncResultIF 115 { 116 117 118 /** Get the main Gtk struct */ 119 public GAsyncResult* getAsyncResultTStruct(); 120 121 /** the main Gtk struct as a void* */ 122 protected void* getStruct(); 123 124 125 /** 126 */ 127 128 /** 129 * Gets the user data from a GAsyncResult. 130 * Returns: the user data for res. [transfer full] 131 */ 132 public void* getUserData(); 133 134 /** 135 * Gets the source object from a GAsyncResult. 136 * Returns: a new reference to the source object for the res, or NULL if there is none. [transfer full] 137 */ 138 public ObjectG getSourceObject(); 139 140 /** 141 * Checks if res has the given source_tag (generally a function 142 * pointer indicating the function res was created by). 143 * Since 2.34 144 * Params: 145 * sourceTag = an application-defined tag 146 * Returns: TRUE if res has the indicated source_tag, FALSE if not. 147 */ 148 public int isTagged(void* sourceTag); 149 150 /** 151 * If res is a GSimpleAsyncResult, this is equivalent to 152 * g_simple_async_result_propagate_error(). Otherwise it returns 153 * FALSE. 154 * This can be used for legacy error handling in async 155 * _finish() wrapper functions that traditionally 156 * handled GSimpleAsyncResult error returns themselves rather than 157 * calling into the virtual method. This should not be used in new 158 * code; GAsyncResult errors that are set by virtual methods should 159 * also be extracted by virtual methods, to enable subclasses to chain 160 * up correctly. 161 * Since 2.34 162 * Returns: TRUE if error is has been filled in with an error from res, FALSE if not. 163 */ 164 public int legacyPropagateError(); 165 }