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 --- public/fpdf_formfill.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'public') diff --git a/public/fpdf_formfill.h b/public/fpdf_formfill.h index 0bc08ec54b..68ffcda56d 100644 --- a/public/fpdf_formfill.h +++ b/public/fpdf_formfill.h @@ -1113,6 +1113,26 @@ FPDFDOC_InitFormFillEnvironment(FPDF_DOCUMENT document, FPDF_EXPORT void FPDF_CALLCONV FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle); +typedef void (*FORM_SAVECALLED)(FPDF_FORMFILLINFO*); +/** + * Experimental API + * Function: FORM_SetSaveCallback + * This method is used to set a callback handler for when Save is + * attempted by a PDF. Should be invoked after user successfully + * loaded a PDF page, and method FPDFDOC_InitFormFillEnvironment had + * been invoked. + * Parameters: + * callback - Function pointer to the callback to be called when a + * Save is attempted. If NULL then no function will be + * invoked.. + * hHandle - Handle to the form fill module. Returned by + * FPDFDOC_InitFormFillEnvironment. + * Return Value: + * NONE. + **/ +FPDF_EXPORT void FPDF_CALLCONV FORM_SetSaveCallback(FORM_SAVECALLED callback, + FPDF_FORMHANDLE hHandle); + /** * Function: FORM_OnAfterLoadPage * This method is required for implementing all the form related -- cgit v1.2.3