| 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_IPDFSDK_ANNOTHANDLER_H_ | 7 #ifndef FPDFSDK_IPDFSDK_ANNOTHANDLER_H_ |
| 8 #define FPDFSDK_IPDFSDK_ANNOTHANDLER_H_ | 8 #define FPDFSDK_IPDFSDK_ANNOTHANDLER_H_ |
| 9 | 9 |
| 10 #include "core/fxcrt/fx_basic.h" | 10 #include "core/fxcrt/fx_basic.h" |
| 11 #include "core/fxcrt/fx_coordinates.h" | 11 #include "core/fxcrt/fx_coordinates.h" |
| 12 #include "fpdfsdk/cpdfsdk_annot.h" | 12 #include "fpdfsdk/cpdfsdk_annot.h" |
| 13 | 13 |
| 14 class CFX_Matrix; | 14 class CFX_Matrix; |
| 15 class CFX_RenderDevice; | 15 class CFX_RenderDevice; |
| 16 class CPDF_Annot; | 16 class CPDF_Annot; |
| 17 class CPDFSDK_PageView; | 17 class CPDFSDK_PageView; |
| 18 | 18 |
| 19 #ifdef PDF_ENABLE_XFA | 19 #ifdef PDF_ENABLE_XFA |
| 20 class CXFA_FFWidget; | 20 class CXFA_FFWidget; |
| 21 #endif // PDF_ENABLE_XFA | 21 #endif // PDF_ENABLE_XFA |
| 22 | 22 |
| 23 class IPDFSDK_AnnotHandler { | 23 class IPDFSDK_AnnotHandler { |
| 24 public: | 24 public: |
| 25 virtual ~IPDFSDK_AnnotHandler() {} | 25 virtual ~IPDFSDK_AnnotHandler() {} |
| 26 | 26 |
| 27 virtual FX_BOOL CanAnswer(CPDFSDK_Annot* pAnnot) = 0; | 27 virtual bool CanAnswer(CPDFSDK_Annot* pAnnot) = 0; |
| 28 virtual CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, | 28 virtual CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, |
| 29 CPDFSDK_PageView* pPage) = 0; | 29 CPDFSDK_PageView* pPage) = 0; |
| 30 | 30 |
| 31 #ifdef PDF_ENABLE_XFA | 31 #ifdef PDF_ENABLE_XFA |
| 32 virtual CPDFSDK_Annot* NewAnnot(CXFA_FFWidget* hWidget, | 32 virtual CPDFSDK_Annot* NewAnnot(CXFA_FFWidget* hWidget, |
| 33 CPDFSDK_PageView* pPage) = 0; | 33 CPDFSDK_PageView* pPage) = 0; |
| 34 #endif // PDF_ENABLE_XFA | 34 #endif // PDF_ENABLE_XFA |
| 35 | 35 |
| 36 virtual void ReleaseAnnot(CPDFSDK_Annot* pAnnot) = 0; | 36 virtual void ReleaseAnnot(CPDFSDK_Annot* pAnnot) = 0; |
| 37 virtual CFX_FloatRect GetViewBBox(CPDFSDK_PageView* pPageView, | 37 virtual CFX_FloatRect GetViewBBox(CPDFSDK_PageView* pPageView, |
| 38 CPDFSDK_Annot* pAnnot) = 0; | 38 CPDFSDK_Annot* pAnnot) = 0; |
| 39 virtual FX_BOOL HitTest(CPDFSDK_PageView* pPageView, | 39 virtual bool HitTest(CPDFSDK_PageView* pPageView, |
| 40 CPDFSDK_Annot* pAnnot, | 40 CPDFSDK_Annot* pAnnot, |
| 41 const CFX_FloatPoint& point) = 0; | 41 const CFX_FloatPoint& point) = 0; |
| 42 virtual void OnDraw(CPDFSDK_PageView* pPageView, | 42 virtual void OnDraw(CPDFSDK_PageView* pPageView, |
| 43 CPDFSDK_Annot* pAnnot, | 43 CPDFSDK_Annot* pAnnot, |
| 44 CFX_RenderDevice* pDevice, | 44 CFX_RenderDevice* pDevice, |
| 45 CFX_Matrix* pUser2Device, | 45 CFX_Matrix* pUser2Device, |
| 46 bool bDrawAnnots) = 0; | 46 bool bDrawAnnots) = 0; |
| 47 virtual void OnLoad(CPDFSDK_Annot* pAnnot) = 0; | 47 virtual void OnLoad(CPDFSDK_Annot* pAnnot) = 0; |
| 48 | 48 |
| 49 virtual void OnMouseEnter(CPDFSDK_PageView* pPageView, | 49 virtual void OnMouseEnter(CPDFSDK_PageView* pPageView, |
| 50 CPDFSDK_Annot::ObservedPtr* pAnnot, | 50 CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 51 uint32_t nFlag) = 0; | 51 uint32_t nFlag) = 0; |
| 52 virtual void OnMouseExit(CPDFSDK_PageView* pPageView, | 52 virtual void OnMouseExit(CPDFSDK_PageView* pPageView, |
| 53 CPDFSDK_Annot::ObservedPtr* pAnnot, | 53 CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 54 uint32_t nFlag) = 0; | 54 uint32_t nFlag) = 0; |
| 55 virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, | 55 virtual bool OnLButtonDown(CPDFSDK_PageView* pPageView, |
| 56 CPDFSDK_Annot::ObservedPtr* pAnnot, | 56 CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 57 uint32_t nFlags, | 57 uint32_t nFlags, |
| 58 const CFX_FloatPoint& point) = 0; | 58 const CFX_FloatPoint& point) = 0; |
| 59 virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, | 59 virtual bool OnLButtonUp(CPDFSDK_PageView* pPageView, |
| 60 CPDFSDK_Annot::ObservedPtr* pAnnot, | 60 CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 61 uint32_t nFlags, | 61 uint32_t nFlags, |
| 62 const CFX_FloatPoint& point) = 0; | 62 const CFX_FloatPoint& point) = 0; |
| 63 virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, | 63 virtual bool OnLButtonDblClk(CPDFSDK_PageView* pPageView, |
| 64 CPDFSDK_Annot::ObservedPtr* pAnnot, | |
| 65 uint32_t nFlags, | |
| 66 const CFX_FloatPoint& point) = 0; | |
| 67 virtual FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, | |
| 68 CPDFSDK_Annot::ObservedPtr* pAnnot, | |
| 69 uint32_t nFlags, | |
| 70 const CFX_FloatPoint& point) = 0; | |
| 71 virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, | |
| 72 CPDFSDK_Annot::ObservedPtr* pAnnot, | 64 CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 73 uint32_t nFlags, | 65 uint32_t nFlags, |
| 74 short zDelta, | |
| 75 const CFX_FloatPoint& point) = 0; | 66 const CFX_FloatPoint& point) = 0; |
| 76 virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, | 67 virtual bool OnMouseMove(CPDFSDK_PageView* pPageView, |
| 77 CPDFSDK_Annot::ObservedPtr* pAnnot, | 68 CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 78 uint32_t nFlags, | 69 uint32_t nFlags, |
| 79 const CFX_FloatPoint& point) = 0; | 70 const CFX_FloatPoint& point) = 0; |
| 80 virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, | 71 virtual bool OnMouseWheel(CPDFSDK_PageView* pPageView, |
| 81 CPDFSDK_Annot::ObservedPtr* pAnnot, | 72 CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 82 uint32_t nFlags, | 73 uint32_t nFlags, |
| 83 const CFX_FloatPoint& point) = 0; | 74 short zDelta, |
| 84 virtual FX_BOOL OnRButtonDblClk(CPDFSDK_PageView* pPageView, | 75 const CFX_FloatPoint& point) = 0; |
| 85 CPDFSDK_Annot::ObservedPtr* pAnnot, | 76 virtual bool OnRButtonDown(CPDFSDK_PageView* pPageView, |
| 86 uint32_t nFlags, | 77 CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 87 const CFX_FloatPoint& point) = 0; | 78 uint32_t nFlags, |
| 88 virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, | 79 const CFX_FloatPoint& point) = 0; |
| 89 uint32_t nChar, | 80 virtual bool OnRButtonUp(CPDFSDK_PageView* pPageView, |
| 90 uint32_t nFlags) = 0; | 81 CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 91 virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) = 0; | 82 uint32_t nFlags, |
| 92 virtual FX_BOOL OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) = 0; | 83 const CFX_FloatPoint& point) = 0; |
| 93 virtual FX_BOOL OnSetFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, | 84 virtual bool OnRButtonDblClk(CPDFSDK_PageView* pPageView, |
| 94 uint32_t nFlag) = 0; | 85 CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 95 virtual FX_BOOL OnKillFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, | 86 uint32_t nFlags, |
| 96 uint32_t nFlag) = 0; | 87 const CFX_FloatPoint& point) = 0; |
| 88 virtual bool OnChar(CPDFSDK_Annot* pAnnot, |
| 89 uint32_t nChar, |
| 90 uint32_t nFlags) = 0; |
| 91 virtual bool OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) = 0; |
| 92 virtual bool OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) = 0; |
| 93 virtual bool OnSetFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 94 uint32_t nFlag) = 0; |
| 95 virtual bool OnKillFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 96 uint32_t nFlag) = 0; |
| 97 #ifdef PDF_ENABLE_XFA | 97 #ifdef PDF_ENABLE_XFA |
| 98 virtual FX_BOOL OnXFAChangedFocus(CPDFSDK_Annot::ObservedPtr* pOldAnnot, | 98 virtual bool OnXFAChangedFocus(CPDFSDK_Annot::ObservedPtr* pOldAnnot, |
| 99 CPDFSDK_Annot::ObservedPtr* pNewAnnot) = 0; | 99 CPDFSDK_Annot::ObservedPtr* pNewAnnot) = 0; |
| 100 #endif // PDF_ENABLE_XFA | 100 #endif // PDF_ENABLE_XFA |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 #endif // FPDFSDK_IPDFSDK_ANNOTHANDLER_H_ | 103 #endif // FPDFSDK_IPDFSDK_ANNOTHANDLER_H_ |
| OLD | NEW |