| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | |
| 6 | |
| 7 #ifndef FPDFSDK_INCLUDE_CPDFSDK_XFAWIDGETHANDLER_H_ | |
| 8 #define FPDFSDK_INCLUDE_CPDFSDK_XFAWIDGETHANDLER_H_ | |
| 9 | |
| 10 #include "core/fxcrt/fx_basic.h" | |
| 11 #include "core/fxcrt/fx_coordinates.h" | |
| 12 #include "fpdfsdk/include/ipdfsdk_annothandler.h" | |
| 13 | |
| 14 class CFX_Matrix; | |
| 15 class CFX_RenderDevice; | |
| 16 class CPDF_Annot; | |
| 17 class CPDFSDK_Environment; | |
| 18 class CPDFSDK_Annot; | |
| 19 class CPDFSDK_PageView; | |
| 20 class CXFA_FFWidget; | |
| 21 class CXFA_FFWidgetHandler; | |
| 22 | |
| 23 class CPDFSDK_XFAWidgetHandler : public IPDFSDK_AnnotHandler { | |
| 24 public: | |
| 25 explicit CPDFSDK_XFAWidgetHandler(CPDFSDK_Environment* pApp); | |
| 26 ~CPDFSDK_XFAWidgetHandler() override; | |
| 27 | |
| 28 FX_BOOL CanAnswer(CPDFSDK_Annot* pAnnot) override; | |
| 29 CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage) override; | |
| 30 CPDFSDK_Annot* NewAnnot(CXFA_FFWidget* pAnnot, | |
| 31 CPDFSDK_PageView* pPage) override; | |
| 32 void ReleaseAnnot(CPDFSDK_Annot* pAnnot) override; | |
| 33 void DeleteAnnot(CPDFSDK_Annot* pAnnot) override; | |
| 34 CFX_FloatRect GetViewBBox(CPDFSDK_PageView* pPageView, | |
| 35 CPDFSDK_Annot* pAnnot) override; | |
| 36 FX_BOOL HitTest(CPDFSDK_PageView* pPageView, | |
| 37 CPDFSDK_Annot* pAnnot, | |
| 38 const CFX_FloatPoint& point) override; | |
| 39 void OnDraw(CPDFSDK_PageView* pPageView, | |
| 40 CPDFSDK_Annot* pAnnot, | |
| 41 CFX_RenderDevice* pDevice, | |
| 42 CFX_Matrix* pUser2Device, | |
| 43 bool bDrawAnnots) override; | |
| 44 void OnCreate(CPDFSDK_Annot* pAnnot) override; | |
| 45 void OnLoad(CPDFSDK_Annot* pAnnot) override; | |
| 46 void OnDelete(CPDFSDK_Annot* pAnnot) override; | |
| 47 void OnRelease(CPDFSDK_Annot* pAnnot) override; | |
| 48 void OnMouseEnter(CPDFSDK_PageView* pPageView, | |
| 49 CPDFSDK_Annot::ObservedPtr* pAnnot, | |
| 50 uint32_t nFlag) override; | |
| 51 void OnMouseExit(CPDFSDK_PageView* pPageView, | |
| 52 CPDFSDK_Annot::ObservedPtr* pAnnot, | |
| 53 uint32_t nFlag) override; | |
| 54 FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, | |
| 55 CPDFSDK_Annot::ObservedPtr* pAnnot, | |
| 56 uint32_t nFlags, | |
| 57 const CFX_FloatPoint& point) override; | |
| 58 FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, | |
| 59 CPDFSDK_Annot::ObservedPtr* pAnnot, | |
| 60 uint32_t nFlags, | |
| 61 const CFX_FloatPoint& point) override; | |
| 62 FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, | |
| 63 CPDFSDK_Annot::ObservedPtr* pAnnot, | |
| 64 uint32_t nFlags, | |
| 65 const CFX_FloatPoint& point) override; | |
| 66 FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, | |
| 67 CPDFSDK_Annot::ObservedPtr* pAnnot, | |
| 68 uint32_t nFlags, | |
| 69 const CFX_FloatPoint& point) override; | |
| 70 FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, | |
| 71 CPDFSDK_Annot::ObservedPtr* pAnnot, | |
| 72 uint32_t nFlags, | |
| 73 short zDelta, | |
| 74 const CFX_FloatPoint& point) override; | |
| 75 FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, | |
| 76 CPDFSDK_Annot::ObservedPtr* pAnnot, | |
| 77 uint32_t nFlags, | |
| 78 const CFX_FloatPoint& point) override; | |
| 79 FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, | |
| 80 CPDFSDK_Annot::ObservedPtr* pAnnot, | |
| 81 uint32_t nFlags, | |
| 82 const CFX_FloatPoint& point) override; | |
| 83 FX_BOOL OnRButtonDblClk(CPDFSDK_PageView* pPageView, | |
| 84 CPDFSDK_Annot::ObservedPtr* pAnnot, | |
| 85 uint32_t nFlags, | |
| 86 const CFX_FloatPoint& point) override; | |
| 87 FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, | |
| 88 uint32_t nChar, | |
| 89 uint32_t nFlags) override; | |
| 90 FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) override; | |
| 91 FX_BOOL OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) override; | |
| 92 void OnDeSelected(CPDFSDK_Annot* pAnnot) override; | |
| 93 void OnSelected(CPDFSDK_Annot* pAnnot) override; | |
| 94 FX_BOOL OnSetFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, | |
| 95 uint32_t nFlag) override; | |
| 96 FX_BOOL OnKillFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, | |
| 97 uint32_t nFlag) override; | |
| 98 FX_BOOL OnXFAChangedFocus(CPDFSDK_Annot::ObservedPtr* pOldAnnot, | |
| 99 CPDFSDK_Annot::ObservedPtr* pNewAnnot) override; | |
| 100 | |
| 101 private: | |
| 102 CXFA_FFWidgetHandler* GetXFAWidgetHandler(CPDFSDK_Annot* pAnnot); | |
| 103 uint32_t GetFWLFlags(uint32_t dwFlag); | |
| 104 | |
| 105 CPDFSDK_Environment* m_pEnv; | |
| 106 }; | |
| 107 | |
| 108 #endif // FPDFSDK_INCLUDE_CPDFSDK_XFAWIDGETHANDLER_H_ | |
| OLD | NEW |