1 // Copyright 2017 PDFium Authors. All rights reserved. 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_formfiller.h" 12 13 class CFX_RenderDevice; 14 class CFX_Matrix; 15 class CPDFSDK_Annot; 16 class CPDFSDK_FormFillEnvironment; 17 class CPDFSDK_PageView; 18 class CPDFSDK_Widget; 19 20 class CFFL_Button : public CFFL_FormFiller { 21 public: 22 CFFL_Button(CPDFSDK_FormFillEnvironment* pFormFillEnv, 23 CPDFSDK_Widget* pWidget); 24 ~CFFL_Button() override; 25 26 // CFFL_FormFiller 27 void OnMouseEnter(CPDFSDK_PageView* pPageView) override; 28 void OnMouseExit(CPDFSDK_PageView* pPageView) override; 29 bool OnLButtonDown(CPDFSDK_PageView* pPageView, 30 CPDFSDK_Annot* pAnnot, 31 uint32_t nFlags, 32 const CFX_PointF& point) override; 33 bool OnLButtonUp(CPDFSDK_PageView* pPageView, 34 CPDFSDK_Annot* pAnnot, 35 uint32_t nFlags, 36 const CFX_PointF& point) override; 37 bool OnMouseMove(CPDFSDK_PageView* pPageView, 38 uint32_t nFlags, 39 const CFX_PointF& point) override; 40 void OnDraw(CPDFSDK_PageView* pPageView, 41 CPDFSDK_Annot* pAnnot, 42 CFX_RenderDevice* pDevice, 43 const CFX_Matrix& mtUser2Device) override; 44 void OnDrawDeactive(CPDFSDK_PageView* pPageView, 45 CPDFSDK_Annot* pAnnot, 46 CFX_RenderDevice* pDevice, 47 const CFX_Matrix& mtUser2Device) override; 48 49 private: 50 bool m_bMouseIn; 51 bool m_bMouseDown; 52 }; 53 54 #endif // FPDFSDK_FORMFILLER_CFFL_BUTTON_H_ 55