1 /* $Id: linkbutton.hg,v 1.2 2006/03/22 16:53:22 murrayc Exp $ */
5 * Copyright (C) 2006 The gtkmm Development Team
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the Free
19 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #include <gtkmm/button.h>
24 _PINCLUDE(gtkmm/private/button_p.h)
30 /** Create buttons bound to a URL.
32 * A Gtk::LinkButton is a Gtk::Button with a hyperlink, similar to the one
33 * used by web browsers, which triggers an action when clicked. It is useful
34 * to show quick links to resources.
36 * The URI bound to a Gtk::LinkButton can be set specifically using set_uri(),
37 * and retrieved using get_uri().
38 * Gtk::LinkButton offers a global hook, which is called when the used clicks on it: see set_uri_hook().
43 class LinkButton : public Button
45 _CLASS_GTKOBJECT(LinkButton, GtkLinkButton, GTK_LINK_BUTTON, Gtk::Button, GtkButton)
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)
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)
56 * void on_linkbutton_uri(Gtk::LinkButton *button, const Glib::ustring& uri);
58 * @see set_uri_hook().
60 typedef sigc::slot<void, Gtk::LinkButton*, const Glib::ustring&> SlotUri;
62 /** Sets slot as the function that should be invoked every time a user clicks a LinkButton.
63 * This function is called before every signal handler registered for the "clicked" signal.
65 * @param slot A function called each time a LinkButton is clicked.
68 static void set_uri_hook(const SlotUri& slot);
69 _IGNORE(gtk_link_button_set_uri_hook)
71 /** Unsets any previously set slot as the function that should be invoked every time a user clicks a LinkButton.
72 * @see set_uri_hook().
75 static void unset_uri_hook();
78 _WRAP_PROPERTY("uri", Glib::ustring)