summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-04-17 15:12:58 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-17 15:12:58 +0000
commita4c7ac479d291fc3373b9c2f8f25302ecd53b0d5 (patch)
tree6403f92adcae02ef51897ad932ffc585c2422655 /public
parent3900ddb64f30f36fd6696bd2927cf8f151e6ede9 (diff)
downloadpdfium-a4c7ac479d291fc3373b9c2f8f25302ecd53b0d5.tar.xz
Implement FORM_GetFocusedText() API.
If there is a focused form field, get its text. BUG=chromium:753216 Change-Id: I05294f14d05c1c86769055f6c9eaf9177787d9fd Reviewed-on: https://pdfium-review.googlesource.com/12072 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'public')
-rw-r--r--public/fpdf_formfill.h34
1 files changed, 29 insertions, 5 deletions
diff --git a/public/fpdf_formfill.h b/public/fpdf_formfill.h
index 6cf2fcea0c..ff87d99ab5 100644
--- a/public/fpdf_formfill.h
+++ b/public/fpdf_formfill.h
@@ -1384,6 +1384,30 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnChar(FPDF_FORMHANDLE hHandle,
int modifier);
/**
+ * Experimental API
+ * Function: FORM_GetFocusedText
+ * You can call this function to obtain the text within the current
+ * focused field, if any.
+ * Parameters:
+ * hHandle - Handle to the form fill module. Returned by
+ * FPDFDOC_InitFormFillEnvironment.
+ * page - Handle to the page. Returned by FPDF_LoadPage
+ * function.
+ * buffer - Buffer for holding the form text, encoded in
+ * UTF16-LE. If NULL, |buffer| is not modified.
+ * buflen - Length of |buffer| in bytes. If |buflen| is less
+ than the length of the form text string, |buffer| is
+ not modified.
+ * Return Value:
+ * Length in bytes for the text in the focused field.
+ **/
+FPDF_EXPORT unsigned long FPDF_CALLCONV
+FORM_GetFocusedText(FPDF_FORMHANDLE hHandle,
+ FPDF_PAGE page,
+ void* buffer,
+ unsigned long buflen);
+
+/**
* Function: FORM_GetSelectedText
* You can call this function to obtain selected text within
* a form text field or form combobox text field.
@@ -1392,11 +1416,11 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnChar(FPDF_FORMHANDLE hHandle,
* FPDFDOC_InitFormFillEnvironment.
* page - Handle to the page. Returned by FPDF_LoadPage
* function.
- * buffer - Buffer for holding the selected text, encoded
- * in UTF16-LE. If NULL, |buffer| is not modified.
- * buflen - Length of |buffer| in bytes. If |buflen|
- is less than the length of the selected text
- string, |buffer| is not modified.
+ * buffer - Buffer for holding the selected text, encoded in
+ * UTF16-LE. If NULL, |buffer| is not modified.
+ * buflen - Length of |buffer| in bytes. If |buflen| is less
+ than the length of the selected text string,
+ |buffer| is not modified.
* Return Value:
* Length in bytes of selected text in form text field or form combobox
* text field.