All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SElement.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------------------
2 // Copyright (c) 2001-2021 by PDFTron Systems Inc. All Rights Reserved.
3 // Consult legal.txt regarding legal and license information.
4 //---------------------------------------------------------------------------------------
5 #ifndef PDFTRON_H_CPPPDFStructSElement
6 #define PDFTRON_H_CPPPDFStructSElement
7 
8 namespace pdftron {
9  namespace PDF {
10  class PDFDoc;
11  namespace Struct {
12 
21 class SElement
22 {
23 public:
24 
33  SElement (SDF::Obj dict = SDF::Obj(0));
34 
35  SElement (const SElement&);
36  SElement& operator= (const SElement&);
37 
43  static SElement Create(pdftron::PDF::PDFDoc& doc, const char* struct_type);
44 
51  void Insert(SElement& kid, int insert_before);
52 
59  int CreateContentItem(PDFDoc& doc, Page& page, int insert_before = -1);
60 
64  bool IsValid() const;
65 
73  const char* GetType() const;
74 
78  int GetNumKids() const;
79 
88  bool IsContentItem(int index) const;
89 
96  class ContentItem GetAsContentItem(int index) const;
97 
104  SElement GetAsStructElem(int index) const;
105 
114  SElement GetParent() const;
115 
120  class STree GetStructTreeRoot() const;
121 
128  bool HasTitle() const;
129 
133  UString GetTitle() const;
134 
138  SDF::Obj GetID() const;
139 
147  bool HasActualText() const;
148 
156  UString GetActualText() const;
157 
165  bool HasAlt() const;
166 
174  UString GetAlt() const;
175 
179  SDF::Obj GetSDFObj() const;
180 
181 
182 // @cond PRIVATE_DOC
183 #ifndef SWIGHIDDEN
184  SElement(TRN_SElement impl);
185  TRN_SElement mp_elem;
186 #endif
187 // @endcond
188 };
189 
190 
191 
192  }; // namespace Struct
193  }; // namespace PDF
194 }; // namespace pdftron
195 
196 #include <Impl/PDFDoc.inl>
197 
198 #endif // PDFTRON_H_CPPPDFStructSElement
SElement(SDF::Obj dict=SDF::Obj(0))
bool IsContentItem(int index) const
int CreateContentItem(PDFDoc &doc, Page &page, int insert_before=-1)
UString GetActualText() const
const char * GetType() const
SElement GetAsStructElem(int index) const
static SElement Create(pdftron::PDF::PDFDoc &doc, const char *struct_type)
SElement & operator=(const SElement &)
void Insert(SElement &kid, int insert_before)