Code

Some consistency cleanup for descriptions.
[inkscape.git] / src / snap-preferences.h
1 #ifndef SNAPPREFERENCES_H_
2 #define SNAPPREFERENCES_H_
4 /**
5  *  \file snap-preferences.cpp
6  *  \brief Storing of snapping preferences
7  *
8  * Authors:
9  *   Diederik van Lierop <mail@diedenrezi.nl>
10  *
11  * Copyright (C) 2008 Authors
12  *
13  * Released under GNU GPL, read the file 'COPYING' for more information
14  */
16 namespace Inkscape
17 {
19 class SnapPreferences
20 {
21 public:
22         SnapPreferences();
24         /// Point types to snap.
25     typedef int PointType;
26     static const PointType SNAPPOINT_NODE;
27     static const PointType SNAPPOINT_BBOX;
28     static const PointType SNAPPOINT_GUIDE;
30     void setSnapModeBBox(bool enabled);
31     void setSnapModeNode(bool enabled);
32     void setSnapModeGuide(bool enabled);
33     bool getSnapModeBBox() const;
34     bool getSnapModeNode() const;
35     bool getSnapModeBBoxOrNodes() const;
36     bool getSnapModeAny() const;
37     bool getSnapModeGuide() const;
39     void setSnapIntersectionGG(bool enabled) {_intersectionGG = enabled;}
40     void setSnapIntersectionCS(bool enabled) {_intersectionCS = enabled;}
41     void setSnapSmoothNodes(bool enabled) {_smoothNodes = enabled;}
42     void setSnapLineMidpoints(bool enabled) {_line_midpoints = enabled;}
43     void setSnapObjectMidpoints(bool enabled) {_object_midpoints = enabled;}
44     void setSnapBBoxEdgeMidpoints(bool enabled) {_bbox_edge_midpoints = enabled;}
45         void setSnapBBoxMidpoints(bool enabled) {_bbox_midpoints = enabled;}
46     bool getSnapIntersectionGG() const {return _intersectionGG;}
47     bool getSnapIntersectionCS() const {return _intersectionCS;}
48     bool getSnapSmoothNodes() const {return _smoothNodes;}
49     bool getSnapLineMidpoints() const {return _line_midpoints;}
50     bool getSnapObjectMidpoints() const {return _object_midpoints;}
51     bool getSnapBBoxEdgeMidpoints() const {return _bbox_edge_midpoints;}
52         bool getSnapBBoxMidpoints() const {return _bbox_midpoints;}
54         void setSnapToGrids(bool enabled) {_snap_to_grids = enabled;}
55     bool getSnapToGrids() const {return _snap_to_grids;}
57     void setSnapToGuides(bool enabled) {_snap_to_guides = enabled;}
58         bool getSnapToGuides() const {return _snap_to_guides;}
60     void setIncludeItemCenter(bool enabled) {_include_item_center = enabled;}
61     bool getIncludeItemCenter() const {return _include_item_center;}
63     void setSnapEnabledGlobally(bool enabled) {_snap_enabled_globally = enabled;}
64     bool getSnapEnabledGlobally() const {return _snap_enabled_globally;}
66     void setSnapPostponedGlobally(bool postponed) {_snap_postponed_globally = postponed;}
67     bool getSnapPostponedGlobally() const {return _snap_postponed_globally;}
69     void setSnapFrom(PointType t, bool s);
70     bool getSnapFrom(PointType t) const;
72     // These will only be used for the object snapper
73     void setSnapToItemNode(bool s) {_snap_to_itemnode = s;}
74         bool getSnapToItemNode() const {return _snap_to_itemnode;}
75         void setSnapToItemPath(bool s) {_snap_to_itempath = s;}
76         bool getSnapToItemPath() const {return _snap_to_itempath;}
77         void setSnapToBBoxNode(bool s) {_snap_to_bboxnode = s;}
78         bool getSnapToBBoxNode() const {return _snap_to_bboxnode;}
79         void setSnapToBBoxPath(bool s) {_snap_to_bboxpath = s;}
80         bool getSnapToBBoxPath() const {return _snap_to_bboxpath;}
81         void setSnapToPageBorder(bool s) {_snap_to_page_border = s;}
82         bool getSnapToPageBorder() const {return _snap_to_page_border;}
83         bool getStrictSnapping() const {return _strict_snapping;}
85 private:
86     bool _include_item_center; //If true, snapping nodes will also snap the item's center
87     bool _intersectionGG; //Consider snapping to intersections of grid and guides
88     bool _intersectionCS; //Consider snapping to intersections of curves
89     bool _smoothNodes;
90     bool _line_midpoints;
91     bool _object_midpoints; // the midpoint of shapes (e.g. a circle, rect, polygon) or of any other shape (at [h/2, w/2])
92     bool _bbox_edge_midpoints;
93         bool _bbox_midpoints;
94         bool _snap_to_grids;
95         bool _snap_to_guides;
96     bool _snap_enabled_globally; // Toggles ALL snapping
97     bool _snap_postponed_globally; // Hold all snapping temporarily when the mouse is moving fast
98     PointType _snap_from; ///< bitmap of point types that we will snap from
100     // These will only be used for the object snapper
101     bool _snap_to_itemnode;
102         bool _snap_to_itempath;
103         bool _snap_to_bboxnode;
104         bool _snap_to_bboxpath;
105         bool _snap_to_page_border;
106         //If enabled, then bbox corners will only snap to bboxes,
107         //and nodes will only snap to nodes and paths. We will not
108         //snap bbox corners to nodes, or nodes to bboxes.
109         //(snapping to grids and guides is not affected by this)
110         bool _strict_snapping;
111 };
114 #endif /*SNAPPREFERENCES_H_*/
116 /*
117   Local Variables:
118   mode:c++
119   c-file-style:"stroustrup"
120   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
121   indent-tabs-mode:nil
122   fill-column:99
123   End:
124 */
125 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :