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_FORMFILLER_CFFL_LISTBOX_H_ 8 #define FPDFSDK_FORMFILLER_CFFL_LISTBOX_H_ 9 10 #include <memory> 11 #include <set> 12 #include <vector> 13 14 #include "fpdfsdk/formfiller/cffl_textobject.h" 15 16 class CPWL_ListBox; 17 18 class CFFL_ListBox final : public CFFL_TextObject { 19 public: 20 CFFL_ListBox(CPDFSDK_FormFillEnvironment* pApp, CPDFSDK_Widget* pWidget); 21 ~CFFL_ListBox() override; 22 23 // CFFL_TextObject: 24 CPWL_Wnd::CreateParams GetCreateParam() override; 25 std::unique_ptr<CPWL_Wnd> NewPWLWindow( 26 const CPWL_Wnd::CreateParams& cp, 27 std::unique_ptr<IPWL_SystemHandler::PerWindowData> pAttachedData) 28 override; 29 bool OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags) override; 30 bool IsDataChanged(CPDFSDK_PageView* pPageView) override; 31 void SaveData(CPDFSDK_PageView* pPageView) override; 32 void GetActionData(CPDFSDK_PageView* pPageView, 33 CPDF_AAction::AActionType type, 34 CPDFSDK_FieldAction& fa) override; 35 void SaveState(CPDFSDK_PageView* pPageView) override; 36 void RestoreState(CPDFSDK_PageView* pPageView) override; 37 bool SetIndexSelected(int index, bool selected) override; 38 bool IsIndexSelected(int index) override; 39 40 private: 41 CPWL_ListBox* GetListBox(CPDFSDK_PageView* pPageView); 42 43 std::set<int> m_OriginSelections; 44 std::vector<int> m_State; 45 }; 46 47 #endif // FPDFSDK_FORMFILLER_CFFL_LISTBOX_H_ 48