| 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 _FWL_COMBOBOX_LIGHT_H | 7 #ifndef XFA_INCLUDE_FWL_LIGHTWIDGET_COMBOBOX_H_ |
| 8 #define _FWL_COMBOBOX_LIGHT_H | 8 #define XFA_INCLUDE_FWL_LIGHTWIDGET_COMBOBOX_H_ |
| 9 class CFWL_Widget; | 9 |
| 10 #include <memory> |
| 11 #include <vector> |
| 12 |
| 13 #include "xfa/include/fwl/basewidget/fwl_combobox.h" |
| 14 #include "xfa/include/fwl/lightwidget/widget.h" |
| 15 |
| 10 class CFWL_WidgetProperties; | 16 class CFWL_WidgetProperties; |
| 11 class IFWL_ComboBoxDP; | 17 class IFWL_ComboBoxDP; |
| 12 class CFWL_ComboBox; | |
| 13 class CFWL_ComboBoxDP; | 18 class CFWL_ComboBoxDP; |
| 14 class CFWL_ComboBoxItem; | 19 class CFWL_ComboBoxItem; |
| 20 |
| 15 class CFWL_ComboBox : public CFWL_Widget { | 21 class CFWL_ComboBox : public CFWL_Widget { |
| 16 public: | 22 public: |
| 17 static CFWL_ComboBox* Create(); | 23 static CFWL_ComboBox* Create(); |
| 18 FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); | 24 FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); |
| 19 int32_t AddString(const CFX_WideStringC& wsText); | 25 int32_t AddString(const CFX_WideStringC& wsText); |
| 20 int32_t AddString(const CFX_WideStringC& wsText, CFX_DIBitmap* pIcon); | 26 int32_t AddString(const CFX_WideStringC& wsText, CFX_DIBitmap* pIcon); |
| 21 int32_t RemoveAt(int32_t iIndex); | 27 bool RemoveAt(int32_t iIndex); // Returns false iff |iIndex| out of range. |
| 22 int32_t RemoveAll(); | 28 void RemoveAll(); |
| 23 int32_t CountItems(); | 29 int32_t CountItems(); |
| 24 FWL_ERR GetTextByIndex(int32_t iIndex, CFX_WideString& wsText); | 30 FWL_ERR GetTextByIndex(int32_t iIndex, CFX_WideString& wsText); |
| 25 int32_t GetCurSel(); | 31 int32_t GetCurSel(); |
| 26 FWL_ERR SetCurSel(int32_t iSel); | 32 FWL_ERR SetCurSel(int32_t iSel); |
| 27 FWL_ERR SetEditText(const CFX_WideStringC& wsText); | 33 FWL_ERR SetEditText(const CFX_WideStringC& wsText); |
| 28 int32_t GetEditTextLength() const; | 34 int32_t GetEditTextLength() const; |
| 29 FWL_ERR GetEditText(CFX_WideString& wsText, | 35 FWL_ERR GetEditText(CFX_WideString& wsText, |
| 30 int32_t nStart = 0, | 36 int32_t nStart = 0, |
| 31 int32_t nCount = -1) const; | 37 int32_t nCount = -1) const; |
| 32 FWL_ERR SetEditSelRange(int32_t nStart, int32_t nCount = -1); | 38 FWL_ERR SetEditSelRange(int32_t nStart, int32_t nCount = -1); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 virtual FWL_ERR SetItemCheckRect(IFWL_Widget* pWidget, | 112 virtual FWL_ERR SetItemCheckRect(IFWL_Widget* pWidget, |
| 107 FWL_HLISTITEM hItem, | 113 FWL_HLISTITEM hItem, |
| 108 const CFX_RectF& rtCheck); | 114 const CFX_RectF& rtCheck); |
| 109 virtual FX_DWORD GetItemCheckState(IFWL_Widget* pWidget, | 115 virtual FX_DWORD GetItemCheckState(IFWL_Widget* pWidget, |
| 110 FWL_HLISTITEM hItem); | 116 FWL_HLISTITEM hItem); |
| 111 virtual FWL_ERR SetItemCheckState(IFWL_Widget* pWidget, | 117 virtual FWL_ERR SetItemCheckState(IFWL_Widget* pWidget, |
| 112 FWL_HLISTITEM hItem, | 118 FWL_HLISTITEM hItem, |
| 113 FX_DWORD dwCheckState); | 119 FX_DWORD dwCheckState); |
| 114 virtual FX_FLOAT GetListHeight(IFWL_Widget* pWidget); | 120 virtual FX_FLOAT GetListHeight(IFWL_Widget* pWidget); |
| 115 | 121 |
| 116 CFX_PtrArray m_arrItem; | 122 std::vector<std::unique_ptr<CFWL_ComboBoxItem>> m_ItemArray; |
| 117 FX_FLOAT m_fMaxListHeight; | 123 FX_FLOAT m_fMaxListHeight; |
| 118 FX_FLOAT m_fItemHeight; | 124 FX_FLOAT m_fItemHeight; |
| 119 }; | 125 }; |
| 120 CFWL_ComboBoxDP m_comboBoxData; | 126 CFWL_ComboBoxDP m_comboBoxData; |
| 121 }; | 127 }; |
| 128 |
| 122 class CFWL_ComboBoxItem { | 129 class CFWL_ComboBoxItem { |
| 123 public: | 130 public: |
| 124 CFWL_ComboBoxItem() { | 131 CFWL_ComboBoxItem() { |
| 125 m_pDIB = NULL; | 132 m_pDIB = NULL; |
| 126 m_pData = NULL; | 133 m_pData = NULL; |
| 127 } | 134 } |
| 128 CFX_RectF m_rtItem; | 135 CFX_RectF m_rtItem; |
| 129 FX_DWORD m_dwStyles; | 136 FX_DWORD m_dwStyles; |
| 130 CFX_WideString m_wsText; | 137 CFX_WideString m_wsText; |
| 131 CFX_DIBitmap* m_pDIB; | 138 CFX_DIBitmap* m_pDIB; |
| 132 FX_DWORD m_dwCheckState; | 139 FX_DWORD m_dwCheckState; |
| 133 CFX_RectF m_rtCheckBox; | 140 CFX_RectF m_rtCheckBox; |
| 134 void* m_pData; | 141 void* m_pData; |
| 135 }; | 142 }; |
| 136 #endif | 143 |
| 144 #endif // XFA_INCLUDE_FWL_LIGHTWIDGET_COMBOBOX_H_ |
| OLD | NEW |