7#ifndef CORE_FPDFDOC_CPDF_STRUCTTREE_H_
8#define CORE_FPDFDOC_CPDF_STRUCTTREE_H_
15#include "core/fpdfapi/parser/cpdf_dictionary.h"
16#include "core/fxcrt/bytestring.h"
17#include "core/fxcrt/retain_ptr.h"
20class CPDF_StructElement;
26 RetainPtr<
const CPDF_Dictionary> pPageDict);
32 CPDF_StructElement*
GetTopElement(size_t i)
const {
return m_Kids[i].Get(); }
41 void LoadPageTree(
RetainPtr<
const CPDF_Dictionary> pPageDict);
42 RetainPtr<CPDF_StructElement> AddPageNode(
44 StructElementMap* map,
46 bool AddTopLevelNode(
const CPDF_Dictionary* pDict,
47 const RetainPtr<CPDF_StructElement>& pElement);
49 RetainPtr<
const CPDF_Dictionary>
const m_pTreeRoot;
50 RetainPtr<
const CPDF_Dictionary>
const m_pRoleMap;
52 std::vector<RetainPtr<CPDF_StructElement>> m_Kids;
int GetIntegerFor(const ByteString &key) const
ByteString GetNameFor(const ByteString &key) const
uint32_t GetRefObjNum() const
~CPDF_StructElement() override
void SetParent(CPDF_StructElement *pParentElement)
int GetKidContentId(size_t index) const
absl::optional< WideString > GetID() const
bool UpdateKidIfElement(const CPDF_Dictionary *pDict, CPDF_StructElement *pElement)
ByteString GetType() const
RetainPtr< const CPDF_Object > GetK() const
WideString GetTitle() const
absl::optional< WideString > GetLang() const
CPDF_StructElement * GetKidIfElement(size_t index) const
WideString GetActualText() const
CPDF_StructElement * GetParent() const
ByteString GetObjType() const
WideString GetAltText() const
RetainPtr< const CPDF_Object > GetA() const
static std::unique_ptr< CPDF_StructTree > LoadPage(const CPDF_Document *pDoc, RetainPtr< const CPDF_Dictionary > pPageDict)
size_t CountTopElements() const
CPDF_StructElement * GetTopElement(size_t i) const
uint32_t GetPageObjNum() const
CPDF_StructTree(const CPDF_Document *pDoc)
ByteString GetRoleMapNameFor(const ByteString &type) const
bool operator==(const char *ptr) const
#define CONSTRUCT_VIA_MAKE_RETAIN