Code

d01cdb04804399c2efcf0aea2964ec5ae81ef7bb
[inkscape.git] / src / ui / dialog / dialog.h
1 /**
2  * \brief Base class for dialogs in Inkscape.  This class provides certain
3  *        common behaviors and styles wanted of all dialogs in the application.
4  *
5  * Author:
6  *   Bryce W. Harrington <bryce@bryceharrington.org>
7  *
8  * Copyright (C) 2004, 2005 Authors
9  *
10  * Released under GNU GPL.  Read the file 'COPYING' for more information.
11  */
13 #ifndef INKSCAPE_DIALOG_H
14 #define INKSCAPE_DIALOG_H
16 #include <gtkmm/dialog.h>
17 #include <gtkmm/tooltips.h>
19 namespace Inkscape { class Selection; }
20 class SPDesktop;
22 namespace Inkscape {
23 namespace UI {
24 namespace Dialog {
26 class Dialog : public Gtk::Dialog {
27 public:
28     Dialog(BaseObjectType *gobj); // fixme: remove this
30     Dialog(const char *prefs_path, int verb_num = 0, const char *apply_label = NULL);
32     virtual ~Dialog();
34     virtual void onDesktopActivated (SPDesktop*);
35     virtual void onShutdown();
37     /** Hide and show dialogs */
38     virtual void   onHideF12();
39     virtual void   onShowF12();
41     bool           _hiddenF12;
42     bool           _user_hidden; // when it is closed by the user, to prevent repopping on f12
44     void           read_geometry();
45     void           save_geometry();
47     const char           *_prefs_path;
49     bool retransientize_suppress; // when true, do not retransientize (prevents races when switching new windows too fast)
51 protected:
53     /**
54      * Tooltips object for all descendants to use
55      */
56     Gtk::Tooltips tooltips;
58     virtual void   on_response(int response_id);
59     virtual bool   on_delete_event (GdkEventAny*);
60     virtual void   _apply();
61     virtual void   _close();
63     static bool windowKeyPress( GtkWidget *widget, GdkEventKey *event );
65     Inkscape::Selection*   _getSelection();
67     sigc::connection _desktop_activated_connection;
68     sigc::connection _dialogs_hidden_connection;
69     sigc::connection _dialogs_unhidden_connection;
70     sigc::connection _shutdown_connection;
72 private:
73     Dialog(); // no constructor without params
75     Dialog(Dialog const &d);            // no copy
76     Dialog& operator=(Dialog const &d); // no assign
77 };
79 } // namespace Dialog
80 } // namespace UI
81 } // namespace Inkscape
83 #endif //INKSCAPE_DIALOG_H
85 /*
86   Local Variables:
87   mode:c++
88   c-file-style:"stroustrup"
89   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
90   indent-tabs-mode:nil
91   fill-column:99
92   End:
93 */
94 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :