| 1 |
/* Copyright (C) 2006 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/button.h> |
| 18 |
_DEFS(gtkmm,gtk) |
| 19 |
_PINCLUDE(gtkmm/private/button_p.h) |
| 20 |
|
| 21 |
|
| 22 |
namespace Gtk |
| 23 |
{ |
| 24 |
|
| 25 |
/** Create buttons bound to a URL. |
| 26 |
* |
| 27 |
* A Gtk::LinkButton is a Gtk::Button with a hyperlink, similar to the one |
| 28 |
* used by web browsers, which triggers an action when clicked. It is useful |
| 29 |
* to show quick links to resources. |
| 30 |
* |
| 31 |
* The URI bound to a Gtk::LinkButton can be set specifically using set_uri(), |
| 32 |
* and retrieved using get_uri(). |
| 33 |
* By default, Gtk::LinkButton calls gtk_show_uri() when the button is clicked. |
| 34 |
* This behaviour can be overridden by connecting to the activate_link signal and |
| 35 |
* returning true from the signal handler. |
| 36 |
* |
| 37 |
* The LinkButton widget looks like this: |
| 38 |
* @image html linkbutton1.png |
| 39 |
* |
| 40 |
* @newin{2,10} |
| 41 |
* @ingroup Widgets |
| 42 |
*/ |
| 43 |
class GTKMM_API LinkButton : public Button |
| 44 |
{ |
| 45 |
_CLASS_GTKOBJECT(LinkButton, GtkLinkButton, GTK_LINK_BUTTON, Gtk::Button, GtkButton, , , GTKMM_API) |
| 46 |
public: |
| 47 |
_CTOR_DEFAULT |
| 48 |
explicit LinkButton(const Glib::ustring& uri); |
| 49 |
_IGNORE(gtk_link_button_new) |
| 50 |
_WRAP_CTOR(LinkButton(const Glib::ustring& uri, const Glib::ustring& label),gtk_link_button_new_with_label) |
| 51 |
|
| 52 |
_WRAP_METHOD(Glib::ustring get_uri() const, gtk_link_button_get_uri) |
| 53 |
_WRAP_METHOD(void set_uri(const Glib::ustring& uri), gtk_link_button_set_uri) |
| 54 |
|
| 55 |
_WRAP_METHOD(bool get_visited() const, gtk_link_button_get_visited) |
| 56 |
_WRAP_METHOD(void set_visited(bool visited = true), gtk_link_button_set_visited) |
| 57 |
|
| 58 |
_WRAP_PROPERTY("uri", Glib::ustring) |
| 59 |
_WRAP_PROPERTY("visited", bool) |
| 60 |
|
| 61 |
_WRAP_SIGNAL(bool activate_link(), "activate-link") |
| 62 |
}; |
| 63 |
|
| 64 |
} // namespace Gtk |