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