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 |
| 54 CPDF_Object* GetIndirectObject(uint32_t objnum) override; |
| 55 |
54 int GetPageCount() const; | 56 int GetPageCount() const; |
55 CPDF_Dictionary* GetPage(int iPage); | 57 CPDF_Dictionary* GetPage(int iPage); |
56 int GetPageIndex(uint32_t objnum); | 58 int GetPageIndex(uint32_t objnum); |
57 uint32_t GetUserPermissions() const; | 59 uint32_t GetUserPermissions() const; |
58 CPDF_DocPageData* GetPageData() const { return m_pDocPage; } | 60 CPDF_DocPageData* GetPageData() const { return m_pDocPage; } |
59 void ClearPageData(); | 61 void ClearPageData(); |
60 void RemoveColorSpaceFromPageData(CPDF_Object* pObject); | 62 void RemoveColorSpaceFromPageData(CPDF_Object* pObject); |
61 | 63 |
62 std::unique_ptr<JBig2_DocumentContext>* CodecContext() { | 64 std::unique_ptr<JBig2_DocumentContext>* CodecContext() { |
63 return &m_pCodecContext; | 65 return &m_pCodecContext; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 int iPage, | 121 int iPage, |
120 int nPagesToGo, | 122 int nPagesToGo, |
121 int level); | 123 int level); |
122 int FindPageIndex(CPDF_Dictionary* pNode, | 124 int FindPageIndex(CPDF_Dictionary* pNode, |
123 uint32_t& skip_count, | 125 uint32_t& skip_count, |
124 uint32_t objnum, | 126 uint32_t objnum, |
125 int& index, | 127 int& index, |
126 int level = 0); | 128 int level = 0); |
127 FX_BOOL CheckOCGVisible(CPDF_Dictionary* pOCG, FX_BOOL bPrinting); | 129 FX_BOOL CheckOCGVisible(CPDF_Dictionary* pOCG, FX_BOOL bPrinting); |
128 | 130 |
| 131 CPDF_Parser* m_pParser; |
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 |