| 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" | 
| (...skipping 22 matching lines...) Expand all  Loading... | 
|   33 typedef unsigned int FX_UINT; |   33 typedef unsigned int FX_UINT; | 
|   34 class CRenderContext; |   34 class CRenderContext; | 
|   35 class IFSDK_PAUSE_Adapter; |   35 class IFSDK_PAUSE_Adapter; | 
|   36  |   36  | 
|   37 class CPDF_CustomAccess final : public IFX_FileRead { |   37 class CPDF_CustomAccess final : public IFX_FileRead { | 
|   38  public: |   38  public: | 
|   39   explicit CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess); |   39   explicit CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess); | 
|   40   ~CPDF_CustomAccess() override {} |   40   ~CPDF_CustomAccess() override {} | 
|   41  |   41  | 
|   42   // IFX_FileRead |   42   // IFX_FileRead | 
|   43   FX_FILESIZE GetSize() override { return m_FileAccess.m_FileLen; } |   43   FX_FILESIZE GetSize() override; | 
|   44   void Release() override { delete this; } |   44   void Release() override; | 
|   45   FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; |   45   FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; | 
|   46  |   46  | 
|   47 #ifdef PDF_ENABLE_XFA |   47 #ifdef PDF_ENABLE_XFA | 
|   48   virtual CFX_ByteString GetFullPath() { return ""; } |   48   virtual CFX_ByteString GetFullPath(); | 
|   49   virtual FX_BOOL GetByte(uint32_t pos, uint8_t& ch); |   49   virtual FX_BOOL GetByte(uint32_t pos, uint8_t& ch); | 
|   50   virtual FX_BOOL GetBlock(uint32_t pos, uint8_t* pBuf, uint32_t size); |   50   virtual FX_BOOL GetBlock(uint32_t pos, uint8_t* pBuf, uint32_t size); | 
|   51 #endif  // PDF_ENABLE_XFA |   51 #endif  // PDF_ENABLE_XFA | 
|   52  |   52  | 
|   53  private: |   53  private: | 
|   54   FPDF_FILEACCESS m_FileAccess; |   54   FPDF_FILEACCESS m_FileAccess; | 
|   55 #ifdef PDF_ENABLE_XFA |   55 #ifdef PDF_ENABLE_XFA | 
|   56   uint8_t m_Buffer[512]; |   56   uint8_t m_Buffer[512]; | 
|   57   uint32_t m_BufferOffset; |   57   uint32_t m_BufferOffset; | 
|   58 #endif  // PDF_ENABLE_XFA |   58 #endif  // PDF_ENABLE_XFA | 
|   59 }; |   59 }; | 
|   60  |   60  | 
|   61 #ifdef PDF_ENABLE_XFA |   61 #ifdef PDF_ENABLE_XFA | 
|   62 class CFPDF_FileStream : public IFX_FileStream { |   62 class CFPDF_FileStream : public IFX_FileStream { | 
|   63  public: |   63  public: | 
|   64   explicit CFPDF_FileStream(FPDF_FILEHANDLER* pFS); |   64   explicit CFPDF_FileStream(FPDF_FILEHANDLER* pFS); | 
|   65   ~CFPDF_FileStream() override {} |   65   ~CFPDF_FileStream() override {} | 
|   66  |   66  | 
|   67   // IFX_FileStream: |   67   // IFX_FileStream: | 
|   68   IFX_FileStream* Retain() override; |   68   IFX_FileStream* Retain() override; | 
|   69   void Release() override; |   69   void Release() override; | 
|   70   FX_FILESIZE GetSize() override; |   70   FX_FILESIZE GetSize() override; | 
|   71   FX_BOOL IsEOF() override; |   71   FX_BOOL IsEOF() override; | 
|   72   FX_FILESIZE GetPosition() override { return m_nCurPos; } |   72   FX_FILESIZE GetPosition() override; | 
|   73   FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; |   73   FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; | 
|   74   size_t ReadBlock(void* buffer, size_t size) override; |   74   size_t ReadBlock(void* buffer, size_t size) override; | 
|   75   FX_BOOL WriteBlock(const void* buffer, |   75   FX_BOOL WriteBlock(const void* buffer, | 
|   76                      FX_FILESIZE offset, |   76                      FX_FILESIZE offset, | 
|   77                      size_t size) override; |   77                      size_t size) override; | 
|   78   FX_BOOL Flush() override; |   78   FX_BOOL Flush() override; | 
|   79  |   79  | 
|   80   void SetPosition(FX_FILESIZE pos) { m_nCurPos = pos; } |   80   void SetPosition(FX_FILESIZE pos) { m_nCurPos = pos; } | 
|   81  |   81  | 
|   82  protected: |   82  protected: | 
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  121                             int rotate, |  121                             int rotate, | 
|  122                             int flags, |  122                             int flags, | 
|  123                             FX_BOOL bNeedToRestore, |  123                             FX_BOOL bNeedToRestore, | 
|  124                             IFSDK_PAUSE_Adapter* pause); |  124                             IFSDK_PAUSE_Adapter* pause); | 
|  125  |  125  | 
|  126 void CheckUnSupportError(CPDF_Document* pDoc, uint32_t err_code); |  126 void CheckUnSupportError(CPDF_Document* pDoc, uint32_t err_code); | 
|  127 void CheckUnSupportAnnot(CPDF_Document* pDoc, const CPDF_Annot* pPDFAnnot); |  127 void CheckUnSupportAnnot(CPDF_Document* pDoc, const CPDF_Annot* pPDFAnnot); | 
|  128 void ProcessParseError(CPDF_Parser::Error err); |  128 void ProcessParseError(CPDF_Parser::Error err); | 
|  129  |  129  | 
|  130 #endif  // FPDFSDK_INCLUDE_FSDK_DEFINE_H_ |  130 #endif  // FPDFSDK_INCLUDE_FSDK_DEFINE_H_ | 
| OLD | NEW |