summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2018-01-12 18:36:30 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-12 18:36:30 +0000
commit9baf31f8c38e1c5266609e184cc07e369b744760 (patch)
tree37002a8148539b21f2562454b4864f0056f2aed2 /public
parent72d34be06324624ee4dcf27b1f001ab573ddec06 (diff)
downloadpdfium-9baf31f8c38e1c5266609e184cc07e369b744760.tar.xz
Use enum for tracking form field types
Within PDFium use enum class for better type safety when working with form field types. These values will still be converted to ints as part of the public API, since that is the existing API. This work is preperation for extending the number of form field types to have more specific entries for XFA. BUG=pdfium:952,chromium:763129,chromium:592758 Change-Id: Ie6c29f02ae22be782ff36eb87d27f1a4bf2c099e Reviewed-on: https://pdfium-review.googlesource.com/22742 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'public')
-rw-r--r--public/fpdf_formfill.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/public/fpdf_formfill.h b/public/fpdf_formfill.h
index 5bc3cf3a6d..e4cdaee0f6 100644
--- a/public/fpdf_formfill.h
+++ b/public/fpdf_formfill.h
@@ -1441,7 +1441,9 @@ FPDF_EXPORT void FPDF_CALLCONV FORM_ReplaceSelection(FPDF_FORMHANDLE hHandle,
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle);
-// Field Types
+// Form Field Types
+// The names of the defines are stable, but the specific values associated with
+// them are not, so do not hardcode their values.
#define FPDF_FORMFIELD_UNKNOWN 0 // Unknown.
#define FPDF_FORMFIELD_PUSHBUTTON 1 // push button type.
#define FPDF_FORMFIELD_CHECKBOX 2 // check box type.
@@ -1449,8 +1451,15 @@ FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle);
#define FPDF_FORMFIELD_COMBOBOX 4 // combo box type.
#define FPDF_FORMFIELD_LISTBOX 5 // list box type.
#define FPDF_FORMFIELD_TEXTFIELD 6 // text field type.
+#define FPDF_FORMFIELD_SIGNATURE 7 // text field type.
#ifdef PDF_ENABLE_XFA
-#define FPDF_FORMFIELD_XFA 7 // text field type.
+#define FPDF_FORMFIELD_XFA 8 // Generic XFA type.
+#endif // PDF_ENABLE_XFA
+
+#ifndef PDF_ENABLE_XFA
+#define FPDF_FORMFIELD_COUNT 8
+#else
+#define FPDF_FORMFIELD_COUNT 9
#endif // PDF_ENABLE_XFA
/**
@@ -1507,11 +1516,11 @@ FPDFPage_FormFieldZOrderAtPoint(FPDF_FORMHANDLE hHandle,
* Return Value:
* NONE.
* Comments:
- * When the parameter fieldType is set to zero, the highlight color
- *will be applied to all the form fields in the
+ * When the parameter fieldType is set to FPDF_FORMFIELD_UNKNOWN, the
+ * highlight color will be applied to all the form fields in the
* document.
* Please refresh the client window to show the highlight immediately
- *if necessary.
+ * if necessary.
**/
FPDF_EXPORT void FPDF_CALLCONV
FPDF_SetFormFieldHighlightColor(FPDF_FORMHANDLE hHandle,