1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ |
2 | |
3 | /* GIO - GLib Input, Output and Streaming Library |
4 | * |
5 | * Copyright (C) 2006-2007 Red Hat, Inc. |
6 | * |
7 | * SPDX-License-Identifier: LGPL-2.1-or-later |
8 | * |
9 | * This library is free software; you can redistribute it and/or |
10 | * modify it under the terms of the GNU Lesser General Public |
11 | * License as published by the Free Software Foundation; either |
12 | * version 2.1 of the License, or (at your option) any later version. |
13 | * |
14 | * This library is distributed in the hope that it will be useful, |
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
17 | * Lesser General Public License for more details. |
18 | * |
19 | * You should have received a copy of the GNU Lesser General |
20 | * Public License along with this library; if not, see <http://www.gnu.org/licenses/>. |
21 | * |
22 | * Author: Alexander Larsson <alexl@redhat.com> |
23 | * David Zeuthen <davidz@redhat.com> |
24 | */ |
25 | |
26 | #ifndef __G_VOLUME_MONITOR_H__ |
27 | #define __G_VOLUME_MONITOR_H__ |
28 | |
29 | #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) |
30 | #error "Only <gio/gio.h> can be included directly." |
31 | #endif |
32 | |
33 | #include <gio/giotypes.h> |
34 | |
35 | G_BEGIN_DECLS |
36 | |
37 | #define G_TYPE_VOLUME_MONITOR (g_volume_monitor_get_type ()) |
38 | #define G_VOLUME_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_VOLUME_MONITOR, GVolumeMonitor)) |
39 | #define G_VOLUME_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_VOLUME_MONITOR, GVolumeMonitorClass)) |
40 | #define G_VOLUME_MONITOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_VOLUME_MONITOR, GVolumeMonitorClass)) |
41 | #define G_IS_VOLUME_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_VOLUME_MONITOR)) |
42 | #define G_IS_VOLUME_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_VOLUME_MONITOR)) |
43 | |
44 | /** |
45 | * G_VOLUME_MONITOR_EXTENSION_POINT_NAME: |
46 | * |
47 | * Extension point for volume monitor functionality. |
48 | * See [Extending GIO][extending-gio]. |
49 | */ |
50 | #define G_VOLUME_MONITOR_EXTENSION_POINT_NAME "gio-volume-monitor" |
51 | |
52 | typedef struct _GVolumeMonitorClass GVolumeMonitorClass; |
53 | |
54 | struct _GVolumeMonitor |
55 | { |
56 | GObject parent_instance; |
57 | |
58 | /*< private >*/ |
59 | gpointer priv; |
60 | }; |
61 | |
62 | struct _GVolumeMonitorClass |
63 | { |
64 | GObjectClass parent_class; |
65 | |
66 | /*< public >*/ |
67 | /* signals */ |
68 | void (* volume_added) (GVolumeMonitor *volume_monitor, |
69 | GVolume *volume); |
70 | void (* volume_removed) (GVolumeMonitor *volume_monitor, |
71 | GVolume *volume); |
72 | void (* volume_changed) (GVolumeMonitor *volume_monitor, |
73 | GVolume *volume); |
74 | |
75 | void (* mount_added) (GVolumeMonitor *volume_monitor, |
76 | GMount *mount); |
77 | void (* mount_removed) (GVolumeMonitor *volume_monitor, |
78 | GMount *mount); |
79 | void (* mount_pre_unmount) (GVolumeMonitor *volume_monitor, |
80 | GMount *mount); |
81 | void (* mount_changed) (GVolumeMonitor *volume_monitor, |
82 | GMount *mount); |
83 | |
84 | void (* drive_connected) (GVolumeMonitor *volume_monitor, |
85 | GDrive *drive); |
86 | void (* drive_disconnected) (GVolumeMonitor *volume_monitor, |
87 | GDrive *drive); |
88 | void (* drive_changed) (GVolumeMonitor *volume_monitor, |
89 | GDrive *drive); |
90 | |
91 | /* Vtable */ |
92 | |
93 | gboolean (* is_supported) (void); |
94 | |
95 | GList * (* get_connected_drives) (GVolumeMonitor *volume_monitor); |
96 | GList * (* get_volumes) (GVolumeMonitor *volume_monitor); |
97 | GList * (* get_mounts) (GVolumeMonitor *volume_monitor); |
98 | |
99 | GVolume * (* get_volume_for_uuid) (GVolumeMonitor *volume_monitor, |
100 | const char *uuid); |
101 | |
102 | GMount * (* get_mount_for_uuid) (GVolumeMonitor *volume_monitor, |
103 | const char *uuid); |
104 | |
105 | |
106 | /* These arguments are unfortunately backwards by mistake (bug #520169). Deprecated in 2.20. */ |
107 | GVolume * (* adopt_orphan_mount) (GMount *mount, |
108 | GVolumeMonitor *volume_monitor); |
109 | |
110 | /* signal added in 2.17 */ |
111 | void (* drive_eject_button) (GVolumeMonitor *volume_monitor, |
112 | GDrive *drive); |
113 | |
114 | /* signal added in 2.21 */ |
115 | void (* drive_stop_button) (GVolumeMonitor *volume_monitor, |
116 | GDrive *drive); |
117 | |
118 | /*< private >*/ |
119 | /* Padding for future expansion */ |
120 | void (*_g_reserved1) (void); |
121 | void (*_g_reserved2) (void); |
122 | void (*_g_reserved3) (void); |
123 | void (*_g_reserved4) (void); |
124 | void (*_g_reserved5) (void); |
125 | void (*_g_reserved6) (void); |
126 | }; |
127 | |
128 | GIO_AVAILABLE_IN_ALL |
129 | GType g_volume_monitor_get_type (void) G_GNUC_CONST; |
130 | |
131 | GIO_AVAILABLE_IN_ALL |
132 | GVolumeMonitor *g_volume_monitor_get (void); |
133 | GIO_AVAILABLE_IN_ALL |
134 | GList * g_volume_monitor_get_connected_drives (GVolumeMonitor *volume_monitor); |
135 | GIO_AVAILABLE_IN_ALL |
136 | GList * g_volume_monitor_get_volumes (GVolumeMonitor *volume_monitor); |
137 | GIO_AVAILABLE_IN_ALL |
138 | GList * g_volume_monitor_get_mounts (GVolumeMonitor *volume_monitor); |
139 | GIO_AVAILABLE_IN_ALL |
140 | GVolume * g_volume_monitor_get_volume_for_uuid (GVolumeMonitor *volume_monitor, |
141 | const char *uuid); |
142 | GIO_AVAILABLE_IN_ALL |
143 | GMount * g_volume_monitor_get_mount_for_uuid (GVolumeMonitor *volume_monitor, |
144 | const char *uuid); |
145 | |
146 | GIO_DEPRECATED |
147 | GVolume * g_volume_monitor_adopt_orphan_mount (GMount *mount); |
148 | |
149 | G_END_DECLS |
150 | |
151 | #endif /* __G_VOLUME_MONITOR_H__ */ |
152 | |