summaryrefslogtreecommitdiff
path: root/public/fpdf_annot.h
diff options
context:
space:
mode:
authorDiana Gage <drgage@google.com>2017-07-19 17:33:33 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-07-20 00:49:52 +0000
commit7e0c05d7a3329fd0a262d13b8aea74eaf33ba997 (patch)
tree7f3084e167c76ed22cfebae7cd50d456884ca521 /public/fpdf_annot.h
parent33b42e4ab56d56ff02cd08a47c5f590875d886bf (diff)
downloadpdfium-7e0c05d7a3329fd0a262d13b8aea74eaf33ba997.tar.xz
Add FPDFAnnot_GetFormFieldFlags() and associated embedder tests.
Given an interactive form annotation, this method returns its annotation flags. The flags returned are dependent upon the "Ff" field, and are specific to interactive form annotations, such as FPDF_FORMFLAG_MULTILINE, FPDF_FORMFLAG_COMBO, FPDF_FORMFLAG_EDIT, and others. To test this method more thoroughly, text_form_multiple.pdf has been added, which is similar to text_form.pdf, but includes a read-only text field. BUG=chromium:59266 Change-Id: Ie66046de273f69a1be6f04a433351ebaa271f60c Reviewed-on: https://pdfium-review.googlesource.com/7851 Commit-Queue: Diana Gage <drgage@google.com> Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'public/fpdf_annot.h')
-rw-r--r--public/fpdf_annot.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/public/fpdf_annot.h b/public/fpdf_annot.h
index 1351f7193b..2a44e45bc8 100644
--- a/public/fpdf_annot.h
+++ b/public/fpdf_annot.h
@@ -55,6 +55,33 @@ extern "C" {
#define FPDF_ANNOT_FLAG_LOCKED (1 << 7)
#define FPDF_ANNOT_FLAG_TOGGLENOVIEW (1 << 8)
+#define FPDF_OBJECT_UNKNOWN 0
+#define FPDF_OBJECT_BOOLEAN 1
+#define FPDF_OBJECT_NUMBER 2
+#define FPDF_OBJECT_STRING 3
+#define FPDF_OBJECT_NAME 4
+#define FPDF_OBJECT_ARRAY 5
+#define FPDF_OBJECT_DICTIONARY 6
+#define FPDF_OBJECT_STREAM 7
+#define FPDF_OBJECT_NULLOBJ 8
+#define FPDF_OBJECT_REFERENCE 9
+
+// Refer to PDF Reference version 1.7 table 8.70 for field flags common to all
+// interactive form field types.
+#define FPDF_FORMFLAG_NONE 0
+#define FPDF_FORMFLAG_READONLY (1 << 0)
+#define FPDF_FORMFLAG_REQUIRED (1 << 1)
+#define FPDF_FORMFLAG_NOEXPORT (1 << 2)
+
+// Refer to PDF Reference version 1.7 table 8.77 for field flags specific to
+// interactive form text fields.
+#define FPDF_FORMFLAG_TEXT_MULTILINE (1 << 12)
+
+// Refer to PDF Reference version 1.7 table 8.79 for field flags specific to
+// interactive form choice fields.
+#define FPDF_FORMFLAG_CHOICE_COMBO (1 << 17)
+#define FPDF_FORMFLAG_CHOICE_EDIT (1 << 18)
+
typedef enum FPDFANNOT_COLORTYPE {
FPDFANNOT_COLORTYPE_Color = 0,
FPDFANNOT_COLORTYPE_InteriorColor
@@ -366,6 +393,17 @@ DLLEXPORT int STDCALL FPDFAnnot_GetFlags(FPDF_ANNOTATION annot);
DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_SetFlags(FPDF_ANNOTATION annot,
int flags);
+// Experimental API.
+// Get the annotation flags of |annot|, which is an interactive form
+// annotation in |page|.
+//
+// page - handle to a page.
+// annot - handle to an interactive form annotation.
+//
+// Returns the annotation flags specific to interactive forms.
+DLLEXPORT int STDCALL FPDFAnnot_GetFormFieldFlags(FPDF_PAGE page,
+ FPDF_ANNOTATION annot);
+
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus