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 <functional> | 10 #include <functional> |
11 #include <memory> | 11 #include <memory> |
12 | 12 |
13 #include "core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h" | 13 #include "core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h" |
14 #include "core/fpdfapi/fpdf_parser/include/cpdf_object.h" | 14 #include "core/fpdfapi/fpdf_parser/include/cpdf_object.h" |
15 #include "core/fpdfdoc/include/cpdf_linklist.h" | 15 #include "core/fpdfdoc/include/cpdf_linklist.h" |
| 16 #include "core/fxcrt/include/cfx_string_pool_template.h" |
| 17 #include "core/fxcrt/include/cfx_weak_ptr.h" |
16 #include "core/fxcrt/include/fx_basic.h" | 18 #include "core/fxcrt/include/fx_basic.h" |
17 | 19 |
18 class CFX_Font; | 20 class CFX_Font; |
19 class CFX_Matrix; | 21 class CFX_Matrix; |
20 class CPDF_ColorSpace; | 22 class CPDF_ColorSpace; |
21 class CPDF_DocPageData; | 23 class CPDF_DocPageData; |
22 class CPDF_DocRenderData; | 24 class CPDF_DocRenderData; |
23 class CPDF_Font; | 25 class CPDF_Font; |
24 class CPDF_FontEncoding; | 26 class CPDF_FontEncoding; |
25 class CPDF_IccProfile; | 27 class CPDF_IccProfile; |
(...skipping 14 matching lines...) Expand all Loading... |
40 #define FPDF_PAGE_MAX_NUM 0xFFFFF | 42 #define FPDF_PAGE_MAX_NUM 0xFFFFF |
41 | 43 |
42 class CPDF_Document : public CPDF_IndirectObjectHolder { | 44 class CPDF_Document : public CPDF_IndirectObjectHolder { |
43 public: | 45 public: |
44 explicit CPDF_Document(std::unique_ptr<CPDF_Parser> pParser); | 46 explicit CPDF_Document(std::unique_ptr<CPDF_Parser> pParser); |
45 ~CPDF_Document() override; | 47 ~CPDF_Document() override; |
46 | 48 |
47 CPDF_Parser* GetParser() const { return m_pParser.get(); } | 49 CPDF_Parser* GetParser() const { return m_pParser.get(); } |
48 CPDF_Dictionary* GetRoot() const { return m_pRootDict; } | 50 CPDF_Dictionary* GetRoot() const { return m_pRootDict; } |
49 CPDF_Dictionary* GetInfo() const { return m_pInfoDict; } | 51 CPDF_Dictionary* GetInfo() const { return m_pInfoDict; } |
| 52 CFX_WeakPtr<CFX_ByteStringPool> GetByteStringPool() const { |
| 53 return m_pByteStringPool; |
| 54 } |
50 | 55 |
51 void DeletePage(int iPage); | 56 void DeletePage(int iPage); |
52 int GetPageCount() const; | 57 int GetPageCount() const; |
53 | 58 |
54 bool IsPageLoaded(int iPage) const; | 59 bool IsPageLoaded(int iPage) const; |
55 CPDF_Dictionary* GetPage(int iPage); | 60 CPDF_Dictionary* GetPage(int iPage); |
56 int GetPageIndex(uint32_t objnum); | 61 int GetPageIndex(uint32_t objnum); |
57 uint32_t GetUserPermissions() const; | 62 uint32_t GetUserPermissions() const; |
58 CPDF_DocPageData* GetPageData() const { return m_pDocPage; } | 63 CPDF_DocPageData* GetPageData() const { return m_pDocPage; } |
59 | 64 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 CPDF_Dictionary* m_pInfoDict; | 132 CPDF_Dictionary* m_pInfoDict; |
128 bool m_bLinearized; | 133 bool m_bLinearized; |
129 int m_iFirstPageNo; | 134 int m_iFirstPageNo; |
130 uint32_t m_dwFirstPageObjNum; | 135 uint32_t m_dwFirstPageObjNum; |
131 // TODO(thestig): Figure out why this cannot be a std::unique_ptr. | 136 // TODO(thestig): Figure out why this cannot be a std::unique_ptr. |
132 CPDF_DocPageData* m_pDocPage; | 137 CPDF_DocPageData* m_pDocPage; |
133 std::unique_ptr<CPDF_DocRenderData> m_pDocRender; | 138 std::unique_ptr<CPDF_DocRenderData> m_pDocRender; |
134 std::unique_ptr<JBig2_DocumentContext> m_pCodecContext; | 139 std::unique_ptr<JBig2_DocumentContext> m_pCodecContext; |
135 std::unique_ptr<CPDF_LinkList> m_pLinksContext; | 140 std::unique_ptr<CPDF_LinkList> m_pLinksContext; |
136 CFX_ArrayTemplate<uint32_t> m_PageList; | 141 CFX_ArrayTemplate<uint32_t> m_PageList; |
| 142 CFX_WeakPtr<CFX_ByteStringPool> m_pByteStringPool; |
137 }; | 143 }; |
138 | 144 |
139 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DOCUMENT_H_ | 145 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DOCUMENT_H_ |
OLD | NEW |