Select/deselect and isIndexSelected for Comboboxes and Listboxes.

Part of feature work to make Pdfium more usable by mobile platforms
that wish to render comboboxes and listboxes using custom displays
when a widget is selected instead of Pdfium's support for drawing
the dropdown/selected items.

R=thestig@chromium.org

Bug: b/124253371
Change-Id: Idd1759bd7a7ab2ae518583e9325dfd094d91c8ad
Reviewed-on: https://pdfium-review.googlesource.com/c/50650
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/fpdfsdk/fpdf_formfill.cpp b/fpdfsdk/fpdf_formfill.cpp
index b84d906..79ea68d 100644
--- a/fpdfsdk/fpdf_formfill.cpp
+++ b/fpdfsdk/fpdf_formfill.cpp
@@ -725,3 +725,22 @@
     pActionHandler->DoAction_Page(action, type, pFormFillEnv);
   }
 }
+
+FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
+FORM_SetIndexSelected(FPDF_FORMHANDLE hHandle,
+                      FPDF_PAGE page,
+                      int index,
+                      FPDF_BOOL selected) {
+  CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page);
+  if (!pPageView)
+    return false;
+  return pPageView->SetIndexSelected(index, selected);
+}
+
+FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
+FORM_IsIndexSelected(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int index) {
+  CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page);
+  if (!pPageView)
+    return false;
+  return pPageView->IsIndexSelected(index);
+}