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_COMBOBOX_H_ | 7 #ifndef XFA_FWL_CORE_CFWL_COMBOBOX_H_ |
8 #define XFA_FWL_CORE_CFWL_COMBOBOX_H_ | 8 #define XFA_FWL_CORE_CFWL_COMBOBOX_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "xfa/fwl/core/cfwl_widget.h" | 13 #include "xfa/fwl/core/cfwl_widget.h" |
14 #include "xfa/fwl/core/ifwl_combobox.h" | 14 #include "xfa/fwl/core/ifwl_combobox.h" |
15 | 15 |
16 class CFWL_ComboBox : public CFWL_Widget, public IFWL_ComboBoxDP { | 16 class CFWL_ComboBox : public CFWL_Widget, public IFWL_ComboBox::DataProvider { |
17 public: | 17 public: |
18 explicit CFWL_ComboBox(const IFWL_App* pApp); | 18 explicit CFWL_ComboBox(const IFWL_App* pApp); |
19 ~CFWL_ComboBox() override; | 19 ~CFWL_ComboBox() override; |
20 | 20 |
21 void Initialize(); | 21 void Initialize(); |
22 | 22 |
23 // IFWL_DataProvider | 23 // IFWL_Widget::DataProvider |
24 void GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption) override; | 24 void GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption) override; |
25 | 25 |
26 // IFWL_ListBoxDP | 26 // IFWL_ListBox::DataProvider |
27 int32_t CountItems(const IFWL_Widget* pWidget) const override; | 27 int32_t CountItems(const IFWL_Widget* pWidget) const override; |
28 CFWL_ListItem* GetItem(const IFWL_Widget* pWidget, | 28 CFWL_ListItem* GetItem(const IFWL_Widget* pWidget, |
29 int32_t nIndex) const override; | 29 int32_t nIndex) const override; |
30 int32_t GetItemIndex(IFWL_Widget* pWidget, CFWL_ListItem* pItem) override; | 30 int32_t GetItemIndex(IFWL_Widget* pWidget, CFWL_ListItem* pItem) override; |
31 uint32_t GetItemStyles(IFWL_Widget* pWidget, CFWL_ListItem* pItem) override; | 31 uint32_t GetItemStyles(IFWL_Widget* pWidget, CFWL_ListItem* pItem) override; |
32 void GetItemText(IFWL_Widget* pWidget, | 32 void GetItemText(IFWL_Widget* pWidget, |
33 CFWL_ListItem* pItem, | 33 CFWL_ListItem* pItem, |
34 CFX_WideString& wsText) override; | 34 CFX_WideString& wsText) override; |
35 void GetItemRect(IFWL_Widget* pWidget, | 35 void GetItemRect(IFWL_Widget* pWidget, |
36 CFWL_ListItem* pItem, | 36 CFWL_ListItem* pItem, |
(...skipping 12 matching lines...) Expand all Loading... |
49 CFX_RectF& rtCheck) override; | 49 CFX_RectF& rtCheck) override; |
50 void SetItemCheckRect(IFWL_Widget* pWidget, | 50 void SetItemCheckRect(IFWL_Widget* pWidget, |
51 CFWL_ListItem* pItem, | 51 CFWL_ListItem* pItem, |
52 const CFX_RectF& rtCheck) override; | 52 const CFX_RectF& rtCheck) override; |
53 uint32_t GetItemCheckState(IFWL_Widget* pWidget, | 53 uint32_t GetItemCheckState(IFWL_Widget* pWidget, |
54 CFWL_ListItem* pItem) override; | 54 CFWL_ListItem* pItem) override; |
55 void SetItemCheckState(IFWL_Widget* pWidget, | 55 void SetItemCheckState(IFWL_Widget* pWidget, |
56 CFWL_ListItem* pItem, | 56 CFWL_ListItem* pItem, |
57 uint32_t dwCheckState) override; | 57 uint32_t dwCheckState) override; |
58 | 58 |
59 // IFWL_ComboBoxDP | 59 // IFWL_ComboBox::DataProvider |
60 FX_FLOAT GetListHeight(IFWL_Widget* pWidget) override; | 60 FX_FLOAT GetListHeight(IFWL_Widget* pWidget) override; |
61 | 61 |
62 int32_t AddString(const CFX_WideStringC& wsText); | 62 int32_t AddString(const CFX_WideStringC& wsText); |
63 | 63 |
64 bool RemoveAt(int32_t iIndex); // Returns false iff |iIndex| out of range. | 64 bool RemoveAt(int32_t iIndex); // Returns false iff |iIndex| out of range. |
65 void RemoveAll(); | 65 void RemoveAll(); |
66 | 66 |
67 void GetTextByIndex(int32_t iIndex, CFX_WideString& wsText) const; | 67 void GetTextByIndex(int32_t iIndex, CFX_WideString& wsText) const; |
68 int32_t GetCurSel() const; | 68 int32_t GetCurSel() const; |
69 void SetCurSel(int32_t iSel); | 69 void SetCurSel(int32_t iSel); |
(...skipping 21 matching lines...) Expand all Loading... |
91 | 91 |
92 void GetBBox(CFX_RectF& rect); | 92 void GetBBox(CFX_RectF& rect); |
93 void EditModifyStylesEx(uint32_t dwStylesExAdded, uint32_t dwStylesExRemoved); | 93 void EditModifyStylesEx(uint32_t dwStylesExAdded, uint32_t dwStylesExRemoved); |
94 | 94 |
95 private: | 95 private: |
96 std::vector<std::unique_ptr<CFWL_ListItem>> m_ItemArray; | 96 std::vector<std::unique_ptr<CFWL_ListItem>> m_ItemArray; |
97 FX_FLOAT m_fMaxListHeight; | 97 FX_FLOAT m_fMaxListHeight; |
98 }; | 98 }; |
99 | 99 |
100 #endif // XFA_FWL_CORE_CFWL_COMBOBOX_H_ | 100 #endif // XFA_FWL_CORE_CFWL_COMBOBOX_H_ |
OLD | NEW |