| 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 |
* structWrap: |
|---|
| 48 |
* - GObject* -> ObjectG |
|---|
| 49 |
* module aliases: |
|---|
| 50 |
* local aliases: |
|---|
| 51 |
* overrides: |
|---|
| 52 |
*/ |
|---|
| 53 |
|
|---|
| 54 |
module gio.AsyncResultIF; |
|---|
| 55 |
|
|---|
| 56 |
public import gtkc.giotypes; |
|---|
| 57 |
|
|---|
| 58 |
private import gtkc.gio; |
|---|
| 59 |
private import glib.ConstructionException; |
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 |
private import gobject.ObjectG; |
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 |
/** |
|---|
| 68 |
* Description |
|---|
| 69 |
* Provides a base class for implementing asynchronous function results. |
|---|
| 70 |
* Asynchronous operations are broken up into two separate operations |
|---|
| 71 |
* which are chained together by a GAsyncReadyCallback. To begin |
|---|
| 72 |
* an asynchronous operation, provide a GAsyncReadyCallback to the |
|---|
| 73 |
* asynchronous function. This callback will be triggered when the |
|---|
| 74 |
* operation has completed, and will be passed a GAsyncResult instance |
|---|
| 75 |
* filled with the details of the operation's success or failure, the |
|---|
| 76 |
* object the asynchronous function was started for and any error codes |
|---|
| 77 |
* returned. The asynchronous callback function is then expected to call |
|---|
| 78 |
* the corresponding "_finish()" function, passing the object the |
|---|
| 79 |
* function was called for, the GAsyncResult instance, and (optionally) |
|---|
| 80 |
* an error to grab any error conditions that may have occurred. |
|---|
| 81 |
* The "_finish()" function for an operation takes the generic result |
|---|
| 82 |
* (of type GAsyncResult) and returns the specific result that the |
|---|
| 83 |
* operation in question yields (e.g. a GFileEnumerator for a |
|---|
| 84 |
* "enumerate children" operation). If the result or error status of the |
|---|
| 85 |
* operation is not needed, there is no need to call the "_finish()" |
|---|
| 86 |
* function; GIO will take care of cleaning up the result and error |
|---|
| 87 |
* information after the GAsyncReadyCallback returns. Applications may |
|---|
| 88 |
* also take a reference to the GAsyncResult and call "_finish()" |
|---|
| 89 |
* later; however, the "_finish()" function may be called at most once. |
|---|
| 90 |
* Example of a typical asynchronous operation flow: |
|---|
| 91 |
* $(DDOC_COMMENT example) |
|---|
| 92 |
* The callback for an asynchronous operation is called only once, and is |
|---|
| 93 |
* always called, even in the case of a cancelled operation. On cancellation |
|---|
| 94 |
* the result is a G_IO_ERROR_CANCELLED error. |
|---|
| 95 |
* Some asynchronous operations are implemented using synchronous calls. |
|---|
| 96 |
* These are run in a separate thread, if GThread has been initialized, but |
|---|
| 97 |
* otherwise they are sent to the Main Event Loop and processed in an idle |
|---|
| 98 |
* function. So, if you truly need asynchronous operations, make sure to |
|---|
| 99 |
* initialize GThread. |
|---|
| 100 |
*/ |
|---|
| 101 |
public interface AsyncResultIF |
|---|
| 102 |
{ |
|---|
| 103 |
|
|---|
| 104 |
|
|---|
| 105 |
public GAsyncResult* getAsyncResultTStruct(); |
|---|
| 106 |
|
|---|
| 107 |
/** the main Gtk struct as a void* */ |
|---|
| 108 |
protected void* getStruct(); |
|---|
| 109 |
|
|---|
| 110 |
|
|---|
| 111 |
/** |
|---|
| 112 |
*/ |
|---|
| 113 |
|
|---|
| 114 |
/** |
|---|
| 115 |
* Gets the user data from a GAsyncResult. |
|---|
| 116 |
* Returns: the user data for res. [transfer full] |
|---|
| 117 |
*/ |
|---|
| 118 |
public void* getUserData(); |
|---|
| 119 |
|
|---|
| 120 |
/** |
|---|
| 121 |
* Gets the source object from a GAsyncResult. |
|---|
| 122 |
* Returns: a new reference to the source object for the res, or NULL if there is none. [transfer full] |
|---|
| 123 |
*/ |
|---|
| 124 |
public ObjectG getSourceObject(); |
|---|
| 125 |
} |
|---|