Debian Codegraph @

gtk/src/aboutdialog.hg

raw
1 /* Copyright (C) 2004 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 <vector>
20
21 #include <gtkmm/dialog.h>
22
23 _DEFS(gtkmm,gtk)
24 _PINCLUDE(gtkmm/private/dialog_p.h)
25
26 namespace Gtk
27 {
28
29 _WRAP_ENUM(License, GtkLicense, decl_prefix GTKMM_API)
30
31 /** The AboutDialog offers a simple way to display information about a program like its logo, name, copyright,
32 * website and license. It is also possible to give credits to the authors, documenters, translators and artists
33 * who have worked on the program. An about dialog is typically opened when the user selects the About option
34 * from the Help menu. All parts of the dialog are optional.
35 *
36 * About dialogs often contain links and email addresses. Gtk::AboutDialog displays these as clickable links.
37 * By default, it calls gtk_show_uri() when a user clicks one. The behaviour can be overridden with the activate_link signal.
38 * Email addresses in the authors, documenters and artists properties are recognized by looking
39 * for \<user\@host\>, URLs are recognized by looking for http://url, with the URL extending to the next space,
40 * tab or line break.
41 *
42 * An AboutDialog looks like this:
43 * @image html aboutdialog1.png
44 *
45 * @ingroup Dialogs
46 */
47 class GTKMM_API AboutDialog : public Dialog
48 {
49 _CLASS_GTKOBJECT(AboutDialog, GtkAboutDialog, GTK_ABOUT_DIALOG, Gtk::Dialog, GtkDialog, , , GTKMM_API)
50 _UNMANAGEABLE
51 public:
52 _CTOR_DEFAULT()
53
54 /** Constructor.
55 *
56 * @param use_header_bar <tt>true</tt> if the dialog shall use a HeaderBar
57 * for action buttons instead of the action-area.
58 *
59 * @newin{3,24}
60 */
61 explicit AboutDialog(bool use_header_bar);
62
63 _WRAP_METHOD(Glib::ustring get_program_name() const, gtk_about_dialog_get_program_name)
64 _WRAP_METHOD(void set_program_name(const Glib::ustring& name), gtk_about_dialog_set_program_name)
65
66 _WRAP_METHOD(Glib::ustring get_version() const, gtk_about_dialog_get_version)
67 _WRAP_METHOD(void set_version(const Glib::ustring& version), gtk_about_dialog_set_version)
68 _WRAP_METHOD(Glib::ustring get_copyright() const, gtk_about_dialog_get_copyright)
69 _WRAP_METHOD(void set_copyright(const Glib::ustring& copyright), gtk_about_dialog_set_copyright)
70 _WRAP_METHOD(Glib::ustring get_comments() const, gtk_about_dialog_get_comments)
71 _WRAP_METHOD(void set_comments(const Glib::ustring& comments), gtk_about_dialog_set_comments)
72 _WRAP_METHOD(Glib::ustring get_license() const, gtk_about_dialog_get_license)
73 _WRAP_METHOD(void set_license(const Glib::ustring& license), gtk_about_dialog_set_license)
74
75 /** Hides the license button.
76 *
77 * @newin{3,4}
78 */
79 void unset_license();
80 _WRAP_METHOD(License get_license_type() const, gtk_about_dialog_get_license_type)
81 _WRAP_METHOD(void set_license_type(License license_type), gtk_about_dialog_set_license_type)
82 _WRAP_METHOD(Glib::ustring get_website() const, gtk_about_dialog_get_website)
83 _WRAP_METHOD(void set_website(const Glib::ustring& website), gtk_about_dialog_set_website)
84 _WRAP_METHOD(Glib::ustring get_website_label() const, gtk_about_dialog_get_website_label)
85 _WRAP_METHOD(void set_website_label(const Glib::ustring& website_label), gtk_about_dialog_set_website_label)
86
87 #m4 _CONVERSION(`const gchar* const*',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_NONE)')
88 _WRAP_METHOD(std::vector<Glib::ustring> get_authors() const, gtk_about_dialog_get_authors)
89
90 #m4 _CONVERSION(`const std::vector<Glib::ustring>&',`const gchar**',`Glib::ArrayHandler<Glib::ustring>::vector_to_array($3).data ()')
91 _WRAP_METHOD(void set_authors(const std::vector<Glib::ustring>& authors) const, gtk_about_dialog_set_authors)
92
93 _WRAP_METHOD(std::vector<Glib::ustring> get_documenters() const, gtk_about_dialog_get_documenters)
94
95 _WRAP_METHOD(void set_documenters(const std::vector<Glib::ustring>& documenters), gtk_about_dialog_set_documenters)
96 _WRAP_METHOD(std::vector<Glib::ustring> get_artists() const, gtk_about_dialog_get_artists)
97 _WRAP_METHOD(void set_artists(const std::vector<Glib::ustring>& artists), gtk_about_dialog_set_artists)
98 _WRAP_METHOD(Glib::ustring get_translator_credits() const, gtk_about_dialog_get_translator_credits)
99 _WRAP_METHOD(void set_translator_credits(const Glib::ustring& translator_credits), gtk_about_dialog_set_translator_credits)
100
101 _WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> get_logo(), gtk_about_dialog_get_logo, refreturn)
102 _WRAP_METHOD(Glib::RefPtr<const Gdk::Pixbuf> get_logo() const, gtk_about_dialog_get_logo, refreturn, constversion)
103
104 _WRAP_METHOD(void set_logo(const Glib::RefPtr<Gdk::Pixbuf>& logo), gtk_about_dialog_set_logo)
105
106 /** Sets the pixbuf to be displayed as logo in the about dialog.
107 * The logo is set to the default window icon set with
108 * Gtk::Window::set_default_icon() or Gtk::Window::set_default_icon_list().
109 *
110 * @newin{3,4}
111 */
112 void set_logo_default();
113
114 _WRAP_METHOD(Glib::ustring get_logo_icon_name() const, gtk_about_dialog_get_logo_icon_name)
115 _WRAP_METHOD(void set_logo_icon_name(const Glib::ustring& icon_name), gtk_about_dialog_set_logo_icon_name)
116
117 _WRAP_METHOD(bool get_wrap_license() const, gtk_about_dialog_get_wrap_license)
118 _WRAP_METHOD(void set_wrap_license(bool wrap_license), gtk_about_dialog_set_wrap_license)
119
120 _WRAP_METHOD(void add_credit_section(const Glib::ustring& section_name, const std::vector<Glib::ustring>& people), gtk_about_dialog_add_credit_section)
121
122 _WRAP_PROPERTY("program-name", Glib::ustring)
123
124 _WRAP_PROPERTY("version", Glib::ustring)
125 _WRAP_PROPERTY("copyright", Glib::ustring)
126 _WRAP_PROPERTY("comments", Glib::ustring)
127 _WRAP_PROPERTY("website", Glib::ustring)
128 _WRAP_PROPERTY("website_label", Glib::ustring)
129 _WRAP_PROPERTY("license", Glib::ustring)
130 _WRAP_PROPERTY("license-type", License)
131 _WRAP_PROPERTY("authors", std::vector<Glib::ustring>)
132 _WRAP_PROPERTY("documenters", std::vector<Glib::ustring>)
133 _WRAP_PROPERTY("translator_credits", std::vector<Glib::ustring>)
134 _WRAP_PROPERTY("artists", std::vector<Glib::ustring>)
135 _WRAP_PROPERTY("logo", Glib::RefPtr<Gdk::Pixbuf>)
136 _WRAP_PROPERTY("logo_icon_name", Glib::ustring)
137 _WRAP_PROPERTY("wrap_license", bool)
138
139 _WRAP_SIGNAL(bool activate_link(const std::string& uri), "activate-link")
140 };
141
142 } // namespace Gtk