gio/ docs/reference/gio Merged gio-standalone into glib.
[platform/upstream/glib.git] / gio / gvolumemonitor.h
1 /* GIO - GLib Input, Output and Streaming Library
2  * 
3  * Copyright (C) 2006-2007 Red Hat, Inc.
4  *
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.
9  *
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.
14  *
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.
19  *
20  * Author: Alexander Larsson <alexl@redhat.com>
21  */
22
23 #ifndef __G_VOLUME_MONITOR_H__
24 #define __G_VOLUME_MONITOR_H__
25
26 #include <glib-object.h>
27 #include <gio/gvolume.h>
28 #include <gio/gdrive.h>
29
30 G_BEGIN_DECLS
31
32 #define G_TYPE_VOLUME_MONITOR         (g_volume_monitor_get_type ())
33 #define G_VOLUME_MONITOR(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_VOLUME_MONITOR, GVolumeMonitor))
34 #define G_VOLUME_MONITOR_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_VOLUME_MONITOR, GVolumeMonitorClass))
35 #define G_VOLUME_MONITOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_VOLUME_MONITOR, GVolumeMonitorClass))
36 #define G_IS_VOLUME_MONITOR(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_VOLUME_MONITOR))
37 #define G_IS_VOLUME_MONITOR_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_VOLUME_MONITOR))
38
39 typedef struct _GVolumeMonitor GVolumeMonitor;
40 typedef struct _GVolumeMonitorClass GVolumeMonitorClass;
41
42 struct _GVolumeMonitor {
43   GObject parent;
44   gpointer priv;
45 };
46
47 struct _GVolumeMonitorClass {
48   GObjectClass parent_class;
49
50   /*< public >*/
51   /* signals */
52   void (* volume_mounted)       (GVolumeMonitor *volume_monitor,
53                                  GVolume        *volume);
54   void (* volume_pre_unmount)   (GVolumeMonitor *volume_monitor,
55                                  GVolume        *volume);
56   void (* volume_unmounted)     (GVolumeMonitor *volume_monitor,
57                                  GVolume        *volume);
58   void (* drive_connected)      (GVolumeMonitor *volume_monitor,
59                                  GDrive         *drive);
60   void (* drive_disconnected)   (GVolumeMonitor *volume_monitor,
61                                  GDrive         *drive);
62
63   /* Vtable */
64
65   GList * (*get_mounted_volumes)  (GVolumeMonitor *volume_monitor);
66   GList * (*get_connected_drives) (GVolumeMonitor *volume_monitor);
67
68
69   /* Padding for future expansion */
70   void (*_g_reserved1) (void);
71   void (*_g_reserved2) (void);
72   void (*_g_reserved3) (void);
73   void (*_g_reserved4) (void);
74   void (*_g_reserved5) (void);
75   void (*_g_reserved6) (void);
76   void (*_g_reserved7) (void);
77   void (*_g_reserved8) (void);
78 };
79
80 GType g_volume_monitor_get_type (void) G_GNUC_CONST;
81
82 GVolumeMonitor *g_volume_monitor_get                  (void);
83 GList *         g_volume_monitor_get_mounted_volumes  (GVolumeMonitor *volume_monitor);
84 GList *         g_volume_monitor_get_connected_drives (GVolumeMonitor *volume_monitor);
85
86 G_END_DECLS
87
88 #endif /* __G_VOLUME_MONITOR_H__ */