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_iformfiller.h" | 13 #include "fpdfsdk/formfiller/cffl_iformfiller.h" |
14 #include "fpdfsdk/include/pdfsdk_fieldaction.h" | 14 #include "fpdfsdk/include/pdfsdk_fieldaction.h" |
15 | 15 |
16 class CPDFDoc_Environment; | |
17 class CPDFSDK_Annot; | 16 class CPDFSDK_Annot; |
| 17 class CPDFSDK_Environment; |
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(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot); | 23 CFFL_FormFiller(CPDFSDK_Environment* pApp, 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 FX_BOOL IsValid() const; | 139 FX_BOOL IsValid() const; |
140 CFX_FloatRect GetPDFWindowRect() const; | 140 CFX_FloatRect GetPDFWindowRect() const; |
141 | 141 |
142 CPDFSDK_PageView* GetCurPageView(bool renew); | 142 CPDFSDK_PageView* GetCurPageView(bool renew); |
143 void SetChangeMark(); | 143 void SetChangeMark(); |
144 | 144 |
145 virtual void InvalidateRect(double left, | 145 virtual void InvalidateRect(double left, |
146 double top, | 146 double top, |
147 double right, | 147 double right, |
148 double bottom); | 148 double bottom); |
149 CPDFDoc_Environment* GetApp() { return m_pApp; } | 149 CPDFSDK_Environment* GetApp() { return m_pApp; } |
150 CPDFSDK_Annot* GetSDKAnnot() { return m_pAnnot; } | 150 CPDFSDK_Annot* GetSDKAnnot() { return m_pAnnot; } |
151 | 151 |
152 protected: | 152 protected: |
153 using CFFL_PageView2PDFWindow = std::map<CPDFSDK_PageView*, CPWL_Wnd*>; | 153 using CFFL_PageView2PDFWindow = std::map<CPDFSDK_PageView*, CPWL_Wnd*>; |
154 | 154 |
155 // If the inheriting widget has its own fontmap and a PWL_Edit widget that | 155 // If the inheriting widget has its own fontmap and a PWL_Edit widget that |
156 // access that fontmap then you have to call DestroyWindows before destroying | 156 // access that fontmap then you have to call DestroyWindows before destroying |
157 // the font map in order to not get a use-after-free. | 157 // the font map in order to not get a use-after-free. |
158 // | 158 // |
159 // The font map should be stored somewhere more appropriate so it will live | 159 // The font map should be stored somewhere more appropriate so it will live |
160 // until the PWL_Edit is done with it. pdfium:566 | 160 // until the PWL_Edit is done with it. pdfium:566 |
161 void DestroyWindows(); | 161 void DestroyWindows(); |
162 | 162 |
163 CPDFDoc_Environment* m_pApp; | 163 CPDFSDK_Environment* m_pApp; |
164 CPDFSDK_Widget* m_pWidget; | 164 CPDFSDK_Widget* m_pWidget; |
165 CPDFSDK_Annot* m_pAnnot; | 165 CPDFSDK_Annot* m_pAnnot; |
166 | 166 |
167 FX_BOOL m_bValid; | 167 FX_BOOL m_bValid; |
168 CFFL_PageView2PDFWindow m_Maps; | 168 CFFL_PageView2PDFWindow m_Maps; |
169 CFX_FloatPoint m_ptOldPos; | 169 CFX_FloatPoint m_ptOldPos; |
170 }; | 170 }; |
171 | 171 |
172 class CFFL_Button : public CFFL_FormFiller { | 172 class CFFL_Button : public CFFL_FormFiller { |
173 public: | 173 public: |
174 CFFL_Button(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget); | 174 CFFL_Button(CPDFSDK_Environment* pApp, CPDFSDK_Annot* pWidget); |
175 ~CFFL_Button() override; | 175 ~CFFL_Button() override; |
176 | 176 |
177 // CFFL_FormFiller | 177 // CFFL_FormFiller |
178 void OnMouseEnter(CPDFSDK_PageView* pPageView, | 178 void OnMouseEnter(CPDFSDK_PageView* pPageView, |
179 CPDFSDK_Annot* pAnnot) override; | 179 CPDFSDK_Annot* pAnnot) override; |
180 void OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot) override; | 180 void OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot) override; |
181 FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, | 181 FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, |
182 CPDFSDK_Annot* pAnnot, | 182 CPDFSDK_Annot* pAnnot, |
183 FX_UINT nFlags, | 183 FX_UINT nFlags, |
184 const CFX_FloatPoint& point) override; | 184 const CFX_FloatPoint& point) override; |
(...skipping 13 matching lines...) Expand all Loading... |
198 CPDFSDK_Annot* pAnnot, | 198 CPDFSDK_Annot* pAnnot, |
199 CFX_RenderDevice* pDevice, | 199 CFX_RenderDevice* pDevice, |
200 CFX_Matrix* pUser2Device) override; | 200 CFX_Matrix* pUser2Device) override; |
201 | 201 |
202 protected: | 202 protected: |
203 FX_BOOL m_bMouseIn; | 203 FX_BOOL m_bMouseIn; |
204 FX_BOOL m_bMouseDown; | 204 FX_BOOL m_bMouseDown; |
205 }; | 205 }; |
206 | 206 |
207 #endif // FPDFSDK_FORMFILLER_CFFL_FORMFILLER_H_ | 207 #endif // FPDFSDK_FORMFILLER_CFFL_FORMFILLER_H_ |
OLD | NEW |