| 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_BASEWIDGET_IFWL_LISTBOX_H_ | 7 #ifndef XFA_FWL_BASEWIDGET_IFWL_LISTBOX_H_ |
| 8 #define XFA_FWL_BASEWIDGET_IFWL_LISTBOX_H_ | 8 #define XFA_FWL_BASEWIDGET_IFWL_LISTBOX_H_ |
| 9 | 9 |
| 10 #include "xfa/fwl/core/ifwl_widget.h" | 10 #include "xfa/fwl/core/ifwl_widget.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #define FWL_STYLEEXT_LTB_Icon (1L << 8) | 26 #define FWL_STYLEEXT_LTB_Icon (1L << 8) |
| 27 #define FWL_STYLEEXT_LTB_Check (1L << 9) | 27 #define FWL_STYLEEXT_LTB_Check (1L << 9) |
| 28 #define FWL_STYLEEXT_LTB_AlignMask (3L << 4) | 28 #define FWL_STYLEEXT_LTB_AlignMask (3L << 4) |
| 29 #define FWL_STYLEEXT_LTB_ShowScrollBarFocus (1L << 10) | 29 #define FWL_STYLEEXT_LTB_ShowScrollBarFocus (1L << 10) |
| 30 #define FWL_ITEMSTATE_LTB_Selected (1L << 0) | 30 #define FWL_ITEMSTATE_LTB_Selected (1L << 0) |
| 31 #define FWL_ITEMSTATE_LTB_Focused (1L << 1) | 31 #define FWL_ITEMSTATE_LTB_Focused (1L << 1) |
| 32 #define FWL_ITEMSTATE_LTB_Checked (1L << 2) | 32 #define FWL_ITEMSTATE_LTB_Checked (1L << 2) |
| 33 #define FWL_WGTHITTEST_LTB_Item FWL_WGTHITTEST_MAX + 1 | 33 #define FWL_WGTHITTEST_LTB_Item FWL_WGTHITTEST_MAX + 1 |
| 34 #define FWL_WGTHITTEST_LTB_HScrollBar FWL_WGTHITTEST_MAX + 2 | 34 #define FWL_WGTHITTEST_LTB_HScrollBar FWL_WGTHITTEST_MAX + 2 |
| 35 #define FWL_WGTHITTEST_LTB_VScrollBar FWL_WGTHITTEST_MAX + 3 | 35 #define FWL_WGTHITTEST_LTB_VScrollBar FWL_WGTHITTEST_MAX + 3 |
| 36 // TODO(dsinclair): Event hash is hash of string, cleanup. pdfium:474 | |
| 37 #define FWL_EVTHASH_LTB_SelChanged 1701781688 | |
| 38 #define FWL_EVTHASH_LTB_DrawItem 1050853991 | |
| 39 | 36 |
| 40 typedef struct FWL_HLISTITEM_ { void* pData; } * FWL_HLISTITEM; | 37 typedef struct FWL_HLISTITEM_ { void* pData; } * FWL_HLISTITEM; |
| 41 | 38 |
| 42 class CFX_DIBitmap; | 39 class CFX_DIBitmap; |
| 43 class IFWL_ListBoxDP; | 40 class IFWL_ListBoxDP; |
| 44 | 41 |
| 45 struct FWL_ListBoxItemData { | 42 struct FWL_ListBoxItemData { |
| 46 IFWL_ListBoxDP* pDataProvider; | 43 IFWL_ListBoxDP* pDataProvider; |
| 47 int32_t iIndex; | 44 int32_t iIndex; |
| 48 }; | 45 }; |
| 49 | 46 |
| 50 BEGIN_FWL_EVENT_DEF(CFWL_EvtLtbSelChanged, FWL_EVTHASH_LTB_SelChanged) | 47 BEGIN_FWL_EVENT_DEF(CFWL_EvtLtbSelChanged, CFWL_EventType::SelectChanged) |
| 51 CFX_Int32Array iarraySels; | 48 CFX_Int32Array iarraySels; |
| 52 END_FWL_EVENT_DEF | 49 END_FWL_EVENT_DEF |
| 53 | 50 |
| 54 BEGIN_FWL_EVENT_DEF(CFWL_EvtLtbDrawItem, FWL_EVTHASH_LTB_DrawItem) | 51 BEGIN_FWL_EVENT_DEF(CFWL_EvtLtbDrawItem, CFWL_EventType::DrawItem) |
| 55 CFX_Graphics* m_pGraphics; | 52 CFX_Graphics* m_pGraphics; |
| 56 CFX_Matrix m_matrix; | 53 CFX_Matrix m_matrix; |
| 57 int32_t m_index; | 54 int32_t m_index; |
| 58 CFX_RectF m_rect; | 55 CFX_RectF m_rect; |
| 59 END_FWL_EVENT_DEF | 56 END_FWL_EVENT_DEF |
| 60 | 57 |
| 61 class IFWL_ListBoxDP : public IFWL_DataProvider { | 58 class IFWL_ListBoxDP : public IFWL_DataProvider { |
| 62 public: | 59 public: |
| 63 virtual int32_t CountItems(IFWL_Widget* pWidget) = 0; | 60 virtual int32_t CountItems(IFWL_Widget* pWidget) = 0; |
| 64 virtual FWL_HLISTITEM GetItem(IFWL_Widget* pWidget, int32_t nIndex) = 0; | 61 virtual FWL_HLISTITEM GetItem(IFWL_Widget* pWidget, int32_t nIndex) = 0; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 FWL_ERR SetSelItem(FWL_HLISTITEM hItem, FX_BOOL bSelect = TRUE); | 116 FWL_ERR SetSelItem(FWL_HLISTITEM hItem, FX_BOOL bSelect = TRUE); |
| 120 FWL_ERR GetItemText(FWL_HLISTITEM hItem, CFX_WideString& wsText); | 117 FWL_ERR GetItemText(FWL_HLISTITEM hItem, CFX_WideString& wsText); |
| 121 FWL_ERR GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert = TRUE); | 118 FWL_ERR GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert = TRUE); |
| 122 FWL_ERR* Sort(IFWL_ListBoxCompare* pCom); | 119 FWL_ERR* Sort(IFWL_ListBoxCompare* pCom); |
| 123 | 120 |
| 124 protected: | 121 protected: |
| 125 IFWL_ListBox(); | 122 IFWL_ListBox(); |
| 126 }; | 123 }; |
| 127 | 124 |
| 128 #endif // XFA_FWL_BASEWIDGET_IFWL_LISTBOX_H_ | 125 #endif // XFA_FWL_BASEWIDGET_IFWL_LISTBOX_H_ |
| OLD | NEW |