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_CORE_IFWL_LISTBOX_H_ | 7 #ifndef XFA_FWL_CORE_IFWL_LISTBOX_H_ |
8 #define XFA_FWL_CORE_IFWL_LISTBOX_H_ | 8 #define XFA_FWL_CORE_IFWL_LISTBOX_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "xfa/fwl/core/cfwl_event.h" | 12 #include "xfa/fwl/core/cfwl_event.h" |
13 #include "xfa/fwl/core/cfwl_widgetimpproperties.h" | 13 #include "xfa/fwl/core/cfwl_widgetproperties.h" |
14 #include "xfa/fwl/core/ifwl_dataprovider.h" | 14 #include "xfa/fwl/core/ifwl_dataprovider.h" |
15 #include "xfa/fwl/core/ifwl_edit.h" | 15 #include "xfa/fwl/core/ifwl_edit.h" |
16 #include "xfa/fwl/core/ifwl_listbox.h" | 16 #include "xfa/fwl/core/ifwl_listbox.h" |
17 #include "xfa/fwl/core/ifwl_widget.h" | 17 #include "xfa/fwl/core/ifwl_widget.h" |
18 | 18 |
19 #define FWL_STYLEEXT_LTB_MultiSelection (1L << 0) | 19 #define FWL_STYLEEXT_LTB_MultiSelection (1L << 0) |
20 #define FWL_STYLEEXT_LTB_ShowScrollBarAlaways (1L << 2) | 20 #define FWL_STYLEEXT_LTB_ShowScrollBarAlaways (1L << 2) |
21 #define FWL_STYLEEXT_LTB_MultiColumn (1L << 3) | 21 #define FWL_STYLEEXT_LTB_MultiColumn (1L << 3) |
22 #define FWL_STYLEEXT_LTB_LeftAlign (0L << 4) | 22 #define FWL_STYLEEXT_LTB_LeftAlign (0L << 4) |
23 #define FWL_STYLEEXT_LTB_CenterAlign (1L << 4) | 23 #define FWL_STYLEEXT_LTB_CenterAlign (1L << 4) |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 class IFWL_ListBoxCompare { | 96 class IFWL_ListBoxCompare { |
97 public: | 97 public: |
98 virtual ~IFWL_ListBoxCompare() {} | 98 virtual ~IFWL_ListBoxCompare() {} |
99 virtual int32_t Compare(IFWL_ListItem* hLeft, IFWL_ListItem* hRight) = 0; | 99 virtual int32_t Compare(IFWL_ListItem* hLeft, IFWL_ListItem* hRight) = 0; |
100 }; | 100 }; |
101 | 101 |
102 class IFWL_ListBox : public IFWL_Widget { | 102 class IFWL_ListBox : public IFWL_Widget { |
103 public: | 103 public: |
104 IFWL_ListBox(const IFWL_App* app, | 104 IFWL_ListBox(const IFWL_App* app, |
105 const CFWL_WidgetImpProperties& properties, | 105 std::unique_ptr<CFWL_WidgetProperties> properties, |
106 IFWL_Widget* pOuter); | 106 IFWL_Widget* pOuter); |
107 ~IFWL_ListBox() override; | 107 ~IFWL_ListBox() override; |
108 | 108 |
109 // IFWL_Widget | 109 // IFWL_Widget |
110 FWL_Type GetClassID() const override; | 110 FWL_Type GetClassID() const override; |
111 FWL_Error GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override; | 111 FWL_Error GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override; |
112 FWL_Error Update() override; | 112 FWL_Error Update() override; |
113 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; | 113 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; |
114 FWL_Error DrawWidget(CFX_Graphics* pGraphics, | 114 FWL_Error DrawWidget(CFX_Graphics* pGraphics, |
115 const CFX_Matrix* pMatrix = nullptr) override; | 115 const CFX_Matrix* pMatrix = nullptr) override; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 void OnLButtonDown(CFWL_MsgMouse* pMsg); | 187 void OnLButtonDown(CFWL_MsgMouse* pMsg); |
188 void OnLButtonUp(CFWL_MsgMouse* pMsg); | 188 void OnLButtonUp(CFWL_MsgMouse* pMsg); |
189 void OnMouseWheel(CFWL_MsgMouseWheel* pMsg); | 189 void OnMouseWheel(CFWL_MsgMouseWheel* pMsg); |
190 void OnKeyDown(CFWL_MsgKey* pMsg); | 190 void OnKeyDown(CFWL_MsgKey* pMsg); |
191 void OnVK(IFWL_ListItem* hItem, bool bShift, bool bCtrl); | 191 void OnVK(IFWL_ListItem* hItem, bool bShift, bool bCtrl); |
192 bool OnScroll(IFWL_ScrollBar* pScrollBar, uint32_t dwCode, FX_FLOAT fPos); | 192 bool OnScroll(IFWL_ScrollBar* pScrollBar, uint32_t dwCode, FX_FLOAT fPos); |
193 void DispatchSelChangedEv(); | 193 void DispatchSelChangedEv(); |
194 }; | 194 }; |
195 | 195 |
196 #endif // XFA_FWL_CORE_IFWL_LISTBOX_H_ | 196 #endif // XFA_FWL_CORE_IFWL_LISTBOX_H_ |
OLD | NEW |