1 // -*- c++ -*- 2 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY! 3 #ifndef _GTKMM_FILECHOOSERBUTTON_H 4 #define _GTKMM_FILECHOOSERBUTTON_H 5 6 7 #include <glibmm/ustring.h> 8 #include <sigc++/sigc++.h> 9 10 /* $Id: filechooserbutton.hg,v 1.7 2005/12/12 08:14:21 murrayc Exp $ */ 11 12 /* filechooserbutton.h 13 * 14 * Copyright (C) 2003 The gtkmm Development Team 15 * 16 * This library is free software; you can redistribute it and/or 17 * modify it under the terms of the GNU Lesser General Public 18 * License as published by the Free Software Foundation; either 19 * version 2.1 of the License, or (at your option) any later version. 20 * 21 * This library is distributed in the hope that it will be useful, 22 * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 24 * Lesser General Public License for more details. 25 * 26 * You should have received a copy of the GNU Lesser General Public 27 * License along with this library; if not, write to the Free 28 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 29 */ 30 31 #include <gtkmm/box.h> 32 #include <gtkmm/filechooserdialog.h> 33 34 35 #ifndef DOXYGEN_SHOULD_SKIP_THIS 36 typedef struct _GtkFileChooserButton GtkFileChooserButton; 37 typedef struct _GtkFileChooserButtonClass GtkFileChooserButtonClass; 38 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 39 40 41 namespace Gtk 42 { class FileChooserButton_Class; } // namespace Gtk 43 namespace Gtk 44 { 45 46 /** A button to launch a file chooser dialog. 47 * 48 * This widget lets the user select a file. It implements the FileChooser interface. Visually, it is a file name with a 49 * button to bring up a FileChooserDialog. The user can then use that dialog to change the file associated with that 50 * button. This widget does not support setting the "select_multiple" property to true. 51 * 52 * The FileChooserButton supports the FileChooserActions FILE_CHOOSER_ACTION_OPEN and FILE_CHOOSER_ACTION_SELECT_FOLDER. 53 * 54 * The FileChooserButton will ellipsize the label, and will thus request little horizontal space. To give the button more 55 * space, you should call size_request(), set_width_chars(), or pack the button in such a way that other interface 56 * elements give space to the widget. 57 * 58 * The FileChooserButton widget looks like this: 59 * @image html filechooserbutton1.png 60 * 61 * @ingroup Widgets 62 */ 63 64 class FileChooserButton 65 : public HBox, 66 public FileChooser 67 { 68 public: 69 #ifndef DOXYGEN_SHOULD_SKIP_THIS 70 typedef FileChooserButton CppObjectType; 71 typedef FileChooserButton_Class CppClassType; 72 typedef GtkFileChooserButton BaseObjectType; 73 typedef GtkFileChooserButtonClass BaseClassType; 74 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 75 76 virtual ~FileChooserButton(); 77 78 #ifndef DOXYGEN_SHOULD_SKIP_THIS 79 80 private: 81 friend class FileChooserButton_Class; 82 static CppClassType filechooserbutton_class_; 83 84 // noncopyable 85 FileChooserButton(const FileChooserButton&); 86 FileChooserButton& operator=(const FileChooserButton&); 87 88 protected: 89 explicit FileChooserButton(const Glib::ConstructParams& construct_params); 90 explicit FileChooserButton(GtkFileChooserButton* castitem); 91 92 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 93 94 public: 95 #ifndef DOXYGEN_SHOULD_SKIP_THIS 96 static GType get_type() G_GNUC_CONST; 97 98 99 static GType get_base_type() G_GNUC_CONST; 100 #endif 101 102 ///Provides access to the underlying C GtkObject. gobj()103 GtkFileChooserButton* gobj() { return reinterpret_cast<GtkFileChooserButton*>(gobject_); } 104 105 ///Provides access to the underlying C GtkObject. gobj()106 const GtkFileChooserButton* gobj() const { return reinterpret_cast<GtkFileChooserButton*>(gobject_); } 107 108 109 public: 110 //C++ methods used to invoke GTK+ virtual functions: 111 112 protected: 113 //GTK+ Virtual Functions (override these to change behaviour): 114 115 //Default Signal Handlers:: 116 117 118 private: 119 120 121 public: 122 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. 127 */ 128 explicit FileChooserButton(FileChooserAction action = FILE_CHOOSER_ACTION_OPEN); 129 130 /** Creates a new file-selecting button widget. 131 * 132 * @param title The title of the browse dialog. 133 * @param action The open mode for the widget. 134 */ 135 explicit FileChooserButton(const Glib::ustring& title, FileChooserAction action = FILE_CHOOSER_ACTION_OPEN); 136 137 138 /** Creates a new file-selecting button widget using backend. 139 * 140 * @param title The title of the browse dialog. 141 * @param action The open mode for the widget. 142 * @param backend The name of the Gtk::FileSystem backend to use. 143 */ 144 explicit FileChooserButton(const Glib::ustring& title, FileChooserAction action, const Glib::ustring& backend); 145 146 147 /** Creates a new file-selecting button widget which uses dialog as its file-picking window. 148 * 149 * @param dialog The dialog to use. 150 */ 151 explicit FileChooserButton(FileChooserDialog& dialog); 152 153 154 /** Retrieves the title of the browse dialog used by @a button. The returned value 155 * should not be modified or freed. 156 * 157 * @newin{2,6} 158 * 159 * @return A pointer to the browse dialog's title. 160 */ 161 Glib::ustring get_title() const; 162 163 /** Modifies the @a title of the browse dialog used by @a button. 164 * 165 * @newin{2,6} 166 * 167 * @param title The new browse dialog title. 168 */ 169 void set_title(const Glib::ustring& title); 170 171 172 /** Retrieves the width in characters of the @a button widget's entry and/or label. 173 * 174 * @newin{2,6} 175 * 176 * @return An integer width (in characters) that the button will use to size itself. 177 */ 178 int get_width_chars() const; 179 180 /** Sets the width (in characters) that @a button will use to @a n_chars. 181 * 182 * @newin{2,6} 183 * 184 * @param n_chars The new width, in characters. 185 */ 186 void set_width_chars(int n_chars); 187 188 189 /** Returns whether the button grabs focus when it is clicked with the mouse. 190 * See set_focus_on_click(). 191 * 192 * @newin{2,10} 193 * 194 * @return <tt>true</tt> if the button grabs focus when it is clicked with 195 * the mouse. 196 */ 197 bool get_focus_on_click() const; 198 199 /** Sets whether the button will grab focus when it is clicked with the mouse. 200 * Making mouse clicks not grab focus is useful in places like toolbars where 201 * you don't want the keyboard focus removed from the main area of the 202 * application. 203 * 204 * @newin{2,10} 205 * 206 * @param focus_on_click Whether the button grabs focus when clicked with the mouse. 207 */ 208 void set_focus_on_click(gboolean focus_on_click = true); 209 210 //TODO: Remove no_default_handler when we can break ABI. 211 //This is a G_SIGNAL_ACTION signal, but it seems to be public API for applications. 212 //See http://bugzilla.gnome.org/show_bug.cgi?id=353196 213 214 /** 215 * @par Slot Prototype: 216 * <tt>void on_my_%file_set()</tt> 217 * 218 */ 219 220 Glib::SignalProxy0< void > signal_file_set(); 221 222 223 //gtkmmproc error: dialog : attempt to wrap write-only and construct-only property. 224 /** Whether the button grabs focus when it is clicked with the mouse. 225 * 226 * @return A PropertyProxy that allows you to get or set the value of the property, 227 * or receive notification when the value of the property changes. 228 */ 229 Glib::PropertyProxy< bool > property_focus_on_click() ; 230 231 /** Whether the button grabs focus when it is clicked with the mouse. 232 * 233 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 234 * or receive notification when the value of the property changes. 235 */ 236 Glib::PropertyProxy_ReadOnly< bool > property_focus_on_click() const; 237 238 /** The title of the file chooser dialog. 239 * 240 * @return A PropertyProxy that allows you to get or set the value of the property, 241 * or receive notification when the value of the property changes. 242 */ 243 Glib::PropertyProxy< Glib::ustring > property_title() ; 244 245 /** The title of the file chooser dialog. 246 * 247 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 248 * or receive notification when the value of the property changes. 249 */ 250 Glib::PropertyProxy_ReadOnly< Glib::ustring > property_title() const; 251 252 /** The desired width of the button widget, in characters. 253 * 254 * @return A PropertyProxy that allows you to get or set the value of the property, 255 * or receive notification when the value of the property changes. 256 */ 257 Glib::PropertyProxy< int > property_width_chars() ; 258 259 /** The desired width of the button widget, in characters. 260 * 261 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 262 * or receive notification when the value of the property changes. 263 */ 264 Glib::PropertyProxy_ReadOnly< int > property_width_chars() const; 265 266 267 }; 268 269 270 } // namespace Gtk 271 272 273 namespace Glib 274 { 275 /** A Glib::wrap() method for this object. 276 * 277 * @param object The C instance. 278 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. 279 * @result A C++ instance that wraps this C instance. 280 * 281 * @relates Gtk::FileChooserButton 282 */ 283 Gtk::FileChooserButton* wrap(GtkFileChooserButton* object, bool take_copy = false); 284 } //namespace Glib 285 286 287 #endif /* _GTKMM_FILECHOOSERBUTTON_H */ 288 289