Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: core/fpdfapi/fpdf_parser/include/cpdf_document.h

Issue 2349353003: CPDF_Document friend cleanup (Closed)
Patch Set: Rebase to master Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698