diff options
Diffstat (limited to 'fpdfsdk/include/fsdk_define.h')
-rw-r--r-- | fpdfsdk/include/fsdk_define.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/fpdfsdk/include/fsdk_define.h b/fpdfsdk/include/fsdk_define.h index 6242696f9a..7f9c38791e 100644 --- a/fpdfsdk/include/fsdk_define.h +++ b/fpdfsdk/include/fsdk_define.h @@ -17,6 +17,16 @@ #include "core/include/fxge/fx_ge_win32.h" #include "public/fpdfview.h" +#ifdef PDF_ENABLE_XFA +#include "fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h" +#include "fpdfsdk/include/fpdfxfa/fpdfxfa_page.h" +#include "xfa/include/fwl/adapter/fwl_adaptertimermgr.h" +#include "xfa/include/fxbarcode/BC_BarCode.h" +#include "xfa/include/fxfa/fxfa.h" +#include "xfa/include/fxgraphics/fx_graphics.h" +#include "xfa/include/fxjse/fxjse.h" +#endif // PDF_ENABLE_XFA + #ifdef _WIN32 #include <tchar.h> #include <math.h> @@ -46,15 +56,56 @@ class CPDF_CustomAccess final : public IFX_FileRead { void Release() override { delete this; } FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; +#ifdef PDF_ENABLE_XFA + virtual CFX_ByteString GetFullPath() { return ""; } + virtual FX_BOOL GetByte(FX_DWORD pos, uint8_t& ch); + virtual FX_BOOL GetBlock(FX_DWORD pos, uint8_t* pBuf, FX_DWORD size); +#endif // PDF_ENABLE_XFA + private: FPDF_FILEACCESS m_FileAccess; +#ifdef PDF_ENABLE_XFA + uint8_t m_Buffer[512]; + FX_DWORD m_BufferOffset; +#endif // PDF_ENABLE_XFA +}; + +#ifdef PDF_ENABLE_XFA +class CFPDF_FileStream : public IFX_FileStream { + public: + CFPDF_FileStream(FPDF_FILEHANDLER* pFS); + virtual ~CFPDF_FileStream() {} + + virtual IFX_FileStream* Retain(); + virtual void Release(); + + virtual FX_FILESIZE GetSize(); + virtual FX_BOOL IsEOF(); + virtual FX_FILESIZE GetPosition() { return m_nCurPos; } + virtual void SetPosition(FX_FILESIZE pos) { m_nCurPos = pos; } + virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size); + virtual size_t ReadBlock(void* buffer, size_t size); + virtual FX_BOOL WriteBlock(const void* buffer, + FX_FILESIZE offset, + size_t size); + virtual FX_BOOL Flush(); + + protected: + FPDF_FILEHANDLER* m_pFS; + FX_FILESIZE m_nCurPos; }; +#endif // PDF_ENABLE_XFA // Object types for public FPDF_ types; these correspond to next layer down // from fpdfsdk. For master, these are CPDF_ types, but for XFA, these are // CPDFXFA_ types. +#ifndef PDF_ENABLE_XFA using UnderlyingDocumentType = CPDF_Document; using UnderlyingPageType = CPDF_Page; +#else // PDF_ENABLE_XFA +using UnderlyingDocumentType = CPDFXFA_Document; +using UnderlyingPageType = CPDFXFA_Page; +#endif // PDF_ENABLE_XFA // Conversions to/from underlying types. UnderlyingDocumentType* UnderlyingFromFPDFDocument(FPDF_DOCUMENT doc); |