summaryrefslogtreecommitdiff
path: root/public/fpdf_annot.h
diff options
context:
space:
mode:
authorDiana Gage <drgage@google.com>2017-07-19 18:16:03 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-07-20 01:30:30 +0000
commit40870db0aadef4e145fd3b2b95fa5a083afb3161 (patch)
tree75115b1c00857ac28d3ea4913d6a0e9e37239aa4 /public/fpdf_annot.h
parent7e0c05d7a3329fd0a262d13b8aea74eaf33ba997 (diff)
downloadpdfium-40870db0aadef4e145fd3b2b95fa5a083afb3161.tar.xz
Add FPDFAnnot_GetFormFieldAtPoint() and embedder tests.
Given a point on a page, this method returns the interactive form annotation whose rectangle contains that point. If there is no such annotation, nullptr is returned. FPDFPage_CloseAnnot() must be called after the annotation this method returns is no longer needed. The tests for this method use the returned annotation to check its interactive form annotation flags via FPDFAnnot_GetFormFieldFlags(). BUG=chromium:59266 Change-Id: I8728792bea5367c172e08fdb6bae83eafb70eb68 Reviewed-on: https://pdfium-review.googlesource.com/7970 Commit-Queue: Diana Gage <drgage@google.com> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'public/fpdf_annot.h')
-rw-r--r--public/fpdf_annot.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/public/fpdf_annot.h b/public/fpdf_annot.h
index 2a44e45bc8..c0f9a6e4c6 100644
--- a/public/fpdf_annot.h
+++ b/public/fpdf_annot.h
@@ -9,6 +9,7 @@
#include "fpdfview.h"
#include "fpdf_doc.h"
+#include "fpdf_formfill.h"
#ifdef __cplusplus
extern "C" {
@@ -404,6 +405,26 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_SetFlags(FPDF_ANNOTATION annot,
DLLEXPORT int STDCALL FPDFAnnot_GetFormFieldFlags(FPDF_PAGE page,
FPDF_ANNOTATION annot);
+// Experimental API.
+// Retrieves an interactive form annotation whose rectangle contains a given
+// point on a page. Must call FPDFPage_CloseAnnot() when the annotation returned
+// is no longer needed.
+//
+//
+// hHandle - handle to the form fill module, returned by
+// FPDFDOC_InitFormFillEnvironment.
+// page - handle to the page, returned by FPDF_LoadPage function.
+// page_x - X position in PDF "user space".
+// page_y - Y position in PDF "user space".
+//
+// Returns the interactive form annotation whose rectangle contains the given
+// coordinates on the page. If there is no such annotation, return NULL.
+DLLEXPORT FPDF_ANNOTATION STDCALL
+FPDFAnnot_GetFormFieldAtPoint(FPDF_FORMHANDLE hHandle,
+ FPDF_PAGE page,
+ double page_x,
+ double page_y);
+
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus