xref: /aosp_15_r20/external/pdfium/fpdfsdk/pwl/cpwl_sbbutton.h (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1 // Copyright 2021 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_PWL_CPWL_SBBUTTON_H_
8 #define FPDFSDK_PWL_CPWL_SBBUTTON_H_
9 
10 #include <memory>
11 
12 #include "fpdfsdk/pwl/cpwl_wnd.h"
13 #include "fpdfsdk/pwl/ipwl_fillernotify.h"
14 
15 class CPWL_SBButton final : public CPWL_Wnd {
16  public:
17   enum class Type : uint8_t { kMinButton, kMaxButton, kPosButton };
18 
19   CPWL_SBButton(const CreateParams& cp,
20                 std::unique_ptr<IPWL_FillerNotify::PerWindowData> pAttachedData,
21                 Type eButtonType);
22   ~CPWL_SBButton() override;
23 
24   // CPWL_Wnd
25   void DrawThisAppearance(CFX_RenderDevice* pDevice,
26                           const CFX_Matrix& mtUser2Device) override;
27   bool OnLButtonDown(Mask<FWL_EVENTFLAG> nFlag,
28                      const CFX_PointF& point) override;
29   bool OnLButtonUp(Mask<FWL_EVENTFLAG> nFlag, const CFX_PointF& point) override;
30   bool OnMouseMove(Mask<FWL_EVENTFLAG> nFlag, const CFX_PointF& point) override;
31 
32  private:
33   const Type m_eSBButtonType;
34   bool m_bMouseDown = false;
35 };
36 
37 #endif  // FPDFSDK_PWL_CPWL_SBBUTTON_H_
38