1 // Copyright 2018 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 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 ~CXFA_FFDropDown() override; 18 19 // CXFA_FFField: 20 CXFA_FFDropDown* AsDropDown() override; 21 22 virtual void InsertItem(const WideString& wsLabel, int32_t nIndex) = 0; 23 virtual void DeleteItem(int32_t nIndex) = 0; 24 virtual CXFA_FFComboBox* AsComboBox(); 25 26 protected: 27 explicit CXFA_FFDropDown(CXFA_Node* pNode); 28 }; 29 ToComboBox(CXFA_FFDropDown * pDropDown)30inline CXFA_FFComboBox* ToComboBox(CXFA_FFDropDown* pDropDown) { 31 return pDropDown ? pDropDown->AsComboBox() : nullptr; 32 } 33 34 #endif // XFA_FXFA_CXFA_FFDROPDOWN_H_ 35