add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / filechooserbutton.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_FILECHOOSERBUTTON_H
4 #define _GTKMM_FILECHOOSERBUTTON_H
5
6
7 #include <glibmm.h>
8
9 /* $Id$ */
10
11 /* filechooserbutton.h
12  * 
13  * Copyright (C) 2003 The gtkmm Development Team
14  *
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.
19  *
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.
24  *
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.
28  */
29
30 #include <gtkmm/box.h>
31 #include <gtkmm/filechooserdialog.h>
32
33
34 #ifndef DOXYGEN_SHOULD_SKIP_THIS
35 typedef struct _GtkFileChooserButton GtkFileChooserButton;
36 typedef struct _GtkFileChooserButtonClass GtkFileChooserButtonClass;
37 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
38
39
40 namespace Gtk
41 { class FileChooserButton_Class; } // namespace Gtk
42 namespace Gtk
43 {
44
45 /** A button to launch a file chooser dialog.
46  * 
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.
50  *
51  * The FileChooserButton supports the FileChooserActions FILE_CHOOSER_ACTION_OPEN and FILE_CHOOSER_ACTION_SELECT_FOLDER.
52  *
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.
56  *
57  * @ingroup Widgets
58  */
59
60 class FileChooserButton
61   : public HBox,
62     public FileChooser
63 {
64   public:
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 */
71
72   virtual ~FileChooserButton();
73
74 #ifndef DOXYGEN_SHOULD_SKIP_THIS
75
76 private:
77   friend class FileChooserButton_Class;
78   static CppClassType filechooserbutton_class_;
79
80   // noncopyable
81   FileChooserButton(const FileChooserButton&);
82   FileChooserButton& operator=(const FileChooserButton&);
83
84 protected:
85   explicit FileChooserButton(const Glib::ConstructParams& construct_params);
86   explicit FileChooserButton(GtkFileChooserButton* castitem);
87
88 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
89
90 public:
91 #ifndef DOXYGEN_SHOULD_SKIP_THIS
92   static GType get_type()      G_GNUC_CONST;
93   static GType get_base_type() G_GNUC_CONST;
94 #endif
95
96   ///Provides access to the underlying C GtkObject.
97   GtkFileChooserButton*       gobj()       { return reinterpret_cast<GtkFileChooserButton*>(gobject_); }
98
99   ///Provides access to the underlying C GtkObject.
100   const GtkFileChooserButton* gobj() const { return reinterpret_cast<GtkFileChooserButton*>(gobject_); }
101
102
103 public:
104   //C++ methods used to invoke GTK+ virtual functions:
105 #ifdef GLIBMM_VFUNCS_ENABLED
106 #endif //GLIBMM_VFUNCS_ENABLED
107
108 protected:
109   //GTK+ Virtual Functions (override these to change behaviour):
110 #ifdef GLIBMM_VFUNCS_ENABLED
111 #endif //GLIBMM_VFUNCS_ENABLED
112
113   //Default Signal Handlers::
114 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
115 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
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   /** Creates a new file-selecting button widget using backend.
138    *
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.
142    */ 
143   explicit FileChooserButton(const Glib::ustring& title, FileChooserAction action, const Glib::ustring& backend);
144   
145   /** Creates a new file-selecting button widget which uses dialog as its file-picking window.
146    *
147    * @param dialog The dialog to use.
148    */
149   explicit FileChooserButton(FileChooserDialog& dialog);
150   
151   
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.
155    * 
156    * @newin2p6.
157    */
158   Glib::ustring get_title() const;
159   
160   /** Modifies the @a title  of the browse dialog used by @a button .
161    * 
162    * @newin2p6
163    * @param title The new browse dialog title.
164    */
165   void set_title(const Glib::ustring& title);
166  
167   
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.
170    * 
171    * @newin2p6.
172    */
173   int get_width_chars() const;
174   
175   /** Sets the width (in characters) that @a button  will use to @a n_chars .
176    * 
177    * @newin2p6
178    * @param n_chars The new width, in characters.
179    */
180   void set_width_chars(int n_chars);
181
182   
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
185    * the mouse.
186    * 
187    * @newin2p10.
188    */
189   bool get_focus_on_click() const;
190   
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
194    * application.
195    * 
196    * @newin2p10
197    * @param focus_on_click Whether the button grabs focus when clicked with the mouse.
198    */
199   void set_focus_on_click(gboolean focus_on_click = true);   
200
201   //I'm no totally convinced that this is only a key-binding signal. murrayc:
202   
203
204   #ifdef GLIBMM_PROPERTIES_ENABLED
205 /** The file chooser dialog to use.
206    *
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.
210    */
211   Glib::PropertyProxy_ReadOnly<FileChooserDialog*> property_dialog() const;
212 #endif //#GLIBMM_PROPERTIES_ENABLED
213
214
215   #ifdef GLIBMM_PROPERTIES_ENABLED
216 /** Whether the button grabs focus when it is clicked with the mouse.
217    *
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.
221    */
222   Glib::PropertyProxy<bool> property_focus_on_click() ;
223 #endif //#GLIBMM_PROPERTIES_ENABLED
224
225 #ifdef GLIBMM_PROPERTIES_ENABLED
226 /** Whether the button grabs focus when it is clicked with the mouse.
227    *
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.
231    */
232   Glib::PropertyProxy_ReadOnly<bool> property_focus_on_click() const;
233 #endif //#GLIBMM_PROPERTIES_ENABLED
234
235   #ifdef GLIBMM_PROPERTIES_ENABLED
236 /** The title of the file chooser dialog.
237    *
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.
241    */
242   Glib::PropertyProxy<Glib::ustring> property_title() ;
243 #endif //#GLIBMM_PROPERTIES_ENABLED
244
245 #ifdef GLIBMM_PROPERTIES_ENABLED
246 /** The title of the file chooser dialog.
247    *
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.
251    */
252   Glib::PropertyProxy_ReadOnly<Glib::ustring> property_title() const;
253 #endif //#GLIBMM_PROPERTIES_ENABLED
254                                           
255   #ifdef GLIBMM_PROPERTIES_ENABLED
256 /** The desired width of the button widget
257    *
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.
261    */
262   Glib::PropertyProxy<int> property_width_chars() ;
263 #endif //#GLIBMM_PROPERTIES_ENABLED
264
265 #ifdef GLIBMM_PROPERTIES_ENABLED
266 /** The desired width of the button widget
267    *
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.
271    */
272   Glib::PropertyProxy_ReadOnly<int> property_width_chars() const;
273 #endif //#GLIBMM_PROPERTIES_ENABLED
274     
275
276 };
277
278
279 } // namespace Gtk
280
281
282 namespace Glib
283 {
284   /** A Glib::wrap() method for this object.
285    * 
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.
289    *
290    * @relates Gtk::FileChooserButton
291    */
292   Gtk::FileChooserButton* wrap(GtkFileChooserButton* object, bool take_copy = false);
293 } //namespace Glib
294
295
296 #endif /* _GTKMM_FILECHOOSERBUTTON_H */
297