s/parent/parent_instance/ in GObjects
[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  *         David Zeuthen <davidz@redhat.com>
22  */
23
24 #ifndef __G_VOLUME_MONITOR_H__
25 #define __G_VOLUME_MONITOR_H__
26
27 #include <glib-object.h>
28 #include <gio/gmount.h>
29 #include <gio/gvolume.h>
30 #include <gio/gdrive.h>
31
32 G_BEGIN_DECLS
33
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))
40
41 /**
42  * GVolumeMonitor:
43  * @parent_instance: The parent instance.
44  *
45  * A Volume Monitor that watches for volume events.
46  **/
47 typedef struct _GVolumeMonitor GVolumeMonitor;
48 typedef struct _GVolumeMonitorClass GVolumeMonitorClass;
49
50 struct _GVolumeMonitor {
51   GObject parent_instance;
52
53   /*< private >*/
54   gpointer priv;
55 };
56
57 struct _GVolumeMonitorClass {
58   GObjectClass parent_class;
59
60   /*< public >*/
61   /* signals */
62   void (* volume_added)     (GVolumeMonitor   *volume_monitor,
63                              GVolume          *volume);
64   void (* volume_removed)   (GVolumeMonitor   *volume_monitor,
65                              GVolume          *volume);
66   void (* volume_changed)   (GVolumeMonitor   *volume_monitor,
67                              GVolume          *volume);
68
69   void (* mount_added)       (GVolumeMonitor *volume_monitor,
70                               GMount         *mount);
71   void (* mount_removed)     (GVolumeMonitor *volume_monitor,
72                               GMount         *mount);
73   void (* mount_pre_unmount) (GVolumeMonitor *volume_monitor,
74                               GMount         *mount);
75   void (* mount_changed)     (GVolumeMonitor *volume_monitor,
76                               GMount         *mount);
77
78   void (* drive_connected)      (GVolumeMonitor *volume_monitor,
79                                  GDrive         *drive);
80   void (* drive_disconnected)   (GVolumeMonitor *volume_monitor,
81                                  GDrive         *drive);
82   void (* drive_changed)        (GVolumeMonitor *volume_monitor,
83                                  GDrive         *drive);
84
85   /* Vtable */
86
87   GList * (*get_connected_drives)   (GVolumeMonitor *volume_monitor);
88   GList * (*get_volumes)            (GVolumeMonitor *volume_monitor);
89   GList * (*get_mounts)             (GVolumeMonitor *volume_monitor);
90
91   /*< private >*/
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);
101 };
102
103 GType g_volume_monitor_get_type (void) G_GNUC_CONST;
104
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);
109
110 G_END_DECLS
111
112 #endif /* __G_VOLUME_MONITOR_H__ */