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 30 matching lines...) Expand all Loading... |
41 | 41 |
42 class CPDF_Document : public CPDF_IndirectObjectHolder { | 42 class CPDF_Document : public CPDF_IndirectObjectHolder { |
43 public: | 43 public: |
44 explicit CPDF_Document(std::unique_ptr<CPDF_Parser> pParser); | 44 explicit CPDF_Document(std::unique_ptr<CPDF_Parser> pParser); |
45 ~CPDF_Document() override; | 45 ~CPDF_Document() override; |
46 | 46 |
47 CPDF_Parser* GetParser() const { return m_pParser.get(); } | 47 CPDF_Parser* GetParser() const { return m_pParser.get(); } |
48 CPDF_Dictionary* GetRoot() const { return m_pRootDict; } | 48 CPDF_Dictionary* GetRoot() const { return m_pRootDict; } |
49 CPDF_Dictionary* GetInfo() const { return m_pInfoDict; } | 49 CPDF_Dictionary* GetInfo() const { return m_pInfoDict; } |
50 | 50 |
| 51 void DeletePage(int iPage); |
51 int GetPageCount() const; | 52 int GetPageCount() const; |
| 53 |
52 CPDF_Dictionary* GetPage(int iPage); | 54 CPDF_Dictionary* GetPage(int iPage); |
53 int GetPageIndex(uint32_t objnum); | 55 int GetPageIndex(uint32_t objnum); |
54 uint32_t GetUserPermissions() const; | 56 uint32_t GetUserPermissions() const; |
55 CPDF_DocPageData* GetPageData() const { return m_pDocPage; } | 57 CPDF_DocPageData* GetPageData() const { return m_pDocPage; } |
56 | 58 |
57 std::unique_ptr<JBig2_DocumentContext>* CodecContext() { | 59 std::unique_ptr<JBig2_DocumentContext>* CodecContext() { |
58 return &m_pCodecContext; | 60 return &m_pCodecContext; |
59 } | 61 } |
60 std::unique_ptr<CPDF_LinkList>* LinksContext() { return &m_pLinksContext; } | 62 std::unique_ptr<CPDF_LinkList>* LinksContext() { return &m_pLinksContext; } |
61 | 63 |
62 CPDF_DocRenderData* GetRenderData() const { return m_pDocRender.get(); } | 64 CPDF_DocRenderData* GetRenderData() const { return m_pDocRender.get(); } |
63 | 65 |
64 // |pFontDict| must not be null. | 66 // |pFontDict| must not be null. |
65 CPDF_Font* LoadFont(CPDF_Dictionary* pFontDict); | 67 CPDF_Font* LoadFont(CPDF_Dictionary* pFontDict); |
66 CPDF_ColorSpace* LoadColorSpace(CPDF_Object* pCSObj, | 68 CPDF_ColorSpace* LoadColorSpace(CPDF_Object* pCSObj, |
67 CPDF_Dictionary* pResources = nullptr); | 69 CPDF_Dictionary* pResources = nullptr); |
68 | 70 |
69 CPDF_Pattern* LoadPattern(CPDF_Object* pObj, | 71 CPDF_Pattern* LoadPattern(CPDF_Object* pObj, |
70 FX_BOOL bShading, | 72 FX_BOOL bShading, |
71 const CFX_Matrix& matrix); | 73 const CFX_Matrix& matrix); |
72 | 74 |
73 CPDF_Image* LoadImageF(CPDF_Object* pObj); | 75 CPDF_Image* LoadImageF(CPDF_Object* pObj); |
74 CPDF_StreamAcc* LoadFontFile(CPDF_Stream* pStream); | 76 CPDF_StreamAcc* LoadFontFile(CPDF_Stream* pStream); |
75 CPDF_IccProfile* LoadIccProfile(CPDF_Stream* pStream); | 77 CPDF_IccProfile* LoadIccProfile(CPDF_Stream* pStream); |
76 | 78 |
77 void LoadDoc(); | 79 void LoadDoc(); |
78 void LoadLinearizedDoc(CPDF_Dictionary* pLinearizationParams); | 80 void LoadLinearizedDoc(CPDF_Dictionary* pLinearizationParams); |
79 void LoadPages(); | 81 void LoadPages(); |
80 | 82 |
81 // Editing methods. | |
82 void CreateNewDoc(); | 83 void CreateNewDoc(); |
83 CPDF_Dictionary* CreateNewPage(int iPage); | 84 CPDF_Dictionary* CreateNewPage(int iPage); |
84 void DeletePage(int iPage); | 85 |
85 CPDF_Font* AddStandardFont(const FX_CHAR* font, CPDF_FontEncoding* pEncoding); | 86 CPDF_Font* AddStandardFont(const FX_CHAR* font, CPDF_FontEncoding* pEncoding); |
86 CPDF_Font* AddFont(CFX_Font* pFont, int charset, FX_BOOL bVert); | 87 CPDF_Font* AddFont(CFX_Font* pFont, int charset, FX_BOOL bVert); |
87 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 88 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
88 CPDF_Font* AddWindowsFont(LOGFONTA* pLogFont, | 89 CPDF_Font* AddWindowsFont(LOGFONTA* pLogFont, |
89 FX_BOOL bVert, | 90 FX_BOOL bVert, |
90 FX_BOOL bTranslateName = FALSE); | 91 FX_BOOL bTranslateName = FALSE); |
91 CPDF_Font* AddWindowsFont(LOGFONTW* pLogFont, | 92 CPDF_Font* AddWindowsFont(LOGFONTW* pLogFont, |
92 FX_BOOL bVert, | 93 FX_BOOL bVert, |
93 FX_BOOL bTranslateName = FALSE); | 94 FX_BOOL bTranslateName = FALSE); |
94 #endif | 95 #endif |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 CPDF_Dictionary* GetPagesDict() const; | 132 CPDF_Dictionary* GetPagesDict() const; |
132 CPDF_Dictionary* ProcessbCJK( | 133 CPDF_Dictionary* ProcessbCJK( |
133 CPDF_Dictionary* pBaseDict, | 134 CPDF_Dictionary* pBaseDict, |
134 int charset, | 135 int charset, |
135 FX_BOOL bVert, | 136 FX_BOOL bVert, |
136 CFX_ByteString basefont, | 137 CFX_ByteString basefont, |
137 std::function<void(FX_WCHAR, FX_WCHAR, CPDF_Array*)> Insert); | 138 std::function<void(FX_WCHAR, FX_WCHAR, CPDF_Array*)> Insert); |
138 }; | 139 }; |
139 | 140 |
140 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DOCUMENT_H_ | 141 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DOCUMENT_H_ |
OLD | NEW |