Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
node-observer.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
/*
5 * Authors:
6 * MenTaLguY <mental@rydia.net>
7 * Krzysztof KosiƄski <tweenk.pl@gmail.com> (documentation)
8 *
9 * Copyright (C) 2018 Authors
10 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
11 */
15#ifndef SEEN_INKSCAPE_XML_NODE_OBSERVER_H
16#define SEEN_INKSCAPE_XML_NODE_OBSERVER_H
17
18#include "util/share.h"
19typedef unsigned int GQuark;
20
21#ifndef INK_UNUSED
22#define INK_UNUSED(x) ((void)(x))
23#endif // INK_UNUSED
24
25namespace Inkscape {
26namespace XML {
27
28class Node;
29
51protected:
52 /* the constructor is protected to prevent instantiation */
53 NodeObserver() = default;
54public:
55 virtual ~NodeObserver() = default;
56
57 // FIXME: somebody needs to learn what "pure virtual" means
58
69 virtual void notifyChildAdded(Node &node, Node &child, Node *prev) {
70 INK_UNUSED(node);
71 INK_UNUSED(child);
72 INK_UNUSED(prev);
73 }
74
85 virtual void notifyChildRemoved(Node &node, Node &child, Node *prev) {
86 INK_UNUSED(node);
87 INK_UNUSED(child);
88 INK_UNUSED(prev);
89 }
90
105 Node *old_prev, Node *new_prev) {
106 INK_UNUSED(node);
107 INK_UNUSED(child);
108 INK_UNUSED(old_prev);
109 INK_UNUSED(new_prev);
110 }
111
123 Util::ptr_shared old_content,
124 Util::ptr_shared new_content) {
125 INK_UNUSED(node);
126 INK_UNUSED(old_content);
127 INK_UNUSED(new_content);
128 }
129
143 Util::ptr_shared old_value,
144 Util::ptr_shared new_value) {
145 INK_UNUSED(node);
146 INK_UNUSED(name);
147 INK_UNUSED(old_value);
148 INK_UNUSED(new_value);
149 }
150
160 virtual void notifyElementNameChanged(Node& node, GQuark old_name, GQuark new_name) {
161 INK_UNUSED(node);
162 INK_UNUSED(old_name);
163 INK_UNUSED(new_name);
164 }
165
166};
167
168} // namespace XML
169} // namespace Inkscape
170
171#endif
172/*
173 Local Variables:
174 mode:c++
175 c-file-style:"stroustrup"
176 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
177 indent-tabs-mode:nil
178 fill-column:99
179 End:
180*/
181// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
Interface for XML node observers.
virtual void notifyElementNameChanged(Node &node, GQuark old_name, GQuark new_name)
Element name change callback.
virtual void notifyAttributeChanged(Node &node, GQuark name, Util::ptr_shared old_value, Util::ptr_shared new_value)
Attribute change callback.
virtual void notifyContentChanged(Node &node, Util::ptr_shared old_content, Util::ptr_shared new_content)
Content change callback.
virtual ~NodeObserver()=default
virtual void notifyChildOrderChanged(Node &node, Node &child, Node *old_prev, Node *new_prev)
Child order change callback.
virtual void notifyChildRemoved(Node &node, Node &child, Node *prev)
Child removal callback.
virtual void notifyChildAdded(Node &node, Node &child, Node *prev)
Child addition callback.
Interface for refcounted XML nodes.
Definition node.h:80
Inkscape::XML::Node * node
Helper class to stream background task notifications as a series of messages.
unsigned int GQuark
Ocnode * child[8]
Definition quantize.cpp:33
guint32 GQuark
Glib::ustring name
Definition toolbars.cpp:55