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 12 matching lines...) Expand all Loading... |
23 #define FWL_STYLEEXT_LTB_RightAlign (2L << 4) | 23 #define FWL_STYLEEXT_LTB_RightAlign (2L << 4) |
24 #define FWL_STYLEEXT_LTB_MultiLine (1L << 6) | 24 #define FWL_STYLEEXT_LTB_MultiLine (1L << 6) |
25 #define FWL_STYLEEXT_LTB_OwnerDraw (1L << 7) | 25 #define FWL_STYLEEXT_LTB_OwnerDraw (1L << 7) |
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 // TODO(dsinclair): Event hash is hash of string, cleanup. pdfium:474 | |
34 #define FWL_EVTHASH_LTB_SelChanged 1701781688 | |
35 #define FWL_EVTHASH_LTB_DrawItem 1050853991 | |
36 | 33 |
37 typedef struct FWL_HLISTITEM_ { void* pData; } * FWL_HLISTITEM; | 34 typedef struct FWL_HLISTITEM_ { void* pData; } * FWL_HLISTITEM; |
38 | 35 |
39 class CFX_DIBitmap; | 36 class CFX_DIBitmap; |
40 class IFWL_ListBoxDP; | 37 class IFWL_ListBoxDP; |
41 | 38 |
42 struct FWL_ListBoxItemData { | 39 struct FWL_ListBoxItemData { |
43 IFWL_ListBoxDP* pDataProvider; | 40 IFWL_ListBoxDP* pDataProvider; |
44 int32_t iIndex; | 41 int32_t iIndex; |
45 }; | 42 }; |
46 | 43 |
47 BEGIN_FWL_EVENT_DEF(CFWL_EvtLtbSelChanged, FWL_EVTHASH_LTB_SelChanged) | 44 BEGIN_FWL_EVENT_DEF(CFWL_EvtLtbSelChanged, CFWL_EventType::SelectChanged) |
48 CFX_Int32Array iarraySels; | 45 CFX_Int32Array iarraySels; |
49 END_FWL_EVENT_DEF | 46 END_FWL_EVENT_DEF |
50 | 47 |
51 BEGIN_FWL_EVENT_DEF(CFWL_EvtLtbDrawItem, FWL_EVTHASH_LTB_DrawItem) | 48 BEGIN_FWL_EVENT_DEF(CFWL_EvtLtbDrawItem, CFWL_EventType::DrawItem) |
52 CFX_Graphics* m_pGraphics; | 49 CFX_Graphics* m_pGraphics; |
53 CFX_Matrix m_matrix; | 50 CFX_Matrix m_matrix; |
54 int32_t m_index; | 51 int32_t m_index; |
55 CFX_RectF m_rect; | 52 CFX_RectF m_rect; |
56 END_FWL_EVENT_DEF | 53 END_FWL_EVENT_DEF |
57 | 54 |
58 class IFWL_ListBoxDP : public IFWL_DataProvider { | 55 class IFWL_ListBoxDP : public IFWL_DataProvider { |
59 public: | 56 public: |
60 virtual int32_t CountItems(IFWL_Widget* pWidget) = 0; | 57 virtual int32_t CountItems(IFWL_Widget* pWidget) = 0; |
61 virtual FWL_HLISTITEM GetItem(IFWL_Widget* pWidget, int32_t nIndex) = 0; | 58 virtual FWL_HLISTITEM GetItem(IFWL_Widget* pWidget, int32_t nIndex) = 0; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 FWL_ERR SetSelItem(FWL_HLISTITEM hItem, FX_BOOL bSelect = TRUE); | 113 FWL_ERR SetSelItem(FWL_HLISTITEM hItem, FX_BOOL bSelect = TRUE); |
117 FWL_ERR GetItemText(FWL_HLISTITEM hItem, CFX_WideString& wsText); | 114 FWL_ERR GetItemText(FWL_HLISTITEM hItem, CFX_WideString& wsText); |
118 FWL_ERR GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert = TRUE); | 115 FWL_ERR GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert = TRUE); |
119 FWL_ERR* Sort(IFWL_ListBoxCompare* pCom); | 116 FWL_ERR* Sort(IFWL_ListBoxCompare* pCom); |
120 | 117 |
121 protected: | 118 protected: |
122 IFWL_ListBox(); | 119 IFWL_ListBox(); |
123 }; | 120 }; |
124 | 121 |
125 #endif // XFA_FWL_BASEWIDGET_IFWL_LISTBOX_H_ | 122 #endif // XFA_FWL_BASEWIDGET_IFWL_LISTBOX_H_ |
OLD | NEW |