2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_FILESELECTION_H
4 #define _GTKMM_FILESELECTION_H
6 #ifndef GTKMM_DISABLE_DEPRECATED
16 * Copyright (C) 1998-2002 The gtkmm Development Team
18 * This library is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU Library General Public
20 * License as published by the Free Software Foundation; either
21 * version 2 of the License, or (at your option) any later version.
23 * This library is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26 * Library General Public License for more details.
28 * You should have received a copy of the GNU Library General Public
29 * License along with this library; if not, write to the Free
30 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
33 #include <gtkmm/dialog.h>
34 #include <gtkmm/button.h>
35 #include <gtkmm/entry.h>
36 #include <gtkmm/label.h>
37 #include <gtkmm/box.h>
38 #include <gtkmm/treeview.h>
39 #include <gtkmm/buttonbox.h>
40 #include <gtkmm/optionmenu.h>
43 #ifndef DOXYGEN_SHOULD_SKIP_THIS
44 typedef struct _GtkFileSelection GtkFileSelection;
45 typedef struct _GtkFileSelectionClass GtkFileSelectionClass;
46 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
50 { class FileSelection_Class; } // namespace Gtk
54 /** Prompt the user for a file or directory name.
56 * Gtk::FileSelection should be used to retrieve file or directory names from
57 * the user. It will create a new dialog window containing a directory list,
58 * and a file list corresponding to the current working directory. The
59 * filesystem can be navigated using the directory list or the drop-down
60 * history menu. Alternatively, the TAB key can be used to navigate using
61 * filename completion - common in text based editors such as emacs and jed.
63 * @deprecated Use the FileChooserDialog instead.
66 class FileSelection : public Dialog
69 #ifndef DOXYGEN_SHOULD_SKIP_THIS
70 typedef FileSelection CppObjectType;
71 typedef FileSelection_Class CppClassType;
72 typedef GtkFileSelection BaseObjectType;
73 typedef GtkFileSelectionClass BaseClassType;
74 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
76 virtual ~FileSelection();
78 #ifndef DOXYGEN_SHOULD_SKIP_THIS
81 friend class FileSelection_Class;
82 static CppClassType fileselection_class_;
85 FileSelection(const FileSelection&);
86 FileSelection& operator=(const FileSelection&);
89 explicit FileSelection(const Glib::ConstructParams& construct_params);
90 explicit FileSelection(GtkFileSelection* castitem);
92 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
95 #ifndef DOXYGEN_SHOULD_SKIP_THIS
96 static GType get_type() G_GNUC_CONST;
97 static GType get_base_type() G_GNUC_CONST;
100 ///Provides access to the underlying C GtkObject.
101 GtkFileSelection* gobj() { return reinterpret_cast<GtkFileSelection*>(gobject_); }
103 ///Provides access to the underlying C GtkObject.
104 const GtkFileSelection* gobj() const { return reinterpret_cast<GtkFileSelection*>(gobject_); }
108 //C++ methods used to invoke GTK+ virtual functions:
109 #ifdef GLIBMM_VFUNCS_ENABLED
110 #endif //GLIBMM_VFUNCS_ENABLED
113 //GTK+ Virtual Functions (override these to change behaviour):
114 #ifdef GLIBMM_VFUNCS_ENABLED
115 #endif //GLIBMM_VFUNCS_ENABLED
117 //Default Signal Handlers::
118 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
119 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
128 explicit FileSelection(const Glib::ustring& title);
131 /** Sets a default path for the file requestor. If @a filename includes a
132 * directory path, then the requestor will open with that path as its
133 * current working directory.
135 * This has the consequence that in order to open the requestor with a
136 * working directory and an empty filename, @a filename must have a trailing
137 * directory separator.
139 * The encoding of @a filename is preferred GLib file name encoding, which
140 * may not be UTF-8. See Glib::filename_from_utf8().
141 * @param filename A string to set as the default file name.
143 void set_filename(const std::string& filename);
146 /** This function returns the selected filename in the GLib file name
147 * encoding. To convert to UTF-8, call Glib::filename_to_utf8(). The
148 * returned string points to a statically allocated buffer and should
149 * be copied if you plan to keep it around.
151 * If no file is selected then the selected directory path is returned.
152 * @return Currently-selected filename in the on-disk encoding.
154 std::string get_filename() const;
157 void complete(const Glib::ustring& pattern);
159 void show_fileop_buttons();
161 void hide_fileop_buttons();
164 /** Retrieves the list of file selections the user has made in the dialog box.
165 * This function is intended for use when the user can select multiple files
168 * The filenames are in the GLib file name encoding. To convert to
169 * UTF-8, call Glib::filename_to_utf8() on each string.
170 * @return A newly-allocated <tt>0</tt>-terminated array of strings. Use
171 * Glib::strfreev() to free it.
173 Glib::ArrayHandle<std::string> get_selections() const;
176 /** Sets whether the user is allowed to select multiple files in the file list.
177 * Use get_selections() to get the list of selected files.
178 * @param select_multiple Whether or not the user is allowed to select multiple
179 * files in the file list.
181 void set_select_multiple(bool select_multiple = true);
183 /** Determines whether or not the user is allowed to select multiple files in
184 * the file list. See set_select_multiple().
185 * @return <tt>true</tt> if the user is allowed to select multiple files in the
188 bool get_select_multiple() const;
191 TreeView* get_dir_list();
192 const TreeView* get_dir_list() const;
193 TreeView* get_file_list();
194 const TreeView* get_file_list() const;
195 OptionMenu* get_history_pulldown();
196 const OptionMenu* get_history_pulldown() const;
197 Entry* get_selection_entry();
198 const Entry* get_selection_entry() const;
199 Label* get_selection_text();
200 const Label* get_selection_text() const;
201 VBox* get_main_vbox();
202 const VBox* get_main_vbox() const;
203 Button* get_ok_button();
204 const Button* get_ok_button() const;
205 Button* get_cancel_button();
206 const Button* get_cancel_button() const;
207 Button* get_help_button();
208 const Button* get_help_button() const;
209 HButtonBox* get_button_area();
210 const HButtonBox* get_button_area() const;
211 HBox* get_action_area();
212 const HBox* get_action_area() const;
214 #ifdef GLIBMM_PROPERTIES_ENABLED
215 /** Whether buttons for creating/manipulating files should be displayed.
217 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
218 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
219 * the value of the property changes.
221 Glib::PropertyProxy<bool> property_show_fileops() ;
222 #endif //#GLIBMM_PROPERTIES_ENABLED
224 #ifdef GLIBMM_PROPERTIES_ENABLED
225 /** Whether buttons for creating/manipulating files should be displayed.
227 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
228 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
229 * the value of the property changes.
231 Glib::PropertyProxy_ReadOnly<bool> property_show_fileops() const;
232 #endif //#GLIBMM_PROPERTIES_ENABLED
234 #ifdef GLIBMM_PROPERTIES_ENABLED
235 /** The currently selected filename.
237 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
238 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
239 * the value of the property changes.
241 Glib::PropertyProxy<std::string> property_filename() ;
242 #endif //#GLIBMM_PROPERTIES_ENABLED
244 #ifdef GLIBMM_PROPERTIES_ENABLED
245 /** The currently selected filename.
247 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
248 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
249 * the value of the property changes.
251 Glib::PropertyProxy_ReadOnly<std::string> property_filename() const;
252 #endif //#GLIBMM_PROPERTIES_ENABLED
254 #ifdef GLIBMM_PROPERTIES_ENABLED
255 /** Whether to allow multiple files to be selected.
257 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
258 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
259 * the value of the property changes.
261 Glib::PropertyProxy<bool> property_select_multiple() ;
262 #endif //#GLIBMM_PROPERTIES_ENABLED
264 #ifdef GLIBMM_PROPERTIES_ENABLED
265 /** Whether to allow multiple files to be selected.
267 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
268 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
269 * the value of the property changes.
271 Glib::PropertyProxy_ReadOnly<bool> property_select_multiple() const;
272 #endif //#GLIBMM_PROPERTIES_ENABLED
282 /** @relates Gtk::FileSelection
283 * @param object The C instance
284 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
285 * @result A C++ instance that wraps this C instance.
287 Gtk::FileSelection* wrap(GtkFileSelection* object, bool take_copy = false);
291 #endif // GTKMM_DISABLE_DEPRECATED
294 #endif /* _GTKMM_FILESELECTION_H */