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 FX_BOOL CanAnswer(CPDFSDK_Annot* pAnnot) override; | |
33 CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage) override; | |
34 #ifdef PDF_ENABLE_XFA | |
35 CPDFSDK_Annot* NewAnnot(CXFA_FFWidget* hWidget, | |
36 CPDFSDK_PageView* pPage) override; | |
37 #endif // PDF_ENABLE_XFA | |
38 void ReleaseAnnot(CPDFSDK_Annot* pAnnot) override; | |
39 void DeleteAnnot(CPDFSDK_Annot* pAnnot) override; | |
40 CFX_FloatRect GetViewBBox(CPDFSDK_PageView* pPageView, | |
41 CPDFSDK_Annot* pAnnot) override; | |
42 FX_BOOL HitTest(CPDFSDK_PageView* pPageView, | |
43 CPDFSDK_Annot* pAnnot, | |
44 const CFX_FloatPoint& point) override; | |
45 void OnDraw(CPDFSDK_PageView* pPageView, | |
46 CPDFSDK_Annot* pAnnot, | |
47 CFX_RenderDevice* pDevice, | |
48 CFX_Matrix* pUser2Device, | |
49 uint32_t dwFlags) override; | |
50 void OnDrawSleep(CPDFSDK_PageView* pPageView, | |
51 CPDFSDK_Annot* pAnnot, | |
52 CFX_RenderDevice* pDevice, | |
53 CFX_Matrix* pUser2Device, | |
54 const CFX_FloatRect& rcWindow, | |
55 uint32_t dwFlags) override; | |
56 void OnCreate(CPDFSDK_Annot* pAnnot) override; | |
57 void OnLoad(CPDFSDK_Annot* pAnnot) override; | |
58 void OnDelete(CPDFSDK_Annot* pAnnot) override; | |
59 void OnRelease(CPDFSDK_Annot* pAnnot) override; | |
60 void OnMouseEnter(CPDFSDK_PageView* pPageView, | |
61 CPDFSDK_Annot* pAnnot, | |
62 uint32_t nFlag) override; | |
63 void OnMouseExit(CPDFSDK_PageView* pPageView, | |
64 CPDFSDK_Annot* pAnnot, | |
65 uint32_t nFlag) override; | |
66 FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, | |
67 CPDFSDK_Annot* pAnnot, | |
68 uint32_t nFlags, | |
69 const CFX_FloatPoint& point) override; | |
70 FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, | |
71 CPDFSDK_Annot* pAnnot, | |
72 uint32_t nFlags, | |
73 const CFX_FloatPoint& point) override; | |
74 FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, | |
75 CPDFSDK_Annot* pAnnot, | |
76 uint32_t nFlags, | |
77 const CFX_FloatPoint& point) override; | |
78 FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, | |
79 CPDFSDK_Annot* pAnnot, | |
80 uint32_t nFlags, | |
81 const CFX_FloatPoint& point) override; | |
82 FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, | |
83 CPDFSDK_Annot* pAnnot, | |
84 uint32_t nFlags, | |
85 short zDelta, | |
86 const CFX_FloatPoint& point) override; | |
87 FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, | |
88 CPDFSDK_Annot* pAnnot, | |
89 uint32_t nFlags, | |
90 const CFX_FloatPoint& point) override; | |
91 FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, | |
92 CPDFSDK_Annot* pAnnot, | |
93 uint32_t nFlags, | |
94 const CFX_FloatPoint& point) override; | |
95 FX_BOOL OnRButtonDblClk(CPDFSDK_PageView* pPageView, | |
96 CPDFSDK_Annot* pAnnot, | |
97 uint32_t nFlags, | |
98 const CFX_FloatPoint& point) override; | |
99 FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, | |
100 uint32_t nChar, | |
101 uint32_t nFlags) override; | |
102 FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) override; | |
103 FX_BOOL OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) override; | |
104 void OnDeSelected(CPDFSDK_Annot* pAnnot) override {} | |
105 void OnSelected(CPDFSDK_Annot* pAnnot) override {} | |
106 FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag) override; | |
107 FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag) override; | |
108 #ifdef PDF_ENABLE_XFA | |
109 FX_BOOL OnXFAChangedFocus(CPDFSDK_Annot* pOldAnnot, | |
110 CPDFSDK_Annot* pNewAnnot) override; | |
111 #endif // PDF_ENABLE_XFA | |
112 | |
113 void SetFormFiller(CFFL_IFormFiller* pFiller) { m_pFormFiller = pFiller; } | |
114 CFFL_IFormFiller* GetFormFiller() { return m_pFormFiller; } | |
115 | |
116 private: | |
117 CPDFDoc_Environment* m_pApp; | |
118 CFFL_IFormFiller* m_pFormFiller; | |
119 }; | |
120 | |
121 #endif // FPDFSDK_INCLUDE_CPDFSDK_BFANNOTHANDLER_H_ | |
OLD | NEW |