root/trunk/src/gio/VolumeIF.d

Revision 938, 12.2 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  = GVolume.html
27  * outPack = gio
28  * outFile = VolumeIF
29  * strct   = GVolume
30  * realStrct=
31  * ctorStrct=
32  * clss    = VolumeT
33  * interf  = VolumeIF
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  =
38  * implements:
39  * prefixes:
40  *  - g_volume_
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.Signals
50  *  - gio.AsyncResultIF
51  *  - gio.Cancellable
52  *  - gio.Drive
53  *  - gio.DriveIF
54  *  - gio.File
55  *  - gio.Icon
56  *  - gio.IconIF
57  *  - gio.Mount
58  *  - gio.MountIF
59  *  - gio.MountOperation
60  * structWrap:
61  *  - GAsyncResult* -> AsyncResultIF
62  *  - GCancellable* -> Cancellable
63  *  - GDrive* -> DriveIF
64  *  - GFile* -> File
65  *  - GIcon* -> IconIF
66  *  - GMount* -> MountIF
67  *  - GMountOperation* -> MountOperation
68  * module aliases:
69  * local aliases:
70  * overrides:
71  */
72
73 module gio.VolumeIF;
74
75 public  import gtkc.giotypes;
76
77 private import gtkc.gio;
78 private import glib.ConstructionException;
79
80 private import gobject.Signals;
81 public  import gtkc.gdktypes;
82
83 private import glib.Str;
84 private import glib.ErrorG;
85 private import glib.GException;
86 private import gobject.Signals;
87 private import gio.AsyncResultIF;
88 private import gio.Cancellable;
89 private import gio.Drive;
90 private import gio.DriveIF;
91 private import gio.File;
92 private import gio.Icon;
93 private import gio.IconIF;
94 private import gio.Mount;
95 private import gio.MountIF;
96 private import gio.MountOperation;
97
98
99
100
101 /**
102  * Description
103  * The GVolume interface represents user-visible objects that can be
104  * mounted. Note, when porting from GnomeVFS, GVolume is the moral
105  * equivalent of GnomeVFSDrive.
106  * Mounting a GVolume instance is an asynchronous operation. For more
107  * information about asynchronous operations, see GAsyncReady and
108  * GSimpleAsyncReady. To mount a GVolume, first call
109  * g_volume_mount() with (at least) the GVolume instance, optionally
110  * a GMountOperation object and a GAsyncReadyCallback.
111  * Typically, one will only want to pass NULL for the
112  * GMountOperation if automounting all volumes when a desktop session
113  * starts since it's not desirable to put up a lot of dialogs asking
114  * for credentials.
115  * The callback will be fired when the operation has resolved (either
116  * with success or failure), and a GAsyncReady structure will be
117  * passed to the callback. That callback should then call
118  * g_volume_mount_finish() with the GVolume instance and the
119  * GAsyncReady data to see if the operation was completed
120  * successfully. If an error is present when g_volume_mount_finish()
121  * is called, then it will be filled with any error information.
122  * It is sometimes necessary to directly access the underlying
123  * operating system object behind a volume (e.g. for passing a volume
124  * to an application via the commandline). For this purpose, GIO
125  * allows to obtain an 'identifier' for the volume. There can be
126  * different kinds of identifiers, such as Hal UDIs, filesystem labels,
127  * traditional Unix devices (e.g. /dev/sda2),
128  * uuids. GIO uses predefind strings as names for the different kinds
129  * of identifiers: G_VOLUME_IDENTIFIER_KIND_HAL_UDI,
130  * G_VOLUME_IDENTIFIER_KIND_LABEL, etc. Use g_volume_get_identifier()
131  * to obtain an identifier for a volume.
132  * Note that G_VOLUME_IDENTIFIER_KIND_HAL_UDI will only be available
133  * when the gvfs hal volume monitor is in use. Other volume monitors
134  * will generally be able to provide the G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE
135  * identifier, which can be used to obtain a hal device by means of
136  * libhal_manger_find_device_string_match().
137  */
138 public interface VolumeIF
139 {
140    
141    
142     public GVolume* getVolumeTStruct();
143    
144     /** the main Gtk struct as a void* */
145     protected void* getStruct();
146    
147    
148     /**
149      */
150    
151     void delegate(VolumeIF)[] onChangedListeners();
152     /**
153      * Emitted when the volume has been changed.
154      */
155     void addOnChanged(void delegate(VolumeIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
156     void delegate(VolumeIF)[] onRemovedListeners();
157     /**
158      * This signal is emitted when the GVolume have been removed. If
159      * the recipient is holding references to the object they should
160      * release them so the object can be finalized.
161      */
162     void addOnRemoved(void delegate(VolumeIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
163    
164     /**
165      * Gets the name of volume.
166      * Returns: the name for the given volume. The returned string should be freed with g_free() when no longer needed.
167      */
168     public string getName();
169    
170     /**
171      * Gets the UUID for the volume. The reference is typically based on
172      * the file system UUID for the volume in question and should be
173      * considered an opaque string. Returns NULL if there is no UUID
174      * available.
175      * Returns: the UUID for volume or NULL if no UUID can be computed. The returned string should be freed with g_free() when no longer needed.
176      */
177     public string getUuid();
178    
179     /**
180      * Gets the icon for volume.
181      * Returns: a GIcon. The returned object should be unreffed with g_object_unref() when no longer needed. [transfer full]
182      */
183     public IconIF getIcon();
184    
185     /**
186      * Gets the drive for the volume.
187      * Returns: a GDrive or NULL if volume is not associated with a drive. The returned object should be unreffed with g_object_unref() when no longer needed. [transfer full]
188      */
189     public DriveIF getDrive();
190    
191     /**
192      * Gets the mount for the volume.
193      * Returns: a GMount or NULL if volume isn't mounted. The returned object should be unreffed with g_object_unref() when no longer needed. [transfer full]
194      */
195     public MountIF getMount();
196    
197     /**
198      * Checks if a volume can be mounted.
199      * Returns: TRUE if the volume can be mounted. FALSE otherwise.
200      */
201     public int canMount();
202    
203     /**
204      * Returns whether the volume should be automatically mounted.
205      * Returns: TRUE if the volume should be automatically mounted.
206      */
207     public int shouldAutomount();
208    
209     /**
210      * Gets the activation root for a GVolume if it is known ahead of
211      * mount time. Returns NULL otherwise. If not NULL and if volume
212      * is mounted, then the result of g_mount_get_root() on the
213      * GMount object obtained from g_volume_get_mount() will always
214      * either be equal or a prefix of what this function returns. In
215      * other words, in code
216      *  GMount *mount;
217      *  GFile *mount_root
218      *  GFile *volume_activation_root;
219      *  mount = g_volume_get_mount (volume); /+* mounted, so never NULL +/
220      *  mount_root = g_mount_get_root (mount);
221      *  volume_activation_root = g_volume_get_activation_root(volume); /+* assume not NULL +/
222      * then the expression
223      *  (g_file_has_prefix (volume_activation_root, mount_root) ||
224      *  g_file_equal (volume_activation_root, mount_root))
225      * will always be TRUE.
226      * Activation roots are typically used in GVolumeMonitor
227      * implementations to find the underlying mount to shadow, see
228      * g_mount_is_shadowed() for more details.
229      * Since 2.18
230      * Returns: the activation root of volume or NULL. Use g_object_unref() to free. [transfer full]
231      */
232     public File getActivationRoot();
233    
234     /**
235      * Mounts a volume. This is an asynchronous operation, and is
236      * finished by calling g_volume_mount_finish() with the volume
237      * and GAsyncResult returned in the callback.
238      * Virtual: mount_fn
239      * Params:
240      * flags = flags affecting the operation
241      * mountOperation = a GMountOperation or NULL to avoid user interaction. [allow-none]
242      * cancellable = optional GCancellable object, NULL to ignore. [allow-none]
243      * callback = a GAsyncReadyCallback, or NULL. [allow-none]
244      * userData = user data that gets passed to callback
245      */
246     public void mount(GMountMountFlags flags, MountOperation mountOperation, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
247    
248     /**
249      * Finishes mounting a volume. If any errors occured during the operation,
250      * error will be set to contain the errors and FALSE will be returned.
251      * If the mount operation succeeded, g_volume_get_mount() on volume
252      * is guaranteed to return the mount right after calling this
253      * function; there's no need to listen for the 'mount-added' signal on
254      * GVolumeMonitor.
255      * Params:
256      * result = a GAsyncResult
257      * Returns: TRUE, FALSE if operation failed.
258      * Throws: GException on failure.
259      */
260     public int mountFinish(AsyncResultIF result);
261    
262     /**
263      * Checks if a volume can be ejected.
264      * Returns: TRUE if the volume can be ejected. FALSE otherwise.
265      */
266     public int canEject();
267    
268     /**
269      * Warning
270      * g_volume_eject has been deprecated since version 2.22 and should not be used in newly-written code. Use g_volume_eject_with_operation() instead.
271      * Ejects a volume. This is an asynchronous operation, and is
272      * finished by calling g_volume_eject_finish() with the volume
273      * and GAsyncResult returned in the callback.
274      * Params:
275      * flags = flags affecting the unmount if required for eject
276      * cancellable = optional GCancellable object, NULL to ignore. [allow-none]
277      * callback = a GAsyncReadyCallback, or NULL. [allow-none]
278      * userData = user data that gets passed to callback
279      */
280     public void eject(GMountUnmountFlags flags, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
281    
282     /**
283      * Warning
284      * g_volume_eject_finish has been deprecated since version 2.22 and should not be used in newly-written code. Use g_volume_eject_with_operation_finish() instead.
285      * Finishes ejecting a volume. If any errors occured during the operation,
286      * error will be set to contain the errors and FALSE will be returned.
287      * Params:
288      * result = a GAsyncResult.
289      * Returns: TRUE, FALSE if operation failed.
290      * Throws: GException on failure.
291      */
292     public int ejectFinish(AsyncResultIF result);
293    
294     /**
295      * Ejects a volume. This is an asynchronous operation, and is
296      * finished by calling g_volume_eject_with_operation_finish() with the volume
297      * and GAsyncResult data returned in the callback.
298      * Since 2.22
299      * Params:
300      * flags = flags affecting the unmount if required for eject
301      * mountOperation = a GMountOperation or NULL to
302      * avoid user interaction. [allow-none]
303      * cancellable = optional GCancellable object, NULL to ignore. [allow-none]
304      * callback = a GAsyncReadyCallback, or NULL.
305      * userData = user data passed to callback.
306      */
307     public void ejectWithOperation(GMountUnmountFlags flags, MountOperation mountOperation, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
308    
309     /**
310      * Finishes ejecting a volume. If any errors occurred during the operation,
311      * error will be set to contain the errors and FALSE will be returned.
312      * Since 2.22
313      * Params:
314      * result = a GAsyncResult.
315      * Returns: TRUE if the volume was successfully ejected. FALSE otherwise.
316      * Throws: GException on failure.
317      */
318     public int ejectWithOperationFinish(AsyncResultIF result);
319    
320     /**
321      * Gets the kinds of identifiers
322      * that volume has. Use g_volume_get_identifer() to obtain
323      * the identifiers themselves.
324      * Returns: a NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free. [array zero-terminated=1][transfer full]
325      */
326     public string[] enumerateIdentifiers();
327    
328     /**
329      * Gets the identifier of the given kind for volume.
330      * See the introduction
331      * for more information about volume identifiers.
332      * Params:
333      * kind = the kind of identifier to return
334      * Returns: a newly allocated string containing the requested identfier, or NULL if the GVolume doesn't have this kind of identifier Signal Details The "changed" signal void user_function (GVolume *arg0, gpointer user_data) : Run Last Emitted when the volume has been changed.
335      */
336     public string getIdentifier(string kind);
337 }
Note: See TracBrowser for help on using the browser.