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-2008 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 #include "xml/helper-observer.h"
31 using namespace Inkscape::UI::Widget;
33 namespace Inkscape {
34 namespace UI {
35 namespace Dialog {
37 class DocumentProperties : public UI::Widget::Panel {
38 public:
39 void update();
40 static DocumentProperties &getInstance();
41 static void destroy();
43 void update_gridspage();
45 protected:
46 void build_page();
47 void build_grid();
48 void build_guides();
49 void build_snap();
50 void build_gridspage();
51 #if ENABLE_LCMS
52 void build_cms();
53 #endif // ENABLE_LCMS
54 void build_scripting();
55 void init();
57 virtual void on_response (int);
58 #if ENABLE_LCMS
59 void populate_available_profiles();
60 void populate_linked_profiles_box();
61 void linkSelectedProfile();
62 void removeSelectedProfile();
63 void linked_profiles_list_button_release(GdkEventButton* event);
64 void cms_create_popup_menu(Gtk::Widget& parent, sigc::slot<void> rem);
65 #endif // ENABLE_LCMS
67 void external_scripts_list_button_release(GdkEventButton* event);
68 void populate_external_scripts_box();
69 void addExternalScript();
70 void removeExternalScript();
71 void scripting_create_popup_menu(Gtk::Widget& parent, sigc::slot<void> rem);
73 void _handleDocumentReplaced(SPDesktop* desktop, SPDocument *document);
74 void _handleActivateDesktop(Inkscape::Application *application, SPDesktop *desktop);
75 void _handleDeactivateDesktop(Inkscape::Application *application, SPDesktop *desktop);
77 Inkscape::XML::SignalObserver _emb_profiles_observer, _ext_scripts_observer;
78 Gtk::Tooltips _tt;
79 Gtk::Notebook _notebook;
81 NotebookPage _page_page, _page_guides;
82 NotebookPage _page_snap, _page_cms, _page_scripting;
83 Gtk::VBox _grids_vbox;
85 Registry _wr;
86 //---------------------------------------------------------------
87 RegisteredCheckButton _rcb_canb, _rcb_bord, _rcb_shad;
88 RegisteredColorPicker _rcp_bg, _rcp_bord;
89 RegisteredUnitMenu _rum_deflt;
90 PageSizer _page_sizer;
91 //---------------------------------------------------------------
92 RegisteredCheckButton _rcb_sgui, _rcbsng;
93 RegisteredColorPicker _rcp_gui, _rcp_hgui;
94 //---------------------------------------------------------------
95 ToleranceSlider _rsu_sno, _rsu_sn, _rsu_gusn;
96 //---------------------------------------------------------------
97 Gtk::Menu _menu;
98 Gtk::OptionMenu _combo_avail;
99 Gtk::Button _link_btn;
100 class LinkedProfilesColumns : public Gtk::TreeModel::ColumnRecord
101 {
102 public:
103 LinkedProfilesColumns()
104 { add(nameColumn); add(previewColumn); }
105 Gtk::TreeModelColumn<Glib::ustring> nameColumn;
106 Gtk::TreeModelColumn<Glib::ustring> previewColumn;
107 };
108 LinkedProfilesColumns _LinkedProfilesListColumns;
109 Glib::RefPtr<Gtk::ListStore> _LinkedProfilesListStore;
110 Gtk::TreeView _LinkedProfilesList;
111 Gtk::ScrolledWindow _LinkedProfilesListScroller;
112 Gtk::Menu _EmbProfContextMenu;
114 //---------------------------------------------------------------
115 Gtk::Button _add_btn;
116 class ExternalScriptsColumns : public Gtk::TreeModel::ColumnRecord
117 {
118 public:
119 ExternalScriptsColumns()
120 { add(filenameColumn); }
121 Gtk::TreeModelColumn<Glib::ustring> filenameColumn;
122 };
123 ExternalScriptsColumns _ExternalScriptsListColumns;
124 Glib::RefPtr<Gtk::ListStore> _ExternalScriptsListStore;
125 Gtk::TreeView _ExternalScriptsList;
126 Gtk::ScrolledWindow _ExternalScriptsListScroller;
127 Gtk::Menu _ExternalScriptsContextMenu;
128 Gtk::Entry _script_entry;
129 //---------------------------------------------------------------
131 Gtk::Notebook _grids_notebook;
132 Gtk::HBox _grids_hbox_crea;
133 Gtk::Label _grids_label_crea;
134 Gtk::Button _grids_button_new;
135 Gtk::Button _grids_button_remove;
136 Gtk::ComboBoxText _grids_combo_gridtype;
137 Gtk::Label _grids_label_def;
138 Gtk::HBox _grids_space;
139 //---------------------------------------------------------------
141 Gtk::HBox& _createPageTabLabel(const Glib::ustring& label, const char *label_image);
143 private:
144 DocumentProperties();
145 virtual ~DocumentProperties();
147 // callback methods for buttons on grids page.
148 void onNewGrid();
149 void onRemoveGrid();
150 };
152 } // namespace Dialog
153 } // namespace UI
154 } // namespace Inkscape
156 #endif // INKSCAPE_UI_DIALOG_DOCUMENT_PREFERENCES_H
158 /*
159 Local Variables:
160 mode:c++
161 c-file-style:"stroustrup"
162 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
163 indent-tabs-mode:nil
164 fill-column:99
165 End:
166 */
167 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :