1 // Copyright 2017 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_FFLISTBOX_H_
8 #define XFA_FXFA_CXFA_FFLISTBOX_H_
9 
10 #include "xfa/fxfa/cxfa_fffield.h"
11 
12 class CXFA_FFListBox : public CXFA_FFField {
13  public:
14   explicit CXFA_FFListBox(CXFA_Node* pNode);
15   ~CXFA_FFListBox() override;
16 
17   // CXFA_FFField
18   bool LoadWidget() override;
19   bool OnKillFocus(CXFA_FFWidget* pNewWidget) override;
20   void OnProcessMessage(CFWL_Message* pMessage) override;
21   void OnProcessEvent(CFWL_Event* pEvent) override;
22   void OnDrawWidget(CXFA_Graphics* pGraphics,
23                     const CFX_Matrix& matrix) override;
24   FormFieldType GetFormFieldType() override;
25 
26   void OnSelectChanged(CFWL_Widget* pWidget);
27   void SetItemState(int32_t nIndex, bool bSelected);
28   void InsertItem(const WideStringView& wsLabel, int32_t nIndex);
29   void DeleteItem(int32_t nIndex);
30 
31  private:
32   bool CommitData() override;
33   bool UpdateFWLData() override;
34   bool IsDataChanged() override;
35 
36   uint32_t GetAlignment();
37 
38   IFWL_WidgetDelegate* m_pOldDelegate;
39 };
40 
41 #endif  // XFA_FXFA_CXFA_FFLISTBOX_H_
42