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 _FPDF_TAGGED_INT_H_ | 7 #ifndef _FPDF_TAGGED_INT_H_ |
8 #define _FPDF_TAGGED_INT_H_ | 8 #define _FPDF_TAGGED_INT_H_ |
9 class CPDF_StructTreeImpl; | 9 |
| 10 #include "../../include/fpdfdoc/fpdf_tagged.h" |
| 11 |
10 class CPDF_StructElementImpl; | 12 class CPDF_StructElementImpl; |
11 class CPDF_StructTreeImpl : public CPDF_StructTree | 13 class CPDF_StructTreeImpl : public CPDF_StructTree |
12 { | 14 { |
13 public: | 15 public: |
14 CPDF_StructTreeImpl(const CPDF_Document* pDoc); | 16 CPDF_StructTreeImpl(const CPDF_Document* pDoc); |
15 ~CPDF_StructTreeImpl(); | 17 ~CPDF_StructTreeImpl(); |
16 int CountTopElements() const | 18 int CountTopElements() const |
17 { | 19 { |
18 return m_Kids.GetSize(); | 20 return m_Kids.GetSize(); |
19 } | 21 } |
20 CPDF_StructElement* GetTopElement(int i) const | 22 CPDF_StructElement* GetTopElement(int i) const |
21 { | 23 { |
22 return (CPDF_StructElement*)m_Kids.GetAt(i); | 24 return (CPDF_StructElement*)m_Kids.GetAt(i); |
23 } | 25 } |
24 void LoadDocTree(); | 26 void LoadDocTree(); |
25 void LoadPageTree(const CPDF_Dictionary* pPageDict); | 27 void LoadPageTree(const CPDF_Dictionary* pPageDict); |
26 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); |
27 FX_BOOL AddTopLevelNode(CPDF_Dictionary* pDict, CPDF_StructEleme
ntImpl* pElement); | 29 FX_BOOL AddTopLevelNode(CPDF_Dictionary* pDict, CPDF_StructEleme
ntImpl* pElement); |
28 protected: | 30 protected: |
29 const CPDF_Dictionary* m_pTreeRoot; | 31 const CPDF_Dictionary* m_pTreeRoot; |
30 const CPDF_Dictionary* m_pRoleMap; | 32 const CPDF_Dictionary* m_pRoleMap; |
31 const CPDF_Dictionary* m_pPage; | 33 const CPDF_Dictionary* m_pPage; |
32 CFX_ArrayTemplate<CPDF_StructElementImpl*> m_Kids; | 34 CFX_ArrayTemplate<CPDF_StructElementImpl*> m_Kids; |
33 friend class CPDF_StructElementImpl; | 35 friend class CPDF_StructElementImpl; |
34 }; | 36 }; |
35 class CPDF_StructElementImpl FX_FINAL : public CPDF_StructElement | 37 class CPDF_StructElementImpl FX_FINAL : public CPDF_StructElement |
36 { | 38 { |
37 public: | 39 public: |
38 CPDF_StructElementImpl(CPDF_StructTreeImpl* pTree, CPDF_StructElementImpl* p
Parent, CPDF_Dictionary* pDict); | 40 CPDF_StructElementImpl(CPDF_StructTreeImpl* pTree, CPDF_StructElementImpl* p
Parent, CPDF_Dictionary* pDict); |
39 ~CPDF_StructElementImpl(); | |
40 CPDF_StructTree* GetTree() const | 41 CPDF_StructTree* GetTree() const |
41 { | 42 { |
42 return m_pTree; | 43 return m_pTree; |
43 } | 44 } |
44 const CFX_ByteString& GetType() const | 45 const CFX_ByteString& GetType() const |
45 { | 46 { |
46 return m_Type; | 47 return m_Type; |
47 } | 48 } |
48 CPDF_StructElement* GetParent() const | 49 CPDF_StructElement* GetParent() const |
49 { | 50 { |
(...skipping 22 matching lines...) Expand all Loading... |
72 FX_ARGB GetColor(FX_BSTR owner, FX_BSTR
name, FX_ARGB default_value, FX_BOOL bInheritable = FALSE, int subindex = -1); | 73 FX_ARGB GetColor(FX_BSTR owner, FX_BSTR
name, FX_ARGB default_value, FX_BOOL bInheritable = FALSE, int subindex = -1); |
73 FX_FLOAT GetNumber(FX_BSTR owner, FX_BSTR name, F
X_FLOAT default_value, FX_BOOL bInheritable = FALSE, int subindex = -1); | 74 FX_FLOAT GetNumber(FX_BSTR owner, FX_BSTR name, F
X_FLOAT default_value, FX_BOOL bInheritable = FALSE, int subindex = -1); |
74 int GetInteger(FX_BSTR owner, FX_BST
R name, int default_value, FX_BOOL bInheritable = FALSE, int subindex = -1); | 75 int GetInteger(FX_BSTR owner, FX_BST
R name, int default_value, FX_BOOL bInheritable = FALSE, int subindex = -1); |
75 CFX_PtrArray m_ObjectArray; | 76 CFX_PtrArray m_ObjectArray; |
76 void LoadKids(CPDF_Dictionary* pDict)
; | 77 void LoadKids(CPDF_Dictionary* pDict)
; |
77 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); |
78 CPDF_Object* GetAttr(FX_BSTR owner, FX_BSTR name, FX_
BOOL bInheritable, int subindex); | 79 CPDF_Object* GetAttr(FX_BSTR owner, FX_BSTR name, FX_
BOOL bInheritable, int subindex); |
79 CPDF_StructElementImpl* Retain(); | 80 CPDF_StructElementImpl* Retain(); |
80 void Release(); | 81 void Release(); |
81 protected: | 82 protected: |
| 83 ~CPDF_StructElementImpl(); |
| 84 |
82 CPDF_StructTreeImpl* m_pTree; | 85 CPDF_StructTreeImpl* m_pTree; |
83 CFX_ByteString m_Type; | 86 CFX_ByteString m_Type; |
84 CPDF_StructElementImpl* m_pParent; | 87 CPDF_StructElementImpl* m_pParent; |
85 CPDF_Dictionary* m_pDict; | 88 CPDF_Dictionary* m_pDict; |
86 CFX_ArrayTemplate<CPDF_StructKid> m_Kids; | 89 CFX_ArrayTemplate<CPDF_StructKid> m_Kids; |
| 90 int m_RefCount; |
87 | 91 |
88 int m_RefCount; | |
89 friend class CPDF_StructTreeImpl; | 92 friend class CPDF_StructTreeImpl; |
90 }; | 93 }; |
91 #endif | 94 #endif |
OLD | NEW |