diff options
author | tsepez <tsepez@chromium.org> | 2016-06-02 14:17:40 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-02 14:17:40 -0700 |
commit | ad700c2c1fc3c3843dae71e5982f462e42efc987 (patch) | |
tree | 9d996c8101e0d467a278d51a90f0cf4889ef358e /xfa/fwl/lightwidget/cfwl_listbox.h | |
parent | ec409315f876bbac0e73abacfe73ef9bd1dd3db9 (diff) | |
download | pdfium-ad700c2c1fc3c3843dae71e5982f462e42efc987.tar.xz |
Replace FWL_HLISTITEM with class IFWL_ListItem {}
Make CFWL_ classes inherit from IFWL_ListItem.
Replace reinterpret_casts with static_casts.
Review-Url: https://codereview.chromium.org/2029923002
Diffstat (limited to 'xfa/fwl/lightwidget/cfwl_listbox.h')
-rw-r--r-- | xfa/fwl/lightwidget/cfwl_listbox.h | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/xfa/fwl/lightwidget/cfwl_listbox.h b/xfa/fwl/lightwidget/cfwl_listbox.h index a40d0f975c..7d79893fa6 100644 --- a/xfa/fwl/lightwidget/cfwl_listbox.h +++ b/xfa/fwl/lightwidget/cfwl_listbox.h @@ -21,28 +21,28 @@ class CFWL_ListBox : public CFWL_Widget { public: static CFWL_ListBox* Create(); FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL); - FWL_Error AddDIBitmap(CFX_DIBitmap* pDIB, FWL_HLISTITEM hItem); - FWL_HLISTITEM AddString(const CFX_WideStringC& wsAdd, - FX_BOOL bSelect = FALSE); - FX_BOOL DeleteString(FWL_HLISTITEM hItem); + FWL_Error AddDIBitmap(CFX_DIBitmap* pDIB, IFWL_ListItem* pItem); + IFWL_ListItem* AddString(const CFX_WideStringC& wsAdd, + FX_BOOL bSelect = FALSE); + FX_BOOL DeleteString(IFWL_ListItem* pItem); void DeleteAll(); int32_t CountSelItems(); - FWL_HLISTITEM GetSelItem(int32_t nIndexSel); + IFWL_ListItem* GetSelItem(int32_t nIndexSel); int32_t GetSelIndex(int32_t nIndex); - FWL_Error SetSelItem(FWL_HLISTITEM hItem, FX_BOOL bSelect = TRUE); - FWL_Error GetItemText(FWL_HLISTITEM hItem, CFX_WideString& wsText); + FWL_Error SetSelItem(IFWL_ListItem* pItem, FX_BOOL bSelect = TRUE); + FWL_Error GetItemText(IFWL_ListItem* pItem, CFX_WideString& wsText); FWL_Error GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert = TRUE); FWL_Error SetItemHeight(FX_FLOAT fItemHeight); - FWL_HLISTITEM GetFocusItem(); - FWL_Error SetFocusItem(FWL_HLISTITEM hItem); + IFWL_ListItem* GetFocusItem(); + FWL_Error SetFocusItem(IFWL_ListItem* pItem); int32_t CountItems(); - FWL_HLISTITEM GetItem(int32_t nIndex); - FWL_Error SetItemString(FWL_HLISTITEM hItem, const CFX_WideStringC& wsText); - FWL_Error GetItemString(FWL_HLISTITEM hItem, CFX_WideString& wsText); - FWL_Error SetItemData(FWL_HLISTITEM hItem, void* pData); - void* GetItemData(FWL_HLISTITEM hItem); - FWL_HLISTITEM GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy); - uint32_t GetItemStates(FWL_HLISTITEM hItem); + IFWL_ListItem* GetItem(int32_t nIndex); + FWL_Error SetItemString(IFWL_ListItem* pItem, const CFX_WideStringC& wsText); + FWL_Error GetItemString(IFWL_ListItem* pItem, CFX_WideString& wsText); + FWL_Error SetItemData(IFWL_ListItem* pItem, void* pData); + void* GetItemData(IFWL_ListItem* pItem); + IFWL_ListItem* GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy); + uint32_t GetItemStates(IFWL_ListItem* pItem); CFWL_ListBox(); virtual ~CFWL_ListBox(); @@ -58,41 +58,41 @@ class CFWL_ListBox : public CFWL_Widget { // IFWL_ListBoxDP: int32_t CountItems(IFWL_Widget* pWidget) override; - FWL_HLISTITEM GetItem(IFWL_Widget* pWidget, int32_t nIndex) override; - int32_t GetItemIndex(IFWL_Widget* pWidget, FWL_HLISTITEM hItem) override; + IFWL_ListItem* GetItem(IFWL_Widget* pWidget, int32_t nIndex) override; + int32_t GetItemIndex(IFWL_Widget* pWidget, IFWL_ListItem* pItem) override; FX_BOOL SetItemIndex(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, + IFWL_ListItem* pItem, int32_t nIndex) override; - uint32_t GetItemStyles(IFWL_Widget* pWidget, FWL_HLISTITEM hItem) override; + uint32_t GetItemStyles(IFWL_Widget* pWidget, IFWL_ListItem* pItem) override; FWL_Error GetItemText(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, + IFWL_ListItem* pItem, CFX_WideString& wsText) override; FWL_Error GetItemRect(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, + IFWL_ListItem* pItem, CFX_RectF& rtItem) override; - void* GetItemData(IFWL_Widget* pWidget, FWL_HLISTITEM hItem) override; + void* GetItemData(IFWL_Widget* pWidget, IFWL_ListItem* pItem) override; FWL_Error SetItemStyles(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, + IFWL_ListItem* pItem, uint32_t dwStyle) override; FWL_Error SetItemText(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, + IFWL_ListItem* pItem, const FX_WCHAR* pszText) override; FWL_Error SetItemRect(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, + IFWL_ListItem* pItem, const CFX_RectF& rtItem) override; FX_FLOAT GetItemHeight(IFWL_Widget* pWidget) override; CFX_DIBitmap* GetItemIcon(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem) override; + IFWL_ListItem* pItem) override; FWL_Error GetItemCheckRect(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, + IFWL_ListItem* pItem, CFX_RectF& rtCheck) override; FWL_Error SetItemCheckRect(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, + IFWL_ListItem* pItem, const CFX_RectF& rtCheck) override; uint32_t GetItemCheckState(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem) override; + IFWL_ListItem* pItem) override; FWL_Error SetItemCheckState(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, + IFWL_ListItem* pItem, uint32_t dwCheckState) override; std::vector<std::unique_ptr<CFWL_ListItem>> m_ItemArray; @@ -103,7 +103,7 @@ class CFWL_ListBox : public CFWL_Widget { CFWL_ListBoxDP m_ListBoxDP; }; -class CFWL_ListItem { +class CFWL_ListItem : public IFWL_ListItem { public: CFWL_ListItem() { m_rtItem.Reset(); |