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 12 matching lines...) Expand all Loading... |
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 // Layering prevents fxcrt from knowing about FPDF_FILEACCESS, so this can't | 28 // Layering prevents fxcrt from knowing about FPDF_FILEACCESS, so this can't |
29 // be a static method of IFX_SeekableReadStream. | 29 // be a static method of IFX_SeekableReadStream. |
30 IFX_SeekableReadStream* MakeSeekableReadStream(FPDF_FILEACCESS* pFileAccess); | 30 IFX_SeekableReadStream* MakeSeekableReadStream(FPDF_FILEACCESS* pFileAccess); |
31 | 31 |
32 #ifdef PDF_ENABLE_XFA | 32 #ifdef PDF_ENABLE_XFA |
33 class CFPDF_FileStream : public IFX_SeekableStream { | 33 // Layering prevents fxcrt from knowing about FPDF_FILEHANDLER, so this can't |
34 public: | 34 // be a static method of IFX_SeekableStream. |
35 explicit CFPDF_FileStream(FPDF_FILEHANDLER* pFS); | 35 IFX_SeekableStream* MakeSeekableStream(FPDF_FILEHANDLER* pFileHandler); |
36 ~CFPDF_FileStream() override {} | |
37 | |
38 // IFX_SeekableStream: | |
39 IFX_SeekableStream* Retain() override; | |
40 void Release() override; | |
41 FX_FILESIZE GetSize() override; | |
42 bool IsEOF() override; | |
43 FX_FILESIZE GetPosition() override; | |
44 bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; | |
45 size_t ReadBlock(void* buffer, size_t size) override; | |
46 bool WriteBlock(const void* buffer, FX_FILESIZE offset, size_t size) override; | |
47 bool Flush() override; | |
48 | |
49 void SetPosition(FX_FILESIZE pos) { m_nCurPos = pos; } | |
50 | |
51 protected: | |
52 FPDF_FILEHANDLER* m_pFS; | |
53 FX_FILESIZE m_nCurPos; | |
54 }; | |
55 #endif // PDF_ENABLE_XFA | 36 #endif // PDF_ENABLE_XFA |
56 | 37 |
57 // Object types for public FPDF_ types; these correspond to next layer down | 38 // Object types for public FPDF_ types; these correspond to next layer down |
58 // from fpdfsdk. For master, these are CPDF_ types, but for XFA, these are | 39 // from fpdfsdk. For master, these are CPDF_ types, but for XFA, these are |
59 // CPDFXFA_ types. | 40 // CPDFXFA_ types. |
60 #ifndef PDF_ENABLE_XFA | 41 #ifndef PDF_ENABLE_XFA |
61 using UnderlyingDocumentType = CPDF_Document; | 42 using UnderlyingDocumentType = CPDF_Document; |
62 using UnderlyingPageType = CPDF_Page; | 43 using UnderlyingPageType = CPDF_Page; |
63 #else // PDF_ENABLE_XFA | 44 #else // PDF_ENABLE_XFA |
64 using UnderlyingDocumentType = CPDFXFA_Context; | 45 using UnderlyingDocumentType = CPDFXFA_Context; |
(...skipping 25 matching lines...) Expand all Loading... |
90 int rotate, | 71 int rotate, |
91 int flags, | 72 int flags, |
92 bool bNeedToRestore, | 73 bool bNeedToRestore, |
93 IFSDK_PAUSE_Adapter* pause); | 74 IFSDK_PAUSE_Adapter* pause); |
94 | 75 |
95 void CheckUnSupportError(CPDF_Document* pDoc, uint32_t err_code); | 76 void CheckUnSupportError(CPDF_Document* pDoc, uint32_t err_code); |
96 void CheckUnSupportAnnot(CPDF_Document* pDoc, const CPDF_Annot* pPDFAnnot); | 77 void CheckUnSupportAnnot(CPDF_Document* pDoc, const CPDF_Annot* pPDFAnnot); |
97 void ProcessParseError(CPDF_Parser::Error err); | 78 void ProcessParseError(CPDF_Parser::Error err); |
98 | 79 |
99 #endif // FPDFSDK_FSDK_DEFINE_H_ | 80 #endif // FPDFSDK_FSDK_DEFINE_H_ |
OLD | NEW |