Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:00:00

0001 /* GIO - GLib Input, Output and Streaming Library
0002  *
0003  * Copyright (C) 2006-2007 Red Hat, Inc.
0004  *
0005  * SPDX-License-Identifier: LGPL-2.1-or-later
0006  *
0007  * This library is free software; you can redistribute it and/or
0008  * modify it under the terms of the GNU Lesser General Public
0009  * License as published by the Free Software Foundation; either
0010  * version 2.1 of the License, or (at your option) any later version.
0011  *
0012  * This library is distributed in the hope that it will be useful,
0013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015  * Lesser General Public License for more details.
0016  *
0017  * You should have received a copy of the GNU Lesser General
0018  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
0019  *
0020  * Author: Alexander Larsson <alexl@redhat.com>
0021  */
0022 
0023 #ifndef __G_VFS_H__
0024 #define __G_VFS_H__
0025 
0026 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
0027 #error "Only <gio/gio.h> can be included directly."
0028 #endif
0029 
0030 #include <gio/giotypes.h>
0031 
0032 G_BEGIN_DECLS
0033 
0034 #define G_TYPE_VFS         (g_vfs_get_type ())
0035 #define G_VFS(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_VFS, GVfs))
0036 #define G_VFS_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_VFS, GVfsClass))
0037 #define G_VFS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_VFS, GVfsClass))
0038 #define G_IS_VFS(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_VFS))
0039 #define G_IS_VFS_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_VFS))
0040 
0041 /**
0042  * GVfsFileLookupFunc:
0043  * @vfs: a #GVfs
0044  * @identifier: the identifier to look up a #GFile for. This can either
0045  *     be a URI or a parse name as returned by g_file_get_parse_name()
0046  * @user_data: user data passed to the function
0047  *
0048  * This function type is used by g_vfs_register_uri_scheme() to make it
0049  * possible for a client to associate a URI scheme to a different #GFile
0050  * implementation.
0051  *
0052  * The client should return a reference to the new file that has been
0053  * created for @uri, or %NULL to continue with the default implementation.
0054  *
0055  * Returns: (transfer full): a #GFile for @identifier.
0056  *
0057  * Since: 2.50
0058  */
0059 typedef GFile * (* GVfsFileLookupFunc) (GVfs       *vfs,
0060                                         const char *identifier,
0061                                         gpointer    user_data);
0062 
0063 /**
0064  * G_VFS_EXTENSION_POINT_NAME:
0065  *
0066  * Extension point for #GVfs functionality.
0067  * See [Extending GIO][extending-gio].
0068  */
0069 #define G_VFS_EXTENSION_POINT_NAME "gio-vfs"
0070 
0071 typedef struct _GVfsClass    GVfsClass;
0072 
0073 struct _GVfs
0074 {
0075   GObject parent_instance;
0076 };
0077 
0078 struct _GVfsClass
0079 {
0080   GObjectClass parent_class;
0081 
0082   /* Virtual Table */
0083 
0084   gboolean              (* is_active)                 (GVfs       *vfs);
0085   GFile               * (* get_file_for_path)         (GVfs       *vfs,
0086                                                        const char *path);
0087   GFile               * (* get_file_for_uri)          (GVfs       *vfs,
0088                                                        const char *uri);
0089   const gchar * const * (* get_supported_uri_schemes) (GVfs       *vfs);
0090   GFile               * (* parse_name)                (GVfs       *vfs,
0091                                                        const char *parse_name);
0092 
0093   /*< private >*/
0094   void                  (* local_file_add_info)       (GVfs       *vfs,
0095                                const char *filename,
0096                                guint64     device,
0097                                GFileAttributeMatcher *attribute_matcher,
0098                                GFileInfo  *info,
0099                                GCancellable *cancellable,
0100                                gpointer   *extra_data,
0101                                GDestroyNotify *free_extra_data);
0102   void                  (* add_writable_namespaces)   (GVfs       *vfs,
0103                                GFileAttributeInfoList *list);
0104   gboolean              (* local_file_set_attributes) (GVfs       *vfs,
0105                                const char *filename,
0106                                GFileInfo  *info,
0107                                                        GFileQueryInfoFlags flags,
0108                                                        GCancellable *cancellable,
0109                                GError    **error);
0110   void                  (* local_file_removed)        (GVfs       *vfs,
0111                                const char *filename);
0112   void                  (* local_file_moved)          (GVfs       *vfs,
0113                                const char *source,
0114                                const char *dest);
0115   GIcon *               (* deserialize_icon)          (GVfs       *vfs,
0116                                                        GVariant   *value);
0117   /* Padding for future expansion */
0118   void (*_g_reserved1) (void);
0119   void (*_g_reserved2) (void);
0120   void (*_g_reserved3) (void);
0121   void (*_g_reserved4) (void);
0122   void (*_g_reserved5) (void);
0123   void (*_g_reserved6) (void);
0124 };
0125 
0126 GIO_AVAILABLE_IN_ALL
0127 GType                 g_vfs_get_type                  (void) G_GNUC_CONST;
0128 
0129 GIO_AVAILABLE_IN_ALL
0130 gboolean              g_vfs_is_active                 (GVfs       *vfs);
0131 GIO_AVAILABLE_IN_ALL
0132 GFile *               g_vfs_get_file_for_path         (GVfs       *vfs,
0133                                                        const char *path);
0134 GIO_AVAILABLE_IN_ALL
0135 GFile *               g_vfs_get_file_for_uri          (GVfs       *vfs,
0136                                                        const char *uri);
0137 GIO_AVAILABLE_IN_ALL
0138 const gchar* const * g_vfs_get_supported_uri_schemes  (GVfs       *vfs);
0139 
0140 GIO_AVAILABLE_IN_ALL
0141 GFile *               g_vfs_parse_name                (GVfs       *vfs,
0142                                                        const char *parse_name);
0143 
0144 GIO_AVAILABLE_IN_ALL
0145 GVfs *                g_vfs_get_default               (void);
0146 GIO_AVAILABLE_IN_ALL
0147 GVfs *                g_vfs_get_local                 (void);
0148 
0149 GIO_AVAILABLE_IN_2_50
0150 gboolean              g_vfs_register_uri_scheme       (GVfs               *vfs,
0151                                                        const char         *scheme,
0152                                                        GVfsFileLookupFunc  uri_func,
0153                                                        gpointer            uri_data,
0154                                                        GDestroyNotify      uri_destroy,
0155                                                        GVfsFileLookupFunc  parse_name_func,
0156                                                        gpointer            parse_name_data,
0157                                                        GDestroyNotify      parse_name_destroy);
0158 GIO_AVAILABLE_IN_2_50
0159 gboolean              g_vfs_unregister_uri_scheme     (GVfs               *vfs,
0160                                                        const char         *scheme);
0161 
0162 
0163 G_END_DECLS
0164 
0165 #endif /* __G_VFS_H__ */