PDFix SDK  7.2.0
Loading...
Searching...
No Matches
PdsStructTree Struct Referenceabstract

PdsStructTree class. More...

#include <pdfix.h>

Public Member Functions

virtual PdsDictionaryGetObject ()=0
 Gets the dictionary object corresponding to the structure tree. More...
 
virtual PdsClassMapGetClassMap ()=0
 Gets the PdsClassMap object for the specified structure tree root. More...
 
virtual PdsClassMapCreateClassMap ()=0
 Creates the PdsClassMap object for the specified structure tree root if does not exist. More...
 
virtual bool RemoveClassMap ()=0
 Removes the PdsClassMap object for the specified structure tree root. More...
 
virtual PdsObjectGetChildObject (int index)=0
 
virtual int GetNumChildren ()=0
 Gets the number of children of the structure tree root. More...
 
virtual PdsRoleMapGetRoleMap ()=0
 Gets the PdsRoleMap object for the specified structure tree root. More...
 
virtual PdsRoleMapCreateRoleMap ()=0
 Create the PdsRoleMap object for the specified structure tree root if does not exist. More...
 
virtual bool RemoveRoleMap ()=0
 Removes the PdsRoleMap object for the specified structure tree root. More...
 
virtual PdsStructElementGetStructElementFromObject (PdsObject *object)=0
 
virtual bool RemoveChild (int index)=0
 Removes the specified child from the specified structure tree root. More...
 
virtual bool AddChild (PdsStructElement *element, int index)=0
 Adds the new PdsStructElement. More...
 
virtual PdsStructElementAddNewChild (const wchar_t *type, int index)=0
 Creates a new (but empty) PdsStructElement of specific type. More...
 
virtual PdfDocGetDoc ()=0
 Return parent PdfDoc object. More...
 
virtual bool RepairParentTree (PdfCancelProc cancel_proc, void *cancel_data)=0
 Create or repair parent tree based on the struct tree. More...
 
virtual bool RepairIdTree (PdfCancelProc cancel_proc, void *cancel_data)=0
 Create or repair id tree based on the struct tree. More...
 

Detailed Description

PdsStructTree class.

The root of the structure tree, which is a central repository for information related to a PDF document's logical structure. There is at most one PDSTreeRoot in each document.

Member Function Documentation

◆ AddChild()

virtual bool PdsStructTree::AddChild ( PdsStructElement element,
int  index 
)
pure virtual

Adds the new PdsStructElement.

Parameters
elementThe element to add.
indexPosition where the child is inserted. If element currently has no children, index is ignored.
Returns
Created PdsStructElement.

◆ AddNewChild()

virtual PdsStructElement * PdsStructTree::AddNewChild ( const wchar_t *  type,
int  index 
)
pure virtual

Creates a new (but empty) PdsStructElement of specific type.

Parameters
typeThe name representing the element's type.
indexPosition where the child is inserted. If element currently has no children, index is ignored.
Returns
Created PdsStructElement.

◆ CreateClassMap()

virtual PdsClassMap * PdsStructTree::CreateClassMap ( )
pure virtual

Creates the PdsClassMap object for the specified structure tree root if does not exist.

Returns
The class map, if one exists, nullptr otherwise.

◆ CreateRoleMap()

virtual PdsRoleMap * PdsStructTree::CreateRoleMap ( )
pure virtual

Create the PdsRoleMap object for the specified structure tree root if does not exist.

Returns
The created or existing role map.

◆ GetChildObject()

virtual PdsObject * PdsStructTree::GetChildObject ( int  index)
pure virtual

Gets the child's object at an array index in the specified structure tree root. The immediate children of the structure tree root shall be structure elements only.

Parameters
indexIndex of the child to obtain.
Returns
Pointer to the child's object at index.
See also
PdsStructTree::GetStructElementFromObject

◆ GetClassMap()

virtual PdsClassMap * PdsStructTree::GetClassMap ( )
pure virtual

Gets the PdsClassMap object for the specified structure tree root.

Returns
The class map, if one exists, nullptr otherwise.

◆ GetDoc()

virtual PdfDoc * PdsStructTree::GetDoc ( )
pure virtual

Return parent PdfDoc object.

See also
PdfDoc::GetStructTree
PdfDoc::CreateStructTree

◆ GetNumChildren()

virtual int PdsStructTree::GetNumChildren ( )
pure virtual

Gets the number of children of the structure tree root.

Parameters
class_nameThe string of a class name for which an associated attribute objects is found.
Returns
The number of children of the structure tree root.

◆ GetObject()

virtual PdsDictionary * PdsStructTree::GetObject ( )
pure virtual

Gets the dictionary object corresponding to the structure tree.

Returns
The requested dictionary.

◆ GetRoleMap()

virtual PdsRoleMap * PdsStructTree::GetRoleMap ( )
pure virtual

Gets the PdsRoleMap object for the specified structure tree root.

Returns
The role map, if one exists, nullptr otherwise.

◆ GetStructElementFromObject()

virtual PdsStructElement * PdsStructTree::GetStructElementFromObject ( PdsObject object)
pure virtual

Gets a PdsStructElement from a Pds object. The struct elements is cached, so that subsequent calls on the same object return The same PdsStructElement. The PdsStructElement remains in the cache as long as PdsStructTree exists.

Parameters
objectElement's Pds object.
Returns
The requested structure element.

◆ RemoveChild()

virtual bool PdsStructTree::RemoveChild ( int  index)
pure virtual

Removes the specified child from the specified structure tree root.

Parameters
indexThe index of the child.
Returns
True if successfull, false otherwise.

◆ RemoveClassMap()

virtual bool PdsStructTree::RemoveClassMap ( )
pure virtual

Removes the PdsClassMap object for the specified structure tree root.

Returns
True if successfull, false otherwise.

◆ RemoveRoleMap()

virtual bool PdsStructTree::RemoveRoleMap ( )
pure virtual

Removes the PdsRoleMap object for the specified structure tree root.

Returns
True if successfull, false otherwise.

◆ RepairIdTree()

virtual bool PdsStructTree::RepairIdTree ( PdfCancelProc  cancel_proc,
void *  cancel_data 
)
pure virtual

Create or repair id tree based on the struct tree.

Parameters
cancel_procCallback to check for canceling operations.
cancel_dataPointer to client data for the cancel procedure.
Returns
True if successfull, false otherwise.

◆ RepairParentTree()

virtual bool PdsStructTree::RepairParentTree ( PdfCancelProc  cancel_proc,
void *  cancel_data 
)
pure virtual

Create or repair parent tree based on the struct tree.

Parameters
cancel_procCallback to check for canceling operations.
cancel_dataPointer to client data for the cancel procedure.
Returns
True if successfull, false otherwise.