source: appstream-generator/build/girepo/gio/VolumeIF.d @ 4841

Last change on this file since 4841 was 4841, checked in by Juanma, 2 years ago

Initial release

File size: 11.4 KB
Line 
1/*
2 * Licensed under the GNU Lesser General Public License Version 3
3 *
4 * This library is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation, either version 3 of the license, or
7 * (at your option) any later version.
8 *
9 * This software is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
16 */
17
18// generated automatically - do not change
19
20
21module gio.VolumeIF;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import gio.AsyncResultIF;
26private import gio.Cancellable;
27private import gio.Drive;
28private import gio.DriveIF;
29private import gio.File;
30private import gio.FileIF;
31private import gio.Icon;
32private import gio.IconIF;
33private import gio.Mount;
34private import gio.MountIF;
35private import gio.MountOperation;
36private import glib.ErrorG;
37private import glib.GException;
38private import glib.Str;
39private import gobject.ObjectG;
40private import gobject.Signals;
41private import std.algorithm;
42
43
44/**
45 * The #GVolume interface represents user-visible objects that can be
46 * mounted. Note, when porting from GnomeVFS, #GVolume is the moral
47 * equivalent of #GnomeVFSDrive.
48 *
49 * Mounting a #GVolume instance is an asynchronous operation. For more
50 * information about asynchronous operations, see #GAsyncResult and
51 * #GTask. To mount a #GVolume, first call g_volume_mount() with (at
52 * least) the #GVolume instance, optionally a #GMountOperation object
53 * and a #GAsyncReadyCallback.
54 *
55 * Typically, one will only want to pass %NULL for the
56 * #GMountOperation if automounting all volumes when a desktop session
57 * starts since it's not desirable to put up a lot of dialogs asking
58 * for credentials.
59 *
60 * The callback will be fired when the operation has resolved (either
61 * with success or failure), and a #GAsyncReady structure will be
62 * passed to the callback.  That callback should then call
63 * g_volume_mount_finish() with the #GVolume instance and the
64 * #GAsyncReady data to see if the operation was completed
65 * successfully.  If an @error is present when g_volume_mount_finish()
66 * is called, then it will be filled with any error information.
67 *
68 * ## Volume Identifiers # {#volume-identifier}
69 *
70 * It is sometimes necessary to directly access the underlying
71 * operating system object behind a volume (e.g. for passing a volume
72 * to an application via the commandline). For this purpose, GIO
73 * allows to obtain an 'identifier' for the volume. There can be
74 * different kinds of identifiers, such as Hal UDIs, filesystem labels,
75 * traditional Unix devices (e.g. `/dev/sda2`), UUIDs. GIO uses predefined
76 * strings as names for the different kinds of identifiers:
77 * #G_VOLUME_IDENTIFIER_KIND_HAL_UDI, #G_VOLUME_IDENTIFIER_KIND_LABEL, etc.
78 * Use g_volume_get_identifier() to obtain an identifier for a volume.
79 *
80 *
81 * Note that #G_VOLUME_IDENTIFIER_KIND_HAL_UDI will only be available
82 * when the gvfs hal volume monitor is in use. Other volume monitors
83 * will generally be able to provide the #G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE
84 * identifier, which can be used to obtain a hal device by means of
85 * libhal_manager_find_device_string_match().
86 */
87public interface VolumeIF{
88        /** Get the main Gtk struct */
89        public GVolume* getVolumeStruct();
90
91        /** the main Gtk struct as a void* */
92        protected void* getStruct();
93
94
95        /**
96         * Checks if a volume can be ejected.
97         *
98         * Returns: %TRUE if the @volume can be ejected. %FALSE otherwise
99         */
100        public bool canEject();
101
102        /**
103         * Checks if a volume can be mounted.
104         *
105         * Returns: %TRUE if the @volume can be mounted. %FALSE otherwise
106         */
107        public bool canMount();
108
109        /**
110         * Ejects a volume. This is an asynchronous operation, and is
111         * finished by calling g_volume_eject_finish() with the @volume
112         * and #GAsyncResult returned in the @callback.
113         *
114         * Deprecated: Use g_volume_eject_with_operation() instead.
115         *
116         * Params:
117         *     flags = flags affecting the unmount if required for eject
118         *     cancellable = optional #GCancellable object, %NULL to ignore
119         *     callback = a #GAsyncReadyCallback, or %NULL
120         *     userData = user data that gets passed to @callback
121         */
122        public void eject(GMountUnmountFlags flags, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
123
124        /**
125         * Finishes ejecting a volume. If any errors occurred during the operation,
126         * @error will be set to contain the errors and %FALSE will be returned.
127         *
128         * Deprecated: Use g_volume_eject_with_operation_finish() instead.
129         *
130         * Params:
131         *     result = a #GAsyncResult
132         *
133         * Returns: %TRUE, %FALSE if operation failed
134         *
135         * Throws: GException on failure.
136         */
137        public bool ejectFinish(AsyncResultIF result);
138
139        /**
140         * Ejects a volume. This is an asynchronous operation, and is
141         * finished by calling g_volume_eject_with_operation_finish() with the @volume
142         * and #GAsyncResult data returned in the @callback.
143         *
144         * Params:
145         *     flags = flags affecting the unmount if required for eject
146         *     mountOperation = a #GMountOperation or %NULL to
147         *         avoid user interaction
148         *     cancellable = optional #GCancellable object, %NULL to ignore
149         *     callback = a #GAsyncReadyCallback, or %NULL
150         *     userData = user data passed to @callback
151         *
152         * Since: 2.22
153         */
154        public void ejectWithOperation(GMountUnmountFlags flags, MountOperation mountOperation, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
155
156        /**
157         * Finishes ejecting a volume. If any errors occurred during the operation,
158         * @error will be set to contain the errors and %FALSE will be returned.
159         *
160         * Params:
161         *     result = a #GAsyncResult
162         *
163         * Returns: %TRUE if the volume was successfully ejected. %FALSE otherwise
164         *
165         * Since: 2.22
166         *
167         * Throws: GException on failure.
168         */
169        public bool ejectWithOperationFinish(AsyncResultIF result);
170
171        /**
172         * Gets the kinds of [identifiers][volume-identifier] that @volume has.
173         * Use g_volume_get_identifier() to obtain the identifiers themselves.
174         *
175         * Returns: a %NULL-terminated array
176         *     of strings containing kinds of identifiers. Use g_strfreev() to free.
177         */
178        public string[] enumerateIdentifiers();
179
180        /**
181         * Gets the activation root for a #GVolume if it is known ahead of
182         * mount time. Returns %NULL otherwise. If not %NULL and if @volume
183         * is mounted, then the result of g_mount_get_root() on the
184         * #GMount object obtained from g_volume_get_mount() will always
185         * either be equal or a prefix of what this function returns. In
186         * other words, in code
187         *
188         * |[<!-- language="C" -->
189         * GMount *mount;
190         * GFile *mount_root
191         * GFile *volume_activation_root;
192         *
193         * mount = g_volume_get_mount (volume); // mounted, so never NULL
194         * mount_root = g_mount_get_root (mount);
195         * volume_activation_root = g_volume_get_activation_root (volume); // assume not NULL
196         * ]|
197         * then the expression
198         * |[<!-- language="C" -->
199         * (g_file_has_prefix (volume_activation_root, mount_root) ||
200         * g_file_equal (volume_activation_root, mount_root))
201         * ]|
202         * will always be %TRUE.
203         *
204         * Activation roots are typically used in #GVolumeMonitor
205         * implementations to find the underlying mount to shadow, see
206         * g_mount_is_shadowed() for more details.
207         *
208         * Returns: the activation root of @volume
209         *     or %NULL. Use g_object_unref() to free.
210         *
211         * Since: 2.18
212         */
213        public FileIF getActivationRoot();
214
215        /**
216         * Gets the drive for the @volume.
217         *
218         * Returns: a #GDrive or %NULL if @volume is not
219         *     associated with a drive. The returned object should be unreffed
220         *     with g_object_unref() when no longer needed.
221         */
222        public DriveIF getDrive();
223
224        /**
225         * Gets the icon for @volume.
226         *
227         * Returns: a #GIcon.
228         *     The returned object should be unreffed with g_object_unref()
229         *     when no longer needed.
230         */
231        public IconIF getIcon();
232
233        /**
234         * Gets the identifier of the given kind for @volume.
235         * See the [introduction][volume-identifier] for more
236         * information about volume identifiers.
237         *
238         * Params:
239         *     kind = the kind of identifier to return
240         *
241         * Returns: a newly allocated string containing the
242         *     requested identfier, or %NULL if the #GVolume
243         *     doesn't have this kind of identifier
244         */
245        public string getIdentifier(string kind);
246
247        /**
248         * Gets the mount for the @volume.
249         *
250         * Returns: a #GMount or %NULL if @volume isn't mounted.
251         *     The returned object should be unreffed with g_object_unref()
252         *     when no longer needed.
253         */
254        public MountIF getMount();
255
256        /**
257         * Gets the name of @volume.
258         *
259         * Returns: the name for the given @volume. The returned string should
260         *     be freed with g_free() when no longer needed.
261         */
262        public string getName();
263
264        /**
265         * Gets the sort key for @volume, if any.
266         *
267         * Returns: Sorting key for @volume or %NULL if no such key is available
268         *
269         * Since: 2.32
270         */
271        public string getSortKey();
272
273        /**
274         * Gets the symbolic icon for @volume.
275         *
276         * Returns: a #GIcon.
277         *     The returned object should be unreffed with g_object_unref()
278         *     when no longer needed.
279         *
280         * Since: 2.34
281         */
282        public IconIF getSymbolicIcon();
283
284        /**
285         * Gets the UUID for the @volume. The reference is typically based on
286         * the file system UUID for the volume in question and should be
287         * considered an opaque string. Returns %NULL if there is no UUID
288         * available.
289         *
290         * Returns: the UUID for @volume or %NULL if no UUID can be computed.
291         *     The returned string should be freed with g_free()
292         *     when no longer needed.
293         */
294        public string getUuid();
295
296        /**
297         * Mounts a volume. This is an asynchronous operation, and is
298         * finished by calling g_volume_mount_finish() with the @volume
299         * and #GAsyncResult returned in the @callback.
300         *
301         * Params:
302         *     flags = flags affecting the operation
303         *     mountOperation = a #GMountOperation or %NULL to avoid user interaction
304         *     cancellable = optional #GCancellable object, %NULL to ignore
305         *     callback = a #GAsyncReadyCallback, or %NULL
306         *     userData = user data that gets passed to @callback
307         */
308        public void mount(GMountMountFlags flags, MountOperation mountOperation, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
309
310        /**
311         * Finishes mounting a volume. If any errors occurred during the operation,
312         * @error will be set to contain the errors and %FALSE will be returned.
313         *
314         * If the mount operation succeeded, g_volume_get_mount() on @volume
315         * is guaranteed to return the mount right after calling this
316         * function; there's no need to listen for the 'mount-added' signal on
317         * #GVolumeMonitor.
318         *
319         * Params:
320         *     result = a #GAsyncResult
321         *
322         * Returns: %TRUE, %FALSE if operation failed
323         *
324         * Throws: GException on failure.
325         */
326        public bool mountFinish(AsyncResultIF result);
327
328        /**
329         * Returns whether the volume should be automatically mounted.
330         *
331         * Returns: %TRUE if the volume should be automatically mounted
332         */
333        public bool shouldAutomount();
334
335        /**
336         * Emitted when the volume has been changed.
337         */
338        gulong addOnChanged(void delegate(VolumeIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
339
340        /**
341         * This signal is emitted when the #GVolume have been removed. If
342         * the recipient is holding references to the object they should
343         * release them so the object can be finalized.
344         */
345        gulong addOnRemoved(void delegate(VolumeIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
346}
Note: See TracBrowser for help on using the repository browser.