blob: 076b5298ed440ae64b21340bdc776fa99d399f9c [file] [log] [blame]
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001// 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.
Lei Zhanga6d9f0e2015-06-13 00:48:38 -07004
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07005// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
Dan Sinclairc411eb92017-07-25 09:39:30 -04007#ifndef FPDFSDK_PWL_CPWL_SPECIAL_BUTTON_H_
8#define FPDFSDK_PWL_CPWL_SPECIAL_BUTTON_H_
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07009
Dan Sinclairc411eb92017-07-25 09:39:30 -040010#include "fpdfsdk/pwl/cpwl_button.h"
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070011
Nico Weber9d8ec5a2015-08-04 13:00:21 -070012class CPWL_PushButton : public CPWL_Button {
13 public:
14 CPWL_PushButton();
Lei Zhang2b1a2d52015-08-14 22:16:22 -070015 ~CPWL_PushButton() override;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070016
Lei Zhang2b1a2d52015-08-14 22:16:22 -070017 // CPWL_Button
Ryan Harrison275e2602017-09-18 14:23:18 -040018 ByteString GetClassName() const override;
Tom Sepez281a9ea2016-02-26 14:24:28 -080019 CFX_FloatRect GetFocusRect() const override;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070020};
21
Nico Weber9d8ec5a2015-08-04 13:00:21 -070022class CPWL_CheckBox : public CPWL_Button {
23 public:
24 CPWL_CheckBox();
Lei Zhang2b1a2d52015-08-14 22:16:22 -070025 ~CPWL_CheckBox() override;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070026
Lei Zhang2b1a2d52015-08-14 22:16:22 -070027 // CPWL_Button
Ryan Harrison275e2602017-09-18 14:23:18 -040028 ByteString GetClassName() const override;
Dan Sinclairf528eee2017-02-14 11:52:07 -050029 bool OnLButtonUp(const CFX_PointF& point, uint32_t nFlag) override;
tsepez4cf55152016-11-02 14:37:54 -070030 bool OnChar(uint16_t nChar, uint32_t nFlag) override;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070031
Wei Li97da9762016-03-11 17:00:48 -080032 void SetCheck(bool bCheck);
33 bool IsChecked() const;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070034
Nico Weber9d8ec5a2015-08-04 13:00:21 -070035 private:
Wei Li97da9762016-03-11 17:00:48 -080036 bool m_bChecked;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070037};
38
Nico Weber9d8ec5a2015-08-04 13:00:21 -070039class CPWL_RadioButton : public CPWL_Button {
40 public:
41 CPWL_RadioButton();
Lei Zhang2b1a2d52015-08-14 22:16:22 -070042 ~CPWL_RadioButton() override;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070043
Lei Zhang2b1a2d52015-08-14 22:16:22 -070044 // CPWL_Button
Ryan Harrison275e2602017-09-18 14:23:18 -040045 ByteString GetClassName() const override;
Dan Sinclairf528eee2017-02-14 11:52:07 -050046 bool OnLButtonUp(const CFX_PointF& point, uint32_t nFlag) override;
tsepez4cf55152016-11-02 14:37:54 -070047 bool OnChar(uint16_t nChar, uint32_t nFlag) override;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070048
Wei Li97da9762016-03-11 17:00:48 -080049 void SetCheck(bool bCheck);
50 bool IsChecked() const;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070051
Nico Weber9d8ec5a2015-08-04 13:00:21 -070052 private:
Wei Li97da9762016-03-11 17:00:48 -080053 bool m_bChecked;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070054};
55
Dan Sinclairc411eb92017-07-25 09:39:30 -040056#endif // FPDFSDK_PWL_CPWL_SPECIAL_BUTTON_H_