Foxit PDF SDK
foxit::pdf::objects::StructElement Class Reference
Inheritance diagram for foxit::pdf::objects::StructElement:
foxit::pdf::objects::StructTreeEntity foxit::Base

Public Types

enum  ElementInfoType {
  e_ElementInfoTypeTitle = 0, e_ElementInfoTypeLanguage = 1, e_ElementInfoTypeAltDescription = 2, e_ElementInfoTypeExpandedForm = 3,
  e_ElementInfoTypeActualText = 4
}
 Enumeration for structure element info type. More...
 
- Public Types inherited from foxit::pdf::objects::StructTreeEntity
enum  StructTreeEntityType { e_UnknownType = -1, e_StructTreeEntityTypeElement = 0, e_StructTreeEntityTypeMarkedContent = 1, e_StructTreeEntityTypeObjectContent = 2 }
 Enumeration for structure tree entity type. More...
 

Public Member Functions

 StructElement ()
 Constructor.
 
 StructElement (const StructElement &other)
 Constructor, with another structure element object. More...
 
 StructElement (const StructTreeEntity &other)
 Constructor, with another structure element object. More...
 
 ~StructElement ()
 Destructor.
 
StructTreeEntity GetChild (int index)
 Get a child structure tree entity by index. More...
 
int GetChildCount () const
 Get the count of child structure tree entities in the current structure element. More...
 
WString GetElementInfo (ElementInfoType type) const
 Get the structure element information. More...
 
StructElement GetParentElement ()
 Get the parent structure element. More...
 
String GetStructureTypeName () const
 Get structure type name. More...
 
bool HasElementInfo (ElementInfoType type) const
 Check whether the structure element information of a specific type exist. More...
 
- Public Member Functions inherited from foxit::pdf::objects::StructTreeEntity
 StructTreeEntity ()
 Constructor.
 
 StructTreeEntity (const StructTreeEntity &other)
 Constructor, with another structure element entity object. More...
 
 ~StructTreeEntity ()
 Destructor.
 
PDFPage GetPage () const
 Get the related PDF page. More...
 
StructTreeEntityType GetType () const
 Get structure tree entity type. More...
 
bool IsEmpty () const
 Check whether current object is empty or not. More...
 
bool operator!= (const StructTreeEntity &other) const
 Not equal operator. More...
 
StructTreeEntityoperator= (const StructTreeEntity &other)
 Assign operator. More...
 
bool operator== (const StructTreeEntity &other) const
 Equal operator. More...
 
- Public Member Functions inherited from foxit::Base
FS_HANDLE Handle () const
 Get the handle of current object. More...
 

Detailed Description

This class represents structure element.

Member Enumeration Documentation

◆ ElementInfoType

Enumeration for structure element info type.

Values of this enumeration should be used alone.

Enumerator
e_ElementInfoTypeTitle 

Structure element info type: Title, which means the title of the structure element. A text string representing it in human-readable form.

e_ElementInfoTypeLanguage 

Structure element info type: Language, which means the natural language for all text in the structure element except where overridden by language specifications for nested structure elements or marked content.

e_ElementInfoTypeAltDescription 

Structure element info type: Alternative Description, which means the alternative description of structure element.

e_ElementInfoTypeExpandedForm 

Structure element info type: Expanded Form, which means the expanded form of structure element.

e_ElementInfoTypeActualText 

Structure element info type: Actual Text, which means the actual text of structure element.

Constructor & Destructor Documentation

◆ StructElement() [1/2]

foxit::pdf::objects::StructElement::StructElement ( const StructElement other)

Constructor, with another structure element object.

Parameters
[in]otherAnother structure element object.

◆ StructElement() [2/2]

foxit::pdf::objects::StructElement::StructElement ( const StructTreeEntity other)

Constructor, with another structure element object.

Parameters
[in]otherAnother structure element object.

Member Function Documentation

◆ GetChild()

StructTreeEntity foxit::pdf::objects::StructElement::GetChild ( int  index)

Get a child structure tree entity by index.

Parameters
[in]indexIndex of a child structure tree entity to be retrieved. Valid range: from 0 to (count-1). count is returned by function StructElement::GetChildCount.
Returns
A child structure tree entity object.

◆ GetChildCount()

int foxit::pdf::objects::StructElement::GetChildCount ( ) const

Get the count of child structure tree entities in the current structure element.

Returns
The count of child structure tree entities.

◆ GetElementInfo()

WString foxit::pdf::objects::StructElement::GetElementInfo ( ElementInfoType  type) const

Get the structure element information.

Before get structure element information, ensure that the function StructElement::HasElementInfo has been called and returned true (using the corresponding type).

Parameters
[in]typeStructure element information type. Please refer to values starting from StructElement::e_ElementInfoTypeTitle and this would be one of these values.
Returns
Structure element information string.

◆ GetParentElement()

StructElement foxit::pdf::objects::StructElement::GetParentElement ( )

Get the parent structure element.

Returns
Parent structure element. If function StructElement::IsEmpty for the returned object returns true, that means current element does not have a parent element.

◆ GetStructureTypeName()

String foxit::pdf::objects::StructElement::GetStructureTypeName ( ) const

Get structure type name.

Every structure element shall have a structure type, a name object that identifies the nature of the structure element and its role within the document (such as a chapter, paragraph, or footnote). Please refer to the description of "Standard Structure Types" in Section 10.7.3 of <PDF Reference 1.7> or the description of "Standard structure types" in Section 14.8.4 of <PDF Reference 2.0> for more details.

Returns
A string that represents structure type name of current structure element.

◆ HasElementInfo()

bool foxit::pdf::objects::StructElement::HasElementInfo ( ElementInfoType  type) const

Check whether the structure element information of a specific type exist.

Parameters
[in]typeStructure element information type. Please refer to values starting from StructElement::e_ElementInfoTypeTitle and this would be one of these values.
Returns
true means the element information type has element information, while false means the element information type does not have element information.