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