summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2016-02-19 14:25:10 -0800
committerLei Zhang <thestig@chromium.org>2016-02-19 14:25:10 -0800
commit84e5a12f186a00bf37a26cc13965f65c25561bd1 (patch)
treec22ec5799746ced87732293ae394f5c5130ef7cf
parent78353d5dbc0b0c9b2d6946005439a51efa7d108c (diff)
downloadpdfium-84e5a12f186a00bf37a26cc13965f65c25561bd1.tar.xz
Hook up FFI_PageEvent.
BUG=pdfium:401 R=jun_fang@foxitsoftware.com, tsepez@chromium.org Review URL: https://codereview.chromium.org/1712763003 .
-rw-r--r--fpdfsdk/include/fsdk_mgr.h9
-rw-r--r--public/fpdf_formfill.h19
2 files changed, 23 insertions, 5 deletions
diff --git a/fpdfsdk/include/fsdk_mgr.h b/fpdfsdk/include/fsdk_mgr.h
index b6944ec80b..1e2620a192 100644
--- a/fpdfsdk/include/fsdk_mgr.h
+++ b/fpdfsdk/include/fsdk_mgr.h
@@ -232,8 +232,6 @@ class CPDFDoc_Environment final {
wsURL = CFX_WideString();
}
- void FFI_PageEvent(FPDF_PAGE page, FPDF_DWORD flag) {}
-
void FFI_GetPageViewRect(FPDF_PAGE page, FS_RECTF& dstRect) {
if (m_pInfo && m_pInfo->FFI_GetPageViewRect) {
double left;
@@ -405,9 +403,10 @@ class CPDFDoc_Environment final {
}
return L"";
}
- void FFI_PageEvent(int iPageIndex, int iEventType) const {
- // Todo: call a call-back function when it's implemented
- // in applicaiton's side.
+
+ void FFI_PageEvent(int iPageIndex, FX_DWORD dwEventType) const {
+ if (m_pInfo && m_pInfo->FFI_PageEvent)
+ m_pInfo->FFI_PageEvent(m_pInfo, iPageIndex, dwEventType);
}
#endif // PDF_ENABLE_XFA
diff --git a/public/fpdf_formfill.h b/public/fpdf_formfill.h
index 45c7e52c0c..710dc4e9d2 100644
--- a/public/fpdf_formfill.h
+++ b/public/fpdf_formfill.h
@@ -818,6 +818,25 @@ typedef struct _FPDF_FORMFILLINFO {
double* top,
double* right,
double* bottom);
+
+ /**
+ * Method: FFI_PageEvent
+ * This method fires when pages have been added or deleted.
+ * Interface Version:
+ * 2
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * page_index - 0-based page number.
+ * event_type - See FXFA_PAGEVIEWEVENT_* above.
+ * Return value:
+ * None.
+ **/
+ void (*FFI_PageEvent)(struct _FPDF_FORMFILLINFO* pThis,
+ int page_index,
+ FPDF_DWORD event_type);
+
/**
* Method: FFI_PopupMenu
* This method will track the right context menu for XFA fields.