Index: core/include/fpdfapi/fpdf_parser.h |
diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h |
index b7684e530a380895907f910d6f993c2739a30ba6..d1f50038a798ea24f3a8db98eb67b2b361c90fb1 100644 |
--- a/core/include/fpdfapi/fpdf_parser.h |
+++ b/core/include/fpdfapi/fpdf_parser.h |
@@ -7,7 +7,6 @@ |
#ifndef CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ |
#define CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ |
-#include "../../../public/fpdf_dataavail.h" |
#include "../../../third_party/base/nonstd_unique_ptr.h" |
#include "../fxcrt/fx_system.h" |
#include "fpdf_objects.h" |
@@ -871,6 +870,34 @@ class IFX_DownloadHints { |
class IPDF_DataAvail { |
public: |
+ // Must match PDF_DATA_* definitions in public/fpdf_dataavail.h, but cannot |
+ // #include that header. fpdfsdk/src/fpdf_dataavail.cpp has static_asserts |
+ // to make sure the two sets of values match. |
+ enum DocAvailStatus { |
+ DataError = -1, // PDF_DATA_ERROR |
+ DataNotAvailable = 0, // PDF_DATA_NOTAVAIL |
+ DataAvailable = 1, // PDF_DATA_AVAIL |
+ }; |
+ |
+ // Must match PDF_*LINEAR* definitions in public/fpdf_dataavail.h, but cannot |
+ // #include that header. fpdfsdk/src/fpdf_dataavail.cpp has static_asserts |
+ // to make sure the two sets of values match. |
+ enum DocLinearizationStatus { |
+ LinearizationUnknown = -1, // PDF_LINEARIZATION_UNKNOWN |
+ NotLinearized = 0, // PDF_NOT_LINEARIZED |
+ Linearized = 1, // PDF_LINEARIZED |
+ }; |
+ |
+ // Must match PDF_FORM_* definitions in public/fpdf_dataavail.h, but cannot |
+ // #include that header. fpdfsdk/src/fpdf_dataavail.cpp has static_asserts |
+ // to make sure the two sets of values match. |
+ enum DocFormStatus { |
+ FormError = -1, // PDF_FORM_ERROR |
+ FormNotAvailable = 0, // PDF_FORM_NOTAVAIL |
+ FormAvailable = 1, // PDF_FORM_AVAIL |
+ FormNotExist = 2, // PDF_FORM_NOTEXIST |
+ }; |
+ |
static IPDF_DataAvail* Create(IFX_FileAvail* pFileAvail, |
IFX_FileRead* pFileRead); |
virtual ~IPDF_DataAvail() {} |
@@ -878,12 +905,12 @@ class IPDF_DataAvail { |
IFX_FileAvail* GetFileAvail() const { return m_pFileAvail; } |
IFX_FileRead* GetFileRead() const { return m_pFileRead; } |
- virtual int IsDocAvail(IFX_DownloadHints* pHints) = 0; |
+ virtual DocAvailStatus IsDocAvail(IFX_DownloadHints* pHints) = 0; |
virtual void SetDocument(CPDF_Document* pDoc) = 0; |
virtual int IsPageAvail(int iPage, IFX_DownloadHints* pHints) = 0; |
virtual FX_BOOL IsLinearized() = 0; |
- virtual int IsFormAvail(IFX_DownloadHints* pHints) = 0; |
- virtual int IsLinearizedPDF() = 0; |
+ virtual DocFormStatus IsFormAvail(IFX_DownloadHints* pHints) = 0; |
+ virtual DocLinearizationStatus IsLinearizedPDF() = 0; |
virtual void GetLinearizedMainXRefInfo(FX_FILESIZE* pPos, |
FX_DWORD* pSize) = 0; |