Code

Fix change in revision 9947 to be consistent with rest of the codebase.
[inkscape.git] / src / shape-editor.h
1 #ifndef __SHAPE_EDITOR_H__
2 #define __SHAPE_EDITOR_H__
4 /*
5  * Inkscape::ShapeEditor
6  *
7  * This is a container class which contains either knotholder (for shapes) or nodepath (for
8  * paths). It is attached to a single item so only one of these is active at a time.
9  *
10  * Authors:
11  *   bulia byak <buliabyak@users.sf.net>
12  *
13  */
15 #include <forward.h>
16 #include <2geom/forward.h>
18 namespace Inkscape { namespace NodePath { class Path; } }
19 namespace Inkscape { namespace XML { class Node; } }
21 class KnotHolder;
22 class SPDesktop;
23 class SPNodeContext;
24 class ShapeEditorsCollective;
25 class LivePathEffectObject;
27 #include "libnr/nr-path-code.h"
28 #include <2geom/point.h>
29 #include <boost/optional.hpp>
30 #include <vector>
32 enum SubType{
33     SH_NODEPATH,
34     SH_KNOTHOLDER
35 };
37 class ShapeEditor {
38 public:
40     ShapeEditor(SPDesktop *desktop);
41     ~ShapeEditor();
43     void set_item (SPItem *item, SubType type, bool keep_knotholder = false);
44     void unset_item (SubType type, bool keep_knotholder = false);
46     bool has_nodepath (); //((deprecated))
47     void update_knotholder (); //((deprecated))
49     bool has_local_change (SubType type);
50     void decrement_local_change (SubType type);
52     GList *save_nodepath_selection ();
53     void restore_nodepath_selection (GList *saved);
55     void nodepath_destroyed ();
57     bool has_selection ();
59     Inkscape::NodePath::Path *get_nodepath() {return NULL;} //((deprecated))
60     ShapeEditorsCollective *get_container() {return NULL;}
62     // this one is only public because it's called from non-C++ repr changed callback
63     void shapeeditor_event_attr_changed(gchar const *name);
65     bool knot_mouseover();
67 private:
68     bool has_knotholder ();
69     void reset_item (SubType type, bool keep_knotholder = true);
70     const SPItem *get_item (SubType type);
72     SPDesktop *desktop;
73     KnotHolder *knotholder;
74     Inkscape::XML::Node *knotholder_listener_attached_for;
75 };
77 #endif
80 /*
81   Local Variables:
82   mode:c++
83   c-file-style:"stroustrup"
84   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
85   indent-tabs-mode:nil
86   fill-column:99
87   End:
88 */
89 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :