2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_FILESELECTION_H
4 #define _GTKMM_FILESELECTION_H
6 #include <gtkmmconfig.h>
8 #ifndef GTKMM_DISABLE_DEPRECATED
18 * Copyright (C) 1998-2002 The gtkmm Development Team
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Library General Public
22 * License as published by the Free Software Foundation; either
23 * version 2 of the License, or (at your option) any later version.
25 * This library is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Library General Public License for more details.
30 * You should have received a copy of the GNU Library General Public
31 * License along with this library; if not, write to the Free
32 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
35 // This is for including the config header before any code (such as
36 // the #ifndef GTKMM_DISABLE_DEPRECATED in deprecated classes) is generated:
39 #include <gtkmm/dialog.h>
40 #include <gtkmm/button.h>
41 #include <gtkmm/entry.h>
42 #include <gtkmm/label.h>
43 #include <gtkmm/box.h>
44 #include <gtkmm/treeview.h>
45 #include <gtkmm/buttonbox.h>
46 #include <gtkmm/optionmenu.h>
49 #ifndef DOXYGEN_SHOULD_SKIP_THIS
50 typedef struct _GtkFileSelection GtkFileSelection;
51 typedef struct _GtkFileSelectionClass GtkFileSelectionClass;
52 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
56 { class FileSelection_Class; } // namespace Gtk
60 /** Prompt the user for a file or directory name.
62 * Gtk::FileSelection should be used to retrieve file or directory names from
63 * the user. It will create a new dialog window containing a directory list,
64 * and a file list corresponding to the current working directory. The
65 * filesystem can be navigated using the directory list or the drop-down
66 * history menu. Alternatively, the TAB key can be used to navigate using
67 * filename completion - common in text based editors such as emacs and jed.
69 * @deprecated Use the FileChooserDialog instead.
72 class FileSelection : public Dialog
75 #ifndef DOXYGEN_SHOULD_SKIP_THIS
76 typedef FileSelection CppObjectType;
77 typedef FileSelection_Class CppClassType;
78 typedef GtkFileSelection BaseObjectType;
79 typedef GtkFileSelectionClass BaseClassType;
80 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
82 virtual ~FileSelection();
84 #ifndef DOXYGEN_SHOULD_SKIP_THIS
87 friend class FileSelection_Class;
88 static CppClassType fileselection_class_;
91 FileSelection(const FileSelection&);
92 FileSelection& operator=(const FileSelection&);
95 explicit FileSelection(const Glib::ConstructParams& construct_params);
96 explicit FileSelection(GtkFileSelection* castitem);
98 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
101 #ifndef DOXYGEN_SHOULD_SKIP_THIS
102 static GType get_type() G_GNUC_CONST;
103 static GType get_base_type() G_GNUC_CONST;
106 ///Provides access to the underlying C GtkObject.
107 GtkFileSelection* gobj() { return reinterpret_cast<GtkFileSelection*>(gobject_); }
109 ///Provides access to the underlying C GtkObject.
110 const GtkFileSelection* gobj() const { return reinterpret_cast<GtkFileSelection*>(gobject_); }
114 //C++ methods used to invoke GTK+ virtual functions:
115 #ifdef GLIBMM_VFUNCS_ENABLED
116 #endif //GLIBMM_VFUNCS_ENABLED
119 //GTK+ Virtual Functions (override these to change behaviour):
120 #ifdef GLIBMM_VFUNCS_ENABLED
121 #endif //GLIBMM_VFUNCS_ENABLED
123 //Default Signal Handlers::
124 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
125 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
134 explicit FileSelection(const Glib::ustring& title);
137 /** Sets a default path for the file requestor. If @a filename includes a
138 * directory path, then the requestor will open with that path as its
139 * current working directory.
141 * This has the consequence that in order to open the requestor with a
142 * working directory and an empty filename, @a filename must have a trailing
143 * directory separator.
145 * The encoding of @a filename is preferred GLib file name encoding, which
146 * may not be UTF-8. See Glib::filename_from_utf8().
147 * @param filename A string to set as the default file name.
149 void set_filename(const std::string& filename);
152 /** This function returns the selected filename in the GLib file name
153 * encoding. To convert to UTF-8, call Glib::filename_to_utf8(). The
154 * returned string points to a statically allocated buffer and should
155 * be copied if you plan to keep it around.
157 * If no file is selected then the selected directory path is returned.
158 * @return Currently-selected filename in the on-disk encoding.
160 std::string get_filename() const;
163 void complete(const Glib::ustring& pattern);
165 void show_fileop_buttons();
167 void hide_fileop_buttons();
170 /** Retrieves the list of file selections the user has made in the dialog box.
171 * This function is intended for use when the user can select multiple files
174 * The filenames are in the GLib file name encoding. To convert to
175 * UTF-8, call Glib::filename_to_utf8() on each string.
176 * @return A newly-allocated <tt>0</tt>-terminated array of strings. Use
177 * Glib::strfreev() to free it.
179 Glib::ArrayHandle<std::string> get_selections() const;
182 /** Sets whether the user is allowed to select multiple files in the file list.
183 * Use get_selections() to get the list of selected files.
184 * @param select_multiple Whether or not the user is allowed to select multiple
185 * files in the file list.
187 void set_select_multiple(bool select_multiple = true);
189 /** Determines whether or not the user is allowed to select multiple files in
190 * the file list. See set_select_multiple().
191 * @return <tt>true</tt> if the user is allowed to select multiple files in the
194 bool get_select_multiple() const;
197 TreeView* get_dir_list();
198 const TreeView* get_dir_list() const;
199 TreeView* get_file_list();
200 const TreeView* get_file_list() const;
201 OptionMenu* get_history_pulldown();
202 const OptionMenu* get_history_pulldown() const;
203 Entry* get_selection_entry();
204 const Entry* get_selection_entry() const;
205 Label* get_selection_text();
206 const Label* get_selection_text() const;
207 VBox* get_main_vbox();
208 const VBox* get_main_vbox() const;
209 Button* get_ok_button();
210 const Button* get_ok_button() const;
211 Button* get_cancel_button();
212 const Button* get_cancel_button() const;
213 Button* get_help_button();
214 const Button* get_help_button() const;
215 HButtonBox* get_button_area();
216 const HButtonBox* get_button_area() const;
217 HBox* get_action_area();
218 const HBox* get_action_area() const;
220 #ifdef GLIBMM_PROPERTIES_ENABLED
221 /** Whether buttons for creating/manipulating files should be displayed.
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<bool> property_show_fileops() ;
228 #endif //#GLIBMM_PROPERTIES_ENABLED
230 #ifdef GLIBMM_PROPERTIES_ENABLED
231 /** Whether buttons for creating/manipulating files should be displayed.
233 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
234 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
235 * the value of the property changes.
237 Glib::PropertyProxy_ReadOnly<bool> property_show_fileops() const;
238 #endif //#GLIBMM_PROPERTIES_ENABLED
240 #ifdef GLIBMM_PROPERTIES_ENABLED
241 /** The currently selected filename.
243 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
244 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
245 * the value of the property changes.
247 Glib::PropertyProxy<std::string> property_filename() ;
248 #endif //#GLIBMM_PROPERTIES_ENABLED
250 #ifdef GLIBMM_PROPERTIES_ENABLED
251 /** The currently selected filename.
253 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
254 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
255 * the value of the property changes.
257 Glib::PropertyProxy_ReadOnly<std::string> property_filename() const;
258 #endif //#GLIBMM_PROPERTIES_ENABLED
260 #ifdef GLIBMM_PROPERTIES_ENABLED
261 /** Whether to allow multiple files to be selected.
263 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
264 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
265 * the value of the property changes.
267 Glib::PropertyProxy<bool> property_select_multiple() ;
268 #endif //#GLIBMM_PROPERTIES_ENABLED
270 #ifdef GLIBMM_PROPERTIES_ENABLED
271 /** Whether to allow multiple files to be selected.
273 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
274 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
275 * the value of the property changes.
277 Glib::PropertyProxy_ReadOnly<bool> property_select_multiple() const;
278 #endif //#GLIBMM_PROPERTIES_ENABLED
288 /** A Glib::wrap() method for this object.
290 * @param object The C instance.
291 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
292 * @result A C++ instance that wraps this C instance.
294 * @relates Gtk::FileSelection
296 Gtk::FileSelection* wrap(GtkFileSelection* object, bool take_copy = false);
300 #endif // GTKMM_DISABLE_DEPRECATED
303 #endif /* _GTKMM_FILESELECTION_H */