1 /* GTK - The GIMP Toolkit
2 * gtkfilechooser.h: Abstract interface for file selector GUIs
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, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
21 #ifndef __GTK_FILE_CHOOSER_H__
22 #define __GTK_FILE_CHOOSER_H__
24 #include <gtk/gtkwidget.h>
28 #define GTK_TYPE_FILE_CHOOSER (gtk_file_chooser_get_type ())
29 #define GTK_FILE_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FILE_CHOOSER, GtkFileChooser))
30 #define GTK_IS_FILE_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_FILE_CHOOSER))
32 typedef struct _GtkFileChooser GtkFileChooser;
36 GTK_FILE_CHOOSER_ACTION_OPEN,
37 GTK_FILE_CHOOSER_ACTION_SAVE
38 } GtkFileChooserAction;
40 GType gtk_file_chooser_get_type (void);
44 void gtk_file_chooser_set_action (GtkFileChooser *chooser,
45 GtkFileChooserAction action);
46 GtkFileChooserAction gtk_file_chooser_get_action (GtkFileChooser *chooser);
47 void gtk_file_chooser_set_folder_mode (GtkFileChooser *chooser,
48 gboolean folder_mode);
49 gboolean gtk_file_chooser_get_folder_mode (GtkFileChooser *chooser);
50 void gtk_file_chooser_set_local_only (GtkFileChooser *chooser,
52 gboolean gtk_file_chooser_get_local_only (GtkFileChooser *chooser);
53 void gtk_file_chooser_set_select_multiple (GtkFileChooser *chooser,
54 gboolean select_multiple);
55 gboolean gtk_file_chooser_get_select_multiple (GtkFileChooser *chooser);
57 /* Filename manipulation
59 gchar * gtk_file_chooser_get_filename (GtkFileChooser *chooser);
60 void gtk_file_chooser_set_filename (GtkFileChooser *chooser,
61 const char *filename);
62 void gtk_file_chooser_select_filename (GtkFileChooser *chooser,
63 const char *filename);
64 void gtk_file_chooser_unselect_filename (GtkFileChooser *chooser,
65 const char *filename);
66 void gtk_file_chooser_select_all (GtkFileChooser *chooser);
67 void gtk_file_chooser_unselect_all (GtkFileChooser *chooser);
68 GSList *gtk_file_chooser_get_filenames (GtkFileChooser *chooser);
69 void gtk_file_chooser_set_current_folder (GtkFileChooser *chooser,
70 const gchar *filename);
71 gchar *gtk_file_chooser_get_current_folder (GtkFileChooser *chooser);
76 gchar * gtk_file_chooser_get_uri (GtkFileChooser *chooser);
77 void gtk_file_chooser_set_uri (GtkFileChooser *chooser,
79 void gtk_file_chooser_select_uri (GtkFileChooser *chooser,
81 void gtk_file_chooser_unselect_uri (GtkFileChooser *chooser,
83 GSList *gtk_file_chooser_get_uris (GtkFileChooser *chooser);
85 void gtk_file_chooser_set_current_folder_uri (GtkFileChooser *chooser,
87 gchar *gtk_file_chooser_get_current_folder_uri (GtkFileChooser *chooser);
91 void gtk_file_chooser_set_preview_widget (GtkFileChooser *chooser,
92 GtkWidget *preview_widget);
93 GtkWidget *gtk_file_chooser_get_preview_widget (GtkFileChooser *chooser);
94 void gtk_file_chooser_set_preview_widget_active (GtkFileChooser *chooser,
96 gboolean gtk_file_chooser_get_preview_widget_active (GtkFileChooser *chooser);
98 const char *gtk_file_chooser_get_preview_filename (GtkFileChooser *file_chooser);
99 const char *gtk_file_chooser_get_preview_uri (GtkFileChooser *file_chooser);
105 void gtk_file_chooser_add_filter (GtkFileChooser *chooser,
106 GtkFileFilter *filter);
107 void gtk_file_chooser_remove_filter (GtkFileChooser *chooser,
108 GtkFileFilter *filter);
109 GList *gtk_file_chooser_get_filters (GtkFileChooser *chooser);
112 /************************************************/
114 static gboolean (*GtkFileFilterFunc) (const char *uri,
115 const char *filename,
118 GtkFileFilter *gtk_file_filter_new_pattern (const char *pattern);
119 GtkFileFilter *gtk_file_filter_new_mime_type (const char *mime_type);
120 GtkFileFilter *gtk_file_filter_new_callback (GtkFileFilterFunction *func,
122 GDestroyNotify notify);
127 #endif /* __GTK_FILE_CHOOSER_H__ */