Remove ancient/unused flowcanvas and libglademm from repository.
[ardour.git] / libs / gtkmm2 / gtk / src / fileselection.hg
1 /* $Id: fileselection.hg,v 1.4 2005/11/29 16:38:10 murrayc Exp $ */
2
3
4 /* fileselection.h
5  * 
6  * Copyright (C) 1998-2002 The gtkmm Development Team
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the Free
20  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  */
22
23 // This is for including the config header before any code (such as
24 // the #ifndef GTKMM_DISABLE_DEPRECATED in deprecated classes) is generated:
25 _CONFIGINCLUDE(gtkmmconfig.h)
26
27 #include <gtkmm/dialog.h>
28 #include <gtkmm/button.h>
29 #include <gtkmm/entry.h>
30 #include <gtkmm/label.h>
31 #include <gtkmm/box.h>
32 #include <gtkmm/treeview.h>
33 #include <gtkmm/buttonbox.h>
34 #include <gtkmm/optionmenu.h>
35 _DEFS(gtkmm,gtk)
36 _PINCLUDE(gtkmm/private/dialog_p.h)
37
38 namespace Gtk
39 {
40
41 /** Prompt the user for a file or directory name.
42  *
43  * Gtk::FileSelection should be used to retrieve file or directory names from
44  * the user. It will create a new dialog window containing a directory list,
45  * and a file list corresponding to the current working directory. The
46  * filesystem can be navigated using the directory list or the drop-down
47  * history menu. Alternatively, the TAB key can be used to navigate using
48  * filename completion - common in text based editors such as emacs and jed.
49  *
50  * @deprecated Use the FileChooserDialog instead.
51  */
52 class FileSelection : public Dialog
53 {
54   _CLASS_GTKOBJECT(FileSelection,GtkFileSelection,GTK_FILE_SELECTION,Gtk::Dialog,GtkDialog)
55   _UNMANAGEABLE
56   _IS_DEPRECATED
57 public:
58
59   FileSelection();
60   _WRAP_CTOR(FileSelection(const Glib::ustring& title), gtk_file_selection_new)
61
62 #m4 dnl // Rarely needed -- could be used by accident if it were in convert_gtk.m4.
63 #m4 _CONVERSION(`const std::string&', `const gchar*', `($3).c_str()')
64
65   _WRAP_METHOD(void set_filename(const std::string& filename), gtk_file_selection_set_filename)
66
67 #m4 dnl // This isn't in convert_gtk.m4, because usually we need to check for NULL.
68 #m4 _CONVERSION(`const gchar*', `std::string', `$2($3)')
69
70   _WRAP_METHOD(std::string get_filename() const, gtk_file_selection_get_filename)
71
72   _WRAP_METHOD(void complete(const Glib::ustring& pattern), gtk_file_selection_complete)
73   _WRAP_METHOD(void show_fileop_buttons(), gtk_file_selection_show_fileop_buttons)
74   _WRAP_METHOD(void hide_fileop_buttons(), gtk_file_selection_hide_fileop_buttons)
75
76 #m4 dnl // This isn't in convert_gtk.m4, since the gchar** ownership policy often differs.
77 #m4 _CONVERSION(`gchar**', `Glib::ArrayHandle<std::string>', `$2($3, Glib::OWNERSHIP_DEEP)')
78
79   _WRAP_METHOD(Glib::ArrayHandle<std::string> get_selections() const, gtk_file_selection_get_selections)
80
81   _WRAP_METHOD(void set_select_multiple(bool select_multiple = true), gtk_file_selection_set_select_multiple)
82   _WRAP_METHOD(bool get_select_multiple() const, gtk_file_selection_get_select_multiple)
83
84   //: Accessors
85   _MEMBER_GET_PTR(dir_list, dir_list, TreeView*, GtkWidget*)
86   _MEMBER_GET_PTR(file_list, file_list, TreeView*, GtkWidget*)
87   _MEMBER_GET_PTR(history_pulldown, history_pulldown, OptionMenu*, GtkWidget*)
88   _MEMBER_GET_PTR(selection_entry, selection_entry, Entry*, GtkWidget*)
89   _MEMBER_GET_PTR(selection_text, selection_text, Label*, GtkWidget*)
90   _MEMBER_GET_PTR(main_vbox, main_vbox, VBox*, GtkWidget*)
91   _MEMBER_GET_PTR(ok_button, ok_button, Button*, GtkWidget*)
92   _MEMBER_GET_PTR(cancel_button, cancel_button, Button*, GtkWidget*)
93   _MEMBER_GET_PTR(help_button, help_button, Button*, GtkWidget*)
94   _MEMBER_GET_PTR(button_area, button_area, HButtonBox*, GtkWidget*)
95   _MEMBER_GET_PTR(action_area, action_area, HBox*, GtkWidget*)
96
97   _WRAP_PROPERTY("show-fileops", bool)
98   _WRAP_PROPERTY("filename", std::string)
99   _WRAP_PROPERTY("select_multiple", bool)
100 };
101
102 } // namespace Gtk
103