1 // Copyright 2018 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 XFA_FXFA_CXFA_FFDROPDOWN_H_ 8 #define XFA_FXFA_CXFA_FFDROPDOWN_H_ 9 10 #include "core/fxcrt/widestring.h" 11 #include "xfa/fxfa/cxfa_fffield.h" 12 13 class CXFA_FFComboBox; 14 15 class CXFA_FFDropDown : public CXFA_FFField { 16 public: 17 CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED; 18 ~CXFA_FFDropDown() override; 19 20 // CXFA_FFField: 21 CXFA_FFDropDown* AsDropDown() override; 22 23 virtual void InsertItem(const WideString& wsLabel, int32_t nIndex) = 0; 24 virtual void DeleteItem(int32_t nIndex) = 0; 25 virtual CXFA_FFComboBox* AsComboBox(); 26 27 protected: 28 explicit CXFA_FFDropDown(CXFA_Node* pNode); 29 }; 30 ToComboBox(CXFA_FFDropDown * pDropDown)31inline CXFA_FFComboBox* ToComboBox(CXFA_FFDropDown* pDropDown) { 32 return pDropDown ? pDropDown->AsComboBox() : nullptr; 33 } 34 35 #endif // XFA_FXFA_CXFA_FFDROPDOWN_H_ 36