Install ardour as a binary, a script and a set of shared
[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 #include <glibmm.h>
7
8 /* $Id$ */
9
10 /* filechooserbutton.h
11  * 
12  * Copyright (C) 2003 The gtkmm Development Team
13  *
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.
18  *
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.
23  *
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.
27  */
28
29 #include <gtkmm/box.h>
30 #include <gtkmm/filechooserdialog.h>
31
32
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 typedef struct _GtkFileChooserButton GtkFileChooserButton;
35 typedef struct _GtkFileChooserButtonClass GtkFileChooserButtonClass;
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
37
38
39 namespace Gtk
40 { class FileChooserButton_Class; } // namespace Gtk
41 namespace Gtk
42 {
43
44 /** A button to launch a file chooser dialog.
45  * 
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.
49  *
50  * The FileChooserButton supports the FileChooserActions FILE_CHOOSER_ACTION_OPEN and FILE_CHOOSER_ACTION_SELECT_FOLDER.
51  *
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.
55  *
56  * @ingroup Widgets
57  */
58
59 class FileChooserButton
60   : public HBox,
61     public FileChooser
62 {
63   public:
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 */
70
71   virtual ~FileChooserButton();
72
73 #ifndef DOXYGEN_SHOULD_SKIP_THIS
74
75 private:
76   friend class FileChooserButton_Class;
77   static CppClassType filechooserbutton_class_;
78
79   // noncopyable
80   FileChooserButton(const FileChooserButton&);
81   FileChooserButton& operator=(const FileChooserButton&);
82
83 protected:
84   explicit FileChooserButton(const Glib::ConstructParams& construct_params);
85   explicit FileChooserButton(GtkFileChooserButton* castitem);
86
87 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
88
89 public:
90 #ifndef DOXYGEN_SHOULD_SKIP_THIS
91   static GType get_type()      G_GNUC_CONST;
92   static GType get_base_type() G_GNUC_CONST;
93 #endif
94
95   ///Provides access to the underlying C GtkObject.
96   GtkFileChooserButton*       gobj()       { return reinterpret_cast<GtkFileChooserButton*>(gobject_); }
97
98   ///Provides access to the underlying C GtkObject.
99   const GtkFileChooserButton* gobj() const { return reinterpret_cast<GtkFileChooserButton*>(gobject_); }
100
101
102 public:
103   //C++ methods used to invoke GTK+ virtual functions:
104
105 protected:
106   //GTK+ Virtual Functions (override these to change behaviour):
107
108   //Default Signal Handlers::
109
110
111 private:
112
113   
114 public:
115
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.
120    */
121   explicit FileChooserButton(FileChooserAction action = FILE_CHOOSER_ACTION_OPEN);
122   
123   /** Creates a new file-selecting button widget.
124    *
125    * @param title The title of the browse dialog.
126    * @param action The open mode for the widget.
127    */
128   explicit FileChooserButton(const Glib::ustring& title, FileChooserAction action = FILE_CHOOSER_ACTION_OPEN);
129   
130   /** Creates a new file-selecting button widget using backend.
131    *
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.
135    */ 
136   explicit FileChooserButton(const Glib::ustring& title, FileChooserAction action, const Glib::ustring& backend);
137   
138   /** Creates a new file-selecting button widget which uses dialog as its file-picking window.
139    *
140    * @param dialog The dialog to use.
141    */
142   explicit FileChooserButton(FileChooserDialog& dialog);
143   
144   
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.
148    * 
149    * Since: 2.6.
150    */
151   Glib::ustring get_title() const;
152   
153   /** Modifies the @a title  of the browse dialog used by @a button .
154    * 
155    * Since: 2.6
156    * @param title The new browse dialog title.
157    */
158   void set_title(const Glib::ustring& title);
159  
160   
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.
163    * 
164    * Since: 2.6.
165    */
166   int get_width_chars() const;
167   
168   /** Sets the width (in characters) that @a button  will use to @a n_chars .
169    * 
170    * Since: 2.6
171    * @param n_chars The new width, in chracters.
172    */
173   void set_width_chars(int n_chars);
174
175
176   /** The file chooser dialog to use.
177    *
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.
181    */
182   Glib::PropertyProxy_ReadOnly<FileChooserDialog*> property_dialog() const;
183
184
185   /** The title of the file chooser dialog.
186    *
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.
190    */
191   Glib::PropertyProxy<Glib::ustring> property_title() ;
192
193 /** The title of the file chooser dialog.
194    *
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.
198    */
199   Glib::PropertyProxy_ReadOnly<Glib::ustring> property_title() const;
200                                           
201   /** The desired width of the button widget
202    *
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.
206    */
207   Glib::PropertyProxy<int> property_width_chars() ;
208
209 /** The desired width of the button widget
210    *
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.
214    */
215   Glib::PropertyProxy_ReadOnly<int> property_width_chars() const;
216     
217
218 };
219
220
221 } // namespace Gtk
222
223
224 namespace Glib
225 {
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.
230    */
231   Gtk::FileChooserButton* wrap(GtkFileChooserButton* object, bool take_copy = false);
232 }
233 #endif /* _GTKMM_FILECHOOSERBUTTON_H */
234