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