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))
39 * @g_iface: The parent interface.
40 * @changed: Signal emitted when the drive is changed.
41 * @get_name: Returns the name for the given #GDrive.
42 * @get_icon: Returns a #GIcon for the given #GDrive.
43 * @has_volumes: Returns %TRUE if the #GDrive has mountable volumes.
44 * @get_volumes: Returns a #GList of volumes for the #GDrive.
45 * @is_automounted: returns %TRUE if the #GDrive was automounted.
46 * @can_mount: Returns %TRUE if the #GDrive can be mounted.
47 * @can_eject: Returns %TRUE if the #GDrive can be ejected.
48 * @mount: Mounts a given #GDrive.
49 * @mount_finish: Finishes a mount operation.
50 * @eject: Ejects a #GDrive.
51 * @eject_finish: Finishes an eject operation.
53 * Interface for creating #GDrive implementations.
55 typedef struct _GDriveIface GDriveIface;
59 GTypeInterface g_iface;
62 void (*changed) (GVolume *volume);
66 char * (*get_name) (GDrive *drive);
67 GIcon * (*get_icon) (GDrive *drive);
68 gboolean (*has_volumes) (GDrive *drive);
69 GList * (*get_volumes) (GDrive *drive);
70 gboolean (*is_automounted)(GDrive *drive);
71 gboolean (*can_mount) (GDrive *drive);
72 gboolean (*can_eject) (GDrive *drive);
73 void (*mount) (GDrive *drive,
74 GMountOperation *mount_operation,
75 GCancellable *cancellable,
76 GAsyncReadyCallback callback,
78 gboolean (*mount_finish)(GDrive *drive,
81 void (*eject) (GDrive *drive,
82 GCancellable *cancellable,
83 GAsyncReadyCallback callback,
85 gboolean (*eject_finish)(GDrive *drive,
90 GType g_drive_get_type (void) G_GNUC_CONST;
92 char * g_drive_get_name (GDrive *drive);
93 GIcon * g_drive_get_icon (GDrive *drive);
94 gboolean g_drive_has_volumes (GDrive *drive);
95 GList * g_drive_get_volumes (GDrive *drive);
96 gboolean g_drive_is_automounted (GDrive *drive);
97 gboolean g_drive_can_mount (GDrive *drive);
98 gboolean g_drive_can_eject (GDrive *drive);
99 void g_drive_mount (GDrive *drive,
100 GMountOperation *mount_operation,
101 GCancellable *cancellable,
102 GAsyncReadyCallback callback,
104 gboolean g_drive_mount_finish (GDrive *drive,
105 GAsyncResult *result,
107 void g_drive_eject (GDrive *drive,
108 GCancellable *cancellable,
109 GAsyncReadyCallback callback,
111 gboolean g_drive_eject_finish (GDrive *drive,
112 GAsyncResult *result,
117 #endif /* __G_DRIVE_H__ */