No need for padding for interfaces
[platform/upstream/glib.git] / gio / gvolume.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  *         David Zeuthen <davidz@redhat.com>
22  */
23
24 #ifndef __G_VOLUME_H__
25 #define __G_VOLUME_H__
26
27 #include <glib-object.h>
28 #include <gio/gfile.h>
29 #include <gio/gdrive.h>
30
31 G_BEGIN_DECLS
32
33 #define G_TYPE_VOLUME            (g_volume_get_type ())
34 #define G_VOLUME(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_VOLUME, GVolume))
35 #define G_IS_VOLUME(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_VOLUME))
36 #define G_VOLUME_GET_IFACE(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_VOLUME, GVolumeIface))
37
38 /**
39  * GVolumeIface:
40  * @g_iface: The parent interface.
41  * @changed: Changed signal that is emitted when the volume's state has changed.
42  * @get_name: Gets a string containing the name of the #GVolume.
43  * @get_icon: Gets a #GIcon for the #GVolume.
44  * @get_drive: Gets a #GDrive the volume is located on. Returns %NULL if the #GVolume is not associated with a #GDrive.
45  * @get_mount: Gets a #GMount representing the mounted volume. Returns %NULL if the #GVolume is not mounted.
46  * @can_mount: Returns %TRUE if the #GVolume can be mounted.
47  * @mount: Mounts a given #GVolume.
48  * @mount_finish: Finishes a mount operation.
49  * 
50  * Interface for implementing operations for mountable volumes.
51  **/
52 typedef struct _GVolumeIface    GVolumeIface;
53
54 struct _GVolumeIface
55 {
56   GTypeInterface g_iface;
57
58   /* signals */
59
60   void (*changed) (GVolume *volume);
61   
62   /* Virtual Table */
63
64   char *    (*get_name)       (GVolume             *volume);
65   GIcon *   (*get_icon)       (GVolume             *volume);
66   GDrive *  (*get_drive)      (GVolume             *volume);
67   GMount *  (*get_mount)      (GVolume             *volume);
68   gboolean  (*can_mount)      (GVolume             *volume);
69   void      (*mount_fn)       (GVolume             *volume,
70                                GMountOperation     *mount_operation,
71                                GCancellable        *cancellable,
72                                GAsyncReadyCallback  callback,
73                                gpointer             user_data);
74   gboolean  (*mount_finish)   (GVolume             *volume,
75                                GAsyncResult        *result,
76                                GError             **error);
77 };
78
79 GType     g_volume_get_type       (void) G_GNUC_CONST;
80
81 char *    g_volume_get_name       (GVolume              *volume);
82 GIcon *   g_volume_get_icon       (GVolume              *volume);
83 GDrive *  g_volume_get_drive      (GVolume              *volume);
84 GMount *  g_volume_get_mount      (GVolume              *volume);
85 gboolean  g_volume_can_mount      (GVolume              *volume);
86 void      g_volume_mount          (GVolume              *volume,
87                                    GMountOperation      *mount_operation,
88                                    GCancellable         *cancellable,
89                                    GAsyncReadyCallback   callback,
90                                    gpointer              user_data);
91 gboolean g_volume_mount_finish    (GVolume              *volume,
92                                    GAsyncResult         *result,
93                                    GError              **error);
94
95 G_END_DECLS
96
97 #endif /* __G_VOLUME_H__ */