summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/dialog.h
blob: dd3cdaafe43c57c992aeb60bd514d4766eed8435 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/**
 * \brief Base class for dialogs in Inkscape.  This class provides certain
 *        common behaviors and styles wanted of all dialogs in the application.
 *
 * Author:
 *   Bryce W. Harrington <bryce@bryceharrington.org>
 *
 * Copyright (C) 2004, 2005 Authors
 *
 * Released under GNU GPL.  Read the file 'COPYING' for more information.
 */

#ifndef INKSCAPE_DIALOG_H
#define INKSCAPE_DIALOG_H

#include <gtkmm/dialog.h>
#include <gtkmm/tooltips.h>

namespace Inkscape { class Selection; }
class SPDesktop;

namespace Inkscape {
namespace UI {
namespace Dialog {

class Dialog : public Gtk::Dialog {
public:
    Dialog(BaseObjectType *gobj); // fixme: remove this

    Dialog(const char *prefs_path, int verb_num = 0, const char *apply_label = NULL);

    virtual ~Dialog();

    virtual void onDesktopActivated (SPDesktop*);
    virtual void onShutdown();

    virtual void present();

    /** Hide and show dialogs */
    virtual void   onHideF12();
    virtual void   onShowF12();

    bool           _hiddenF12;
    bool           _user_hidden; // when it is closed by the user, to prevent repopping on f12

    void           read_geometry();
    void           save_geometry();

    const char           *_prefs_path;

    bool retransientize_suppress; // when true, do not retransientize (prevents races when switching new windows too fast)

protected:

    /**
     * Tooltips object for all descendants to use
     */
    Gtk::Tooltips tooltips;

    virtual void   on_response(int response_id);
    virtual bool   on_delete_event (GdkEventAny*);
    virtual void   _apply();
    virtual void   _close();

    static bool windowKeyPress( GtkWidget *widget, GdkEventKey *event );

    Inkscape::Selection*   _getSelection();

    sigc::connection _desktop_activated_connection;
    sigc::connection _dialogs_hidden_connection;
    sigc::connection _dialogs_unhidden_connection;
    sigc::connection _shutdown_connection;

private:
    Dialog(); // no constructor without params

    Dialog(Dialog const &d);            // no copy
    Dialog& operator=(Dialog const &d); // no assign
};

} // namespace Dialog
} // namespace UI
} // namespace Inkscape

#endif //INKSCAPE_DIALOG_H

/*
  Local Variables:
  mode:c++
  c-file-style:"stroustrup"
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
  indent-tabs-mode:nil
  fill-column:99
  End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :