| 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/fpdf_doc.h" | 14 #include "core/fpdfdoc/include/fpdf_doc.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_Pattern; | 26 class CPDF_Pattern; |
| 27 class CPDF_StreamAcc; | 27 class CPDF_StreamAcc; |
| 28 class JBig2_DocumentContext; |
| 28 | 29 |
| 29 #define FPDFPERM_PRINT 0x0004 | 30 #define FPDFPERM_PRINT 0x0004 |
| 30 #define FPDFPERM_MODIFY 0x0008 | 31 #define FPDFPERM_MODIFY 0x0008 |
| 31 #define FPDFPERM_EXTRACT 0x0010 | 32 #define FPDFPERM_EXTRACT 0x0010 |
| 32 #define FPDFPERM_ANNOT_FORM 0x0020 | 33 #define FPDFPERM_ANNOT_FORM 0x0020 |
| 33 #define FPDFPERM_FILL_FORM 0x0100 | 34 #define FPDFPERM_FILL_FORM 0x0100 |
| 34 #define FPDFPERM_EXTRACT_ACCESS 0x0200 | 35 #define FPDFPERM_EXTRACT_ACCESS 0x0200 |
| 35 #define FPDFPERM_ASSEMBLE 0x0400 | 36 #define FPDFPERM_ASSEMBLE 0x0400 |
| 36 #define FPDFPERM_PRINT_HIGH 0x0800 | 37 #define FPDFPERM_PRINT_HIGH 0x0800 |
| 37 #define FPDF_PAGE_MAX_NUM 0xFFFFF | 38 #define FPDF_PAGE_MAX_NUM 0xFFFFF |
| (...skipping 13 matching lines...) Expand all Loading... |
| 51 } | 52 } |
| 52 | 53 |
| 53 int GetPageCount() const; | 54 int GetPageCount() const; |
| 54 CPDF_Dictionary* GetPage(int iPage); | 55 CPDF_Dictionary* GetPage(int iPage); |
| 55 int GetPageIndex(uint32_t objnum); | 56 int GetPageIndex(uint32_t objnum); |
| 56 uint32_t GetUserPermissions() const; | 57 uint32_t GetUserPermissions() const; |
| 57 CPDF_DocPageData* GetPageData() const { return m_pDocPage; } | 58 CPDF_DocPageData* GetPageData() const { return m_pDocPage; } |
| 58 void ClearPageData(); | 59 void ClearPageData(); |
| 59 void RemoveColorSpaceFromPageData(CPDF_Object* pObject); | 60 void RemoveColorSpaceFromPageData(CPDF_Object* pObject); |
| 60 | 61 |
| 61 std::unique_ptr<CFX_Deletable>* CodecContext() { return &m_pCodecContext; } | 62 std::unique_ptr<JBig2_DocumentContext>* CodecContext() { |
| 63 return &m_pCodecContext; |
| 64 } |
| 62 std::unique_ptr<CPDF_LinkList>* LinksContext() { return &m_pLinksContext; } | 65 std::unique_ptr<CPDF_LinkList>* LinksContext() { return &m_pLinksContext; } |
| 63 | 66 |
| 64 CPDF_DocRenderData* GetRenderData() const { return m_pDocRender.get(); } | 67 CPDF_DocRenderData* GetRenderData() const { return m_pDocRender.get(); } |
| 65 void ClearRenderData(); | 68 void ClearRenderData(); |
| 66 void ClearRenderFont(); | 69 void ClearRenderFont(); |
| 67 | 70 |
| 68 FX_BOOL IsFormStream(uint32_t objnum, FX_BOOL& bForm) const; | 71 FX_BOOL IsFormStream(uint32_t objnum, FX_BOOL& bForm) const; |
| 69 | 72 |
| 70 // |pFontDict| must not be null. | 73 // |pFontDict| must not be null. |
| 71 CPDF_Font* LoadFont(CPDF_Dictionary* pFontDict); | 74 CPDF_Font* LoadFont(CPDF_Dictionary* pFontDict); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 CPDF_Dictionary* m_pInfoDict; | 130 CPDF_Dictionary* m_pInfoDict; |
| 128 CFX_ByteString m_ID1; | 131 CFX_ByteString m_ID1; |
| 129 CFX_ByteString m_ID2; | 132 CFX_ByteString m_ID2; |
| 130 bool m_bLinearized; | 133 bool m_bLinearized; |
| 131 int m_iFirstPageNo; | 134 int m_iFirstPageNo; |
| 132 uint32_t m_dwFirstPageObjNum; | 135 uint32_t m_dwFirstPageObjNum; |
| 133 CFX_ArrayTemplate<uint32_t> m_PageList; | 136 CFX_ArrayTemplate<uint32_t> m_PageList; |
| 134 // TODO(thestig): Figure out why this cannot be a std::unique_ptr. | 137 // TODO(thestig): Figure out why this cannot be a std::unique_ptr. |
| 135 CPDF_DocPageData* m_pDocPage; | 138 CPDF_DocPageData* m_pDocPage; |
| 136 std::unique_ptr<CPDF_DocRenderData> m_pDocRender; | 139 std::unique_ptr<CPDF_DocRenderData> m_pDocRender; |
| 137 std::unique_ptr<CFX_Deletable> m_pCodecContext; | 140 std::unique_ptr<JBig2_DocumentContext> m_pCodecContext; |
| 138 std::unique_ptr<CPDF_LinkList> m_pLinksContext; | 141 std::unique_ptr<CPDF_LinkList> m_pLinksContext; |
| 139 }; | 142 }; |
| 140 | 143 |
| 141 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DOCUMENT_H_ | 144 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DOCUMENT_H_ |
| OLD | NEW |