OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 |
| 7 #ifndef CORE_FPDFDOC_INCLUDE_FPDF_TAGGED_H_ |
| 8 #define CORE_FPDFDOC_INCLUDE_FPDF_TAGGED_H_ |
| 9 |
| 10 #include "core/fxge/include/fx_dib.h" |
| 11 |
| 12 class CPDF_Dictionary; |
| 13 class CPDF_Document; |
| 14 class IPDF_StructElement; |
| 15 |
| 16 class IPDF_StructTree { |
| 17 public: |
| 18 static IPDF_StructTree* LoadDoc(const CPDF_Document* pDoc); |
| 19 static IPDF_StructTree* LoadPage(const CPDF_Document* pDoc, |
| 20 const CPDF_Dictionary* pPageDict); |
| 21 |
| 22 virtual ~IPDF_StructTree() {} |
| 23 |
| 24 virtual int CountTopElements() const = 0; |
| 25 virtual IPDF_StructElement* GetTopElement(int i) const = 0; |
| 26 }; |
| 27 |
| 28 struct CPDF_StructKid { |
| 29 enum { Invalid, Element, PageContent, StreamContent, Object } m_Type; |
| 30 |
| 31 union { |
| 32 struct { |
| 33 IPDF_StructElement* m_pElement; |
| 34 CPDF_Dictionary* m_pDict; |
| 35 } m_Element; |
| 36 struct { |
| 37 uint32_t m_PageObjNum; |
| 38 uint32_t m_ContentId; |
| 39 } m_PageContent; |
| 40 struct { |
| 41 uint32_t m_PageObjNum; |
| 42 uint32_t m_ContentId; |
| 43 uint32_t m_RefObjNum; |
| 44 } m_StreamContent; |
| 45 struct { |
| 46 uint32_t m_PageObjNum; |
| 47 uint32_t m_RefObjNum; |
| 48 } m_Object; |
| 49 }; |
| 50 }; |
| 51 |
| 52 class IPDF_StructElement { |
| 53 public: |
| 54 virtual ~IPDF_StructElement() {} |
| 55 |
| 56 virtual IPDF_StructTree* GetTree() const = 0; |
| 57 virtual const CFX_ByteString& GetType() const = 0; |
| 58 virtual IPDF_StructElement* GetParent() const = 0; |
| 59 virtual CPDF_Dictionary* GetDict() const = 0; |
| 60 virtual int CountKids() const = 0; |
| 61 virtual const CPDF_StructKid& GetKid(int index) const = 0; |
| 62 |
| 63 virtual CPDF_Object* GetAttr(const CFX_ByteStringC& owner, |
| 64 const CFX_ByteStringC& name, |
| 65 FX_BOOL bInheritable = FALSE, |
| 66 FX_FLOAT fLevel = 0.0F) = 0; |
| 67 |
| 68 virtual CFX_ByteString GetName(const CFX_ByteStringC& owner, |
| 69 const CFX_ByteStringC& name, |
| 70 const CFX_ByteStringC& default_value, |
| 71 FX_BOOL bInheritable = FALSE, |
| 72 int subindex = -1) = 0; |
| 73 |
| 74 virtual FX_ARGB GetColor(const CFX_ByteStringC& owner, |
| 75 const CFX_ByteStringC& name, |
| 76 FX_ARGB default_value, |
| 77 FX_BOOL bInheritable = FALSE, |
| 78 int subindex = -1) = 0; |
| 79 |
| 80 virtual FX_FLOAT GetNumber(const CFX_ByteStringC& owner, |
| 81 const CFX_ByteStringC& name, |
| 82 FX_FLOAT default_value, |
| 83 FX_BOOL bInheritable = FALSE, |
| 84 int subindex = -1) = 0; |
| 85 |
| 86 virtual int GetInteger(const CFX_ByteStringC& owner, |
| 87 const CFX_ByteStringC& name, |
| 88 int default_value, |
| 89 FX_BOOL bInheritable = FALSE, |
| 90 int subindex = -1) = 0; |
| 91 }; |
| 92 |
| 93 #endif // CORE_FPDFDOC_INCLUDE_FPDF_TAGGED_H_ |
OLD | NEW |