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_BFANNOTHANDLER_H_ |
| 8 #define FPDFSDK_INCLUDE_CPDFSDK_BFANNOTHANDLER_H_ |
| 9 |
| 10 #include "core/fxcrt/include/fx_basic.h" |
| 11 #include "core/fxcrt/include/fx_coordinates.h" |
| 12 #include "fpdfsdk/include/ipdfsdk_annothandler.h" |
| 13 |
| 14 class CFFL_IFormFiller; |
| 15 class CFX_Matrix; |
| 16 class CFX_RenderDevice; |
| 17 class CPDF_Annot; |
| 18 class CPDFDoc_Environment; |
| 19 class CPDFSDK_Annot; |
| 20 class CPDFSDK_PageView; |
| 21 |
| 22 #ifdef PDF_ENABLE_XFA |
| 23 class CXFA_FFWidget; |
| 24 #endif // PDF_ENABLE_XFA |
| 25 |
| 26 class CPDFSDK_BFAnnotHandler : public IPDFSDK_AnnotHandler { |
| 27 public: |
| 28 explicit CPDFSDK_BFAnnotHandler(CPDFDoc_Environment* pApp); |
| 29 ~CPDFSDK_BFAnnotHandler() override; |
| 30 |
| 31 CFX_ByteString GetType() override; |
| 32 CFX_ByteString GetName() override; |
| 33 FX_BOOL CanAnswer(CPDFSDK_Annot* pAnnot) override; |
| 34 CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage) override; |
| 35 #ifdef PDF_ENABLE_XFA |
| 36 CPDFSDK_Annot* NewAnnot(CXFA_FFWidget* hWidget, |
| 37 CPDFSDK_PageView* pPage) override; |
| 38 #endif // PDF_ENABLE_XFA |
| 39 void ReleaseAnnot(CPDFSDK_Annot* pAnnot) override; |
| 40 void DeleteAnnot(CPDFSDK_Annot* pAnnot) override; |
| 41 CFX_FloatRect GetViewBBox(CPDFSDK_PageView* pPageView, |
| 42 CPDFSDK_Annot* pAnnot) override; |
| 43 FX_BOOL HitTest(CPDFSDK_PageView* pPageView, |
| 44 CPDFSDK_Annot* pAnnot, |
| 45 const CFX_FloatPoint& point) override; |
| 46 void OnDraw(CPDFSDK_PageView* pPageView, |
| 47 CPDFSDK_Annot* pAnnot, |
| 48 CFX_RenderDevice* pDevice, |
| 49 CFX_Matrix* pUser2Device, |
| 50 uint32_t dwFlags) override; |
| 51 void OnDrawSleep(CPDFSDK_PageView* pPageView, |
| 52 CPDFSDK_Annot* pAnnot, |
| 53 CFX_RenderDevice* pDevice, |
| 54 CFX_Matrix* pUser2Device, |
| 55 const CFX_FloatRect& rcWindow, |
| 56 uint32_t dwFlags) override; |
| 57 void OnCreate(CPDFSDK_Annot* pAnnot) override; |
| 58 void OnLoad(CPDFSDK_Annot* pAnnot) override; |
| 59 void OnDelete(CPDFSDK_Annot* pAnnot) override; |
| 60 void OnRelease(CPDFSDK_Annot* pAnnot) override; |
| 61 void OnMouseEnter(CPDFSDK_PageView* pPageView, |
| 62 CPDFSDK_Annot* pAnnot, |
| 63 uint32_t nFlag) override; |
| 64 void OnMouseExit(CPDFSDK_PageView* pPageView, |
| 65 CPDFSDK_Annot* pAnnot, |
| 66 uint32_t nFlag) override; |
| 67 FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, |
| 68 CPDFSDK_Annot* pAnnot, |
| 69 uint32_t nFlags, |
| 70 const CFX_FloatPoint& point) override; |
| 71 FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, |
| 72 CPDFSDK_Annot* pAnnot, |
| 73 uint32_t nFlags, |
| 74 const CFX_FloatPoint& point) override; |
| 75 FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, |
| 76 CPDFSDK_Annot* pAnnot, |
| 77 uint32_t nFlags, |
| 78 const CFX_FloatPoint& point) override; |
| 79 FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, |
| 80 CPDFSDK_Annot* pAnnot, |
| 81 uint32_t nFlags, |
| 82 const CFX_FloatPoint& point) override; |
| 83 FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, |
| 84 CPDFSDK_Annot* pAnnot, |
| 85 uint32_t nFlags, |
| 86 short zDelta, |
| 87 const CFX_FloatPoint& point) override; |
| 88 FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, |
| 89 CPDFSDK_Annot* pAnnot, |
| 90 uint32_t nFlags, |
| 91 const CFX_FloatPoint& point) override; |
| 92 FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, |
| 93 CPDFSDK_Annot* pAnnot, |
| 94 uint32_t nFlags, |
| 95 const CFX_FloatPoint& point) override; |
| 96 FX_BOOL OnRButtonDblClk(CPDFSDK_PageView* pPageView, |
| 97 CPDFSDK_Annot* pAnnot, |
| 98 uint32_t nFlags, |
| 99 const CFX_FloatPoint& point) override; |
| 100 FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, |
| 101 uint32_t nChar, |
| 102 uint32_t nFlags) override; |
| 103 FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) override; |
| 104 FX_BOOL OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) override; |
| 105 void OnDeSelected(CPDFSDK_Annot* pAnnot) override {} |
| 106 void OnSelected(CPDFSDK_Annot* pAnnot) override {} |
| 107 FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag) override; |
| 108 FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag) override; |
| 109 #ifdef PDF_ENABLE_XFA |
| 110 FX_BOOL OnXFAChangedFocus(CPDFSDK_Annot* pOldAnnot, |
| 111 CPDFSDK_Annot* pNewAnnot) override; |
| 112 #endif // PDF_ENABLE_XFA |
| 113 |
| 114 void SetFormFiller(CFFL_IFormFiller* pFiller) { m_pFormFiller = pFiller; } |
| 115 CFFL_IFormFiller* GetFormFiller() { return m_pFormFiller; } |
| 116 |
| 117 private: |
| 118 CPDFDoc_Environment* m_pApp; |
| 119 CFFL_IFormFiller* m_pFormFiller; |
| 120 }; |
| 121 |
| 122 #endif // FPDFSDK_INCLUDE_CPDFSDK_BFANNOTHANDLER_H_ |
OLD | NEW |