summaryrefslogtreecommitdiff
path: root/xfa/include/fwl/lightwidget/combobox.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-02-05 11:49:27 -0800
committerTom Sepez <tsepez@chromium.org>2016-02-05 11:49:27 -0800
commite059b5ba126082c0303bb4d46df947f34fcb0e61 (patch)
treed2cb55fb60f634b88fe538b7f7ee0e057f644d27 /xfa/include/fwl/lightwidget/combobox.h
parentb1dde8b188a20b5b7de53908bc434d2c82c22217 (diff)
downloadpdfium-e059b5ba126082c0303bb4d46df947f34fcb0e61.tar.xz
Remove CFX_PtrArray from xfa's combobox.h.
patch from issue 1665243003 at patchset 1 (http://crrev.com/1665243003#ps1) R=thestig@chromium.org Review URL: https://codereview.chromium.org/1669313002 .
Diffstat (limited to 'xfa/include/fwl/lightwidget/combobox.h')
-rw-r--r--xfa/include/fwl/lightwidget/combobox.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/xfa/include/fwl/lightwidget/combobox.h b/xfa/include/fwl/lightwidget/combobox.h
index 971c64b1bb..db6db39d2f 100644
--- a/xfa/include/fwl/lightwidget/combobox.h
+++ b/xfa/include/fwl/lightwidget/combobox.h
@@ -4,22 +4,28 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef _FWL_COMBOBOX_LIGHT_H
-#define _FWL_COMBOBOX_LIGHT_H
-class CFWL_Widget;
+#ifndef XFA_INCLUDE_FWL_LIGHTWIDGET_COMBOBOX_H_
+#define XFA_INCLUDE_FWL_LIGHTWIDGET_COMBOBOX_H_
+
+#include <memory>
+#include <vector>
+
+#include "xfa/include/fwl/basewidget/fwl_combobox.h"
+#include "xfa/include/fwl/lightwidget/widget.h"
+
class CFWL_WidgetProperties;
class IFWL_ComboBoxDP;
-class CFWL_ComboBox;
class CFWL_ComboBoxDP;
class CFWL_ComboBoxItem;
+
class CFWL_ComboBox : public CFWL_Widget {
public:
static CFWL_ComboBox* Create();
FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL);
int32_t AddString(const CFX_WideStringC& wsText);
int32_t AddString(const CFX_WideStringC& wsText, CFX_DIBitmap* pIcon);
- int32_t RemoveAt(int32_t iIndex);
- int32_t RemoveAll();
+ bool RemoveAt(int32_t iIndex); // Returns false iff |iIndex| out of range.
+ void RemoveAll();
int32_t CountItems();
FWL_ERR GetTextByIndex(int32_t iIndex, CFX_WideString& wsText);
int32_t GetCurSel();
@@ -113,12 +119,13 @@ class CFWL_ComboBox : public CFWL_Widget {
FX_DWORD dwCheckState);
virtual FX_FLOAT GetListHeight(IFWL_Widget* pWidget);
- CFX_PtrArray m_arrItem;
+ std::vector<std::unique_ptr<CFWL_ComboBoxItem>> m_ItemArray;
FX_FLOAT m_fMaxListHeight;
FX_FLOAT m_fItemHeight;
};
CFWL_ComboBoxDP m_comboBoxData;
};
+
class CFWL_ComboBoxItem {
public:
CFWL_ComboBoxItem() {
@@ -133,4 +140,5 @@ class CFWL_ComboBoxItem {
CFX_RectF m_rtCheckBox;
void* m_pData;
};
-#endif
+
+#endif // XFA_INCLUDE_FWL_LIGHTWIDGET_COMBOBOX_H_