| 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 |
#include <gtkmm/window.h> |
| 18 |
#include <gdkmm/pixbuf.h> |
| 19 |
|
| 20 |
_DEFS(gtkmm,gtk) |
| 21 |
_PINCLUDE(gtkmm/private/window_p.h) |
| 22 |
|
| 23 |
namespace Gtk |
| 24 |
{ |
| 25 |
|
| 26 |
_WRAP_ENUM(AssistantPageType, GtkAssistantPageType, decl_prefix GTKMM_API) |
| 27 |
|
| 28 |
/** A widget used to guide users through multi-step operations. |
| 29 |
* |
| 30 |
* A Gtk::Assistant is a widget used to represent a generally complex |
| 31 |
* operation split into several steps, guiding the user through its |
| 32 |
* pages and controlling the page flow to collect the necessary data. |
| 33 |
* |
| 34 |
* @newin{2,10} |
| 35 |
* @ingroup Dialogs |
| 36 |
*/ |
| 37 |
class GTKMM_API Assistant : public Window |
| 38 |
{ |
| 39 |
_CLASS_GTKOBJECT(Assistant, GtkAssistant, GTK_ASSISTANT, Gtk::Window, GtkWindow, , , GTKMM_API) |
| 40 |
_UNMANAGEABLE |
| 41 |
public: |
| 42 |
_CTOR_DEFAULT() |
| 43 |
|
| 44 |
_WRAP_METHOD(void next_page(), gtk_assistant_next_page) |
| 45 |
_WRAP_METHOD(void previous_page(), gtk_assistant_previous_page) |
| 46 |
|
| 47 |
_WRAP_METHOD(int get_current_page() const, gtk_assistant_get_current_page) |
| 48 |
_WRAP_METHOD(void set_current_page(int page_num), gtk_assistant_set_current_page) |
| 49 |
_WRAP_METHOD(int get_n_pages() const, gtk_assistant_get_n_pages) |
| 50 |
_WRAP_METHOD(Widget* get_nth_page(int page_num), gtk_assistant_get_nth_page) |
| 51 |
_WRAP_METHOD(const Widget* get_nth_page(int page_num) const, gtk_assistant_get_nth_page, constversion) |
| 52 |
_WRAP_METHOD(int prepend_page(Widget& page), gtk_assistant_prepend_page) |
| 53 |
_WRAP_METHOD(int append_page(Widget& page), gtk_assistant_append_page) |
| 54 |
_WRAP_METHOD(int insert_page(Widget& page, int position), gtk_assistant_insert_page) |
| 55 |
_WRAP_METHOD(void remove_page(int page_num), gtk_assistant_remove_page) |
| 56 |
|
| 57 |
typedef sigc::slot<int, int /* current_page */> SlotForwardPage; |
| 58 |
|
| 59 |
void set_forward_page_func(const SlotForwardPage& slot); |
| 60 |
_IGNORE(gtk_assistant_set_forward_page_func) |
| 61 |
|
| 62 |
_WRAP_METHOD(void set_page_type(const Widget& page, AssistantPageType type), gtk_assistant_set_page_type) |
| 63 |
_WRAP_METHOD(AssistantPageType get_page_type(const Widget& page) const, gtk_assistant_get_page_type) |
| 64 |
_WRAP_METHOD(void set_page_title(const Widget& page, const Glib::ustring& title), gtk_assistant_set_page_title) |
| 65 |
_WRAP_METHOD(Glib::ustring get_page_title(const Widget& page) const, gtk_assistant_get_page_title) |
| 66 |
|
| 67 |
_WRAP_METHOD(void set_page_header_image(const Widget& page, const Glib::RefPtr<Gdk::Pixbuf>& pixbuf), gtk_assistant_set_page_header_image, deprecated "A header is no longer shown. Add your header decoration to the page content instead.") |
| 68 |
_WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> get_page_header_image(const Widget& page), gtk_assistant_get_page_header_image, deprecated "A header is no longer shown. Add your header decoration to the page content instead.") |
| 69 |
_WRAP_METHOD(Glib::RefPtr<const Gdk::Pixbuf> get_page_header_image(const Widget& page) const, gtk_assistant_get_page_header_image, constversion, deprecated "A header is no longer shown. Aadd your header decoration to the page content instead.") |
| 70 |
_WRAP_METHOD(void set_page_side_image(const Widget& page, const Glib::RefPtr<Gdk::Pixbuf>& pixbuf), gtk_assistant_set_page_side_image, deprecated "Sidebar images are not shown anymore..") |
| 71 |
_WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> get_page_side_image(const Widget& page), gtk_assistant_get_page_side_image, deprecated "Sidebar images are not shown anymore..") |
| 72 |
_WRAP_METHOD(Glib::RefPtr<const Gdk::Pixbuf> get_page_side_image(const Widget& page) const, gtk_assistant_get_page_side_image, constversion, deprecated "Sidebar images are not shown anymore.") |
| 73 |
|
| 74 |
_WRAP_METHOD(void set_page_complete(const Widget& page, bool complete = true), gtk_assistant_set_page_complete) |
| 75 |
_WRAP_METHOD(bool get_page_complete(const Widget& page) const, gtk_assistant_get_page_complete) |
| 76 |
_WRAP_METHOD(void add_action_widget(Widget& child), gtk_assistant_add_action_widget) |
| 77 |
_WRAP_METHOD(void remove_action_widget(Widget& child), gtk_assistant_remove_action_widget) |
| 78 |
_WRAP_METHOD(void update_buttons_state(), gtk_assistant_update_buttons_state) |
| 79 |
_WRAP_METHOD(void commit(), gtk_assistant_commit) |
| 80 |
|
| 81 |
_WRAP_METHOD(void set_page_has_padding(const Widget& page, bool has_padding = true), gtk_assistant_set_page_has_padding) |
| 82 |
_WRAP_METHOD(bool get_page_has_padding(const Widget& page) const, gtk_assistant_get_page_has_padding) |
| 83 |
|
| 84 |
_WRAP_SIGNAL(void prepare(Gtk::Widget* page), "prepare") |
| 85 |
_WRAP_SIGNAL(void apply(), "apply") |
| 86 |
_WRAP_SIGNAL(void close(), "close") |
| 87 |
_WRAP_SIGNAL(void cancel(), "cancel") |
| 88 |
|
| 89 |
//Ignore action signals. |
| 90 |
_IGNORE_SIGNAL("escape") |
| 91 |
|
| 92 |
_WRAP_PROPERTY("use-header-bar", bool) |
| 93 |
|
| 94 |
//There are no normal properties. |
| 95 |
//TODO: Child properties? |
| 96 |
}; |
| 97 |
|
| 98 |
} // namespace Gtk |