Mako 8.2.0 API
MakoCore SDK API Documentation
Loading...
Searching...
No Matches
structure.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018-2025 Global Graphics Software Ltd. All rights reserved.
3 */
4
5#ifndef JAWSMAKO_STRUCTURE_H
6#define JAWSMAKO_STRUCTURE_H
7
18
19#include <jawsmako/types.h>
20#include <jawsmako/hashable.h>
21
22namespace JawsMako
23{
24 using namespace EDL;
25
37
44 {
45 public:
47
56 static JAWSMAKO_API IMarkedContentDetailsPtr create(const IJawsMakoPtr &jawsMako,
57 const U8String &tag, const IRCObjectPtr &properties,
58 bool isPoint);
59
64 virtual U8String getTag() const = 0;
65
71 virtual IPDFObjectPtr getProperties() const = 0;
72
77 virtual bool getIsPoint() const = 0;
78 };
79
87 {
88 public:
90
100 static JAWSMAKO_API IMarkedContentStructureDetailsPtr create(const IJawsMakoPtr &jawsMako,
101 const U8String &tag, const IRCObjectPtr &properties,
102 bool isPoint, const IStructureElementReferencePtr &elementReference);
103
109 virtual IStructureElementReferencePtr getStructureElementReference() const = 0;
110 };
111 #define obj2IMarkedContentStructureDetails(obj)IMarkedContentStructureDetailsPtr(dynamic_cast<IMarkedContentStructureDetails *>((IRCObject *) (obj)), true)
112
120 {
121 public:
123
132 static JAWSMAKO_API IMarkedContentArtifactDetailsPtr create(const IJawsMakoPtr &jawsMako,
133 const U8String &tag, const IRCObjectPtr &properties,
134 bool isPoint);
144 static JAWSMAKO_API IMarkedContentArtifactDetailsPtr create(const IJawsMakoPtr &jawsMako,
145 const U8String &type,
146 const U8String &subType);
147
153 virtual U8String getType() const = 0;
154
160 virtual U8String getSubtype() const = 0;
161 };
162 #define obj2IMarkedContentArtifactDetails(obj) IMarkedContentArtifactDetailsPtr(dynamic_cast<IMarkedContentArtifactDetails *>((IRCObject *) (obj)), true)
163
170 {
171 public:
173
179 virtual bool equals(const IStructureElementReferencePtr &other) const = 0;
180 };
181
182
183
189 class IStructure : public IRCObject
190 {
191 public:
192 virtual ~IStructure() {}
193
199 static JAWSMAKO_API IStructurePtr create(const IJawsMakoPtr &jawsMako);
200
205 virtual IStructurePtr clone() const = 0;
206
225 virtual IDOMNodePtr tagNode(const IStructureElementPtr &element, const IPagePtr &page, const IDOMNodePtr &nodeToTag) = 0;
226
233 virtual void appendElement(const IStructureElementPtr &element) = 0;
234
243 virtual void insertElement(const IStructureElementPtr &element, uint32 index) = 0;
244
250 virtual void removeElement(uint32 index) = 0;
251
256 virtual const CStructureElementVect &getChildElements() const = 0;
257
264 virtual IStructureElementPtr findStructureElementWithReference(const IStructureElementReferencePtr &reference) const = 0;
265
266 };
267
268
275 {
276 public:
278
285 static JAWSMAKO_API IStructureElementPtr create(const IJawsMakoPtr &jawsMako, const U8String &structureType);
286
291 virtual IStructureElementPtr clone() const = 0;
292
297 virtual U8String getStructureType() const = 0;
298
303 virtual void setStructureType(const U8String &structureType) = 0;
304
305 /*
306 * @brief Get the "Title" of the structure element, or an empty string if none is present.
307 * @return @b U8String The title of the structure element, or an empty string if none is set.
308 */
309 virtual U8String getTitle() const = 0;
310
315 virtual void setTitle(const U8String &title) = 0;
316
321 virtual U8String getLanguage() const = 0;
322
327 virtual void setLanguage(const U8String &language) = 0;
328
334 virtual U8String getAlternate() const = 0;
335
340 virtual void setAlternate(const U8String &alternateDescription) = 0;
341
347 virtual U8String getActualText() const = 0;
348
353 virtual void setActualText(const U8String &actualText) = 0;
354
363 virtual void setAttributes(const IPDFObjectPtr &attributes) = 0;
364
375 virtual IPDFObjectPtr getAttributes() const = 0;
376
385 virtual void appendElement(const IStructurePtr &structure, const IStructureElementPtr &element) = 0;
386
395 virtual void insertElement(const IStructurePtr &structure,
396 const IStructureElementPtr &element,
397 uint32 index) = 0;
398
403 virtual void appendMarkedContentReferenceChild(const IStructureMarkedContentReferenceChildPtr &child) = 0;
404
410 virtual void insertMarkedContentReferenceChild(const IStructureMarkedContentReferenceChildPtr &child,
411 uint32 index) = 0;
412
420 virtual void appendObjectReferenceChild(const IPagePtr &page, const IDOMFormPtr &targetForm) = 0;
421
431 virtual void insertObjectReferenceChild(const IPagePtr &page,
432 const IDOMFormPtr &targetForm,
433 uint32 index) = 0;
434
442 virtual void removeChild(const IStructurePtr &structure, uint32 index) = 0;
443
458 virtual void createMarkedContentReferencePair(const IStructurePtr &structure,
459 const IPagePtr &page, const IDOMNodePtr &node,
460 IStructureMarkedContentReferenceChildPtr &resultReference,
461 IMarkedContentStructureDetailsPtr &resultDetails) = 0;
462
467 virtual const CStructureElementChildVect &getChildren() const = 0;
468
473 virtual IStructureElementReferencePtr getStructureElementReference() const = 0;
474
481 virtual IStructureElementPtr findStructureElementWithReference(const IStructureElementReferencePtr &reference) const = 0;
482
489 virtual IPDFObjectStorePtr getObjectStore() = 0;
490 };
491
499 {
500 public:
502
507
508 {
510 eSCTMarkedContentReference, //<!A child that is a marked content reference
511 eSCTObjectReference //<!A child that is an object reference
513
518 virtual eStructureChildType getType() const = 0;
519
524 virtual IStructureElementChildPtr clone() const = 0;
525
526 };
527
534 {
535 public:
537
542 virtual IStructureElementPtr getElement() const = 0;
543
544 };
545 #define obj2IStructureElementReferenceChild(obj) IStructureElementReferenceChildPtr(dynamic_cast<IStructureElementReferenceChild *>((IRCObject *) (obj)), true)
546
547
555 {
556 public:
558
568 virtual bool matches(const IStructureElementPtr &parentElement, const IMarkedContentStructureDetailsPtr &details) const = 0;
569 };
570 #define obj2IStructureMarkedContentReference(obj) IStructureMarkedContentReferenceChildPtr(dynamic_cast<IStructureMarkedContentReferenceChild *>((IRCObject *) (obj)), true)
571
581 {
582 public:
584
591 virtual bool matches(const IDOMFormPtr &form) const = 0;
592 };
593 #define obj2IStructureObjectReferenceChild(obj) IStructureObjectReferenceChildPtr(dynamic_cast<IStructureObjectReferenceChild *>((IRCObject *) (obj)), true)
594}
595
596#endif /* JAWSMAKO_STRUCTURE_H */
Definition edlvector.h:30
Base class Interface for all Reference Counted objects.
Definition ircobject.h:35
Simple interface to provide a consistent hashing method for Mako objects.
Definition hashable.h:25
A subclass of IMarkedContentDetails that is created when the content is a logical structure Artifact.
Definition structure.h:120
static JAWSMAKO_API IMarkedContentArtifactDetailsPtr create(const IJawsMakoPtr &jawsMako, const U8String &type, const U8String &subType)
Create marked content details for a logical structure Artifact In this context, an artifact is any ob...
virtual U8String getSubtype() const =0
Get the subtype of the artifact, if present. Returns an empty string if no Type information is provid...
static JAWSMAKO_API IMarkedContentArtifactDetailsPtr create(const IJawsMakoPtr &jawsMako, const U8String &tag, const IRCObjectPtr &properties, bool isPoint)
Basic marked content artifact details creation.
virtual ~IMarkedContentArtifactDetails()
Definition structure.h:122
virtual U8String getType() const =0
Get the type of the artifact, if present. Returns an empty string if no Type information is provided.
Details of Marked Content applied to an IDOMGroup.
Definition structure.h:44
virtual ~IMarkedContentDetails()
Definition structure.h:46
virtual bool getIsPoint() const =0
Do the marked content details represent a single point?
static JAWSMAKO_API IMarkedContentDetailsPtr create(const IJawsMakoPtr &jawsMako, const U8String &tag, const IRCObjectPtr &properties, bool isPoint)
Create general-purpose marked content details.
virtual IPDFObjectPtr getProperties() const =0
Obtain the properties, if present, as a PDF Object. Do not edit this object.
virtual U8String getTag() const =0
Obtain the marked content's tag.
A subclass of IMarkedContentDetails that is created when the marked content is associated with the do...
Definition structure.h:87
virtual IStructureElementReferencePtr getStructureElementReference() const =0
Obtain a reference for the structure element that this content refers to. Will never return NULL.
static JAWSMAKO_API IMarkedContentStructureDetailsPtr create(const IJawsMakoPtr &jawsMako, const U8String &tag, const IRCObjectPtr &properties, bool isPoint, const IStructureElementReferencePtr &elementReference)
Create structure marked content details.
virtual ~IMarkedContentStructureDetails()
Definition structure.h:89
A child of a structure element. Either points to actual marked content, or another structure element.
Definition structure.h:499
virtual ~IStructureElementChild()
Definition structure.h:501
virtual IStructureElementChildPtr clone() const =0
Clone the element child.
virtual eStructureChildType getType() const =0
Get the type of this child.
eStructureChildType
Types for children of structure elements.
Definition structure.h:508
@ eSCTStructureElement
A child that is a structure element reference.
Definition structure.h:509
@ eSCTObjectReference
Definition structure.h:511
@ eSCTMarkedContentReference
Definition structure.h:510
A structure element in the structure tree.
Definition structure.h:275
virtual U8String getActualText() const =0
Get the actual text of the structure element. Returns an empty string if none is provided.
virtual void setActualText(const U8String &actualText)=0
Set the alternate description of the structure element, or an empty string to remove.
virtual void insertElement(const IStructurePtr &structure, const IStructureElementPtr &element, uint32 index)=0
Insert an element at the given index, where 0 is the head. An exception will be thrown if an element ...
virtual void setStructureType(const U8String &structureType)=0
Set the structure type. Must be non-zero length.
virtual IStructureElementPtr clone() const =0
Obtain a clone of the element.
virtual U8String getTitle() const =0
virtual IStructureElementPtr findStructureElementWithReference(const IStructureElementReferencePtr &reference) const =0
Find the structure element matching the given reference, in the children. Returns NULL if it does not...
virtual ~IStructureElement()
Definition structure.h:277
virtual void setAttributes(const IPDFObjectPtr &attributes)=0
Set the PDF object representing the attributes of this element. Please see the PDF specification for ...
virtual U8String getLanguage() const =0
Get the language specifier for this element, or an empty string if none is specified.
virtual void setTitle(const U8String &title)=0
Set the "Title" of the structure element, or an empty string to remove.
virtual void removeChild(const IStructurePtr &structure, uint32 index)=0
Remove the child at the given index from the list of children. Note: This will also cause all child e...
virtual IPDFObjectPtr getAttributes() const =0
Obtain the PDF object representing the attributes of this element. Please see the PDF specification f...
virtual const CStructureElementChildVect & getChildren() const =0
Get the child structure information.
virtual void setLanguage(const U8String &language)=0
Set the language specifier for this element, or an empty string to remove.
virtual void insertObjectReferenceChild(const IPagePtr &page, const IDOMFormPtr &targetForm, uint32 index)=0
Insert an object reference targeting the given form into the children at the given index,...
virtual void createMarkedContentReferencePair(const IStructurePtr &structure, const IPagePtr &page, const IDOMNodePtr &node, IStructureMarkedContentReferenceChildPtr &resultReference, IMarkedContentStructureDetailsPtr &resultDetails)=0
Create a IStructureMarkedContentReferenceChild and an IMarkedContentStructureDetails pair for a node ...
virtual void appendElement(const IStructurePtr &structure, const IStructureElementPtr &element)=0
Add an element to the end of the children. An exception will be thrown if the element already exists ...
virtual IStructureElementReferencePtr getStructureElementReference() const =0
Obtain a reference for the structure element.
static JAWSMAKO_API IStructureElementPtr create(const IJawsMakoPtr &jawsMako, const U8String &structureType)
Create a structure element.
virtual IPDFObjectStorePtr getObjectStore()=0
Obtain access to the store of objects associated with the structure element. Objects which are contro...
virtual U8String getStructureType() const =0
Get the structure type.
virtual void insertMarkedContentReferenceChild(const IStructureMarkedContentReferenceChildPtr &child, uint32 index)=0
Insert a marked content reference into the children at the given index.
virtual void appendObjectReferenceChild(const IPagePtr &page, const IDOMFormPtr &targetForm)=0
Add an object reference targeting the given form to the end of the children. In some situations the f...
virtual void setAlternate(const U8String &alternateDescription)=0
Set the alternate description of the structure element, or an empty string to remove.
virtual U8String getAlternate() const =0
Get the alternate description of the structure element, in human-readable form. Returns an empty stri...
virtual void appendMarkedContentReferenceChild(const IStructureMarkedContentReferenceChildPtr &child)=0
Add a marked content reference to the end of the children.
A child of a structure element that points to another structure element.
Definition structure.h:534
virtual IStructureElementPtr getElement() const =0
Obtain a reference to this structure element.
virtual ~IStructureElementReferenceChild()
Definition structure.h:536
A token-like class encapsulating a reference to a structure element.
Definition structure.h:170
virtual bool equals(const IStructureElementReferencePtr &other) const =0
Determine if another structure element reference refers to the same element.
virtual ~IStructureElementReference()
Definition structure.h:172
Top level tracking structure describing the logical structure of the document.
Definition structure.h:190
virtual ~IStructure()
Definition structure.h:192
static JAWSMAKO_API IStructurePtr create(const IJawsMakoPtr &jawsMako)
Create a new Structure.
virtual IStructurePtr clone() const =0
Perform a deep clone of the structure.
virtual const CStructureElementVect & getChildElements() const =0
Get the child structure elements.
virtual void insertElement(const IStructureElementPtr &element, uint32 index)=0
Insert an element into the children at the top level at the given index, where an index of 0 is the h...
virtual void removeElement(uint32 index)=0
Remove the element at the given index from the list of children. Note: This will also cause all child...
virtual IDOMNodePtr tagNode(const IStructureElementPtr &element, const IPagePtr &page, const IDOMNodePtr &nodeToTag)=0
Tag an IDOMNode from the given page with the given element.
virtual void appendElement(const IStructureElementPtr &element)=0
Add an element to the end of the children at the top level. An exception will be thrown if the elemen...
virtual IStructureElementPtr findStructureElementWithReference(const IStructureElementReferencePtr &reference) const =0
Find the structure element matching the given reference, or NULL if it does not exist.
A child of a structure element that points to a piece of marked content. Note; to create these,...
Definition structure.h:555
virtual ~IStructureMarkedContentReferenceChild()
Definition structure.h:557
virtual bool matches(const IStructureElementPtr &parentElement, const IMarkedContentStructureDetailsPtr &details) const =0
Check to see if the given IMarkedContentStructureDetails object matches this reference....
A child of a structure element that points to a piece of marked content. These cannot be created dire...
Definition structure.h:581
virtual bool matches(const IDOMFormPtr &form) const =0
Check to see if the given IDOMForm is pointed to by this object reference.
virtual ~IStructureObjectReferenceChild()
Definition structure.h:583
unsigned int uint32
Definition edltypes.h:34
EDLSysString U8String
A UTF-8 String.
Definition types.h:144
An abstract interface for an object that can be hashed.
Definition apexcustompostprocess.h:17
CEDLVector< IStructureElementChildPtr > CStructureElementChildVect
Definition structure.h:28
CEDLVector< IStructureElementPtr > CStructureElementVect
Definition types.h:174
#define DECL_SMART_PTR(cls)
Definition smartptr.h:211
#define JAWSMAKO_API
Definition types.h:29