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_INCLUDE_CPDFSDK_ANNOTHANDLERMGR_H_ | 7 #ifndef FPDFSDK_INCLUDE_CPDFSDK_ANNOTHANDLERMGR_H_ |
8 #define FPDFSDK_INCLUDE_CPDFSDK_ANNOTHANDLERMGR_H_ | 8 #define FPDFSDK_INCLUDE_CPDFSDK_ANNOTHANDLERMGR_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 13 matching lines...) Expand all Loading... |
24 class IPDFSDK_AnnotHandler; | 24 class IPDFSDK_AnnotHandler; |
25 | 25 |
26 #ifdef PDF_ENABLE_XFA | 26 #ifdef PDF_ENABLE_XFA |
27 class CPDFSDK_XFAWidgetHandler; | 27 class CPDFSDK_XFAWidgetHandler; |
28 class CXFA_FFWidget; | 28 class CXFA_FFWidget; |
29 #endif // PDF_ENABLE_XFA | 29 #endif // PDF_ENABLE_XFA |
30 | 30 |
31 class CPDFSDK_AnnotHandlerMgr { | 31 class CPDFSDK_AnnotHandlerMgr { |
32 public: | 32 public: |
33 explicit CPDFSDK_AnnotHandlerMgr(CPDFSDK_Environment* pApp); | 33 explicit CPDFSDK_AnnotHandlerMgr(CPDFSDK_Environment* pApp); |
34 virtual ~CPDFSDK_AnnotHandlerMgr(); | 34 ~CPDFSDK_AnnotHandlerMgr(); |
35 | 35 |
36 virtual CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, | 36 CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView); |
37 CPDFSDK_PageView* pPageView); | |
38 #ifdef PDF_ENABLE_XFA | 37 #ifdef PDF_ENABLE_XFA |
39 virtual CPDFSDK_Annot* NewAnnot(CXFA_FFWidget* pAnnot, | 38 CPDFSDK_Annot* NewAnnot(CXFA_FFWidget* pAnnot, CPDFSDK_PageView* pPageView); |
40 CPDFSDK_PageView* pPageView); | |
41 #endif // PDF_ENABLE_XFA | 39 #endif // PDF_ENABLE_XFA |
42 virtual void ReleaseAnnot(CPDFSDK_Annot* pAnnot); | 40 void ReleaseAnnot(CPDFSDK_Annot* pAnnot); |
43 | 41 |
44 virtual void Annot_OnCreate(CPDFSDK_Annot* pAnnot); | 42 void Annot_OnCreate(CPDFSDK_Annot* pAnnot); |
45 virtual void Annot_OnLoad(CPDFSDK_Annot* pAnnot); | 43 void Annot_OnLoad(CPDFSDK_Annot* pAnnot); |
46 | 44 |
47 IPDFSDK_AnnotHandler* GetAnnotHandler(CPDFSDK_Annot* pAnnot) const; | 45 IPDFSDK_AnnotHandler* GetAnnotHandler(CPDFSDK_Annot* pAnnot) const; |
48 virtual void Annot_OnDraw(CPDFSDK_PageView* pPageView, | 46 void Annot_OnDraw(CPDFSDK_PageView* pPageView, |
| 47 CPDFSDK_Annot* pAnnot, |
| 48 CFX_RenderDevice* pDevice, |
| 49 CFX_Matrix* pUser2Device, |
| 50 bool bDrawAnnots); |
| 51 |
| 52 void Annot_OnMouseEnter(CPDFSDK_PageView* pPageView, |
| 53 CPDFSDK_Annot* pAnnot, |
| 54 uint32_t nFlags); |
| 55 void Annot_OnMouseExit(CPDFSDK_PageView* pPageView, |
| 56 CPDFSDK_Annot* pAnnot, |
| 57 uint32_t nFlags); |
| 58 FX_BOOL Annot_OnLButtonDown(CPDFSDK_PageView* pPageView, |
| 59 CPDFSDK_Annot* pAnnot, |
| 60 uint32_t nFlags, |
| 61 const CFX_FloatPoint& point); |
| 62 FX_BOOL Annot_OnLButtonUp(CPDFSDK_PageView* pPageView, |
49 CPDFSDK_Annot* pAnnot, | 63 CPDFSDK_Annot* pAnnot, |
50 CFX_RenderDevice* pDevice, | 64 uint32_t nFlags, |
51 CFX_Matrix* pUser2Device, | 65 const CFX_FloatPoint& point); |
52 bool bDrawAnnots); | 66 FX_BOOL Annot_OnLButtonDblClk(CPDFSDK_PageView* pPageView, |
| 67 CPDFSDK_Annot* pAnnot, |
| 68 uint32_t nFlags, |
| 69 const CFX_FloatPoint& point); |
| 70 FX_BOOL Annot_OnMouseMove(CPDFSDK_PageView* pPageView, |
| 71 CPDFSDK_Annot* pAnnot, |
| 72 uint32_t nFlags, |
| 73 const CFX_FloatPoint& point); |
| 74 FX_BOOL Annot_OnMouseWheel(CPDFSDK_PageView* pPageView, |
| 75 CPDFSDK_Annot* pAnnot, |
| 76 uint32_t nFlags, |
| 77 short zDelta, |
| 78 const CFX_FloatPoint& point); |
| 79 FX_BOOL Annot_OnRButtonDown(CPDFSDK_PageView* pPageView, |
| 80 CPDFSDK_Annot* pAnnot, |
| 81 uint32_t nFlags, |
| 82 const CFX_FloatPoint& point); |
| 83 FX_BOOL Annot_OnRButtonUp(CPDFSDK_PageView* pPageView, |
| 84 CPDFSDK_Annot* pAnnot, |
| 85 uint32_t nFlags, |
| 86 const CFX_FloatPoint& point); |
| 87 FX_BOOL Annot_OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags); |
| 88 FX_BOOL Annot_OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag); |
| 89 FX_BOOL Annot_OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag); |
53 | 90 |
54 virtual void Annot_OnMouseEnter(CPDFSDK_PageView* pPageView, | 91 FX_BOOL Annot_OnSetFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag); |
55 CPDFSDK_Annot* pAnnot, | 92 FX_BOOL Annot_OnKillFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag); |
56 uint32_t nFlags); | |
57 virtual void Annot_OnMouseExit(CPDFSDK_PageView* pPageView, | |
58 CPDFSDK_Annot* pAnnot, | |
59 uint32_t nFlags); | |
60 virtual FX_BOOL Annot_OnLButtonDown(CPDFSDK_PageView* pPageView, | |
61 CPDFSDK_Annot* pAnnot, | |
62 uint32_t nFlags, | |
63 const CFX_FloatPoint& point); | |
64 virtual FX_BOOL Annot_OnLButtonUp(CPDFSDK_PageView* pPageView, | |
65 CPDFSDK_Annot* pAnnot, | |
66 uint32_t nFlags, | |
67 const CFX_FloatPoint& point); | |
68 virtual FX_BOOL Annot_OnLButtonDblClk(CPDFSDK_PageView* pPageView, | |
69 CPDFSDK_Annot* pAnnot, | |
70 uint32_t nFlags, | |
71 const CFX_FloatPoint& point); | |
72 virtual FX_BOOL Annot_OnMouseMove(CPDFSDK_PageView* pPageView, | |
73 CPDFSDK_Annot* pAnnot, | |
74 uint32_t nFlags, | |
75 const CFX_FloatPoint& point); | |
76 virtual FX_BOOL Annot_OnMouseWheel(CPDFSDK_PageView* pPageView, | |
77 CPDFSDK_Annot* pAnnot, | |
78 uint32_t nFlags, | |
79 short zDelta, | |
80 const CFX_FloatPoint& point); | |
81 virtual FX_BOOL Annot_OnRButtonDown(CPDFSDK_PageView* pPageView, | |
82 CPDFSDK_Annot* pAnnot, | |
83 uint32_t nFlags, | |
84 const CFX_FloatPoint& point); | |
85 virtual FX_BOOL Annot_OnRButtonUp(CPDFSDK_PageView* pPageView, | |
86 CPDFSDK_Annot* pAnnot, | |
87 uint32_t nFlags, | |
88 const CFX_FloatPoint& point); | |
89 virtual FX_BOOL Annot_OnChar(CPDFSDK_Annot* pAnnot, | |
90 uint32_t nChar, | |
91 uint32_t nFlags); | |
92 virtual FX_BOOL Annot_OnKeyDown(CPDFSDK_Annot* pAnnot, | |
93 int nKeyCode, | |
94 int nFlag); | |
95 virtual FX_BOOL Annot_OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag); | |
96 | |
97 virtual FX_BOOL Annot_OnSetFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag); | |
98 virtual FX_BOOL Annot_OnKillFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag); | |
99 | 93 |
100 #ifdef PDF_ENABLE_XFA | 94 #ifdef PDF_ENABLE_XFA |
101 virtual FX_BOOL Annot_OnChangeFocus(CPDFSDK_Annot* pSetAnnot, | 95 FX_BOOL Annot_OnChangeFocus(CPDFSDK_Annot* pSetAnnot, |
102 CPDFSDK_Annot* pKillAnnot); | 96 CPDFSDK_Annot* pKillAnnot); |
103 #endif // PDF_ENABLE_XFA | 97 #endif // PDF_ENABLE_XFA |
104 | 98 |
105 virtual CFX_FloatRect Annot_OnGetViewBBox(CPDFSDK_PageView* pPageView, | 99 CFX_FloatRect Annot_OnGetViewBBox(CPDFSDK_PageView* pPageView, |
106 CPDFSDK_Annot* pAnnot); | 100 CPDFSDK_Annot* pAnnot); |
107 virtual FX_BOOL Annot_OnHitTest(CPDFSDK_PageView* pPageView, | 101 FX_BOOL Annot_OnHitTest(CPDFSDK_PageView* pPageView, |
108 CPDFSDK_Annot* pAnnot, | 102 CPDFSDK_Annot* pAnnot, |
109 const CFX_FloatPoint& point); | 103 const CFX_FloatPoint& point); |
110 | 104 |
111 private: | 105 private: |
112 IPDFSDK_AnnotHandler* GetAnnotHandler(CPDF_Annot::Subtype nSubtype) const; | 106 IPDFSDK_AnnotHandler* GetAnnotHandler(CPDF_Annot::Subtype nSubtype) const; |
113 CPDFSDK_Annot* GetNextAnnot(CPDFSDK_Annot* pSDKAnnot, FX_BOOL bNext); | 107 CPDFSDK_Annot* GetNextAnnot(CPDFSDK_Annot* pSDKAnnot, FX_BOOL bNext); |
114 | 108 |
115 std::unique_ptr<CPDFSDK_BAAnnotHandler> m_pBAAnnotHandler; | 109 std::unique_ptr<CPDFSDK_BAAnnotHandler> m_pBAAnnotHandler; |
116 std::unique_ptr<CPDFSDK_WidgetHandler> m_pWidgetHandler; | 110 std::unique_ptr<CPDFSDK_WidgetHandler> m_pWidgetHandler; |
117 #ifdef PDF_ENABLE_XFA | 111 #ifdef PDF_ENABLE_XFA |
118 std::unique_ptr<CPDFSDK_XFAWidgetHandler> m_pXFAWidgetHandler; | 112 std::unique_ptr<CPDFSDK_XFAWidgetHandler> m_pXFAWidgetHandler; |
119 #endif // PDF_ENABLE_XFA | 113 #endif // PDF_ENABLE_XFA |
120 | 114 |
121 CPDFSDK_Environment* m_pEnv; | 115 CPDFSDK_Environment* m_pEnv; |
122 }; | 116 }; |
123 | 117 |
124 #endif // FPDFSDK_INCLUDE_CPDFSDK_ANNOTHANDLERMGR_H_ | 118 #endif // FPDFSDK_INCLUDE_CPDFSDK_ANNOTHANDLERMGR_H_ |
OLD | NEW |