diff options
author | Ryan Harrison <rharrison@chromium.org> | 2018-07-16 20:49:56 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-07-16 20:49:56 +0000 |
commit | c30b4e16885c8fd5f59965f48b61ec033ae4691a (patch) | |
tree | d15118e1f461ef5654f94c6d63e8acb96275800f /fpdfsdk/fpdf_formfill.cpp | |
parent | 4cf61e07625888a3b56c4de97719c87cf514fb7f (diff) | |
download | pdfium-c30b4e16885c8fd5f59965f48b61ec033ae4691a.tar.xz |
Alert embedder when attempting to save XFA form
This CL adds an experimental callback to the form fill API that
allows PDFium to signal to the embedder that an attempt call save
occurred. The embedder is responsible for showing an appropriate
UI when this occurs. When PDF saving is implemented the API can
be removed.
BUG=pdfium:953
Change-Id: Iba30f4d0547fe773b793e499995be426626092a0
Reviewed-on: https://pdfium-review.googlesource.com/35870
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_formfill.cpp')
-rw-r--r-- | fpdfsdk/fpdf_formfill.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fpdfsdk/fpdf_formfill.cpp b/fpdfsdk/fpdf_formfill.cpp index 792ced773f..1af34b552f 100644 --- a/fpdfsdk/fpdf_formfill.cpp +++ b/fpdfsdk/fpdf_formfill.cpp @@ -360,6 +360,16 @@ FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle) { delete pFormFillEnv; } +FPDF_EXPORT void FPDF_CALLCONV FORM_SetSaveCallback(FORM_SAVECALLED callback, + FPDF_FORMHANDLE hHandle) { + CPDFSDK_FormFillEnvironment* pFormFillEnv = + HandleToCPDFSDKEnvironment(hHandle); + if (!pFormFillEnv) + return; + + pFormFillEnv->SetSaveCalled(callback); +} + FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnMouseMove(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, |