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> |
11 | 11 |
12 #include "core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h" | 12 #include "core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h" |
13 #include "core/fpdfapi/fpdf_parser/include/cpdf_object.h" | 13 #include "core/fpdfapi/fpdf_parser/include/cpdf_object.h" |
14 #include "core/fpdfdoc/include/cpdf_linklist.h" | 14 #include "core/fpdfdoc/include/cpdf_linklist.h" |
15 #include "core/fxcrt/include/fx_basic.h" | 15 #include "core/fxcrt/include/fx_basic.h" |
16 | 16 |
17 class CFX_Font; | 17 class CFX_Font; |
18 class CFX_Matrix; | 18 class CFX_Matrix; |
19 class CPDF_ColorSpace; | 19 class CPDF_ColorSpace; |
20 class CPDF_DocPageData; | 20 class CPDF_DocPageData; |
21 class CPDF_DocRenderData; | 21 class CPDF_DocRenderData; |
22 class CPDF_Font; | 22 class CPDF_Font; |
23 class CPDF_FontEncoding; | 23 class CPDF_FontEncoding; |
24 class CPDF_IccProfile; | 24 class CPDF_IccProfile; |
25 class CPDF_Image; | 25 class CPDF_Image; |
26 class CPDF_Parser; | |
26 class CPDF_Pattern; | 27 class CPDF_Pattern; |
27 class CPDF_StreamAcc; | 28 class CPDF_StreamAcc; |
28 class JBig2_DocumentContext; | 29 class JBig2_DocumentContext; |
29 | 30 |
30 #define FPDFPERM_PRINT 0x0004 | 31 #define FPDFPERM_PRINT 0x0004 |
31 #define FPDFPERM_MODIFY 0x0008 | 32 #define FPDFPERM_MODIFY 0x0008 |
32 #define FPDFPERM_EXTRACT 0x0010 | 33 #define FPDFPERM_EXTRACT 0x0010 |
33 #define FPDFPERM_ANNOT_FORM 0x0020 | 34 #define FPDFPERM_ANNOT_FORM 0x0020 |
34 #define FPDFPERM_FILL_FORM 0x0100 | 35 #define FPDFPERM_FILL_FORM 0x0100 |
35 #define FPDFPERM_EXTRACT_ACCESS 0x0200 | 36 #define FPDFPERM_EXTRACT_ACCESS 0x0200 |
36 #define FPDFPERM_ASSEMBLE 0x0400 | 37 #define FPDFPERM_ASSEMBLE 0x0400 |
37 #define FPDFPERM_PRINT_HIGH 0x0800 | 38 #define FPDFPERM_PRINT_HIGH 0x0800 |
38 #define FPDF_PAGE_MAX_NUM 0xFFFFF | 39 #define FPDF_PAGE_MAX_NUM 0xFFFFF |
39 | 40 |
40 class CPDF_Document : public CPDF_IndirectObjectHolder { | 41 class CPDF_Document : public CPDF_IndirectObjectHolder { |
41 public: | 42 public: |
42 explicit CPDF_Document(CPDF_Parser* pParser); | 43 explicit CPDF_Document(CPDF_Parser* pParser); |
43 ~CPDF_Document(); | 44 ~CPDF_Document() override; |
44 | 45 |
45 CPDF_Parser* GetParser() const { return m_pParser; } | 46 CPDF_Parser* GetParser() const { return m_pParser; } |
46 CPDF_Dictionary* GetRoot() const { return m_pRootDict; } | 47 CPDF_Dictionary* GetRoot() const { return m_pRootDict; } |
47 CPDF_Dictionary* GetInfo() const { return m_pInfoDict; } | 48 CPDF_Dictionary* GetInfo() const { return m_pInfoDict; } |
48 | 49 |
49 void GetID(CFX_ByteString& id1, CFX_ByteString& id2) const { | 50 void GetID(CFX_ByteString& id1, CFX_ByteString& id2) const { |
50 id1 = m_ID1; | 51 id1 = m_ID1; |
51 id2 = m_ID2; | 52 id2 = m_ID2; |
52 } | 53 } |
53 | 54 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 CPDF_Dictionary* FindPDFPage(CPDF_Dictionary* pPages, | 119 CPDF_Dictionary* FindPDFPage(CPDF_Dictionary* pPages, |
119 int iPage, | 120 int iPage, |
120 int nPagesToGo, | 121 int nPagesToGo, |
121 int level); | 122 int level); |
122 int FindPageIndex(CPDF_Dictionary* pNode, | 123 int FindPageIndex(CPDF_Dictionary* pNode, |
123 uint32_t& skip_count, | 124 uint32_t& skip_count, |
124 uint32_t objnum, | 125 uint32_t objnum, |
125 int& index, | 126 int& index, |
126 int level = 0); | 127 int level = 0); |
127 FX_BOOL CheckOCGVisible(CPDF_Dictionary* pOCG, FX_BOOL bPrinting); | 128 FX_BOOL CheckOCGVisible(CPDF_Dictionary* pOCG, FX_BOOL bPrinting); |
129 CPDF_Object* ParseIndirectObject(uint32_t objnum) override; | |
128 | 130 |
131 CPDF_Parser* m_pParser; | |
Tom Sepez
2016/08/24 16:13:08
can this be CPDF_Parser* const m_pParser? Or uniq
dsinclair
2016/08/24 17:20:19
Followup: https://codereview.chromium.org/22757730
| |
129 CPDF_Dictionary* m_pRootDict; | 132 CPDF_Dictionary* m_pRootDict; |
130 CPDF_Dictionary* m_pInfoDict; | 133 CPDF_Dictionary* m_pInfoDict; |
131 CFX_ByteString m_ID1; | 134 CFX_ByteString m_ID1; |
132 CFX_ByteString m_ID2; | 135 CFX_ByteString m_ID2; |
133 bool m_bLinearized; | 136 bool m_bLinearized; |
134 int m_iFirstPageNo; | 137 int m_iFirstPageNo; |
135 uint32_t m_dwFirstPageObjNum; | 138 uint32_t m_dwFirstPageObjNum; |
136 CFX_ArrayTemplate<uint32_t> m_PageList; | 139 CFX_ArrayTemplate<uint32_t> m_PageList; |
137 // TODO(thestig): Figure out why this cannot be a std::unique_ptr. | 140 // TODO(thestig): Figure out why this cannot be a std::unique_ptr. |
138 CPDF_DocPageData* m_pDocPage; | 141 CPDF_DocPageData* m_pDocPage; |
139 std::unique_ptr<CPDF_DocRenderData> m_pDocRender; | 142 std::unique_ptr<CPDF_DocRenderData> m_pDocRender; |
140 std::unique_ptr<JBig2_DocumentContext> m_pCodecContext; | 143 std::unique_ptr<JBig2_DocumentContext> m_pCodecContext; |
141 std::unique_ptr<CPDF_LinkList> m_pLinksContext; | 144 std::unique_ptr<CPDF_LinkList> m_pLinksContext; |
142 | 145 |
143 private: | 146 private: |
144 void LoadDocInternal(); | 147 void LoadDocInternal(); |
145 }; | 148 }; |
146 | 149 |
147 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DOCUMENT_H_ | 150 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DOCUMENT_H_ |
OLD | NEW |