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 28 matching lines...) Expand all Loading... |
39 #define FWL_PARTSTATE_LTB_Normal (0L << 0) | 39 #define FWL_PARTSTATE_LTB_Normal (0L << 0) |
40 #define FWL_PARTSTATE_LTB_Selected (1L << 0) | 40 #define FWL_PARTSTATE_LTB_Selected (1L << 0) |
41 #define FWL_PARTSTATE_LTB_Disabled (2L << 0) | 41 #define FWL_PARTSTATE_LTB_Disabled (2L << 0) |
42 #define FWL_PARTSTATE_LTB_Focused (1L << 2) | 42 #define FWL_PARTSTATE_LTB_Focused (1L << 2) |
43 #define FWL_PARTSTATE_LTB_UnChecked (0L << 3) | 43 #define FWL_PARTSTATE_LTB_UnChecked (0L << 3) |
44 #define FWL_PARTSTATE_LTB_Checked (1L << 3) | 44 #define FWL_PARTSTATE_LTB_Checked (1L << 3) |
45 #define FWL_PARTSTATE_LTB_Mask (3L << 0) | 45 #define FWL_PARTSTATE_LTB_Mask (3L << 0) |
46 #define FWL_WGTHITTEST_LTB_Item FWL_WGTHITTEST_MAX + 1 | 46 #define FWL_WGTHITTEST_LTB_Item FWL_WGTHITTEST_MAX + 1 |
47 #define FWL_WGTHITTEST_LTB_HScrollBar FWL_WGTHITTEST_MAX + 2 | 47 #define FWL_WGTHITTEST_LTB_HScrollBar FWL_WGTHITTEST_MAX + 2 |
48 #define FWL_WGTHITTEST_LTB_VScrollBar FWL_WGTHITTEST_MAX + 3 | 48 #define FWL_WGTHITTEST_LTB_VScrollBar FWL_WGTHITTEST_MAX + 3 |
49 // TODO(dsinclair): Event hash is hash of string, cleanup. pdfium:474 | |
50 #define FWL_EVTHASH_LTB_SelChanged 1701781688 | |
51 #define FWL_EVTHASH_LTB_DrawItem 1050853991 | |
52 | 49 |
53 typedef struct FWL_HLISTITEM_ { void* pData; } * FWL_HLISTITEM; | 50 typedef struct FWL_HLISTITEM_ { void* pData; } * FWL_HLISTITEM; |
54 | 51 |
55 class CFX_DIBitmap; | 52 class CFX_DIBitmap; |
56 class IFWL_ListBoxDP; | 53 class IFWL_ListBoxDP; |
57 | 54 |
58 struct FWL_ListBoxItemData { | 55 struct FWL_ListBoxItemData { |
59 IFWL_ListBoxDP* pDataProvider; | 56 IFWL_ListBoxDP* pDataProvider; |
60 int32_t iIndex; | 57 int32_t iIndex; |
61 }; | 58 }; |
62 | 59 |
63 BEGIN_FWL_EVENT_DEF(CFWL_EvtLtbSelChanged, FWL_EVTHASH_LTB_SelChanged) | 60 BEGIN_FWL_EVENT_DEF(CFWL_EvtLtbSelChanged, CFWL_EventType::SelectChanged) |
64 CFX_Int32Array iarraySels; | 61 CFX_Int32Array iarraySels; |
65 END_FWL_EVENT_DEF | 62 END_FWL_EVENT_DEF |
66 | 63 |
67 BEGIN_FWL_EVENT_DEF(CFWL_EvtLtbDrawItem, FWL_EVTHASH_LTB_DrawItem) | 64 BEGIN_FWL_EVENT_DEF(CFWL_EvtLtbDrawItem, CFWL_EventType::DrawItem) |
68 CFX_Graphics* m_pGraphics; | 65 CFX_Graphics* m_pGraphics; |
69 CFX_Matrix m_matrix; | 66 CFX_Matrix m_matrix; |
70 int32_t m_index; | 67 int32_t m_index; |
71 CFX_RectF m_rect; | 68 CFX_RectF m_rect; |
72 END_FWL_EVENT_DEF | 69 END_FWL_EVENT_DEF |
73 | 70 |
74 class IFWL_ListBoxDP : public IFWL_DataProvider { | 71 class IFWL_ListBoxDP : public IFWL_DataProvider { |
75 public: | 72 public: |
76 virtual int32_t CountItems(IFWL_Widget* pWidget) = 0; | 73 virtual int32_t CountItems(IFWL_Widget* pWidget) = 0; |
77 virtual FWL_HLISTITEM GetItem(IFWL_Widget* pWidget, int32_t nIndex) = 0; | 74 virtual FWL_HLISTITEM GetItem(IFWL_Widget* pWidget, int32_t nIndex) = 0; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 FWL_ERR SetSelItem(FWL_HLISTITEM hItem, FX_BOOL bSelect = TRUE); | 129 FWL_ERR SetSelItem(FWL_HLISTITEM hItem, FX_BOOL bSelect = TRUE); |
133 FWL_ERR GetItemText(FWL_HLISTITEM hItem, CFX_WideString& wsText); | 130 FWL_ERR GetItemText(FWL_HLISTITEM hItem, CFX_WideString& wsText); |
134 FWL_ERR GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert = TRUE); | 131 FWL_ERR GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert = TRUE); |
135 FWL_ERR* Sort(IFWL_ListBoxCompare* pCom); | 132 FWL_ERR* Sort(IFWL_ListBoxCompare* pCom); |
136 | 133 |
137 protected: | 134 protected: |
138 IFWL_ListBox(); | 135 IFWL_ListBox(); |
139 }; | 136 }; |
140 | 137 |
141 #endif // XFA_FWL_BASEWIDGET_IFWL_LISTBOX_H_ | 138 #endif // XFA_FWL_BASEWIDGET_IFWL_LISTBOX_H_ |
OLD | NEW |