Typed DOM mutation helper used by SVGDocument::withWriteAccess.
More...
#include "donner/svg/SVGDocument.h"
|
| | SVGDocumentMutation (SVGDocument document, DocumentWriteAccess &access) |
| | Create a mutation helper over an active document write access.
|
|
| SVGDocumentMutation (const SVGDocumentMutation &other)=delete |
| | Copying mutation helpers is not allowed.
|
|
| SVGDocumentMutation (SVGDocumentMutation &&other) noexcept=delete |
| | Moving mutation helpers is not allowed.
|
|
SVGDocumentMutation & | operator= (const SVGDocumentMutation &other)=delete |
| | Copying mutation helpers is not allowed.
|
|
SVGDocumentMutation & | operator= (SVGDocumentMutation &&other) noexcept=delete |
| | Moving mutation helpers is not allowed.
|
|
DocumentWriteAccess & | access () const |
| | Get the raw write access for advanced ECS mutation.
|
| void | setCanvasSize (int width, int height) |
| | Set the canvas size.
|
|
void | useAutomaticCanvasSize () |
| | Automatically determine the canvas size from the root <svg> element.
|
| void | setAttribute (SVGElement element, const xml::XMLQualifiedNameRef &name, std::string_view value) |
| | Set an element attribute.
|
| void | removeAttribute (SVGElement element, const xml::XMLQualifiedNameRef &name) |
| | Remove an element attribute.
|
| void | insertBefore (SVGElement parent, const SVGElement &newNode, std::optional< SVGElement > referenceNode) |
| | Insert newNode into parent before referenceNode.
|
| void | appendChild (SVGElement parent, const SVGElement &child) |
| | Append child to parent.
|
| void | replaceChild (SVGElement parent, const SVGElement &newChild, const SVGElement &oldChild) |
| | Replace oldChild with newChild under parent.
|
| void | removeChild (SVGElement parent, const SVGElement &child) |
| | Remove child from parent.
|
| void | remove (SVGElement element) |
| | Remove element from its parent, if it has one.
|
Typed DOM mutation helper used by SVGDocument::withWriteAccess.
◆ SVGDocumentMutation()
Create a mutation helper over an active document write access.
- Parameters
-
| document | Document facade being mutated. |
| access | Active write access for the document. |
◆ appendChild()
Append child to parent.
- Parameters
-
| parent | Parent element to mutate. |
| child | Child to append. |
◆ insertBefore()
Insert newNode into parent before referenceNode.
- Parameters
-
| parent | Parent element to mutate. |
| newNode | Node to insert. |
| referenceNode | Existing child to insert before, or std::nullopt. |
◆ remove()
| void donner::svg::SVGDocumentMutation::remove |
( |
SVGElement | element | ) |
|
Remove element from its parent, if it has one.
- Parameters
-
| element | Element to remove. |
◆ removeAttribute()
Remove an element attribute.
- Parameters
-
| element | Element to mutate. |
| name | Attribute name. |
◆ removeChild()
Remove child from parent.
- Parameters
-
| parent | Parent element to mutate. |
| child | Child to remove. |
◆ replaceChild()
Replace oldChild with newChild under parent.
- Parameters
-
| parent | Parent element to mutate. |
| newChild | Child to insert. |
| oldChild | Existing child to remove. |
◆ setAttribute()
Set an element attribute.
- Parameters
-
| element | Element to mutate. |
| name | Attribute name. |
| value | Attribute value. |
◆ setCanvasSize()
| void donner::svg::SVGDocumentMutation::setCanvasSize |
( |
int | width, |
|
|
int | height ) |
Set the canvas size.
- Parameters
-
| width | Width of the canvas, in pixels. |
| height | Height of the canvas, in pixels. |
The documentation for this class was generated from the following file: