| 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 PUBLIC_FPDF_DATAAVAIL_H_ | 7 #ifndef PUBLIC_FPDF_DATAAVAIL_H_ |
| 8 #define PUBLIC_FPDF_DATAAVAIL_H_ | 8 #define PUBLIC_FPDF_DATAAVAIL_H_ |
| 9 | 9 |
| 10 #include <stddef.h> // For size_t. | 10 #include <stddef.h> // For size_t. |
| 11 | 11 |
| 12 #include "fpdfview.h" | 12 #include "fpdfview.h" |
| 13 | 13 |
| 14 /** The result of the process which check linearized PDF. */ | |
| 15 #define FSDK_IS_LINEARIZED 1 | |
| 16 #define FSDK_NOT_LINEARIZED 0 | |
| 17 #define FSDK_UNKNOW_LINEARIZED -1 | |
| 18 | |
| 19 #ifdef __cplusplus | 14 #ifdef __cplusplus |
| 20 extern "C" { | 15 extern "C" { |
| 21 #endif | 16 #endif |
| 22 | 17 |
| 23 /** | 18 /** |
| 24 * Interface: FX_FILEAVAIL | 19 * Interface: FX_FILEAVAIL |
| 25 * Interface for checking whether the section of the file is available. | 20 * Interface for checking whether the section of the file is available. |
| 26 */ | 21 */ |
| 27 typedef struct _FX_FILEAVAIL { | 22 typedef struct _FX_FILEAVAIL { |
| 28 /** | 23 /** |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 * Function: FPDFAvail_IsDocAvail | 118 * Function: FPDFAvail_IsDocAvail |
| 124 * Check whether the document is ready for loading, if not, get | 119 * Check whether the document is ready for loading, if not, get |
| 125 * download hints. | 120 * download hints. |
| 126 * | 121 * |
| 127 * Parameters: | 122 * Parameters: |
| 128 * avail - Handle to document availability provider returned by | 123 * avail - Handle to document availability provider returned by |
| 129 * FPDFAvail_Create | 124 * FPDFAvail_Create |
| 130 * hints - Pointer to a download hints interface, receiving | 125 * hints - Pointer to a download hints interface, receiving |
| 131 * generated hints | 126 * generated hints |
| 132 * Return value: | 127 * Return value: |
| 133 * Non-zero for page is fully available, 0 for page not yet available. | 128 * true is fully available, false for page not yet available. |
| 134 * Comments: | 129 * Comments: |
| 135 * The application should call this function whenever new data arrived, | 130 * The application should call this function whenever new data arrived, |
| 136 * and process all the | 131 * and process all the |
| 137 * generated download hints if any, until the function returns non-zero | 132 * generated download hints if any, until the function returns true. |
| 138 * value. Then the | 133 * Then the application can call FPDFAvail_GetDocument() to get a document |
| 139 * application can call FPDFAvail_GetDocument() to get a document | |
| 140 * handle. | 134 * handle. |
| 141 */ | 135 */ |
| 142 DLLEXPORT int STDCALL FPDFAvail_IsDocAvail(FPDF_AVAIL avail, | 136 DLLEXPORT FPDF_BOOL STDCALL |
| 143 FX_DOWNLOADHINTS* hints); | 137 FPDFAvail_IsDocAvail(FPDF_AVAIL avail, FX_DOWNLOADHINTS* hints); |
| 144 | 138 |
| 145 /** | 139 /** |
| 146 * Function: FPDFAvail_GetDocument | 140 * Function: FPDFAvail_GetDocument |
| 147 * Get document from the availability provider. | 141 * Get document from the availability provider. |
| 148 * | 142 * |
| 149 * Parameters: | 143 * Parameters: |
| 150 * avail - Handle to document availability provider returned by | 144 * avail - Handle to document availability provider returned by |
| 151 * FPDFAvail_Create | 145 * FPDFAvail_Create |
| 152 * password - Optional password for decrypting the PDF file. | 146 * password - Optional password for decrypting the PDF file. |
| 153 * Return value: | 147 * Return value: |
| (...skipping 28 matching lines...) Expand all Loading... |
| 182 * Check whether a page is ready for loading, if not, get download | 176 * Check whether a page is ready for loading, if not, get download |
| 183 * hints. | 177 * hints. |
| 184 * | 178 * |
| 185 * Parameters: | 179 * Parameters: |
| 186 * avail - Handle to document availability provider returned by | 180 * avail - Handle to document availability provider returned by |
| 187 * FPDFAvail_Create | 181 * FPDFAvail_Create |
| 188 * page_index - Index number of the page. 0 for the first page. | 182 * page_index - Index number of the page. 0 for the first page. |
| 189 * hints - Pointer to a download hints interface, receiving | 183 * hints - Pointer to a download hints interface, receiving |
| 190 * generated hints | 184 * generated hints |
| 191 * Return value: | 185 * Return value: |
| 192 * Non-zero for page is fully available, 0 for page not yet available. | 186 * true is fully available, false for page not yet available. |
| 193 * Comments: | 187 * Comments: |
| 194 * This function call be called only after FPDFAvail_GetDocument if | 188 * This function call be called only after FPDFAvail_GetDocument if |
| 195 * called. | 189 * called. |
| 196 * The application should call this function whenever new data arrived, | 190 * The application should call this function whenever new data arrived, |
| 197 * and process all the | 191 * and process all the |
| 198 * generated download hints if any, until the function returns non-zero | 192 * generated download hints if any, until the function returns true. |
| 199 * value. Then the | 193 * Then the application can perform page loading. |
| 200 * application can perform page loading. | |
| 201 */ | 194 */ |
| 202 DLLEXPORT int STDCALL FPDFAvail_IsPageAvail(FPDF_AVAIL avail, | 195 DLLEXPORT FPDF_BOOL STDCALL FPDFAvail_IsPageAvail(FPDF_AVAIL avail, |
| 203 int page_index, | 196 int page_index, |
| 204 FX_DOWNLOADHINTS* hints); | 197 FX_DOWNLOADHINTS* hints); |
| 205 | 198 |
| 206 /** | 199 /** |
| 207 * Function: FPDFAvail_ISFormAvail | 200 * Function: FPDFAvail_ISFormAvail |
| 208 * Check whether Form data is ready for init, if not, get download | 201 * Check whether Form data is ready for init, if not, get download |
| 209 * hints. | 202 * hints. |
| 210 * | 203 * |
| 211 * Parameters: | 204 * Parameters: |
| 212 * avail - Handle to document availability provider returned by | 205 * avail - Handle to document availability provider returned by |
| 213 * FPDFAvail_Create | 206 * FPDFAvail_Create |
| 214 * hints - Pointer to a download hints interface, receiving | 207 * hints - Pointer to a download hints interface, receiving |
| (...skipping 21 matching lines...) Expand all Loading... |
| 236 FX_DOWNLOADHINTS* hints); | 229 FX_DOWNLOADHINTS* hints); |
| 237 | 230 |
| 238 /** | 231 /** |
| 239 * Function: FPDFAvail_IsLinearized | 232 * Function: FPDFAvail_IsLinearized |
| 240 * To check whether a document is Linearized PDF file. | 233 * To check whether a document is Linearized PDF file. |
| 241 * | 234 * |
| 242 * Parameters: | 235 * Parameters: |
| 243 * avail - Handle to document availability provider returned by | 236 * avail - Handle to document availability provider returned by |
| 244 * FPDFAvail_Create | 237 * FPDFAvail_Create |
| 245 * Return value: | 238 * Return value: |
| 246 * return TRUE means the document is linearized PDF else not. | 239 * PDF_LINEARIZED is a linearize file. |
| 247 * FSDK_IS_LINEARIZED is a linearize file. | 240 * PDF_NOT_LINEARIZED is not a linearize file. |
| 248 * FSDK_NOT_LINEARIZED is not a linearize file. | 241 * PDF_LINEARIZATION_UNKNOWN doesn't know whether the file is a |
| 249 * FSDK_UNKNOW_LINEARIZED don't know whether the file is a linearize | 242 *linearize file. |
| 250 * file. | 243 * |
| 251 * Comments: | 244 * Comments: |
| 252 * It return TRUE/FALSE as soon as we have first 1K data. If the | 245 * It return PDF_LINEARIZED or PDF_NOT_LINEARIZED as soon as |
| 253 * file's size less than | 246 * we have first 1K data. If the file's size less than 1K, it returns |
| 254 * 1K,we don't known whether the PDF is a linearized file. | 247 * PDF_LINEARIZATION_UNKNOWN because there is not enough information to |
| 248 * tell whether a PDF file is a linearized file or not. |
| 255 * | 249 * |
| 256 */ | 250 */ |
| 257 DLLEXPORT FPDF_BOOL STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail); | 251 DLLEXPORT int STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail); |
| 258 | 252 |
| 259 #ifdef __cplusplus | 253 #ifdef __cplusplus |
| 260 } | 254 } |
| 261 #endif | 255 #endif |
| 262 | 256 |
| 263 #endif // PUBLIC_FPDF_DATAAVAIL_H_ | 257 #endif // PUBLIC_FPDF_DATAAVAIL_H_ |
| OLD | NEW |