Bumps documentation to 93% symbol coverage, touching most
[platform/upstream/glib.git] / gio / gdrive.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  */
22
23 #ifndef __G_DRIVE_H__
24 #define __G_DRIVE_H__
25
26 #include <glib-object.h>
27 #include <gio/gvolume.h>
28 #include <gio/gmountoperation.h>
29
30 G_BEGIN_DECLS
31
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))
36
37 /**
38  * 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.
52  * 
53  * Interface for creating #GDrive implementations.
54  */ 
55 typedef struct _GDriveIface    GDriveIface;
56
57 struct _GDriveIface
58 {
59   GTypeInterface g_iface;
60
61   /* signals */
62   void (*changed)            (GVolume *volume);
63   
64   /* Virtual Table */
65   
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,
77                            gpointer        user_data);
78   gboolean (*mount_finish)(GDrive         *drive,
79                            GAsyncResult   *result,
80                            GError        **error);
81   void     (*eject)       (GDrive         *drive,
82                            GCancellable   *cancellable,
83                            GAsyncReadyCallback callback,
84                            gpointer        user_data);
85   gboolean (*eject_finish)(GDrive         *drive,
86                            GAsyncResult   *result,
87                            GError        **error);
88 };
89
90 GType g_drive_get_type (void) G_GNUC_CONST;
91
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,
103                                  gpointer              user_data);
104 gboolean g_drive_mount_finish   (GDrive               *drive,
105                                  GAsyncResult         *result,
106                                  GError              **error);
107 void     g_drive_eject          (GDrive               *drive,
108                                  GCancellable         *cancellable,
109                                  GAsyncReadyCallback   callback,
110                                  gpointer              user_data);
111 gboolean g_drive_eject_finish   (GDrive               *drive,
112                                  GAsyncResult         *result,
113                                  GError              **error);
114
115 G_END_DECLS
116
117 #endif /* __G_DRIVE_H__ */