Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
sp-tref-reference.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2#ifndef SEEN_SP_TREF_REFERENCE_H
3#define SEEN_SP_TREF_REFERENCE_H
4
5/*
6 * The reference corresponding to href of <tref> element.
7 *
8 * This file was created based on sp-use-reference.h
9 *
10 * Copyright (C) 2007 Gail Banaszkiewicz
11 * Abhishek Sharma
12 *
13 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
14 */
15
16#include <cstddef>
17#include <memory>
18#include <sigc++/sigc++.h>
19
20#include "sp-item.h"
21#include "uri-references.h"
22
23#include "util/share.h"
24#include "xml/node-observer.h"
25#include "xml/subtree.h"
26
27typedef unsigned int GQuark;
28
31public:
34 }
35
36 ~SPTRefReference() override {
37 if (subtreeObserved) {
38 subtreeObserved->removeObserver(*this);
39 }
40 }
41
42 SPItem *getObject() const {
43 return static_cast<SPItem *>(URIReference::getObject());
44 }
45
46 void updateObserver();
47
48 // Node Observer Functions
52 Inkscape::XML::Node *old_prev, Inkscape::XML::Node *new_prev) override;
55 Inkscape::Util::ptr_shared new_content) override;
58 Inkscape::Util::ptr_shared new_value) override;
59
60protected:
61 bool _acceptObject(SPObject * obj) const override;
62
63 std::unique_ptr<Inkscape::XML::Subtree> subtreeObserved;
64};
65
66#endif // !SEEN_SP_TREF_REFERENCE_H
67
68/*
69 Local Variables:
70 mode:c++
71 c-file-style:"stroustrup"
72 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
73 indent-tabs-mode:nil
74 fill-column:99
75 End:
76*/
77// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
A class encapsulating a reference to a particular URI; observers can be notified when the URI comes t...
URIReference(SPObject *owner)
Constructor.
Interface for XML node observers.
Interface for refcounted XML nodes.
Definition node.h:80
Base class for visual SVG elements.
Definition sp-item.h:109
SPObject is an abstract base class of all of the document nodes at the SVG document level.
Definition sp-object.h:160
void notifyChildRemoved(Inkscape::XML::Node &node, Inkscape::XML::Node &child, Inkscape::XML::Node *prev) override
Child removal callback.
void notifyChildAdded(Inkscape::XML::Node &node, Inkscape::XML::Node &child, Inkscape::XML::Node *prev) override
Child addition callback.
void notifyAttributeChanged(Inkscape::XML::Node &node, GQuark name, Inkscape::Util::ptr_shared old_value, Inkscape::Util::ptr_shared new_value) override
Attribute change callback.
std::unique_ptr< Inkscape::XML::Subtree > subtreeObserved
SPTRefReference(SPObject *owner)
~SPTRefReference() override
SPItem * getObject() const
void notifyChildOrderChanged(Inkscape::XML::Node &node, Inkscape::XML::Node &child, Inkscape::XML::Node *old_prev, Inkscape::XML::Node *new_prev) override
Child order change callback.
void notifyContentChanged(Inkscape::XML::Node &node, Inkscape::Util::ptr_shared old_content, Inkscape::Util::ptr_shared new_content) override
Content change callback.
bool _acceptObject(SPObject *obj) const override
Inkscape::XML::Node * node
Interface for XML node observers.
Ocnode * child[8]
Definition quantize.cpp:33
Some things pertinent to all visible shapes: SPItem, SPItemView, SPItemCtx.
guint32 GQuark
unsigned int GQuark
Object representing a subtree of the XML document.
Glib::ustring name
Definition toolbars.cpp:55