summaryrefslogtreecommitdiff
path: root/fpdfsdk/fsdk_annothandler.cpp
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-06-15 11:21:33 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-15 11:21:33 -0700
commit625ad667d0c0c17d5bc11d505f04861d90b45078 (patch)
treeefd014e752072adf726a0e34383555399342dcb2 /fpdfsdk/fsdk_annothandler.cpp
parent29b8ad0b130ec6ed4f72ebd0c0a4f9e6a5b03467 (diff)
downloadpdfium-625ad667d0c0c17d5bc11d505f04861d90b45078.tar.xz
Make code compile with clang_use_chrome_plugin (part IV)
This change mainly contains files in fpdfsdk/ directory. This is part of the efforts to make PDFium code compilable by Clang chromium style plugins. The changes are mainly the following: -- move inline constructor/destructor of complex class/struct out-of-line; -- add constructor/destructor of complex class/struct if not explicitly defined; -- add explicit out-of-line copy constructor when needed; -- move inline virtual functions out-of-line; -- Properly mark virtual functions with 'override'; -- some minor cleanups plus removing an unused file and splitting cxfa_eventparam out from fxfa.h BUG=pdfium:469 Review-Url: https://codereview.chromium.org/2062313002
Diffstat (limited to 'fpdfsdk/fsdk_annothandler.cpp')
-rw-r--r--fpdfsdk/fsdk_annothandler.cpp89
1 files changed, 85 insertions, 4 deletions
diff --git a/fpdfsdk/fsdk_annothandler.cpp b/fpdfsdk/fsdk_annothandler.cpp
index c3bc1953f1..b4942fdace 100644
--- a/fpdfsdk/fsdk_annothandler.cpp
+++ b/fpdfsdk/fsdk_annothandler.cpp
@@ -21,6 +21,9 @@
#include "fpdfsdk/fpdfxfa/include/fpdfxfa_util.h"
#include "xfa/fwl/core/include/fwl_widgethit.h"
#include "xfa/fxfa/include/xfa_ffwidget.h"
+#include "xfa/fxfa/include/xfa_ffdocview.h"
+#include "xfa/fxfa/include/xfa_ffpageview.h"
+#include "xfa/fxfa/include/xfa_ffwidgethandler.h"
#include "xfa/fxgraphics/include/cfx_graphics.h"
#endif // PDF_ENABLE_XFA
@@ -397,6 +400,19 @@ CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::GetNextAnnot(CPDFSDK_Annot* pSDKAnnot,
#endif // PDF_ENABLE_XFA
}
+CPDFSDK_BFAnnotHandler::CPDFSDK_BFAnnotHandler(CPDFDoc_Environment* pApp)
+ : m_pApp(pApp), m_pFormFiller(nullptr) {}
+
+CPDFSDK_BFAnnotHandler::~CPDFSDK_BFAnnotHandler() {}
+
+CFX_ByteString CPDFSDK_BFAnnotHandler::GetType() {
+ return CFX_ByteString("Widget");
+}
+
+CFX_ByteString CPDFSDK_BFAnnotHandler::GetName() {
+ return CFX_ByteString("WidgetHandler");
+}
+
FX_BOOL CPDFSDK_BFAnnotHandler::CanAnswer(CPDFSDK_Annot* pAnnot) {
ASSERT(pAnnot->GetType() == "Widget");
if (pAnnot->GetSubType() == BFFT_SIGNATURE)
@@ -457,6 +473,8 @@ void CPDFSDK_BFAnnotHandler::ReleaseAnnot(CPDFSDK_Annot* pAnnot) {
pInterForm->RemoveMap(pControl);
}
+void CPDFSDK_BFAnnotHandler::DeleteAnnot(CPDFSDK_Annot* pAnnot) {}
+
void CPDFSDK_BFAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
CFX_RenderDevice* pDevice,
@@ -474,6 +492,17 @@ void CPDFSDK_BFAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView,
}
}
+void CPDFSDK_BFAnnotHandler::OnDrawSleep(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ CFX_RenderDevice* pDevice,
+ CFX_Matrix* pUser2Device,
+ const CFX_FloatRect& rcWindow,
+ uint32_t dwFlags) {}
+
+void CPDFSDK_BFAnnotHandler::OnDelete(CPDFSDK_Annot* pAnnot) {}
+
+void CPDFSDK_BFAnnotHandler::OnRelease(CPDFSDK_Annot* pAnnot) {}
+
void CPDFSDK_BFAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
uint32_t nFlag) {
@@ -602,6 +631,13 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonUp(CPDFSDK_PageView* pPageView,
return FALSE;
}
+FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonDblClk(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) {
+ return FALSE;
+}
+
FX_BOOL CPDFSDK_BFAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot,
uint32_t nChar,
uint32_t nFlags) {
@@ -700,6 +736,15 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot,
return TRUE;
}
+#ifdef PDF_ENABLE_XFA
+
+FX_BOOL CPDFSDK_BFAnnotHandler::OnXFAChangedFocus(CPDFSDK_Annot* pOldAnnot,
+ CPDFSDK_Annot* pNewAnnot) {
+ return TRUE;
+}
+
+#endif // PDF_ENABLE_XFA
+
CFX_FloatRect CPDFSDK_BFAnnotHandler::GetViewBBox(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot) {
CFX_ByteString sSubType = pAnnot->GetSubType();
@@ -724,6 +769,25 @@ FX_BOOL CPDFSDK_BFAnnotHandler::HitTest(CPDFSDK_PageView* pPageView,
CPDFSDK_XFAAnnotHandler::CPDFSDK_XFAAnnotHandler(CPDFDoc_Environment* pApp)
: m_pApp(pApp) {}
+CPDFSDK_XFAAnnotHandler::~CPDFSDK_XFAAnnotHandler() {}
+
+CFX_ByteString CPDFSDK_XFAAnnotHandler::GetType() {
+ return FSDK_XFAWIDGET_TYPENAME;
+}
+
+CFX_ByteString CPDFSDK_XFAAnnotHandler::GetName() {
+ return "XFAWidgetHandler";
+}
+
+FX_BOOL CPDFSDK_XFAAnnotHandler::CanAnswer(CPDFSDK_Annot* pAnnot) {
+ return !!pAnnot->GetXFAWidget();
+}
+
+CPDFSDK_Annot* CPDFSDK_XFAAnnotHandler::NewAnnot(CPDF_Annot* pAnnot,
+ CPDFSDK_PageView* pPage) {
+ return nullptr;
+}
+
CPDFSDK_Annot* CPDFSDK_XFAAnnotHandler::NewAnnot(CXFA_FFWidget* pAnnot,
CPDFSDK_PageView* pPage) {
CPDFSDK_Document* pSDKDoc = m_pApp->GetSDKDocument();
@@ -733,10 +797,6 @@ CPDFSDK_Annot* CPDFSDK_XFAAnnotHandler::NewAnnot(CXFA_FFWidget* pAnnot,
return pWidget;
}
-FX_BOOL CPDFSDK_XFAAnnotHandler::CanAnswer(CPDFSDK_Annot* pAnnot) {
- return !!pAnnot->GetXFAWidget();
-}
-
void CPDFSDK_XFAAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
CFX_RenderDevice* pDevice,
@@ -763,6 +823,21 @@ void CPDFSDK_XFAAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView,
// to do highlight and shadow
}
+void CPDFSDK_XFAAnnotHandler::OnDrawSleep(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ CFX_RenderDevice* pDevice,
+ CFX_Matrix* pUser2Device,
+ const CFX_FloatRect& rcWindow,
+ uint32_t dwFlags) {}
+
+void CPDFSDK_XFAAnnotHandler::OnCreate(CPDFSDK_Annot* pAnnot) {}
+
+void CPDFSDK_XFAAnnotHandler::OnLoad(CPDFSDK_Annot* pAnnot) {}
+
+void CPDFSDK_XFAAnnotHandler::OnDelete(CPDFSDK_Annot* pAnnot) {}
+
+void CPDFSDK_XFAAnnotHandler::OnRelease(CPDFSDK_Annot* pAnnot) {}
+
void CPDFSDK_XFAAnnotHandler::ReleaseAnnot(CPDFSDK_Annot* pAnnot) {
CPDFSDK_XFAWidget* pWidget = (CPDFSDK_XFAWidget*)pAnnot;
CPDFSDK_InterForm* pInterForm = pWidget->GetInterForm();
@@ -771,6 +846,8 @@ void CPDFSDK_XFAAnnotHandler::ReleaseAnnot(CPDFSDK_Annot* pAnnot) {
delete pWidget;
}
+void CPDFSDK_XFAAnnotHandler::DeleteAnnot(CPDFSDK_Annot* pAnnot) {}
+
CFX_FloatRect CPDFSDK_XFAAnnotHandler::GetViewBBox(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot) {
ASSERT(pAnnot);
@@ -968,6 +1045,10 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnKeyUp(CPDFSDK_Annot* pAnnot,
GetFWLFlags(nFlag));
}
+void CPDFSDK_XFAAnnotHandler::OnDeSelected(CPDFSDK_Annot* pAnnot) {}
+
+void CPDFSDK_XFAAnnotHandler::OnSelected(CPDFSDK_Annot* pAnnot) {}
+
FX_BOOL CPDFSDK_XFAAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot,
uint32_t nFlag) {
return TRUE;