Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:58

0001 /* GIO - GLib Input, Output and Streaming Library
0002  *
0003  * Copyright (C) 2006-2008 Red Hat, Inc.
0004  *
0005  * SPDX-License-Identifier: LGPL-2.1-or-later
0006  *
0007  * This library is free software; you can redistribute it and/or
0008  * modify it under the terms of the GNU Lesser General Public
0009  * License as published by the Free Software Foundation; either
0010  * version 2.1 of the License, or (at your option) any later version.
0011  *
0012  * This library is distributed in the hope that it will be useful,
0013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015  * Lesser General Public License for more details.
0016  *
0017  * You should have received a copy of the GNU Lesser General
0018  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
0019  *
0020  * Author: Alexander Larsson <alexl@redhat.com>
0021  *         David Zeuthen <davidz@redhat.com>
0022  */
0023 
0024 #ifndef __G_MOUNT_H__
0025 #define __G_MOUNT_H__
0026 
0027 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
0028 #error "Only <gio/gio.h> can be included directly."
0029 #endif
0030 
0031 #include <gio/giotypes.h>
0032 
0033 G_BEGIN_DECLS
0034 
0035 #define G_TYPE_MOUNT            (g_mount_get_type ())
0036 #define G_MOUNT(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_MOUNT, GMount))
0037 #define G_IS_MOUNT(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_MOUNT))
0038 #define G_MOUNT_GET_IFACE(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_MOUNT, GMountIface))
0039 
0040 typedef struct _GMountIface    GMountIface;
0041 
0042 /**
0043  * GMountIface:
0044  * @g_iface: The parent interface.
0045  * @changed: Changed signal that is emitted when the mount's state has changed.
0046  * @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.
0047  * @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.
0048  * @get_root: Gets a #GFile to the root directory of the #GMount.
0049  * @get_name: Gets a string containing the name of the #GMount.
0050  * @get_icon: Gets a #GIcon for the #GMount.
0051  * @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.
0052  * @get_volume: Gets a #GVolume the mount is located on. Returns %NULL if the #GMount is not associated with a #GVolume.
0053  * @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.
0054  * @can_unmount: Checks if a #GMount can be unmounted.
0055  * @can_eject: Checks if a #GMount can be ejected.
0056  * @unmount: Starts unmounting a #GMount.
0057  * @unmount_finish: Finishes an unmounting operation.
0058  * @eject: Starts ejecting a #GMount.
0059  * @eject_finish: Finishes an eject operation.
0060  * @remount: Starts remounting a #GMount.
0061  * @remount_finish: Finishes a remounting operation.
0062  * @guess_content_type: Starts guessing the type of the content of a #GMount.
0063  *     See g_mount_guess_content_type() for more information on content
0064  *     type guessing. This operation was added in 2.18.
0065  * @guess_content_type_finish: Finishes a content type guessing operation. Added in 2.18.
0066  * @guess_content_type_sync: Synchronous variant of @guess_content_type. Added in 2.18
0067  * @unmount_with_operation: Starts unmounting a #GMount using a #GMountOperation. Since 2.22.
0068  * @unmount_with_operation_finish: Finishes an unmounting operation using a #GMountOperation. Since 2.22.
0069  * @eject_with_operation: Starts ejecting a #GMount using a #GMountOperation. Since 2.22.
0070  * @eject_with_operation_finish: Finishes an eject operation using a #GMountOperation. Since 2.22.
0071  * @get_default_location: Gets a #GFile indication a start location that can be use as the entry point for this mount. Since 2.24.
0072  * @get_sort_key: Gets a key used for sorting #GMount instance or %NULL if no such key exists. Since 2.32.
0073  * @get_symbolic_icon: Gets a symbolic #GIcon for the #GMount. Since 2.34.
0074  *
0075  * Interface for implementing operations for mounts.
0076  **/
0077 struct _GMountIface
0078 {
0079   GTypeInterface g_iface;
0080 
0081   /* signals */
0082 
0083   void        (* changed)                   (GMount              *mount);
0084   void        (* unmounted)                 (GMount              *mount);
0085 
0086   /* Virtual Table */
0087 
0088   GFile     * (* get_root)                  (GMount              *mount);
0089   char      * (* get_name)                  (GMount              *mount);
0090   GIcon     * (* get_icon)                  (GMount              *mount);
0091   char      * (* get_uuid)                  (GMount              *mount);
0092   GVolume   * (* get_volume)                (GMount              *mount);
0093   GDrive    * (* get_drive)                 (GMount              *mount);
0094   gboolean    (* can_unmount)               (GMount              *mount);
0095   gboolean    (* can_eject)                 (GMount              *mount);
0096 
0097   void        (* unmount)                   (GMount              *mount,
0098                                              GMountUnmountFlags   flags,
0099                                              GCancellable        *cancellable,
0100                                              GAsyncReadyCallback  callback,
0101                                              gpointer             user_data);
0102   gboolean    (* unmount_finish)            (GMount              *mount,
0103                                              GAsyncResult        *result,
0104                                              GError             **error);
0105 
0106   void        (* eject)                     (GMount              *mount,
0107                                              GMountUnmountFlags   flags,
0108                                              GCancellable        *cancellable,
0109                                              GAsyncReadyCallback  callback,
0110                                              gpointer             user_data);
0111   gboolean    (* eject_finish)              (GMount              *mount,
0112                                              GAsyncResult        *result,
0113                                              GError             **error);
0114 
0115   void        (* remount)                   (GMount              *mount,
0116                                              GMountMountFlags     flags,
0117                                              GMountOperation     *mount_operation,
0118                                              GCancellable        *cancellable,
0119                                              GAsyncReadyCallback  callback,
0120                                              gpointer             user_data);
0121   gboolean    (* remount_finish)            (GMount              *mount,
0122                                              GAsyncResult        *result,
0123                                              GError             **error);
0124 
0125   void        (* guess_content_type)        (GMount              *mount,
0126                                              gboolean             force_rescan,
0127                                              GCancellable        *cancellable,
0128                                              GAsyncReadyCallback  callback,
0129                                              gpointer             user_data);
0130   gchar    ** (* guess_content_type_finish) (GMount              *mount,
0131                                              GAsyncResult        *result,
0132                                              GError             **error);
0133   gchar    ** (* guess_content_type_sync)   (GMount              *mount,
0134                                              gboolean             force_rescan,
0135                                              GCancellable        *cancellable,
0136                                              GError             **error);
0137 
0138   /* Signal, not VFunc */
0139   void        (* pre_unmount)               (GMount              *mount);
0140 
0141   void        (* unmount_with_operation)    (GMount              *mount,
0142                                              GMountUnmountFlags   flags,
0143                                              GMountOperation     *mount_operation,
0144                                              GCancellable        *cancellable,
0145                                              GAsyncReadyCallback  callback,
0146                                              gpointer             user_data);
0147   gboolean    (* unmount_with_operation_finish) (GMount          *mount,
0148                                              GAsyncResult        *result,
0149                                              GError             **error);
0150 
0151   void        (* eject_with_operation)      (GMount              *mount,
0152                                              GMountUnmountFlags   flags,
0153                                              GMountOperation     *mount_operation,
0154                                              GCancellable        *cancellable,
0155                                              GAsyncReadyCallback  callback,
0156                                              gpointer             user_data);
0157   gboolean    (* eject_with_operation_finish) (GMount            *mount,
0158                                              GAsyncResult        *result,
0159                                              GError             **error);
0160   GFile     * (* get_default_location)      (GMount              *mount);
0161 
0162   const gchar * (* get_sort_key)            (GMount              *mount);
0163   GIcon       * (* get_symbolic_icon)       (GMount              *mount);
0164 };
0165 
0166 GIO_AVAILABLE_IN_ALL
0167 GType       g_mount_get_type                  (void) G_GNUC_CONST;
0168 
0169 GIO_AVAILABLE_IN_ALL
0170 GFile     * g_mount_get_root                  (GMount              *mount);
0171 GIO_AVAILABLE_IN_ALL
0172 GFile     * g_mount_get_default_location      (GMount              *mount);
0173 GIO_AVAILABLE_IN_ALL
0174 char      * g_mount_get_name                  (GMount              *mount);
0175 GIO_AVAILABLE_IN_ALL
0176 GIcon     * g_mount_get_icon                  (GMount              *mount);
0177 GIO_AVAILABLE_IN_ALL
0178 GIcon     * g_mount_get_symbolic_icon         (GMount              *mount);
0179 GIO_AVAILABLE_IN_ALL
0180 char      * g_mount_get_uuid                  (GMount              *mount);
0181 GIO_AVAILABLE_IN_ALL
0182 GVolume   * g_mount_get_volume                (GMount              *mount);
0183 GIO_AVAILABLE_IN_ALL
0184 GDrive    * g_mount_get_drive                 (GMount              *mount);
0185 GIO_AVAILABLE_IN_ALL
0186 gboolean    g_mount_can_unmount               (GMount              *mount);
0187 GIO_AVAILABLE_IN_ALL
0188 gboolean    g_mount_can_eject                 (GMount              *mount);
0189 
0190 GIO_DEPRECATED_FOR(g_mount_unmount_with_operation)
0191 void        g_mount_unmount                   (GMount              *mount,
0192                                                GMountUnmountFlags   flags,
0193                                                GCancellable        *cancellable,
0194                                                GAsyncReadyCallback  callback,
0195                                                gpointer             user_data);
0196 
0197 GIO_DEPRECATED_FOR(g_mount_unmount_with_operation_finish)
0198 gboolean    g_mount_unmount_finish            (GMount              *mount,
0199                                                GAsyncResult        *result,
0200                                                GError             **error);
0201 
0202 GIO_DEPRECATED_FOR(g_mount_eject_with_operation)
0203 void        g_mount_eject                     (GMount              *mount,
0204                                                GMountUnmountFlags   flags,
0205                                                GCancellable        *cancellable,
0206                                                GAsyncReadyCallback  callback,
0207                                                gpointer             user_data);
0208 
0209 GIO_DEPRECATED_FOR(g_mount_eject_with_operation_finish)
0210 gboolean    g_mount_eject_finish              (GMount              *mount,
0211                                                GAsyncResult        *result,
0212                                                GError             **error);
0213 
0214 GIO_AVAILABLE_IN_ALL
0215 void        g_mount_remount                   (GMount              *mount,
0216                                                GMountMountFlags     flags,
0217                                                GMountOperation     *mount_operation,
0218                                                GCancellable        *cancellable,
0219                                                GAsyncReadyCallback  callback,
0220                                                gpointer             user_data);
0221 GIO_AVAILABLE_IN_ALL
0222 gboolean    g_mount_remount_finish            (GMount              *mount,
0223                                                GAsyncResult        *result,
0224                                                GError             **error);
0225 
0226 GIO_AVAILABLE_IN_ALL
0227 void        g_mount_guess_content_type        (GMount              *mount,
0228                                                gboolean             force_rescan,
0229                                                GCancellable        *cancellable,
0230                                                GAsyncReadyCallback  callback,
0231                                                gpointer             user_data);
0232 GIO_AVAILABLE_IN_ALL
0233 gchar    ** g_mount_guess_content_type_finish (GMount              *mount,
0234                                                GAsyncResult        *result,
0235                                                GError             **error);
0236 GIO_AVAILABLE_IN_ALL
0237 gchar    ** g_mount_guess_content_type_sync   (GMount              *mount,
0238                                                gboolean             force_rescan,
0239                                                GCancellable        *cancellable,
0240                                                GError             **error);
0241 
0242 GIO_AVAILABLE_IN_ALL
0243 gboolean    g_mount_is_shadowed               (GMount              *mount);
0244 GIO_AVAILABLE_IN_ALL
0245 void        g_mount_shadow                    (GMount              *mount);
0246 GIO_AVAILABLE_IN_ALL
0247 void        g_mount_unshadow                  (GMount              *mount);
0248 
0249 GIO_AVAILABLE_IN_ALL
0250 void        g_mount_unmount_with_operation    (GMount              *mount,
0251                                                GMountUnmountFlags   flags,
0252                                                GMountOperation     *mount_operation,
0253                                                GCancellable        *cancellable,
0254                                                GAsyncReadyCallback  callback,
0255                                                gpointer             user_data);
0256 GIO_AVAILABLE_IN_ALL
0257 gboolean    g_mount_unmount_with_operation_finish (GMount          *mount,
0258                                                GAsyncResult        *result,
0259                                                GError             **error);
0260 
0261 GIO_AVAILABLE_IN_ALL
0262 void        g_mount_eject_with_operation      (GMount              *mount,
0263                                                GMountUnmountFlags   flags,
0264                                                GMountOperation     *mount_operation,
0265                                                GCancellable        *cancellable,
0266                                                GAsyncReadyCallback  callback,
0267                                                gpointer             user_data);
0268 GIO_AVAILABLE_IN_ALL
0269 gboolean    g_mount_eject_with_operation_finish (GMount            *mount,
0270                                                GAsyncResult        *result,
0271                                                GError             **error);
0272 
0273 GIO_AVAILABLE_IN_ALL
0274 const gchar *g_mount_get_sort_key             (GMount              *mount);
0275 
0276 G_END_DECLS
0277 
0278 #endif /* __G_MOUNT_H__ */