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>
26 #include <glib-object.h>
27 #include <gio/gvolume.h>
28 #include <gio/gmountoperation.h>
32 #define G_TYPE_DRIVE (g_drive_get_type ())
33 #define G_DRIVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_DRIVE, GDrive))
34 #define G_IS_DRIVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_DRIVE))
35 #define G_DRIVE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_DRIVE, GDriveIface))
37 typedef struct _GDriveIface GDriveIface;
41 GTypeInterface g_iface;
44 void (*changed) (GVolume *volume);
48 char * (*get_name) (GDrive *drive);
49 GIcon * (*get_icon) (GDrive *drive);
50 gboolean (*has_volumes) (GDrive *drive);
51 GList * (*get_volumes) (GDrive *drive);
52 gboolean (*is_automounted)(GDrive *drive);
53 gboolean (*can_mount) (GDrive *drive);
54 gboolean (*can_eject) (GDrive *drive);
55 void (*mount) (GDrive *drive,
56 GMountOperation *mount_operation,
57 GCancellable *cancellable,
58 GAsyncReadyCallback callback,
60 gboolean (*mount_finish)(GDrive *drive,
63 void (*eject) (GDrive *drive,
64 GCancellable *cancellable,
65 GAsyncReadyCallback callback,
67 gboolean (*eject_finish)(GDrive *drive,
72 GType g_drive_get_type (void) G_GNUC_CONST;
74 char * g_drive_get_name (GDrive *drive);
75 GIcon * g_drive_get_icon (GDrive *drive);
76 gboolean g_drive_has_volumes (GDrive *drive);
77 GList * g_drive_get_volumes (GDrive *drive);
78 gboolean g_drive_is_automounted (GDrive *drive);
79 gboolean g_drive_can_mount (GDrive *drive);
80 gboolean g_drive_can_eject (GDrive *drive);
81 void g_drive_mount (GDrive *drive,
82 GMountOperation *mount_operation,
83 GCancellable *cancellable,
84 GAsyncReadyCallback callback,
86 gboolean g_drive_mount_finish (GDrive *drive,
89 void g_drive_eject (GDrive *drive,
90 GCancellable *cancellable,
91 GAsyncReadyCallback callback,
93 gboolean g_drive_eject_finish (GDrive *drive,
99 #endif /* __G_DRIVE_H__ */