2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_FILECHOOSERBUTTON_H
4 #define _GTKMM_FILECHOOSERBUTTON_H
11 /* filechooserbutton.h
13 * Copyright (C) 2003 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/box.h>
31 #include <gtkmm/filechooserdialog.h>
34 #ifndef DOXYGEN_SHOULD_SKIP_THIS
35 typedef struct _GtkFileChooserButton GtkFileChooserButton;
36 typedef struct _GtkFileChooserButtonClass GtkFileChooserButtonClass;
37 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
41 { class FileChooserButton_Class; } // namespace Gtk
45 /** A button to launch a file chooser dialog.
47 * This widget lets the user select a file. It implements the FileChooser interface. Visually, it is a file name with a
48 * button to bring up a FileChooserDialog. The user can then use that dialog to change the file associated with that
49 * button. This widget does not support setting the "select_multiple" property to true.
51 * The FileChooserButton supports the FileChooserActions FILE_CHOOSER_ACTION_OPEN and FILE_CHOOSER_ACTION_SELECT_FOLDER.
53 * The FileChooserButton will ellipsize the label, and will thus request little horizontal space. To give the button more
54 * space, you should call size_request(), set_width_chars(), or pack the button in such a way that other interface
55 * elements give space to the widget.
60 class FileChooserButton
65 #ifndef DOXYGEN_SHOULD_SKIP_THIS
66 typedef FileChooserButton CppObjectType;
67 typedef FileChooserButton_Class CppClassType;
68 typedef GtkFileChooserButton BaseObjectType;
69 typedef GtkFileChooserButtonClass BaseClassType;
70 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
72 virtual ~FileChooserButton();
74 #ifndef DOXYGEN_SHOULD_SKIP_THIS
77 friend class FileChooserButton_Class;
78 static CppClassType filechooserbutton_class_;
81 FileChooserButton(const FileChooserButton&);
82 FileChooserButton& operator=(const FileChooserButton&);
85 explicit FileChooserButton(const Glib::ConstructParams& construct_params);
86 explicit FileChooserButton(GtkFileChooserButton* castitem);
88 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
91 #ifndef DOXYGEN_SHOULD_SKIP_THIS
92 static GType get_type() G_GNUC_CONST;
93 static GType get_base_type() G_GNUC_CONST;
96 ///Provides access to the underlying C GtkObject.
97 GtkFileChooserButton* gobj() { return reinterpret_cast<GtkFileChooserButton*>(gobject_); }
99 ///Provides access to the underlying C GtkObject.
100 const GtkFileChooserButton* gobj() const { return reinterpret_cast<GtkFileChooserButton*>(gobject_); }
104 //C++ methods used to invoke GTK+ virtual functions:
105 #ifdef GLIBMM_VFUNCS_ENABLED
106 #endif //GLIBMM_VFUNCS_ENABLED
109 //GTK+ Virtual Functions (override these to change behaviour):
110 #ifdef GLIBMM_VFUNCS_ENABLED
111 #endif //GLIBMM_VFUNCS_ENABLED
113 //Default Signal Handlers::
114 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
115 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
123 /** Creates a new file-selecting button widget with the default title.
124 * @param title The title of the browse dialog.
125 * @param action The open mode for the widget.
126 * @param backend The name of the Gtk::FileSystem backend to use.
128 explicit FileChooserButton(FileChooserAction action = FILE_CHOOSER_ACTION_OPEN);
130 /** Creates a new file-selecting button widget.
132 * @param title The title of the browse dialog.
133 * @param action The open mode for the widget.
135 explicit FileChooserButton(const Glib::ustring& title, FileChooserAction action = FILE_CHOOSER_ACTION_OPEN);
137 /** Creates a new file-selecting button widget using backend.
139 * @param title The title of the browse dialog.
140 * @param action The open mode for the widget.
141 * @param backend The name of the Gtk::FileSystem backend to use.
143 explicit FileChooserButton(const Glib::ustring& title, FileChooserAction action, const Glib::ustring& backend);
145 /** Creates a new file-selecting button widget which uses dialog as its file-picking window.
147 * @param dialog The dialog to use.
149 explicit FileChooserButton(FileChooserDialog& dialog);
152 /** Retrieves the title of the browse dialog used by @a button . The returned value
153 * should not be modified or freed.
154 * @return A pointer to the browse dialog's title.
158 Glib::ustring get_title() const;
160 /** Modifies the @a title of the browse dialog used by @a button .
163 * @param title The new browse dialog title.
165 void set_title(const Glib::ustring& title);
168 /** Retrieves the width in characters of the @a button widget's entry and/or label.
169 * @return An integer width (in characters) that the button will use to size itself.
173 int get_width_chars() const;
175 /** Sets the width (in characters) that @a button will use to @a n_chars .
178 * @param n_chars The new width, in characters.
180 void set_width_chars(int n_chars);
183 /** Return value: <tt>true</tt> if the button grabs focus when it is clicked with
184 * @return <tt>true</tt> if the button grabs focus when it is clicked with
189 bool get_focus_on_click() const;
191 /** Sets whether the button will grab focus when it is clicked with the mouse.
192 * Making mouse clicks not grab focus is useful in places like toolbars where
193 * you don't want the keyboard focus removed from the main area of the
197 * @param focus_on_click Whether the button grabs focus when clicked with the mouse.
199 void set_focus_on_click(gboolean focus_on_click = true);
201 //I'm no totally convinced that this is only a key-binding signal. murrayc:
204 #ifdef GLIBMM_PROPERTIES_ENABLED
205 /** The file chooser dialog to use.
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_ReadOnly<FileChooserDialog*> property_dialog() const;
212 #endif //#GLIBMM_PROPERTIES_ENABLED
215 #ifdef GLIBMM_PROPERTIES_ENABLED
216 /** Whether the button grabs focus when it is clicked with the mouse.
218 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
219 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
220 * the value of the property changes.
222 Glib::PropertyProxy<bool> property_focus_on_click() ;
223 #endif //#GLIBMM_PROPERTIES_ENABLED
225 #ifdef GLIBMM_PROPERTIES_ENABLED
226 /** Whether the button grabs focus when it is clicked with the mouse.
228 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
229 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
230 * the value of the property changes.
232 Glib::PropertyProxy_ReadOnly<bool> property_focus_on_click() const;
233 #endif //#GLIBMM_PROPERTIES_ENABLED
235 #ifdef GLIBMM_PROPERTIES_ENABLED
236 /** The title of the file chooser dialog.
238 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
239 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
240 * the value of the property changes.
242 Glib::PropertyProxy<Glib::ustring> property_title() ;
243 #endif //#GLIBMM_PROPERTIES_ENABLED
245 #ifdef GLIBMM_PROPERTIES_ENABLED
246 /** The title of the file chooser dialog.
248 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
249 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
250 * the value of the property changes.
252 Glib::PropertyProxy_ReadOnly<Glib::ustring> property_title() const;
253 #endif //#GLIBMM_PROPERTIES_ENABLED
255 #ifdef GLIBMM_PROPERTIES_ENABLED
256 /** The desired width of the button widget
258 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
259 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
260 * the value of the property changes.
262 Glib::PropertyProxy<int> property_width_chars() ;
263 #endif //#GLIBMM_PROPERTIES_ENABLED
265 #ifdef GLIBMM_PROPERTIES_ENABLED
266 /** The desired width of the button widget
268 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
269 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
270 * the value of the property changes.
272 Glib::PropertyProxy_ReadOnly<int> property_width_chars() const;
273 #endif //#GLIBMM_PROPERTIES_ENABLED
284 /** A Glib::wrap() method for this object.
286 * @param object The C instance.
287 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
288 * @result A C++ instance that wraps this C instance.
290 * @relates Gtk::FileChooserButton
292 Gtk::FileChooserButton* wrap(GtkFileChooserButton* object, bool take_copy = false);
296 #endif /* _GTKMM_FILECHOOSERBUTTON_H */