1 /* GTK - The GIMP Toolkit
2 * gtkfilesystem.h: Filesystem abstraction functions.
3 * Copyright (C) 2003, Red Hat, Inc.
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.
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.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef __GTK_FILE_SYSTEM_H__
20 #define __GTK_FILE_SYSTEM_H__
23 #include <gtk/gtkwidget.h> /* For icon handling */
27 #define GTK_TYPE_FILE_SYSTEM (_gtk_file_system_get_type ())
28 #define GTK_FILE_SYSTEM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_FILE_SYSTEM, GtkFileSystem))
29 #define GTK_FILE_SYSTEM_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GTK_TYPE_FILE_SYSTEM, GtkFileSystemClass))
30 #define GTK_IS_FILE_SYSTEM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_FILE_SYSTEM))
31 #define GTK_IS_FILE_SYSTEM_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GTK_TYPE_FILE_SYSTEM))
32 #define GTK_FILE_SYSTEM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_FILE_SYSTEM, GtkFileSystemClass))
34 typedef struct GtkFileSystem GtkFileSystem;
35 typedef struct GtkFileSystemPrivate GtkFileSystemPrivate;
36 typedef struct GtkFileSystemClass GtkFileSystemClass;
39 typedef struct GtkFileSystemVolume GtkFileSystemVolume; /* opaque struct */
40 typedef struct GtkFileSystemBookmark GtkFileSystemBookmark; /* opaque struct */
45 GObject parent_object;
47 GtkFileSystemPrivate *priv;
50 struct GtkFileSystemClass
52 GObjectClass parent_class;
54 void (*bookmarks_changed) (GtkFileSystem *file_system);
55 void (*volumes_changed) (GtkFileSystem *file_system);
59 typedef void (* GtkFileSystemGetInfoCallback) (GCancellable *cancellable,
63 typedef void (* GtkFileSystemVolumeMountCallback) (GCancellable *cancellable,
64 GtkFileSystemVolume *volume,
68 /* GtkFileSystem methods */
69 GType _gtk_file_system_get_type (void) G_GNUC_CONST;
71 GtkFileSystem * _gtk_file_system_new (void);
73 GSList * _gtk_file_system_list_volumes (GtkFileSystem *file_system);
74 GSList * _gtk_file_system_list_bookmarks (GtkFileSystem *file_system);
76 GCancellable * _gtk_file_system_get_info (GtkFileSystem *file_system,
78 const gchar *attributes,
79 GtkFileSystemGetInfoCallback callback,
81 GCancellable * _gtk_file_system_mount_volume (GtkFileSystem *file_system,
82 GtkFileSystemVolume *volume,
83 GMountOperation *mount_operation,
84 GtkFileSystemVolumeMountCallback callback,
86 GCancellable * _gtk_file_system_mount_enclosing_volume (GtkFileSystem *file_system,
88 GMountOperation *mount_operation,
89 GtkFileSystemVolumeMountCallback callback,
92 gboolean _gtk_file_system_insert_bookmark (GtkFileSystem *file_system,
96 gboolean _gtk_file_system_remove_bookmark (GtkFileSystem *file_system,
100 gchar * _gtk_file_system_get_bookmark_label (GtkFileSystem *file_system,
102 void _gtk_file_system_set_bookmark_label (GtkFileSystem *file_system,
106 GtkFileSystemVolume * _gtk_file_system_get_volume_for_file (GtkFileSystem *file_system,
109 /* GtkFileSystemVolume methods */
110 gchar * _gtk_file_system_volume_get_display_name (GtkFileSystemVolume *volume);
111 gboolean _gtk_file_system_volume_is_mounted (GtkFileSystemVolume *volume);
112 GFile * _gtk_file_system_volume_get_root (GtkFileSystemVolume *volume);
113 GdkPixbuf * _gtk_file_system_volume_render_icon (GtkFileSystemVolume *volume,
118 GtkFileSystemVolume *_gtk_file_system_volume_ref (GtkFileSystemVolume *volume);
119 void _gtk_file_system_volume_unref (GtkFileSystemVolume *volume);
121 /* GtkFileSystemBookmark methods */
122 void _gtk_file_system_bookmark_free (GtkFileSystemBookmark *bookmark);
124 /* GFileInfo helper functions */
125 GdkPixbuf * _gtk_file_info_render_icon (GFileInfo *info,
129 gboolean _gtk_file_info_consider_as_directory (GFileInfo *info);
131 /* GFile helper functions */
132 gboolean _gtk_file_has_native_path (GFile *file);
136 #endif /* __GTK_FILE_SYSTEM_H__ */