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> |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 CPDF_Font* AddFont(CFX_Font* pFont, int charset, FX_BOOL bVert); | 90 CPDF_Font* AddFont(CFX_Font* pFont, int charset, FX_BOOL bVert); |
91 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 91 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
92 CPDF_Font* AddWindowsFont(LOGFONTA* pLogFont, | 92 CPDF_Font* AddWindowsFont(LOGFONTA* pLogFont, |
93 FX_BOOL bVert, | 93 FX_BOOL bVert, |
94 FX_BOOL bTranslateName = FALSE); | 94 FX_BOOL bTranslateName = FALSE); |
95 CPDF_Font* AddWindowsFont(LOGFONTW* pLogFont, | 95 CPDF_Font* AddWindowsFont(LOGFONTW* pLogFont, |
96 FX_BOOL bVert, | 96 FX_BOOL bVert, |
97 FX_BOOL bTranslateName = FALSE); | 97 FX_BOOL bTranslateName = FALSE); |
98 #endif | 98 #endif |
99 | 99 |
100 protected: | 100 private: |
101 friend class CPDF_Creator; | 101 friend class CPDF_TestDocument; |
102 friend class CPDF_Parser; | |
103 | 102 |
104 // Retrieve page count information by getting count value from the tree nodes | 103 // Retrieve page count information by getting count value from the tree nodes |
105 int RetrievePageCount() const; | 104 int RetrievePageCount() const; |
106 CPDF_Dictionary* FindPDFPage(CPDF_Dictionary* pPages, | 105 CPDF_Dictionary* FindPDFPage(CPDF_Dictionary* pPages, |
107 int iPage, | 106 int iPage, |
108 int nPagesToGo, | 107 int nPagesToGo, |
109 int level); | 108 int level); |
110 int FindPageIndex(CPDF_Dictionary* pNode, | 109 int FindPageIndex(CPDF_Dictionary* pNode, |
111 uint32_t& skip_count, | 110 uint32_t& skip_count, |
112 uint32_t objnum, | 111 uint32_t objnum, |
113 int& index, | 112 int& index, |
114 int level = 0); | 113 int level = 0); |
115 CPDF_Object* ParseIndirectObject(uint32_t objnum) override; | 114 CPDF_Object* ParseIndirectObject(uint32_t objnum) override; |
| 115 void LoadDocInternal(); |
| 116 size_t CalculateEncodingDict(int charset, CPDF_Dictionary* pBaseDict); |
| 117 CPDF_Dictionary* GetPagesDict() const; |
| 118 CPDF_Dictionary* ProcessbCJK( |
| 119 CPDF_Dictionary* pBaseDict, |
| 120 int charset, |
| 121 FX_BOOL bVert, |
| 122 CFX_ByteString basefont, |
| 123 std::function<void(FX_WCHAR, FX_WCHAR, CPDF_Array*)> Insert); |
116 | 124 |
117 std::unique_ptr<CPDF_Parser> m_pParser; | 125 std::unique_ptr<CPDF_Parser> m_pParser; |
118 CPDF_Dictionary* m_pRootDict; | 126 CPDF_Dictionary* m_pRootDict; |
119 CPDF_Dictionary* m_pInfoDict; | 127 CPDF_Dictionary* m_pInfoDict; |
120 bool m_bLinearized; | 128 bool m_bLinearized; |
121 int m_iFirstPageNo; | 129 int m_iFirstPageNo; |
122 uint32_t m_dwFirstPageObjNum; | 130 uint32_t m_dwFirstPageObjNum; |
123 // TODO(thestig): Figure out why this cannot be a std::unique_ptr. | 131 // TODO(thestig): Figure out why this cannot be a std::unique_ptr. |
124 CPDF_DocPageData* m_pDocPage; | 132 CPDF_DocPageData* m_pDocPage; |
125 std::unique_ptr<CPDF_DocRenderData> m_pDocRender; | 133 std::unique_ptr<CPDF_DocRenderData> m_pDocRender; |
126 std::unique_ptr<JBig2_DocumentContext> m_pCodecContext; | 134 std::unique_ptr<JBig2_DocumentContext> m_pCodecContext; |
127 std::unique_ptr<CPDF_LinkList> m_pLinksContext; | 135 std::unique_ptr<CPDF_LinkList> m_pLinksContext; |
128 | |
129 private: | |
130 void LoadDocInternal(); | |
131 size_t CalculateEncodingDict(int charset, CPDF_Dictionary* pBaseDict); | |
132 CPDF_Dictionary* GetPagesDict() const; | |
133 CPDF_Dictionary* ProcessbCJK( | |
134 CPDF_Dictionary* pBaseDict, | |
135 int charset, | |
136 FX_BOOL bVert, | |
137 CFX_ByteString basefont, | |
138 std::function<void(FX_WCHAR, FX_WCHAR, CPDF_Array*)> Insert); | |
139 | |
140 CFX_ArrayTemplate<uint32_t> m_PageList; | 136 CFX_ArrayTemplate<uint32_t> m_PageList; |
141 }; | 137 }; |
142 | 138 |
143 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DOCUMENT_H_ | 139 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DOCUMENT_H_ |
OLD | NEW |