From c30b4e16885c8fd5f59965f48b61ec033ae4691a Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Mon, 16 Jul 2018 20:49:56 +0000 Subject: 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 Reviewed-by: Tom Sepez --- fpdfsdk/fpdf_formfill.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'fpdfsdk/fpdf_formfill.cpp') 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, -- cgit v1.2.3