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>
23 #ifndef __G_VOLUME_H__
24 #define __G_VOLUME_H__
26 #include <glib-object.h>
27 #include <gio/gfile.h>
31 #define G_TYPE_VOLUME (g_volume_get_type ())
32 #define G_VOLUME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_VOLUME, GVolume))
33 #define G_IS_VOLUME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_VOLUME))
34 #define G_VOLUME_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_VOLUME, GVolumeIface))
36 /* GVolume typedef is in gfile.h due to include order issues */
37 typedef struct _GDrive GDrive; /* Dummy typedef */
38 typedef struct _GVolumeIface GVolumeIface;
42 GTypeInterface g_iface;
46 void (*changed) (GVolume *volume);
50 GFile * (*get_root) (GVolume *volume);
51 char * (*get_name) (GVolume *volume);
52 GIcon * (*get_icon) (GVolume *volume);
53 GDrive * (*get_drive) (GVolume *volume);
54 gboolean (*can_unmount) (GVolume *volume);
55 gboolean (*can_eject) (GVolume *volume);
56 void (*unmount) (GVolume *volume,
57 GCancellable *cancellable,
58 GAsyncReadyCallback callback,
60 gboolean (*unmount_finish) (GVolume *volume,
63 void (*eject) (GVolume *volume,
64 GCancellable *cancellable,
65 GAsyncReadyCallback callback,
67 gboolean (*eject_finish) (GVolume *volume,
72 GType g_volume_get_type (void) G_GNUC_CONST;
74 GFile *g_volume_get_root (GVolume *volume);
75 char * g_volume_get_name (GVolume *volume);
76 GIcon * g_volume_get_icon (GVolume *volume);
77 GDrive * g_volume_get_drive (GVolume *volume);
78 gboolean g_volume_can_unmount (GVolume *volume);
79 gboolean g_volume_can_eject (GVolume *volume);
80 void g_volume_unmount (GVolume *volume,
81 GCancellable *cancellable,
82 GAsyncReadyCallback callback,
84 gboolean g_volume_unmount_finish (GVolume *volume,
87 void g_volume_eject (GVolume *volume,
88 GCancellable *cancellable,
89 GAsyncReadyCallback callback,
91 gboolean g_volume_eject_finish (GVolume *volume,
97 #endif /* __G_VOLUME_H__ */