2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_FILECHOOSERBUTTON_H
4 #define _GTKMM_FILECHOOSERBUTTON_H
10 /* filechooserbutton.h
12 * Copyright (C) 2003 The gtkmm Development Team
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Library General Public
16 * License as published by the Free Software Foundation; either
17 * version 2 of the License, or (at your option) any later version.
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Library General Public License for more details.
24 * You should have received a copy of the GNU Library General Public
25 * License along with this library; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 #include <gtkmm/box.h>
30 #include <gtkmm/filechooserdialog.h>
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 typedef struct _GtkFileChooserButton GtkFileChooserButton;
35 typedef struct _GtkFileChooserButtonClass GtkFileChooserButtonClass;
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
40 { class FileChooserButton_Class; } // namespace Gtk
44 /** A button to launch a file chooser dialog.
46 * This widget lets the user select a file. It implements the FileChooser interface. Visually, it is a file name with a
47 * button to bring up a FileChooserDialog. The user can then use that dialog to change the file associated with that
48 * button. This widget does not support setting the "select_multiple" property to true.
50 * The FileChooserButton supports the FileChooserActions FILE_CHOOSER_ACTION_OPEN and FILE_CHOOSER_ACTION_SELECT_FOLDER.
52 * The FileChooserButton will ellipsize the label, and will thus request little horizontal space. To give the button more
53 * space, you should call size_request(), set_width_chars(), or pack the button in such a way that other interface
54 * elements give space to the widget.
59 class FileChooserButton
64 #ifndef DOXYGEN_SHOULD_SKIP_THIS
65 typedef FileChooserButton CppObjectType;
66 typedef FileChooserButton_Class CppClassType;
67 typedef GtkFileChooserButton BaseObjectType;
68 typedef GtkFileChooserButtonClass BaseClassType;
69 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
71 virtual ~FileChooserButton();
73 #ifndef DOXYGEN_SHOULD_SKIP_THIS
76 friend class FileChooserButton_Class;
77 static CppClassType filechooserbutton_class_;
80 FileChooserButton(const FileChooserButton&);
81 FileChooserButton& operator=(const FileChooserButton&);
84 explicit FileChooserButton(const Glib::ConstructParams& construct_params);
85 explicit FileChooserButton(GtkFileChooserButton* castitem);
87 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
90 #ifndef DOXYGEN_SHOULD_SKIP_THIS
91 static GType get_type() G_GNUC_CONST;
92 static GType get_base_type() G_GNUC_CONST;
95 ///Provides access to the underlying C GtkObject.
96 GtkFileChooserButton* gobj() { return reinterpret_cast<GtkFileChooserButton*>(gobject_); }
98 ///Provides access to the underlying C GtkObject.
99 const GtkFileChooserButton* gobj() const { return reinterpret_cast<GtkFileChooserButton*>(gobject_); }
103 //C++ methods used to invoke GTK+ virtual functions:
106 //GTK+ Virtual Functions (override these to change behaviour):
108 //Default Signal Handlers::
116 /** Creates a new file-selecting button widget with the default title.
117 * @param title The title of the browse dialog.
118 * @param action The open mode for the widget.
119 * @param backend The name of the Gtk::FileSystem backend to use.
121 explicit FileChooserButton(FileChooserAction action = FILE_CHOOSER_ACTION_OPEN);
123 /** Creates a new file-selecting button widget.
125 * @param title The title of the browse dialog.
126 * @param action The open mode for the widget.
128 explicit FileChooserButton(const Glib::ustring& title, FileChooserAction action = FILE_CHOOSER_ACTION_OPEN);
130 /** Creates a new file-selecting button widget using backend.
132 * @param title The title of the browse dialog.
133 * @param action The open mode for the widget.
134 * @param backend The name of the Gtk::FileSystem backend to use.
136 explicit FileChooserButton(const Glib::ustring& title, FileChooserAction action, const Glib::ustring& backend);
138 /** Creates a new file-selecting button widget which uses dialog as its file-picking window.
140 * @param dialog The dialog to use.
142 explicit FileChooserButton(FileChooserDialog& dialog);
145 /** Retrieves the title of the browse dialog used by @a button . The returned value
146 * should not be modified or freed.
147 * @return A pointer to the browse dialog's title.
151 Glib::ustring get_title() const;
153 /** Modifies the @a title of the browse dialog used by @a button .
156 * @param title The new browse dialog title.
158 void set_title(const Glib::ustring& title);
161 /** Retrieves the width in characters of the @a button widget's entry and/or label.
162 * @return An integer width (in characters) that the button will use to size itself.
166 int get_width_chars() const;
168 /** Sets the width (in characters) that @a button will use to @a n_chars .
171 * @param n_chars The new width, in chracters.
173 void set_width_chars(int n_chars);
176 /** The file chooser dialog to use.
178 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
179 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
180 * the value of the property changes.
182 Glib::PropertyProxy_ReadOnly<FileChooserDialog*> property_dialog() const;
185 /** The title of the file chooser dialog.
187 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
188 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
189 * the value of the property changes.
191 Glib::PropertyProxy<Glib::ustring> property_title() ;
193 /** The title of the file chooser dialog.
195 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
196 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
197 * the value of the property changes.
199 Glib::PropertyProxy_ReadOnly<Glib::ustring> property_title() const;
201 /** The desired width of the button widget
203 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
204 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
205 * the value of the property changes.
207 Glib::PropertyProxy<int> property_width_chars() ;
209 /** The desired width of the button widget
211 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
212 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
213 * the value of the property changes.
215 Glib::PropertyProxy_ReadOnly<int> property_width_chars() const;
226 /** @relates Gtk::FileChooserButton
227 * @param object The C instance
228 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
229 * @result A C++ instance that wraps this C instance.
231 Gtk::FileChooserButton* wrap(GtkFileChooserButton* object, bool take_copy = false);
233 #endif /* _GTKMM_FILECHOOSERBUTTON_H */