diff options
author | Ryan Harrison <rharrison@chromium.org> | 2017-10-18 12:28:14 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-10-18 16:41:35 +0000 |
commit | 854d71c1420eb80ec79755a6cdf829f3f39aead7 (patch) | |
tree | ba5f94431c46bcf8fa5b8e873304f14c8c69088c /public | |
parent | 7c2daec0a5f5d5e0f442db7946e9356daa7c55b2 (diff) | |
download | pdfium-854d71c1420eb80ec79755a6cdf829f3f39aead7.tar.xz |
Refactor HasXFAField into HasFormInfo
The existing API is too restrictive for collection the metrics
information that we want. Specifically it only tells us if there are
XFA forms in the document, but not AcroForms. This refactoring makes
the method more general, so that non-XFA information is provided
also. This change in semantics of the return value required some
changes at the call sites of the API.
BUG=chromium:775519
Change-Id: Id421c66c09b47196c252c64cdc2c711ca1911de0
Reviewed-on: https://pdfium-review.googlesource.com/16210
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'public')
-rw-r--r-- | public/fpdf_formfill.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/public/fpdf_formfill.h b/public/fpdf_formfill.h index 1e0d305a6f..0204c846d3 100644 --- a/public/fpdf_formfill.h +++ b/public/fpdf_formfill.h @@ -12,10 +12,11 @@ typedef void* FPDF_FORMHANDLE; -#define XFADOCTYPE_NONE 0 // Document contains no XFA forms -#define XFADOCTYPE_FULL 1 // XFA forms are specified using the entire XFA spec -#define XFADOCTYPE_FOREGROUNDONLY \ - 2 // XFA forms are specified using the XFAF subset +#define FORMTYPE_NONE 0 // Document contains no forms +#define FORMTYPE_ACRO_FORM 1 // Forms are specified using AcroForm spec +#define FORMTYPE_XFA_FULL 2 // Forms are specified using the entire XFA spec +#define FORMTYPE_XFA_FOREGROUND \ + 3 // Forms are specified using the XFAF subset of XFA spec // Exported Functions #ifdef __cplusplus @@ -1607,20 +1608,19 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_FFLRecord(FPDF_FORMHANDLE hHandle, #endif /** - * Function: FPDF_HasXFAField - * This method is designed to check whether a pdf document - *has XFA fields. + * Experimental API + * Function: FPDF_GetFormType + * Returns the type of form contained in the PDF document. * Parameters: * document - Handle to document. *Returned by FPDF_LoadDocument function. * docType - Document type defined as - *XFADOCTYPE_xxx. + *FORMTYPE_xxx. * Return Value: - * TRUE indicates that the input document has XFA fields, - *otherwise FALSE. + * Integer value representing one of the FORMTYPE_xxx + *values. **/ -FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_HasXFAField(FPDF_DOCUMENT document, - int* docType); +FPDF_EXPORT int FPDF_CALLCONV FPDF_GetFormType(FPDF_DOCUMENT document); #ifdef PDF_ENABLE_XFA /** |