1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
3 /* GIO - GLib Input, Output and Streaming Library
5 * Copyright (C) 2006-2007 Red Hat, Inc.
7 * SPDX-License-Identifier: LGPL-2.1-or-later
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General
20 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
22 * Author: Alexander Larsson <alexl@redhat.com>
23 * David Zeuthen <davidz@redhat.com>
26 #ifndef __G_VOLUME_MONITOR_H__
27 #define __G_VOLUME_MONITOR_H__
29 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
30 #error "Only <gio/gio.h> can be included directly."
33 #include <gio/giotypes.h>
37 #define G_TYPE_VOLUME_MONITOR (g_volume_monitor_get_type ())
38 #define G_VOLUME_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_VOLUME_MONITOR, GVolumeMonitor))
39 #define G_VOLUME_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_VOLUME_MONITOR, GVolumeMonitorClass))
40 #define G_VOLUME_MONITOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_VOLUME_MONITOR, GVolumeMonitorClass))
41 #define G_IS_VOLUME_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_VOLUME_MONITOR))
42 #define G_IS_VOLUME_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_VOLUME_MONITOR))
45 * G_VOLUME_MONITOR_EXTENSION_POINT_NAME:
47 * Extension point for volume monitor functionality.
48 * See [Extending GIO][extending-gio].
50 #define G_VOLUME_MONITOR_EXTENSION_POINT_NAME "gio-volume-monitor"
52 typedef struct _GVolumeMonitorClass GVolumeMonitorClass;
54 struct _GVolumeMonitor
56 GObject parent_instance;
62 struct _GVolumeMonitorClass
64 GObjectClass parent_class;
68 void (* volume_added) (GVolumeMonitor *volume_monitor,
70 void (* volume_removed) (GVolumeMonitor *volume_monitor,
72 void (* volume_changed) (GVolumeMonitor *volume_monitor,
75 void (* mount_added) (GVolumeMonitor *volume_monitor,
77 void (* mount_removed) (GVolumeMonitor *volume_monitor,
79 void (* mount_pre_unmount) (GVolumeMonitor *volume_monitor,
81 void (* mount_changed) (GVolumeMonitor *volume_monitor,
84 void (* drive_connected) (GVolumeMonitor *volume_monitor,
86 void (* drive_disconnected) (GVolumeMonitor *volume_monitor,
88 void (* drive_changed) (GVolumeMonitor *volume_monitor,
93 gboolean (* is_supported) (void);
95 GList * (* get_connected_drives) (GVolumeMonitor *volume_monitor);
96 GList * (* get_volumes) (GVolumeMonitor *volume_monitor);
97 GList * (* get_mounts) (GVolumeMonitor *volume_monitor);
99 GVolume * (* get_volume_for_uuid) (GVolumeMonitor *volume_monitor,
102 GMount * (* get_mount_for_uuid) (GVolumeMonitor *volume_monitor,
106 /* These arguments are unfortunately backwards by mistake (bug #520169). Deprecated in 2.20. */
107 GVolume * (* adopt_orphan_mount) (GMount *mount,
108 GVolumeMonitor *volume_monitor);
110 /* signal added in 2.17 */
111 void (* drive_eject_button) (GVolumeMonitor *volume_monitor,
114 /* signal added in 2.21 */
115 void (* drive_stop_button) (GVolumeMonitor *volume_monitor,
119 /* Padding for future expansion */
120 void (*_g_reserved1) (void);
121 void (*_g_reserved2) (void);
122 void (*_g_reserved3) (void);
123 void (*_g_reserved4) (void);
124 void (*_g_reserved5) (void);
125 void (*_g_reserved6) (void);
129 GType g_volume_monitor_get_type (void) G_GNUC_CONST;
132 GVolumeMonitor *g_volume_monitor_get (void);
134 GList * g_volume_monitor_get_connected_drives (GVolumeMonitor *volume_monitor);
136 GList * g_volume_monitor_get_volumes (GVolumeMonitor *volume_monitor);
138 GList * g_volume_monitor_get_mounts (GVolumeMonitor *volume_monitor);
140 GVolume * g_volume_monitor_get_volume_for_uuid (GVolumeMonitor *volume_monitor,
143 GMount * g_volume_monitor_get_mount_for_uuid (GVolumeMonitor *volume_monitor,
147 GVolume * g_volume_monitor_adopt_orphan_mount (GMount *mount);
151 #endif /* __G_VOLUME_MONITOR_H__ */