You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

126 regels
4.6 KiB

  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. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  23. #error "Only <gio/gio.h> can be included directly."
  24. #endif
  25. #ifndef __G_VFS_H__
  26. #define __G_VFS_H__
  27. #include <gio/giotypes.h>
  28. G_BEGIN_DECLS
  29. #define G_TYPE_VFS (g_vfs_get_type ())
  30. #define G_VFS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_VFS, GVfs))
  31. #define G_VFS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_VFS, GVfsClass))
  32. #define G_VFS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_VFS, GVfsClass))
  33. #define G_IS_VFS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_VFS))
  34. #define G_IS_VFS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_VFS))
  35. /**
  36. * G_VFS_EXTENSION_POINT_NAME:
  37. *
  38. * Extension point for #GVfs functionality.
  39. * See <link linkend="extending-gio">Extending GIO</link>.
  40. */
  41. #define G_VFS_EXTENSION_POINT_NAME "gio-vfs"
  42. /**
  43. * GVfs:
  44. *
  45. * Virtual File System object.
  46. **/
  47. typedef struct _GVfsClass GVfsClass;
  48. struct _GVfs
  49. {
  50. GObject parent_instance;
  51. };
  52. struct _GVfsClass
  53. {
  54. GObjectClass parent_class;
  55. /* Virtual Table */
  56. gboolean (* is_active) (GVfs *vfs);
  57. GFile * (* get_file_for_path) (GVfs *vfs,
  58. const char *path);
  59. GFile * (* get_file_for_uri) (GVfs *vfs,
  60. const char *uri);
  61. const gchar * const * (* get_supported_uri_schemes) (GVfs *vfs);
  62. GFile * (* parse_name) (GVfs *vfs,
  63. const char *parse_name);
  64. /*< private >*/
  65. void (* local_file_add_info) (GVfs *vfs,
  66. const char *filename,
  67. guint64 device,
  68. GFileAttributeMatcher *attribute_matcher,
  69. GFileInfo *info,
  70. GCancellable *cancellable,
  71. gpointer *extra_data,
  72. GDestroyNotify *free_extra_data);
  73. void (* add_writable_namespaces) (GVfs *vfs,
  74. GFileAttributeInfoList *list);
  75. gboolean (* local_file_set_attributes) (GVfs *vfs,
  76. const char *filename,
  77. GFileInfo *info,
  78. GFileQueryInfoFlags flags,
  79. GCancellable *cancellable,
  80. GError **error);
  81. void (* local_file_removed) (GVfs *vfs,
  82. const char *filename);
  83. void (* local_file_moved) (GVfs *vfs,
  84. const char *source,
  85. const char *dest);
  86. /* Padding for future expansion */
  87. void (*_g_reserved1) (void);
  88. void (*_g_reserved2) (void);
  89. void (*_g_reserved3) (void);
  90. void (*_g_reserved4) (void);
  91. void (*_g_reserved5) (void);
  92. void (*_g_reserved6) (void);
  93. void (*_g_reserved7) (void);
  94. };
  95. GType g_vfs_get_type (void) G_GNUC_CONST;
  96. gboolean g_vfs_is_active (GVfs *vfs);
  97. GFile * g_vfs_get_file_for_path (GVfs *vfs,
  98. const char *path);
  99. GFile * g_vfs_get_file_for_uri (GVfs *vfs,
  100. const char *uri);
  101. const gchar* const * g_vfs_get_supported_uri_schemes (GVfs *vfs);
  102. GFile * g_vfs_parse_name (GVfs *vfs,
  103. const char *parse_name);
  104. GVfs * g_vfs_get_default (void);
  105. GVfs * g_vfs_get_local (void);
  106. G_END_DECLS
  107. #endif /* __G_VFS_H__ */