| 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_FormFillEnvironment; | 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_FormFillEnvironment* pEnv, CPDFSDK_Annot* pAnnot); | 23 CFFL_FormFiller(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
| 24 CPDFSDK_Annot* pAnnot); |
| 24 ~CFFL_FormFiller() override; | 25 ~CFFL_FormFiller() override; |
| 25 | 26 |
| 26 virtual FX_RECT GetViewBBox(CPDFSDK_PageView* pPageView, | 27 virtual FX_RECT GetViewBBox(CPDFSDK_PageView* pPageView, |
| 27 CPDFSDK_Annot* pAnnot); | 28 CPDFSDK_Annot* pAnnot); |
| 28 virtual void OnDraw(CPDFSDK_PageView* pPageView, | 29 virtual void OnDraw(CPDFSDK_PageView* pPageView, |
| 29 CPDFSDK_Annot* pAnnot, | 30 CPDFSDK_Annot* pAnnot, |
| 30 CFX_RenderDevice* pDevice, | 31 CFX_RenderDevice* pDevice, |
| 31 CFX_Matrix* pUser2Device); | 32 CFX_Matrix* pUser2Device); |
| 32 virtual void OnDrawDeactive(CPDFSDK_PageView* pPageView, | 33 virtual void OnDrawDeactive(CPDFSDK_PageView* pPageView, |
| 33 CPDFSDK_Annot* pAnnot, | 34 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*>; | 155 using CFFL_PageView2PDFWindow = std::map<CPDFSDK_PageView*, CPWL_Wnd*>; |
| 155 | 156 |
| 156 // If the inheriting widget has its own fontmap and a PWL_Edit widget that | 157 // 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 | 158 // access that fontmap then you have to call DestroyWindows before destroying |
| 158 // the font map in order to not get a use-after-free. | 159 // the font map in order to not get a use-after-free. |
| 159 // | 160 // |
| 160 // The font map should be stored somewhere more appropriate so it will live | 161 // The font map should be stored somewhere more appropriate so it will live |
| 161 // until the PWL_Edit is done with it. pdfium:566 | 162 // until the PWL_Edit is done with it. pdfium:566 |
| 162 void DestroyWindows(); | 163 void DestroyWindows(); |
| 163 | 164 |
| 164 CPDFSDK_FormFillEnvironment* m_pEnv; | 165 CPDFSDK_FormFillEnvironment* m_pFormFillEnv; |
| 165 CPDFSDK_Widget* m_pWidget; | 166 CPDFSDK_Widget* m_pWidget; |
| 166 CPDFSDK_Annot* m_pAnnot; | 167 CPDFSDK_Annot* m_pAnnot; |
| 167 | 168 |
| 168 FX_BOOL m_bValid; | 169 FX_BOOL m_bValid; |
| 169 CFFL_PageView2PDFWindow m_Maps; | 170 CFFL_PageView2PDFWindow m_Maps; |
| 170 CFX_FloatPoint m_ptOldPos; | 171 CFX_FloatPoint m_ptOldPos; |
| 171 }; | 172 }; |
| 172 | 173 |
| 173 class CFFL_Button : public CFFL_FormFiller { | 174 class CFFL_Button : public CFFL_FormFiller { |
| 174 public: | 175 public: |
| 175 CFFL_Button(CPDFSDK_FormFillEnvironment* pEnv, CPDFSDK_Annot* pWidget); | 176 CFFL_Button(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
| 177 CPDFSDK_Annot* pWidget); |
| 176 ~CFFL_Button() override; | 178 ~CFFL_Button() override; |
| 177 | 179 |
| 178 // CFFL_FormFiller | 180 // CFFL_FormFiller |
| 179 void OnMouseEnter(CPDFSDK_PageView* pPageView, | 181 void OnMouseEnter(CPDFSDK_PageView* pPageView, |
| 180 CPDFSDK_Annot* pAnnot) override; | 182 CPDFSDK_Annot* pAnnot) override; |
| 181 void OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot) override; | 183 void OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot) override; |
| 182 FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, | 184 FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, |
| 183 CPDFSDK_Annot* pAnnot, | 185 CPDFSDK_Annot* pAnnot, |
| 184 uint32_t nFlags, | 186 uint32_t nFlags, |
| 185 const CFX_FloatPoint& point) override; | 187 const CFX_FloatPoint& point) override; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 199 CPDFSDK_Annot* pAnnot, | 201 CPDFSDK_Annot* pAnnot, |
| 200 CFX_RenderDevice* pDevice, | 202 CFX_RenderDevice* pDevice, |
| 201 CFX_Matrix* pUser2Device) override; | 203 CFX_Matrix* pUser2Device) override; |
| 202 | 204 |
| 203 protected: | 205 protected: |
| 204 FX_BOOL m_bMouseIn; | 206 FX_BOOL m_bMouseIn; |
| 205 FX_BOOL m_bMouseDown; | 207 FX_BOOL m_bMouseDown; |
| 206 }; | 208 }; |
| 207 | 209 |
| 208 #endif // FPDFSDK_FORMFILLER_CFFL_FORMFILLER_H_ | 210 #endif // FPDFSDK_FORMFILLER_CFFL_FORMFILLER_H_ |
| OLD | NEW |