summaryrefslogtreecommitdiff
path: root/public/fpdf_formfill.h
diff options
context:
space:
mode:
authorDiana Gage <drgage@google.com>2017-06-20 11:17:11 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-06-20 21:41:22 +0000
commitdce2d72f9fbc166ee8eed0e362ab26e1e1a33cdd (patch)
tree410816fa09ffea9d2db198b5138f45ea55253824 /public/fpdf_formfill.h
parentb5c5ec06396158232d7f6955dde7b3512df0ae6e (diff)
downloadpdfium-dce2d72f9fbc166ee8eed0e362ab26e1e1a33cdd.tar.xz
Add FORM_GetSelectedText() function.
This function copies the selected text from a form text field or form combobox text field into the buffer parameter and returns the length of the selected text string. When buffer is a nullptr or buflen is less than the length of the selected text, this function does not modify the buffer and only returns the selected text length. BUG=chromium:59266 Change-Id: Ie77de38e45bbe6f9ea033826c961435304eedfc7 Reviewed-on: https://pdfium-review.googlesource.com/6413 Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'public/fpdf_formfill.h')
-rw-r--r--public/fpdf_formfill.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/public/fpdf_formfill.h b/public/fpdf_formfill.h
index caefad78c7..5a15cd9a02 100644
--- a/public/fpdf_formfill.h
+++ b/public/fpdf_formfill.h
@@ -1355,6 +1355,29 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnChar(FPDF_FORMHANDLE hHandle,
int modifier);
/**
+ * Function: FORM_GetSelectedText
+ * You can call this function to obtain selected text within
+ * a form text field or form combobox text field.
+ * 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 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.
+ **/
+DLLEXPORT unsigned long STDCALL FORM_GetSelectedText(FPDF_FORMHANDLE hHandle,
+ FPDF_PAGE page,
+ void* buffer,
+ unsigned long buflen);
+
+/**
* Function: FORM_ForceToKillFocus.
* You can call this member function to force to kill the focus of the
*form field which got focus.