]> Pileus Git - ~andy/gtk/blob - gtk/gtkfilechooser.h
Add setter and getter for the ::show-hidden property. (#145610, Jeff
[~andy/gtk] / gtk / gtkfilechooser.h
1 /* GTK - The GIMP Toolkit
2  * gtkfilechooser.h: Abstract interface for file selector GUIs
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_CHOOSER_H__
22 #define __GTK_FILE_CHOOSER_H__
23
24 #include "gtkfilefilter.h"
25 #include <gtk/gtkwidget.h>
26
27 G_BEGIN_DECLS
28
29 #define GTK_TYPE_FILE_CHOOSER             (gtk_file_chooser_get_type ())
30 #define GTK_FILE_CHOOSER(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FILE_CHOOSER, GtkFileChooser))
31 #define GTK_IS_FILE_CHOOSER(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_FILE_CHOOSER))
32
33 typedef struct _GtkFileChooser      GtkFileChooser;
34
35 typedef enum
36 {
37   GTK_FILE_CHOOSER_ACTION_OPEN,
38   GTK_FILE_CHOOSER_ACTION_SAVE,
39   GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
40   GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER
41 } GtkFileChooserAction;
42
43 GType gtk_file_chooser_get_type (void);
44
45 /* GError enumeration for GtkFileChooser */
46
47 #define GTK_FILE_CHOOSER_ERROR (gtk_file_chooser_error_quark ())
48
49 typedef enum {
50   GTK_FILE_CHOOSER_ERROR_NONEXISTENT,
51   GTK_FILE_CHOOSER_ERROR_BAD_FILENAME
52 } GtkFileChooserError;
53
54 GQuark gtk_file_chooser_error_quark (void);
55
56 /* Configuration
57  */
58 void                 gtk_file_chooser_set_action          (GtkFileChooser       *chooser,
59                                                            GtkFileChooserAction  action);
60 GtkFileChooserAction gtk_file_chooser_get_action          (GtkFileChooser       *chooser);
61 void                 gtk_file_chooser_set_local_only      (GtkFileChooser       *chooser,
62                                                            gboolean              local_only);
63 gboolean             gtk_file_chooser_get_local_only      (GtkFileChooser       *chooser);
64 void                 gtk_file_chooser_set_select_multiple (GtkFileChooser       *chooser,
65                                                            gboolean              select_multiple);
66 gboolean             gtk_file_chooser_get_select_multiple (GtkFileChooser       *chooser);
67 void                 gtk_file_chooser_set_show_hidden     (GtkFileChooser       *chooser,
68                                                            gboolean              show_hidden);
69 gboolean             gtk_file_chooser_get_show_hidden     (GtkFileChooser       *chooser);
70
71 /* Suggested name for the Save-type actions
72  */
73 void     gtk_file_chooser_set_current_name   (GtkFileChooser *chooser,
74                                               const gchar    *name);
75
76 /* Filename manipulation
77  */
78 gchar *  gtk_file_chooser_get_filename       (GtkFileChooser *chooser);
79 gboolean gtk_file_chooser_set_filename       (GtkFileChooser *chooser,
80                                               const char     *filename);
81 gboolean gtk_file_chooser_select_filename    (GtkFileChooser *chooser,
82                                               const char     *filename);
83 void     gtk_file_chooser_unselect_filename  (GtkFileChooser *chooser,
84                                               const char     *filename);
85 void     gtk_file_chooser_select_all         (GtkFileChooser *chooser);
86 void     gtk_file_chooser_unselect_all       (GtkFileChooser *chooser);
87 GSList * gtk_file_chooser_get_filenames      (GtkFileChooser *chooser);
88 gboolean gtk_file_chooser_set_current_folder (GtkFileChooser *chooser,
89                                               const gchar    *filename);
90 gchar *  gtk_file_chooser_get_current_folder (GtkFileChooser *chooser);
91
92
93 /* URI manipulation
94  */
95 gchar *  gtk_file_chooser_get_uri                (GtkFileChooser *chooser);
96 gboolean gtk_file_chooser_set_uri                (GtkFileChooser *chooser,
97                                                   const char     *uri);
98 gboolean gtk_file_chooser_select_uri             (GtkFileChooser *chooser,
99                                                   const char     *uri);
100 void     gtk_file_chooser_unselect_uri           (GtkFileChooser *chooser,
101                                                   const char     *uri);
102 GSList * gtk_file_chooser_get_uris               (GtkFileChooser *chooser);
103 gboolean gtk_file_chooser_set_current_folder_uri (GtkFileChooser *chooser,
104                                                   const gchar    *uri);
105 gchar *  gtk_file_chooser_get_current_folder_uri (GtkFileChooser *chooser);
106
107 /* Preview widget
108  */
109 void       gtk_file_chooser_set_preview_widget        (GtkFileChooser *chooser,
110                                                        GtkWidget      *preview_widget);
111 GtkWidget *gtk_file_chooser_get_preview_widget        (GtkFileChooser *chooser);
112 void       gtk_file_chooser_set_preview_widget_active (GtkFileChooser *chooser,
113                                                        gboolean        active);
114 gboolean   gtk_file_chooser_get_preview_widget_active (GtkFileChooser *chooser);
115 void       gtk_file_chooser_set_use_preview_label     (GtkFileChooser *chooser,
116                                                        gboolean        use_label);
117 gboolean   gtk_file_chooser_get_use_preview_label     (GtkFileChooser *chooser);
118
119 char *gtk_file_chooser_get_preview_filename (GtkFileChooser *chooser);
120 char *gtk_file_chooser_get_preview_uri      (GtkFileChooser *chooser);
121
122 /* Extra widget
123  */
124 void       gtk_file_chooser_set_extra_widget (GtkFileChooser *chooser,
125                                               GtkWidget      *extra_widget);
126 GtkWidget *gtk_file_chooser_get_extra_widget (GtkFileChooser *chooser);
127
128 /* List of user selectable filters
129  */
130 void    gtk_file_chooser_add_filter    (GtkFileChooser *chooser,
131                                         GtkFileFilter  *filter);
132 void    gtk_file_chooser_remove_filter (GtkFileChooser *chooser,
133                                         GtkFileFilter  *filter);
134 GSList *gtk_file_chooser_list_filters  (GtkFileChooser *chooser);
135
136 /* Current filter
137  */
138 void           gtk_file_chooser_set_filter (GtkFileChooser *chooser,
139                                            GtkFileFilter  *filter);
140 GtkFileFilter *gtk_file_chooser_get_filter (GtkFileChooser *chooser);
141
142 /* Per-application shortcut folders */
143
144 gboolean gtk_file_chooser_add_shortcut_folder    (GtkFileChooser *chooser,
145                                                   const char     *folder,
146                                                   GError        **error);
147 gboolean gtk_file_chooser_remove_shortcut_folder (GtkFileChooser *chooser,
148                                                   const char     *folder,
149                                                   GError        **error);
150 GSList *gtk_file_chooser_list_shortcut_folders   (GtkFileChooser *chooser);
151
152 gboolean gtk_file_chooser_add_shortcut_folder_uri    (GtkFileChooser *chooser,
153                                                       const char     *uri,
154                                                       GError        **error);
155 gboolean gtk_file_chooser_remove_shortcut_folder_uri (GtkFileChooser *chooser,
156                                                       const char     *uri,
157                                                       GError        **error);
158 GSList *gtk_file_chooser_list_shortcut_folder_uris   (GtkFileChooser *chooser);
159
160 G_END_DECLS
161
162 #endif /* __GTK_FILE_CHOOSER_H__ */