Ardour  9.0-pre0-582-g084a23a80d
gtkfilesystem.h
Go to the documentation of this file.
1 /* GTK - The GIMP Toolkit
2  * gtkfilesystem.h: Filesystem abstraction functions.
3  * Copyright (C) 2003, 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 Public
16  * 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 
21 #ifndef __GTK_FILE_SYSTEM_H__
22 #define __GTK_FILE_SYSTEM_H__
23 
24 #include <gio/gio.h>
25 #include <gtk/gtkwidget.h> /* For icon handling */
26 
27 G_BEGIN_DECLS
28 
29 #define GTK_TYPE_FILE_SYSTEM (_gtk_file_system_get_type ())
30 #define GTK_FILE_SYSTEM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_FILE_SYSTEM, GtkFileSystem))
31 #define GTK_FILE_SYSTEM_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GTK_TYPE_FILE_SYSTEM, GtkFileSystemClass))
32 #define GTK_IS_FILE_SYSTEM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_FILE_SYSTEM))
33 #define GTK_IS_FILE_SYSTEM_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GTK_TYPE_FILE_SYSTEM))
34 #define GTK_FILE_SYSTEM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_FILE_SYSTEM, GtkFileSystemClass))
35 
36 #define GTK_TYPE_FOLDER (_gtk_folder_get_type ())
37 #define GTK_FOLDER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_FOLDER, GtkFolder))
38 #define GTK_FOLDER_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GTK_TYPE_FOLDER, GtkFolderClass))
39 #define GTK_IS_FOLDER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_FOLDER))
40 #define GTK_IS_FOLDER_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GTK_TYPE_FOLDER))
41 #define GTK_FOLDER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_FOLDER, GtkFolderClass))
42 
44 typedef struct GtkFileSystem GtkFileSystem;
45 typedef struct GtkFolderClass GtkFolderClass;
46 typedef struct GtkFolder GtkFolder;
47 typedef struct GtkFileSystemVolume GtkFileSystemVolume; /* opaque struct */
48 typedef struct GtkFileSystemBookmark GtkFileSystemBookmark; /* opaque struct */
49 
51 {
52  GObjectClass parent_class;
53 
54  void (*bookmarks_changed) (GtkFileSystem *file_system);
55  void (*volumes_changed) (GtkFileSystem *file_system);
56 };
57 
59 {
60  GObject parent_object;
61 };
62 
64 {
65  GObjectClass parent_class;
66 
67  void (*files_added) (GtkFolder *folder,
68  GList *paths);
69  void (*files_removed) (GtkFolder *folder,
70  GList *paths);
71  void (*files_changed) (GtkFolder *folder,
72  GList *paths);
73  void (*finished_loading) (GtkFolder *folder);
74  void (*deleted) (GtkFolder *folder);
75 };
76 
77 struct GtkFolder
78 {
79  GObject parent_object;
80 };
81 
82 typedef void (* GtkFileSystemGetFolderCallback) (GCancellable *cancellable,
83  GtkFolder *folder,
84  const GError *error,
85  gpointer data);
86 typedef void (* GtkFileSystemGetInfoCallback) (GCancellable *cancellable,
87  GFileInfo *file_info,
88  const GError *error,
89  gpointer data);
90 typedef void (* GtkFileSystemVolumeMountCallback) (GCancellable *cancellable,
91  GtkFileSystemVolume *volume,
92  const GError *error,
93  gpointer data);
94 
95 /* GtkFileSystem methods */
96 GType _gtk_file_system_get_type (void) G_GNUC_CONST;
97 
99 
102 
103 GCancellable * _gtk_file_system_get_info (GtkFileSystem *file_system,
104  GFile *file,
105  const gchar *attributes,
107  gpointer data);
108 GCancellable * _gtk_file_system_mount_volume (GtkFileSystem *file_system,
109  GtkFileSystemVolume *volume,
110  GMountOperation *mount_operation,
112  gpointer data);
114  GFile *file,
115  GMountOperation *mount_operation,
117  gpointer data);
118 
120  GFile *file,
121  gint position,
122  GError **error);
124  GFile *file,
125  GError **error);
126 
128  GFile *file);
130  GFile *file,
131  const gchar *label);
132 
134  GFile *file);
135 
136 /* GtkFolder functions */
138 GFileInfo * _gtk_folder_get_info (GtkFolder *folder,
139  GFile *file);
140 
142 
143 
144 /* GtkFileSystemVolume methods */
149  GtkWidget *widget,
150  gint icon_size,
151  GError **error);
152 
155 
156 /* GtkFileSystemBookmark methods */
158 
159 /* GFileInfo helper functions */
160 GdkPixbuf * _gtk_file_info_render_icon (GFileInfo *info,
161  GtkWidget *widget,
162  gint icon_size);
163 
165 
166 /* GFile helper functions */
167 gboolean _gtk_file_has_native_path (GFile *file);
168 
169 G_END_DECLS
170 
171 #endif /* __GTK_FILE_SYSTEM_H__ */
GCancellable * _gtk_file_system_mount_volume(GtkFileSystem *file_system, GtkFileSystemVolume *volume, GMountOperation *mount_operation, GtkFileSystemVolumeMountCallback callback, gpointer data)
GSList * _gtk_file_system_list_bookmarks(GtkFileSystem *file_system)
GSList * _gtk_folder_list_children(GtkFolder *folder)
gchar * _gtk_file_system_volume_get_display_name(GtkFileSystemVolume *volume)
struct GtkFileSystemVolume GtkFileSystemVolume
Definition: gtkfilesystem.h:47
GFileInfo * _gtk_folder_get_info(GtkFolder *folder, GFile *file)
GtkFileSystemVolume * _gtk_file_system_volume_ref(GtkFileSystemVolume *volume)
void(* GtkFileSystemVolumeMountCallback)(GCancellable *cancellable, GtkFileSystemVolume *volume, const GError *error, gpointer data)
Definition: gtkfilesystem.h:90
void _gtk_file_system_bookmark_free(GtkFileSystemBookmark *bookmark)
GSList * _gtk_file_system_list_volumes(GtkFileSystem *file_system)
gboolean _gtk_file_has_native_path(GFile *file)
GCancellable * _gtk_file_system_mount_enclosing_volume(GtkFileSystem *file_system, GFile *file, GMountOperation *mount_operation, GtkFileSystemVolumeMountCallback callback, gpointer data)
void(* GtkFileSystemGetInfoCallback)(GCancellable *cancellable, GFileInfo *file_info, const GError *error, gpointer data)
Definition: gtkfilesystem.h:86
GdkPixbuf * _gtk_file_system_volume_render_icon(GtkFileSystemVolume *volume, GtkWidget *widget, gint icon_size, GError **error)
GCancellable * _gtk_file_system_get_info(GtkFileSystem *file_system, GFile *file, const gchar *attributes, GtkFileSystemGetInfoCallback callback, gpointer data)
gchar * _gtk_file_system_get_bookmark_label(GtkFileSystem *file_system, GFile *file)
gboolean _gtk_file_system_insert_bookmark(GtkFileSystem *file_system, GFile *file, gint position, GError **error)
GtkFileSystemVolume * _gtk_file_system_get_volume_for_file(GtkFileSystem *file_system, GFile *file)
gboolean _gtk_folder_is_finished_loading(GtkFolder *folder)
void _gtk_file_system_volume_unref(GtkFileSystemVolume *volume)
GdkPixbuf * _gtk_file_info_render_icon(GFileInfo *info, GtkWidget *widget, gint icon_size)
void _gtk_file_system_set_bookmark_label(GtkFileSystem *file_system, GFile *file, const gchar *label)
GType _gtk_file_system_get_type(void) G_GNUC_CONST
GtkFileSystem * _gtk_file_system_new(void)
void(* GtkFileSystemGetFolderCallback)(GCancellable *cancellable, GtkFolder *folder, const GError *error, gpointer data)
Definition: gtkfilesystem.h:82
gboolean _gtk_file_system_volume_is_mounted(GtkFileSystemVolume *volume)
gboolean _gtk_file_info_consider_as_directory(GFileInfo *info)
gboolean _gtk_file_system_remove_bookmark(GtkFileSystem *file_system, GFile *file, GError **error)
struct GtkFileSystemBookmark GtkFileSystemBookmark
Definition: gtkfilesystem.h:48
GFile * _gtk_file_system_volume_get_root(GtkFileSystemVolume *volume)
Transmitter info
Transmitter error
void(* bookmarks_changed)(GtkFileSystem *file_system)
Definition: gtkfilesystem.h:54
GObjectClass parent_class
Definition: gtkfilesystem.h:52
void(* volumes_changed)(GtkFileSystem *file_system)
Definition: gtkfilesystem.h:55
GObject parent_object
Definition: gtkfilesystem.h:60
GObjectClass parent_class
Definition: gtkfilesystem.h:65
void(* files_added)(GtkFolder *folder, GList *paths)
Definition: gtkfilesystem.h:67
void(* files_removed)(GtkFolder *folder, GList *paths)
Definition: gtkfilesystem.h:69
void(* finished_loading)(GtkFolder *folder)
Definition: gtkfilesystem.h:73
void(* files_changed)(GtkFolder *folder, GList *paths)
Definition: gtkfilesystem.h:71
void(* deleted)(GtkFolder *folder)
Definition: gtkfilesystem.h:74
GObject parent_object
Definition: gtkfilesystem.h:79