| 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_widgetimpproperties.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_CLASS_ListBox L"FWL_LISTBOX" | |
| 20 #define FWL_STYLEEXT_LTB_MultiSelection (1L << 0) | 19 #define FWL_STYLEEXT_LTB_MultiSelection (1L << 0) |
| 21 #define FWL_STYLEEXT_LTB_ShowScrollBarAlaways (1L << 2) | 20 #define FWL_STYLEEXT_LTB_ShowScrollBarAlaways (1L << 2) |
| 22 #define FWL_STYLEEXT_LTB_MultiColumn (1L << 3) | 21 #define FWL_STYLEEXT_LTB_MultiColumn (1L << 3) |
| 23 #define FWL_STYLEEXT_LTB_LeftAlign (0L << 4) | 22 #define FWL_STYLEEXT_LTB_LeftAlign (0L << 4) |
| 24 #define FWL_STYLEEXT_LTB_CenterAlign (1L << 4) | 23 #define FWL_STYLEEXT_LTB_CenterAlign (1L << 4) |
| 25 #define FWL_STYLEEXT_LTB_RightAlign (2L << 4) | 24 #define FWL_STYLEEXT_LTB_RightAlign (2L << 4) |
| 26 #define FWL_STYLEEXT_LTB_MultiLine (1L << 6) | 25 #define FWL_STYLEEXT_LTB_MultiLine (1L << 6) |
| 27 #define FWL_STYLEEXT_LTB_OwnerDraw (1L << 7) | 26 #define FWL_STYLEEXT_LTB_OwnerDraw (1L << 7) |
| 28 #define FWL_STYLEEXT_LTB_Icon (1L << 8) | 27 #define FWL_STYLEEXT_LTB_Icon (1L << 8) |
| 29 #define FWL_STYLEEXT_LTB_Check (1L << 9) | 28 #define FWL_STYLEEXT_LTB_Check (1L << 9) |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 virtual ~IFWL_ListBoxCompare() {} | 99 virtual ~IFWL_ListBoxCompare() {} |
| 101 virtual int32_t Compare(IFWL_ListItem* hLeft, IFWL_ListItem* hRight) = 0; | 100 virtual int32_t Compare(IFWL_ListItem* hLeft, IFWL_ListItem* hRight) = 0; |
| 102 }; | 101 }; |
| 103 | 102 |
| 104 class IFWL_ListBox : public IFWL_Widget { | 103 class IFWL_ListBox : public IFWL_Widget { |
| 105 public: | 104 public: |
| 106 IFWL_ListBox(const CFWL_WidgetImpProperties& properties, IFWL_Widget* pOuter); | 105 IFWL_ListBox(const CFWL_WidgetImpProperties& properties, IFWL_Widget* pOuter); |
| 107 ~IFWL_ListBox() override; | 106 ~IFWL_ListBox() override; |
| 108 | 107 |
| 109 // IFWL_Widget | 108 // IFWL_Widget |
| 110 FWL_Error GetClassName(CFX_WideString& wsClass) const override; | |
| 111 FWL_Type GetClassID() const override; | 109 FWL_Type GetClassID() const override; |
| 112 FWL_Error Initialize() override; | 110 FWL_Error Initialize() override; |
| 113 FWL_Error Finalize() override; | 111 void Finalize() override; |
| 114 FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; | 112 FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; |
| 115 FWL_Error Update() override; | 113 FWL_Error Update() override; |
| 116 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; | 114 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; |
| 117 FWL_Error DrawWidget(CFX_Graphics* pGraphics, | 115 FWL_Error DrawWidget(CFX_Graphics* pGraphics, |
| 118 const CFX_Matrix* pMatrix = nullptr) override; | 116 const CFX_Matrix* pMatrix = nullptr) override; |
| 119 FWL_Error SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) override; | 117 FWL_Error SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) override; |
| 120 | 118 |
| 121 int32_t CountSelItems(); | 119 int32_t CountSelItems(); |
| 122 IFWL_ListItem* GetSelItem(int32_t nIndexSel); | 120 IFWL_ListItem* GetSelItem(int32_t nIndexSel); |
| 123 int32_t GetSelIndex(int32_t nIndex); | 121 int32_t GetSelIndex(int32_t nIndex); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 void OnLButtonUp(CFWL_MsgMouse* pMsg); | 196 void OnLButtonUp(CFWL_MsgMouse* pMsg); |
| 199 void OnMouseWheel(CFWL_MsgMouseWheel* pMsg); | 197 void OnMouseWheel(CFWL_MsgMouseWheel* pMsg); |
| 200 void OnKeyDown(CFWL_MsgKey* pMsg); | 198 void OnKeyDown(CFWL_MsgKey* pMsg); |
| 201 void OnVK(IFWL_ListItem* hItem, FX_BOOL bShift, FX_BOOL bCtrl); | 199 void OnVK(IFWL_ListItem* hItem, FX_BOOL bShift, FX_BOOL bCtrl); |
| 202 FX_BOOL OnScroll(IFWL_ScrollBar* pScrollBar, uint32_t dwCode, FX_FLOAT fPos); | 200 FX_BOOL OnScroll(IFWL_ScrollBar* pScrollBar, uint32_t dwCode, FX_FLOAT fPos); |
| 203 void DispatchSelChangedEv(); | 201 void DispatchSelChangedEv(); |
| 204 IFWL_ListBox* m_pOwner; | 202 IFWL_ListBox* m_pOwner; |
| 205 }; | 203 }; |
| 206 | 204 |
| 207 #endif // XFA_FWL_CORE_IFWL_LISTBOX_H_ | 205 #endif // XFA_FWL_CORE_IFWL_LISTBOX_H_ |
| OLD | NEW |