Pass --internal to glib-genmarshal
[platform/upstream/glib.git] / gio / gmount.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 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
25 #error "Only <gio/gio.h> can be included directly."
26 #endif
27
28 #ifndef __G_MOUNT_H__
29 #define __G_MOUNT_H__
30
31 #include <glib-object.h>
32 #include <gio/gfile.h>
33
34 G_BEGIN_DECLS
35
36 #define G_TYPE_MOUNT            (g_mount_get_type ())
37 #define G_MOUNT(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_MOUNT, GMount))
38 #define G_IS_MOUNT(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_MOUNT))
39 #define G_MOUNT_GET_IFACE(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_MOUNT, GMountIface))
40
41 /* GMount typedef is in gfile.h due to include order issues */
42 /**
43  * GVolume:
44  * 
45  * Opaque mountable volume object.
46  **/
47 typedef struct _GVolume GVolume; /* Dummy typedef */
48
49 /**
50  * GDrive:
51  * 
52  * Opaque drive object.
53  **/
54 typedef struct _GDrive          GDrive; /* Dummy typedef */
55
56 typedef struct _GMountIface    GMountIface;
57
58 /**
59  * GMountIface:
60  * @g_iface: The parent interface.
61  * @changed: Changed signal that is emitted when the mount's state has changed.
62  * @unmounted: The unmounted signal that is emitted when the #GMount have been unmounted. If the recipient is holding references to the object they should release them so the object can be finalized.
63  * @get_root: Gets a #GFile to the root directory of the #GMount.
64  * @get_name: Gets a string containing the name of the #GMount.
65  * @get_icon: Gets a #GIcon for the #GMount.
66  * @get_uuid: Gets the UUID for the #GMount. The reference is typically based on the file system UUID for the mount in question and should be considered an opaque string. Returns %NULL if there is no UUID available.
67  * @get_volume: Gets a #GVolume the mount is located on. Returns %NULL if the #GMount is not associated with a #GVolume.
68  * @get_drive: Gets a #GDrive the volume of the mount is located on. Returns %NULL if the #GMount is not associated with a #GDrive or a #GVolume. This is convenience method for getting the #GVolume and using that to get the #GDrive.
69  * @can_unmount: Checks if a #GMount can be unmounted.
70  * @can_eject: Checks if a #GMount can be ejected.
71  * @unmount: Starts unmounting a #GMount.
72  * @unmount_finish: Finishes an unmounting operation.
73  * @eject: Starts ejecting a #GMount.
74  * @eject_finish: Finishes an eject operation.
75  * @remount: Starts remounting a #GMount.
76  * @remount_finish: Finishes a remounting operation.
77  * 
78  * Interface for implementing operations for mounts.
79  **/
80 struct _GMountIface
81 {
82   GTypeInterface g_iface;
83
84   /* signals */
85
86   void (*changed) (GMount *mount);
87   void (*unmounted) (GMount *mount);
88   
89   /* Virtual Table */
90
91   GFile *            (*get_root)             (GMount         *mount);
92   char *             (*get_name)             (GMount         *mount);
93   GIcon *            (*get_icon)             (GMount         *mount);
94   char *             (*get_uuid)             (GMount         *mount);
95   GVolume *          (*get_volume)           (GMount         *mount);
96   GDrive *           (*get_drive)            (GMount         *mount);
97   gboolean           (*can_unmount)          (GMount         *mount);
98   gboolean           (*can_eject)            (GMount         *mount);
99   void               (*unmount)              (GMount         *mount,
100                                               GMountUnmountFlags flags,
101                                               GCancellable    *cancellable,
102                                               GAsyncReadyCallback callback,
103                                               gpointer         user_data);
104   gboolean           (*unmount_finish)       (GMount         *mount,
105                                               GAsyncResult    *result,
106                                               GError         **error);
107   void               (*eject)                (GMount         *mount,
108                                               GMountUnmountFlags flags,
109                                               GCancellable    *cancellable,
110                                               GAsyncReadyCallback callback,
111                                               gpointer         user_data);
112   gboolean           (*eject_finish)         (GMount         *mount,
113                                               GAsyncResult    *result,
114                                               GError         **error);
115   void               (*remount)              (GMount         *mount,
116                                               GMountOperation     *mount_operation,
117                                               GCancellable    *cancellable,
118                                               GAsyncReadyCallback callback,
119                                               gpointer         user_data);
120   gboolean           (*remount_finish)       (GMount         *mount,
121                                               GAsyncResult    *result,
122                                               GError         **error);
123 };
124
125 GType g_mount_get_type (void) G_GNUC_CONST;
126
127 GFile *            g_mount_get_root             (GMount              *mount);
128 char *             g_mount_get_name             (GMount              *mount);
129 GIcon *            g_mount_get_icon             (GMount              *mount);
130 char *             g_mount_get_uuid             (GMount              *mount);
131 GVolume *          g_mount_get_volume           (GMount              *mount);
132 GDrive *           g_mount_get_drive            (GMount              *mount);
133 gboolean           g_mount_can_unmount          (GMount              *mount);
134 gboolean           g_mount_can_eject            (GMount              *mount);
135 void               g_mount_unmount              (GMount              *mount,
136                                                  GMountUnmountFlags   flags,
137                                                  GCancellable        *cancellable,
138                                                  GAsyncReadyCallback  callback,
139                                                  gpointer             user_data);
140 gboolean           g_mount_unmount_finish       (GMount              *mount,
141                                                  GAsyncResult        *result,
142                                                  GError             **error);
143 void               g_mount_eject                (GMount              *mount,
144                                                  GMountUnmountFlags   flags,
145                                                  GCancellable        *cancellable,
146                                                  GAsyncReadyCallback  callback,
147                                                  gpointer             user_data);
148 gboolean           g_mount_eject_finish         (GMount              *mount,
149                                                  GAsyncResult        *result,
150                                                  GError             **error);
151 void               g_mount_remount              (GMount              *mount,
152                                                  GMountOperation     *mount_operation,
153                                                  GCancellable        *cancellable,
154                                                  GAsyncReadyCallback  callback,
155                                                  gpointer             user_data);
156 gboolean           g_mount_remount_finish       (GMount              *mount,
157                                                  GAsyncResult        *result,
158                                                  GError             **error);
159
160 G_END_DECLS
161
162 #endif /* __G_MOUNT_H__ */