1  /* GIO - GLib Input, Output and Streaming Library
2  *
3  * Copyright (C) Carl-Anton Ingmarsson 2011 <ca.ingmarsson@gmail.com>
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., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  *
20  * Author: Carl-Anton Ingmarsson <ca.ingmarsson@gmail.com>
21  */
22 
23 #ifndef _GVFSAFPVOLUME_H_
24 #define _GVFSAFPVOLUME_H_
25 
26 #include "gvfsafptypes.h"
27 #include "gvfsafpconnection.h"
28 
29 G_BEGIN_DECLS
30 
31 #define G_VFS_TYPE_AFP_VOLUME             (g_vfs_afp_volume_get_type ())
32 #define G_VFS_AFP_VOLUME(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_VFS_TYPE_AFP_VOLUME, GVfsAfpVolume))
33 #define G_VFS_AFP_VOLUME_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), G_VFS_TYPE_AFP_VOLUME, GVfsAfpVolumeClass))
34 #define G_VFS_IS_AFP_VOLUME(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_VFS_TYPE_AFP_VOLUME))
35 #define G_VFS_IS_AFP_VOLUME_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), G_VFS_TYPE_AFP_VOLUME))
36 #define G_VFS_AFP_VOLUME_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), G_VFS_TYPE_AFP_VOLUME, GVfsAfpVolumeClass))
37 
38 typedef struct _GVfsAfpVolumeClass GVfsAfpVolumeClass;
39 typedef struct _GVfsAfpVolumePrivate GVfsAfpVolumePrivate;
40 
41 struct _GVfsAfpVolumeClass
42 {
43   GObjectClass parent_class;
44 };
45 
46 struct _GVfsAfpVolume
47 {
48   GObject parent_instance;
49 
50   GVfsAfpVolumePrivate *priv;
51 };
52 
53 GType g_vfs_afp_volume_get_type (void) G_GNUC_CONST;
54 
55 GVfsAfpVolume *g_vfs_afp_volume_new                 (GVfsAfpServer *server, GVfsAfpConnection *conn);
56 
57 gboolean       g_vfs_afp_volume_mount_sync          (GVfsAfpVolume *volume,
58                                                      const char    *volume_name,
59                                                      GCancellable  *cancellable,
60                                                      GError       **error);
61 
62 guint16        g_vfs_afp_volume_get_attributes      (GVfsAfpVolume *volume);
63 guint16        g_vfs_afp_volume_get_id              (GVfsAfpVolume *volume);
64 
65 void           g_vfs_afp_volume_get_parms           (GVfsAfpVolume        *volume,
66                                                      guint16              vol_bitmap,
67                                                      GCancellable        *cancellable,
68                                                      GAsyncReadyCallback  callback,
69                                                      gpointer             user_data);
70 
71 GFileInfo *    g_vfs_afp_volume_get_parms_finish    (GVfsAfpVolume       *volume,
72                                                      GAsyncResult        *result,
73                                                      GError             **error);
74 
75 void           g_vfs_afp_volume_open_fork           (GVfsAfpVolume      *volume,
76                                                      const char         *filename,
77                                                      guint16             access_mode,
78                                                      guint16             bitmap,
79                                                      GCancellable       *cancellable,
80                                                      GAsyncReadyCallback callback,
81                                                      gpointer            user_data);
82 
83 gboolean       g_vfs_afp_volume_open_fork_finish    (GVfsAfpVolume  *volume,
84                                                      GAsyncResult   *res,
85                                                      gint16         *fork_refnum,
86                                                      GFileInfo      **info,
87                                                      GError         **error);
88 
89 void           g_vfs_afp_volume_close_fork          (GVfsAfpVolume       *volume,
90                                                      gint16               fork_refnum,
91                                                      GCancellable        *cancellable,
92                                                      GAsyncReadyCallback  callback,
93                                                      gpointer             user_data);
94 
95 gboolean      g_vfs_afp_volume_close_fork_finish   (GVfsAfpVolume  *volume,
96                                                     GAsyncResult   *result,
97                                                     GError         **error);
98 
99 void          g_vfs_afp_volume_delete              (GVfsAfpVolume       *volume,
100                                                     const char          *filename,
101                                                     GCancellable        *cancellable,
102                                                     GAsyncReadyCallback  callback,
103                                                     gpointer             user_data);
104 
105 gboolean      g_vfs_afp_volume_delete_finish       (GVfsAfpVolume  *volume,
106                                                     GAsyncResult   *result,
107                                                     GError         **error);
108 
109 void          g_vfs_afp_volume_create_file         (GVfsAfpVolume      *volume,
110                                                     const char         *filename,
111                                                     gboolean            hard_create,
112                                                     GCancellable       *cancellable,
113                                                     GAsyncReadyCallback callback,
114                                                     gpointer            user_data);
115 
116 gboolean     g_vfs_afp_volume_create_file_finish   (GVfsAfpVolume  *volume,
117                                                     GAsyncResult   *result,
118                                                     GError         **error);
119 
120 void         g_vfs_afp_volume_create_directory     (GVfsAfpVolume      *volume,
121                                                     const char         *directory,
122                                                     GCancellable       *cancellable,
123                                                     GAsyncReadyCallback callback,
124                                                     gpointer            user_data);
125 
126 gboolean     g_vfs_afp_volume_create_directory_finish (GVfsAfpVolume  *volume,
127                                                        GAsyncResult   *result,
128                                                        GError         **error);
129 
130 void         g_vfs_afp_volume_copy_file            (GVfsAfpVolume      *volume,
131                                                     const char         *source,
132                                                     const char         *destination,
133                                                     GCancellable       *cancellable,
134                                                     GAsyncReadyCallback callback,
135                                                     gpointer            user_data);
136 
137 gboolean     g_vfs_afp_volume_copy_file_finish     (GVfsAfpVolume *volume,
138                                                     GAsyncResult  *res,
139                                                     GError       **error);
140 
141 void         g_vfs_afp_volume_rename               (GVfsAfpVolume      *volume,
142                                                     const char         *filename,
143                                                     const char         *new_name,
144                                                     GCancellable       *cancellable,
145                                                     GAsyncReadyCallback callback,
146                                                     gpointer            user_data);
147 
148 gboolean     g_vfs_afp_volume_rename_finish        (GVfsAfpVolume  *volume,
149                                                     GAsyncResult   *res,
150                                                     GError        **error);
151 
152 void         g_vfs_afp_volume_move_and_rename      (GVfsAfpVolume      *volume,
153                                                     const char         *source,
154                                                     const char         *destination,
155                                                     GCancellable       *cancellable,
156                                                     GAsyncReadyCallback callback,
157                                                     gpointer            user_data);
158 
159 gboolean     g_vfs_afp_volume_move_and_rename_finish (GVfsAfpVolume  *volume,
160                                                       GAsyncResult   *res,
161                                                       GError        **error);
162 
163 void          g_vfs_afp_volume_get_filedir_parms   (GVfsAfpVolume       *volume,
164                                                     const char          *filename,
165                                                     guint16              file_bitmap,
166                                                     guint16              dir_bitmap,
167                                                     GCancellable        *cancellable,
168                                                     GAsyncReadyCallback  callback,
169                                                     gpointer             user_data);
170 
171 GFileInfo *   g_vfs_afp_volume_get_filedir_parms_finish (GVfsAfpVolume  *volume,
172                                                          GAsyncResult   *result,
173                                                          GError         **error);
174 
175 void          g_vfs_afp_volume_get_fork_parms      (GVfsAfpVolume       *volume,
176                                                     gint16               fork_refnum,
177                                                     guint16              file_bitmap,
178                                                     GCancellable        *cancellable,
179                                                     GAsyncReadyCallback  callback,
180                                                     gpointer             user_data);
181 
182 GFileInfo *   g_vfs_afp_volume_get_fork_parms_finish (GVfsAfpVolume  *volume,
183                                                       GAsyncResult   *result,
184                                                       GError         **error);
185 
186 void          g_vfs_afp_volume_set_fork_size         (GVfsAfpVolume       *volume,
187                                                       gint16               fork_refnum,
188                                                       gint64               size,
189                                                       GCancellable        *cancellable,
190                                                       GAsyncReadyCallback  callback,
191                                                       gpointer             user_data);
192 
193 gboolean      g_vfs_afp_volume_set_fork_size_finish  (GVfsAfpVolume  *volume,
194                                                       GAsyncResult   *result,
195                                                       GError         **error);
196 
197 void          g_vfs_afp_volume_set_unix_privs      (GVfsAfpVolume       *volume,
198                                                     const char          *filename,
199                                                     guint32              uid,
200                                                     guint32              gid,
201                                                     guint32              permissions,
202                                                     guint32              ua_permissions,
203                                                     GCancellable        *cancellable,
204                                                     GAsyncReadyCallback  callback,
205                                                     gpointer             user_data);
206 
207 gboolean      g_vfs_afp_volume_set_unix_privs_finish (GVfsAfpVolume  *volume,
208                                                       GAsyncResult   *res,
209                                                       GError        **error);
210 
211 void          g_vfs_afp_volume_enumerate             (GVfsAfpVolume       *volume,
212                                                       const char          *directory,
213                                                       gint64               start_index,
214                                                       guint16              file_bitmap,
215                                                       guint16              dir_bitmap,
216                                                       GCancellable        *cancellable,
217                                                       GAsyncReadyCallback  callback,
218                                                       gpointer             user_data);
219 
220 gboolean      g_vfs_afp_volume_enumerate_finish      (GVfsAfpVolume  *volume,
221                                                       GAsyncResult   *res,
222                                                       GPtrArray      **infos,
223                                                       GError        **error);
224 
225 void          g_vfs_afp_volume_exchange_files        (GVfsAfpVolume       *volume,
226                                                       const char          *source,
227                                                       const char          *destination,
228                                                       GCancellable        *cancellable,
229                                                       GAsyncReadyCallback  callback,
230                                                       gpointer             user_data);
231 
232 gboolean      g_vfs_afp_volume_exchange_files_finish (GVfsAfpVolume  *volume,
233                                                       GAsyncResult   *res,
234                                                       GError        **error);
235 
236 void          g_vfs_afp_volume_write_to_fork         (GVfsAfpVolume       *volume,
237                                                       guint16              fork_refnum,
238                                                       char                *buffer,
239                                                       gsize                buffer_size,
240                                                       gint64               offset,
241                                                       GCancellable        *cancellable,
242                                                       GAsyncReadyCallback  callback,
243                                                       gpointer             user_data);
244 
245 gboolean      g_vfs_afp_volume_write_to_fork_finish  (GVfsAfpVolume  *volume,
246                                                       GAsyncResult   *res,
247                                                       gint64         *last_written,
248                                                       GError        **error);
249 
250 void          g_vfs_afp_volume_read_from_fork        (GVfsAfpVolume       *volume,
251                                                       guint16              fork_refnum,
252                                                       char                *buffer,
253                                                       gsize                bytes_requested,
254                                                       gint64               offset,
255                                                       GCancellable        *cancellable,
256                                                       GAsyncReadyCallback  callback,
257                                                       gpointer             user_data);
258 
259 gboolean      g_vfs_afp_volume_read_from_fork_finish (GVfsAfpVolume  *volume,
260                                                       GAsyncResult   *res,
261                                                       gsize          *bytes_read,
262                                                       GError        **error);
263 
264 
265 G_END_DECLS
266 
267 #endif /* _GVFSAFPVOLUME_H_ */
268