Code

added import/export preferences category
[inkscape.git] / src / ui / dialog / inkscape-preferences.h
1 /**
2  * brief Inkscape Preferences dialog
3  *
4  * Authors:
5  *   Carl Hetherington
6  *   Marco Scholten
7  *   Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
8  *   Bruno Dilly <bruno.dilly@gmail.com>
9  *
10  * Copyright (C) 2004-2007 Authors
11  *
12  * Released under GNU GPL.  Read the file 'COPYING' for more information.
13  */
15 #ifndef INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
16 #define INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
18 #include <iostream>
19 #include <vector>
20 #include <gtkmm/table.h>
21 #include <gtkmm/comboboxtext.h>
22 #include <gtkmm/spinbutton.h>
23 #include <gtkmm/treestore.h>
24 #include <gtkmm/treeview.h>
25 #include <gtkmm/radiobutton.h>
26 #include <gtkmm/frame.h>
27 #include "ui/widget/preferences-widget.h"
28 #include <sigc++/sigc++.h>
29 #include <glibmm/i18n.h>
31 #include "dialog.h"
33 // UPDATE THIS IF YOU'RE ADDING PREFS PAGES.
34 // Otherwise the commands that open the dialog with the new page will fail.
36 enum {
37     PREFS_PAGE_MOUSE,
38     PREFS_PAGE_SCROLLING,
39     PREFS_PAGE_STEPS,
40     PREFS_PAGE_TOOLS,
41     PREFS_PAGE_TOOLS_SELECTOR,
42     PREFS_PAGE_TOOLS_NODE,
43     PREFS_PAGE_TOOLS_TWEAK,
44     PREFS_PAGE_TOOLS_ZOOM,
45     PREFS_PAGE_TOOLS_SHAPES,
46     PREFS_PAGE_TOOLS_SHAPES_RECT,
47     PREFS_PAGE_TOOLS_SHAPES_3DBOX,
48     PREFS_PAGE_TOOLS_SHAPES_ELLIPSE,
49     PREFS_PAGE_TOOLS_SHAPES_STAR,
50     PREFS_PAGE_TOOLS_SHAPES_SPIRAL,
51     PREFS_PAGE_TOOLS_PENCIL,
52     PREFS_PAGE_TOOLS_PEN,
53     PREFS_PAGE_TOOLS_CALLIGRAPHY,
54     PREFS_PAGE_TOOLS_PAINTBUCKET,
55     PREFS_PAGE_TOOLS_TEXT,
56     PREFS_PAGE_TOOLS_GRADIENT,
57     PREFS_PAGE_TOOLS_CONNECTOR,
58     PREFS_PAGE_TOOLS_DROPPER,
59     PREFS_PAGE_WINDOWS,
60     PREFS_PAGE_CLONES,
61     PREFS_PAGE_MASKS,
62     PREFS_PAGE_FILTERS,
63     PREFS_PAGE_TRANSFORMS,
64     PREFS_PAGE_SELECTING,
65     PREFS_PAGE_IMPORTEXPORT,
66     PREFS_PAGE_MISC
67 };
69 using namespace Inkscape::UI::Widget;
71 namespace Inkscape {
72 namespace UI {
73 namespace Dialog {
75 class InkscapePreferences : public Dialog {
76 public:
77     virtual ~InkscapePreferences();
79     static InkscapePreferences *create() {return new InkscapePreferences(); }
80     void present();
82 protected:
83     Gtk::Frame _page_frame;
84     Gtk::Label _page_title;
85     Gtk::TreeView _page_list;  
86     Glib::RefPtr<Gtk::TreeStore> _page_list_model;
88     //Pagelist model columns:
89     class PageListModelColumns : public Gtk::TreeModel::ColumnRecord
90     {
91     public:
92         PageListModelColumns()
93         { Gtk::TreeModelColumnRecord::add(_col_name); Gtk::TreeModelColumnRecord::add(_col_page); Gtk::TreeModelColumnRecord::add(_col_id); }
94         Gtk::TreeModelColumn<Glib::ustring> _col_name;
95         Gtk::TreeModelColumn<int> _col_id;
96         Gtk::TreeModelColumn<DialogPage*> _col_page;
97     };
98     PageListModelColumns _page_list_columns;
100     Gtk::TreeModel::Path _path_tools;
101     Gtk::TreeModel::Path _path_shapes;
103     DialogPage _page_mouse, _page_scrolling, _page_steps, _page_tools, _page_windows,
104         _page_clones, _page_mask, _page_transforms, _page_filters, _page_select, 
105         _page_importexport, _page_misc;
106     DialogPage _page_selector, _page_node, _page_zoom, _page_shapes, _page_pencil, _page_pen,
107                _page_calligraphy, _page_text, _page_gradient, _page_connector, _page_dropper;
108     DialogPage _page_rectangle, _page_3dbox, _page_ellipse, _page_star, _page_spiral, _page_paintbucket;
110     PrefSpinButton _mouse_sens, _mouse_thres;
111     PrefCheckButton _mouse_use_ext_input;
113     PrefSpinButton _scroll_wheel, _scroll_arrow_px, _scroll_arrow_acc, _scroll_auto_speed, _scroll_auto_thres;
114     PrefCheckButton _scroll_space;
115     PrefCheckButton _wheel_zoom;
117     PrefCombo       _steps_rot_snap;
118     PrefCheckButton _steps_compass;
119     PrefSpinButton  _steps_arrow, _steps_scale, _steps_inset, _steps_zoom;
121     PrefRadioButton _t_sel_trans_obj, _t_sel_trans_outl, _t_sel_cue_none, _t_sel_cue_mark,
122                     _t_sel_cue_box, _t_sel_bbox_visual, _t_sel_bbox_geometric;
124     PrefSpinButton  _t_pencil_tolerance;
126     PrefRadioButton _win_ontop_none, _win_ontop_normal, _win_ontop_agressive;
127     PrefRadioButton _win_save_geom_off, _win_save_geom, _win_save_geom_prefs;
128     PrefCheckButton _win_hide_task, _win_zoom_resize , _win_show_close;
130 // FIXME: Temporary Win32 special code to enable transient dialogs
131 #ifdef WIN32 
132     PrefCheckButton _win_ontop_win32;   
133 #endif    
135     PrefCheckButton _calligrapy_use_abs_size;
136     PrefCheckButton _calligrapy_keep_selected;
138     PrefCheckButton _connector_ignore_text;
139     
140     PrefRadioButton _clone_option_parallel, _clone_option_stay, _clone_option_transform,
141                     _clone_option_unlink, _clone_option_delete;
143     PrefCheckButton _mask_mask_on_top;
144     PrefCheckButton _mask_mask_remove;
146     PrefRadioButton _blur_quality_best, _blur_quality_better, _blur_quality_normal, _blur_quality_worse, _blur_quality_worst;
148     PrefCheckButton _trans_scale_stroke, _trans_scale_corner, _trans_gradient,_trans_pattern;
149     PrefRadioButton _trans_optimized, _trans_preserved;
151     PrefRadioButton _sel_all;
152     PrefRadioButton _sel_current;
153     PrefRadioButton _sel_recursive;
154     PrefCheckButton _sel_hidden, _sel_locked;
155     PrefCheckButton _sel_layer_deselects;
157     PrefSpinButton  _importexport_export, _misc_recent, _misc_simpl;
158     PrefCheckButton _importexport_imp_bitmap, _misc_comment, _misc_scripts;
159     PrefCheckButton _misc_small_toolbar;
160     PrefCombo       _misc_overs_bitmap;
161     PrefEntryButtonHBox _importexport_ocal_url;
162     PrefEntry       _importexport_ocal_username;
163     PrefEntry       _importexport_ocal_password;
165     int _max_dialog_width;
166     int _max_dialog_height;
167     int _sb_width;
168     DialogPage* _current_page;
170     Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, int id);
171     Gtk::TreeModel::iterator AddPage(DialogPage& p, Glib::ustring title, Gtk::TreeModel::iterator parent, int id);
172     bool SetMaxDialogSize(const Gtk::TreeModel::iterator& iter);
173     bool PresentPage(const Gtk::TreeModel::iterator& iter);
175     static void AddSelcueCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
176     static void AddGradientCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value);
177     static void AddNewObjectsStyle(DialogPage& p, const std::string& prefs_path);
179     void on_pagelist_selection_changed();
180     void initPageMouse();
181     void initPageScrolling();
182     void initPageSteps();
183     void initPageTools();
184     void initPageWindows();
185     void initPageClones();
186     void initPageMasks();
187     void initPageTransforms();
188     void initPageFilters();
189     void initPageSelecting();
190     void initPageImportExport();
191     void initPageMisc();
193 private:
194     InkscapePreferences();
195     InkscapePreferences(InkscapePreferences const &d);
196     InkscapePreferences operator=(InkscapePreferences const &d);
197 };
199 } // namespace Dialog
200 } // namespace UI
201 } // namespace Inkscape
203 #endif //INKSCAPE_UI_DIALOG_INKSCAPE_PREFERENCES_H
205 /* 
206   Local Variables:
207   mode:c++
208   c-file-style:"stroustrup"
209   c-file-offsets:((innamespace . 0)(inline-open . 0))
210   indent-tabs-mode:nil
211   fill-column:99
212   End:
213 */
214 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :