2008-07-01 22:57:50 +00:00
|
|
|
/* GTK - The GIMP Toolkit
|
2008-06-10 00:39:35 +00:00
|
|
|
* gtkfilesystem.h: Filesystem abstraction functions.
|
2003-03-21 20:34:02 +00:00
|
|
|
* Copyright (C) 2003, Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-02-27 13:01:10 +00:00
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2003-03-21 20:34:02 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GTK_FILE_SYSTEM_H__
|
|
|
|
#define __GTK_FILE_SYSTEM_H__
|
|
|
|
|
2008-06-10 00:39:35 +00:00
|
|
|
#include <gio/gio.h>
|
2003-07-16 21:07:38 +00:00
|
|
|
#include <gtk/gtkwidget.h> /* For icon handling */
|
2003-03-21 20:34:02 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2008-06-13 16:47:41 +00:00
|
|
|
#define GTK_TYPE_FILE_SYSTEM (_gtk_file_system_get_type ())
|
2008-06-10 00:39:35 +00:00
|
|
|
#define GTK_FILE_SYSTEM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_FILE_SYSTEM, GtkFileSystem))
|
|
|
|
#define GTK_FILE_SYSTEM_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GTK_TYPE_FILE_SYSTEM, GtkFileSystemClass))
|
|
|
|
#define GTK_IS_FILE_SYSTEM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_FILE_SYSTEM))
|
|
|
|
#define GTK_IS_FILE_SYSTEM_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GTK_TYPE_FILE_SYSTEM))
|
|
|
|
#define GTK_FILE_SYSTEM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_FILE_SYSTEM, GtkFileSystemClass))
|
2003-03-21 20:34:02 +00:00
|
|
|
|
2010-08-26 13:57:05 +00:00
|
|
|
typedef struct GtkFileSystem GtkFileSystem;
|
2010-08-26 17:15:37 +00:00
|
|
|
typedef struct GtkFileSystemPrivate GtkFileSystemPrivate;
|
2010-08-26 13:57:05 +00:00
|
|
|
typedef struct GtkFileSystemClass GtkFileSystemClass;
|
|
|
|
|
|
|
|
|
2008-06-10 00:39:35 +00:00
|
|
|
typedef struct GtkFileSystemVolume GtkFileSystemVolume; /* opaque struct */
|
2006-05-01 21:41:12 +00:00
|
|
|
|
2010-08-26 13:57:05 +00:00
|
|
|
|
|
|
|
struct GtkFileSystem
|
|
|
|
{
|
|
|
|
GObject parent_object;
|
|
|
|
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkFileSystemPrivate *priv;
|
2010-08-26 13:57:05 +00:00
|
|
|
};
|
|
|
|
|
2008-06-10 00:39:35 +00:00
|
|
|
struct GtkFileSystemClass
|
2006-05-01 21:41:12 +00:00
|
|
|
{
|
2008-06-10 00:39:35 +00:00
|
|
|
GObjectClass parent_class;
|
2006-05-01 21:41:12 +00:00
|
|
|
|
2008-06-10 00:39:35 +00:00
|
|
|
void (*volumes_changed) (GtkFileSystem *file_system);
|
2006-05-01 21:41:12 +00:00
|
|
|
};
|
|
|
|
|
2010-08-26 13:57:05 +00:00
|
|
|
|
2008-06-10 00:39:35 +00:00
|
|
|
typedef void (* GtkFileSystemGetInfoCallback) (GCancellable *cancellable,
|
|
|
|
GFileInfo *file_info,
|
|
|
|
const GError *error,
|
|
|
|
gpointer data);
|
|
|
|
typedef void (* GtkFileSystemVolumeMountCallback) (GCancellable *cancellable,
|
|
|
|
GtkFileSystemVolume *volume,
|
|
|
|
const GError *error,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
/* GtkFileSystem methods */
|
2008-06-13 16:47:41 +00:00
|
|
|
GType _gtk_file_system_get_type (void) G_GNUC_CONST;
|
|
|
|
|
|
|
|
GtkFileSystem * _gtk_file_system_new (void);
|
|
|
|
|
|
|
|
GSList * _gtk_file_system_list_volumes (GtkFileSystem *file_system);
|
|
|
|
|
|
|
|
GCancellable * _gtk_file_system_get_info (GtkFileSystem *file_system,
|
|
|
|
GFile *file,
|
|
|
|
const gchar *attributes,
|
|
|
|
GtkFileSystemGetInfoCallback callback,
|
|
|
|
gpointer data);
|
|
|
|
GCancellable * _gtk_file_system_mount_volume (GtkFileSystem *file_system,
|
|
|
|
GtkFileSystemVolume *volume,
|
|
|
|
GMountOperation *mount_operation,
|
|
|
|
GtkFileSystemVolumeMountCallback callback,
|
|
|
|
gpointer data);
|
|
|
|
GCancellable * _gtk_file_system_mount_enclosing_volume (GtkFileSystem *file_system,
|
|
|
|
GFile *file,
|
|
|
|
GMountOperation *mount_operation,
|
|
|
|
GtkFileSystemVolumeMountCallback callback,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
GtkFileSystemVolume * _gtk_file_system_get_volume_for_file (GtkFileSystem *file_system,
|
|
|
|
GFile *file);
|
2008-06-10 00:39:35 +00:00
|
|
|
|
|
|
|
/* GtkFileSystemVolume methods */
|
2008-06-13 16:47:41 +00:00
|
|
|
gchar * _gtk_file_system_volume_get_display_name (GtkFileSystemVolume *volume);
|
|
|
|
gboolean _gtk_file_system_volume_is_mounted (GtkFileSystemVolume *volume);
|
|
|
|
GFile * _gtk_file_system_volume_get_root (GtkFileSystemVolume *volume);
|
2013-07-03 11:26:03 +00:00
|
|
|
cairo_surface_t * _gtk_file_system_volume_render_icon (GtkFileSystemVolume *volume,
|
2008-06-13 16:47:41 +00:00
|
|
|
GtkWidget *widget,
|
|
|
|
gint icon_size,
|
|
|
|
GError **error);
|
2008-06-10 00:39:35 +00:00
|
|
|
|
2010-03-09 04:56:43 +00:00
|
|
|
GtkFileSystemVolume *_gtk_file_system_volume_ref (GtkFileSystemVolume *volume);
|
|
|
|
void _gtk_file_system_volume_unref (GtkFileSystemVolume *volume);
|
2008-06-10 00:39:35 +00:00
|
|
|
|
|
|
|
/* GFileInfo helper functions */
|
2013-07-03 11:26:03 +00:00
|
|
|
cairo_surface_t * _gtk_file_info_render_icon (GFileInfo *info,
|
|
|
|
GtkWidget *widget,
|
|
|
|
gint icon_size);
|
2004-02-19 07:43:39 +00:00
|
|
|
|
2008-12-14 02:14:19 +00:00
|
|
|
gboolean _gtk_file_info_consider_as_directory (GFileInfo *info);
|
|
|
|
|
2012-11-18 08:39:11 +00:00
|
|
|
/* GFile helper functions */
|
2013-03-05 19:59:04 +00:00
|
|
|
gboolean _gtk_file_has_native_path (GFile *file);
|
2012-11-18 08:39:11 +00:00
|
|
|
|
2003-03-21 20:34:02 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GTK_FILE_SYSTEM_H__ */
|