Code

Rework dialog management. Use singleton behavior for dialogs when
[inkscape.git] / src / ui / dialog / document-properties.h
1 /** \file
2  * \brief  Document Properties dialog
3  *
4  * Authors:
5  *   Ralf Stephan <ralf@ark.in-berlin.de>
6  *   Bryce W. Harrington <bryce@bryceharrington.org>
7  *
8  * Copyright (C) 2006 Johan Engelen <johan@shouraizou.nl>
9  * Copyright (C) 2004, 2005 Authors
10  *
11  * Released under GNU GPL.  Read the file 'COPYING' for more information.
12  */
14 #ifndef INKSCAPE_UI_DIALOG_DOCUMENT_PREFERENCES_H
15 #define INKSCAPE_UI_DIALOG_DOCUMENT_PREFERENCES_H
17 #include <list>
18 #include <sigc++/sigc++.h>
19 #include <gtkmm/notebook.h>
20 #include <glibmm/i18n.h>
22 #include "ui/widget/notebook-page.h"
23 #include "ui/widget/page-sizer.h"
24 #include "ui/widget/registered-widget.h"
25 #include "ui/widget/registry.h"
26 #include "ui/widget/tolerance-slider.h"
27 #include "ui/widget/panel.h"
29 using namespace Inkscape::UI::Widget;
31 namespace Inkscape {
32     namespace XML {
33         class Node;
34     }
35     namespace UI {
36         namespace Dialog {
38 class DocumentProperties : public UI::Widget::Panel {
39 public:
40     void  update();
41     static DocumentProperties &getInstance();
42     static void destroy();
44     void  update_gridspage();
45     
46 protected:
47     void  build_page();
48     void  build_grid();
49     void  build_guides();
50     void  build_snap();
51     void  build_snap_dtls();
52     void  build_gridspage();
53     void  init();
54     virtual void  on_response (int);
56     void _handleDocumentReplaced(SPDesktop* desktop, SPDocument *document);
57     void _handleActivateDesktop(Inkscape::Application *application, SPDesktop *desktop);
58     void _handleDeactivateDesktop(Inkscape::Application *application, SPDesktop *desktop);
60     Gtk::Tooltips _tt;
61     Gtk::Notebook  _notebook;
63     NotebookPage   _page_page, _page_guides;
64     NotebookPage   _page_snap, _page_snap_dtls;
65     Gtk::VBox      _grids_vbox;
67     //---------------------------------------------------------------
68     RegisteredCheckButton _rcb_canb, _rcb_bord, _rcb_shad;
69     RegisteredColorPicker _rcp_bg, _rcp_bord;
70     RegisteredUnitMenu    _rum_deflt;
71     PageSizer             _page_sizer;
72     //---------------------------------------------------------------
73     RegisteredCheckButton _rcbgrid;
74     RegisteredUnitMenu    _rums;
75     //---------------------------------------------------------------
76     RegisteredCheckButton _rcb_sgui, _rcbsng;
77     RegisteredUnitMenu    _rum_gusn;
78     RegisteredColorPicker _rcp_gui, _rcp_hgui;
79     //---------------------------------------------------------------
80     RegisteredCheckButton _rcbsnbb, _rcbsnn, _rcbsnop;
81     RegisteredCheckButton _rcbsnon, _rcbsnbbp, _rcbsnbbn;
82     RegisteredUnitMenu    _rumso;
83     ToleranceSlider       _rsu_sno, _rsu_sn, _rsu_gusn;
84     RegisteredRadioButtonPair _rrb_pix;
85     //---------------------------------------------------------------
86     RegisteredCheckButton _rcbic;
87     RegisteredCheckButton _rcbsigg, _rcbsils;
88     //---------------------------------------------------------------
89     Gtk::Notebook   _grids_notebook;
90     Gtk::HBox       _grids_hbox_crea;
91     Gtk::Label      _grids_label_crea;
92     Gtk::Button     _grids_button_new;
93     Gtk::Button     _grids_button_remove;
94     Gtk::ComboBoxText _grids_combo_gridtype;
95     Gtk::Label      _grids_label_def;
96     Gtk::HBox       _grids_space;
97     //---------------------------------------------------------------
99     gchar const *_prefs_path;
100     Registry _wr;
102 private:
103     DocumentProperties();
104     virtual ~DocumentProperties();
106     // callback methods for buttons on grids page.
107     void onNewGrid();
108     void onRemoveGrid();    
109 };
111 } // namespace Dialog
112 } // namespace UI
113 } // namespace Inkscape
115 #endif // INKSCAPE_UI_DIALOG_DOCUMENT_PREFERENCES_H
117 /*
118   Local Variables:
119   mode:c++
120   c-file-style:"stroustrup"
121   c-file-offsets:((innamespace . 0)(inline-open . 0))
122   indent-tabs-mode:nil
123   fill-column:99
124   End:
125 */
126 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :