• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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,
28                     CPDFSDK_Annot* pAnnot) override;
29   void OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot) override;
30   bool OnLButtonDown(CPDFSDK_PageView* pPageView,
31                      CPDFSDK_Annot* pAnnot,
32                      uint32_t nFlags,
33                      const CFX_PointF& point) override;
34   bool OnLButtonUp(CPDFSDK_PageView* pPageView,
35                    CPDFSDK_Annot* pAnnot,
36                    uint32_t nFlags,
37                    const CFX_PointF& point) override;
38   bool OnMouseMove(CPDFSDK_PageView* pPageView,
39                    CPDFSDK_Annot* pAnnot,
40                    uint32_t nFlags,
41                    const CFX_PointF& point) override;
42   void OnDraw(CPDFSDK_PageView* pPageView,
43               CPDFSDK_Annot* pAnnot,
44               CFX_RenderDevice* pDevice,
45               const CFX_Matrix& mtUser2Device) override;
46   void OnDrawDeactive(CPDFSDK_PageView* pPageView,
47                       CPDFSDK_Annot* pAnnot,
48                       CFX_RenderDevice* pDevice,
49                       const CFX_Matrix& mtUser2Device) override;
50 
51  private:
52   bool m_bMouseIn;
53   bool m_bMouseDown;
54 };
55 
56 #endif  // FPDFSDK_FORMFILLER_CFFL_BUTTON_H_
57