Mako 8.2.0 API
MakoCore SDK API Documentation
Loading...
Searching...
No Matches
idomnode.h
Go to the documentation of this file.
1/*
2* Copyright (C) 2007-2025 Global Graphics Software Ltd. All rights reserved.
3*/
4
13
14#ifndef IDOMNODE_H
15#define IDOMNODE_H
16
17#include <edl/iedlobject.h>
18#include <edl/iedlenum.h>
19#include <edl/edltypes.h>
20#include <edl/idomid.h>
21#include <edl/edlproperty.h>
22#include <edl/edlgeom.h>
23#include <edl/edlvector.h>
24
25
27
65
66class IDOMNode;
69
82{
83 public:
87 virtual ~IDOMNodeFlags ()
88 {}
89
112
118 virtual bool get(uint32 position) const = 0;
119
125 virtual void set(uint32 position, bool value = true) = 0;
126
127};
128
129
138class IDOMNode : public IEDLObject
139{
140 public:
144 virtual ~IDOMNode()
145 {}
146
151 virtual DOMid getDOMid() const = 0;
152
157 virtual void setDOMid(DOMid id) = 0;
158
163 virtual eDOMNodeType getNodeType() const = 0;
164
176 virtual bool getProperty(const EDLSysString &propertyName, PValue &propertyValue) const = 0;
177
188 virtual void setProperty(const EDLSysString &propertyName, const PValue &propertyValue) = 0;
189
199 virtual void removeProperty(const EDLSysString &propertyName) = 0;
200
206 virtual IEDLSysStringCollectionEnumPtr getPropertyCollectionEnum() = 0;
207
212 virtual bool hasChildNodes() const = 0;
213
218 virtual IDOMNodePtr getParentNode () const = 0;
219
224 virtual IDOMNodePtr getFirstChild () const = 0;
225
230 virtual IDOMNodePtr getLastChild () const = 0;
231
238 virtual IDOMNodePtr getNextChild (const IDOMNodePtr &child) const = 0;
239
246 virtual IDOMNodePtr getPreviousChild (const IDOMNodePtr &child) const = 0;
247
252 virtual IDOMNodePtr getPreviousSibling () const = 0;
253
258 virtual IDOMNodePtr getNextSibling () const = 0;
259
264 virtual void appendChild (const IDOMNodePtr &child) = 0;
265
273 virtual void insertChild (const IDOMNodePtr &ptrPreviousSibling, const IDOMNodePtr &child, bool bCheckComplete = true) = 0;
274
284 virtual IDOMNodePtr extractChild(const IDOMNodePtr &child) = 0;
285
291 virtual void replaceChild(const IDOMNodePtr &oldChild, const IDOMNodePtr &newChild) = 0;
292
299 virtual bool isComplete() const = 0;
300
304 virtual void setComplete() = 0;
305
310 virtual IDOMNodeFlags * getFlags() = 0;
311
316 virtual void setParentNode (const IDOMNodePtr &ptrParent) = 0;
317
322 virtual void setPreviousSibling(const IDOMNodePtr &ptrPreviousSibling) = 0;
323
328 virtual void setNextSibling (const IDOMNodePtr &ptrNextSibling) = 0;
329
335 virtual bool isAncestor (const IDOMNodePtr &ptrCandidate) = 0;
336
337 // Bounds
355 virtual FRect getBounds(bool applyTransform = true, bool applyClip = true)
356 {
357 FRect bounds;
358
359 // Get the bounds of the children
360 IDOMNodePtr node = getFirstChild();
361 while (node)
362 {
363 FRect childBounds = node->getBounds();
364 bounds.unionRect(childBounds);
365 node = node->getNextSibling();
366 }
367 return bounds;
368 }
369
375 virtual bool copyNodeData(IDOMNode *pSourceNode) = 0;
376
383 virtual IDOMNodePtr cloneNode(IEDLClassFactory *pFactory) const = 0;
384
391 virtual IDOMNodePtr cloneTree(IEDLClassFactory *pFactory) const = 0;
392
399 virtual void cloneTreeAndAppend(IEDLClassFactory *pFactory, const IDOMNodePtr &dest) const = 0;
400
405 virtual void completeTree() = 0;
406
410 virtual void removeCompleteFlagFromTree() = 0;
411
421 virtual void findChildrenOfType(eDOMNodeType type, CDOMNodeVect &nodes, bool searchForms = false) = 0;
422
423 typedef bool (*WalkTreeFunc)(void *priv, const IDOMNodePtr &node);
424
445 virtual void walkTree(WalkTreeFunc func, void *priv, bool descendIntoBrushes = false, bool descendIntoForms = false) = 0;
446
453 static EDL_API FMatrix effectiveTransformationOfNode(const IDOMNodePtr &node);
454
455 typedef void (*NodeDeleteFunc)(const IDOMNode *node, void *priv);
456
462 virtual void notifyOnDestruct(NodeDeleteFunc func, void *priv) = 0;
463
469 virtual void unregisterNotify(NodeDeleteFunc func, void *priv) = 0;
470};
471#define edlobj2IDOMNode(src) edl_cast((IDOMNode *)NULL, src)
472
473template <class T, eDOMNodeType NT>
474static inline CSmartPtr<T> dom2NodeType(const IDOMNodePtr &src)
475{
476 if (src && src->getNodeType() == NT)
477 {
478 return CSmartPtr<T>(static_cast<T *>((IDOMNode *)src), true);
479 }
480 else
481 {
482 return CSmartPtr<T>();
483 }
484}
485
487
488#endif /* IDOMNODE_H */
489
Definition edlvector.h:30
A collection of bit flags used to signal various conditions of the node. For example,...
Definition idomnode.h:82
virtual ~IDOMNodeFlags()
Virtual destructor.
Definition idomnode.h:87
virtual bool get(uint32 position) const =0
Tests whether the bit at a specified position is set to 1.
virtual void set(uint32 position, bool value=true)=0
Sets the bit at the specified position to the specified value.
DOMNodeFlags
DOM node flag enumeration.
Definition idomnode.h:98
@ eNodeRenderFlag
Definition idomnode.h:99
@ eNodeUnpackFlag
Definition idomnode.h:101
@ eNodeSelectedFlag
Definition idomnode.h:108
@ eNodeExcludeFromRender
Definition idomnode.h:105
@ eNodeDirtyFlag
Definition idomnode.h:102
@ eNodeInterestingFlag
Definition idomnode.h:103
@ eNodeUserFlag
Definition idomnode.h:109
Abstract class providing the interface to basic DOM node functionality. IDOMNode is the base class fo...
Definition idomnode.h:139
virtual bool isComplete() const =0
Signals the completeness of the node. A complete node is one that has no more children to be added ...
virtual IDOMNodePtr getPreviousChild(const IDOMNodePtr &child) const =0
Gets the child node which precedes the node passed in.
virtual void setParentNode(const IDOMNodePtr &ptrParent)=0
Sets the parent node.
virtual void completeTree()=0
Mark the entire tree from this point as complete. You should not ordinarily need to call this functio...
virtual void insertChild(const IDOMNodePtr &ptrPreviousSibling, const IDOMNodePtr &child, bool bCheckComplete=true)=0
Insert a child node after ptrPreviousSibling.
virtual bool isAncestor(const IDOMNodePtr &ptrCandidate)=0
Function tests whether a candidate node is a descendant of the node.
virtual IEDLSysStringCollectionEnumPtr getPropertyCollectionEnum()=0
Retrieves a navigable list of the property names stored on this node.
static EDL_API FMatrix effectiveTransformationOfNode(const IDOMNodePtr &node)
Attempt to find the effective transformation matrix external to the specified node relative to either...
virtual void appendChild(const IDOMNodePtr &child)=0
Appends a node to the end of the node's child list.
virtual void setNextSibling(const IDOMNodePtr &ptrNextSibling)=0
Sets the next sibling node.
bool(* WalkTreeFunc)(void *priv, const IDOMNodePtr &node)
Definition idomnode.h:423
virtual IDOMNodePtr extractChild(const IDOMNodePtr &child)=0
Extracts (that is, finds and removes) a child node from the node children. After extraction the child...
virtual IDOMNodePtr getLastChild() const =0
Gets the last child node of this node.
virtual FRect getBounds(bool applyTransform=true, bool applyClip=true)
Find the conservative bounding box of the marking content of the node.
Definition idomnode.h:355
virtual IDOMNodePtr getPreviousSibling() const =0
Retrieves the node's previous sibling node.
virtual void replaceChild(const IDOMNodePtr &oldChild, const IDOMNodePtr &newChild)=0
Replaces the child node with another.
virtual void removeCompleteFlagFromTree()=0
Mark the entire tree from this point as complete.
virtual IDOMNodeFlags * getFlags()=0
Retrieves the node's flags property.
virtual IDOMNodePtr getNextChild(const IDOMNodePtr &child) const =0
Gets the child node which follows the node passed in.
virtual void setComplete()=0
Sets the node's completeness status to "true".
virtual IDOMNodePtr getParentNode() const =0
Gets the parent node of this node.
void(* NodeDeleteFunc)(const IDOMNode *node, void *priv)
Definition idomnode.h:455
virtual IDOMNodePtr cloneTree(IEDLClassFactory *pFactory) const =0
Clone the tree of nodes beginning at this node. An exception of type IEDLError will be thrown on fail...
virtual bool copyNodeData(IDOMNode *pSourceNode)=0
Copy the properties collection, the flags and the DOM ID from the given source node to this one.
virtual void cloneTreeAndAppend(IEDLClassFactory *pFactory, const IDOMNodePtr &dest) const =0
Clone the tree of nodes beginning at this node, and append the result to the destination tree.
virtual void setDOMid(DOMid id)=0
Sets the node ID.
virtual IDOMNodePtr getNextSibling() const =0
Retrieves node's next sibling node.
virtual bool getProperty(const EDLSysString &propertyName, PValue &propertyValue) const =0
Retrieves the value of a property. The EDL DOM node can store non-content or relationship information...
virtual void findChildrenOfType(eDOMNodeType type, CDOMNodeVect &nodes, bool searchForms=false)=0
Find all children of this node with the given type, appending to the given vector....
virtual void notifyOnDestruct(NodeDeleteFunc func, void *priv)=0
Register interest in being told when this node is about to be destroyed.
virtual void setPreviousSibling(const IDOMNodePtr &ptrPreviousSibling)=0
Sets the previous sibling node.
virtual DOMid getDOMid() const =0
Retrieves the node ID.
virtual IDOMNodePtr getFirstChild() const =0
Gets the first child node of this node.
virtual void removeProperty(const EDLSysString &propertyName)=0
Removes property.
virtual bool hasChildNodes() const =0
Function that indicates whether this node is a parent to other nodes.
virtual ~IDOMNode()
virtual destructor
Definition idomnode.h:144
virtual eDOMNodeType getNodeType() const =0
Retrieves the DOM node type.
virtual void setProperty(const EDLSysString &propertyName, const PValue &propertyValue)=0
Sets the value of a property. The EDL DOM node can store non-content or relationship information thro...
virtual IDOMNodePtr cloneNode(IEDLClassFactory *pFactory) const =0
Simpified node cloning. An exception of type IEDLError will be thrown on failure.
virtual void unregisterNotify(NodeDeleteFunc func, void *priv)=0
Unregister interest in being told when this node is about to be destroyed.
virtual void walkTree(WalkTreeFunc func, void *priv, bool descendIntoBrushes=false, bool descendIntoForms=false)=0
Walk through the DOM calling a given function on each node. The function is allowed to:
EDL Factory Interface allows one part of the EDL infrastructure to register class creation methods id...
Definition iedlfactory.h:31
IEDLObject is an abstract base class that is used by all classes that are intended to be created via ...
Definition iedlobject.h:53
Stores a "property" value that is tagged with an enumeration value that indicates the underlying type...
Definition edlproperty.h:31
void unionRect(const RectTmpl< PointType > &rect)
Unite this rect with another rect.
Definition edlgeom.h:271
CTransformMatrix< double > FMatrix
Definition edlgeom.h:1208
RectTmpl< double > FRect
Definition edlgeom.h:338
#define _END_EDL_DOM_NAMESPACE
Definition edlnamespaces.h:110
#define _BEGIN_EDL_DOM_NAMESPACE
Definition edlnamespaces.h:109
EDL uses the concept of a "property" that can store a value that has one of a number of different typ...
std::string EDLSysString
Definition edlstring.h:158
EDL "standard" types including known bit-length signed and unsigned integer type[def]s and definition...
unsigned int uint32
Definition edltypes.h:34
#define EDL_API
Definition edltypes.h:86
Simple template vector class for general use.
eDOMNodeType
DOM node type enumeration.
Definition idomnode.h:34
EDL::uint64 DOMid
Type used to uniquely idenitify a DOM node.
Definition idomid.h:17
CEDLVector< IDOMNodePtr > CDOMNodeVect
Definition idomnode.h:68
@ eDOMDocumentSequenceNode
Document Sequence Node.
Definition idomnode.h:36
@ eDOMJobTkGenericNodeNode
JobTicket Generic Node Node.
Definition idomnode.h:52
@ eDOMFixedPageNode
FixedPage Node.
Definition idomnode.h:40
@ eDOMJobTkContentNode
JobTicket Content Node.
Definition idomnode.h:49
@ eDOMCharPathGroupNode
Char Path Group Node.
Definition idomnode.h:42
@ eDOMCanvasNode
Canvas Node.
Definition idomnode.h:44
@ eDOMContentRootNode
Content Root Node.
Definition idomnode.h:35
@ eDOMJobTkGenericCharacterDataNode
JobTicket Generic Character Data Node.
Definition idomnode.h:53
@ eDOMOutlineEntryNode
Outline Entry Node.
Definition idomnode.h:56
@ eDOMOutlineNode
Outline Node.
Definition idomnode.h:55
@ eDOMPageNode
Page Node.
Definition idomnode.h:39
@ eDOMJobTkNodeNode
JobTicket Node Node.
Definition idomnode.h:50
@ eDOMFragmentNode
Fragment Node.
Definition idomnode.h:60
@ eDOMRefNode
Ref Node.
Definition idomnode.h:48
@ eDOMJobTkValueNode
JobTicket Value Node.
Definition idomnode.h:51
@ eDOMFixedDocumentNode
Fixed Document Node.
Definition idomnode.h:38
@ eDOMVisualRootNode
Visual Root Node.
Definition idomnode.h:54
@ eDOMPathNode
Path Node.
Definition idomnode.h:47
@ eDOMGroupNode
Group Node.
Definition idomnode.h:41
@ eDOMGlyphsNode
Glyphs Node.
Definition idomnode.h:45
@ eDOMGlyphNode
Glyph Node.
Definition idomnode.h:46
@ eDOMTransparencyGroupNode
Transparency GroupNode.
Definition idomnode.h:43
@ eDOMTileNode
Tile Node.
Definition idomnode.h:61
@ eDOMFormInstanceNode
Form Instance Node.
Definition idomnode.h:59
@ eDOMDocumentNode
Document Node.
Definition idomnode.h:37
@ eDOMAnnotationAppearanceNode
Annotation Appearance Node.
Definition idomnode.h:57
@ eDOMFormNode
Form Node.
Definition idomnode.h:58
@ eDOMNodeTypeCnt
Node Type Container.
Definition idomnode.h:62
EDL iterator template classes designed to allow iteration over the contents of a collection....
#define DECL_SMART_PTR(cls)
Definition smartptr.h:211
#define CSmartPtr
Definition smartptr.h:215