Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
gmount.h
Go to the documentation of this file.
1/* GIO - GLib Input, Output and Streaming Library
2 *
3 * Copyright (C) 2006-2008 Red Hat, Inc.
4 *
5 * SPDX-License-Identifier: LGPL-2.1-or-later
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General
18 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 *
20 * Author: Alexander Larsson <alexl@redhat.com>
21 * David Zeuthen <davidz@redhat.com>
22 */
23
24#ifndef __G_MOUNT_H__
25#define __G_MOUNT_H__
26
27#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
28#error "Only <gio/gio.h> can be included directly."
29#endif
30
31#include <gio/giotypes.h>
32
34
35#define G_TYPE_MOUNT (g_mount_get_type ())
36#define G_MOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_MOUNT, GMount))
37#define G_IS_MOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_MOUNT))
38#define G_MOUNT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_MOUNT, GMountIface))
39
41
42/**
43 * GMountIface:
44 * @g_iface: The parent interface.
45 * @changed: Changed signal that is emitted when the mount's state has changed.
46 * @unmounted: The unmounted signal that is emitted when the #GMount have been unmounted. If the recipient is holding references to the object they should release them so the object can be finalized.
47 * @pre_unmount: The ::pre-unmount signal that is emitted when the #GMount will soon be emitted. If the recipient is somehow holding the mount open by keeping an open file on it it should close the file.
48 * @get_root: Gets a #GFile to the root directory of the #GMount.
49 * @get_name: Gets a string containing the name of the #GMount.
50 * @get_icon: Gets a #GIcon for the #GMount.
51 * @get_uuid: Gets the UUID for the #GMount. The reference is typically based on the file system UUID for the mount in question and should be considered an opaque string. Returns %NULL if there is no UUID available.
52 * @get_volume: Gets a #GVolume the mount is located on. Returns %NULL if the #GMount is not associated with a #GVolume.
53 * @get_drive: Gets a #GDrive the volume of the mount is located on. Returns %NULL if the #GMount is not associated with a #GDrive or a #GVolume. This is convenience method for getting the #GVolume and using that to get the #GDrive.
54 * @can_unmount: Checks if a #GMount can be unmounted.
55 * @can_eject: Checks if a #GMount can be ejected.
56 * @unmount: Starts unmounting a #GMount.
57 * @unmount_finish: Finishes an unmounting operation.
58 * @eject: Starts ejecting a #GMount.
59 * @eject_finish: Finishes an eject operation.
60 * @remount: Starts remounting a #GMount.
61 * @remount_finish: Finishes a remounting operation.
62 * @guess_content_type: Starts guessing the type of the content of a #GMount.
63 * See g_mount_guess_content_type() for more information on content
64 * type guessing. This operation was added in 2.18.
65 * @guess_content_type_finish: Finishes a content type guessing operation. Added in 2.18.
66 * @guess_content_type_sync: Synchronous variant of @guess_content_type. Added in 2.18
67 * @unmount_with_operation: Starts unmounting a #GMount using a #GMountOperation. Since 2.22.
68 * @unmount_with_operation_finish: Finishes an unmounting operation using a #GMountOperation. Since 2.22.
69 * @eject_with_operation: Starts ejecting a #GMount using a #GMountOperation. Since 2.22.
70 * @eject_with_operation_finish: Finishes an eject operation using a #GMountOperation. Since 2.22.
71 * @get_default_location: Gets a #GFile indication a start location that can be use as the entry point for this mount. Since 2.24.
72 * @get_sort_key: Gets a key used for sorting #GMount instance or %NULL if no such key exists. Since 2.32.
73 * @get_symbolic_icon: Gets a symbolic #GIcon for the #GMount. Since 2.34.
74 *
75 * Interface for implementing operations for mounts.
76 **/
78{
80
81 /* signals */
82
83 void (* changed) (GMount *mount);
84 void (* unmounted) (GMount *mount);
85
86 /* Virtual Table */
87
88 GFile * (* get_root) (GMount *mount);
89 char * (* get_name) (GMount *mount);
90 GIcon * (* get_icon) (GMount *mount);
91 char * (* get_uuid) (GMount *mount);
92 GVolume * (* get_volume) (GMount *mount);
93 GDrive * (* get_drive) (GMount *mount);
96
97 void (* unmount) (GMount *mount,
99 GCancellable *cancellable,
100 GAsyncReadyCallback callback,
101 gpointer user_data);
103 GAsyncResult *result,
104 GError **error);
105
106 void (* eject) (GMount *mount,
107 GMountUnmountFlags flags,
108 GCancellable *cancellable,
109 GAsyncReadyCallback callback,
110 gpointer user_data);
112 GAsyncResult *result,
113 GError **error);
114
115 void (* remount) (GMount *mount,
116 GMountMountFlags flags,
117 GMountOperation *mount_operation,
118 GCancellable *cancellable,
119 GAsyncReadyCallback callback,
120 gpointer user_data);
122 GAsyncResult *result,
123 GError **error);
124
125 void (* guess_content_type) (GMount *mount,
126 gboolean force_rescan,
127 GCancellable *cancellable,
128 GAsyncReadyCallback callback,
129 gpointer user_data);
130 gchar ** (* guess_content_type_finish) (GMount *mount,
131 GAsyncResult *result,
132 GError **error);
133 gchar ** (* guess_content_type_sync) (GMount *mount,
134 gboolean force_rescan,
135 GCancellable *cancellable,
136 GError **error);
137
138 /* Signal, not VFunc */
139 void (* pre_unmount) (GMount *mount);
140
142 GMountUnmountFlags flags,
143 GMountOperation *mount_operation,
144 GCancellable *cancellable,
145 GAsyncReadyCallback callback,
146 gpointer user_data);
148 GAsyncResult *result,
149 GError **error);
150
151 void (* eject_with_operation) (GMount *mount,
152 GMountUnmountFlags flags,
153 GMountOperation *mount_operation,
154 GCancellable *cancellable,
155 GAsyncReadyCallback callback,
156 gpointer user_data);
158 GAsyncResult *result,
159 GError **error);
160 GFile * (* get_default_location) (GMount *mount);
161
162 const gchar * (* get_sort_key) (GMount *mount);
163 GIcon * (* get_symbolic_icon) (GMount *mount);
164};
165
168
174char * g_mount_get_name (GMount *mount);
180char * g_mount_get_uuid (GMount *mount);
189
192 GMountUnmountFlags flags,
193 GCancellable *cancellable,
194 GAsyncReadyCallback callback,
195 gpointer user_data);
196
199 GAsyncResult *result,
200 GError **error);
201
204 GMountUnmountFlags flags,
205 GCancellable *cancellable,
206 GAsyncReadyCallback callback,
207 gpointer user_data);
208
211 GAsyncResult *result,
212 GError **error);
213
216 GMountMountFlags flags,
217 GMountOperation *mount_operation,
218 GCancellable *cancellable,
219 GAsyncReadyCallback callback,
220 gpointer user_data);
223 GAsyncResult *result,
224 GError **error);
225
228 gboolean force_rescan,
229 GCancellable *cancellable,
230 GAsyncReadyCallback callback,
231 gpointer user_data);
234 GAsyncResult *result,
235 GError **error);
238 gboolean force_rescan,
239 GCancellable *cancellable,
240 GError **error);
241
245void g_mount_shadow (GMount *mount);
248
251 GMountUnmountFlags flags,
252 GMountOperation *mount_operation,
253 GCancellable *cancellable,
254 GAsyncReadyCallback callback,
255 gpointer user_data);
258 GAsyncResult *result,
259 GError **error);
260
263 GMountUnmountFlags flags,
264 GMountOperation *mount_operation,
265 GCancellable *cancellable,
266 GAsyncReadyCallback callback,
267 gpointer user_data);
270 GAsyncResult *result,
271 GError **error);
272
275
277
278#endif /* __G_MOUNT_H__ */
#define GIO_AVAILABLE_IN_ALL
#define GIO_DEPRECATED_FOR(f)
GMountUnmountFlags
Definition gioenums.h:263
GMountMountFlags
Definition gioenums.h:250
struct _GIcon GIcon
Definition giotypes.h:92
struct _GMount GMount
Definition giotypes.h:118
struct _GVolume GVolume
Definition giotypes.h:168
struct _GFile GFile
Definition giotypes.h:74
struct _GDrive GDrive
Definition giotypes.h:68
struct _GAsyncResult GAsyncResult
Definition giotypes.h:36
void(* GAsyncReadyCallback)(GObject *source_object, GAsyncResult *res, gpointer data)
Definition giotypes.h:190
#define G_END_DECLS
Definition gmacros.h:910
#define G_BEGIN_DECLS
Definition gmacros.h:909
#define G_GNUC_CONST
Definition gmacros.h:637
GIO_AVAILABLE_IN_ALL gboolean g_mount_eject_with_operation_finish(GMount *mount, GAsyncResult *result, GError **error)
GIO_AVAILABLE_IN_ALL gchar ** g_mount_guess_content_type_sync(GMount *mount, gboolean force_rescan, GCancellable *cancellable, GError **error)
GIO_AVAILABLE_IN_ALL void g_mount_unshadow(GMount *mount)
GIO_AVAILABLE_IN_ALL const gchar * g_mount_get_sort_key(GMount *mount)
GIO_AVAILABLE_IN_ALL gboolean g_mount_remount_finish(GMount *mount, GAsyncResult *result, GError **error)
GIO_AVAILABLE_IN_ALL char * g_mount_get_uuid(GMount *mount)
GIO_AVAILABLE_IN_ALL void g_mount_guess_content_type(GMount *mount, gboolean force_rescan, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
GIO_AVAILABLE_IN_ALL GFile * g_mount_get_default_location(GMount *mount)
GIO_AVAILABLE_IN_ALL gboolean g_mount_is_shadowed(GMount *mount)
GIO_AVAILABLE_IN_ALL void g_mount_shadow(GMount *mount)
GIO_AVAILABLE_IN_ALL void g_mount_eject_with_operation(GMount *mount, GMountUnmountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
void g_mount_eject(GMount *mount, GMountUnmountFlags flags, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
GIO_AVAILABLE_IN_ALL gboolean g_mount_can_unmount(GMount *mount)
GIO_AVAILABLE_IN_ALL char * g_mount_get_name(GMount *mount)
GIO_AVAILABLE_IN_ALL GIcon * g_mount_get_symbolic_icon(GMount *mount)
GIO_AVAILABLE_IN_ALL GType g_mount_get_type(void) G_GNUC_CONST
GIO_AVAILABLE_IN_ALL gchar ** g_mount_guess_content_type_finish(GMount *mount, GAsyncResult *result, GError **error)
gboolean g_mount_unmount_finish(GMount *mount, GAsyncResult *result, GError **error)
GIO_AVAILABLE_IN_ALL void g_mount_unmount_with_operation(GMount *mount, GMountUnmountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
GIO_AVAILABLE_IN_ALL GFile * g_mount_get_root(GMount *mount)
GIO_AVAILABLE_IN_ALL GIcon * g_mount_get_icon(GMount *mount)
GIO_AVAILABLE_IN_ALL gboolean g_mount_unmount_with_operation_finish(GMount *mount, GAsyncResult *result, GError **error)
GIO_AVAILABLE_IN_ALL void g_mount_remount(GMount *mount, GMountMountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
GIO_AVAILABLE_IN_ALL gboolean g_mount_can_eject(GMount *mount)
void g_mount_unmount(GMount *mount, GMountUnmountFlags flags, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
gboolean g_mount_eject_finish(GMount *mount, GAsyncResult *result, GError **error)
GIO_AVAILABLE_IN_ALL GDrive * g_mount_get_drive(GMount *mount)
GIO_AVAILABLE_IN_ALL GVolume * g_mount_get_volume(GMount *mount)
gsize GType
Definition gtype.h:427
gint gboolean
Definition gtypes.h:56
G_BEGIN_DECLS typedef char gchar
Definition gtypes.h:52
void * gpointer
Definition gtypes.h:109
static void error(LoadState *S, const char *why)
gboolean(* unmount_with_operation_finish)(GMount *mount, GAsyncResult *result, GError **error)
Definition gmount.h:147
void(* guess_content_type)(GMount *mount, gboolean force_rescan, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
Definition gmount.h:125
void(* eject_with_operation)(GMount *mount, GMountUnmountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
Definition gmount.h:151
GTypeInterface g_iface
Definition gmount.h:79
void(* unmounted)(GMount *mount)
Definition gmount.h:84
gboolean(* unmount_finish)(GMount *mount, GAsyncResult *result, GError **error)
Definition gmount.h:102
void(* pre_unmount)(GMount *mount)
Definition gmount.h:139
void(* changed)(GMount *mount)
Definition gmount.h:83
gboolean(* eject_with_operation_finish)(GMount *mount, GAsyncResult *result, GError **error)
Definition gmount.h:157
gboolean(* eject_finish)(GMount *mount, GAsyncResult *result, GError **error)
Definition gmount.h:111
void(* unmount_with_operation)(GMount *mount, GMountUnmountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
Definition gmount.h:141
void(* unmount)(GMount *mount, GMountUnmountFlags flags, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
Definition gmount.h:97
gboolean(* remount_finish)(GMount *mount, GAsyncResult *result, GError **error)
Definition gmount.h:121
void(* remount)(GMount *mount, GMountMountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
Definition gmount.h:115
gboolean(* can_eject)(GMount *mount)
Definition gmount.h:95
void(* eject)(GMount *mount, GMountUnmountFlags flags, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
Definition gmount.h:106
gboolean(* can_unmount)(GMount *mount)
Definition gmount.h:94