Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(311)

Unified Diff: public/fpdf_dataavail.h

Issue 1353093003: Support linearized loading (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Add an argument 'must_linearize' in OpenDocument Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pdfium.gyp ('k') | samples/pdfium_test.cc » ('j') | samples/pdfium_test.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/fpdf_dataavail.h
diff --git a/public/fpdf_dataavail.h b/public/fpdf_dataavail.h
index c17f0311ab3e599387f3efc1432433e19ea2cfc2..00f55870e7998355314b16fe9d66e0b02a1ab26e 100644
--- a/public/fpdf_dataavail.h
+++ b/public/fpdf_dataavail.h
@@ -11,10 +11,15 @@
#include "fpdfview.h"
-/** The result of the process which check linearized PDF. */
-#define FSDK_IS_LINEARIZED 1
-#define FSDK_NOT_LINEARIZED 0
-#define FSDK_UNKNOW_LINEARIZED -1
+#define PDF_LINEARIZATION_UNKNOWN -1
+#define PDF_NOT_LINEARIZED 0
+#define PDF_LINEARIZED 1
+#define PDF_DATA_ERROR -1
+#define PDF_DATA_NOTAVAIL 0
+#define PDF_DATA_AVAIL 1
+#define PDF_FORM_NOTAVAIL 0
+#define PDF_FORM_AVAIL 1
+#define PDF_FORM_NOTEXIST 2
#ifdef __cplusplus
extern "C" {
@@ -130,17 +135,19 @@ typedef struct _FX_DOWNLOADHINTS {
* hints - Pointer to a download hints interface, receiving
* generated hints
* Return value:
-* Non-zero for page is fully available, 0 for page not yet available.
+* PDF_DATA_ERROR: A common error is returned. It can't tell
Tom Sepez 2015/10/21 17:53:08 Public API change. Can we do what we need to do wi
jun_fang 2015/10/22 00:50:06 This public API was designed for linearization fun
+* whehter data are availabe or not.
+* PDF_DATA_NOTAVAIL: Data are not yet available.
+* PDF_DATA_AVAIL: Data are available.
* Comments:
* The application should call this function whenever new data arrived,
* and process all the
-* generated download hints if any, until the function returns non-zero
-* value. Then the
-* application can call FPDFAvail_GetDocument() to get a document
+* generated download hints if any, until the function returns true.
+* Then the application can call FPDFAvail_GetDocument() to get a document
* handle.
*/
-DLLEXPORT int STDCALL FPDFAvail_IsDocAvail(FPDF_AVAIL avail,
- FX_DOWNLOADHINTS* hints);
+DLLEXPORT int STDCALL
+FPDFAvail_IsDocAvail(FPDF_AVAIL avail, FX_DOWNLOADHINTS* hints);
/**
* Function: FPDFAvail_GetDocument
@@ -189,15 +196,17 @@ DLLEXPORT int STDCALL FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc);
* hints - Pointer to a download hints interface, receiving
* generated hints
* Return value:
-* Non-zero for page is fully available, 0 for page not yet available.
+* PDF_DATA_ERROR: A common error is returned. It can't tell
+* whehter data are availabe or not.
+* PDF_DATA_NOTAVAIL: Data are not yet available.
+* PDF_DATA_AVAIL: Data are available.
* Comments:
* This function call be called only after FPDFAvail_GetDocument if
* called.
* The application should call this function whenever new data arrived,
* and process all the
-* generated download hints if any, until the function returns non-zero
-* value. Then the
-* application can perform page loading.
+* generated download hints if any, until the function returns true.
+* Then the application can perform page loading.
*/
DLLEXPORT int STDCALL FPDFAvail_IsPageAvail(FPDF_AVAIL avail,
int page_index,
@@ -243,18 +252,19 @@ DLLEXPORT int STDCALL FPDFAvail_IsFormAvail(FPDF_AVAIL avail,
* avail - Handle to document availability provider returned by
* FPDFAvail_Create
* Return value:
-* return TRUE means the document is linearized PDF else not.
-* FSDK_IS_LINEARIZED is a linearize file.
-* FSDK_NOT_LINEARIZED is not a linearize file.
-* FSDK_UNKNOW_LINEARIZED don't know whether the file is a linearize
-* file.
+* PDF_LINEARIZED is a linearize file.
+* PDF_NOT_LINEARIZED is not a linearize file.
+* PDF_LINEARIZATION_UNKNOWN doesn't know whether the file is a
+*linearize file.
+*
* Comments:
-* It return TRUE/FALSE as soon as we have first 1K data. If the
-* file's size less than
-* 1K,we don't known whether the PDF is a linearized file.
+* It return PDF_LINEARIZED or PDF_NOT_LINEARIZED as soon as
+* we have first 1K data. If the file's size less than 1K, it returns
+* PDF_LINEARIZATION_UNKNOWN because there is not enough information to
+* tell whether a PDF file is a linearized file or not.
*
*/
-DLLEXPORT FPDF_BOOL STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail);
+DLLEXPORT int STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail);
#ifdef __cplusplus
}
« no previous file with comments | « pdfium.gyp ('k') | samples/pdfium_test.cc » ('j') | samples/pdfium_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698