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" |
(...skipping 15 matching lines...) Expand all Loading... |
26 class IFSDK_PAUSE_Adapter; | 26 class IFSDK_PAUSE_Adapter; |
27 | 27 |
28 class CPDF_CustomAccess final : public IFX_SeekableReadStream { | 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_SeekableReadStream | 33 // IFX_SeekableReadStream |
34 FX_FILESIZE GetSize() override; | 34 FX_FILESIZE GetSize() override; |
35 void Release() override; | 35 void Release() override; |
36 bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; | 36 bool IsEOF() override; |
| 37 size_t ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; |
37 | 38 |
38 private: | 39 private: |
39 FPDF_FILEACCESS m_FileAccess; | 40 FPDF_FILEACCESS m_FileAccess; |
| 41 FX_FILESIZE m_nCurPos; |
40 }; | 42 }; |
41 | 43 |
42 #ifdef PDF_ENABLE_XFA | 44 #ifdef PDF_ENABLE_XFA |
43 class CFPDF_FileStream : public IFX_SeekableStream { | 45 class CFPDF_FileStream : public IFX_SeekableStream { |
44 public: | 46 public: |
45 explicit CFPDF_FileStream(FPDF_FILEHANDLER* pFS); | 47 explicit CFPDF_FileStream(FPDF_FILEHANDLER* pFS); |
46 ~CFPDF_FileStream() override {} | 48 ~CFPDF_FileStream() override {} |
47 | 49 |
48 // IFX_SeekableStream: | 50 // IFX_SeekableStream: |
49 IFX_SeekableStream* Retain() override; | 51 IFX_SeekableStream* Retain() override; |
50 void Release() override; | 52 void Release() override; |
51 FX_FILESIZE GetSize() override; | 53 FX_FILESIZE GetSize() override; |
52 bool IsEOF() override; | 54 bool IsEOF() override; |
53 FX_FILESIZE GetPosition() override; | 55 FX_FILESIZE GetPosition() override; |
54 bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; | 56 size_t ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; |
55 size_t ReadBlock(void* buffer, size_t size) override; | 57 size_t ReadBlock(void* buffer, size_t size) override; |
56 bool WriteBlock(const void* buffer, FX_FILESIZE offset, size_t size) override; | 58 bool WriteBlock(const void* buffer, FX_FILESIZE offset, size_t size) override; |
57 bool Flush() override; | 59 bool Flush() override; |
58 | 60 |
59 void SetPosition(FX_FILESIZE pos) { m_nCurPos = pos; } | 61 void SetPosition(FX_FILESIZE pos) { m_nCurPos = pos; } |
60 | 62 |
61 protected: | 63 protected: |
62 FPDF_FILEHANDLER* m_pFS; | 64 FPDF_FILEHANDLER* m_pFS; |
63 FX_FILESIZE m_nCurPos; | 65 FX_FILESIZE m_nCurPos; |
64 }; | 66 }; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 int rotate, | 102 int rotate, |
101 int flags, | 103 int flags, |
102 bool bNeedToRestore, | 104 bool bNeedToRestore, |
103 IFSDK_PAUSE_Adapter* pause); | 105 IFSDK_PAUSE_Adapter* pause); |
104 | 106 |
105 void CheckUnSupportError(CPDF_Document* pDoc, uint32_t err_code); | 107 void CheckUnSupportError(CPDF_Document* pDoc, uint32_t err_code); |
106 void CheckUnSupportAnnot(CPDF_Document* pDoc, const CPDF_Annot* pPDFAnnot); | 108 void CheckUnSupportAnnot(CPDF_Document* pDoc, const CPDF_Annot* pPDFAnnot); |
107 void ProcessParseError(CPDF_Parser::Error err); | 109 void ProcessParseError(CPDF_Parser::Error err); |
108 | 110 |
109 #endif // FPDFSDK_FSDK_DEFINE_H_ | 111 #endif // FPDFSDK_FSDK_DEFINE_H_ |
OLD | NEW |