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_FORMFILLER_CFFL_FORMFILLER_H_ | 7 #ifndef FPDFSDK_FORMFILLER_CFFL_FORMFILLER_H_ |
8 #define FPDFSDK_FORMFILLER_CFFL_FORMFILLER_H_ | 8 #define FPDFSDK_FORMFILLER_CFFL_FORMFILLER_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 | 11 |
12 #include "fpdfsdk/formfiller/cba_fontmap.h" | 12 #include "fpdfsdk/formfiller/cba_fontmap.h" |
13 #include "fpdfsdk/formfiller/cffl_interactiveformfiller.h" | 13 #include "fpdfsdk/formfiller/cffl_interactiveformfiller.h" |
14 #include "fpdfsdk/pdfsdk_fieldaction.h" | 14 #include "fpdfsdk/pdfsdk_fieldaction.h" |
15 | 15 |
16 class CPDFSDK_Annot; | 16 class CPDFSDK_Annot; |
17 class CPDFSDK_Environment; | 17 class CPDFSDK_FormFillEnvironment; |
18 class CPDFSDK_PageView; | 18 class CPDFSDK_PageView; |
19 class CPDFSDK_Widget; | 19 class CPDFSDK_Widget; |
20 | 20 |
21 class CFFL_FormFiller : public IPWL_Provider, public CPWL_TimerHandler { | 21 class CFFL_FormFiller : public IPWL_Provider, public CPWL_TimerHandler { |
22 public: | 22 public: |
23 CFFL_FormFiller(CPDFSDK_Environment* pEnv, CPDFSDK_Annot* pAnnot); | 23 CFFL_FormFiller(CPDFSDK_FormFillEnvironment* pEnv, CPDFSDK_Annot* pAnnot); |
24 ~CFFL_FormFiller() override; | 24 ~CFFL_FormFiller() override; |
25 | 25 |
26 virtual FX_RECT GetViewBBox(CPDFSDK_PageView* pPageView, | 26 virtual FX_RECT GetViewBBox(CPDFSDK_PageView* pPageView, |
27 CPDFSDK_Annot* pAnnot); | 27 CPDFSDK_Annot* pAnnot); |
28 virtual void OnDraw(CPDFSDK_PageView* pPageView, | 28 virtual void OnDraw(CPDFSDK_PageView* pPageView, |
29 CPDFSDK_Annot* pAnnot, | 29 CPDFSDK_Annot* pAnnot, |
30 CFX_RenderDevice* pDevice, | 30 CFX_RenderDevice* pDevice, |
31 CFX_Matrix* pUser2Device); | 31 CFX_Matrix* pUser2Device); |
32 virtual void OnDrawDeactive(CPDFSDK_PageView* pPageView, | 32 virtual void OnDrawDeactive(CPDFSDK_PageView* pPageView, |
33 CPDFSDK_Annot* pAnnot, | 33 CPDFSDK_Annot* pAnnot, |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
154 using CFFL_PageView2PDFWindow = std::map<CPDFSDK_PageView*, CPWL_Wnd*>; | 154 using CFFL_PageView2PDFWindow = std::map<CPDFSDK_PageView*, CPWL_Wnd*>; |
155 | 155 |
156 // If the inheriting widget has its own fontmap and a PWL_Edit widget that | 156 // If the inheriting widget has its own fontmap and a PWL_Edit widget that |
157 // access that fontmap then you have to call DestroyWindows before destroying | 157 // access that fontmap then you have to call DestroyWindows before destroying |
158 // the font map in order to not get a use-after-free. | 158 // the font map in order to not get a use-after-free. |
159 // | 159 // |
160 // The font map should be stored somewhere more appropriate so it will live | 160 // The font map should be stored somewhere more appropriate so it will live |
161 // until the PWL_Edit is done with it. pdfium:566 | 161 // until the PWL_Edit is done with it. pdfium:566 |
162 void DestroyWindows(); | 162 void DestroyWindows(); |
163 | 163 |
164 CPDFSDK_Environment* m_pEnv; | 164 CPDFSDK_FormFillEnvironment* m_pEnv; |
Tom Sepez
2016/10/05 20:44:31
ditto
dsinclair
2016/10/05 20:47:13
ditto ditto.
| |
165 CPDFSDK_Widget* m_pWidget; | 165 CPDFSDK_Widget* m_pWidget; |
166 CPDFSDK_Annot* m_pAnnot; | 166 CPDFSDK_Annot* m_pAnnot; |
167 | 167 |
168 FX_BOOL m_bValid; | 168 FX_BOOL m_bValid; |
169 CFFL_PageView2PDFWindow m_Maps; | 169 CFFL_PageView2PDFWindow m_Maps; |
170 CFX_FloatPoint m_ptOldPos; | 170 CFX_FloatPoint m_ptOldPos; |
171 }; | 171 }; |
172 | 172 |
173 class CFFL_Button : public CFFL_FormFiller { | 173 class CFFL_Button : public CFFL_FormFiller { |
174 public: | 174 public: |
175 CFFL_Button(CPDFSDK_Environment* pEnv, CPDFSDK_Annot* pWidget); | 175 CFFL_Button(CPDFSDK_FormFillEnvironment* pEnv, CPDFSDK_Annot* pWidget); |
176 ~CFFL_Button() override; | 176 ~CFFL_Button() override; |
177 | 177 |
178 // CFFL_FormFiller | 178 // CFFL_FormFiller |
179 void OnMouseEnter(CPDFSDK_PageView* pPageView, | 179 void OnMouseEnter(CPDFSDK_PageView* pPageView, |
180 CPDFSDK_Annot* pAnnot) override; | 180 CPDFSDK_Annot* pAnnot) override; |
181 void OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot) override; | 181 void OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot) override; |
182 FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, | 182 FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, |
183 CPDFSDK_Annot* pAnnot, | 183 CPDFSDK_Annot* pAnnot, |
184 uint32_t nFlags, | 184 uint32_t nFlags, |
185 const CFX_FloatPoint& point) override; | 185 const CFX_FloatPoint& point) override; |
(...skipping 13 matching lines...) Expand all Loading... | |
199 CPDFSDK_Annot* pAnnot, | 199 CPDFSDK_Annot* pAnnot, |
200 CFX_RenderDevice* pDevice, | 200 CFX_RenderDevice* pDevice, |
201 CFX_Matrix* pUser2Device) override; | 201 CFX_Matrix* pUser2Device) override; |
202 | 202 |
203 protected: | 203 protected: |
204 FX_BOOL m_bMouseIn; | 204 FX_BOOL m_bMouseIn; |
205 FX_BOOL m_bMouseDown; | 205 FX_BOOL m_bMouseDown; |
206 }; | 206 }; |
207 | 207 |
208 #endif // FPDFSDK_FORMFILLER_CFFL_FORMFILLER_H_ | 208 #endif // FPDFSDK_FORMFILLER_CFFL_FORMFILLER_H_ |
OLD | NEW |