1 // Copyright 2014 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_PWL_CPWL_SPECIAL_BUTTON_H_ 8 #define FPDFSDK_PWL_CPWL_SPECIAL_BUTTON_H_ 9 10 #include <memory> 11 12 #include "fpdfsdk/pwl/cpwl_button.h" 13 14 class CPWL_PushButton final : public CPWL_Button { 15 public: 16 CPWL_PushButton( 17 const CreateParams& cp, 18 std::unique_ptr<IPWL_SystemHandler::PerWindowData> pAttachedData); 19 ~CPWL_PushButton() override; 20 21 // CPWL_Button: 22 CFX_FloatRect GetFocusRect() const override; 23 }; 24 25 class CPWL_CheckBox final : public CPWL_Button { 26 public: 27 CPWL_CheckBox( 28 const CreateParams& cp, 29 std::unique_ptr<IPWL_SystemHandler::PerWindowData> pAttachedData); 30 ~CPWL_CheckBox() override; 31 32 // CPWL_Button: 33 bool OnLButtonUp(const CFX_PointF& point, uint32_t nFlag) override; 34 bool OnChar(uint16_t nChar, uint32_t nFlag) override; 35 IsChecked()36 bool IsChecked() const { return m_bChecked; } SetCheck(bool bCheck)37 void SetCheck(bool bCheck) { m_bChecked = bCheck; } 38 39 private: 40 bool m_bChecked = false; 41 }; 42 43 class CPWL_RadioButton final : public CPWL_Button { 44 public: 45 CPWL_RadioButton( 46 const CreateParams& cp, 47 std::unique_ptr<IPWL_SystemHandler::PerWindowData> pAttachedData); 48 ~CPWL_RadioButton() override; 49 50 // CPWL_Button 51 bool OnLButtonUp(const CFX_PointF& point, uint32_t nFlag) override; 52 bool OnChar(uint16_t nChar, uint32_t nFlag) override; 53 IsChecked()54 bool IsChecked() const { return m_bChecked; } SetCheck(bool bCheck)55 void SetCheck(bool bCheck) { m_bChecked = bCheck; } 56 57 private: 58 bool m_bChecked = false; 59 }; 60 61 #endif // FPDFSDK_PWL_CPWL_SPECIAL_BUTTON_H_ 62