1 // Copyright 2014 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_FORMFILLER_CFFL_CHECKBOX_H_ 8 #define FPDFSDK_FORMFILLER_CFFL_CHECKBOX_H_ 9 10 #include <memory> 11 12 #include "fpdfsdk/formfiller/cffl_button.h" 13 14 class CPWL_CheckBox; 15 16 class CFFL_CheckBox final : public CFFL_Button { 17 public: 18 CFFL_CheckBox(CFFL_InteractiveFormFiller* pFormFiller, 19 CPDFSDK_Widget* pWidget); 20 ~CFFL_CheckBox() override; 21 22 // CFFL_Button: 23 std::unique_ptr<CPWL_Wnd> NewPWLWindow( 24 const CPWL_Wnd::CreateParams& cp, 25 std::unique_ptr<IPWL_FillerNotify::PerWindowData> pAttachedData) override; 26 bool OnKeyDown(FWL_VKEYCODE nKeyCode, Mask<FWL_EVENTFLAG> nFlags) override; 27 bool OnChar(CPDFSDK_Widget* pWidget, 28 uint32_t nChar, 29 Mask<FWL_EVENTFLAG> nFlags) override; 30 bool OnLButtonUp(CPDFSDK_PageView* pPageView, 31 CPDFSDK_Widget* pWidget, 32 Mask<FWL_EVENTFLAG> nFlags, 33 const CFX_PointF& point) override; 34 bool IsDataChanged(const CPDFSDK_PageView* pPageView) override; 35 void SaveData(const CPDFSDK_PageView* pPageView) override; 36 37 private: 38 CPWL_CheckBox* GetPWLCheckBox(const CPDFSDK_PageView* pPageView) const; 39 CPWL_CheckBox* CreateOrUpdatePWLCheckBox(const CPDFSDK_PageView* pPageView); 40 }; 41 42 #endif // FPDFSDK_FORMFILLER_CFFL_CHECKBOX_H_ 43