jaepark | 35512aa | 2016-08-29 17:15:08 -0700 | [diff] [blame] | 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 | |
dsinclair | 114e46a | 2016-09-29 17:18:21 -0700 | [diff] [blame] | 7 | #ifndef FPDFSDK_CPDFSDK_BAANNOTHANDLER_H_ |
| 8 | #define FPDFSDK_CPDFSDK_BAANNOTHANDLER_H_ |
jaepark | 35512aa | 2016-08-29 17:15:08 -0700 | [diff] [blame] | 9 | |
dsinclair | a52ab74 | 2016-09-29 13:59:29 -0700 | [diff] [blame] | 10 | #include "core/fxcrt/fx_coordinates.h" |
dsinclair | 114e46a | 2016-09-29 17:18:21 -0700 | [diff] [blame] | 11 | #include "fpdfsdk/ipdfsdk_annothandler.h" |
jaepark | 35512aa | 2016-08-29 17:15:08 -0700 | [diff] [blame] | 12 | |
dsinclair | b94d7c9 | 2016-09-21 12:07:00 -0700 | [diff] [blame] | 13 | class CFFL_InteractiveFormFiller; |
jaepark | 35512aa | 2016-08-29 17:15:08 -0700 | [diff] [blame] | 14 | class CFX_Matrix; |
| 15 | class CFX_RenderDevice; |
| 16 | class CPDF_Annot; |
dsinclair | 735606d | 2016-10-05 15:47:02 -0700 | [diff] [blame] | 17 | class CPDFSDK_FormFillEnvironment; |
jaepark | 35512aa | 2016-08-29 17:15:08 -0700 | [diff] [blame] | 18 | class CPDFSDK_Annot; |
| 19 | class CPDFSDK_PageView; |
| 20 | |
| 21 | #ifdef PDF_ENABLE_XFA |
| 22 | class CXFA_FFWidget; |
| 23 | #endif // PDF_ENABLE_XFA |
| 24 | |
| 25 | class CPDFSDK_BAAnnotHandler : public IPDFSDK_AnnotHandler { |
| 26 | public: |
| 27 | CPDFSDK_BAAnnotHandler(); |
| 28 | ~CPDFSDK_BAAnnotHandler() override; |
| 29 | |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 30 | bool CanAnswer(CPDFSDK_Annot* pAnnot) override; |
jaepark | 35512aa | 2016-08-29 17:15:08 -0700 | [diff] [blame] | 31 | CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage) override; |
| 32 | #ifdef PDF_ENABLE_XFA |
| 33 | CPDFSDK_Annot* NewAnnot(CXFA_FFWidget* hWidget, |
| 34 | CPDFSDK_PageView* pPage) override; |
| 35 | #endif // PDF_ENABLE_XFA |
| 36 | void ReleaseAnnot(CPDFSDK_Annot* pAnnot) override; |
jaepark | 35512aa | 2016-08-29 17:15:08 -0700 | [diff] [blame] | 37 | CFX_FloatRect GetViewBBox(CPDFSDK_PageView* pPageView, |
| 38 | CPDFSDK_Annot* pAnnot) override; |
Ryan Harrison | 275e260 | 2017-09-18 14:23:18 -0400 | [diff] [blame] | 39 | WideString GetSelectedText(CPDFSDK_Annot* pAnnot) override; |
| 40 | void ReplaceSelection(CPDFSDK_Annot* pAnnot, const WideString& text) override; |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 41 | bool HitTest(CPDFSDK_PageView* pPageView, |
| 42 | CPDFSDK_Annot* pAnnot, |
Dan Sinclair | f528eee | 2017-02-14 11:52:07 -0500 | [diff] [blame] | 43 | const CFX_PointF& point) override; |
jaepark | 35512aa | 2016-08-29 17:15:08 -0700 | [diff] [blame] | 44 | void OnDraw(CPDFSDK_PageView* pPageView, |
| 45 | CPDFSDK_Annot* pAnnot, |
| 46 | CFX_RenderDevice* pDevice, |
jaepark | 75f84a5 | 2016-09-09 15:39:09 -0700 | [diff] [blame] | 47 | CFX_Matrix* pUser2Device, |
| 48 | bool bDrawAnnots) override; |
jaepark | 35512aa | 2016-08-29 17:15:08 -0700 | [diff] [blame] | 49 | void OnLoad(CPDFSDK_Annot* pAnnot) override; |
tsepez | f8074ce | 2016-09-27 14:29:57 -0700 | [diff] [blame] | 50 | |
jaepark | 35512aa | 2016-08-29 17:15:08 -0700 | [diff] [blame] | 51 | void OnMouseEnter(CPDFSDK_PageView* pPageView, |
tsepez | f8074ce | 2016-09-27 14:29:57 -0700 | [diff] [blame] | 52 | CPDFSDK_Annot::ObservedPtr* pAnnot, |
jaepark | 35512aa | 2016-08-29 17:15:08 -0700 | [diff] [blame] | 53 | uint32_t nFlag) override; |
| 54 | void OnMouseExit(CPDFSDK_PageView* pPageView, |
tsepez | f8074ce | 2016-09-27 14:29:57 -0700 | [diff] [blame] | 55 | CPDFSDK_Annot::ObservedPtr* pAnnot, |
jaepark | 35512aa | 2016-08-29 17:15:08 -0700 | [diff] [blame] | 56 | uint32_t nFlag) override; |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 57 | bool OnLButtonDown(CPDFSDK_PageView* pPageView, |
| 58 | CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 59 | uint32_t nFlags, |
Dan Sinclair | f528eee | 2017-02-14 11:52:07 -0500 | [diff] [blame] | 60 | const CFX_PointF& point) override; |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 61 | bool OnLButtonUp(CPDFSDK_PageView* pPageView, |
| 62 | CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 63 | uint32_t nFlags, |
Dan Sinclair | f528eee | 2017-02-14 11:52:07 -0500 | [diff] [blame] | 64 | const CFX_PointF& point) override; |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 65 | bool OnLButtonDblClk(CPDFSDK_PageView* pPageView, |
tsepez | f8074ce | 2016-09-27 14:29:57 -0700 | [diff] [blame] | 66 | CPDFSDK_Annot::ObservedPtr* pAnnot, |
jaepark | 35512aa | 2016-08-29 17:15:08 -0700 | [diff] [blame] | 67 | uint32_t nFlags, |
Dan Sinclair | f528eee | 2017-02-14 11:52:07 -0500 | [diff] [blame] | 68 | const CFX_PointF& point) override; |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 69 | bool OnMouseMove(CPDFSDK_PageView* pPageView, |
| 70 | CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 71 | uint32_t nFlags, |
Dan Sinclair | f528eee | 2017-02-14 11:52:07 -0500 | [diff] [blame] | 72 | const CFX_PointF& point) override; |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 73 | bool OnMouseWheel(CPDFSDK_PageView* pPageView, |
| 74 | CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 75 | uint32_t nFlags, |
| 76 | short zDelta, |
Dan Sinclair | f528eee | 2017-02-14 11:52:07 -0500 | [diff] [blame] | 77 | const CFX_PointF& point) override; |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 78 | bool OnRButtonDown(CPDFSDK_PageView* pPageView, |
| 79 | CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 80 | uint32_t nFlags, |
Dan Sinclair | f528eee | 2017-02-14 11:52:07 -0500 | [diff] [blame] | 81 | const CFX_PointF& point) override; |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 82 | bool OnRButtonUp(CPDFSDK_PageView* pPageView, |
| 83 | CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 84 | uint32_t nFlags, |
Dan Sinclair | f528eee | 2017-02-14 11:52:07 -0500 | [diff] [blame] | 85 | const CFX_PointF& point) override; |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 86 | bool OnRButtonDblClk(CPDFSDK_PageView* pPageView, |
| 87 | CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 88 | uint32_t nFlags, |
Dan Sinclair | f528eee | 2017-02-14 11:52:07 -0500 | [diff] [blame] | 89 | const CFX_PointF& point) override; |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 90 | bool OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags) override; |
| 91 | bool OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) override; |
| 92 | bool OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) override; |
| 93 | bool OnSetFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlag) override; |
| 94 | bool OnKillFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlag) override; |
jaepark | 35512aa | 2016-08-29 17:15:08 -0700 | [diff] [blame] | 95 | #ifdef PDF_ENABLE_XFA |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 96 | bool OnXFAChangedFocus(CPDFSDK_Annot::ObservedPtr* pOldAnnot, |
| 97 | CPDFSDK_Annot::ObservedPtr* pNewAnnot) override; |
jaepark | 35512aa | 2016-08-29 17:15:08 -0700 | [diff] [blame] | 98 | #endif // PDF_ENABLE_XFA |
| 99 | }; |
| 100 | |
dsinclair | 114e46a | 2016-09-29 17:18:21 -0700 | [diff] [blame] | 101 | #endif // FPDFSDK_CPDFSDK_BAANNOTHANDLER_H_ |