OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef XFA_FWL_CORE_CFWL_LISTBOX_H_ | 7 #ifndef XFA_FWL_CORE_CFWL_LISTBOX_H_ |
8 #define XFA_FWL_CORE_CFWL_LISTBOX_H_ | 8 #define XFA_FWL_CORE_CFWL_LISTBOX_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
| 13 #include "xfa/fwl/core/cfwl_listitem.h" |
13 #include "xfa/fwl/core/cfwl_widget.h" | 14 #include "xfa/fwl/core/cfwl_widget.h" |
14 #include "xfa/fwl/core/fwl_error.h" | 15 #include "xfa/fwl/core/fwl_error.h" |
15 #include "xfa/fwl/core/ifwl_listbox.h" | |
16 #include "xfa/fwl/core/ifwl_widget.h" | |
17 | 16 |
18 class CFWL_ListBox : public CFWL_Widget, public IFWL_ListBox::DataProvider { | 17 class CFWL_ListBox : public CFWL_Widget { |
19 public: | 18 public: |
20 explicit CFWL_ListBox(const CFWL_App* pApp); | 19 explicit CFWL_ListBox(const CFWL_App* pApp); |
21 ~CFWL_ListBox() override; | 20 ~CFWL_ListBox() override; |
22 | 21 |
23 void Initialize(); | 22 void Initialize(); |
24 | 23 |
25 CFWL_ListItem* GetItem(const IFWL_Widget* pWidget, int32_t nIndex) const; | 24 CFWL_ListItem* GetItem(const IFWL_Widget* pWidget, int32_t nIndex) const; |
26 void GetItemText(IFWL_Widget* pWidget, | 25 void GetItemText(IFWL_Widget* pWidget, |
27 CFWL_ListItem* pItem, | 26 CFWL_ListItem* pItem, |
28 CFX_WideString& wsText); | 27 CFX_WideString& wsText); |
29 | 28 |
30 CFWL_ListItem* AddString(const CFX_WideStringC& wsAdd, bool bSelect = false); | 29 CFWL_ListItem* AddString(const CFX_WideStringC& wsAdd, bool bSelect = false); |
31 bool DeleteString(CFWL_ListItem* pItem); | 30 bool DeleteString(CFWL_ListItem* pItem); |
32 void DeleteAll(); | 31 void DeleteAll(); |
33 int32_t CountSelItems(); | 32 int32_t CountSelItems(); |
34 void SetSelItem(CFWL_ListItem* pItem, bool bSelect = true); | 33 void SetSelItem(CFWL_ListItem* pItem, bool bSelect = true); |
35 CFWL_ListItem* GetSelItem(int32_t nIndexSel); | 34 CFWL_ListItem* GetSelItem(int32_t nIndexSel); |
36 int32_t GetSelIndex(int32_t nIndex); | 35 int32_t GetSelIndex(int32_t nIndex); |
37 | 36 |
38 uint32_t GetItemStates(CFWL_ListItem* pItem); | 37 uint32_t GetItemStates(CFWL_ListItem* pItem); |
39 }; | 38 }; |
40 | 39 |
41 #endif // XFA_FWL_CORE_CFWL_LISTBOX_H_ | 40 #endif // XFA_FWL_CORE_CFWL_LISTBOX_H_ |
OLD | NEW |