1 // Copyright 2017 The PDFium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef FPDFSDK_FORMFILLER_CFFL_BUTTON_H_ 8 #define FPDFSDK_FORMFILLER_CFFL_BUTTON_H_ 9 10 #include "core/fxcrt/fx_coordinates.h" 11 #include "fpdfsdk/formfiller/cffl_formfield.h" 12 13 class CFX_RenderDevice; 14 class CFX_Matrix; 15 class CPDFSDK_PageView; 16 class CPDFSDK_Widget; 17 18 class CFFL_Button : public CFFL_FormField { 19 public: 20 CFFL_Button(CFFL_InteractiveFormFiller* pFormFiller, CPDFSDK_Widget* pWidget); 21 ~CFFL_Button() override; 22 23 // CFFL_FormField 24 void OnMouseEnter(CPDFSDK_PageView* pPageView) override; 25 void OnMouseExit(CPDFSDK_PageView* pPageView) override; 26 bool OnLButtonDown(CPDFSDK_PageView* pPageView, 27 CPDFSDK_Widget* pWidget, 28 Mask<FWL_EVENTFLAG> nFlags, 29 const CFX_PointF& point) override; 30 bool OnLButtonUp(CPDFSDK_PageView* pPageView, 31 CPDFSDK_Widget* pWidget, 32 Mask<FWL_EVENTFLAG> nFlags, 33 const CFX_PointF& point) override; 34 bool OnMouseMove(CPDFSDK_PageView* pPageView, 35 Mask<FWL_EVENTFLAG> nFlags, 36 const CFX_PointF& point) override; 37 void OnDraw(CPDFSDK_PageView* pPageView, 38 CPDFSDK_Widget* pWidget, 39 CFX_RenderDevice* pDevice, 40 const CFX_Matrix& mtUser2Device) override; 41 void OnDrawDeactive(CPDFSDK_PageView* pPageView, 42 CPDFSDK_Widget* pWidget, 43 CFX_RenderDevice* pDevice, 44 const CFX_Matrix& mtUser2Device) override; 45 46 private: 47 bool m_bMouseIn = false; 48 bool m_bMouseDown = false; 49 }; 50 51 #endif // FPDFSDK_FORMFILLER_CFFL_BUTTON_H_ 52