1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright (C) 2006-2007 Red Hat, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General
16 * Public License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 * Boston, MA 02111-1307, USA.
20 * Author: Alexander Larsson <alexl@redhat.com>
21 * David Zeuthen <davidz@redhat.com>
24 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
25 #error "Only <gio/gio.h> can be included directly."
28 #ifndef __G_VOLUME_MONITOR_H__
29 #define __G_VOLUME_MONITOR_H__
31 #include <glib-object.h>
32 #include <gio/gmount.h>
33 #include <gio/gvolume.h>
34 #include <gio/gdrive.h>
38 #define G_TYPE_VOLUME_MONITOR (g_volume_monitor_get_type ())
39 #define G_VOLUME_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_VOLUME_MONITOR, GVolumeMonitor))
40 #define G_VOLUME_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_VOLUME_MONITOR, GVolumeMonitorClass))
41 #define G_VOLUME_MONITOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_VOLUME_MONITOR, GVolumeMonitorClass))
42 #define G_IS_VOLUME_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_VOLUME_MONITOR))
43 #define G_IS_VOLUME_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_VOLUME_MONITOR))
46 * G_VOLUME_MONITOR_EXTENSION_POINT_NAME:
48 * Extension point for volume monitor functionality.
49 * See <link linkend="gio-extension-points">Extending GIO</link>.
51 #define G_VOLUME_MONITOR_EXTENSION_POINT_NAME "gio-volume-monitor"
55 * @parent_instance: The parent instance.
57 * A Volume Monitor that watches for volume events.
59 typedef struct _GVolumeMonitor GVolumeMonitor;
60 typedef struct _GVolumeMonitorClass GVolumeMonitorClass;
62 struct _GVolumeMonitor {
63 GObject parent_instance;
69 struct _GVolumeMonitorClass {
70 GObjectClass parent_class;
74 void (* volume_added) (GVolumeMonitor *volume_monitor,
76 void (* volume_removed) (GVolumeMonitor *volume_monitor,
78 void (* volume_changed) (GVolumeMonitor *volume_monitor,
81 void (* mount_added) (GVolumeMonitor *volume_monitor,
83 void (* mount_removed) (GVolumeMonitor *volume_monitor,
85 void (* mount_pre_unmount) (GVolumeMonitor *volume_monitor,
87 void (* mount_changed) (GVolumeMonitor *volume_monitor,
90 void (* drive_connected) (GVolumeMonitor *volume_monitor,
92 void (* drive_disconnected) (GVolumeMonitor *volume_monitor,
94 void (* drive_changed) (GVolumeMonitor *volume_monitor,
99 gboolean (*is_supported) (void);
101 GList * (*get_connected_drives) (GVolumeMonitor *volume_monitor);
102 GList * (*get_volumes) (GVolumeMonitor *volume_monitor);
103 GList * (*get_mounts) (GVolumeMonitor *volume_monitor);
105 GVolume * (*get_volume_for_uuid) (GVolumeMonitor *volume_monitor,
108 GMount * (*get_mount_for_uuid) (GVolumeMonitor *volume_monitor,
112 GVolume * (*adopt_orphan_mount) (GMount *mount);
116 /* Padding for future expansion */
117 void (*_g_reserved1) (void);
118 void (*_g_reserved2) (void);
119 void (*_g_reserved3) (void);
120 void (*_g_reserved4) (void);
121 void (*_g_reserved5) (void);
122 void (*_g_reserved6) (void);
123 void (*_g_reserved7) (void);
124 void (*_g_reserved8) (void);
127 GType g_volume_monitor_get_type (void) G_GNUC_CONST;
129 GVolumeMonitor *g_volume_monitor_get (void);
130 GList * g_volume_monitor_get_connected_drives (GVolumeMonitor *volume_monitor);
131 GList * g_volume_monitor_get_volumes (GVolumeMonitor *volume_monitor);
132 GList * g_volume_monitor_get_mounts (GVolumeMonitor *volume_monitor);
133 GVolume * g_volume_monitor_get_volume_for_uuid (GVolumeMonitor *volume_monitor,
135 GMount * g_volume_monitor_get_mount_for_uuid (GVolumeMonitor *volume_monitor,
138 GVolume * g_volume_monitor_adopt_orphan_mount (GMount *mount);
142 #endif /* __G_VOLUME_MONITOR_H__ */