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))
47 * @parent_instance: The parent instance.
49 * A Volume Monitor that watches for volume events.
51 typedef struct _GVolumeMonitor GVolumeMonitor;
52 typedef struct _GVolumeMonitorClass GVolumeMonitorClass;
54 struct _GVolumeMonitor {
55 GObject parent_instance;
61 struct _GVolumeMonitorClass {
62 GObjectClass parent_class;
66 void (* volume_added) (GVolumeMonitor *volume_monitor,
68 void (* volume_removed) (GVolumeMonitor *volume_monitor,
70 void (* volume_changed) (GVolumeMonitor *volume_monitor,
73 void (* mount_added) (GVolumeMonitor *volume_monitor,
75 void (* mount_removed) (GVolumeMonitor *volume_monitor,
77 void (* mount_pre_unmount) (GVolumeMonitor *volume_monitor,
79 void (* mount_changed) (GVolumeMonitor *volume_monitor,
82 void (* drive_connected) (GVolumeMonitor *volume_monitor,
84 void (* drive_disconnected) (GVolumeMonitor *volume_monitor,
86 void (* drive_changed) (GVolumeMonitor *volume_monitor,
91 GList * (*get_connected_drives) (GVolumeMonitor *volume_monitor);
92 GList * (*get_volumes) (GVolumeMonitor *volume_monitor);
93 GList * (*get_mounts) (GVolumeMonitor *volume_monitor);
96 /* Padding for future expansion */
97 void (*_g_reserved1) (void);
98 void (*_g_reserved2) (void);
99 void (*_g_reserved3) (void);
100 void (*_g_reserved4) (void);
101 void (*_g_reserved5) (void);
102 void (*_g_reserved6) (void);
103 void (*_g_reserved7) (void);
104 void (*_g_reserved8) (void);
107 GType g_volume_monitor_get_type (void) G_GNUC_CONST;
109 GVolumeMonitor *g_volume_monitor_get (void);
110 GList * g_volume_monitor_get_connected_drives (GVolumeMonitor *volume_monitor);
111 GList * g_volume_monitor_get_volumes (GVolumeMonitor *volume_monitor);
112 GList * g_volume_monitor_get_mounts (GVolumeMonitor *volume_monitor);
116 #endif /* __G_VOLUME_MONITOR_H__ */