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 #ifndef __G_VOLUME_MONITOR_H__
25 #define __G_VOLUME_MONITOR_H__
27 #include <glib-object.h>
28 #include <gio/gmount.h>
29 #include <gio/gvolume.h>
30 #include <gio/gdrive.h>
34 #define G_TYPE_VOLUME_MONITOR (g_volume_monitor_get_type ())
35 #define G_VOLUME_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_VOLUME_MONITOR, GVolumeMonitor))
36 #define G_VOLUME_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_VOLUME_MONITOR, GVolumeMonitorClass))
37 #define G_VOLUME_MONITOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_VOLUME_MONITOR, GVolumeMonitorClass))
38 #define G_IS_VOLUME_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_VOLUME_MONITOR))
39 #define G_IS_VOLUME_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_VOLUME_MONITOR))
43 * @parent_instance: The parent instance.
45 * A Volume Monitor that watches for volume events.
47 typedef struct _GVolumeMonitor GVolumeMonitor;
48 typedef struct _GVolumeMonitorClass GVolumeMonitorClass;
50 struct _GVolumeMonitor {
51 GObject parent_instance;
57 struct _GVolumeMonitorClass {
58 GObjectClass parent_class;
62 void (* volume_added) (GVolumeMonitor *volume_monitor,
64 void (* volume_removed) (GVolumeMonitor *volume_monitor,
66 void (* volume_changed) (GVolumeMonitor *volume_monitor,
69 void (* mount_added) (GVolumeMonitor *volume_monitor,
71 void (* mount_removed) (GVolumeMonitor *volume_monitor,
73 void (* mount_pre_unmount) (GVolumeMonitor *volume_monitor,
75 void (* mount_changed) (GVolumeMonitor *volume_monitor,
78 void (* drive_connected) (GVolumeMonitor *volume_monitor,
80 void (* drive_disconnected) (GVolumeMonitor *volume_monitor,
82 void (* drive_changed) (GVolumeMonitor *volume_monitor,
87 GList * (*get_connected_drives) (GVolumeMonitor *volume_monitor);
88 GList * (*get_volumes) (GVolumeMonitor *volume_monitor);
89 GList * (*get_mounts) (GVolumeMonitor *volume_monitor);
92 /* Padding for future expansion */
93 void (*_g_reserved1) (void);
94 void (*_g_reserved2) (void);
95 void (*_g_reserved3) (void);
96 void (*_g_reserved4) (void);
97 void (*_g_reserved5) (void);
98 void (*_g_reserved6) (void);
99 void (*_g_reserved7) (void);
100 void (*_g_reserved8) (void);
103 GType g_volume_monitor_get_type (void) G_GNUC_CONST;
105 GVolumeMonitor *g_volume_monitor_get (void);
106 GList * g_volume_monitor_get_connected_drives (GVolumeMonitor *volume_monitor);
107 GList * g_volume_monitor_get_volumes (GVolumeMonitor *volume_monitor);
108 GList * g_volume_monitor_get_mounts (GVolumeMonitor *volume_monitor);
112 #endif /* __G_VOLUME_MONITOR_H__ */