summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/cpdfsdk_annothandlermgr.cpp2
-rw-r--r--fpdfsdk/cpdfsdk_environment.cpp10
-rw-r--r--fpdfsdk/cpdfsdk_interform.cpp4
-rw-r--r--fpdfsdk/formfiller/cffl_checkbox.cpp8
-rw-r--r--fpdfsdk/formfiller/cffl_combobox.cpp4
-rw-r--r--fpdfsdk/formfiller/cffl_formfiller.cpp13
-rw-r--r--fpdfsdk/formfiller/cffl_formfiller.h2
-rw-r--r--fpdfsdk/formfiller/cffl_interactiveformfiller.cpp (renamed from fpdfsdk/formfiller/cffl_iformfiller.cpp)266
-rw-r--r--fpdfsdk/formfiller/cffl_interactiveformfiller.h (renamed from fpdfsdk/formfiller/cffl_iformfiller.h)12
-rw-r--r--fpdfsdk/formfiller/cffl_listbox.cpp6
-rw-r--r--fpdfsdk/formfiller/cffl_radiobutton.cpp6
-rw-r--r--fpdfsdk/formfiller/cffl_textfield.cpp4
-rw-r--r--fpdfsdk/include/cpdfsdk_baannothandler.h2
-rw-r--r--fpdfsdk/include/cpdfsdk_environment.h7
-rw-r--r--fpdfsdk/include/cpdfsdk_widgethandler.h10
15 files changed, 178 insertions, 178 deletions
diff --git a/fpdfsdk/cpdfsdk_annothandlermgr.cpp b/fpdfsdk/cpdfsdk_annothandlermgr.cpp
index f808b8412b..5092dc731f 100644
--- a/fpdfsdk/cpdfsdk_annothandlermgr.cpp
+++ b/fpdfsdk/cpdfsdk_annothandlermgr.cpp
@@ -31,7 +31,7 @@ CPDFSDK_AnnotHandlerMgr::CPDFSDK_AnnotHandlerMgr(CPDFSDK_Environment* pApp)
m_pXFAWidgetHandler(new CPDFSDK_XFAWidgetHandler(pApp)),
#endif // PDF_ENABLE_XFA
m_pApp(pApp) {
- m_pWidgetHandler->SetFormFiller(m_pApp->GetIFormFiller());
+ m_pWidgetHandler->SetFormFiller(m_pApp->GetInteractiveFormFiller());
}
CPDFSDK_AnnotHandlerMgr::~CPDFSDK_AnnotHandlerMgr() {}
diff --git a/fpdfsdk/cpdfsdk_environment.cpp b/fpdfsdk/cpdfsdk_environment.cpp
index 12ef66997b..21549bc1ab 100644
--- a/fpdfsdk/cpdfsdk_environment.cpp
+++ b/fpdfsdk/cpdfsdk_environment.cpp
@@ -6,7 +6,7 @@
#include "fpdfsdk/include/cpdfsdk_environment.h"
-#include "fpdfsdk/formfiller/cffl_iformfiller.h"
+#include "fpdfsdk/formfiller/cffl_interactiveformfiller.h"
#include "fpdfsdk/include/cpdfsdk_annothandlermgr.h"
#include "fpdfsdk/include/fsdk_actionhandler.h"
#include "fpdfsdk/javascript/ijs_runtime.h"
@@ -207,8 +207,8 @@ CPDFSDK_ActionHandler* CPDFSDK_Environment::GetActionHander() {
return m_pActionHandler.get();
}
-CFFL_IFormFiller* CPDFSDK_Environment::GetIFormFiller() {
- if (!m_pIFormFiller)
- m_pIFormFiller.reset(new CFFL_IFormFiller(this));
- return m_pIFormFiller.get();
+CFFL_InteractiveFormFiller* CPDFSDK_Environment::GetInteractiveFormFiller() {
+ if (!m_pFormFiller)
+ m_pFormFiller.reset(new CFFL_InteractiveFormFiller(this));
+ return m_pFormFiller.get();
}
diff --git a/fpdfsdk/cpdfsdk_interform.cpp b/fpdfsdk/cpdfsdk_interform.cpp
index e9fb5b4de0..ce6206a3f7 100644
--- a/fpdfsdk/cpdfsdk_interform.cpp
+++ b/fpdfsdk/cpdfsdk_interform.cpp
@@ -342,10 +342,10 @@ void CPDFSDK_InterForm::UpdateField(CPDF_FormField* pFormField) {
if (CPDFSDK_Widget* pWidget = GetWidget(pFormCtrl, false)) {
CPDFSDK_Environment* pEnv = m_pDocument->GetEnv();
- CFFL_IFormFiller* pIFormFiller = pEnv->GetIFormFiller();
UnderlyingPageType* pPage = pWidget->GetUnderlyingPage();
CPDFSDK_PageView* pPageView = m_pDocument->GetPageView(pPage, false);
- FX_RECT rcBBox = pIFormFiller->GetViewBBox(pPageView, pWidget);
+ FX_RECT rcBBox =
+ pEnv->GetInteractiveFormFiller()->GetViewBBox(pPageView, pWidget);
pEnv->Invalidate(pPage, rcBBox.left, rcBBox.top, rcBBox.right,
rcBBox.bottom);
diff --git a/fpdfsdk/formfiller/cffl_checkbox.cpp b/fpdfsdk/formfiller/cffl_checkbox.cpp
index ef1bf18ea6..01f1a2a08c 100644
--- a/fpdfsdk/formfiller/cffl_checkbox.cpp
+++ b/fpdfsdk/formfiller/cffl_checkbox.cpp
@@ -42,17 +42,13 @@ FX_BOOL CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot,
switch (nChar) {
case FWL_VKEY_Return:
case FWL_VKEY_Space: {
- CFFL_IFormFiller* pIFormFiller = m_pEnv->GetIFormFiller();
- ASSERT(pIFormFiller);
-
CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
ASSERT(pPageView);
FX_BOOL bReset = FALSE;
FX_BOOL bExit = FALSE;
-
- pIFormFiller->OnButtonUp(m_pWidget, pPageView, bReset, bExit, nFlags);
-
+ m_pEnv->GetInteractiveFormFiller()->OnButtonUp(m_pWidget, pPageView,
+ bReset, bExit, nFlags);
if (bReset)
return TRUE;
if (bExit)
diff --git a/fpdfsdk/formfiller/cffl_combobox.cpp b/fpdfsdk/formfiller/cffl_combobox.cpp
index 84e242ab5c..aaddcf5fbc 100644
--- a/fpdfsdk/formfiller/cffl_combobox.cpp
+++ b/fpdfsdk/formfiller/cffl_combobox.cpp
@@ -8,7 +8,7 @@
#include "fpdfsdk/formfiller/cba_fontmap.h"
#include "fpdfsdk/formfiller/cffl_formfiller.h"
-#include "fpdfsdk/formfiller/cffl_iformfiller.h"
+#include "fpdfsdk/formfiller/cffl_interactiveformfiller.h"
#include "fpdfsdk/include/cpdfsdk_environment.h"
#include "fpdfsdk/include/cpdfsdk_widget.h"
#include "fpdfsdk/include/fsdk_common.h"
@@ -54,7 +54,7 @@ CPWL_Wnd* CFFL_ComboBox::NewPDFWindow(const PWL_CREATEPARAM& cp,
pWnd->AttachFFLData(this);
pWnd->Create(cp);
- CFFL_IFormFiller* pFormFiller = m_pEnv->GetIFormFiller();
+ CFFL_InteractiveFormFiller* pFormFiller = m_pEnv->GetInteractiveFormFiller();
pWnd->SetFillerNotify(pFormFiller);
int32_t nCurSel = m_pWidget->GetSelectedIndex(0);
diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp
index 889f3b46a1..7aeda57c2e 100644
--- a/fpdfsdk/formfiller/cffl_formfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_formfiller.cpp
@@ -94,7 +94,7 @@ void CFFL_FormFiller::OnDraw(CPDFSDK_PageView* pPageView,
pWnd->DrawAppearance(pDevice, &mt);
} else {
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
- if (CFFL_IFormFiller::IsVisible(pWidget))
+ if (CFFL_InteractiveFormFiller::IsVisible(pWidget))
pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal,
nullptr);
}
@@ -525,8 +525,9 @@ FX_BOOL CFFL_FormFiller::CommitData(CPDFSDK_PageView* pPageView,
if (IsDataChanged(pPageView)) {
FX_BOOL bRC = TRUE;
FX_BOOL bExit = FALSE;
- CFFL_IFormFiller* pIFormFiller = m_pEnv->GetIFormFiller();
- pIFormFiller->OnKeyStrokeCommit(m_pWidget, pPageView, bRC, bExit, nFlag);
+ CFFL_InteractiveFormFiller* pFormFiller =
+ m_pEnv->GetInteractiveFormFiller();
+ pFormFiller->OnKeyStrokeCommit(m_pWidget, pPageView, bRC, bExit, nFlag);
if (bExit)
return TRUE;
if (!bRC) {
@@ -534,7 +535,7 @@ FX_BOOL CFFL_FormFiller::CommitData(CPDFSDK_PageView* pPageView,
return TRUE;
}
- pIFormFiller->OnValidate(m_pWidget, pPageView, bRC, bExit, nFlag);
+ pFormFiller->OnValidate(m_pWidget, pPageView, bRC, bExit, nFlag);
if (bExit)
return TRUE;
if (!bRC) {
@@ -543,11 +544,11 @@ FX_BOOL CFFL_FormFiller::CommitData(CPDFSDK_PageView* pPageView,
}
SaveData(pPageView);
- pIFormFiller->OnCalculate(m_pWidget, pPageView, bExit, nFlag);
+ pFormFiller->OnCalculate(m_pWidget, pPageView, bExit, nFlag);
if (bExit)
return TRUE;
- pIFormFiller->OnFormat(m_pWidget, pPageView, bExit, nFlag);
+ pFormFiller->OnFormat(m_pWidget, pPageView, bExit, nFlag);
}
return TRUE;
}
diff --git a/fpdfsdk/formfiller/cffl_formfiller.h b/fpdfsdk/formfiller/cffl_formfiller.h
index d2f2fe6230..1d679df536 100644
--- a/fpdfsdk/formfiller/cffl_formfiller.h
+++ b/fpdfsdk/formfiller/cffl_formfiller.h
@@ -10,7 +10,7 @@
#include <map>
#include "fpdfsdk/formfiller/cba_fontmap.h"
-#include "fpdfsdk/formfiller/cffl_iformfiller.h"
+#include "fpdfsdk/formfiller/cffl_interactiveformfiller.h"
#include "fpdfsdk/include/pdfsdk_fieldaction.h"
class CPDFSDK_Annot;
diff --git a/fpdfsdk/formfiller/cffl_iformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
index 83e91982cc..3d1a716580 100644
--- a/fpdfsdk/formfiller/cffl_iformfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
@@ -4,7 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "fpdfsdk/formfiller/cffl_iformfiller.h"
+#include "fpdfsdk/formfiller/cffl_interactiveformfiller.h"
#include "core/fpdfapi/fpdf_page/include/cpdf_page.h"
#include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
@@ -27,20 +27,21 @@
#define FFL_MAXLISTBOXHEIGHT 140.0f
-CFFL_IFormFiller::CFFL_IFormFiller(CPDFSDK_Environment* pEnv)
+CFFL_InteractiveFormFiller::CFFL_InteractiveFormFiller(
+ CPDFSDK_Environment* pEnv)
: m_pEnv(pEnv), m_bNotifying(FALSE) {}
-CFFL_IFormFiller::~CFFL_IFormFiller() {}
+CFFL_InteractiveFormFiller::~CFFL_InteractiveFormFiller() {}
-FX_BOOL CFFL_IFormFiller::Annot_HitTest(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- CFX_FloatPoint point) {
+FX_BOOL CFFL_InteractiveFormFiller::Annot_HitTest(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ CFX_FloatPoint point) {
CFX_FloatRect rc = pAnnot->GetRect();
return rc.Contains(point.x, point.y);
}
-FX_RECT CFFL_IFormFiller::GetViewBBox(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot) {
+FX_RECT CFFL_InteractiveFormFiller::GetViewBBox(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot) {
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
return pFormFiller->GetViewBBox(pPageView, pAnnot);
@@ -51,10 +52,10 @@ FX_RECT CFFL_IFormFiller::GetViewBBox(CPDFSDK_PageView* pPageView,
return rcWin.GetOuterRect();
}
-void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- CFX_RenderDevice* pDevice,
- CFX_Matrix* pUser2Device) {
+void CFFL_InteractiveFormFiller::OnDraw(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ CFX_RenderDevice* pDevice,
+ CFX_Matrix* pUser2Device) {
ASSERT(pPageView);
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
@@ -101,19 +102,19 @@ void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView,
pWidget->DrawShadow(pDevice, pPageView);
}
-void CFFL_IFormFiller::OnCreate(CPDFSDK_Annot* pAnnot) {
+void CFFL_InteractiveFormFiller::OnCreate(CPDFSDK_Annot* pAnnot) {
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
pFormFiller->OnCreate(pAnnot);
}
}
-void CFFL_IFormFiller::OnLoad(CPDFSDK_Annot* pAnnot) {
+void CFFL_InteractiveFormFiller::OnLoad(CPDFSDK_Annot* pAnnot) {
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
pFormFiller->OnLoad(pAnnot);
}
}
-void CFFL_IFormFiller::OnDelete(CPDFSDK_Annot* pAnnot) {
+void CFFL_InteractiveFormFiller::OnDelete(CPDFSDK_Annot* pAnnot) {
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
pFormFiller->OnDelete(pAnnot);
}
@@ -121,9 +122,9 @@ void CFFL_IFormFiller::OnDelete(CPDFSDK_Annot* pAnnot) {
UnRegisterFormFiller(pAnnot);
}
-void CFFL_IFormFiller::OnMouseEnter(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlag) {
+void CFFL_InteractiveFormFiller::OnMouseEnter(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlag) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
if (!m_bNotifying) {
@@ -157,9 +158,9 @@ void CFFL_IFormFiller::OnMouseEnter(CPDFSDK_PageView* pPageView,
}
}
-void CFFL_IFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlag) {
+void CFFL_InteractiveFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlag) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
if (!m_bNotifying) {
@@ -193,10 +194,10 @@ void CFFL_IFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView,
}
}
-FX_BOOL CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) {
+FX_BOOL CFFL_InteractiveFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
if (!m_bNotifying) {
@@ -235,10 +236,10 @@ FX_BOOL CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView,
return FALSE;
}
-FX_BOOL CFFL_IFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) {
+FX_BOOL CFFL_InteractiveFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
CPDFSDK_Document* pDocument = m_pEnv->GetSDKDocument();
@@ -276,11 +277,11 @@ FX_BOOL CFFL_IFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView,
return bRet;
}
-void CFFL_IFormFiller::OnButtonUp(CPDFSDK_Widget* pWidget,
- CPDFSDK_PageView* pPageView,
- FX_BOOL& bReset,
- FX_BOOL& bExit,
- uint32_t nFlag) {
+void CFFL_InteractiveFormFiller::OnButtonUp(CPDFSDK_Widget* pWidget,
+ CPDFSDK_PageView* pPageView,
+ FX_BOOL& bReset,
+ FX_BOOL& bExit,
+ uint32_t nFlag) {
ASSERT(pWidget);
if (!m_bNotifying) {
@@ -315,10 +316,11 @@ void CFFL_IFormFiller::OnButtonUp(CPDFSDK_Widget* pWidget,
}
}
-FX_BOOL CFFL_IFormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) {
+FX_BOOL CFFL_InteractiveFormFiller::OnLButtonDblClk(
+ CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
@@ -328,10 +330,10 @@ FX_BOOL CFFL_IFormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView,
return FALSE;
}
-FX_BOOL CFFL_IFormFiller::OnMouseMove(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) {
+FX_BOOL CFFL_InteractiveFormFiller::OnMouseMove(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
// change cursor
@@ -342,11 +344,11 @@ FX_BOOL CFFL_IFormFiller::OnMouseMove(CPDFSDK_PageView* pPageView,
return FALSE;
}
-FX_BOOL CFFL_IFormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- short zDelta,
- const CFX_FloatPoint& point) {
+FX_BOOL CFFL_InteractiveFormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ short zDelta,
+ const CFX_FloatPoint& point) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
@@ -356,10 +358,10 @@ FX_BOOL CFFL_IFormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView,
return FALSE;
}
-FX_BOOL CFFL_IFormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) {
+FX_BOOL CFFL_InteractiveFormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
@@ -369,10 +371,10 @@ FX_BOOL CFFL_IFormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView,
return FALSE;
}
-FX_BOOL CFFL_IFormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) {
+FX_BOOL CFFL_InteractiveFormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
@@ -382,9 +384,9 @@ FX_BOOL CFFL_IFormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView,
return FALSE;
}
-FX_BOOL CFFL_IFormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot,
- uint32_t nKeyCode,
- uint32_t nFlags) {
+FX_BOOL CFFL_InteractiveFormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot,
+ uint32_t nKeyCode,
+ uint32_t nFlags) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
@@ -394,9 +396,9 @@ FX_BOOL CFFL_IFormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot,
return FALSE;
}
-FX_BOOL CFFL_IFormFiller::OnChar(CPDFSDK_Annot* pAnnot,
- uint32_t nChar,
- uint32_t nFlags) {
+FX_BOOL CFFL_InteractiveFormFiller::OnChar(CPDFSDK_Annot* pAnnot,
+ uint32_t nChar,
+ uint32_t nFlags) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
if (nChar == FWL_VKEY_Tab)
return TRUE;
@@ -407,7 +409,8 @@ FX_BOOL CFFL_IFormFiller::OnChar(CPDFSDK_Annot* pAnnot,
return FALSE;
}
-FX_BOOL CFFL_IFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag) {
+FX_BOOL CFFL_InteractiveFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot,
+ uint32_t nFlag) {
if (!pAnnot)
return FALSE;
@@ -451,7 +454,8 @@ FX_BOOL CFFL_IFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag) {
return TRUE;
}
-FX_BOOL CFFL_IFormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag) {
+FX_BOOL CFFL_InteractiveFormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot,
+ uint32_t nFlag) {
if (!pAnnot)
return FALSE;
ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
@@ -483,16 +487,16 @@ FX_BOOL CFFL_IFormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag) {
return TRUE;
}
-FX_BOOL CFFL_IFormFiller::IsVisible(CPDFSDK_Widget* pWidget) {
+FX_BOOL CFFL_InteractiveFormFiller::IsVisible(CPDFSDK_Widget* pWidget) {
return pWidget->IsVisible();
}
-FX_BOOL CFFL_IFormFiller::IsReadOnly(CPDFSDK_Widget* pWidget) {
+FX_BOOL CFFL_InteractiveFormFiller::IsReadOnly(CPDFSDK_Widget* pWidget) {
int nFieldFlags = pWidget->GetFieldFlags();
return (nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY;
}
-FX_BOOL CFFL_IFormFiller::IsFillingAllowed(CPDFSDK_Widget* pWidget) {
+FX_BOOL CFFL_InteractiveFormFiller::IsFillingAllowed(CPDFSDK_Widget* pWidget) {
if (pWidget->GetFieldType() == FIELDTYPE_PUSHBUTTON)
return TRUE;
@@ -504,8 +508,9 @@ FX_BOOL CFFL_IFormFiller::IsFillingAllowed(CPDFSDK_Widget* pWidget) {
(dwPermissions & FPDFPERM_MODIFY);
}
-CFFL_FormFiller* CFFL_IFormFiller::GetFormFiller(CPDFSDK_Annot* pAnnot,
- FX_BOOL bRegister) {
+CFFL_FormFiller* CFFL_InteractiveFormFiller::GetFormFiller(
+ CPDFSDK_Annot* pAnnot,
+ FX_BOOL bRegister) {
auto it = m_Maps.find(pAnnot);
if (it != m_Maps.end())
return it->second.get();
@@ -548,13 +553,13 @@ CFFL_FormFiller* CFFL_IFormFiller::GetFormFiller(CPDFSDK_Annot* pAnnot,
return pFormFiller;
}
-void CFFL_IFormFiller::RemoveFormFiller(CPDFSDK_Annot* pAnnot) {
+void CFFL_InteractiveFormFiller::RemoveFormFiller(CPDFSDK_Annot* pAnnot) {
if (pAnnot) {
UnRegisterFormFiller(pAnnot);
}
}
-void CFFL_IFormFiller::UnRegisterFormFiller(CPDFSDK_Annot* pAnnot) {
+void CFFL_InteractiveFormFiller::UnRegisterFormFiller(CPDFSDK_Annot* pAnnot) {
auto it = m_Maps.find(pAnnot);
if (it == m_Maps.end())
return;
@@ -562,11 +567,11 @@ void CFFL_IFormFiller::UnRegisterFormFiller(CPDFSDK_Annot* pAnnot) {
m_Maps.erase(it);
}
-void CFFL_IFormFiller::QueryWherePopup(void* pPrivateData,
- FX_FLOAT fPopupMin,
- FX_FLOAT fPopupMax,
- int32_t& nRet,
- FX_FLOAT& fPopupRet) {
+void CFFL_InteractiveFormFiller::QueryWherePopup(void* pPrivateData,
+ FX_FLOAT fPopupMin,
+ FX_FLOAT fPopupMax,
+ int32_t& nRet,
+ FX_FLOAT& fPopupRet) {
CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
CFX_FloatRect rcPageView(0, 0, 0, 0);
@@ -635,11 +640,11 @@ void CFFL_IFormFiller::QueryWherePopup(void* pPrivateData,
fPopupRet = fFactHeight;
}
-void CFFL_IFormFiller::OnKeyStrokeCommit(CPDFSDK_Widget* pWidget,
- CPDFSDK_PageView* pPageView,
- FX_BOOL& bRC,
- FX_BOOL& bExit,
- uint32_t nFlag) {
+void CFFL_InteractiveFormFiller::OnKeyStrokeCommit(CPDFSDK_Widget* pWidget,
+ CPDFSDK_PageView* pPageView,
+ FX_BOOL& bRC,
+ FX_BOOL& bExit,
+ uint32_t nFlag) {
if (!m_bNotifying) {
if (pWidget->GetAAction(CPDF_AAction::KeyStroke).GetDict()) {
m_bNotifying = TRUE;
@@ -666,11 +671,11 @@ void CFFL_IFormFiller::OnKeyStrokeCommit(CPDFSDK_Widget* pWidget,
}
}
-void CFFL_IFormFiller::OnValidate(CPDFSDK_Widget* pWidget,
- CPDFSDK_PageView* pPageView,
- FX_BOOL& bRC,
- FX_BOOL& bExit,
- uint32_t nFlag) {
+void CFFL_InteractiveFormFiller::OnValidate(CPDFSDK_Widget* pWidget,
+ CPDFSDK_PageView* pPageView,
+ FX_BOOL& bRC,
+ FX_BOOL& bExit,
+ uint32_t nFlag) {
if (!m_bNotifying) {
if (pWidget->GetAAction(CPDF_AAction::Validate).GetDict()) {
m_bNotifying = TRUE;
@@ -696,10 +701,10 @@ void CFFL_IFormFiller::OnValidate(CPDFSDK_Widget* pWidget,
}
}
-void CFFL_IFormFiller::OnCalculate(CPDFSDK_Widget* pWidget,
- CPDFSDK_PageView* pPageView,
- FX_BOOL& bExit,
- uint32_t nFlag) {
+void CFFL_InteractiveFormFiller::OnCalculate(CPDFSDK_Widget* pWidget,
+ CPDFSDK_PageView* pPageView,
+ FX_BOOL& bExit,
+ uint32_t nFlag) {
if (!m_bNotifying) {
ASSERT(pWidget);
CPDFSDK_Document* pDocument = pPageView->GetSDKDocument();
@@ -709,10 +714,10 @@ void CFFL_IFormFiller::OnCalculate(CPDFSDK_Widget* pWidget,
}
}
-void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget,
- CPDFSDK_PageView* pPageView,
- FX_BOOL& bExit,
- uint32_t nFlag) {
+void CFFL_InteractiveFormFiller::OnFormat(CPDFSDK_Widget* pWidget,
+ CPDFSDK_PageView* pPageView,
+ FX_BOOL& bExit,
+ uint32_t nFlag) {
if (!m_bNotifying) {
ASSERT(pWidget);
CPDFSDK_Document* pDocument = pPageView->GetSDKDocument();
@@ -735,11 +740,11 @@ void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget,
}
#ifdef PDF_ENABLE_XFA
-void CFFL_IFormFiller::OnClick(CPDFSDK_Widget* pWidget,
- CPDFSDK_PageView* pPageView,
- FX_BOOL& bReset,
- FX_BOOL& bExit,
- uint32_t nFlag) {
+void CFFL_InteractiveFormFiller::OnClick(CPDFSDK_Widget* pWidget,
+ CPDFSDK_PageView* pPageView,
+ FX_BOOL& bReset,
+ FX_BOOL& bExit,
+ uint32_t nFlag) {
if (!m_bNotifying) {
if (pWidget->HasXFAAAction(PDFSDK_XFA_Click)) {
m_bNotifying = TRUE;
@@ -770,11 +775,11 @@ void CFFL_IFormFiller::OnClick(CPDFSDK_Widget* pWidget,
}
}
-void CFFL_IFormFiller::OnFull(CPDFSDK_Widget* pWidget,
- CPDFSDK_PageView* pPageView,
- FX_BOOL& bReset,
- FX_BOOL& bExit,
- uint32_t nFlag) {
+void CFFL_InteractiveFormFiller::OnFull(CPDFSDK_Widget* pWidget,
+ CPDFSDK_PageView* pPageView,
+ FX_BOOL& bReset,
+ FX_BOOL& bExit,
+ uint32_t nFlag) {
if (!m_bNotifying) {
if (pWidget->HasXFAAAction(PDFSDK_XFA_Full)) {
m_bNotifying = TRUE;
@@ -805,9 +810,9 @@ void CFFL_IFormFiller::OnFull(CPDFSDK_Widget* pWidget,
}
}
-void CFFL_IFormFiller::OnPopupPreOpen(void* pPrivateData,
- FX_BOOL& bExit,
- uint32_t nFlag) {
+void CFFL_InteractiveFormFiller::OnPopupPreOpen(void* pPrivateData,
+ FX_BOOL& bExit,
+ uint32_t nFlag) {
CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
ASSERT(pData);
ASSERT(pData->pWidget);
@@ -821,9 +826,9 @@ void CFFL_IFormFiller::OnPopupPreOpen(void* pPrivateData,
}
}
-void CFFL_IFormFiller::OnPopupPostOpen(void* pPrivateData,
- FX_BOOL& bExit,
- uint32_t nFlag) {
+void CFFL_InteractiveFormFiller::OnPopupPostOpen(void* pPrivateData,
+ FX_BOOL& bExit,
+ uint32_t nFlag) {
CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
ASSERT(pData);
ASSERT(pData->pWidget);
@@ -837,11 +842,11 @@ void CFFL_IFormFiller::OnPopupPostOpen(void* pPrivateData,
}
}
-void CFFL_IFormFiller::OnPreOpen(CPDFSDK_Widget* pWidget,
- CPDFSDK_PageView* pPageView,
- FX_BOOL& bReset,
- FX_BOOL& bExit,
- uint32_t nFlag) {
+void CFFL_InteractiveFormFiller::OnPreOpen(CPDFSDK_Widget* pWidget,
+ CPDFSDK_PageView* pPageView,
+ FX_BOOL& bReset,
+ FX_BOOL& bExit,
+ uint32_t nFlag) {
if (!m_bNotifying) {
if (pWidget->HasXFAAAction(PDFSDK_XFA_PreOpen)) {
m_bNotifying = TRUE;
@@ -872,11 +877,11 @@ void CFFL_IFormFiller::OnPreOpen(CPDFSDK_Widget* pWidget,
}
}
-void CFFL_IFormFiller::OnPostOpen(CPDFSDK_Widget* pWidget,
- CPDFSDK_PageView* pPageView,
- FX_BOOL& bReset,
- FX_BOOL& bExit,
- uint32_t nFlag) {
+void CFFL_InteractiveFormFiller::OnPostOpen(CPDFSDK_Widget* pWidget,
+ CPDFSDK_PageView* pPageView,
+ FX_BOOL& bReset,
+ FX_BOOL& bExit,
+ uint32_t nFlag) {
if (!m_bNotifying) {
if (pWidget->HasXFAAAction(PDFSDK_XFA_PostOpen)) {
m_bNotifying = TRUE;
@@ -908,23 +913,24 @@ void CFFL_IFormFiller::OnPostOpen(CPDFSDK_Widget* pWidget,
}
#endif // PDF_ENABLE_XFA
-FX_BOOL CFFL_IFormFiller::IsValidAnnot(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot) {
+FX_BOOL CFFL_InteractiveFormFiller::IsValidAnnot(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot) {
if (pPageView)
return pPageView->IsValidAnnot(pAnnot->GetPDFAnnot());
return FALSE;
}
-void CFFL_IFormFiller::OnBeforeKeyStroke(void* pPrivateData,
- CFX_WideString& strChange,
- const CFX_WideString& strChangeEx,
- int nSelStart,
- int nSelEnd,
- FX_BOOL bKeyDown,
- FX_BOOL& bRC,
- FX_BOOL& bExit,
- uint32_t nFlag) {
+void CFFL_InteractiveFormFiller::OnBeforeKeyStroke(
+ void* pPrivateData,
+ CFX_WideString& strChange,
+ const CFX_WideString& strChangeEx,
+ int nSelStart,
+ int nSelEnd,
+ FX_BOOL bKeyDown,
+ FX_BOOL& bRC,
+ FX_BOOL& bExit,
+ uint32_t nFlag) {
CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
ASSERT(pData->pWidget);
diff --git a/fpdfsdk/formfiller/cffl_iformfiller.h b/fpdfsdk/formfiller/cffl_interactiveformfiller.h
index f326123a47..1594cfda17 100644
--- a/fpdfsdk/formfiller/cffl_iformfiller.h
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.h
@@ -4,8 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef FPDFSDK_FORMFILLER_CFFL_IFORMFILLER_H_
-#define FPDFSDK_FORMFILLER_CFFL_IFORMFILLER_H_
+#ifndef FPDFSDK_FORMFILLER_CFFL_INTERACTIVEFORMFILLER_H_
+#define FPDFSDK_FORMFILLER_CFFL_INTERACTIVEFORMFILLER_H_
#include <map>
#include <memory>
@@ -19,10 +19,10 @@ class CPDFSDK_Annot;
class CPDFSDK_PageView;
class CPDFSDK_Widget;
-class CFFL_IFormFiller : public IPWL_Filler_Notify {
+class CFFL_InteractiveFormFiller : public IPWL_Filler_Notify {
public:
- explicit CFFL_IFormFiller(CPDFSDK_Environment* pEnv);
- ~CFFL_IFormFiller() override;
+ explicit CFFL_InteractiveFormFiller(CPDFSDK_Environment* pEnv);
+ ~CFFL_InteractiveFormFiller() override;
virtual FX_BOOL Annot_HitTest(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
@@ -186,4 +186,4 @@ class CFFL_PrivateData {
int nValueAge;
};
-#endif // FPDFSDK_FORMFILLER_CFFL_IFORMFILLER_H_
+#endif // FPDFSDK_FORMFILLER_CFFL_INTERACTIVEFORMFILLER_H_
diff --git a/fpdfsdk/formfiller/cffl_listbox.cpp b/fpdfsdk/formfiller/cffl_listbox.cpp
index 0f253ec380..7a6976e440 100644
--- a/fpdfsdk/formfiller/cffl_listbox.cpp
+++ b/fpdfsdk/formfiller/cffl_listbox.cpp
@@ -8,7 +8,7 @@
#include "fpdfsdk/formfiller/cba_fontmap.h"
#include "fpdfsdk/formfiller/cffl_formfiller.h"
-#include "fpdfsdk/formfiller/cffl_iformfiller.h"
+#include "fpdfsdk/formfiller/cffl_interactiveformfiller.h"
#include "fpdfsdk/include/cpdfsdk_environment.h"
#include "fpdfsdk/include/cpdfsdk_widget.h"
#include "fpdfsdk/include/fsdk_common.h"
@@ -47,9 +47,7 @@ CPWL_Wnd* CFFL_ListBox::NewPDFWindow(const PWL_CREATEPARAM& cp,
CPWL_ListBox* pWnd = new CPWL_ListBox();
pWnd->AttachFFLData(this);
pWnd->Create(cp);
-
- CFFL_IFormFiller* pIFormFiller = m_pEnv->GetIFormFiller();
- pWnd->SetFillerNotify(pIFormFiller);
+ pWnd->SetFillerNotify(m_pEnv->GetInteractiveFormFiller());
for (int32_t i = 0, sz = m_pWidget->CountOptions(); i < sz; i++)
pWnd->AddString(m_pWidget->GetOptionLabel(i));
diff --git a/fpdfsdk/formfiller/cffl_radiobutton.cpp b/fpdfsdk/formfiller/cffl_radiobutton.cpp
index 8e782d0eb9..17573fd625 100644
--- a/fpdfsdk/formfiller/cffl_radiobutton.cpp
+++ b/fpdfsdk/formfiller/cffl_radiobutton.cpp
@@ -46,15 +46,13 @@ FX_BOOL CFFL_RadioButton::OnChar(CPDFSDK_Annot* pAnnot,
switch (nChar) {
case FWL_VKEY_Return:
case FWL_VKEY_Space: {
- CFFL_IFormFiller* pIFormFiller = m_pEnv->GetIFormFiller();
CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
ASSERT(pPageView);
FX_BOOL bReset = FALSE;
FX_BOOL bExit = FALSE;
-
- pIFormFiller->OnButtonUp(m_pWidget, pPageView, bReset, bExit, nFlags);
-
+ m_pEnv->GetInteractiveFormFiller()->OnButtonUp(m_pWidget, pPageView,
+ bReset, bExit, nFlags);
if (bReset)
return TRUE;
if (bExit)
diff --git a/fpdfsdk/formfiller/cffl_textfield.cpp b/fpdfsdk/formfiller/cffl_textfield.cpp
index aa3b87a09a..b80bbe4e17 100644
--- a/fpdfsdk/formfiller/cffl_textfield.cpp
+++ b/fpdfsdk/formfiller/cffl_textfield.cpp
@@ -83,9 +83,7 @@ CPWL_Wnd* CFFL_TextField::NewPDFWindow(const PWL_CREATEPARAM& cp,
CPWL_Edit* pWnd = new CPWL_Edit();
pWnd->AttachFFLData(this);
pWnd->Create(cp);
-
- CFFL_IFormFiller* pIFormFiller = m_pEnv->GetIFormFiller();
- pWnd->SetFillerNotify(pIFormFiller);
+ pWnd->SetFillerNotify(m_pEnv->GetInteractiveFormFiller());
int32_t nMaxLen = m_pWidget->GetMaxLen();
CFX_WideString swValue = m_pWidget->GetValue();
diff --git a/fpdfsdk/include/cpdfsdk_baannothandler.h b/fpdfsdk/include/cpdfsdk_baannothandler.h
index 1e04bc15c2..112f8125f1 100644
--- a/fpdfsdk/include/cpdfsdk_baannothandler.h
+++ b/fpdfsdk/include/cpdfsdk_baannothandler.h
@@ -11,7 +11,7 @@
#include "core/fxcrt/include/fx_coordinates.h"
#include "fpdfsdk/include/ipdfsdk_annothandler.h"
-class CFFL_IFormFiller;
+class CFFL_InteractiveFormFiller;
class CFX_Matrix;
class CFX_RenderDevice;
class CPDF_Annot;
diff --git a/fpdfsdk/include/cpdfsdk_environment.h b/fpdfsdk/include/cpdfsdk_environment.h
index 59b260859a..338d70f33b 100644
--- a/fpdfsdk/include/cpdfsdk_environment.h
+++ b/fpdfsdk/include/cpdfsdk_environment.h
@@ -18,7 +18,7 @@
#include "public/fpdf_formfill.h"
#include "public/fpdf_fwlevent.h"
-class CFFL_IFormFiller;
+class CFFL_InteractiveFormFiller;
class CFX_SystemHandler;
class CPDFSDK_ActionHandler;
class CPDFSDK_AnnotHandlerMgr;
@@ -400,7 +400,8 @@ class CPDFSDK_Environment final {
CFX_SystemHandler* GetSysHandler() const { return m_pSysHandler.get(); }
FPDF_FORMFILLINFO* GetFormFillInfo() const { return m_pInfo; }
- CFFL_IFormFiller* GetIFormFiller(); // Creates if not present.
+ // Creates if not present.
+ CFFL_InteractiveFormFiller* GetInteractiveFormFiller();
CPDFSDK_AnnotHandlerMgr* GetAnnotHandlerMgr(); // Creates if not present.
IJS_Runtime* GetJSRuntime(); // Creates if not present.
CPDFSDK_ActionHandler* GetActionHander(); // Creates if not present.
@@ -412,7 +413,7 @@ class CPDFSDK_Environment final {
FPDF_FORMFILLINFO* const m_pInfo;
CPDFSDK_Document* m_pSDKDoc;
UnderlyingDocumentType* const m_pUnderlyingDoc;
- std::unique_ptr<CFFL_IFormFiller> m_pIFormFiller;
+ std::unique_ptr<CFFL_InteractiveFormFiller> m_pFormFiller;
std::unique_ptr<CFX_SystemHandler> m_pSysHandler;
};
diff --git a/fpdfsdk/include/cpdfsdk_widgethandler.h b/fpdfsdk/include/cpdfsdk_widgethandler.h
index 432a90bc24..c5efd21e84 100644
--- a/fpdfsdk/include/cpdfsdk_widgethandler.h
+++ b/fpdfsdk/include/cpdfsdk_widgethandler.h
@@ -11,7 +11,7 @@
#include "core/fxcrt/include/fx_coordinates.h"
#include "fpdfsdk/include/ipdfsdk_annothandler.h"
-class CFFL_IFormFiller;
+class CFFL_InteractiveFormFiller;
class CFX_Matrix;
class CFX_RenderDevice;
class CPDF_Annot;
@@ -103,12 +103,14 @@ class CPDFSDK_WidgetHandler : public IPDFSDK_AnnotHandler {
CPDFSDK_Annot* pNewAnnot) override;
#endif // PDF_ENABLE_XFA
- void SetFormFiller(CFFL_IFormFiller* pFiller) { m_pFormFiller = pFiller; }
- CFFL_IFormFiller* GetFormFiller() { return m_pFormFiller; }
+ void SetFormFiller(CFFL_InteractiveFormFiller* pFiller) {
+ m_pFormFiller = pFiller;
+ }
+ CFFL_InteractiveFormFiller* GetFormFiller() { return m_pFormFiller; }
private:
CPDFSDK_Environment* m_pApp;
- CFFL_IFormFiller* m_pFormFiller;
+ CFFL_InteractiveFormFiller* m_pFormFiller;
};
#endif // FPDFSDK_INCLUDE_CPDFSDK_WIDGETHANDLER_H_