2
* \brief Base class for dialogs in Inkscape. This class provides certain
3
* common behaviors and styles wanted of all dialogs in the application.
2
* \brief Base class for dialogs in Inkscape. This class provides certain common behaviors and
3
* styles wanted of all dialogs in the application. Fundamental parts of the dialog's
4
* behavior is controlled by a Dialog::Behavior subclass instance connected to the dialog.
6
7
* Bryce W. Harrington <bryce@bryceharrington.org>
8
* Gustav Broberg <broberg@kth.se>
8
* Copyright (C) 2004, 2005 Authors
10
* Copyright (C) 2004--2007 Authors
10
12
* Released under GNU GPL. Read the file 'COPYING' for more information.
16
18
#include <gtkmm/dialog.h>
17
19
#include <gtkmm/tooltips.h>
21
#include "dock-behavior.h"
22
#include "floating-behavior.h"
19
24
namespace Inkscape { class Selection; }
26
class Dialog : public Gtk::Dialog {
31
enum BehaviorType { FLOATING, DOCK };
28
Dialog(BaseObjectType *gobj); // fixme: remove this
30
Dialog(const char *prefs_path, int verb_num = 0, const char *apply_label = NULL);
36
Dialog(const char *prefs_path = NULL, int verb_num = 0, const char *apply_label = NULL);
38
Dialog(Behavior::BehaviorFactory behavior_factory, const char *prefs_path = NULL,
39
int verb_num = 0, const char *apply_label = NULL);
37
46
virtual void present();
39
48
/** Hide and show dialogs */
40
virtual void onHideF12();
41
virtual void onShowF12();
49
virtual void onHideF12();
50
virtual void onShowF12();
52
virtual operator Gtk::Widget&();
53
virtual GtkWidget *gobj();
54
virtual Gtk::VBox *get_vbox();
57
virtual void show_all_children();
58
virtual void set_resizable(bool);
59
virtual void set_sensitive(bool sensitive=true);
60
virtual void set_default(Gtk::Widget&);
61
virtual void set_size_request(int, int);
62
virtual void size_request(Gtk::Requisition&);
63
virtual void get_position(int& x, int& y);
64
virtual void get_size(int& width, int& height);
65
virtual void resize(int width, int height);
66
virtual void move(int x, int y);
67
virtual void set_position(Gtk::WindowPosition position);
68
virtual void set_title(Glib::ustring title);
70
virtual void set_response_sensitive(int response_id, bool setting);
71
virtual Glib::SignalProxy0<void> signal_show();
72
virtual Glib::SignalProxy0<void> signal_hide();
73
virtual Glib::SignalProxy1<void, int> signal_response();
75
virtual Gtk::Button* add_button (const Glib::ustring& button_text, int response_id);
76
virtual Gtk::Button* add_button (const Gtk::StockID& stock_id, int response_id);
78
virtual void set_default_response(int response_id);
80
bool _user_hidden; // when it is closed by the user, to prevent repopping on f12
44
bool _user_hidden; // when it is closed by the user, to prevent repopping on f12
46
83
void read_geometry();
47
84
void save_geometry();
49
const char *_prefs_path;
51
86
bool retransientize_suppress; // when true, do not retransientize (prevents races when switching new windows too fast)
89
const char *_prefs_path;
92
const char *_apply_label;
56
95
* Tooltips object for all descendants to use
72
111
sigc::connection _shutdown_connection;
114
Behavior::Behavior* _behavior;
75
116
Dialog(); // no constructor without params
77
118
Dialog(Dialog const &d); // no copy
78
119
Dialog& operator=(Dialog const &d); // no assign
121
friend class Behavior::FloatingBehavior;
122
friend class Behavior::DockBehavior;
81
125
} // namespace Dialog