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

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

Initial release

File size: 16.1 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.MountIF;
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.MountOperation;
34private import gio.Volume;
35private import gio.VolumeIF;
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 #GMount interface represents user-visible mounts. Note, when
46 * porting from GnomeVFS, #GMount is the moral equivalent of #GnomeVFSVolume.
47 *
48 * #GMount is a "mounted" filesystem that you can access. Mounted is in
49 * quotes because it's not the same as a unix mount, it might be a gvfs
50 * mount, but you can still access the files on it if you use GIO. Might or
51 * might not be related to a volume object.
52 *
53 * Unmounting a #GMount instance is an asynchronous operation. For
54 * more information about asynchronous operations, see #GAsyncResult
55 * and #GTask. To unmount a #GMount instance, first call
56 * g_mount_unmount_with_operation() with (at least) the #GMount instance and a
57 * #GAsyncReadyCallback.  The callback will be fired when the
58 * operation has resolved (either with success or failure), and a
59 * #GAsyncReady structure will be passed to the callback.  That
60 * callback should then call g_mount_unmount_with_operation_finish() with the #GMount
61 * and the #GAsyncReady data to see if the operation was completed
62 * successfully.  If an @error is present when g_mount_unmount_with_operation_finish()
63 * is called, then it will be filled with any error information.
64 */
65public interface MountIF{
66        /** Get the main Gtk struct */
67        public GMount* getMountStruct();
68
69        /** the main Gtk struct as a void* */
70        protected void* getStruct();
71
72
73        /**
74         * Checks if @mount can be eject.
75         *
76         * Returns: %TRUE if the @mount can be ejected.
77         */
78        public bool canEject();
79
80        /**
81         * Checks if @mount can be mounted.
82         *
83         * Returns: %TRUE if the @mount can be unmounted.
84         */
85        public bool canUnmount();
86
87        /**
88         * Ejects a mount. This is an asynchronous operation, and is
89         * finished by calling g_mount_eject_finish() with the @mount
90         * and #GAsyncResult data returned in the @callback.
91         *
92         * Deprecated: Use g_mount_eject_with_operation() instead.
93         *
94         * Params:
95         *     flags = flags affecting the unmount if required for eject
96         *     cancellable = optional #GCancellable object, %NULL to ignore.
97         *     callback = a #GAsyncReadyCallback, or %NULL.
98         *     userData = user data passed to @callback.
99         */
100        public void eject(GMountUnmountFlags flags, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
101
102        /**
103         * Finishes ejecting a mount. If any errors occurred during the operation,
104         * @error will be set to contain the errors and %FALSE will be returned.
105         *
106         * Deprecated: Use g_mount_eject_with_operation_finish() instead.
107         *
108         * Params:
109         *     result = a #GAsyncResult.
110         *
111         * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
112         *
113         * Throws: GException on failure.
114         */
115        public bool ejectFinish(AsyncResultIF result);
116
117        /**
118         * Ejects a mount. This is an asynchronous operation, and is
119         * finished by calling g_mount_eject_with_operation_finish() with the @mount
120         * and #GAsyncResult data returned in the @callback.
121         *
122         * Params:
123         *     flags = flags affecting the unmount if required for eject
124         *     mountOperation = a #GMountOperation or %NULL to avoid
125         *         user interaction.
126         *     cancellable = optional #GCancellable object, %NULL to ignore.
127         *     callback = a #GAsyncReadyCallback, or %NULL.
128         *     userData = user data passed to @callback.
129         *
130         * Since: 2.22
131         */
132        public void ejectWithOperation(GMountUnmountFlags flags, MountOperation mountOperation, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
133
134        /**
135         * Finishes ejecting a mount. If any errors occurred during the operation,
136         * @error will be set to contain the errors and %FALSE will be returned.
137         *
138         * Params:
139         *     result = a #GAsyncResult.
140         *
141         * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
142         *
143         * Since: 2.22
144         *
145         * Throws: GException on failure.
146         */
147        public bool ejectWithOperationFinish(AsyncResultIF result);
148
149        /**
150         * Gets the default location of @mount. The default location of the given
151         * @mount is a path that reflects the main entry point for the user (e.g.
152         * the home directory, or the root of the volume).
153         *
154         * Returns: a #GFile.
155         *     The returned object should be unreffed with
156         *     g_object_unref() when no longer needed.
157         */
158        public FileIF getDefaultLocation();
159
160        /**
161         * Gets the drive for the @mount.
162         *
163         * This is a convenience method for getting the #GVolume and then
164         * using that object to get the #GDrive.
165         *
166         * Returns: a #GDrive or %NULL if @mount is not associated with a volume or a drive.
167         *     The returned object should be unreffed with
168         *     g_object_unref() when no longer needed.
169         */
170        public DriveIF getDrive();
171
172        /**
173         * Gets the icon for @mount.
174         *
175         * Returns: a #GIcon.
176         *     The returned object should be unreffed with
177         *     g_object_unref() when no longer needed.
178         */
179        public IconIF getIcon();
180
181        /**
182         * Gets the name of @mount.
183         *
184         * Returns: the name for the given @mount.
185         *     The returned string should be freed with g_free()
186         *     when no longer needed.
187         */
188        public string getName();
189
190        /**
191         * Gets the root directory on @mount.
192         *
193         * Returns: a #GFile.
194         *     The returned object should be unreffed with
195         *     g_object_unref() when no longer needed.
196         */
197        public FileIF getRoot();
198
199        /**
200         * Gets the sort key for @mount, if any.
201         *
202         * Returns: Sorting key for @mount or %NULL if no such key is available.
203         *
204         * Since: 2.32
205         */
206        public string getSortKey();
207
208        /**
209         * Gets the symbolic icon for @mount.
210         *
211         * Returns: a #GIcon.
212         *     The returned object should be unreffed with
213         *     g_object_unref() when no longer needed.
214         *
215         * Since: 2.34
216         */
217        public IconIF getSymbolicIcon();
218
219        /**
220         * Gets the UUID for the @mount. The reference is typically based on
221         * the file system UUID for the mount in question and should be
222         * considered an opaque string. Returns %NULL if there is no UUID
223         * available.
224         *
225         * Returns: the UUID for @mount or %NULL if no UUID can be computed.
226         *     The returned string should be freed with g_free()
227         *     when no longer needed.
228         */
229        public string getUuid();
230
231        /**
232         * Gets the volume for the @mount.
233         *
234         * Returns: a #GVolume or %NULL if @mount is not associated with a volume.
235         *     The returned object should be unreffed with
236         *     g_object_unref() when no longer needed.
237         */
238        public VolumeIF getVolume();
239
240        /**
241         * Tries to guess the type of content stored on @mount. Returns one or
242         * more textual identifiers of well-known content types (typically
243         * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
244         * memory cards. See the
245         * [shared-mime-info](http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec)
246         * specification for more on x-content types.
247         *
248         * This is an asynchronous operation (see
249         * g_mount_guess_content_type_sync() for the synchronous version), and
250         * is finished by calling g_mount_guess_content_type_finish() with the
251         * @mount and #GAsyncResult data returned in the @callback.
252         *
253         * Params:
254         *     forceRescan = Whether to force a rescan of the content.
255         *         Otherwise a cached result will be used if available
256         *     cancellable = optional #GCancellable object, %NULL to ignore
257         *     callback = a #GAsyncReadyCallback
258         *     userData = user data passed to @callback
259         *
260         * Since: 2.18
261         */
262        public void guessContentType(bool forceRescan, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
263
264        /**
265         * Finishes guessing content types of @mount. If any errors occurred
266         * during the operation, @error will be set to contain the errors and
267         * %FALSE will be returned. In particular, you may get an
268         * %G_IO_ERROR_NOT_SUPPORTED if the mount does not support content
269         * guessing.
270         *
271         * Params:
272         *     result = a #GAsyncResult
273         *
274         * Returns: a %NULL-terminated array of content types or %NULL on error.
275         *     Caller should free this array with g_strfreev() when done with it.
276         *
277         * Since: 2.18
278         *
279         * Throws: GException on failure.
280         */
281        public string[] guessContentTypeFinish(AsyncResultIF result);
282
283        /**
284         * Tries to guess the type of content stored on @mount. Returns one or
285         * more textual identifiers of well-known content types (typically
286         * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
287         * memory cards. See the
288         * [shared-mime-info](http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec)
289         * specification for more on x-content types.
290         *
291         * This is an synchronous operation and as such may block doing IO;
292         * see g_mount_guess_content_type() for the asynchronous version.
293         *
294         * Params:
295         *     forceRescan = Whether to force a rescan of the content.
296         *         Otherwise a cached result will be used if available
297         *     cancellable = optional #GCancellable object, %NULL to ignore
298         *
299         * Returns: a %NULL-terminated array of content types or %NULL on error.
300         *     Caller should free this array with g_strfreev() when done with it.
301         *
302         * Since: 2.18
303         *
304         * Throws: GException on failure.
305         */
306        public string[] guessContentTypeSync(bool forceRescan, Cancellable cancellable);
307
308        /**
309         * Determines if @mount is shadowed. Applications or libraries should
310         * avoid displaying @mount in the user interface if it is shadowed.
311         *
312         * A mount is said to be shadowed if there exists one or more user
313         * visible objects (currently #GMount objects) with a root that is
314         * inside the root of @mount.
315         *
316         * One application of shadow mounts is when exposing a single file
317         * system that is used to address several logical volumes. In this
318         * situation, a #GVolumeMonitor implementation would create two
319         * #GVolume objects (for example, one for the camera functionality of
320         * the device and one for a SD card reader on the device) with
321         * activation URIs `gphoto2://[usb:001,002]/store1/`
322         * and `gphoto2://[usb:001,002]/store2/`. When the
323         * underlying mount (with root
324         * `gphoto2://[usb:001,002]/`) is mounted, said
325         * #GVolumeMonitor implementation would create two #GMount objects
326         * (each with their root matching the corresponding volume activation
327         * root) that would shadow the original mount.
328         *
329         * The proxy monitor in GVfs 2.26 and later, automatically creates and
330         * manage shadow mounts (and shadows the underlying mount) if the
331         * activation root on a #GVolume is set.
332         *
333         * Returns: %TRUE if @mount is shadowed.
334         *
335         * Since: 2.20
336         */
337        public bool isShadowed();
338
339        /**
340         * Remounts a mount. This is an asynchronous operation, and is
341         * finished by calling g_mount_remount_finish() with the @mount
342         * and #GAsyncResults data returned in the @callback.
343         *
344         * Remounting is useful when some setting affecting the operation
345         * of the volume has been changed, as these may need a remount to
346         * take affect. While this is semantically equivalent with unmounting
347         * and then remounting not all backends might need to actually be
348         * unmounted.
349         *
350         * Params:
351         *     flags = flags affecting the operation
352         *     mountOperation = a #GMountOperation or %NULL to avoid
353         *         user interaction.
354         *     cancellable = optional #GCancellable object, %NULL to ignore.
355         *     callback = a #GAsyncReadyCallback, or %NULL.
356         *     userData = user data passed to @callback.
357         */
358        public void remount(GMountMountFlags flags, MountOperation mountOperation, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
359
360        /**
361         * Finishes remounting a mount. If any errors occurred during the operation,
362         * @error will be set to contain the errors and %FALSE will be returned.
363         *
364         * Params:
365         *     result = a #GAsyncResult.
366         *
367         * Returns: %TRUE if the mount was successfully remounted. %FALSE otherwise.
368         *
369         * Throws: GException on failure.
370         */
371        public bool remountFinish(AsyncResultIF result);
372
373        /**
374         * Increments the shadow count on @mount. Usually used by
375         * #GVolumeMonitor implementations when creating a shadow mount for
376         * @mount, see g_mount_is_shadowed() for more information. The caller
377         * will need to emit the #GMount::changed signal on @mount manually.
378         *
379         * Since: 2.20
380         */
381        public void shadow();
382
383        /**
384         * Unmounts a mount. This is an asynchronous operation, and is
385         * finished by calling g_mount_unmount_finish() with the @mount
386         * and #GAsyncResult data returned in the @callback.
387         *
388         * Deprecated: Use g_mount_unmount_with_operation() instead.
389         *
390         * Params:
391         *     flags = flags affecting the operation
392         *     cancellable = optional #GCancellable object, %NULL to ignore.
393         *     callback = a #GAsyncReadyCallback, or %NULL.
394         *     userData = user data passed to @callback.
395         */
396        public void unmount(GMountUnmountFlags flags, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
397
398        /**
399         * Finishes unmounting a mount. If any errors occurred during the operation,
400         * @error will be set to contain the errors and %FALSE will be returned.
401         *
402         * Deprecated: Use g_mount_unmount_with_operation_finish() instead.
403         *
404         * Params:
405         *     result = a #GAsyncResult.
406         *
407         * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
408         *
409         * Throws: GException on failure.
410         */
411        public bool unmountFinish(AsyncResultIF result);
412
413        /**
414         * Unmounts a mount. This is an asynchronous operation, and is
415         * finished by calling g_mount_unmount_with_operation_finish() with the @mount
416         * and #GAsyncResult data returned in the @callback.
417         *
418         * Params:
419         *     flags = flags affecting the operation
420         *     mountOperation = a #GMountOperation or %NULL to avoid
421         *         user interaction.
422         *     cancellable = optional #GCancellable object, %NULL to ignore.
423         *     callback = a #GAsyncReadyCallback, or %NULL.
424         *     userData = user data passed to @callback.
425         *
426         * Since: 2.22
427         */
428        public void unmountWithOperation(GMountUnmountFlags flags, MountOperation mountOperation, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
429
430        /**
431         * Finishes unmounting a mount. If any errors occurred during the operation,
432         * @error will be set to contain the errors and %FALSE will be returned.
433         *
434         * Params:
435         *     result = a #GAsyncResult.
436         *
437         * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
438         *
439         * Since: 2.22
440         *
441         * Throws: GException on failure.
442         */
443        public bool unmountWithOperationFinish(AsyncResultIF result);
444
445        /**
446         * Decrements the shadow count on @mount. Usually used by
447         * #GVolumeMonitor implementations when destroying a shadow mount for
448         * @mount, see g_mount_is_shadowed() for more information. The caller
449         * will need to emit the #GMount::changed signal on @mount manually.
450         *
451         * Since: 2.20
452         */
453        public void unshadow();
454
455        /**
456         * Emitted when the mount has been changed.
457         */
458        gulong addOnChanged(void delegate(MountIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
459
460        /**
461         * This signal is emitted when the #GMount is about to be
462         * unmounted.
463         *
464         * Since: 2.22
465         */
466        gulong addOnPreUnmount(void delegate(MountIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
467
468        /**
469         * This signal is emitted when the #GMount have been
470         * unmounted. If the recipient is holding references to the
471         * object they should release them so the object can be
472         * finalized.
473         */
474        gulong addOnUnmounted(void delegate(MountIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
475}
Note: See TracBrowser for help on using the repository browser.