OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DOCUMENT_H_ | 7 #ifndef CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DOCUMENT_H_ |
8 #define CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DOCUMENT_H_ | 8 #define CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DOCUMENT_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 22 matching lines...) Expand all Loading... |
33 #define FPDFPERM_ANNOT_FORM 0x0020 | 33 #define FPDFPERM_ANNOT_FORM 0x0020 |
34 #define FPDFPERM_FILL_FORM 0x0100 | 34 #define FPDFPERM_FILL_FORM 0x0100 |
35 #define FPDFPERM_EXTRACT_ACCESS 0x0200 | 35 #define FPDFPERM_EXTRACT_ACCESS 0x0200 |
36 #define FPDFPERM_ASSEMBLE 0x0400 | 36 #define FPDFPERM_ASSEMBLE 0x0400 |
37 #define FPDFPERM_PRINT_HIGH 0x0800 | 37 #define FPDFPERM_PRINT_HIGH 0x0800 |
38 #define FPDF_PAGE_MAX_NUM 0xFFFFF | 38 #define FPDF_PAGE_MAX_NUM 0xFFFFF |
39 | 39 |
40 class CPDF_Document : public CPDF_IndirectObjectHolder { | 40 class CPDF_Document : public CPDF_IndirectObjectHolder { |
41 public: | 41 public: |
42 explicit CPDF_Document(CPDF_Parser* pParser); | 42 explicit CPDF_Document(CPDF_Parser* pParser); |
43 ~CPDF_Document(); | 43 ~CPDF_Document() override; |
44 | 44 |
45 CPDF_Parser* GetParser() const { return m_pParser; } | 45 CPDF_Parser* GetParser() const { return m_pParser; } |
46 CPDF_Dictionary* GetRoot() const { return m_pRootDict; } | 46 CPDF_Dictionary* GetRoot() const { return m_pRootDict; } |
47 CPDF_Dictionary* GetInfo() const { return m_pInfoDict; } | 47 CPDF_Dictionary* GetInfo() const { return m_pInfoDict; } |
48 | 48 |
49 void GetID(CFX_ByteString& id1, CFX_ByteString& id2) const { | 49 void GetID(CFX_ByteString& id1, CFX_ByteString& id2) const { |
50 id1 = m_ID1; | 50 id1 = m_ID1; |
51 id2 = m_ID2; | 51 id2 = m_ID2; |
52 } | 52 } |
53 | 53 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 CPDF_Dictionary* FindPDFPage(CPDF_Dictionary* pPages, | 118 CPDF_Dictionary* FindPDFPage(CPDF_Dictionary* pPages, |
119 int iPage, | 119 int iPage, |
120 int nPagesToGo, | 120 int nPagesToGo, |
121 int level); | 121 int level); |
122 int FindPageIndex(CPDF_Dictionary* pNode, | 122 int FindPageIndex(CPDF_Dictionary* pNode, |
123 uint32_t& skip_count, | 123 uint32_t& skip_count, |
124 uint32_t objnum, | 124 uint32_t objnum, |
125 int& index, | 125 int& index, |
126 int level = 0); | 126 int level = 0); |
127 FX_BOOL CheckOCGVisible(CPDF_Dictionary* pOCG, FX_BOOL bPrinting); | 127 FX_BOOL CheckOCGVisible(CPDF_Dictionary* pOCG, FX_BOOL bPrinting); |
| 128 CPDF_Object* ParseIndirectObject(uint32_t objnum) override; |
128 | 129 |
| 130 CPDF_Parser* m_pParser; |
129 CPDF_Dictionary* m_pRootDict; | 131 CPDF_Dictionary* m_pRootDict; |
130 CPDF_Dictionary* m_pInfoDict; | 132 CPDF_Dictionary* m_pInfoDict; |
131 CFX_ByteString m_ID1; | 133 CFX_ByteString m_ID1; |
132 CFX_ByteString m_ID2; | 134 CFX_ByteString m_ID2; |
133 bool m_bLinearized; | 135 bool m_bLinearized; |
134 int m_iFirstPageNo; | 136 int m_iFirstPageNo; |
135 uint32_t m_dwFirstPageObjNum; | 137 uint32_t m_dwFirstPageObjNum; |
136 CFX_ArrayTemplate<uint32_t> m_PageList; | 138 CFX_ArrayTemplate<uint32_t> m_PageList; |
137 // TODO(thestig): Figure out why this cannot be a std::unique_ptr. | 139 // TODO(thestig): Figure out why this cannot be a std::unique_ptr. |
138 CPDF_DocPageData* m_pDocPage; | 140 CPDF_DocPageData* m_pDocPage; |
139 std::unique_ptr<CPDF_DocRenderData> m_pDocRender; | 141 std::unique_ptr<CPDF_DocRenderData> m_pDocRender; |
140 std::unique_ptr<JBig2_DocumentContext> m_pCodecContext; | 142 std::unique_ptr<JBig2_DocumentContext> m_pCodecContext; |
141 std::unique_ptr<CPDF_LinkList> m_pLinksContext; | 143 std::unique_ptr<CPDF_LinkList> m_pLinksContext; |
142 | 144 |
143 private: | 145 private: |
144 void LoadDocInternal(); | 146 void LoadDocInternal(); |
145 }; | 147 }; |
146 | 148 |
147 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DOCUMENT_H_ | 149 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DOCUMENT_H_ |
OLD | NEW |