Debian Codegraph @

gtk/src/appchooser.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 _CONFIGINCLUDE(gtkmmconfig.h)
18
19 #include <glibmm/interface.h>
20 #include <giomm/appinfo.h>
21 //#include <gtkmm/enums.h>
22 _DEFS(gtkmm,gtk)
23 _PINCLUDE(glibmm/private/interface_p.h)
24
25 #ifndef DOXYGEN_SHOULD_SKIP_THIS
26 extern "C"
27 {
28 typedef struct _GtkAppChooserIface GtkAppChooserIface;
29 }
30 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
31
32 namespace Gtk
33 {
34
35 /** Interface implemented by widgets for choosing an application.
36 *
37 * This interface can be implemented by widgets which allow the user to choose
38 * an application (typically for the purpose of opening a file). The main
39 * objects that implement this interface are AppChooserWidget, AppChooserDialog
40 * and AppChooserButton.
41 *
42 * Applications are represented by Gio::AppInfo objects here.
43 * GIO has a concept of recommended and fallback applications for a
44 * given content type. Recommended applications are those that claim
45 * to handle the content type itself, while fallback also includes
46 * applications that handle a more generic content type. GIO also
47 * knows the default and last-used application for a given content
48 * type. The AppChooserWidget provides detailed control over
49 * whether the shown list of applications should include default,
50 * recommended or fallback applications.
51 *
52 * To obtain the application that has been selected in an AppChooser,
53 * use get_app_info().
54 *
55 * See @ref giommContentType in glibmm for more information about content types.
56 *
57 * @newin{3,0}
58 */
59 class GTKMM_API AppChooser : public Glib::Interface
60 {
61 _CLASS_INTERFACE(AppChooser, GtkAppChooser, GTK_APP_CHOOSER, GtkAppChooserIface, , , GTKMM_API)
62
63 public:
64 _WRAP_METHOD(Glib::RefPtr<Gio::AppInfo> get_app_info(), gtk_app_chooser_get_app_info, refreturn)
65 _WRAP_METHOD(Glib::RefPtr<const Gio::AppInfo> get_app_info() const, gtk_app_chooser_get_app_info, refreturn, constversion)
66
67 _WRAP_METHOD(Glib::ustring get_content_type() const, gtk_app_chooser_get_content_type)
68 _WRAP_METHOD(void refresh(), gtk_app_chooser_refresh)
69
70 _WRAP_PROPERTY("content_type", Glib::ustring)
71 };
72
73 } // namespace Gtk