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_INCLUDE_FSDK_DEFINE_H_ | 7 #ifndef FPDFSDK_INCLUDE_FSDK_DEFINE_H_ |
8 #define FPDFSDK_INCLUDE_FSDK_DEFINE_H_ | 8 #define FPDFSDK_INCLUDE_FSDK_DEFINE_H_ |
9 | 9 |
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_parser.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_parser.h" |
11 #include "core/fpdfdoc/include/fpdf_doc.h" | 11 #include "core/fpdfdoc/include/fpdf_doc.h" |
12 #include "core/fxge/include/fx_ge.h" | |
13 #include "core/fxge/include/fx_ge_win32.h" | |
14 #include "public/fpdfview.h" | 12 #include "public/fpdfview.h" |
15 | 13 |
16 #ifdef PDF_ENABLE_XFA | 14 #ifdef PDF_ENABLE_XFA |
17 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h" | 15 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h" |
18 #endif // PDF_ENABLE_XFA | 16 #endif // PDF_ENABLE_XFA |
19 | 17 |
20 #ifdef _WIN32 | 18 #ifdef _WIN32 |
21 #include <math.h> | 19 #include <math.h> |
22 #include <tchar.h> | 20 #include <tchar.h> |
23 #endif | 21 #endif |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 FPDF_FILEACCESS m_FileAccess; | 54 FPDF_FILEACCESS m_FileAccess; |
57 #ifdef PDF_ENABLE_XFA | 55 #ifdef PDF_ENABLE_XFA |
58 uint8_t m_Buffer[512]; | 56 uint8_t m_Buffer[512]; |
59 uint32_t m_BufferOffset; | 57 uint32_t m_BufferOffset; |
60 #endif // PDF_ENABLE_XFA | 58 #endif // PDF_ENABLE_XFA |
61 }; | 59 }; |
62 | 60 |
63 #ifdef PDF_ENABLE_XFA | 61 #ifdef PDF_ENABLE_XFA |
64 class CFPDF_FileStream : public IFX_FileStream { | 62 class CFPDF_FileStream : public IFX_FileStream { |
65 public: | 63 public: |
66 CFPDF_FileStream(FPDF_FILEHANDLER* pFS); | 64 explicit CFPDF_FileStream(FPDF_FILEHANDLER* pFS); |
67 virtual ~CFPDF_FileStream() {} | 65 ~CFPDF_FileStream() override {} |
68 | 66 |
69 virtual IFX_FileStream* Retain(); | 67 // IFX_FileStream: |
70 virtual void Release(); | 68 IFX_FileStream* Retain() override; |
| 69 void Release() override; |
| 70 FX_FILESIZE GetSize() override; |
| 71 FX_BOOL IsEOF() override; |
| 72 FX_FILESIZE GetPosition() override { return m_nCurPos; } |
| 73 FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; |
| 74 size_t ReadBlock(void* buffer, size_t size) override; |
| 75 FX_BOOL WriteBlock(const void* buffer, |
| 76 FX_FILESIZE offset, |
| 77 size_t size) override; |
| 78 FX_BOOL Flush() override; |
71 | 79 |
72 virtual FX_FILESIZE GetSize(); | 80 void SetPosition(FX_FILESIZE pos) { m_nCurPos = pos; } |
73 virtual FX_BOOL IsEOF(); | |
74 virtual FX_FILESIZE GetPosition() { return m_nCurPos; } | |
75 virtual void SetPosition(FX_FILESIZE pos) { m_nCurPos = pos; } | |
76 virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size); | |
77 virtual size_t ReadBlock(void* buffer, size_t size); | |
78 virtual FX_BOOL WriteBlock(const void* buffer, | |
79 FX_FILESIZE offset, | |
80 size_t size); | |
81 virtual FX_BOOL Flush(); | |
82 | 81 |
83 protected: | 82 protected: |
84 FPDF_FILEHANDLER* m_pFS; | 83 FPDF_FILEHANDLER* m_pFS; |
85 FX_FILESIZE m_nCurPos; | 84 FX_FILESIZE m_nCurPos; |
86 }; | 85 }; |
87 #endif // PDF_ENABLE_XFA | 86 #endif // PDF_ENABLE_XFA |
88 | 87 |
89 // Object types for public FPDF_ types; these correspond to next layer down | 88 // Object types for public FPDF_ types; these correspond to next layer down |
90 // from fpdfsdk. For master, these are CPDF_ types, but for XFA, these are | 89 // from fpdfsdk. For master, these are CPDF_ types, but for XFA, these are |
91 // CPDFXFA_ types. | 90 // CPDFXFA_ types. |
(...skipping 28 matching lines...) Expand all Loading... |
120 int rotate, | 119 int rotate, |
121 int flags, | 120 int flags, |
122 FX_BOOL bNeedToRestore, | 121 FX_BOOL bNeedToRestore, |
123 IFSDK_PAUSE_Adapter* pause); | 122 IFSDK_PAUSE_Adapter* pause); |
124 | 123 |
125 void CheckUnSupportError(CPDF_Document* pDoc, uint32_t err_code); | 124 void CheckUnSupportError(CPDF_Document* pDoc, uint32_t err_code); |
126 void CheckUnSupportAnnot(CPDF_Document* pDoc, const CPDF_Annot* pPDFAnnot); | 125 void CheckUnSupportAnnot(CPDF_Document* pDoc, const CPDF_Annot* pPDFAnnot); |
127 void ProcessParseError(CPDF_Parser::Error err); | 126 void ProcessParseError(CPDF_Parser::Error err); |
128 | 127 |
129 #endif // FPDFSDK_INCLUDE_FSDK_DEFINE_H_ | 128 #endif // FPDFSDK_INCLUDE_FSDK_DEFINE_H_ |
OLD | NEW |