blob: 2ed9ed83343db9f9ce2627c655bb986690c162da [file] [log] [blame]
jaepark35512aa2016-08-29 17:15:08 -07001// 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
dsinclair114e46a2016-09-29 17:18:21 -07007#ifndef FPDFSDK_CPDFSDK_BAANNOTHANDLER_H_
8#define FPDFSDK_CPDFSDK_BAANNOTHANDLER_H_
jaepark35512aa2016-08-29 17:15:08 -07009
dsinclaira52ab742016-09-29 13:59:29 -070010#include "core/fxcrt/fx_coordinates.h"
dsinclair114e46a2016-09-29 17:18:21 -070011#include "fpdfsdk/ipdfsdk_annothandler.h"
jaepark35512aa2016-08-29 17:15:08 -070012
dsinclairb94d7c92016-09-21 12:07:00 -070013class CFFL_InteractiveFormFiller;
jaepark35512aa2016-08-29 17:15:08 -070014class CFX_Matrix;
15class CFX_RenderDevice;
16class CPDF_Annot;
dsinclair735606d2016-10-05 15:47:02 -070017class CPDFSDK_FormFillEnvironment;
jaepark35512aa2016-08-29 17:15:08 -070018class CPDFSDK_Annot;
19class CPDFSDK_PageView;
20
21#ifdef PDF_ENABLE_XFA
22class CXFA_FFWidget;
23#endif // PDF_ENABLE_XFA
24
25class CPDFSDK_BAAnnotHandler : public IPDFSDK_AnnotHandler {
26 public:
27 CPDFSDK_BAAnnotHandler();
28 ~CPDFSDK_BAAnnotHandler() override;
29
tsepez4cf55152016-11-02 14:37:54 -070030 bool CanAnswer(CPDFSDK_Annot* pAnnot) override;
jaepark35512aa2016-08-29 17:15:08 -070031 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;
jaepark35512aa2016-08-29 17:15:08 -070037 CFX_FloatRect GetViewBBox(CPDFSDK_PageView* pPageView,
38 CPDFSDK_Annot* pAnnot) override;
Diana Gagedce2d722017-06-20 11:17:11 -070039 CFX_WideString GetSelectedText(CPDFSDK_Annot* pAnnot) override;
Diana Gageab390972017-07-28 17:07:39 -070040 void ReplaceSelection(CPDFSDK_Annot* pAnnot,
41 const CFX_WideString& text) override;
tsepez4cf55152016-11-02 14:37:54 -070042 bool HitTest(CPDFSDK_PageView* pPageView,
43 CPDFSDK_Annot* pAnnot,
Dan Sinclairf528eee2017-02-14 11:52:07 -050044 const CFX_PointF& point) override;
jaepark35512aa2016-08-29 17:15:08 -070045 void OnDraw(CPDFSDK_PageView* pPageView,
46 CPDFSDK_Annot* pAnnot,
47 CFX_RenderDevice* pDevice,
jaepark75f84a52016-09-09 15:39:09 -070048 CFX_Matrix* pUser2Device,
49 bool bDrawAnnots) override;
jaepark35512aa2016-08-29 17:15:08 -070050 void OnLoad(CPDFSDK_Annot* pAnnot) override;
tsepezf8074ce2016-09-27 14:29:57 -070051
jaepark35512aa2016-08-29 17:15:08 -070052 void OnMouseEnter(CPDFSDK_PageView* pPageView,
tsepezf8074ce2016-09-27 14:29:57 -070053 CPDFSDK_Annot::ObservedPtr* pAnnot,
jaepark35512aa2016-08-29 17:15:08 -070054 uint32_t nFlag) override;
55 void OnMouseExit(CPDFSDK_PageView* pPageView,
tsepezf8074ce2016-09-27 14:29:57 -070056 CPDFSDK_Annot::ObservedPtr* pAnnot,
jaepark35512aa2016-08-29 17:15:08 -070057 uint32_t nFlag) override;
tsepez4cf55152016-11-02 14:37:54 -070058 bool OnLButtonDown(CPDFSDK_PageView* pPageView,
59 CPDFSDK_Annot::ObservedPtr* pAnnot,
60 uint32_t nFlags,
Dan Sinclairf528eee2017-02-14 11:52:07 -050061 const CFX_PointF& point) override;
tsepez4cf55152016-11-02 14:37:54 -070062 bool OnLButtonUp(CPDFSDK_PageView* pPageView,
63 CPDFSDK_Annot::ObservedPtr* pAnnot,
64 uint32_t nFlags,
Dan Sinclairf528eee2017-02-14 11:52:07 -050065 const CFX_PointF& point) override;
tsepez4cf55152016-11-02 14:37:54 -070066 bool OnLButtonDblClk(CPDFSDK_PageView* pPageView,
tsepezf8074ce2016-09-27 14:29:57 -070067 CPDFSDK_Annot::ObservedPtr* pAnnot,
jaepark35512aa2016-08-29 17:15:08 -070068 uint32_t nFlags,
Dan Sinclairf528eee2017-02-14 11:52:07 -050069 const CFX_PointF& point) override;
tsepez4cf55152016-11-02 14:37:54 -070070 bool OnMouseMove(CPDFSDK_PageView* pPageView,
71 CPDFSDK_Annot::ObservedPtr* pAnnot,
72 uint32_t nFlags,
Dan Sinclairf528eee2017-02-14 11:52:07 -050073 const CFX_PointF& point) override;
tsepez4cf55152016-11-02 14:37:54 -070074 bool OnMouseWheel(CPDFSDK_PageView* pPageView,
75 CPDFSDK_Annot::ObservedPtr* pAnnot,
76 uint32_t nFlags,
77 short zDelta,
Dan Sinclairf528eee2017-02-14 11:52:07 -050078 const CFX_PointF& point) override;
tsepez4cf55152016-11-02 14:37:54 -070079 bool OnRButtonDown(CPDFSDK_PageView* pPageView,
80 CPDFSDK_Annot::ObservedPtr* pAnnot,
81 uint32_t nFlags,
Dan Sinclairf528eee2017-02-14 11:52:07 -050082 const CFX_PointF& point) override;
tsepez4cf55152016-11-02 14:37:54 -070083 bool OnRButtonUp(CPDFSDK_PageView* pPageView,
84 CPDFSDK_Annot::ObservedPtr* pAnnot,
85 uint32_t nFlags,
Dan Sinclairf528eee2017-02-14 11:52:07 -050086 const CFX_PointF& point) override;
tsepez4cf55152016-11-02 14:37:54 -070087 bool OnRButtonDblClk(CPDFSDK_PageView* pPageView,
88 CPDFSDK_Annot::ObservedPtr* pAnnot,
89 uint32_t nFlags,
Dan Sinclairf528eee2017-02-14 11:52:07 -050090 const CFX_PointF& point) override;
tsepez4cf55152016-11-02 14:37:54 -070091 bool OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags) override;
92 bool OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) override;
93 bool OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) override;
94 bool OnSetFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlag) override;
95 bool OnKillFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlag) override;
jaepark35512aa2016-08-29 17:15:08 -070096#ifdef PDF_ENABLE_XFA
tsepez4cf55152016-11-02 14:37:54 -070097 bool OnXFAChangedFocus(CPDFSDK_Annot::ObservedPtr* pOldAnnot,
98 CPDFSDK_Annot::ObservedPtr* pNewAnnot) override;
jaepark35512aa2016-08-29 17:15:08 -070099#endif // PDF_ENABLE_XFA
100};
101
dsinclair114e46a2016-09-29 17:18:21 -0700102#endif // FPDFSDK_CPDFSDK_BAANNOTHANDLER_H_