Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:00:00

0001 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
0002 
0003 /* GIO - GLib Input, Output and Streaming Library
0004  *
0005  * Copyright (C) 2006-2007 Red Hat, Inc.
0006  *
0007  * SPDX-License-Identifier: LGPL-2.1-or-later
0008  *
0009  * This library is free software; you can redistribute it and/or
0010  * modify it under the terms of the GNU Lesser General Public
0011  * License as published by the Free Software Foundation; either
0012  * version 2.1 of the License, or (at your option) any later version.
0013  *
0014  * This library is distributed in the hope that it will be useful,
0015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0017  * Lesser General Public License for more details.
0018  *
0019  * You should have received a copy of the GNU Lesser General
0020  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
0021  *
0022  * Author: Alexander Larsson <alexl@redhat.com>
0023  *         David Zeuthen <davidz@redhat.com>
0024  */
0025 
0026 #ifndef __G_VOLUME_MONITOR_H__
0027 #define __G_VOLUME_MONITOR_H__
0028 
0029 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
0030 #error "Only <gio/gio.h> can be included directly."
0031 #endif
0032 
0033 #include <gio/giotypes.h>
0034 
0035 G_BEGIN_DECLS
0036 
0037 #define G_TYPE_VOLUME_MONITOR         (g_volume_monitor_get_type ())
0038 #define G_VOLUME_MONITOR(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_VOLUME_MONITOR, GVolumeMonitor))
0039 #define G_VOLUME_MONITOR_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_VOLUME_MONITOR, GVolumeMonitorClass))
0040 #define G_VOLUME_MONITOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_VOLUME_MONITOR, GVolumeMonitorClass))
0041 #define G_IS_VOLUME_MONITOR(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_VOLUME_MONITOR))
0042 #define G_IS_VOLUME_MONITOR_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_VOLUME_MONITOR))
0043 
0044 /**
0045  * G_VOLUME_MONITOR_EXTENSION_POINT_NAME:
0046  *
0047  * Extension point for volume monitor functionality.
0048  * See [Extending GIO][extending-gio].
0049  */
0050 #define G_VOLUME_MONITOR_EXTENSION_POINT_NAME "gio-volume-monitor"
0051 
0052 typedef struct _GVolumeMonitorClass GVolumeMonitorClass;
0053 
0054 struct _GVolumeMonitor
0055 {
0056   GObject parent_instance;
0057 
0058   /*< private >*/
0059   gpointer priv;
0060 };
0061 
0062 struct _GVolumeMonitorClass
0063 {
0064   GObjectClass parent_class;
0065 
0066   /*< public >*/
0067   /* signals */
0068   void      (* volume_added)         (GVolumeMonitor *volume_monitor,
0069                                       GVolume        *volume);
0070   void      (* volume_removed)       (GVolumeMonitor *volume_monitor,
0071                                       GVolume        *volume);
0072   void      (* volume_changed)       (GVolumeMonitor *volume_monitor,
0073                                       GVolume        *volume);
0074 
0075   void      (* mount_added)          (GVolumeMonitor *volume_monitor,
0076                                       GMount         *mount);
0077   void      (* mount_removed)        (GVolumeMonitor *volume_monitor,
0078                                       GMount         *mount);
0079   void      (* mount_pre_unmount)    (GVolumeMonitor *volume_monitor,
0080                                       GMount         *mount);
0081   void      (* mount_changed)        (GVolumeMonitor *volume_monitor,
0082                                       GMount         *mount);
0083 
0084   void      (* drive_connected)      (GVolumeMonitor *volume_monitor,
0085                                       GDrive         *drive);
0086   void      (* drive_disconnected)   (GVolumeMonitor *volume_monitor,
0087                                       GDrive         *drive);
0088   void      (* drive_changed)        (GVolumeMonitor *volume_monitor,
0089                                       GDrive         *drive);
0090 
0091   /* Vtable */
0092 
0093   gboolean  (* is_supported)         (void);
0094 
0095   GList   * (* get_connected_drives) (GVolumeMonitor *volume_monitor);
0096   GList   * (* get_volumes)          (GVolumeMonitor *volume_monitor);
0097   GList   * (* get_mounts)           (GVolumeMonitor *volume_monitor);
0098 
0099   GVolume * (* get_volume_for_uuid)  (GVolumeMonitor *volume_monitor,
0100                                       const char     *uuid);
0101 
0102   GMount  * (* get_mount_for_uuid)   (GVolumeMonitor *volume_monitor,
0103                                       const char     *uuid);
0104 
0105 
0106   /* These arguments are unfortunately backwards by mistake (bug #520169). Deprecated in 2.20. */
0107   GVolume * (* adopt_orphan_mount)   (GMount         *mount,
0108                                       GVolumeMonitor *volume_monitor);
0109 
0110   /* signal added in 2.17 */
0111   void      (* drive_eject_button)   (GVolumeMonitor *volume_monitor,
0112                                       GDrive         *drive);
0113 
0114   /* signal added in 2.21 */
0115   void      (* drive_stop_button)   (GVolumeMonitor *volume_monitor,
0116                                      GDrive         *drive);
0117 
0118   /*< private >*/
0119   /* Padding for future expansion */
0120   void (*_g_reserved1) (void);
0121   void (*_g_reserved2) (void);
0122   void (*_g_reserved3) (void);
0123   void (*_g_reserved4) (void);
0124   void (*_g_reserved5) (void);
0125   void (*_g_reserved6) (void);
0126 };
0127 
0128 GIO_AVAILABLE_IN_ALL
0129 GType           g_volume_monitor_get_type             (void) G_GNUC_CONST;
0130 
0131 GIO_AVAILABLE_IN_ALL
0132 GVolumeMonitor *g_volume_monitor_get                  (void);
0133 GIO_AVAILABLE_IN_ALL
0134 GList *         g_volume_monitor_get_connected_drives (GVolumeMonitor *volume_monitor);
0135 GIO_AVAILABLE_IN_ALL
0136 GList *         g_volume_monitor_get_volumes          (GVolumeMonitor *volume_monitor);
0137 GIO_AVAILABLE_IN_ALL
0138 GList *         g_volume_monitor_get_mounts           (GVolumeMonitor *volume_monitor);
0139 GIO_AVAILABLE_IN_ALL
0140 GVolume *       g_volume_monitor_get_volume_for_uuid  (GVolumeMonitor *volume_monitor,
0141                                                        const char     *uuid);
0142 GIO_AVAILABLE_IN_ALL
0143 GMount *        g_volume_monitor_get_mount_for_uuid   (GVolumeMonitor *volume_monitor,
0144                                                        const char     *uuid);
0145 
0146 GIO_DEPRECATED
0147 GVolume *       g_volume_monitor_adopt_orphan_mount   (GMount         *mount);
0148 
0149 G_END_DECLS
0150 
0151 #endif /* __G_VOLUME_MONITOR_H__ */