OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 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_FORMFILLER_FFL_IFORMFILLER_H_ | 7 #ifndef FPDFSDK_INCLUDE_FORMFILLER_FFL_IFORMFILLER_H_ |
8 #define FPDFSDK_INCLUDE_FORMFILLER_FFL_IFORMFILLER_H_ | 8 #define FPDFSDK_INCLUDE_FORMFILLER_FFL_IFORMFILLER_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 | 11 |
12 #include "FormFiller.h" | 12 #include "FormFiller.h" |
13 | 13 |
14 class CFFL_FormFiller; | 14 class CFFL_FormFiller; |
15 class CFFL_PrivateData; | 15 class CFFL_PrivateData; |
16 | 16 |
17 class CFFL_IFormFiller : public IPWL_Filler_Notify { | 17 class CFFL_IFormFiller : public IPWL_Filler_Notify { |
18 public: | 18 public: |
19 CFFL_IFormFiller(CPDFDoc_Environment* pApp); | 19 explicit CFFL_IFormFiller(CPDFDoc_Environment* pApp); |
20 virtual ~CFFL_IFormFiller(); | 20 ~CFFL_IFormFiller() override; |
21 | 21 |
22 virtual FX_BOOL Annot_HitTest(CPDFSDK_PageView* pPageView, | 22 virtual FX_BOOL Annot_HitTest(CPDFSDK_PageView* pPageView, |
23 CPDFSDK_Annot* pAnnot, | 23 CPDFSDK_Annot* pAnnot, |
24 CPDF_Point point); | 24 CPDF_Point point); |
25 virtual FX_RECT GetViewBBox(CPDFSDK_PageView* pPageView, | 25 virtual FX_RECT GetViewBBox(CPDFSDK_PageView* pPageView, |
26 CPDFSDK_Annot* pAnnot); | 26 CPDFSDK_Annot* pAnnot); |
27 virtual void OnDraw(CPDFSDK_PageView* pPageView, | 27 virtual void OnDraw(CPDFSDK_PageView* pPageView, |
28 /*HDC hDC,*/ CPDFSDK_Annot* pAnnot, | 28 CPDFSDK_Annot* pAnnot, |
29 CFX_RenderDevice* pDevice, | 29 CFX_RenderDevice* pDevice, |
30 CPDF_Matrix* pUser2Device, | 30 CPDF_Matrix* pUser2Device, |
31 /*const CRect& rcWindow,*/ FX_DWORD dwFlags); | 31 FX_DWORD dwFlags); |
32 | 32 |
33 virtual void OnCreate(CPDFSDK_Annot* pAnnot); | 33 virtual void OnCreate(CPDFSDK_Annot* pAnnot); |
34 virtual void OnLoad(CPDFSDK_Annot* pAnnot); | 34 virtual void OnLoad(CPDFSDK_Annot* pAnnot); |
35 virtual void OnDelete(CPDFSDK_Annot* pAnnot); | 35 virtual void OnDelete(CPDFSDK_Annot* pAnnot); |
36 | 36 |
37 virtual void OnMouseEnter(CPDFSDK_PageView* pPageView, | 37 virtual void OnMouseEnter(CPDFSDK_PageView* pPageView, |
38 CPDFSDK_Annot* pAnnot, | 38 CPDFSDK_Annot* pAnnot, |
39 FX_UINT nFlag); | 39 FX_UINT nFlag); |
40 virtual void OnMouseExit(CPDFSDK_PageView* pPageView, | 40 virtual void OnMouseExit(CPDFSDK_PageView* pPageView, |
41 CPDFSDK_Annot* pAnnot, | 41 CPDFSDK_Annot* pAnnot, |
(...skipping 30 matching lines...) Expand all Loading... |
72 const CPDF_Point& point); | 72 const CPDF_Point& point); |
73 | 73 |
74 virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, | 74 virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, |
75 FX_UINT nKeyCode, | 75 FX_UINT nKeyCode, |
76 FX_UINT nFlags); | 76 FX_UINT nFlags); |
77 virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags); | 77 virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags); |
78 | 78 |
79 virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag); | 79 virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag); |
80 virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag); | 80 virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag); |
81 | 81 |
82 virtual void QueryWherePopup(void* pPrivateData, | |
83 FX_FLOAT fPopupMin, | |
84 FX_FLOAT fPopupMax, | |
85 int32_t& nRet, | |
86 FX_FLOAT& fPopupRet); | |
87 virtual void OnBeforeKeyStroke(FX_BOOL bEditOrList, | |
88 void* pPrivateData, | |
89 int32_t nKeyCode, | |
90 CFX_WideString& strChange, | |
91 const CFX_WideString& strChangeEx, | |
92 int nSelStart, | |
93 int nSelEnd, | |
94 FX_BOOL bKeyDown, | |
95 FX_BOOL& bRC, | |
96 FX_BOOL& bExit, | |
97 FX_DWORD nFlag); | |
98 virtual void OnAfterKeyStroke(FX_BOOL bEditOrList, | |
99 void* pPrivateData, | |
100 FX_BOOL& bExit, | |
101 FX_DWORD nFlag); | |
102 | |
103 CFFL_FormFiller* GetFormFiller(CPDFSDK_Annot* pAnnot, FX_BOOL bRegister); | 82 CFFL_FormFiller* GetFormFiller(CPDFSDK_Annot* pAnnot, FX_BOOL bRegister); |
104 void RemoveFormFiller(CPDFSDK_Annot* pAnnot); | 83 void RemoveFormFiller(CPDFSDK_Annot* pAnnot); |
105 | 84 |
106 static FX_BOOL IsVisible(CPDFSDK_Widget* pWidget); | 85 static FX_BOOL IsVisible(CPDFSDK_Widget* pWidget); |
107 static FX_BOOL IsReadOnly(CPDFSDK_Widget* pWidget); | 86 static FX_BOOL IsReadOnly(CPDFSDK_Widget* pWidget); |
108 static FX_BOOL IsFillingAllowed(CPDFSDK_Widget* pWidget); | 87 static FX_BOOL IsFillingAllowed(CPDFSDK_Widget* pWidget); |
109 static FX_BOOL IsValidAnnot(CPDFSDK_PageView* pPageView, | 88 static FX_BOOL IsValidAnnot(CPDFSDK_PageView* pPageView, |
110 CPDFSDK_Annot* pAnnot); | 89 CPDFSDK_Annot* pAnnot); |
111 | 90 |
112 void OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, | 91 void OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, |
(...skipping 17 matching lines...) Expand all Loading... |
130 FX_DWORD nFlag); | 109 FX_DWORD nFlag); |
131 void OnButtonUp(CPDFSDK_Widget* pWidget, | 110 void OnButtonUp(CPDFSDK_Widget* pWidget, |
132 CPDFSDK_PageView* pPageView, | 111 CPDFSDK_PageView* pPageView, |
133 FX_BOOL& bReset, | 112 FX_BOOL& bReset, |
134 FX_BOOL& bExit, | 113 FX_BOOL& bExit, |
135 FX_UINT nFlag); | 114 FX_UINT nFlag); |
136 | 115 |
137 private: | 116 private: |
138 using CFFL_Widget2Filler = std::map<CPDFSDK_Annot*, CFFL_FormFiller*>; | 117 using CFFL_Widget2Filler = std::map<CPDFSDK_Annot*, CFFL_FormFiller*>; |
139 | 118 |
| 119 // IPWL_Filler_Notify: |
| 120 void QueryWherePopup(void* pPrivateData, |
| 121 FX_FLOAT fPopupMin, |
| 122 FX_FLOAT fPopupMax, |
| 123 int32_t& nRet, |
| 124 FX_FLOAT& fPopupRet) override; |
| 125 void OnBeforeKeyStroke(FX_BOOL bEditOrList, |
| 126 void* pPrivateData, |
| 127 int32_t nKeyCode, |
| 128 CFX_WideString& strChange, |
| 129 const CFX_WideString& strChangeEx, |
| 130 int nSelStart, |
| 131 int nSelEnd, |
| 132 FX_BOOL bKeyDown, |
| 133 FX_BOOL& bRC, |
| 134 FX_BOOL& bExit, |
| 135 FX_DWORD nFlag) override; |
| 136 void OnAfterKeyStroke(FX_BOOL bEditOrList, |
| 137 void* pPrivateData, |
| 138 FX_BOOL& bExit, |
| 139 FX_DWORD nFlag) override; |
| 140 |
140 void UnRegisterFormFiller(CPDFSDK_Annot* pAnnot); | 141 void UnRegisterFormFiller(CPDFSDK_Annot* pAnnot); |
141 | 142 |
142 CPDFDoc_Environment* m_pApp; | 143 CPDFDoc_Environment* m_pApp; |
143 CFFL_Widget2Filler m_Maps; | 144 CFFL_Widget2Filler m_Maps; |
144 FX_BOOL m_bNotifying; | 145 FX_BOOL m_bNotifying; |
145 }; | 146 }; |
146 | 147 |
147 class CFFL_PrivateData { | 148 class CFFL_PrivateData { |
148 public: | 149 public: |
149 CPDFSDK_Widget* pWidget; | 150 CPDFSDK_Widget* pWidget; |
150 CPDFSDK_PageView* pPageView; | 151 CPDFSDK_PageView* pPageView; |
151 int nWidgetAge; | 152 int nWidgetAge; |
152 int nValueAge; | 153 int nValueAge; |
153 }; | 154 }; |
154 | 155 |
155 #endif // FPDFSDK_INCLUDE_FORMFILLER_FFL_IFORMFILLER_H_ | 156 #endif // FPDFSDK_INCLUDE_FORMFILLER_FFL_IFORMFILLER_H_ |
OLD | NEW |