Remove ancient/unused flowcanvas and libglademm from repository.
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / fileselection.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_FILESELECTION_H
4 #define _GTKMM_FILESELECTION_H
5
6 #include <gtkmmconfig.h>
7
8 #ifndef GTKMM_DISABLE_DEPRECATED
9
10
11 #include <glibmm.h>
12
13 /* $Id$ */
14
15
16 /* fileselection.h
17  * 
18  * Copyright (C) 1998-2002 The gtkmm Development Team
19  *
20  * This library is free software; you can redistribute it and/or
21  * modify it under the terms of the GNU Library General Public
22  * License as published by the Free Software Foundation; either
23  * version 2 of the License, or (at your option) any later version.
24  *
25  * This library is distributed in the hope that it will be useful,
26  * but WITHOUT ANY WARRANTY; without even the implied warranty of
27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
28  * Library General Public License for more details.
29  *
30  * You should have received a copy of the GNU Library General Public
31  * License along with this library; if not, write to the Free
32  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
33  */
34
35 // This is for including the config header before any code (such as
36 // the #ifndef GTKMM_DISABLE_DEPRECATED in deprecated classes) is generated:
37
38
39 #include <gtkmm/dialog.h>
40 #include <gtkmm/button.h>
41 #include <gtkmm/entry.h>
42 #include <gtkmm/label.h>
43 #include <gtkmm/box.h>
44 #include <gtkmm/treeview.h>
45 #include <gtkmm/buttonbox.h>
46 #include <gtkmm/optionmenu.h>
47
48
49 #ifndef DOXYGEN_SHOULD_SKIP_THIS
50 typedef struct _GtkFileSelection GtkFileSelection;
51 typedef struct _GtkFileSelectionClass GtkFileSelectionClass;
52 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
53
54
55 namespace Gtk
56 { class FileSelection_Class; } // namespace Gtk
57 namespace Gtk
58 {
59
60 /** Prompt the user for a file or directory name.
61  *
62  * Gtk::FileSelection should be used to retrieve file or directory names from
63  * the user. It will create a new dialog window containing a directory list,
64  * and a file list corresponding to the current working directory. The
65  * filesystem can be navigated using the directory list or the drop-down
66  * history menu. Alternatively, the TAB key can be used to navigate using
67  * filename completion - common in text based editors such as emacs and jed.
68  *
69  * @deprecated Use the FileChooserDialog instead.
70  */
71
72 class FileSelection : public Dialog
73 {
74   public:
75 #ifndef DOXYGEN_SHOULD_SKIP_THIS
76   typedef FileSelection CppObjectType;
77   typedef FileSelection_Class CppClassType;
78   typedef GtkFileSelection BaseObjectType;
79   typedef GtkFileSelectionClass BaseClassType;
80 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
81
82   virtual ~FileSelection();
83
84 #ifndef DOXYGEN_SHOULD_SKIP_THIS
85
86 private:
87   friend class FileSelection_Class;
88   static CppClassType fileselection_class_;
89
90   // noncopyable
91   FileSelection(const FileSelection&);
92   FileSelection& operator=(const FileSelection&);
93
94 protected:
95   explicit FileSelection(const Glib::ConstructParams& construct_params);
96   explicit FileSelection(GtkFileSelection* castitem);
97
98 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
99
100 public:
101 #ifndef DOXYGEN_SHOULD_SKIP_THIS
102   static GType get_type()      G_GNUC_CONST;
103   static GType get_base_type() G_GNUC_CONST;
104 #endif
105
106   ///Provides access to the underlying C GtkObject.
107   GtkFileSelection*       gobj()       { return reinterpret_cast<GtkFileSelection*>(gobject_); }
108
109   ///Provides access to the underlying C GtkObject.
110   const GtkFileSelection* gobj() const { return reinterpret_cast<GtkFileSelection*>(gobject_); }
111
112
113 public:
114   //C++ methods used to invoke GTK+ virtual functions:
115 #ifdef GLIBMM_VFUNCS_ENABLED
116 #endif //GLIBMM_VFUNCS_ENABLED
117
118 protected:
119   //GTK+ Virtual Functions (override these to change behaviour):
120 #ifdef GLIBMM_VFUNCS_ENABLED
121 #endif //GLIBMM_VFUNCS_ENABLED
122
123   //Default Signal Handlers::
124 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
125 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
126
127
128 private:
129
130   
131 public:
132
133   FileSelection();
134   explicit FileSelection(const Glib::ustring& title);
135
136   
137   /** Sets a default path for the file requestor. If @a filename  includes a
138    * directory path, then the requestor will open with that path as its
139    * current working directory.
140    * 
141    * This has the consequence that in order to open the requestor with a 
142    * working directory and an empty filename, @a filename  must have a trailing
143    * directory separator.
144    * 
145    * The encoding of @a filename  is preferred GLib file name encoding, which
146    * may not be UTF-8. See Glib::filename_from_utf8().
147    * @param filename A string to set as the default file name.
148    */
149   void set_filename(const std::string& filename);
150
151   
152   /** This function returns the selected filename in the GLib file name
153    * encoding. To convert to UTF-8, call Glib::filename_to_utf8(). The
154    * returned string points to a statically allocated buffer and should
155    * be copied if you plan to keep it around.
156    * 
157    * If no file is selected then the selected directory path is returned.
158    * @return Currently-selected filename in the on-disk encoding.
159    */
160   std::string get_filename() const;
161
162   
163   void complete(const Glib::ustring& pattern);
164   
165   void show_fileop_buttons();
166   
167   void hide_fileop_buttons();
168
169   
170   /** Retrieves the list of file selections the user has made in the dialog box.
171    * This function is intended for use when the user can select multiple files
172    * in the file list. 
173    * 
174    * The filenames are in the GLib file name encoding. To convert to
175    * UTF-8, call Glib::filename_to_utf8() on each string.
176    * @return A newly-allocated <tt>0</tt>-terminated array of strings. Use
177    * Glib::strfreev() to free it.
178    */
179   Glib::ArrayHandle<std::string> get_selections() const;
180
181   
182   /** Sets whether the user is allowed to select multiple files in the file list.
183    * Use get_selections() to get the list of selected files.
184    * @param select_multiple Whether or not the user is allowed to select multiple
185    * files in the file list.
186    */
187   void set_select_multiple(bool select_multiple = true);
188   
189   /** Determines whether or not the user is allowed to select multiple files in
190    * the file list. See set_select_multiple().
191    * @return <tt>true</tt> if the user is allowed to select multiple files in the
192    * file list.
193    */
194   bool get_select_multiple() const;
195
196   //: Accessors
197    TreeView* get_dir_list();
198   const TreeView* get_dir_list() const;
199     TreeView* get_file_list();
200   const TreeView* get_file_list() const;
201     OptionMenu* get_history_pulldown();
202   const OptionMenu* get_history_pulldown() const;
203     Entry* get_selection_entry();
204   const Entry* get_selection_entry() const;
205     Label* get_selection_text();
206   const Label* get_selection_text() const;
207     VBox* get_main_vbox();
208   const VBox* get_main_vbox() const;
209     Button* get_ok_button();
210   const Button* get_ok_button() const;
211     Button* get_cancel_button();
212   const Button* get_cancel_button() const;
213     Button* get_help_button();
214   const Button* get_help_button() const;
215     HButtonBox* get_button_area();
216   const HButtonBox* get_button_area() const;
217     HBox* get_action_area();
218   const HBox* get_action_area() const;
219  
220   #ifdef GLIBMM_PROPERTIES_ENABLED
221 /** Whether buttons for creating/manipulating files should be displayed.
222    *
223    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
224    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
225    * the value of the property changes.
226    */
227   Glib::PropertyProxy<bool> property_show_fileops() ;
228 #endif //#GLIBMM_PROPERTIES_ENABLED
229
230 #ifdef GLIBMM_PROPERTIES_ENABLED
231 /** Whether buttons for creating/manipulating files should be displayed.
232    *
233    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
234    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
235    * the value of the property changes.
236    */
237   Glib::PropertyProxy_ReadOnly<bool> property_show_fileops() const;
238 #endif //#GLIBMM_PROPERTIES_ENABLED
239
240   #ifdef GLIBMM_PROPERTIES_ENABLED
241 /** The currently selected filename.
242    *
243    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
244    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
245    * the value of the property changes.
246    */
247   Glib::PropertyProxy<std::string> property_filename() ;
248 #endif //#GLIBMM_PROPERTIES_ENABLED
249
250 #ifdef GLIBMM_PROPERTIES_ENABLED
251 /** The currently selected filename.
252    *
253    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
254    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
255    * the value of the property changes.
256    */
257   Glib::PropertyProxy_ReadOnly<std::string> property_filename() const;
258 #endif //#GLIBMM_PROPERTIES_ENABLED
259
260   #ifdef GLIBMM_PROPERTIES_ENABLED
261 /** Whether to allow multiple files to be selected.
262    *
263    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
264    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
265    * the value of the property changes.
266    */
267   Glib::PropertyProxy<bool> property_select_multiple() ;
268 #endif //#GLIBMM_PROPERTIES_ENABLED
269
270 #ifdef GLIBMM_PROPERTIES_ENABLED
271 /** Whether to allow multiple files to be selected.
272    *
273    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
274    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
275    * the value of the property changes.
276    */
277   Glib::PropertyProxy_ReadOnly<bool> property_select_multiple() const;
278 #endif //#GLIBMM_PROPERTIES_ENABLED
279
280
281 };
282
283 } // namespace Gtk
284
285
286 namespace Glib
287 {
288   /** A Glib::wrap() method for this object.
289    * 
290    * @param object The C instance.
291    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
292    * @result A C++ instance that wraps this C instance.
293    *
294    * @relates Gtk::FileSelection
295    */
296   Gtk::FileSelection* wrap(GtkFileSelection* object, bool take_copy = false);
297 } //namespace Glib
298
299
300 #endif // GTKMM_DISABLE_DEPRECATED
301
302
303 #endif /* _GTKMM_FILESELECTION_H */
304