Chromium Code Reviews| 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/cfx_string_pool_template.h" | |
| 15 #include "core/fxcrt/include/fx_basic.h" | 16 #include "core/fxcrt/include/fx_basic.h" |
| 16 | 17 |
| 17 class CFX_Font; | 18 class CFX_Font; |
| 18 class CFX_Matrix; | 19 class CFX_Matrix; |
| 19 class CPDF_ColorSpace; | 20 class CPDF_ColorSpace; |
| 20 class CPDF_DocPageData; | 21 class CPDF_DocPageData; |
| 21 class CPDF_DocRenderData; | 22 class CPDF_DocRenderData; |
| 22 class CPDF_Font; | 23 class CPDF_Font; |
| 23 class CPDF_FontEncoding; | 24 class CPDF_FontEncoding; |
| 24 class CPDF_IccProfile; | 25 class CPDF_IccProfile; |
| 25 class CPDF_Image; | 26 class CPDF_Image; |
| 26 class CPDF_Parser; | 27 class CPDF_Parser; |
| 27 class CPDF_Pattern; | 28 class CPDF_Pattern; |
| 28 class CPDF_StreamAcc; | 29 class CPDF_StreamAcc; |
| 29 class JBig2_DocumentContext; | 30 class JBig2_DocumentContext; |
| 30 | 31 |
| 31 #define FPDFPERM_PRINT 0x0004 | 32 #define FPDFPERM_PRINT 0x0004 |
| 32 #define FPDFPERM_MODIFY 0x0008 | 33 #define FPDFPERM_MODIFY 0x0008 |
| 33 #define FPDFPERM_EXTRACT 0x0010 | 34 #define FPDFPERM_EXTRACT 0x0010 |
| 34 #define FPDFPERM_ANNOT_FORM 0x0020 | 35 #define FPDFPERM_ANNOT_FORM 0x0020 |
| 35 #define FPDFPERM_FILL_FORM 0x0100 | 36 #define FPDFPERM_FILL_FORM 0x0100 |
| 36 #define FPDFPERM_EXTRACT_ACCESS 0x0200 | 37 #define FPDFPERM_EXTRACT_ACCESS 0x0200 |
| 37 #define FPDFPERM_ASSEMBLE 0x0400 | 38 #define FPDFPERM_ASSEMBLE 0x0400 |
| 38 #define FPDFPERM_PRINT_HIGH 0x0800 | 39 #define FPDFPERM_PRINT_HIGH 0x0800 |
| 39 #define FPDF_PAGE_MAX_NUM 0xFFFFF | 40 #define FPDF_PAGE_MAX_NUM 0xFFFFF |
| 40 | 41 |
| 41 class CPDF_Document : public CPDF_IndirectObjectHolder { | 42 class CPDF_Document : public CPDF_IndirectObjectHolder, |
| 43 public CFX_ByteStringPool { | |
|
dsinclair
2016/09/19 13:24:34
I'm not sure about this, should the document just
Tom Sepez
2016/09/19 18:24:59
Done.
| |
| 42 public: | 44 public: |
| 43 explicit CPDF_Document(std::unique_ptr<CPDF_Parser> pParser); | 45 explicit CPDF_Document(std::unique_ptr<CPDF_Parser> pParser); |
| 44 ~CPDF_Document() override; | 46 ~CPDF_Document() override; |
| 45 | 47 |
| 46 CPDF_Parser* GetParser() const { return m_pParser.get(); } | 48 CPDF_Parser* GetParser() const { return m_pParser.get(); } |
| 47 CPDF_Dictionary* GetRoot() const { return m_pRootDict; } | 49 CPDF_Dictionary* GetRoot() const { return m_pRootDict; } |
| 48 CPDF_Dictionary* GetInfo() const { return m_pInfoDict; } | 50 CPDF_Dictionary* GetInfo() const { return m_pInfoDict; } |
| 49 | 51 |
| 50 int GetPageCount() const; | 52 int GetPageCount() const; |
| 51 CPDF_Dictionary* GetPage(int iPage); | 53 CPDF_Dictionary* GetPage(int iPage); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 124 std::unique_ptr<JBig2_DocumentContext> m_pCodecContext; | 126 std::unique_ptr<JBig2_DocumentContext> m_pCodecContext; |
| 125 std::unique_ptr<CPDF_LinkList> m_pLinksContext; | 127 std::unique_ptr<CPDF_LinkList> m_pLinksContext; |
| 126 | 128 |
| 127 private: | 129 private: |
| 128 void LoadDocInternal(); | 130 void LoadDocInternal(); |
| 129 size_t CalculateEncodingDict(int charset, CPDF_Dictionary* pBaseDict); | 131 size_t CalculateEncodingDict(int charset, CPDF_Dictionary* pBaseDict); |
| 130 CPDF_Dictionary* GetPagesDict() const; | 132 CPDF_Dictionary* GetPagesDict() const; |
| 131 }; | 133 }; |
| 132 | 134 |
| 133 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DOCUMENT_H_ | 135 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DOCUMENT_H_ |
| OLD | NEW |