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_SRC_FPDFDOC_TAGGED_INT_H_ | 7 #ifndef CORE_SRC_FPDFDOC_TAGGED_INT_H_ |
8 #define CORE_SRC_FPDFDOC_TAGGED_INT_H_ | 8 #define CORE_SRC_FPDFDOC_TAGGED_INT_H_ |
9 | 9 |
10 #include "../../include/fpdfdoc/fpdf_tagged.h" | 10 #include "../../include/fpdfdoc/fpdf_tagged.h" |
11 | 11 |
12 class CPDF_StructElementImpl; | 12 class CPDF_StructElementImpl; |
13 class CPDF_StructTreeImpl : public CPDF_StructTree | 13 class CPDF_StructTreeImpl : public CPDF_StructTree |
14 { | 14 { |
15 public: | 15 public: |
16 CPDF_StructTreeImpl(const CPDF_Document* pDoc); | 16 CPDF_StructTreeImpl(const CPDF_Document* pDoc); |
17 ~CPDF_StructTreeImpl(); | 17 ~CPDF_StructTreeImpl(); |
18 int CountTopElements() const | 18 int CountTopElements() const |
19 { | 19 { |
20 return m_Kids.GetSize(); | 20 return m_Kids.GetSize(); |
21 } | 21 } |
22 CPDF_StructElement* GetTopElement(int i) const | 22 CPDF_StructElement* GetTopElement(int i) const |
23 { | 23 { |
24 return (CPDF_StructElement*)m_Kids.GetAt(i); | 24 return (CPDF_StructElement*)m_Kids.GetAt(i); |
25 } | 25 } |
26 void LoadDocTree(); | 26 void LoadDocTree(); |
27 void LoadPageTree(const CPDF_Dictionary* pPageDict); | 27 void LoadPageTree(const CPDF_Dictionary* pPageDict); |
28 CPDF_StructElementImpl* AddPageNode(CPDF_Dictionary* pElement, CFX_MapPtrToP
tr& map, int nLevel = 0); | 28 CPDF_StructElementImpl* AddPageNode(CPDF_Dictionary* pElement, CFX_MapPtrToP
tr& map, int nLevel = 0); |
29 FX_BOOL» » AddTopLevelNode(CPDF_Dictionary* pDict, CPDF_StructEleme
ntImpl* pElement); | 29 bool» » AddTopLevelNode(CPDF_Dictionary* pDict, CPDF_StructEleme
ntImpl* pElement); |
30 protected: | 30 protected: |
31 const CPDF_Dictionary* m_pTreeRoot; | 31 const CPDF_Dictionary* m_pTreeRoot; |
32 const CPDF_Dictionary* m_pRoleMap; | 32 const CPDF_Dictionary* m_pRoleMap; |
33 const CPDF_Dictionary* m_pPage; | 33 const CPDF_Dictionary* m_pPage; |
34 CFX_ArrayTemplate<CPDF_StructElementImpl*> m_Kids; | 34 CFX_ArrayTemplate<CPDF_StructElementImpl*> m_Kids; |
35 friend class CPDF_StructElementImpl; | 35 friend class CPDF_StructElementImpl; |
36 }; | 36 }; |
37 class CPDF_StructElementImpl final : public CPDF_StructElement | 37 class CPDF_StructElementImpl final : public CPDF_StructElement |
38 { | 38 { |
39 public: | 39 public: |
(...skipping 20 matching lines...) Expand all Loading... |
60 } | 60 } |
61 const CPDF_StructKid& GetKid(int index) const | 61 const CPDF_StructKid& GetKid(int index) const |
62 { | 62 { |
63 return m_Kids.GetData()[index]; | 63 return m_Kids.GetData()[index]; |
64 } | 64 } |
65 CFX_PtrArray* GetObjectArray() | 65 CFX_PtrArray* GetObjectArray() |
66 { | 66 { |
67 return &m_ObjectArray; | 67 return &m_ObjectArray; |
68 } | 68 } |
69 | 69 |
70 CPDF_Object*» » » GetAttr(const CFX_ByteStringC& owner, co
nst CFX_ByteStringC& name, FX_BOOL bInheritable = FALSE, FX_FLOAT fLevel = 0.0F)
; | 70 CPDF_Object*» » » GetAttr(const CFX_ByteStringC& owner, co
nst CFX_ByteStringC& name, bool bInheritable = false, FX_FLOAT fLevel = 0.0F); |
71 | 71 |
72 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); | 72 CFX_ByteString» » » GetName(const CFX_ByteStringC& owner, co
nst CFX_ByteStringC& name, const CFX_ByteStringC& default_value, bool bInheritab
le = false, int subindex = -1); |
73 FX_ARGB» » » » » GetColor(const CFX_ByteStringC&
owner, const CFX_ByteStringC& name, FX_ARGB default_value, FX_BOOL bInheritable
= FALSE, int subindex = -1); | 73 FX_ARGB» » » » » GetColor(const CFX_ByteStringC&
owner, const CFX_ByteStringC& name, FX_ARGB default_value, bool bInheritable = f
alse, int subindex = -1); |
74 FX_FLOAT» » » » GetNumber(const CFX_ByteStringC& owner,
const CFX_ByteStringC& name, FX_FLOAT default_value, FX_BOOL bInheritable = FALS
E, int subindex = -1); | 74 FX_FLOAT» » » » GetNumber(const CFX_ByteStringC& owner,
const CFX_ByteStringC& name, FX_FLOAT default_value, bool bInheritable = false,
int subindex = -1); |
75 int»» » » » » GetInteger(const CFX_ByteStringC
& owner, const CFX_ByteStringC& name, int default_value, FX_BOOL bInheritable =
FALSE, int subindex = -1); | 75 int»» » » » » GetInteger(const CFX_ByteStringC
& owner, const CFX_ByteStringC& name, int default_value, bool bInheritable = fal
se, int subindex = -1); |
76 CFX_PtrArray m_ObjectArray; | 76 CFX_PtrArray m_ObjectArray; |
77 void LoadKids(CPDF_Dictionary* pDict)
; | 77 void LoadKids(CPDF_Dictionary* pDict)
; |
78 void LoadKid(FX_DWORD PageObjNum, CPD
F_Object* pObj, CPDF_StructKid* pKid); | 78 void LoadKid(FX_DWORD PageObjNum, CPD
F_Object* pObj, CPDF_StructKid* pKid); |
79 CPDF_Object*» » » GetAttr(const CFX_ByteStringC& owner, co
nst CFX_ByteStringC& name, FX_BOOL bInheritable, int subindex); | 79 CPDF_Object*» » » GetAttr(const CFX_ByteStringC& owner, co
nst CFX_ByteStringC& name, bool bInheritable, int subindex); |
80 CPDF_StructElementImpl* Retain(); | 80 CPDF_StructElementImpl* Retain(); |
81 void Release(); | 81 void Release(); |
82 protected: | 82 protected: |
83 ~CPDF_StructElementImpl(); | 83 ~CPDF_StructElementImpl(); |
84 | 84 |
85 CPDF_StructTreeImpl* m_pTree; | 85 CPDF_StructTreeImpl* m_pTree; |
86 CFX_ByteString m_Type; | 86 CFX_ByteString m_Type; |
87 CPDF_StructElementImpl* m_pParent; | 87 CPDF_StructElementImpl* m_pParent; |
88 CPDF_Dictionary* m_pDict; | 88 CPDF_Dictionary* m_pDict; |
89 CFX_ArrayTemplate<CPDF_StructKid> m_Kids; | 89 CFX_ArrayTemplate<CPDF_StructKid> m_Kids; |
90 int m_RefCount; | 90 int m_RefCount; |
91 | 91 |
92 friend class CPDF_StructTreeImpl; | 92 friend class CPDF_StructTreeImpl; |
93 }; | 93 }; |
94 | 94 |
95 #endif // CORE_SRC_FPDFDOC_TAGGED_INT_H_ | 95 #endif // CORE_SRC_FPDFDOC_TAGGED_INT_H_ |
OLD | NEW |