/*
5 * Authors: see git history
7 * Copyright (C) 2018 Authors
8 * Released under GNU GPL v2+, read the file
'COPYING' for more information.
11#ifndef SEEN_INKSCAPE_XML_NODE_H
12#error You have included xml/simple-node.h in your document, which is an implementation. Chances are that you want xml/node.h. Please fix that.
15#ifndef SEEN_INKSCAPE_XML_SIMPLE_NODE_H
16#define SEEN_INKSCAPE_XML_SIMPLE_NODE_H
39 char const *
name()
const override;
85 char const *
content()
const override;
89 bool equal(
Node const *other,
bool recursive,
bool skip_ids =
false)
override;
90 void mergeFrom(
Node const *src,
char const *
key,
bool extension =
false,
bool clean =
false)
override;
TODO: insert short description here.
Cairo::RefPtr< Cairo::Region > clean
A base class for objects for whom the normal new and delete operators should use the garbage-collecte...
An observer that relays notifications to multiple other observers.
void add(NodeObserver &observer)
Add an observer to the list.
void remove(NodeObserver &observer)
Remove an observer from the list.
Interface for XML node observers.
Interface for refcounted XML nodes.
Default implementation of the XML node stored in memory.
void cleanOriginal(Node *src, gchar const *key) override
void addObserver(NodeObserver &observer) override
Add an object that will be notified of the changes to this node.
Node const * parent() const override
Node const * lastChild() const override
bool _cached_positions_valid
Node * next() override
Get the next sibling of this node.
Inkscape::Util::ptr_shared _content
bool matchAttributeName(char const *partial_name) const override
Check whether this node has any attribute that matches a string.
Node * firstChild() override
Get the first child of this node.
void removeObserver(NodeObserver &observer) override
Remove an object from the list of observers.
void recursivePrintTree(unsigned level=0) override
Node * nthChild(unsigned index) override
Get the child of this node with a given index.
void setCodeUnsafe(int code) override
Set the integer GQuark code for the name of the node.
void setPosition(int pos) override
Set the position of this node in parent's child order.
Document const * document() const override
SimpleNode * _first_child
Node * parent() override
Get the parent of this node.
bool equal(Node const *other, bool recursive, bool skip_ids=false) override
Compare 2 nodes equality.
void appendChild(Node *child) override
Append a node as the last child of this node.
int code() const override
Get the integer code corresponding to the node's name.
const AttributeVector & attributeList() const override
Get a list of the node's attributes.
char const * content() const override
Get the content of a text or comment node.
void operator=(Node const &)
void removeChild(Node *child) override
Remove a child of this node.
CompositeNodeObserver _subtree_observers
CompositeNodeObserver _observers
AttributeVector _attributes
Node const * firstChild() const override
unsigned _cached_position
Node const * nthChild(unsigned index) const override
char const * name() const override
Get the name of the element node.
unsigned _childPosition(SimpleNode const &child) const
void synthesizeEvents(NodeObserver &observer) override
Generate a sequence of events corresponding to the state of this node.
void setAttributeImpl(char const *key, char const *value) override
unsigned childCount() const override
Get the number of children of this node.
Node const * root() const override
void mergeFrom(Node const *src, char const *key, bool extension=false, bool clean=false) override
Merge all children of another node with the current.
Node * lastChild() override
Get the last child of this node.
Node const * prev() const override
void addChild(Node *child, Node *ref) override
Insert another node as a child of this node.
void addSubtreeObserver(NodeObserver &observer) override
Add an object that will be notified of the changes to this node and its descendants.
unsigned position() const override
Get the index of this node in parent's child order.
char const * attribute(char const *key) const override
Get the string representation of a node's attribute.
Node * root() override
Get the root node of this node's document.
void setContent(char const *value) override
Set the content of a text or comment node.
Document * document() override
Get the node's associated document.
void _setParent(SimpleNode *parent)
void changeOrder(Node *child, Node *ref) override
Move a given node in this node's child order.
void removeSubtreeObserver(NodeObserver &observer) override
Remove an object from the subtree observers list.
Node const * next() const override
NodeObserver const * observer
Inkscape::XML::CompositeNodeObserver - combine multiple observers.
std::vector< AttributeRecord, Inkscape::GC::Alloc< AttributeRecord > > AttributeVector
Helper class to stream background task notifications as a series of messages.
static cairo_user_data_key_t key
Interface for XML documents.