OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 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 FPDFSDK_FSDK_DEFINE_H_ | 7 #ifndef FPDFSDK_FSDK_DEFINE_H_ |
8 #define FPDFSDK_FSDK_DEFINE_H_ | 8 #define FPDFSDK_FSDK_DEFINE_H_ |
9 | 9 |
10 #include "core/fpdfapi/parser/cpdf_parser.h" | 10 #include "core/fpdfapi/parser/cpdf_parser.h" |
11 #include "core/fxge/fx_dib.h" | 11 #include "core/fxge/fx_dib.h" |
12 #include "public/fpdfview.h" | 12 #include "public/fpdfview.h" |
13 | 13 |
14 #ifdef PDF_ENABLE_XFA | 14 #ifdef PDF_ENABLE_XFA |
15 #include "fpdfsdk/fpdfxfa/cpdfxfa_document.h" | 15 #include "fpdfsdk/fpdfxfa/cpdfxfa_document.h" |
16 #endif // PDF_ENABLE_XFA | 16 #endif // PDF_ENABLE_XFA |
17 | 17 |
18 #ifdef _WIN32 | 18 #ifdef _WIN32 |
19 #include <math.h> | 19 #include <math.h> |
20 #include <tchar.h> | 20 #include <tchar.h> |
21 #endif | 21 #endif |
22 | 22 |
23 class CPDF_Annot; | 23 class CPDF_Annot; |
24 class CPDF_Page; | 24 class CPDF_Page; |
25 class CPDF_PageRenderContext; | 25 class CPDF_PageRenderContext; |
26 class IFSDK_PAUSE_Adapter; | 26 class IFSDK_PAUSE_Adapter; |
27 | 27 |
28 class CPDF_CustomAccess final : public IFX_FileRead { | 28 class CPDF_CustomAccess final : public IFX_SeekableReadStream { |
29 public: | 29 public: |
30 explicit CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess); | 30 explicit CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess); |
31 ~CPDF_CustomAccess() override {} | 31 ~CPDF_CustomAccess() override {} |
32 | 32 |
33 // IFX_FileRead | 33 // IFX_SeekableReadStream |
34 FX_FILESIZE GetSize() override; | 34 FX_FILESIZE GetSize() override; |
35 void Release() override; | 35 void Release() override; |
36 FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; | 36 FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; |
37 | 37 |
38 private: | 38 private: |
39 FPDF_FILEACCESS m_FileAccess; | 39 FPDF_FILEACCESS m_FileAccess; |
40 }; | 40 }; |
41 | 41 |
42 #ifdef PDF_ENABLE_XFA | 42 #ifdef PDF_ENABLE_XFA |
43 class CFPDF_FileStream : public IFX_FileStream { | 43 class CFPDF_FileStream : public IFX_SeekableStream { |
44 public: | 44 public: |
45 explicit CFPDF_FileStream(FPDF_FILEHANDLER* pFS); | 45 explicit CFPDF_FileStream(FPDF_FILEHANDLER* pFS); |
46 ~CFPDF_FileStream() override {} | 46 ~CFPDF_FileStream() override {} |
47 | 47 |
48 // IFX_FileStream: | 48 // IFX_SeekableStream: |
49 IFX_FileStream* Retain() override; | 49 IFX_SeekableStream* Retain() override; |
50 void Release() override; | 50 void Release() override; |
51 FX_FILESIZE GetSize() override; | 51 FX_FILESIZE GetSize() override; |
52 FX_BOOL IsEOF() override; | 52 FX_BOOL IsEOF() override; |
53 FX_FILESIZE GetPosition() override; | 53 FX_FILESIZE GetPosition() override; |
54 FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; | 54 FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; |
55 size_t ReadBlock(void* buffer, size_t size) override; | 55 size_t ReadBlock(void* buffer, size_t size) override; |
56 FX_BOOL WriteBlock(const void* buffer, | 56 FX_BOOL WriteBlock(const void* buffer, |
57 FX_FILESIZE offset, | 57 FX_FILESIZE offset, |
58 size_t size) override; | 58 size_t size) override; |
59 FX_BOOL Flush() override; | 59 FX_BOOL Flush() override; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 int rotate, | 102 int rotate, |
103 int flags, | 103 int flags, |
104 FX_BOOL bNeedToRestore, | 104 FX_BOOL bNeedToRestore, |
105 IFSDK_PAUSE_Adapter* pause); | 105 IFSDK_PAUSE_Adapter* pause); |
106 | 106 |
107 void CheckUnSupportError(CPDF_Document* pDoc, uint32_t err_code); | 107 void CheckUnSupportError(CPDF_Document* pDoc, uint32_t err_code); |
108 void CheckUnSupportAnnot(CPDF_Document* pDoc, const CPDF_Annot* pPDFAnnot); | 108 void CheckUnSupportAnnot(CPDF_Document* pDoc, const CPDF_Annot* pPDFAnnot); |
109 void ProcessParseError(CPDF_Parser::Error err); | 109 void ProcessParseError(CPDF_Parser::Error err); |
110 | 110 |
111 #endif // FPDFSDK_FSDK_DEFINE_H_ | 111 #endif // FPDFSDK_FSDK_DEFINE_H_ |
OLD | NEW |