1 /**
2 * \brief A floating dialog implementation.
3 *
4 * Author:
5 * Gustav Broberg <broberg@kth.se>
6 *
7 * Copyright (C) 2007 Authors
8 *
9 * Released under GNU GPL. Read the file 'COPYING' for more information.
10 */
13 #ifndef INKSCAPE_UI_DIALOG_FLOATING_BEHAVIOR_H
14 #define INKSCAPE_UI_DIALOG_FLOATING_BEHAVIOR_H
16 #include <gtkmm/dialog.h>
17 #include "behavior.h"
19 namespace Inkscape {
20 namespace UI {
21 namespace Dialog {
22 namespace Behavior {
24 class FloatingBehavior : public Behavior {
26 public:
27 static Behavior *create(Dialog& dialog);
29 ~FloatingBehavior();
31 /** Gtk::Dialog methods */
32 operator Gtk::Widget&();
33 GtkWidget *gobj();
34 void present();
35 Gtk::VBox *get_vbox();
36 void show();
37 void hide();
38 void show_all_children();
39 void resize(int width, int height);
40 void move(int x, int y);
41 void set_position(Gtk::WindowPosition);
42 void set_size_request(int width, int height);
43 void size_request(Gtk::Requisition& requisition);
44 void get_position(int& x, int& y);
45 void get_size(int& width, int& height);
46 void set_title(Glib::ustring title);
47 void set_response_sensitive(int response_id, bool setting);
48 void set_sensitive(bool sensitive);
49 Gtk::Button *add_button(const Glib::ustring& button_text, int response_id);
50 Gtk::Button *add_button(const Gtk::StockID& stock_id, int response_id);
51 void set_default_response(int response_id);
53 /** Gtk::Dialog signal proxies */
54 Glib::SignalProxy0<void> signal_show();
55 Glib::SignalProxy0<void> signal_hide();
56 Glib::SignalProxy1<bool, GdkEventAny *> signal_delete_event();
57 Glib::SignalProxy1<void, int> signal_response();
59 /** Custom signal handlers */
60 void onHideF12();
61 void onShowF12();
62 void onDesktopActivated(SPDesktop *desktop);
63 void onShutdown();
65 private:
66 FloatingBehavior(Dialog& dialog);
68 Gtk::Dialog *_d; //< the actual dialog
70 };
72 } // namespace Behavior
73 } // namespace Dialog
74 } // namespace UI
75 } // namespace Inkscape
77 #endif // INKSCAPE_UI_DIALOG_FLOATING_BEHAVIOR_H
79 /*
80 Local Variables:
81 mode:c++
82 c-file-style:"stroustrup"
83 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
84 indent-tabs-mode:nil
85 fill-column:99
86 End:
87 */
88 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :