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 30 matching lines...) Expand all Loading... | |
41 class CPDF_Document : public CPDF_IndirectObjectHolder { | 41 class CPDF_Document : public CPDF_IndirectObjectHolder { |
42 public: | 42 public: |
43 explicit CPDF_Document(std::unique_ptr<CPDF_Parser> pParser); | 43 explicit CPDF_Document(std::unique_ptr<CPDF_Parser> pParser); |
44 ~CPDF_Document() override; | 44 ~CPDF_Document() override; |
45 | 45 |
46 CPDF_Parser* GetParser() const { return m_pParser.get(); } | 46 CPDF_Parser* GetParser() const { return m_pParser.get(); } |
47 CPDF_Dictionary* GetRoot() const { return m_pRootDict; } | 47 CPDF_Dictionary* GetRoot() const { return m_pRootDict; } |
48 CPDF_Dictionary* GetInfo() const { return m_pInfoDict; } | 48 CPDF_Dictionary* GetInfo() const { return m_pInfoDict; } |
49 | 49 |
50 int GetPageCount() const; | 50 int GetPageCount() const; |
51 CPDF_Dictionary* GetPagesDict() const; | |
dsinclair
2016/09/09 00:21:06
Put this in the private section?
npm
2016/09/09 14:24:15
Done, but method no longer used in InsertNewPage.
| |
51 CPDF_Dictionary* GetPage(int iPage); | 52 CPDF_Dictionary* GetPage(int iPage); |
52 int GetPageIndex(uint32_t objnum); | 53 int GetPageIndex(uint32_t objnum); |
53 uint32_t GetUserPermissions() const; | 54 uint32_t GetUserPermissions() const; |
54 CPDF_DocPageData* GetPageData() const { return m_pDocPage; } | 55 CPDF_DocPageData* GetPageData() const { return m_pDocPage; } |
55 | 56 |
56 std::unique_ptr<JBig2_DocumentContext>* CodecContext() { | 57 std::unique_ptr<JBig2_DocumentContext>* CodecContext() { |
57 return &m_pCodecContext; | 58 return &m_pCodecContext; |
58 } | 59 } |
59 std::unique_ptr<CPDF_LinkList>* LinksContext() { return &m_pLinksContext; } | 60 std::unique_ptr<CPDF_LinkList>* LinksContext() { return &m_pLinksContext; } |
60 | 61 |
61 CPDF_DocRenderData* GetRenderData() const { return m_pDocRender.get(); } | 62 CPDF_DocRenderData* GetRenderData() const { return m_pDocRender.get(); } |
62 | 63 |
63 FX_BOOL IsFormStream(uint32_t objnum, FX_BOOL& bForm) const; | |
npm
2016/09/09 14:24:15
This slipped from delete CL, should have gone ther
| |
64 | |
65 // |pFontDict| must not be null. | 64 // |pFontDict| must not be null. |
66 CPDF_Font* LoadFont(CPDF_Dictionary* pFontDict); | 65 CPDF_Font* LoadFont(CPDF_Dictionary* pFontDict); |
67 CPDF_ColorSpace* LoadColorSpace(CPDF_Object* pCSObj, | 66 CPDF_ColorSpace* LoadColorSpace(CPDF_Object* pCSObj, |
68 CPDF_Dictionary* pResources = nullptr); | 67 CPDF_Dictionary* pResources = nullptr); |
69 | 68 |
70 CPDF_Pattern* LoadPattern(CPDF_Object* pObj, | 69 CPDF_Pattern* LoadPattern(CPDF_Object* pObj, |
71 FX_BOOL bShading, | 70 FX_BOOL bShading, |
72 const CFX_Matrix& matrix); | 71 const CFX_Matrix& matrix); |
73 | 72 |
74 CPDF_Image* LoadImageF(CPDF_Object* pObj); | 73 CPDF_Image* LoadImageF(CPDF_Object* pObj); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
121 uint32_t m_dwFirstPageObjNum; | 120 uint32_t m_dwFirstPageObjNum; |
122 CFX_ArrayTemplate<uint32_t> m_PageList; | 121 CFX_ArrayTemplate<uint32_t> m_PageList; |
123 // TODO(thestig): Figure out why this cannot be a std::unique_ptr. | 122 // TODO(thestig): Figure out why this cannot be a std::unique_ptr. |
124 CPDF_DocPageData* m_pDocPage; | 123 CPDF_DocPageData* m_pDocPage; |
125 std::unique_ptr<CPDF_DocRenderData> m_pDocRender; | 124 std::unique_ptr<CPDF_DocRenderData> m_pDocRender; |
126 std::unique_ptr<JBig2_DocumentContext> m_pCodecContext; | 125 std::unique_ptr<JBig2_DocumentContext> m_pCodecContext; |
127 std::unique_ptr<CPDF_LinkList> m_pLinksContext; | 126 std::unique_ptr<CPDF_LinkList> m_pLinksContext; |
128 | 127 |
129 private: | 128 private: |
130 void LoadDocInternal(); | 129 void LoadDocInternal(); |
130 size_t CalculateEncodingDict(int charset, CPDF_Dictionary* pBaseDict); | |
131 }; | 131 }; |
132 | 132 |
133 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DOCUMENT_H_ | 133 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DOCUMENT_H_ |
OLD | NEW |