2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_FILESELECTION_H
4 #define _GTKMM_FILESELECTION_H
13 * Copyright (C) 1998-2002 The gtkmm Development Team
15 * This library is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Library General Public
17 * License as published by the Free Software Foundation; either
18 * version 2 of the License, or (at your option) any later version.
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Library General Public License for more details.
25 * You should have received a copy of the GNU Library General Public
26 * License along with this library; if not, write to the Free
27 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 #include <gtkmm/dialog.h>
31 #include <gtkmm/button.h>
32 #include <gtkmm/entry.h>
33 #include <gtkmm/label.h>
34 #include <gtkmm/box.h>
35 #include <gtkmm/treeview.h>
36 #include <gtkmm/buttonbox.h>
37 #include <gtkmm/optionmenu.h>
40 #ifndef DOXYGEN_SHOULD_SKIP_THIS
41 typedef struct _GtkFileSelection GtkFileSelection;
42 typedef struct _GtkFileSelectionClass GtkFileSelectionClass;
43 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
47 { class FileSelection_Class; } // namespace Gtk
51 /** Prompt the user for a file or directory name.
53 * Gtk::FileSelection should be used to retrieve file or directory names from
54 * the user. It will create a new dialog window containing a directory list,
55 * and a file list corresponding to the current working directory. The
56 * filesystem can be navigated using the directory list or the drop-down
57 * history menu. Alternatively, the TAB key can be used to navigate using
58 * filename completion - common in text based editors such as emacs and jed.
60 * @deprecated Use the FileChooserDialog instead.
63 class FileSelection : public Dialog
66 #ifndef DOXYGEN_SHOULD_SKIP_THIS
67 typedef FileSelection CppObjectType;
68 typedef FileSelection_Class CppClassType;
69 typedef GtkFileSelection BaseObjectType;
70 typedef GtkFileSelectionClass BaseClassType;
71 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
73 virtual ~FileSelection();
75 #ifndef DOXYGEN_SHOULD_SKIP_THIS
78 friend class FileSelection_Class;
79 static CppClassType fileselection_class_;
82 FileSelection(const FileSelection&);
83 FileSelection& operator=(const FileSelection&);
86 explicit FileSelection(const Glib::ConstructParams& construct_params);
87 explicit FileSelection(GtkFileSelection* castitem);
89 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
92 #ifndef DOXYGEN_SHOULD_SKIP_THIS
93 static GType get_type() G_GNUC_CONST;
94 static GType get_base_type() G_GNUC_CONST;
97 ///Provides access to the underlying C GtkObject.
98 GtkFileSelection* gobj() { return reinterpret_cast<GtkFileSelection*>(gobject_); }
100 ///Provides access to the underlying C GtkObject.
101 const GtkFileSelection* gobj() const { return reinterpret_cast<GtkFileSelection*>(gobject_); }
105 //C++ methods used to invoke GTK+ virtual functions:
108 //GTK+ Virtual Functions (override these to change behaviour):
110 //Default Signal Handlers::
119 explicit FileSelection(const Glib::ustring& title);
122 /** Sets a default path for the file requestor. If @a filename includes a
123 * directory path, then the requestor will open with that path as its
124 * current working directory.
126 * This has the consequence that in order to open the requestor with a
127 * working directory and an empty filename, @a filename must have a trailing
128 * directory separator.
130 * The encoding of @a filename is preferred GLib file name encoding, which
131 * may not be UTF-8. See Glib::filename_from_utf8().
132 * @param filename A string to set as the default file name.
134 void set_filename(const std::string& filename);
137 /** This function returns the selected filename in the GLib file name
138 * encoding. To convert to UTF-8, call Glib::filename_to_utf8(). The
139 * returned string points to a statically allocated buffer and should
140 * be copied if you plan to keep it around.
142 * If no file is selected then the selected directory path is returned.
143 * @return Currently-selected filename in the on-disk encoding.
145 std::string get_filename() const;
148 void complete(const Glib::ustring& pattern);
150 void show_fileop_buttons();
152 void hide_fileop_buttons();
155 /** Retrieves the list of file selections the user has made in the dialog box.
156 * This function is intended for use when the user can select multiple files
159 * The filenames are in the GLib file name encoding. To convert to
160 * UTF-8, call Glib::filename_to_utf8() on each string.
161 * @return A newly-allocated <tt>0</tt>-terminated array of strings. Use
162 * Glib::strfreev() to free it.
164 Glib::ArrayHandle<std::string> get_selections() const;
167 /** Sets whether the user is allowed to select multiple files in the file list.
168 * Use get_selections() to get the list of selected files.
169 * @param select_multiple Whether or not the user is allowed to select multiple
170 * files in the file list.
172 void set_select_multiple(bool select_multiple = true);
174 /** Determines whether or not the user is allowed to select multiple files in
175 * the file list. See set_select_multiple().
176 * @return <tt>true</tt> if the user is allowed to select multiple files in the
179 bool get_select_multiple() const;
182 TreeView* get_dir_list();
183 const TreeView* get_dir_list() const;
184 TreeView* get_file_list();
185 const TreeView* get_file_list() const;
186 OptionMenu* get_history_pulldown();
187 const OptionMenu* get_history_pulldown() const;
188 Entry* get_selection_entry();
189 const Entry* get_selection_entry() const;
190 Label* get_selection_text();
191 const Label* get_selection_text() const;
192 VBox* get_main_vbox();
193 const VBox* get_main_vbox() const;
194 Button* get_ok_button();
195 const Button* get_ok_button() const;
196 Button* get_cancel_button();
197 const Button* get_cancel_button() const;
198 Button* get_help_button();
199 const Button* get_help_button() const;
200 HButtonBox* get_button_area();
201 const HButtonBox* get_button_area() const;
202 HBox* get_action_area();
203 const HBox* get_action_area() const;
205 /** Whether buttons for creating/manipulating files should be displayed.
207 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
208 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
209 * the value of the property changes.
211 Glib::PropertyProxy<bool> property_show_fileops() ;
213 /** Whether buttons for creating/manipulating files should be displayed.
215 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
216 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
217 * the value of the property changes.
219 Glib::PropertyProxy_ReadOnly<bool> property_show_fileops() const;
221 /** The currently selected filename.
223 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
224 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
225 * the value of the property changes.
227 Glib::PropertyProxy<std::string> property_filename() ;
229 /** The currently selected filename.
231 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
232 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
233 * the value of the property changes.
235 Glib::PropertyProxy_ReadOnly<std::string> property_filename() const;
237 /** Whether to allow multiple files to be selected.
239 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
240 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
241 * the value of the property changes.
243 Glib::PropertyProxy<bool> property_select_multiple() ;
245 /** Whether to allow multiple files to be selected.
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<bool> property_select_multiple() const;
262 /** @relates Gtk::FileSelection
263 * @param object The C instance
264 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
265 * @result A C++ instance that wraps this C instance.
267 Gtk::FileSelection* wrap(GtkFileSelection* object, bool take_copy = false);
269 #endif /* _GTKMM_FILESELECTION_H */