summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-03-31 20:34:43 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-31 20:34:43 -0700
commitdf4bc596c64fb848647c670be66a29ea0861b4f4 (patch)
tree096f18bc5903e45982291daf81424d0d4954d158 /fpdfsdk
parent64376be4aac4710848b36b823fd98aae75095336 (diff)
downloadpdfium-df4bc596c64fb848647c670be66a29ea0861b4f4.tar.xz
Remove IXFA_* interfaces.
This CL removes the IXFA_* interfaces which are: - Implemented once. - Not implemented by an fpdfsdk class. This requires making a few classes visible to fpdfsdk so we can have the correct instances available instead of the IXFA types. Review URL: https://codereview.chromium.org/1846993002
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdfformfill.cpp44
-rw-r--r--fpdfsdk/fpdfsave.cpp24
-rw-r--r--fpdfsdk/fpdfxfa/fpdfxfa_app.cpp17
-rw-r--r--fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp110
-rw-r--r--fpdfsdk/fpdfxfa/fpdfxfa_page.cpp8
-rw-r--r--fpdfsdk/fsdk_annothandler.cpp52
-rw-r--r--fpdfsdk/fsdk_baseform.cpp86
-rw-r--r--fpdfsdk/fsdk_mgr.cpp17
-rw-r--r--fpdfsdk/include/fpdfxfa/fpdfxfa_app.h5
-rw-r--r--fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h101
-rw-r--r--fpdfsdk/include/fpdfxfa/fpdfxfa_page.h10
-rw-r--r--fpdfsdk/include/fsdk_annothandler.h14
-rw-r--r--fpdfsdk/include/fsdk_baseannot.h2
-rw-r--r--fpdfsdk/include/fsdk_baseform.h36
-rw-r--r--fpdfsdk/include/fsdk_mgr.h4
15 files changed, 274 insertions, 256 deletions
diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdfformfill.cpp
index ed6279a2c6..ea36c78da4 100644
--- a/fpdfsdk/fpdfformfill.cpp
+++ b/fpdfsdk/fpdfformfill.cpp
@@ -21,6 +21,9 @@
#include "fpdfsdk/include/fpdfxfa/fpdfxfa_app.h"
#include "fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h"
#include "fpdfsdk/include/fpdfxfa/fpdfxfa_page.h"
+#include "xfa/include/fxfa/xfa_ffapp.h"
+#include "xfa/include/fxfa/xfa_ffdocview.h"
+#include "xfa/include/fxfa/xfa_ffpageview.h"
#endif // PDF_ENABLE_XFA
namespace {
@@ -75,15 +78,15 @@ DLLEXPORT int STDCALL FPDFPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle,
if (!pXFAPage)
return -1;
- IXFA_PageView* pPageView = pXFAPage->GetXFAPageView();
+ CXFA_FFPageView* pPageView = pXFAPage->GetXFAPageView();
if (!pPageView)
return -1;
- IXFA_DocView* pDocView = pPageView->GetDocView();
+ CXFA_FFDocView* pDocView = pPageView->GetDocView();
if (!pDocView)
return -1;
- IXFA_WidgetHandler* pWidgetHandler = pDocView->GetWidgetHandler();
+ CXFA_FFWidgetHandler* pWidgetHandler = pDocView->GetWidgetHandler();
if (!pWidgetHandler)
return -1;
@@ -94,7 +97,7 @@ DLLEXPORT int STDCALL FPDFPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle,
if (!pWidgetIterator)
return -1;
- IXFA_Widget* pXFAAnnot = pWidgetIterator->MoveToNext();
+ CXFA_FFWidget* pXFAAnnot = pWidgetIterator->MoveToNext();
while (pXFAAnnot) {
CFX_RectF rcBBox;
pWidgetHandler->GetBBox(pXFAAnnot, rcBBox, 0);
@@ -417,12 +420,12 @@ DLLEXPORT void STDCALL FPDF_Widget_Undo(FPDF_DOCUMENT document,
pDocument->GetDocType() != XFA_DOCTYPE_Static)
return;
- IXFA_MenuHandler* pXFAMenuHander =
+ CXFA_FFMenuHandler* pXFAMenuHander =
CPDFXFA_App::GetInstance()->GetXFAApp()->GetMenuHandler();
if (pXFAMenuHander == NULL)
return;
- pXFAMenuHander->Undo((IXFA_Widget*)hWidget);
+ pXFAMenuHander->Undo((CXFA_FFWidget*)hWidget);
}
DLLEXPORT void STDCALL FPDF_Widget_Redo(FPDF_DOCUMENT document,
FPDF_WIDGET hWidget) {
@@ -434,12 +437,12 @@ DLLEXPORT void STDCALL FPDF_Widget_Redo(FPDF_DOCUMENT document,
pDocument->GetDocType() != XFA_DOCTYPE_Static)
return;
- IXFA_MenuHandler* pXFAMenuHander =
+ CXFA_FFMenuHandler* pXFAMenuHander =
CPDFXFA_App::GetInstance()->GetXFAApp()->GetMenuHandler();
if (pXFAMenuHander == NULL)
return;
- pXFAMenuHander->Redo((IXFA_Widget*)hWidget);
+ pXFAMenuHander->Redo((CXFA_FFWidget*)hWidget);
}
DLLEXPORT void STDCALL FPDF_Widget_SelectAll(FPDF_DOCUMENT document,
@@ -452,12 +455,12 @@ DLLEXPORT void STDCALL FPDF_Widget_SelectAll(FPDF_DOCUMENT document,
pDocument->GetDocType() != XFA_DOCTYPE_Static)
return;
- IXFA_MenuHandler* pXFAMenuHander =
+ CXFA_FFMenuHandler* pXFAMenuHander =
CPDFXFA_App::GetInstance()->GetXFAApp()->GetMenuHandler();
if (pXFAMenuHander == NULL)
return;
- pXFAMenuHander->SelectAll((IXFA_Widget*)hWidget);
+ pXFAMenuHander->SelectAll((CXFA_FFWidget*)hWidget);
}
DLLEXPORT void STDCALL FPDF_Widget_Copy(FPDF_DOCUMENT document,
FPDF_WIDGET hWidget,
@@ -471,13 +474,13 @@ DLLEXPORT void STDCALL FPDF_Widget_Copy(FPDF_DOCUMENT document,
pDocument->GetDocType() != XFA_DOCTYPE_Static)
return;
- IXFA_MenuHandler* pXFAMenuHander =
+ CXFA_FFMenuHandler* pXFAMenuHander =
CPDFXFA_App::GetInstance()->GetXFAApp()->GetMenuHandler();
if (pXFAMenuHander == NULL)
return;
CFX_WideString wsCpText;
- pXFAMenuHander->Copy((IXFA_Widget*)hWidget, wsCpText);
+ pXFAMenuHander->Copy((CXFA_FFWidget*)hWidget, wsCpText);
CFX_ByteString bsCpText = wsCpText.UTF16LE_Encode();
uint32_t len = bsCpText.GetLength() / sizeof(unsigned short);
@@ -507,13 +510,13 @@ DLLEXPORT void STDCALL FPDF_Widget_Cut(FPDF_DOCUMENT document,
pDocument->GetDocType() != XFA_DOCTYPE_Static)
return;
- IXFA_MenuHandler* pXFAMenuHander =
+ CXFA_FFMenuHandler* pXFAMenuHander =
CPDFXFA_App::GetInstance()->GetXFAApp()->GetMenuHandler();
if (pXFAMenuHander == NULL)
return;
CFX_WideString wsCpText;
- pXFAMenuHander->Cut((IXFA_Widget*)hWidget, wsCpText);
+ pXFAMenuHander->Cut((CXFA_FFWidget*)hWidget, wsCpText);
CFX_ByteString bsCpText = wsCpText.UTF16LE_Encode();
uint32_t len = bsCpText.GetLength() / sizeof(unsigned short);
@@ -544,13 +547,13 @@ DLLEXPORT void STDCALL FPDF_Widget_Paste(FPDF_DOCUMENT document,
pDocument->GetDocType() != XFA_DOCTYPE_Static)
return;
- IXFA_MenuHandler* pXFAMenuHander =
+ CXFA_FFMenuHandler* pXFAMenuHander =
CPDFXFA_App::GetInstance()->GetXFAApp()->GetMenuHandler();
if (pXFAMenuHander == NULL)
return;
CFX_WideString wstr = CFX_WideString::FromUTF16LE(wsText, size);
- pXFAMenuHander->Paste((IXFA_Widget*)hWidget, wstr);
+ pXFAMenuHander->Paste((CXFA_FFWidget*)hWidget, wstr);
}
DLLEXPORT void STDCALL
@@ -567,7 +570,7 @@ FPDF_Widget_ReplaceSpellCheckWord(FPDF_DOCUMENT document,
pDocument->GetDocType() != XFA_DOCTYPE_Static)
return;
- IXFA_MenuHandler* pXFAMenuHander =
+ CXFA_FFMenuHandler* pXFAMenuHander =
CPDFXFA_App::GetInstance()->GetXFAApp()->GetMenuHandler();
if (pXFAMenuHander == NULL)
return;
@@ -576,7 +579,8 @@ FPDF_Widget_ReplaceSpellCheckWord(FPDF_DOCUMENT document,
ptPopup.x = x;
ptPopup.y = y;
CFX_ByteStringC bs(bsText);
- pXFAMenuHander->ReplaceSpellCheckWord((IXFA_Widget*)hWidget, ptPopup, bs);
+ pXFAMenuHander->ReplaceSpellCheckWord(
+ reinterpret_cast<CXFA_FFWidget*>(hWidget), ptPopup, bs);
}
DLLEXPORT void STDCALL
@@ -593,7 +597,7 @@ FPDF_Widget_GetSpellCheckWords(FPDF_DOCUMENT document,
pDocument->GetDocType() != XFA_DOCTYPE_Static)
return;
- IXFA_MenuHandler* pXFAMenuHander =
+ CXFA_FFMenuHandler* pXFAMenuHander =
CPDFXFA_App::GetInstance()->GetXFAApp()->GetMenuHandler();
if (!pXFAMenuHander)
return;
@@ -602,7 +606,7 @@ FPDF_Widget_GetSpellCheckWords(FPDF_DOCUMENT document,
CFX_PointF ptPopup;
ptPopup.x = x;
ptPopup.y = y;
- pXFAMenuHander->GetSuggestWords(reinterpret_cast<IXFA_Widget*>(hWidget),
+ pXFAMenuHander->GetSuggestWords(reinterpret_cast<CXFA_FFWidget*>(hWidget),
ptPopup, *sSuggestWords);
*stringHandle = ToFPDFStringHandle(sSuggestWords);
}
diff --git a/fpdfsdk/fpdfsave.cpp b/fpdfsdk/fpdfsave.cpp
index e11e1f2d6d..b9d393e505 100644
--- a/fpdfsdk/fpdfsave.cpp
+++ b/fpdfsdk/fpdfsave.cpp
@@ -23,6 +23,10 @@
#include "fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h"
#include "fpdfsdk/include/fpdfxfa/fpdfxfa_util.h"
#include "public/fpdf_formfill.h"
+#include "xfa/include/fxfa/xfa_checksum.h"
+#include "xfa/include/fxfa/xfa_ffapp.h"
+#include "xfa/include/fxfa/xfa_ffdocview.h"
+#include "xfa/include/fxfa/xfa_ffwidgethandler.h"
#endif
#if _FX_OS_ == _FX_ANDROID_
@@ -83,11 +87,11 @@ bool SaveXFADocumentData(CPDFXFA_Document* pDocument,
if (!CPDFXFA_App::GetInstance()->GetXFAApp())
return true;
- IXFA_DocView* pXFADocView = pDocument->GetXFADocView();
+ CXFA_FFDocView* pXFADocView = pDocument->GetXFADocView();
if (!pXFADocView)
return true;
- IXFA_DocHandler* pXFADocHandler =
+ CXFA_FFDocHandler* pXFADocHandler =
CPDFXFA_App::GetInstance()->GetXFAApp()->GetDocHandler();
CPDF_Document* pPDFDocument = pDocument->GetPDFDoc();
if (!pDocument)
@@ -128,8 +132,8 @@ bool SaveXFADocumentData(CPDFXFA_Document* pDocument,
else if (pPDFObj->GetString() == "template")
iTemplate = i + 1;
}
- std::unique_ptr<IXFA_ChecksumContext, ReleaseDeleter<IXFA_ChecksumContext>>
- pContext(XFA_Checksum_Create());
+ std::unique_ptr<CXFA_ChecksumContext, ReleaseDeleter<CXFA_ChecksumContext>>
+ pContext(new CXFA_ChecksumContext);
pContext->StartChecksum();
// template
@@ -228,13 +232,13 @@ bool SendPostSaveToXFADoc(CPDFXFA_Document* pDocument) {
pDocument->GetDocType() != DOCTYPE_STATIC_XFA)
return true;
- IXFA_DocView* pXFADocView = pDocument->GetXFADocView();
+ CXFA_FFDocView* pXFADocView = pDocument->GetXFADocView();
if (!pXFADocView)
return false;
- IXFA_WidgetHandler* pWidgetHander = pXFADocView->GetWidgetHandler();
+ CXFA_FFWidgetHandler* pWidgetHander = pXFADocView->GetWidgetHandler();
CXFA_WidgetAcc* pWidgetAcc = NULL;
- IXFA_WidgetAccIterator* pWidgetAccIterator =
+ CXFA_WidgetAccIterator* pWidgetAccIterator =
pXFADocView->CreateWidgetAccIterator();
pWidgetAcc = pWidgetAccIterator->MoveToNext();
while (pWidgetAcc) {
@@ -255,13 +259,13 @@ bool SendPreSaveToXFADoc(CPDFXFA_Document* pDocument,
pDocument->GetDocType() != DOCTYPE_STATIC_XFA)
return true;
- IXFA_DocView* pXFADocView = pDocument->GetXFADocView();
+ CXFA_FFDocView* pXFADocView = pDocument->GetXFADocView();
if (!pXFADocView)
return true;
- IXFA_WidgetHandler* pWidgetHander = pXFADocView->GetWidgetHandler();
+ CXFA_FFWidgetHandler* pWidgetHander = pXFADocView->GetWidgetHandler();
CXFA_WidgetAcc* pWidgetAcc = NULL;
- IXFA_WidgetAccIterator* pWidgetAccIterator =
+ CXFA_WidgetAccIterator* pWidgetAccIterator =
pXFADocView->CreateWidgetAccIterator();
pWidgetAcc = pWidgetAccIterator->MoveToNext();
while (pWidgetAcc) {
diff --git a/fpdfsdk/fpdfxfa/fpdfxfa_app.cpp b/fpdfsdk/fpdfxfa/fpdfxfa_app.cpp
index b52879a25a..4e1b95ea64 100644
--- a/fpdfsdk/fpdfxfa/fpdfxfa_app.cpp
+++ b/fpdfsdk/fpdfxfa/fpdfxfa_app.cpp
@@ -11,6 +11,8 @@
#include "fpdfsdk/include/fsdk_mgr.h"
#include "public/fpdf_formfill.h"
#include "xfa/fxbarcode/include/BC_Library.h"
+#include "xfa/include/fxfa/xfa_ffapp.h"
+#include "xfa/include/fxfa/xfa_fontmgr.h"
CPDFXFA_App* CPDFXFA_App::g_pApp = NULL;
@@ -29,7 +31,6 @@ void CPDFXFA_App::ReleaseInstance() {
CPDFXFA_App::CPDFXFA_App()
: m_bJavaScriptInitialized(FALSE),
m_pXFAApp(NULL),
- m_pFontMgr(NULL),
m_hJSERuntime(NULL),
m_csAppType(JS_STR_VIEWERTYPE_STANDARD),
m_bOwnedRuntime(false) {
@@ -37,9 +38,6 @@ CPDFXFA_App::CPDFXFA_App()
}
CPDFXFA_App::~CPDFXFA_App() {
- delete m_pFontMgr;
- m_pFontMgr = NULL;
-
delete m_pXFAApp;
m_pXFAApp = NULL;
@@ -62,15 +60,8 @@ FX_BOOL CPDFXFA_App::Initialize(FXJSE_HRUNTIME hRuntime) {
if (!m_hJSERuntime)
return FALSE;
- m_pXFAApp = IXFA_App::Create(this);
- if (!m_pXFAApp)
- return FALSE;
-
- m_pFontMgr = IXFA_FontMgr::CreateDefault();
- if (!m_pFontMgr)
- return FALSE;
-
- m_pXFAApp->SetDefaultFontMgr(m_pFontMgr);
+ m_pXFAApp = new CXFA_FFApp(this);
+ m_pXFAApp->SetDefaultFontMgr(new CXFA_DefFontMgr);
#endif
return TRUE;
}
diff --git a/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp b/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp
index 23efc3321a..11434ae947 100644
--- a/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp
+++ b/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp
@@ -16,6 +16,10 @@
#include "fpdfsdk/include/fsdk_mgr.h"
#include "fpdfsdk/javascript/ijs_runtime.h"
#include "public/fpdf_formfill.h"
+#include "xfa/include/fxfa/xfa_ffapp.h"
+#include "xfa/include/fxfa/xfa_ffdoc.h"
+#include "xfa/include/fxfa/xfa_ffdocview.h"
+#include "xfa/include/fxfa/xfa_ffpageview.h"
#define IDS_XFA_Validate_Input \
"At least one required field was empty. Please fill in the required " \
@@ -53,9 +57,9 @@ CPDFXFA_Document::~CPDFXFA_Document() {
m_nLoadStatus = FXFA_LOADSTATUS_CLOSING;
if (m_pXFADoc) {
- IXFA_App* pApp = m_pApp->GetXFAApp();
+ CXFA_FFApp* pApp = m_pApp->GetXFAApp();
if (pApp) {
- IXFA_DocHandler* pDocHandler = pApp->GetDocHandler();
+ CXFA_FFDocHandler* pDocHandler = pApp->GetDocHandler();
if (pDocHandler) {
CloseXFADoc(pDocHandler);
}
@@ -84,7 +88,7 @@ FX_BOOL CPDFXFA_Document::LoadXFADoc() {
m_XFAPageList.RemoveAll();
- IXFA_App* pApp = m_pApp->GetXFAApp();
+ CXFA_FFApp* pApp = m_pApp->GetXFAApp();
if (!pApp)
return FALSE;
@@ -94,7 +98,7 @@ FX_BOOL CPDFXFA_Document::LoadXFADoc() {
return FALSE;
}
- IXFA_DocHandler* pDocHandler = pApp->GetDocHandler();
+ CXFA_FFDocHandler* pDocHandler = pApp->GetDocHandler();
if (!pDocHandler) {
SetLastError(FPDF_ERR_XFALOAD);
return FALSE;
@@ -170,7 +174,7 @@ CPDFXFA_Page* CPDFXFA_Document::GetPage(int page_index) {
return pPage;
}
-CPDFXFA_Page* CPDFXFA_Document::GetPage(IXFA_PageView* pPage) {
+CPDFXFA_Page* CPDFXFA_Document::GetPage(CXFA_FFPageView* pPage) {
if (!pPage)
return NULL;
@@ -219,19 +223,19 @@ void CPDFXFA_Document::FXRect2PDFRect(const CFX_RectF& fxRectF,
pdfRect.bottom = fxRectF.top;
}
-void CPDFXFA_Document::SetChangeMark(IXFA_Doc* hDoc) {
+void CPDFXFA_Document::SetChangeMark(CXFA_FFDoc* hDoc) {
if (hDoc == m_pXFADoc && m_pSDKDoc) {
m_pSDKDoc->SetChangeMark();
}
}
-FX_BOOL CPDFXFA_Document::GetChangeMark(IXFA_Doc* hDoc) {
+FX_BOOL CPDFXFA_Document::GetChangeMark(CXFA_FFDoc* hDoc) {
if (hDoc == m_pXFADoc && m_pSDKDoc)
return m_pSDKDoc->GetChangeMark();
return FALSE;
}
-void CPDFXFA_Document::InvalidateRect(IXFA_PageView* pPageView,
+void CPDFXFA_Document::InvalidateRect(CXFA_FFPageView* pPageView,
const CFX_RectF& rt,
uint32_t dwFlags /* = 0 */) {
if (!m_pXFADoc || !m_pSDKDoc)
@@ -256,7 +260,7 @@ void CPDFXFA_Document::InvalidateRect(IXFA_PageView* pPageView,
rcPage.right, rcPage.top);
}
-void CPDFXFA_Document::InvalidateRect(IXFA_Widget* hWidget,
+void CPDFXFA_Document::InvalidateRect(CXFA_FFWidget* hWidget,
uint32_t dwFlags /* = 0 */) {
if (!hWidget)
return;
@@ -267,11 +271,11 @@ void CPDFXFA_Document::InvalidateRect(IXFA_Widget* hWidget,
if (m_iDocType != DOCTYPE_DYNAMIC_XFA)
return;
- IXFA_WidgetHandler* pWidgetHandler = m_pXFADocView->GetWidgetHandler();
+ CXFA_FFWidgetHandler* pWidgetHandler = m_pXFADocView->GetWidgetHandler();
if (!pWidgetHandler)
return;
- IXFA_PageView* pPageView = pWidgetHandler->GetPageView(hWidget);
+ CXFA_FFPageView* pPageView = pWidgetHandler->GetPageView(hWidget);
if (!pPageView)
return;
@@ -280,7 +284,7 @@ void CPDFXFA_Document::InvalidateRect(IXFA_Widget* hWidget,
InvalidateRect(pPageView, rect, dwFlags);
}
-void CPDFXFA_Document::DisplayCaret(IXFA_Widget* hWidget,
+void CPDFXFA_Document::DisplayCaret(CXFA_FFWidget* hWidget,
FX_BOOL bVisible,
const CFX_RectF* pRtAnchor) {
if (!hWidget || pRtAnchor == NULL)
@@ -292,11 +296,11 @@ void CPDFXFA_Document::DisplayCaret(IXFA_Widget* hWidget,
if (m_iDocType != DOCTYPE_DYNAMIC_XFA)
return;
- IXFA_WidgetHandler* pWidgetHandler = m_pXFADocView->GetWidgetHandler();
+ CXFA_FFWidgetHandler* pWidgetHandler = m_pXFADocView->GetWidgetHandler();
if (!pWidgetHandler)
return;
- IXFA_PageView* pPageView = pWidgetHandler->GetPageView(hWidget);
+ CXFA_FFPageView* pPageView = pWidgetHandler->GetPageView(hWidget);
if (!pPageView)
return;
@@ -316,7 +320,7 @@ void CPDFXFA_Document::DisplayCaret(IXFA_Widget* hWidget,
rcCaret.right, rcCaret.bottom);
}
-FX_BOOL CPDFXFA_Document::GetPopupPos(IXFA_Widget* hWidget,
+FX_BOOL CPDFXFA_Document::GetPopupPos(CXFA_FFWidget* hWidget,
FX_FLOAT fMinPopup,
FX_FLOAT fMaxPopup,
const CFX_RectF& rtAnchor,
@@ -324,7 +328,7 @@ FX_BOOL CPDFXFA_Document::GetPopupPos(IXFA_Widget* hWidget,
if (NULL == hWidget) {
return FALSE;
}
- IXFA_PageView* pXFAPageView =
+ CXFA_FFPageView* pXFAPageView =
m_pXFADocView->GetWidgetHandler()->GetPageView(hWidget);
if (NULL == pXFAPageView) {
return FALSE;
@@ -450,13 +454,13 @@ FX_BOOL CPDFXFA_Document::GetPopupPos(IXFA_Widget* hWidget,
return TRUE;
}
-FX_BOOL CPDFXFA_Document::PopupMenu(IXFA_Widget* hWidget,
+FX_BOOL CPDFXFA_Document::PopupMenu(CXFA_FFWidget* hWidget,
CFX_PointF ptPopup,
const CFX_RectF* pRectExclude) {
if (NULL == hWidget) {
return FALSE;
}
- IXFA_PageView* pXFAPageView =
+ CXFA_FFPageView* pXFAPageView =
m_pXFADocView->GetWidgetHandler()->GetPageView(hWidget);
if (pXFAPageView == NULL)
return FALSE;
@@ -467,7 +471,7 @@ FX_BOOL CPDFXFA_Document::PopupMenu(IXFA_Widget* hWidget,
int menuFlag = 0;
- IXFA_MenuHandler* pXFAMenuHander = m_pApp->GetXFAApp()->GetMenuHandler();
+ CXFA_FFMenuHandler* pXFAMenuHander = m_pApp->GetXFAApp()->GetMenuHandler();
if (pXFAMenuHander->CanUndo(hWidget))
menuFlag |= FXFA_MEMU_UNDO;
if (pXFAMenuHander->CanRedo(hWidget))
@@ -488,7 +492,7 @@ FX_BOOL CPDFXFA_Document::PopupMenu(IXFA_Widget* hWidget,
return pEnv->FFI_PopupMenu(pPage, hWidget, menuFlag, ptPopup, NULL);
}
-void CPDFXFA_Document::PageViewEvent(IXFA_PageView* pPageView,
+void CPDFXFA_Document::PageViewEvent(CXFA_FFPageView* pPageView,
uint32_t dwFlags) {
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
if (!pEnv)
@@ -501,7 +505,7 @@ void CPDFXFA_Document::PageViewEvent(IXFA_PageView* pPageView,
if (nNewCount == m_nPageCount)
return;
- IXFA_DocView* pXFADocView = GetXFADocView();
+ CXFA_FFDocView* pXFADocView = GetXFADocView();
if (!pXFADocView)
return;
for (int iPageIter = 0; iPageIter < m_nPageCount; iPageIter++) {
@@ -509,7 +513,7 @@ void CPDFXFA_Document::PageViewEvent(IXFA_PageView* pPageView,
if (!pPage)
continue;
m_pSDKDoc->RemovePageView(pPage);
- IXFA_PageView* pXFAPageView = pXFADocView->GetPageView(iPageIter);
+ CXFA_FFPageView* pXFAPageView = pXFADocView->GetPageView(iPageIter);
pPage->SetXFAPageView(pXFAPageView);
if (pXFAPageView)
pXFAPageView->LoadPageView(nullptr);
@@ -524,7 +528,7 @@ void CPDFXFA_Document::PageViewEvent(IXFA_PageView* pPageView,
}
}
-void CPDFXFA_Document::WidgetEvent(IXFA_Widget* hWidget,
+void CPDFXFA_Document::WidgetEvent(CXFA_FFWidget* hWidget,
CXFA_WidgetAcc* pWidgetData,
uint32_t dwEvent,
void* pParam,
@@ -536,7 +540,7 @@ void CPDFXFA_Document::WidgetEvent(IXFA_Widget* hWidget,
if (!pEnv)
return;
- IXFA_PageView* pPageView =
+ CXFA_FFPageView* pPageView =
m_pXFADocView->GetWidgetHandler()->GetPageView(hWidget);
if (pPageView == NULL)
return;
@@ -557,13 +561,13 @@ void CPDFXFA_Document::WidgetEvent(IXFA_Widget* hWidget,
}
}
-int32_t CPDFXFA_Document::CountPages(IXFA_Doc* hDoc) {
+int32_t CPDFXFA_Document::CountPages(CXFA_FFDoc* hDoc) {
if (hDoc == m_pXFADoc && m_pSDKDoc) {
return GetPageCount();
}
return 0;
}
-int32_t CPDFXFA_Document::GetCurrentPage(IXFA_Doc* hDoc) {
+int32_t CPDFXFA_Document::GetCurrentPage(CXFA_FFDoc* hDoc) {
if (hDoc != m_pXFADoc || !m_pSDKDoc)
return -1;
if (m_iDocType != DOCTYPE_DYNAMIC_XFA)
@@ -575,7 +579,7 @@ int32_t CPDFXFA_Document::GetCurrentPage(IXFA_Doc* hDoc) {
return pEnv->FFI_GetCurrentPageIndex(this);
}
-void CPDFXFA_Document::SetCurrentPage(IXFA_Doc* hDoc, int32_t iCurPage) {
+void CPDFXFA_Document::SetCurrentPage(CXFA_FFDoc* hDoc, int32_t iCurPage) {
if (hDoc != m_pXFADoc || !m_pSDKDoc || m_iDocType != DOCTYPE_DYNAMIC_XFA ||
iCurPage < 0 || iCurPage >= m_pSDKDoc->GetPageCount()) {
return;
@@ -585,7 +589,7 @@ void CPDFXFA_Document::SetCurrentPage(IXFA_Doc* hDoc, int32_t iCurPage) {
return;
pEnv->FFI_SetCurrentPage(this, iCurPage);
}
-FX_BOOL CPDFXFA_Document::IsCalculationsEnabled(IXFA_Doc* hDoc) {
+FX_BOOL CPDFXFA_Document::IsCalculationsEnabled(CXFA_FFDoc* hDoc) {
if (hDoc != m_pXFADoc || !m_pSDKDoc)
return FALSE;
if (m_pSDKDoc->GetInterForm())
@@ -593,7 +597,7 @@ FX_BOOL CPDFXFA_Document::IsCalculationsEnabled(IXFA_Doc* hDoc) {
return FALSE;
}
-void CPDFXFA_Document::SetCalculationsEnabled(IXFA_Doc* hDoc,
+void CPDFXFA_Document::SetCalculationsEnabled(CXFA_FFDoc* hDoc,
FX_BOOL bEnabled) {
if (hDoc != m_pXFADoc || !m_pSDKDoc)
return;
@@ -601,7 +605,7 @@ void CPDFXFA_Document::SetCalculationsEnabled(IXFA_Doc* hDoc,
m_pSDKDoc->GetInterForm()->XfaEnableCalculate(bEnabled);
}
-void CPDFXFA_Document::GetTitle(IXFA_Doc* hDoc, CFX_WideString& wsTitle) {
+void CPDFXFA_Document::GetTitle(CXFA_FFDoc* hDoc, CFX_WideString& wsTitle) {
if (hDoc != m_pXFADoc)
return;
if (m_pPDFDoc == NULL)
@@ -615,7 +619,7 @@ void CPDFXFA_Document::GetTitle(IXFA_Doc* hDoc, CFX_WideString& wsTitle) {
wsTitle = wsTitle.FromLocal(csTitle.GetBuffer(csTitle.GetLength()));
csTitle.ReleaseBuffer(csTitle.GetLength());
}
-void CPDFXFA_Document::SetTitle(IXFA_Doc* hDoc,
+void CPDFXFA_Document::SetTitle(CXFA_FFDoc* hDoc,
const CFX_WideStringC& wsTitle) {
if (hDoc != m_pXFADoc)
return;
@@ -627,7 +631,7 @@ void CPDFXFA_Document::SetTitle(IXFA_Doc* hDoc,
return;
pInfoDict->SetAt("Title", new CPDF_String(wsTitle));
}
-void CPDFXFA_Document::ExportData(IXFA_Doc* hDoc,
+void CPDFXFA_Document::ExportData(CXFA_FFDoc* hDoc,
const CFX_WideStringC& wsFilePath,
FX_BOOL bXDP) {
if (hDoc != m_pXFADoc)
@@ -658,7 +662,7 @@ void CPDFXFA_Document::ExportData(IXFA_Doc* hDoc,
CFPDF_FileStream fileWrite(pFileHandler);
- IXFA_DocHandler* pXFADocHander = m_pApp->GetXFAApp()->GetDocHandler();
+ CXFA_FFDocHandler* pXFADocHander = m_pApp->GetXFAApp()->GetDocHandler();
CFX_ByteString content;
if (fileType == FXFA_SAVEAS_XML) {
content = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n";
@@ -729,10 +733,10 @@ void CPDFXFA_Document::ExportData(IXFA_Doc* hDoc,
// Ignoring flush error.
}
}
-void CPDFXFA_Document::ImportData(IXFA_Doc* hDoc,
+void CPDFXFA_Document::ImportData(CXFA_FFDoc* hDoc,
const CFX_WideStringC& wsFilePath) {}
-void CPDFXFA_Document::GotoURL(IXFA_Doc* hDoc,
+void CPDFXFA_Document::GotoURL(CXFA_FFDoc* hDoc,
const CFX_WideStringC& bsURL,
FX_BOOL bAppend) {
if (hDoc != m_pXFADoc)
@@ -750,7 +754,7 @@ void CPDFXFA_Document::GotoURL(IXFA_Doc* hDoc,
pEnv->FFI_GotoURL(this, str, bAppend);
}
-FX_BOOL CPDFXFA_Document::IsValidationsEnabled(IXFA_Doc* hDoc) {
+FX_BOOL CPDFXFA_Document::IsValidationsEnabled(CXFA_FFDoc* hDoc) {
if (hDoc != m_pXFADoc || !m_pSDKDoc)
return FALSE;
if (m_pSDKDoc->GetInterForm())
@@ -758,13 +762,15 @@ FX_BOOL CPDFXFA_Document::IsValidationsEnabled(IXFA_Doc* hDoc) {
return TRUE;
}
-void CPDFXFA_Document::SetValidationsEnabled(IXFA_Doc* hDoc, FX_BOOL bEnabled) {
+void CPDFXFA_Document::SetValidationsEnabled(CXFA_FFDoc* hDoc,
+ FX_BOOL bEnabled) {
if (hDoc != m_pXFADoc || !m_pSDKDoc)
return;
if (m_pSDKDoc->GetInterForm())
m_pSDKDoc->GetInterForm()->XfaSetValidationsEnabled(bEnabled);
}
-void CPDFXFA_Document::SetFocusWidget(IXFA_Doc* hDoc, IXFA_Widget* hWidget) {
+void CPDFXFA_Document::SetFocusWidget(CXFA_FFDoc* hDoc,
+ CXFA_FFWidget* hWidget) {
if (hDoc != m_pXFADoc)
return;
@@ -785,7 +791,7 @@ void CPDFXFA_Document::SetFocusWidget(IXFA_Doc* hDoc, IXFA_Widget* hWidget) {
}
}
}
-void CPDFXFA_Document::Print(IXFA_Doc* hDoc,
+void CPDFXFA_Document::Print(CXFA_FFDoc* hDoc,
int32_t nStartPage,
int32_t nEndPage,
uint32_t dwOptions) {
@@ -809,7 +815,7 @@ void CPDFXFA_Document::Print(IXFA_Doc* hDoc,
dwOptions & XFA_PRINTOPT_PrintAnnot);
}
-void CPDFXFA_Document::GetURL(IXFA_Doc* hDoc, CFX_WideString& wsDocURL) {
+void CPDFXFA_Document::GetURL(CXFA_FFDoc* hDoc, CFX_WideString& wsDocURL) {
if (hDoc != m_pXFADoc)
return;
@@ -820,7 +826,7 @@ void CPDFXFA_Document::GetURL(IXFA_Doc* hDoc, CFX_WideString& wsDocURL) {
pEnv->FFI_GetURL(this, wsDocURL);
}
-FX_ARGB CPDFXFA_Document::GetHighlightColor(IXFA_Doc* hDoc) {
+FX_ARGB CPDFXFA_Document::GetHighlightColor(CXFA_FFDoc* hDoc) {
if (hDoc != m_pXFADoc)
return 0;
if (m_pSDKDoc) {
@@ -848,10 +854,10 @@ FX_BOOL CPDFXFA_Document::_OnBeforeNotifySumbit() {
return TRUE;
if (m_pXFADocView == NULL)
return TRUE;
- IXFA_WidgetHandler* pWidgetHandler = m_pXFADocView->GetWidgetHandler();
+ CXFA_FFWidgetHandler* pWidgetHandler = m_pXFADocView->GetWidgetHandler();
if (pWidgetHandler == NULL)
return TRUE;
- IXFA_WidgetAccIterator* pWidgetAccIterator =
+ CXFA_WidgetAccIterator* pWidgetAccIterator =
m_pXFADocView->CreateWidgetAccIterator();
if (pWidgetAccIterator) {
CXFA_EventParam Param;
@@ -897,10 +903,10 @@ void CPDFXFA_Document::_OnAfterNotifySumbit() {
return;
if (m_pXFADocView == NULL)
return;
- IXFA_WidgetHandler* pWidgetHandler = m_pXFADocView->GetWidgetHandler();
+ CXFA_FFWidgetHandler* pWidgetHandler = m_pXFADocView->GetWidgetHandler();
if (pWidgetHandler == NULL)
return;
- IXFA_WidgetAccIterator* pWidgetAccIterator =
+ CXFA_WidgetAccIterator* pWidgetAccIterator =
m_pXFADocView->CreateWidgetAccIterator();
if (pWidgetAccIterator == NULL)
return;
@@ -916,7 +922,7 @@ void CPDFXFA_Document::_OnAfterNotifySumbit() {
m_pXFADocView->UpdateDocView();
}
-FX_BOOL CPDFXFA_Document::SubmitData(IXFA_Doc* hDoc, CXFA_Submit submit) {
+FX_BOOL CPDFXFA_Document::SubmitData(CXFA_FFDoc* hDoc, CXFA_Submit submit) {
if (!_NotifySubmit(TRUE))
return FALSE;
if (NULL == m_pXFADocView)
@@ -928,7 +934,7 @@ FX_BOOL CPDFXFA_Document::SubmitData(IXFA_Doc* hDoc, CXFA_Submit submit) {
return ret;
}
-IFX_FileRead* CPDFXFA_Document::OpenLinkedFile(IXFA_Doc* hDoc,
+IFX_FileRead* CPDFXFA_Document::OpenLinkedFile(CXFA_FFDoc* hDoc,
const CFX_WideString& wsLink) {
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
if (pEnv == NULL)
@@ -949,7 +955,7 @@ FX_BOOL CPDFXFA_Document::_ExportSubmitFile(FPDF_FILEHANDLER* pFileHandler,
FPDF_DWORD flag) {
if (NULL == m_pXFADocView)
return FALSE;
- IXFA_DocHandler* pDocHandler = m_pApp->GetXFAApp()->GetDocHandler();
+ CXFA_FFDocHandler* pDocHandler = m_pApp->GetXFAApp()->GetDocHandler();
CFX_ByteString content;
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
@@ -1135,7 +1141,7 @@ FX_BOOL CPDFXFA_Document::_MailToInfo(CFX_WideString& csURL,
return TRUE;
}
-FX_BOOL CPDFXFA_Document::_SubmitData(IXFA_Doc* hDoc, CXFA_Submit submit) {
+FX_BOOL CPDFXFA_Document::_SubmitData(CXFA_FFDoc* hDoc, CXFA_Submit submit) {
#ifdef PDF_ENABLE_XFA
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
if (!pEnv)
@@ -1236,7 +1242,7 @@ FX_BOOL CPDFXFA_Document::_SubmitData(IXFA_Doc* hDoc, CXFA_Submit submit) {
#endif
}
-FX_BOOL CPDFXFA_Document::SetGlobalProperty(IXFA_Doc* hDoc,
+FX_BOOL CPDFXFA_Document::SetGlobalProperty(CXFA_FFDoc* hDoc,
const CFX_ByteStringC& szPropName,
FXJSE_HVALUE hValue) {
if (hDoc != m_pXFADoc)
@@ -1247,7 +1253,7 @@ FX_BOOL CPDFXFA_Document::SetGlobalProperty(IXFA_Doc* hDoc,
hValue);
return FALSE;
}
-FX_BOOL CPDFXFA_Document::GetPDFScriptObject(IXFA_Doc* hDoc,
+FX_BOOL CPDFXFA_Document::GetPDFScriptObject(CXFA_FFDoc* hDoc,
const CFX_ByteStringC& utf8Name,
FXJSE_HVALUE hValue) {
if (hDoc != m_pXFADoc)
@@ -1264,7 +1270,7 @@ FX_BOOL CPDFXFA_Document::GetPDFScriptObject(IXFA_Doc* hDoc,
return _GetHValueByName(utf8Name, hValue,
m_pSDKDoc->GetEnv()->GetJSRuntime());
}
-FX_BOOL CPDFXFA_Document::GetGlobalProperty(IXFA_Doc* hDoc,
+FX_BOOL CPDFXFA_Document::GetGlobalProperty(CXFA_FFDoc* hDoc,
const CFX_ByteStringC& szPropName,
FXJSE_HVALUE hValue) {
if (hDoc != m_pXFADoc)
diff --git a/fpdfsdk/fpdfxfa/fpdfxfa_page.cpp b/fpdfsdk/fpdfxfa/fpdfxfa_page.cpp
index 8c977635e7..dc4185af2d 100644
--- a/fpdfsdk/fpdfxfa/fpdfxfa_page.cpp
+++ b/fpdfsdk/fpdfxfa/fpdfxfa_page.cpp
@@ -12,6 +12,8 @@
#include "fpdfsdk/include/fpdfxfa/fpdfxfa_util.h"
#include "fpdfsdk/include/fsdk_define.h"
#include "fpdfsdk/include/fsdk_mgr.h"
+#include "xfa/include/fxfa/xfa_ffdocview.h"
+#include "xfa/include/fxfa/xfa_ffpageview.h"
CPDFXFA_Page::CPDFXFA_Page(CPDFXFA_Document* pDoc, int page_index)
: m_pPDFPage(NULL),
@@ -66,15 +68,15 @@ FX_BOOL CPDFXFA_Page::LoadPDFPage() {
FX_BOOL CPDFXFA_Page::LoadXFAPageView() {
if (!m_pDocument)
return FALSE;
- IXFA_Doc* pXFADoc = m_pDocument->GetXFADoc();
+ CXFA_FFDoc* pXFADoc = m_pDocument->GetXFADoc();
if (!pXFADoc)
return FALSE;
- IXFA_DocView* pXFADocView = m_pDocument->GetXFADocView();
+ CXFA_FFDocView* pXFADocView = m_pDocument->GetXFADocView();
if (!pXFADocView)
return FALSE;
- IXFA_PageView* pPageView = pXFADocView->GetPageView(m_iPageIndex);
+ CXFA_FFPageView* pPageView = pXFADocView->GetPageView(m_iPageIndex);
if (!pPageView)
return FALSE;
diff --git a/fpdfsdk/fsdk_annothandler.cpp b/fpdfsdk/fsdk_annothandler.cpp
index f32c87cf1f..b89a63696c 100644
--- a/fpdfsdk/fsdk_annothandler.cpp
+++ b/fpdfsdk/fsdk_annothandler.cpp
@@ -76,7 +76,7 @@ CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::NewAnnot(CPDF_Annot* pAnnot,
}
#ifdef PDF_ENABLE_XFA
-CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::NewAnnot(IXFA_Widget* pAnnot,
+CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::NewAnnot(CXFA_FFWidget* pAnnot,
CPDFSDK_PageView* pPageView) {
ASSERT(pAnnot);
ASSERT(pPageView);
@@ -383,7 +383,7 @@ CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::GetNextAnnot(CPDFSDK_Annot* pSDKAnnot,
return NULL;
if (pWidgetIterator->GetCurrentWidget() != pSDKAnnot->GetXFAWidget())
pWidgetIterator->SetCurrentWidget(pSDKAnnot->GetXFAWidget());
- IXFA_Widget* hNextFocus = NULL;
+ CXFA_FFWidget* hNextFocus = NULL;
hNextFocus =
bNext ? pWidgetIterator->MoveToNext() : pWidgetIterator->MoveToPrevious();
if (!hNextFocus && pSDKAnnot)
@@ -439,7 +439,7 @@ CPDFSDK_Annot* CPDFSDK_BFAnnotHandler::NewAnnot(CPDF_Annot* pAnnot,
}
#ifdef PDF_ENABLE_XFA
-CPDFSDK_Annot* CPDFSDK_BFAnnotHandler::NewAnnot(IXFA_Widget* hWidget,
+CPDFSDK_Annot* CPDFSDK_BFAnnotHandler::NewAnnot(CXFA_FFWidget* hWidget,
CPDFSDK_PageView* pPage) {
return NULL;
}
@@ -734,7 +734,7 @@ FX_BOOL CPDFSDK_BFAnnotHandler::HitTest(CPDFSDK_PageView* pPageView,
CPDFSDK_XFAAnnotHandler::CPDFSDK_XFAAnnotHandler(CPDFDoc_Environment* pApp)
: m_pApp(pApp) {}
-CPDFSDK_Annot* CPDFSDK_XFAAnnotHandler::NewAnnot(IXFA_Widget* pAnnot,
+CPDFSDK_Annot* CPDFSDK_XFAAnnotHandler::NewAnnot(CXFA_FFWidget* pAnnot,
CPDFSDK_PageView* pPage) {
CPDFSDK_Document* pSDKDoc = m_pApp->GetSDKDocument();
CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pSDKDoc->GetInterForm();
@@ -756,7 +756,7 @@ void CPDFSDK_XFAAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView,
ASSERT(pAnnot != NULL);
CPDFSDK_Document* pSDKDoc = pPageView->GetSDKDocument();
- IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
+ CXFA_FFWidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
CFX_Graphics gs;
gs.Create(pDevice);
@@ -785,7 +785,7 @@ CFX_FloatRect CPDFSDK_XFAAnnotHandler::GetViewBBox(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot) {
ASSERT(pAnnot);
- IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
+ CXFA_FFWidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
CFX_RectF rcBBox;
XFA_ELEMENT eType =
pWidgetHandler->GetDataAcc(pAnnot->GetXFAWidget())->GetUIType();
@@ -819,11 +819,11 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::HitTest(CPDFSDK_PageView* pPageView,
if (!pDoc)
return FALSE;
- IXFA_DocView* pDocView = pDoc->GetXFADocView();
+ CXFA_FFDocView* pDocView = pDoc->GetXFADocView();
if (!pDocView)
return FALSE;
- IXFA_WidgetHandler* pWidgetHandler = pDocView->GetWidgetHandler();
+ CXFA_FFWidgetHandler* pWidgetHandler = pDocView->GetWidgetHandler();
if (!pWidgetHandler)
return FALSE;
@@ -837,7 +837,7 @@ void CPDFSDK_XFAAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView,
uint32_t nFlag) {
if (!pPageView || !pAnnot)
return;
- IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
+ CXFA_FFWidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
pWidgetHandler->OnMouseEnter(pAnnot->GetXFAWidget());
}
@@ -847,7 +847,7 @@ void CPDFSDK_XFAAnnotHandler::OnMouseExit(CPDFSDK_PageView* pPageView,
if (!pPageView || !pAnnot)
return;
- IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
+ CXFA_FFWidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
pWidgetHandler->OnMouseExit(pAnnot->GetXFAWidget());
}
@@ -858,7 +858,7 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonDown(CPDFSDK_PageView* pPageView,
if (!pPageView || !pAnnot)
return FALSE;
- IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
+ CXFA_FFWidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
return pWidgetHandler->OnLButtonDown(pAnnot->GetXFAWidget(),
GetFWLFlags(nFlags), point.x, point.y);
}
@@ -870,7 +870,7 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonUp(CPDFSDK_PageView* pPageView,
if (!pPageView || !pAnnot)
return FALSE;
- IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
+ CXFA_FFWidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
return pWidgetHandler->OnLButtonUp(pAnnot->GetXFAWidget(),
GetFWLFlags(nFlags), point.x, point.y);
}
@@ -882,7 +882,7 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView* pPageView,
if (!pPageView || !pAnnot)
return FALSE;
- IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
+ CXFA_FFWidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
return pWidgetHandler->OnLButtonDblClk(pAnnot->GetXFAWidget(),
GetFWLFlags(nFlags), point.x, point.y);
}
@@ -894,7 +894,7 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnMouseMove(CPDFSDK_PageView* pPageView,
if (!pPageView || !pAnnot)
return FALSE;
- IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
+ CXFA_FFWidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
return pWidgetHandler->OnMouseMove(pAnnot->GetXFAWidget(),
GetFWLFlags(nFlags), point.x, point.y);
}
@@ -907,7 +907,7 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnMouseWheel(CPDFSDK_PageView* pPageView,
if (!pPageView || !pAnnot)
return FALSE;
- IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
+ CXFA_FFWidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
return pWidgetHandler->OnMouseWheel(
pAnnot->GetXFAWidget(), GetFWLFlags(nFlags), zDelta, point.x, point.y);
}
@@ -919,7 +919,7 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonDown(CPDFSDK_PageView* pPageView,
if (!pPageView || !pAnnot)
return FALSE;
- IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
+ CXFA_FFWidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
return pWidgetHandler->OnRButtonDown(pAnnot->GetXFAWidget(),
GetFWLFlags(nFlags), point.x, point.y);
}
@@ -931,7 +931,7 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonUp(CPDFSDK_PageView* pPageView,
if (!pPageView || !pAnnot)
return FALSE;
- IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
+ CXFA_FFWidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
return pWidgetHandler->OnRButtonUp(pAnnot->GetXFAWidget(),
GetFWLFlags(nFlags), point.x, point.y);
}
@@ -943,7 +943,7 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonDblClk(CPDFSDK_PageView* pPageView,
if (!pPageView || !pAnnot)
return FALSE;
- IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
+ CXFA_FFWidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
return pWidgetHandler->OnRButtonDblClk(pAnnot->GetXFAWidget(),
GetFWLFlags(nFlags), point.x, point.y);
}
@@ -954,7 +954,7 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot,
if (!pAnnot)
return FALSE;
- IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
+ CXFA_FFWidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
return pWidgetHandler->OnChar(pAnnot->GetXFAWidget(), nChar,
GetFWLFlags(nFlags));
}
@@ -965,7 +965,7 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnKeyDown(CPDFSDK_Annot* pAnnot,
if (!pAnnot)
return FALSE;
- IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
+ CXFA_FFWidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
return pWidgetHandler->OnKeyDown(pAnnot->GetXFAWidget(), nKeyCode,
GetFWLFlags(nFlag));
}
@@ -976,7 +976,7 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnKeyUp(CPDFSDK_Annot* pAnnot,
if (!pAnnot)
return FALSE;
- IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
+ CXFA_FFWidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
return pWidgetHandler->OnKeyUp(pAnnot->GetXFAWidget(), nKeyCode,
GetFWLFlags(nFlag));
}
@@ -993,7 +993,7 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot,
FX_BOOL CPDFSDK_XFAAnnotHandler::OnXFAChangedFocus(CPDFSDK_Annot* pOldAnnot,
CPDFSDK_Annot* pNewAnnot) {
- IXFA_WidgetHandler* pWidgetHandler = NULL;
+ CXFA_FFWidgetHandler* pWidgetHandler = NULL;
if (pOldAnnot)
pWidgetHandler = GetXFAWidgetHandler(pOldAnnot);
@@ -1002,9 +1002,9 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnXFAChangedFocus(CPDFSDK_Annot* pOldAnnot,
if (pWidgetHandler) {
FX_BOOL bRet = TRUE;
- IXFA_Widget* hWidget = pNewAnnot ? pNewAnnot->GetXFAWidget() : NULL;
+ CXFA_FFWidget* hWidget = pNewAnnot ? pNewAnnot->GetXFAWidget() : NULL;
if (hWidget) {
- IXFA_PageView* pXFAPageView = pWidgetHandler->GetPageView(hWidget);
+ CXFA_FFPageView* pXFAPageView = pWidgetHandler->GetPageView(hWidget);
if (pXFAPageView) {
bRet = pXFAPageView->GetDocView()->SetFocus(hWidget);
if (pXFAPageView->GetDocView()->GetFocusWidget() == hWidget)
@@ -1017,7 +1017,7 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnXFAChangedFocus(CPDFSDK_Annot* pOldAnnot,
return TRUE;
}
-IXFA_WidgetHandler* CPDFSDK_XFAAnnotHandler::GetXFAWidgetHandler(
+CXFA_FFWidgetHandler* CPDFSDK_XFAAnnotHandler::GetXFAWidgetHandler(
CPDFSDK_Annot* pAnnot) {
if (!pAnnot)
return NULL;
@@ -1034,7 +1034,7 @@ IXFA_WidgetHandler* CPDFSDK_XFAAnnotHandler::GetXFAWidgetHandler(
if (!pDoc)
return NULL;
- IXFA_DocView* pDocView = pDoc->GetXFADocView();
+ CXFA_FFDocView* pDocView = pDoc->GetXFADocView();
if (!pDocView)
return NULL;
diff --git a/fpdfsdk/fsdk_baseform.cpp b/fpdfsdk/fsdk_baseform.cpp
index 9b21880d05..f22111ce73 100644
--- a/fpdfsdk/fsdk_baseform.cpp
+++ b/fpdfsdk/fsdk_baseform.cpp
@@ -52,12 +52,12 @@ CPDFSDK_Widget::CPDFSDK_Widget(CPDF_Annot* pAnnot,
CPDFSDK_Widget::~CPDFSDK_Widget() {}
#ifdef PDF_ENABLE_XFA
-IXFA_Widget* CPDFSDK_Widget::GetMixXFAWidget() const {
+CXFA_FFWidget* CPDFSDK_Widget::GetMixXFAWidget() const {
CPDFSDK_Document* pSDKDoc = m_pPageView->GetSDKDocument();
CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument();
if (pDoc->GetDocType() == DOCTYPE_STATIC_XFA) {
if (!m_hMixXFAWidget) {
- if (IXFA_DocView* pDocView = pDoc->GetXFADocView()) {
+ if (CXFA_FFDocView* pDocView = pDoc->GetXFADocView()) {
CFX_WideString sName;
if (GetFieldType() == FIELDTYPE_RADIOBUTTON) {
sName = GetAnnotName();
@@ -77,11 +77,11 @@ IXFA_Widget* CPDFSDK_Widget::GetMixXFAWidget() const {
return NULL;
}
-IXFA_Widget* CPDFSDK_Widget::GetGroupMixXFAWidget() {
+CXFA_FFWidget* CPDFSDK_Widget::GetGroupMixXFAWidget() {
CPDFSDK_Document* pSDKDoc = m_pPageView->GetSDKDocument();
CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument();
if (pDoc->GetDocType() == DOCTYPE_STATIC_XFA) {
- if (IXFA_DocView* pDocView = pDoc->GetXFADocView()) {
+ if (CXFA_FFDocView* pDocView = pDoc->GetXFADocView()) {
CFX_WideString sName = GetName();
if (!sName.IsEmpty())
return pDocView->GetWidgetByName(sName);
@@ -91,12 +91,12 @@ IXFA_Widget* CPDFSDK_Widget::GetGroupMixXFAWidget() {
return nullptr;
}
-IXFA_WidgetHandler* CPDFSDK_Widget::GetXFAWidgetHandler() const {
+CXFA_FFWidgetHandler* CPDFSDK_Widget::GetXFAWidgetHandler() const {
CPDFSDK_Document* pSDKDoc = m_pPageView->GetSDKDocument();
CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument();
if (pDoc->GetDocType() == DOCTYPE_STATIC_XFA) {
if (!m_pWidgetHandler) {
- if (IXFA_DocView* pDocView = pDoc->GetXFADocView()) {
+ if (CXFA_FFDocView* pDocView = pDoc->GetXFADocView()) {
m_pWidgetHandler = pDocView->GetWidgetHandler();
}
}
@@ -182,13 +182,13 @@ static XFA_EVENTTYPE GetXFAEventType(CPDF_AAction::AActionType eAAT,
}
FX_BOOL CPDFSDK_Widget::HasXFAAAction(PDFSDK_XFAAActionType eXFAAAT) {
- if (IXFA_Widget* hWidget = GetMixXFAWidget()) {
- if (IXFA_WidgetHandler* pXFAWidgetHandler = GetXFAWidgetHandler()) {
+ if (CXFA_FFWidget* hWidget = GetMixXFAWidget()) {
+ if (CXFA_FFWidgetHandler* pXFAWidgetHandler = GetXFAWidgetHandler()) {
XFA_EVENTTYPE eEventType = GetXFAEventType(eXFAAAT);
if ((eEventType == XFA_EVENT_Click || eEventType == XFA_EVENT_Change) &&
GetFieldType() == FIELDTYPE_RADIOBUTTON) {
- if (IXFA_Widget* hGroupWidget = GetGroupMixXFAWidget()) {
+ if (CXFA_FFWidget* hGroupWidget = GetGroupMixXFAWidget()) {
CXFA_WidgetAcc* pAcc = pXFAWidgetHandler->GetDataAcc(hGroupWidget);
if (pXFAWidgetHandler->HasEvent(pAcc, eEventType))
return TRUE;
@@ -210,11 +210,11 @@ FX_BOOL CPDFSDK_Widget::OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT,
CPDFSDK_PageView* pPageView) {
CPDFSDK_Document* pSDKDoc = m_pPageView->GetSDKDocument();
CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument();
- if (IXFA_Widget* hWidget = GetMixXFAWidget()) {
+ if (CXFA_FFWidget* hWidget = GetMixXFAWidget()) {
XFA_EVENTTYPE eEventType = GetXFAEventType(eXFAAAT);
if (eEventType != XFA_EVENT_Unknown) {
- if (IXFA_WidgetHandler* pXFAWidgetHandler = GetXFAWidgetHandler()) {
+ if (CXFA_FFWidgetHandler* pXFAWidgetHandler = GetXFAWidgetHandler()) {
CXFA_EventParam param;
param.m_eType = eEventType;
param.m_wsChange = data.sChange;
@@ -235,7 +235,7 @@ FX_BOOL CPDFSDK_Widget::OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT,
if ((eEventType == XFA_EVENT_Click || eEventType == XFA_EVENT_Change) &&
GetFieldType() == FIELDTYPE_RADIOBUTTON) {
- if (IXFA_Widget* hGroupWidget = GetGroupMixXFAWidget()) {
+ if (CXFA_FFWidget* hGroupWidget = GetGroupMixXFAWidget()) {
CXFA_WidgetAcc* pAcc = pXFAWidgetHandler->GetDataAcc(hGroupWidget);
param.m_pTarget = pAcc;
if (pXFAWidgetHandler->ProcessEvent(pAcc, &param) !=
@@ -248,7 +248,7 @@ FX_BOOL CPDFSDK_Widget::OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT,
param.m_pTarget = pAcc;
int32_t nRet = pXFAWidgetHandler->ProcessEvent(pAcc, &param);
- if (IXFA_DocView* pDocView = pDoc->GetXFADocView()) {
+ if (CXFA_FFDocView* pDocView = pDoc->GetXFADocView()) {
pDocView->UpdateDocView();
}
return nRet == XFA_EVENTERROR_Success;
@@ -260,8 +260,8 @@ FX_BOOL CPDFSDK_Widget::OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT,
}
void CPDFSDK_Widget::Synchronize(FX_BOOL bSynchronizeElse) {
- if (IXFA_Widget* hWidget = GetMixXFAWidget()) {
- if (IXFA_WidgetHandler* pXFAWidgetHandler = GetXFAWidgetHandler()) {
+ if (CXFA_FFWidget* hWidget = GetMixXFAWidget()) {
+ if (CXFA_FFWidgetHandler* pXFAWidgetHandler = GetXFAWidgetHandler()) {
CPDF_FormField* pFormField = GetFormField();
if (CXFA_WidgetAcc* pWidgetAcc = pXFAWidgetHandler->GetDataAcc(hWidget)) {
switch (GetFieldType()) {
@@ -310,11 +310,11 @@ void CPDFSDK_Widget::Synchronize(FX_BOOL bSynchronizeElse) {
void CPDFSDK_Widget::SynchronizeXFAValue() {
CPDFSDK_Document* pSDKDoc = m_pPageView->GetSDKDocument();
CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument();
- IXFA_DocView* pXFADocView = pDoc->GetXFADocView();
+ CXFA_FFDocView* pXFADocView = pDoc->GetXFADocView();
if (!pXFADocView)
return;
- if (IXFA_Widget* hWidget = GetMixXFAWidget()) {
+ if (CXFA_FFWidget* hWidget = GetMixXFAWidget()) {
if (GetXFAWidgetHandler()) {
CPDFSDK_Widget::SynchronizeXFAValue(pXFADocView, hWidget, GetFormField(),
GetFormControl());
@@ -325,23 +325,24 @@ void CPDFSDK_Widget::SynchronizeXFAValue() {
void CPDFSDK_Widget::SynchronizeXFAItems() {
CPDFSDK_Document* pSDKDoc = m_pPageView->GetSDKDocument();
CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument();
- IXFA_DocView* pXFADocView = pDoc->GetXFADocView();
+ CXFA_FFDocView* pXFADocView = pDoc->GetXFADocView();
if (!pXFADocView)
return;
- if (IXFA_Widget* hWidget = GetMixXFAWidget()) {
+ if (CXFA_FFWidget* hWidget = GetMixXFAWidget()) {
if (GetXFAWidgetHandler())
SynchronizeXFAItems(pXFADocView, hWidget, GetFormField(), nullptr);
}
}
-void CPDFSDK_Widget::SynchronizeXFAValue(IXFA_DocView* pXFADocView,
- IXFA_Widget* hWidget,
+void CPDFSDK_Widget::SynchronizeXFAValue(CXFA_FFDocView* pXFADocView,
+ CXFA_FFWidget* hWidget,
CPDF_FormField* pFormField,
CPDF_FormControl* pFormControl) {
ASSERT(hWidget);
- if (IXFA_WidgetHandler* pXFAWidgetHandler = pXFADocView->GetWidgetHandler()) {
+ if (CXFA_FFWidgetHandler* pXFAWidgetHandler =
+ pXFADocView->GetWidgetHandler()) {
ASSERT(pFormControl);
switch (pFormField->GetFieldType()) {
@@ -407,13 +408,14 @@ void CPDFSDK_Widget::SynchronizeXFAValue(IXFA_DocView* pXFADocView,
}
}
-void CPDFSDK_Widget::SynchronizeXFAItems(IXFA_DocView* pXFADocView,
- IXFA_Widget* hWidget,
+void CPDFSDK_Widget::SynchronizeXFAItems(CXFA_FFDocView* pXFADocView,
+ CXFA_FFWidget* hWidget,
CPDF_FormField* pFormField,
CPDF_FormControl* pFormControl) {
ASSERT(hWidget);
- if (IXFA_WidgetHandler* pXFAWidgetHandler = pXFADocView->GetWidgetHandler()) {
+ if (CXFA_FFWidgetHandler* pXFAWidgetHandler =
+ pXFADocView->GetWidgetHandler()) {
switch (pFormField->GetFieldType()) {
case FIELDTYPE_LISTBOX: {
pFormField->ClearSelection(FALSE);
@@ -592,8 +594,8 @@ FX_FLOAT CPDFSDK_Widget::GetFontSize() const {
int CPDFSDK_Widget::GetSelectedIndex(int nIndex) const {
#ifdef PDF_ENABLE_XFA
- if (IXFA_Widget* hWidget = GetMixXFAWidget()) {
- if (IXFA_WidgetHandler* pXFAWidgetHandler = GetXFAWidgetHandler()) {
+ if (CXFA_FFWidget* hWidget = GetMixXFAWidget()) {
+ if (CXFA_FFWidgetHandler* pXFAWidgetHandler = GetXFAWidgetHandler()) {
if (CXFA_WidgetAcc* pWidgetAcc = pXFAWidgetHandler->GetDataAcc(hWidget)) {
if (nIndex < pWidgetAcc->CountSelectedItems())
return pWidgetAcc->GetSelectedItem(nIndex);
@@ -607,8 +609,8 @@ int CPDFSDK_Widget::GetSelectedIndex(int nIndex) const {
#ifdef PDF_ENABLE_XFA
CFX_WideString CPDFSDK_Widget::GetValue(FX_BOOL bDisplay) const {
- if (IXFA_Widget* hWidget = GetMixXFAWidget()) {
- if (IXFA_WidgetHandler* pXFAWidgetHandler = GetXFAWidgetHandler()) {
+ if (CXFA_FFWidget* hWidget = GetMixXFAWidget()) {
+ if (CXFA_FFWidgetHandler* pXFAWidgetHandler = GetXFAWidgetHandler()) {
if (CXFA_WidgetAcc* pWidgetAcc = pXFAWidgetHandler->GetDataAcc(hWidget)) {
CFX_WideString sValue;
pWidgetAcc->GetValue(sValue, bDisplay ? XFA_VALUEPICTURE_Display
@@ -641,8 +643,8 @@ int CPDFSDK_Widget::CountOptions() const {
FX_BOOL CPDFSDK_Widget::IsOptionSelected(int nIndex) const {
#ifdef PDF_ENABLE_XFA
- if (IXFA_Widget* hWidget = GetMixXFAWidget()) {
- if (IXFA_WidgetHandler* pXFAWidgetHandler = GetXFAWidgetHandler()) {
+ if (CXFA_FFWidget* hWidget = GetMixXFAWidget()) {
+ if (CXFA_FFWidgetHandler* pXFAWidgetHandler = GetXFAWidgetHandler()) {
if (CXFA_WidgetAcc* pWidgetAcc = pXFAWidgetHandler->GetDataAcc(hWidget)) {
if (nIndex > -1 && nIndex < pWidgetAcc->CountChoiceListItems())
return pWidgetAcc->GetItemState(nIndex);
@@ -663,8 +665,8 @@ int CPDFSDK_Widget::GetTopVisibleIndex() const {
bool CPDFSDK_Widget::IsChecked() const {
#ifdef PDF_ENABLE_XFA
- if (IXFA_WidgetHandler* pXFAWidgetHandler = GetXFAWidgetHandler()) {
- if (IXFA_Widget* hWidget = GetMixXFAWidget()) {
+ if (CXFA_FFWidgetHandler* pXFAWidgetHandler = GetXFAWidgetHandler()) {
+ if (CXFA_FFWidget* hWidget = GetMixXFAWidget()) {
if (CXFA_WidgetAcc* pWidgetAcc = pXFAWidgetHandler->GetDataAcc(hWidget))
return pWidgetAcc->GetCheckState() == XFA_CHECKSTATE_On;
}
@@ -1875,11 +1877,11 @@ FX_BOOL CPDFSDK_Widget::OnAAction(CPDF_AAction::AActionType type,
#ifdef PDF_ENABLE_XFA
CPDFXFA_Document* pDoc = pDocument->GetXFADocument();
- if (IXFA_Widget* hWidget = GetMixXFAWidget()) {
+ if (CXFA_FFWidget* hWidget = GetMixXFAWidget()) {
XFA_EVENTTYPE eEventType = GetXFAEventType(type, data.bWillCommit);
if (eEventType != XFA_EVENT_Unknown) {
- if (IXFA_WidgetHandler* pXFAWidgetHandler = GetXFAWidgetHandler()) {
+ if (CXFA_FFWidgetHandler* pXFAWidgetHandler = GetXFAWidgetHandler()) {
CXFA_EventParam param;
param.m_eType = eEventType;
param.m_wsChange = data.sChange;
@@ -1902,7 +1904,7 @@ FX_BOOL CPDFSDK_Widget::OnAAction(CPDF_AAction::AActionType type,
param.m_pTarget = pAcc;
int32_t nRet = pXFAWidgetHandler->ProcessEvent(pAcc, &param);
- if (IXFA_DocView* pDocView = pDoc->GetXFADocView()) {
+ if (CXFA_FFDocView* pDocView = pDoc->GetXFADocView()) {
pDocView->UpdateDocView();
}
@@ -1983,7 +1985,7 @@ FX_BOOL CPDFSDK_Widget::HitTest(FX_FLOAT pageX, FX_FLOAT pageY) {
}
#ifdef PDF_ENABLE_XFA
-CPDFSDK_XFAWidget::CPDFSDK_XFAWidget(IXFA_Widget* pAnnot,
+CPDFSDK_XFAWidget::CPDFSDK_XFAWidget(CXFA_FFWidget* pAnnot,
CPDFSDK_PageView* pPageView,
CPDFSDK_InterForm* pInterForm)
: CPDFSDK_Annot(pPageView),
@@ -2002,8 +2004,8 @@ CFX_FloatRect CPDFSDK_XFAWidget::GetRect() const {
CPDFSDK_PageView* pPageView = GetPageView();
CPDFSDK_Document* pDocument = pPageView->GetSDKDocument();
CPDFXFA_Document* pDoc = pDocument->GetXFADocument();
- IXFA_DocView* pDocView = pDoc->GetXFADocView();
- IXFA_WidgetHandler* pWidgetHandler = pDocView->GetWidgetHandler();
+ CXFA_FFDocView* pDocView = pDoc->GetXFADocView();
+ CXFA_FFWidgetHandler* pWidgetHandler = pDocView->GetWidgetHandler();
CFX_RectF rcBBox;
pWidgetHandler->GetRect(GetXFAWidget(), rcBBox);
@@ -2150,16 +2152,16 @@ FX_BOOL CPDFSDK_InterForm::IsCalculateEnabled() const {
}
#ifdef PDF_ENABLE_XFA
-void CPDFSDK_InterForm::AddXFAMap(IXFA_Widget* hWidget,
+void CPDFSDK_InterForm::AddXFAMap(CXFA_FFWidget* hWidget,
CPDFSDK_XFAWidget* pWidget) {
m_XFAMap.SetAt(hWidget, pWidget);
}
-void CPDFSDK_InterForm::RemoveXFAMap(IXFA_Widget* hWidget) {
+void CPDFSDK_InterForm::RemoveXFAMap(CXFA_FFWidget* hWidget) {
m_XFAMap.RemoveKey(hWidget);
}
-CPDFSDK_XFAWidget* CPDFSDK_InterForm::GetXFAWidget(IXFA_Widget* hWidget) {
+CPDFSDK_XFAWidget* CPDFSDK_InterForm::GetXFAWidget(CXFA_FFWidget* hWidget) {
CPDFSDK_XFAWidget* pWidget = NULL;
m_XFAMap.Lookup(hWidget, pWidget);
diff --git a/fpdfsdk/fsdk_mgr.cpp b/fpdfsdk/fsdk_mgr.cpp
index b318b0a9db..323128c9fe 100644
--- a/fpdfsdk/fsdk_mgr.cpp
+++ b/fpdfsdk/fsdk_mgr.cpp
@@ -24,6 +24,7 @@
#include "fpdfsdk/include/fpdfxfa/fpdfxfa_page.h"
#include "fpdfsdk/include/fpdfxfa/fpdfxfa_util.h"
#include "xfa/fxgraphics/include/cfx_graphics.h"
+#include "xfa/include/fxfa/xfa_rendercontext.h"
#endif // PDF_ENABLE_XFA
#if _FX_OS_ == _FX_ANDROID_
@@ -702,17 +703,15 @@ void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice,
static_cast<FX_FLOAT>(pClip.Width()),
static_cast<FX_FLOAT>(pClip.Height()));
gs.SetClipRect(rectClip);
- IXFA_RenderContext* pRenderContext = XFA_RenderContext_Create();
- if (!pRenderContext)
- return;
+ CXFA_RenderContext* pRenderContext = new CXFA_RenderContext;
CXFA_RenderOptions renderOptions;
renderOptions.m_bHighlight = TRUE;
- IXFA_PageView* xfaView = pPage->GetXFAPageView();
+ CXFA_FFPageView* xfaView = pPage->GetXFAPageView();
pRenderContext->StartRender(xfaView, &gs, *pUser2Device, renderOptions);
pRenderContext->DoRender();
pRenderContext->StopRender();
pRenderContext->Release();
- IXFA_DocView* docView = xfaView->GetDocView();
+ CXFA_FFDocView* docView = xfaView->GetDocView();
if (!docView)
return;
CPDFSDK_Annot* annot = GetFocusAnnot();
@@ -821,7 +820,7 @@ CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(CPDF_Annot* pPDFAnnot) {
}
#ifdef PDF_ENABLE_XFA
-CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(IXFA_Widget* pPDFAnnot) {
+CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(CXFA_FFWidget* pPDFAnnot) {
if (!pPDFAnnot)
return nullptr;
@@ -914,7 +913,7 @@ CPDFSDK_Annot* CPDFSDK_PageView::GetAnnotByDict(CPDF_Dictionary* pDict) {
}
#ifdef PDF_ENABLE_XFA
-CPDFSDK_Annot* CPDFSDK_PageView::GetAnnotByXFAWidget(IXFA_Widget* hWidget) {
+CPDFSDK_Annot* CPDFSDK_PageView::GetAnnotByXFAWidget(CXFA_FFWidget* hWidget) {
if (!hWidget)
return nullptr;
@@ -1087,7 +1086,7 @@ void CPDFSDK_PageView::LoadFXAnnots() {
#ifdef PDF_ENABLE_XFA
m_page->AddRef();
if (m_pSDKDoc->GetXFADocument()->GetDocType() == DOCTYPE_DYNAMIC_XFA) {
- IXFA_PageView* pageView = m_page->GetXFAPageView();
+ CXFA_FFPageView* pageView = m_page->GetXFAPageView();
IXFA_WidgetIterator* pWidgetHander = pageView->CreateWidgetIterator(
XFA_TRAVERSEWAY_Form, XFA_WIDGETFILTER_Visible |
XFA_WIDGETFILTER_Viewable |
@@ -1098,7 +1097,7 @@ void CPDFSDK_PageView::LoadFXAnnots() {
return;
}
- while (IXFA_Widget* pXFAAnnot = pWidgetHander->MoveToNext()) {
+ while (CXFA_FFWidget* pXFAAnnot = pWidgetHander->MoveToNext()) {
CPDFSDK_Annot* pAnnot = pAnnotHandlerMgr->NewAnnot(pXFAAnnot, this);
if (!pAnnot)
continue;
diff --git a/fpdfsdk/include/fpdfxfa/fpdfxfa_app.h b/fpdfsdk/include/fpdfxfa/fpdfxfa_app.h
index f96ed3b177..ed626716f7 100644
--- a/fpdfsdk/include/fpdfxfa/fpdfxfa_app.h
+++ b/fpdfsdk/include/fpdfxfa/fpdfxfa_app.h
@@ -21,7 +21,7 @@ class CPDFXFA_App : public IXFA_AppProvider {
~CPDFXFA_App() override;
FX_BOOL Initialize(FXJSE_HRUNTIME hRuntime);
- IXFA_App* GetXFAApp() { return m_pXFAApp; }
+ CXFA_FFApp* GetXFAApp() { return m_pXFAApp; }
FX_BOOL AddFormFillEnv(CPDFDoc_Environment* pEnv);
FX_BOOL RemoveFormFillEnv(CPDFDoc_Environment* pEnv);
@@ -88,8 +88,7 @@ class CPDFXFA_App : public IXFA_AppProvider {
static CPDFXFA_App* g_pApp;
FX_BOOL m_bJavaScriptInitialized;
- IXFA_App* m_pXFAApp;
- IXFA_FontMgr* m_pFontMgr;
+ CXFA_FFApp* m_pXFAApp;
FXJSE_HRUNTIME m_hJSERuntime;
IFXJS_Runtime* m_pJSRuntime;
CFX_WideString m_csAppType;
diff --git a/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h b/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h
index 98ed6fdbe4..6d501317d6 100644
--- a/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h
+++ b/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h
@@ -11,6 +11,7 @@
#include "public/fpdfview.h"
#include "xfa/include/fxfa/fxfa.h"
+#include "xfa/include/fxfa/xfa_ffdochandler.h"
class CPDFXFA_App;
class CPDFXFA_Document;
@@ -19,7 +20,7 @@ class CPDFSDK_Document;
class CPDFDoc_Environment;
class IJS_Runtime;
class IJS_Context;
-class IXFA_DocHandler;
+class CXFA_FFDocHandler;
class CPDFXFA_Document : public IXFA_DocProvider {
public:
@@ -29,12 +30,12 @@ class CPDFXFA_Document : public IXFA_DocProvider {
FX_BOOL LoadXFADoc();
CPDFXFA_App* GetApp() { return m_pApp; }
CPDF_Document* GetPDFDoc() { return m_pPDFDoc; }
- IXFA_Doc* GetXFADoc() { return m_pXFADoc; }
- IXFA_DocView* GetXFADocView() { return m_pXFADocView; }
+ CXFA_FFDoc* GetXFADoc() { return m_pXFADoc; }
+ CXFA_FFDocView* GetXFADocView() { return m_pXFADocView; }
int GetPageCount();
CPDFXFA_Page* GetPage(int page_index);
- CPDFXFA_Page* GetPage(IXFA_PageView* pPage);
+ CPDFXFA_Page* GetPage(CXFA_FFPageView* pPage);
void DeletePage(int page_index);
void RemovePage(CPDFXFA_Page* page);
@@ -44,39 +45,39 @@ class CPDFXFA_Document : public IXFA_DocProvider {
void FXRect2PDFRect(const CFX_RectF& fxRectF, CFX_FloatRect& pdfRect);
- virtual void SetChangeMark(IXFA_Doc* hDoc);
- virtual FX_BOOL GetChangeMark(IXFA_Doc* hDoc);
+ virtual void SetChangeMark(CXFA_FFDoc* hDoc);
+ virtual FX_BOOL GetChangeMark(CXFA_FFDoc* hDoc);
// used in dynamic xfa, dwFlags refer to XFA_INVALIDATE_XXX macros.
- virtual void InvalidateRect(IXFA_PageView* pPageView,
+ virtual void InvalidateRect(CXFA_FFPageView* pPageView,
const CFX_RectF& rt,
uint32_t dwFlags = 0);
// used in static xfa, dwFlags refer to XFA_INVALIDATE_XXX macros.
- virtual void InvalidateRect(IXFA_Widget* hWidget, uint32_t dwFlags = 0);
+ virtual void InvalidateRect(CXFA_FFWidget* hWidget, uint32_t dwFlags = 0);
// show or hide caret
- virtual void DisplayCaret(IXFA_Widget* hWidget,
+ virtual void DisplayCaret(CXFA_FFWidget* hWidget,
FX_BOOL bVisible,
const CFX_RectF* pRtAnchor);
// dwPos: (0:bottom 1:top)
- virtual FX_BOOL GetPopupPos(IXFA_Widget* hWidget,
+ virtual FX_BOOL GetPopupPos(CXFA_FFWidget* hWidget,
FX_FLOAT fMinPopup,
FX_FLOAT fMaxPopup,
const CFX_RectF& rtAnchor,
CFX_RectF& rtPopup);
- virtual FX_BOOL PopupMenu(IXFA_Widget* hWidget,
+ virtual FX_BOOL PopupMenu(CXFA_FFWidget* hWidget,
CFX_PointF ptPopup,
const CFX_RectF* pRectExclude = NULL);
// dwFlags XFA_PAGEVIEWEVENT_Added, XFA_PAGEVIEWEVENT_Removing
- virtual void PageViewEvent(IXFA_PageView* pPageView, uint32_t dwFlags);
+ virtual void PageViewEvent(CXFA_FFPageView* pPageView, uint32_t dwFlags);
// dwEvent refer to XFA_WIDGETEVENT_XXX
- virtual void WidgetEvent(IXFA_Widget* hWidget,
+ virtual void WidgetEvent(CXFA_FFWidget* hWidget,
CXFA_WidgetAcc* pWidgetData,
uint32_t dwEvent,
void* pParam = NULL,
void* pAdditional = NULL);
// return true if render it.
- virtual FX_BOOL RenderCustomWidget(IXFA_Widget* hWidget,
+ virtual FX_BOOL RenderCustomWidget(CXFA_FFWidget* hWidget,
CFX_Graphics* pGS,
CFX_Matrix* pMatrix,
const CFX_RectF& rtUI) {
@@ -84,44 +85,44 @@ class CPDFXFA_Document : public IXFA_DocProvider {
}
// host method
- virtual int32_t CountPages(IXFA_Doc* hDoc);
- virtual int32_t GetCurrentPage(IXFA_Doc* hDoc);
- virtual void SetCurrentPage(IXFA_Doc* hDoc, int32_t iCurPage);
- virtual FX_BOOL IsCalculationsEnabled(IXFA_Doc* hDoc);
- virtual void SetCalculationsEnabled(IXFA_Doc* hDoc, FX_BOOL bEnabled);
- virtual void GetTitle(IXFA_Doc* hDoc, CFX_WideString& wsTitle);
- virtual void SetTitle(IXFA_Doc* hDoc, const CFX_WideStringC& wsTitle);
- virtual void ExportData(IXFA_Doc* hDoc,
+ virtual int32_t CountPages(CXFA_FFDoc* hDoc);
+ virtual int32_t GetCurrentPage(CXFA_FFDoc* hDoc);
+ virtual void SetCurrentPage(CXFA_FFDoc* hDoc, int32_t iCurPage);
+ virtual FX_BOOL IsCalculationsEnabled(CXFA_FFDoc* hDoc);
+ virtual void SetCalculationsEnabled(CXFA_FFDoc* hDoc, FX_BOOL bEnabled);
+ virtual void GetTitle(CXFA_FFDoc* hDoc, CFX_WideString& wsTitle);
+ virtual void SetTitle(CXFA_FFDoc* hDoc, const CFX_WideStringC& wsTitle);
+ virtual void ExportData(CXFA_FFDoc* hDoc,
const CFX_WideStringC& wsFilePath,
FX_BOOL bXDP = TRUE);
- virtual void ImportData(IXFA_Doc* hDoc, const CFX_WideStringC& wsFilePath);
- virtual void GotoURL(IXFA_Doc* hDoc,
+ virtual void ImportData(CXFA_FFDoc* hDoc, const CFX_WideStringC& wsFilePath);
+ virtual void GotoURL(CXFA_FFDoc* hDoc,
const CFX_WideStringC& bsURL,
FX_BOOL bAppend = TRUE);
- virtual FX_BOOL IsValidationsEnabled(IXFA_Doc* hDoc);
- virtual void SetValidationsEnabled(IXFA_Doc* hDoc, FX_BOOL bEnabled);
- virtual void SetFocusWidget(IXFA_Doc* hDoc, IXFA_Widget* hWidget);
- virtual void Print(IXFA_Doc* hDoc,
+ virtual FX_BOOL IsValidationsEnabled(CXFA_FFDoc* hDoc);
+ virtual void SetValidationsEnabled(CXFA_FFDoc* hDoc, FX_BOOL bEnabled);
+ virtual void SetFocusWidget(CXFA_FFDoc* hDoc, CXFA_FFWidget* hWidget);
+ virtual void Print(CXFA_FFDoc* hDoc,
int32_t nStartPage,
int32_t nEndPage,
uint32_t dwOptions);
// LayoutPseudo method
- virtual int32_t AbsPageCountInBatch(IXFA_Doc* hDoc) { return 0; }
- virtual int32_t AbsPageInBatch(IXFA_Doc* hDoc, IXFA_Widget* hWidget) {
+ virtual int32_t AbsPageCountInBatch(CXFA_FFDoc* hDoc) { return 0; }
+ virtual int32_t AbsPageInBatch(CXFA_FFDoc* hDoc, CXFA_FFWidget* hWidget) {
return 0;
}
- virtual int32_t SheetCountInBatch(IXFA_Doc* hDoc) { return 0; }
- virtual int32_t SheetInBatch(IXFA_Doc* hDoc, IXFA_Widget* hWidget) {
+ virtual int32_t SheetCountInBatch(CXFA_FFDoc* hDoc) { return 0; }
+ virtual int32_t SheetInBatch(CXFA_FFDoc* hDoc, CXFA_FFWidget* hWidget) {
return 0;
}
- virtual int32_t Verify(IXFA_Doc* hDoc,
+ virtual int32_t Verify(CXFA_FFDoc* hDoc,
CXFA_Node* pSigNode,
FX_BOOL bUsed = TRUE) {
return 0;
}
- virtual FX_BOOL Sign(IXFA_Doc* hDoc,
+ virtual FX_BOOL Sign(CXFA_FFDoc* hDoc,
CXFA_NodeList* pNodeList,
const CFX_WideStringC& wsExpression,
const CFX_WideStringC& wsXMLIdent,
@@ -129,16 +130,16 @@ class CPDFXFA_Document : public IXFA_DocProvider {
FX_BOOL bUsed = TRUE) {
return 0;
}
- virtual CXFA_NodeList* Enumerate(IXFA_Doc* hDoc) { return 0; }
- virtual FX_BOOL Clear(IXFA_Doc* hDoc,
+ virtual CXFA_NodeList* Enumerate(CXFA_FFDoc* hDoc) { return 0; }
+ virtual FX_BOOL Clear(CXFA_FFDoc* hDoc,
CXFA_Node* pSigNode,
FX_BOOL bCleared = TRUE) {
return 0;
}
// Get document path
- virtual void GetURL(IXFA_Doc* hDoc, CFX_WideString& wsDocURL);
- virtual FX_ARGB GetHighlightColor(IXFA_Doc* hDoc);
+ virtual void GetURL(CXFA_FFDoc* hDoc, CFX_WideString& wsDocURL);
+ virtual FX_ARGB GetHighlightColor(CXFA_FFDoc* hDoc);
/**
*Submit data to email, http, ftp.
@@ -152,35 +153,35 @@ class CPDFXFA_Document : public IXFA_DocProvider {
* @param[in] bEmbedPDF, specifies whether PDF is embedded in the submitted
*content or not.
*/
- virtual FX_BOOL SubmitData(IXFA_Doc* hDoc, CXFA_Submit submit);
+ virtual FX_BOOL SubmitData(CXFA_FFDoc* hDoc, CXFA_Submit submit);
- virtual FX_BOOL CheckWord(IXFA_Doc* hDoc, const CFX_ByteStringC& sWord) {
+ virtual FX_BOOL CheckWord(CXFA_FFDoc* hDoc, const CFX_ByteStringC& sWord) {
return FALSE;
}
- virtual FX_BOOL GetSuggestWords(IXFA_Doc* hDoc,
+ virtual FX_BOOL GetSuggestWords(CXFA_FFDoc* hDoc,
const CFX_ByteStringC& sWord,
std::vector<CFX_ByteString>& sSuggest) {
return FALSE;
}
// Get PDF javascript object, set the object to hValue.
- virtual FX_BOOL GetPDFScriptObject(IXFA_Doc* hDoc,
+ virtual FX_BOOL GetPDFScriptObject(CXFA_FFDoc* hDoc,
const CFX_ByteStringC& utf8Name,
FXJSE_HVALUE hValue);
- virtual FX_BOOL GetGlobalProperty(IXFA_Doc* hDoc,
+ virtual FX_BOOL GetGlobalProperty(CXFA_FFDoc* hDoc,
const CFX_ByteStringC& szPropName,
FXJSE_HVALUE hValue);
- virtual FX_BOOL SetGlobalProperty(IXFA_Doc* hDoc,
+ virtual FX_BOOL SetGlobalProperty(CXFA_FFDoc* hDoc,
const CFX_ByteStringC& szPropName,
FXJSE_HVALUE hValue);
- virtual CPDF_Document* OpenPDF(IXFA_Doc* hDoc,
+ virtual CPDF_Document* OpenPDF(CXFA_FFDoc* hDoc,
IFX_FileRead* pFile,
FX_BOOL bTakeOverFile) {
return NULL;
}
- virtual IFX_FileRead* OpenLinkedFile(IXFA_Doc* hDoc,
+ virtual IFX_FileRead* OpenLinkedFile(CXFA_FFDoc* hDoc,
const CFX_WideString& wsLink);
FX_BOOL _GetHValueByName(const CFX_ByteStringC& utf8Name,
@@ -189,7 +190,7 @@ class CPDFXFA_Document : public IXFA_DocProvider {
FX_BOOL _OnBeforeNotifySumbit();
void _OnAfterNotifySumbit();
FX_BOOL _NotifySubmit(FX_BOOL bPrevOrPost);
- FX_BOOL _SubmitData(IXFA_Doc* hDoc, CXFA_Submit submit);
+ FX_BOOL _SubmitData(CXFA_FFDoc* hDoc, CXFA_Submit submit);
FX_BOOL _MailToInfo(CFX_WideString& csURL,
CFX_WideString& csToAddress,
CFX_WideString& csCCAddress,
@@ -211,7 +212,7 @@ class CPDFXFA_Document : public IXFA_DocProvider {
FXFA_LOADSTATUS_CLOSING,
FXFA_LOADSTATUS_CLOSED
};
- void CloseXFADoc(IXFA_DocHandler* pDoc) {
+ void CloseXFADoc(CXFA_FFDocHandler* pDoc) {
if (pDoc) {
pDoc->CloseDoc(m_pXFADoc);
pDoc->ReleaseDoc(m_pXFADoc);
@@ -223,8 +224,8 @@ class CPDFXFA_Document : public IXFA_DocProvider {
int m_iDocType;
CPDF_Document* m_pPDFDoc;
CPDFSDK_Document* m_pSDKDoc;
- IXFA_Doc* m_pXFADoc;
- IXFA_DocView* m_pXFADocView;
+ CXFA_FFDoc* m_pXFADoc;
+ CXFA_FFDocView* m_pXFADocView;
CPDFXFA_App* m_pApp;
IJS_Context* m_pJSContext;
CFX_ArrayTemplate<CPDFXFA_Page*> m_XFAPageList;
diff --git a/fpdfsdk/include/fpdfxfa/fpdfxfa_page.h b/fpdfsdk/include/fpdfxfa/fpdfxfa_page.h
index d686fe9bae..20da040a23 100644
--- a/fpdfsdk/include/fpdfxfa/fpdfxfa_page.h
+++ b/fpdfsdk/include/fpdfxfa/fpdfxfa_page.h
@@ -14,7 +14,7 @@
class CPDFXFA_Document;
class CPDF_Page;
-class IXFA_PageView;
+class CXFA_FFPageView;
class CPDFXFA_Page {
public:
@@ -28,8 +28,10 @@ class CPDFXFA_Page {
CPDFXFA_Document* GetDocument() { return m_pDocument; }
int GetPageIndex() { return m_iPageIndex; }
CPDF_Page* GetPDFPage() { return m_pPDFPage; }
- IXFA_PageView* GetXFAPageView() { return m_pXFAPageView; }
- void SetXFAPageView(IXFA_PageView* pPageView) { m_pXFAPageView = pPageView; }
+ CXFA_FFPageView* GetXFAPageView() { return m_pXFAPageView; }
+ void SetXFAPageView(CXFA_FFPageView* pPageView) {
+ m_pXFAPageView = pPageView;
+ }
FX_FLOAT GetPageWidth();
FX_FLOAT GetPageHeight();
@@ -66,7 +68,7 @@ class CPDFXFA_Page {
private:
CPDF_Page* m_pPDFPage;
- IXFA_PageView* m_pXFAPageView;
+ CXFA_FFPageView* m_pXFAPageView;
int m_iPageIndex;
CPDFXFA_Document* m_pDocument;
int m_iRef;
diff --git a/fpdfsdk/include/fsdk_annothandler.h b/fpdfsdk/include/fsdk_annothandler.h
index 637fdfc387..e810a7e504 100644
--- a/fpdfsdk/include/fsdk_annothandler.h
+++ b/fpdfsdk/include/fsdk_annothandler.h
@@ -15,6 +15,9 @@
#ifdef PDF_ENABLE_XFA
#include "xfa/include/fxfa/fxfa.h"
+#include "xfa/include/fxfa/xfa_ffdocview.h"
+#include "xfa/include/fxfa/xfa_ffpageview.h"
+#include "xfa/include/fxfa/xfa_ffwidgethandler.h"
#define FSDK_XFAWIDGET_TYPENAME "XFAWidget"
#endif // PDF_ENABLE_XFA
@@ -42,7 +45,7 @@ class IPDFSDK_AnnotHandler {
CPDFSDK_PageView* pPage) = 0;
#ifdef PDF_ENABLE_XFA
- virtual CPDFSDK_Annot* NewAnnot(IXFA_Widget* hWidget,
+ virtual CPDFSDK_Annot* NewAnnot(CXFA_FFWidget* hWidget,
CPDFSDK_PageView* pPage) = 0;
#endif // PDF_ENABLE_XFA
@@ -148,7 +151,7 @@ class CPDFSDK_BFAnnotHandler : public IPDFSDK_AnnotHandler {
FX_BOOL CanAnswer(CPDFSDK_Annot* pAnnot) override;
CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage) override;
#ifdef PDF_ENABLE_XFA
- CPDFSDK_Annot* NewAnnot(IXFA_Widget* hWidget,
+ CPDFSDK_Annot* NewAnnot(CXFA_FFWidget* hWidget,
CPDFSDK_PageView* pPage) override;
#endif // PDF_ENABLE_XFA
void ReleaseAnnot(CPDFSDK_Annot* pAnnot) override;
@@ -255,7 +258,8 @@ class CPDFSDK_XFAAnnotHandler : public IPDFSDK_AnnotHandler {
return NULL;
}
- virtual CPDFSDK_Annot* NewAnnot(IXFA_Widget* pAnnot, CPDFSDK_PageView* pPage);
+ virtual CPDFSDK_Annot* NewAnnot(CXFA_FFWidget* pAnnot,
+ CPDFSDK_PageView* pPage);
virtual void ReleaseAnnot(CPDFSDK_Annot* pAnnot);
@@ -345,7 +349,7 @@ class CPDFSDK_XFAAnnotHandler : public IPDFSDK_AnnotHandler {
CPDFSDK_Annot* pNewAnnot);
private:
- IXFA_WidgetHandler* GetXFAWidgetHandler(CPDFSDK_Annot* pAnnot);
+ CXFA_FFWidgetHandler* GetXFAWidgetHandler(CPDFSDK_Annot* pAnnot);
uint32_t GetFWLFlags(uint32_t dwFlag);
private:
@@ -367,7 +371,7 @@ class CPDFSDK_AnnotHandlerMgr {
virtual CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot,
CPDFSDK_PageView* pPageView);
#ifdef PDF_ENABLE_XFA
- virtual CPDFSDK_Annot* NewAnnot(IXFA_Widget* pAnnot,
+ virtual CPDFSDK_Annot* NewAnnot(CXFA_FFWidget* pAnnot,
CPDFSDK_PageView* pPageView);
#endif // PDF_ENABLE_XFA
virtual void ReleaseAnnot(CPDFSDK_Annot* pAnnot);
diff --git a/fpdfsdk/include/fsdk_baseannot.h b/fpdfsdk/include/fsdk_baseannot.h
index dc2c1a9691..a8f4a67381 100644
--- a/fpdfsdk/include/fsdk_baseannot.h
+++ b/fpdfsdk/include/fsdk_baseannot.h
@@ -83,7 +83,7 @@ class CPDFSDK_Annot {
virtual CPDF_Annot* GetPDFAnnot() const { return nullptr; }
#ifdef PDF_ENABLE_XFA
- virtual IXFA_Widget* GetXFAWidget() const { return nullptr; }
+ virtual CXFA_FFWidget* GetXFAWidget() const { return nullptr; }
#endif // PDF_ENABLE_XFA
virtual CFX_ByteString GetType() const { return ""; }
diff --git a/fpdfsdk/include/fsdk_baseform.h b/fpdfsdk/include/fsdk_baseform.h
index aa96215d1c..06f0666c81 100644
--- a/fpdfsdk/include/fsdk_baseform.h
+++ b/fpdfsdk/include/fsdk_baseform.h
@@ -15,6 +15,10 @@
#include "core/include/fxge/fx_dib.h"
#include "fpdfsdk/include/fsdk_baseannot.h"
+#ifdef PDF_ENABLE_XFA
+#include "xfa/include/fxfa/xfa_ffwidgethandler.h"
+#endif // PDF_ENABLE_XFA
+
#if _FX_OS_ == _FX_ANDROID_
#include "time.h"
#else
@@ -67,9 +71,9 @@ struct PDFSDK_FieldAction {
class CPDFSDK_Widget : public CPDFSDK_BAAnnot {
public:
#ifdef PDF_ENABLE_XFA
- IXFA_Widget* GetMixXFAWidget() const;
- IXFA_Widget* GetGroupMixXFAWidget();
- IXFA_WidgetHandler* GetXFAWidgetHandler() const;
+ CXFA_FFWidget* GetMixXFAWidget() const;
+ CXFA_FFWidget* GetGroupMixXFAWidget();
+ CXFA_FFWidgetHandler* GetXFAWidgetHandler() const;
FX_BOOL HasXFAAAction(PDFSDK_XFAAActionType eXFAAAT);
FX_BOOL OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT,
@@ -80,12 +84,12 @@ class CPDFSDK_Widget : public CPDFSDK_BAAnnot {
void SynchronizeXFAValue();
void SynchronizeXFAItems();
- static void SynchronizeXFAValue(IXFA_DocView* pXFADocView,
- IXFA_Widget* hWidget,
+ static void SynchronizeXFAValue(CXFA_FFDocView* pXFADocView,
+ CXFA_FFWidget* hWidget,
CPDF_FormField* pFormField,
CPDF_FormControl* pFormControl);
- static void SynchronizeXFAItems(IXFA_DocView* pXFADocView,
- IXFA_Widget* hWidget,
+ static void SynchronizeXFAItems(CXFA_FFDocView* pXFADocView,
+ CXFA_FFWidget* hWidget,
CPDF_FormField* pFormField,
CPDF_FormControl* pFormControl);
#endif // PDF_ENABLE_XFA
@@ -214,21 +218,21 @@ class CPDFSDK_Widget : public CPDFSDK_BAAnnot {
int32_t m_nValueAge;
#ifdef PDF_ENABLE_XFA
- mutable IXFA_Widget* m_hMixXFAWidget;
- mutable IXFA_WidgetHandler* m_pWidgetHandler;
+ mutable CXFA_FFWidget* m_hMixXFAWidget;
+ mutable CXFA_FFWidgetHandler* m_pWidgetHandler;
#endif // PDF_ENABLE_XFA
};
#ifdef PDF_ENABLE_XFA
class CPDFSDK_XFAWidget : public CPDFSDK_Annot {
public:
- CPDFSDK_XFAWidget(IXFA_Widget* pAnnot,
+ CPDFSDK_XFAWidget(CXFA_FFWidget* pAnnot,
CPDFSDK_PageView* pPageView,
CPDFSDK_InterForm* pInterForm);
~CPDFSDK_XFAWidget() override {}
FX_BOOL IsXFAField() override;
- IXFA_Widget* GetXFAWidget() const override { return m_hXFAWidget; }
+ CXFA_FFWidget* GetXFAWidget() const override { return m_hXFAWidget; }
CFX_ByteString GetType() const override;
CFX_ByteString GetSubType() const override { return ""; }
CFX_FloatRect GetRect() const override;
@@ -237,10 +241,10 @@ class CPDFSDK_XFAWidget : public CPDFSDK_Annot {
private:
CPDFSDK_InterForm* m_pInterForm;
- IXFA_Widget* m_hXFAWidget;
+ CXFA_FFWidget* m_hXFAWidget;
};
#define CPDFSDK_XFAWidgetMap \
- CFX_MapPtrTemplate<IXFA_Widget*, CPDFSDK_XFAWidget*>
+ CFX_MapPtrTemplate<CXFA_FFWidget*, CPDFSDK_XFAWidget*>
#define CPDFSDK_FieldSynchronizeMap CFX_MapPtrTemplate<CPDF_FormField*, int>
#endif // PDF_ENABLE_XFA
@@ -268,9 +272,9 @@ class CPDFSDK_InterForm : public CPDF_FormNotify {
FX_BOOL IsCalculateEnabled() const;
#ifdef PDF_ENABLE_XFA
- void AddXFAMap(IXFA_Widget* hWidget, CPDFSDK_XFAWidget* pWidget);
- void RemoveXFAMap(IXFA_Widget* hWidget);
- CPDFSDK_XFAWidget* GetXFAWidget(IXFA_Widget* hWidget);
+ void AddXFAMap(CXFA_FFWidget* hWidget, CPDFSDK_XFAWidget* pWidget);
+ void RemoveXFAMap(CXFA_FFWidget* hWidget);
+ CPDFSDK_XFAWidget* GetXFAWidget(CXFA_FFWidget* hWidget);
void XfaEnableCalculate(FX_BOOL bEnabled);
FX_BOOL IsXfaCalculateEnabled() const;
FX_BOOL IsXfaValidationsEnabled();
diff --git a/fpdfsdk/include/fsdk_mgr.h b/fpdfsdk/include/fsdk_mgr.h
index 4bc5a7f916..39edc38f57 100644
--- a/fpdfsdk/include/fsdk_mgr.h
+++ b/fpdfsdk/include/fsdk_mgr.h
@@ -587,8 +587,8 @@ class CPDFSDK_PageView final {
CPDFSDK_Annot* GetAnnotByDict(CPDF_Dictionary* pDict);
#ifdef PDF_ENABLE_XFA
- CPDFSDK_Annot* AddAnnot(IXFA_Widget* pPDFAnnot);
- CPDFSDK_Annot* GetAnnotByXFAWidget(IXFA_Widget* hWidget);
+ CPDFSDK_Annot* AddAnnot(CXFA_FFWidget* pPDFAnnot);
+ CPDFSDK_Annot* GetAnnotByXFAWidget(CXFA_FFWidget* hWidget);
CPDFXFA_Page* GetPDFXFAPage() { return m_page; }
CPDF_Page* GetPDFPage();
#else