Debian Codegraph @

gtk/src/appchooserbutton.hg

raw
1 /* Copyright (C) 2011 The gtkmm Development Team
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
15 */
16
17 #include <gtkmm/appchooser.h>
18 #include <gtkmm/combobox.h>
19 _DEFS(gtkmm,gtk)
20 _PINCLUDE(gtkmm/private/combobox_p.h)
21
22
23 namespace Gtk
24 {
25
26 /** A button to launch an application chooser dialog.
27 *
28 * This widget lets the user select an application. See the AppChooser base class API.
29 *
30 * Initially, an AppChooserButton selects the first application
31 * in its list, which will either be the most-recently used application
32 * or, if property_show_default_item() is <tt>true</tt>, the
33 * default application.
34 *
35 * The list of applications shown in an AppChooserButton includes
36 * the recommended applications for the given content type. When
37 * property_show_default_item() is set, the default application
38 * is also included. To let the user choose other applications,
39 * you can set property_show_dialog_item(),
40 * which allows to open a full AppChooserDialog.
41 *
42 * It is possible to add custom items to the list, using append_custom_item().
43 * These items cause signal_custom_item_activated() to be
44 * emitted when they are selected.
45 *
46 * To track changes in the selected application, use ComboBox::signal_changed().
47 *
48 * The AppChooserButton widget looks like this:
49 * @image html appchooserbutton1.png
50 *
51 * @ingroup Widgets
52 *
53 * @newin{3,0}
54 */
55 class GTKMM_API AppChooserButton
56 : public ComboBox,
57 public AppChooser
58 {
59 _CLASS_GTKOBJECT(AppChooserButton, GtkAppChooserButton, GTK_APP_CHOOSER_BUTTON, ComboBox, GtkComboBox, , , GTKMM_API)
60 _IMPLEMENTS_INTERFACE(AppChooser)
61 public:
62
63 /** Creates a new app-chooser button for applications that can handle content of the given type.
64 *
65 * See @ref giommContentType in glibmm for more information about content types.
66 *
67 * @param content_type The content type to show applications for
68 */
69 _WRAP_CTOR(AppChooserButton(const Glib::ustring& content_type), gtk_app_chooser_button_new)
70
71 _WRAP_METHOD(void append_separator(), gtk_app_chooser_button_append_separator)
72 _WRAP_METHOD(void append_custom_item(const Glib::ustring& name, const Glib::ustring& label, const Glib::RefPtr<Gio::Icon>& icon), gtk_app_chooser_button_append_custom_item)
73 _WRAP_METHOD(void set_active_custom_item(const Glib::ustring& name), gtk_app_chooser_button_set_active_custom_item)
74 _WRAP_METHOD(void set_show_dialog_item(bool setting = true), gtk_app_chooser_button_set_show_dialog_item)
75 _WRAP_METHOD(bool get_show_dialog_item() const, gtk_app_chooser_button_get_show_dialog_item)
76 _WRAP_METHOD(void set_heading(const Glib::ustring& heading), gtk_app_chooser_button_set_heading)
77 _WRAP_METHOD(Glib::ustring get_heading() const, gtk_app_chooser_button_get_heading)
78 _WRAP_METHOD(void set_show_default_item(bool setting = true), gtk_app_chooser_button_set_show_default_item)
79 _WRAP_METHOD(bool get_show_default_item() const, gtk_app_chooser_button_get_show_default_item)
80
81
82 _WRAP_SIGNAL(void custom_item_activated(const Glib::ustring& item_name), "custom-item-activated",
83 detail_name custom_item_name, two_signal_methods)
84
85 _WRAP_PROPERTY("show-dialog-item", bool)
86 _WRAP_PROPERTY("heading", Glib::ustring)
87 _WRAP_PROPERTY("show-default-item", bool)
88 };
89
90 } // namespace Gtk