7#ifndef XFA_FWL_CFWL_LISTBOX_H_
8#define XFA_FWL_CFWL_LISTBOX_H_
13#include "core/fxcrt/unowned_ptr.h"
14#include "xfa/fwl/cfwl_edit.h"
15#include "xfa/fwl/cfwl_event.h"
16#include "xfa/fwl/cfwl_listbox.h"
17#include "xfa/fwl/cfwl_widget.h"
18#include "xfa/fwl/fwl_widgetdef.h"
20#define FWL_STYLEEXT_LTB_MultiSelection (1L
<< 0
)
21#define FWL_STYLEEXT_LTB_LeftAlign (0L
<< 4
)
22#define FWL_STYLEEXT_LTB_CenterAlign (1L
<< 4
)
23#define FWL_STYLEEXT_LTB_RightAlign (2L
<< 4
)
24#define FWL_STYLEEXT_LTB_AlignMask (3L
<< 4
)
25#define FWL_STYLEEXT_LTB_ShowScrollBarFocus (1L
<< 10
)
27class CFWL_MessageMouse;
28class CFWL_MessageMouseWheel;
34 explicit Item(
const WideString& text);
43 WideString
GetText()
const {
return m_wsText; }
46 bool m_bIsSelected =
false;
47 bool m_bIsFocused =
false;
49 const WideString m_wsText;
56 void Trace(cppgc::Visitor* visitor)
const override;
98 bool IsMultiSelection()
const;
99 void ClearSelection();
101 Item* GetFocusedItem();
102 void SetFocusItem(
Item* hItem);
111 CFX_SizeF CalcSize();
112 void UpdateItemSize(
Item* hItem,
115 float fHeight)
const;
116 float GetMaxTextWidth();
117 float GetScrollWidth();
119 void OnFocusGained();
121 void OnLButtonDown(CFWL_MessageMouse* pMsg);
122 void OnLButtonUp(CFWL_MessageMouse* pMsg);
123 void OnMouseWheel(CFWL_MessageMouseWheel* pMsg);
124 void OnKeyDown(CFWL_MessageKey* pMsg);
125 void OnVK(
Item* hItem,
bool bShift,
bool bCtrl);
126 bool OnScroll(CFWL_ScrollBar* pScrollBar,
127 CFWL_EventScroll::
Code dwCode,
133 cppgc::Member<CFWL_ScrollBar> m_pHorzScrollBar;
134 cppgc::Member<CFWL_ScrollBar> m_pVertScrollBar;
137 bool m_bLButtonDown =
false;
138 float m_fItemHeight = 0.0f;
139 float m_fScorllBarWidth = 0.0f;
140 std::vector<std::unique_ptr<Item>> m_ItemArray;
#define FWL_STYLEEXT_CMB_ListItemAlignMask
#define FWL_STYLEEXT_CMB_EditHAlignMask
#define FWL_STYLEEXT_CMB_EditVCenter
#define FWL_STYLEEXT_CMB_EditVFar
#define FWL_STYLEEXT_CMB_DropDown
#define FWL_STYLEEXT_CMB_ListItemCenterAlign
#define FWL_STYLEEXT_CMB_EditHCenter
#define FWL_STYLEEXT_CMB_EditVAlignMask
#define FWL_STYLEEXT_CMB_ReadOnly
#define FWL_STYLEEXT_CMB_EditJustified
#define FWL_STYLEEXT_EDT_VAlignMask
#define FWL_STYLEEXT_EDT_HAlignModeMask
#define FWL_STYLEEXT_EDT_HAlignMask
#define FWL_STYLEEXT_EDT_VNear
#define FWL_STYLEEXT_EDT_VCenter
#define FWL_STYLEEXT_EDT_ReadOnly
#define FWL_STYLEEXT_EDT_VFar
#define FWL_STYLEEXT_EDT_HNear
#define FWL_STYLEEXT_EDT_Justified
#define FWL_STYLEEXT_EDT_HCenter
#define FWL_STYLEEXT_LTB_CenterAlign
#define FWL_STYLEEXT_LTB_LeftAlign
StateRestorer(CFGAS_GEGraphics *graphics)
void ConcatMatrix(const CFX_Matrix &matrix)
void ProcessSelChanged(bool bLButtonUp)
void OnProcessMessage(CFWL_Message *pMessage) override
void DrawWidget(CFGAS_GEGraphics *pGraphics, const CFX_Matrix &matrix) override
WideString GetTextByIndex(int32_t iIndex) const
~CFWL_ComboBox() override
void EditModifyStyleExts(uint32_t dwStyleExtsAdded, uint32_t dwStyleExtsRemoved)
FWL_Type GetClassID() const override
CFWL_ComboEdit * GetComboEdit() const
void AddString(const WideString &wsText)
FWL_WidgetHit HitTest(const CFX_PointF &point) override
void SetStates(uint32_t dwStates) override
absl::optional< WideString > EditCut()
bool EditCanSelectAll() const
void SetCurSel(int32_t iSel)
void RemoveStates(uint32_t dwStates) override
void OnProcessEvent(CFWL_Event *pEvent) override
CFX_RectF GetBBox() const
WideString GetEditText() const
int32_t GetCurrentSelection() const
absl::optional< WideString > EditCopy() const
void RemoveAt(int32_t iIndex)
void Trace(cppgc::Visitor *visitor) const override
bool EditPaste(const WideString &wsPaste)
int32_t GetCurSel() const
void SetEditText(const WideString &wsText)
void OnDrawWidget(CFGAS_GEGraphics *pGraphics, const CFX_Matrix &matrix) override
void ModifyStyleExts(uint32_t dwStyleExtsAdded, uint32_t dwStyleExtsRemoved) override
void OnProcessMessage(CFWL_Message *pMessage) override
~CFWL_ComboEdit() override
~CFWL_ComboList() override
void ChangeSelected(int32_t iSel)
void OnProcessMessage(CFWL_Message *pMessage) override
int32_t MatchItem(WideStringView wsMatch)
CFWL_Widget * GetSrcTarget() const
void SetSelected(bool enable)
CFX_RectF GetRect() const
Item(const WideString &text)
void SetFocused(bool enable)
void SetRect(const CFX_RectF &rect)
WideString GetText() const
bool ScrollBarPropertiesPresent() const
void SetSelItem(Item *hItem, bool bSelect)
FWL_WidgetHit HitTest(const CFX_PointF &point) override
void Trace(cppgc::Visitor *visitor) const override
Item * GetSelItem(int32_t nIndexSel)
void OnDrawWidget(CFGAS_GEGraphics *pGraphics, const CFX_Matrix &matrix) override
int32_t CountItems(const CFWL_Widget *pWidget) const
bool ScrollToVisible(Item *hItem)
int32_t GetItemIndex(CFWL_Widget *pWidget, Item *pItem)
void DrawWidget(CFGAS_GEGraphics *pGraphics, const CFX_Matrix &matrix) override
void InitHorizontalScrollBar()
void SetSelection(Item *hStart, Item *hEnd, bool bSelected)
bool IsShowVertScrollBar() const
Item * GetItem(const CFWL_Widget *pWidget, int32_t nIndex) const
void RemoveAt(int32_t iIndex)
FWL_Type GetClassID() const override
bool IsShowHorzScrollBar() const
void OnProcessEvent(CFWL_Event *pEvent) override
Item * GetListItem(Item *hItem, XFA_FWL_VKEYCODE dwKeyCode)
void OnProcessMessage(CFWL_Message *pMessage) override
Item * GetItemAtPoint(const CFX_PointF &point)
CFWL_ScrollBar * GetVertScrollBar() const
CFWL_ListBox(CFWL_App *pApp, const Properties &properties, CFWL_Widget *pOuter)
const CFX_RectF & GetRTClient() const
void DeleteString(Item *pItem)
void InitVerticalScrollBar()
Item * AddString(const WideString &wsAdd)
int32_t GetSelIndex(int32_t nIndex)
const uint32_t m_dwKeyCodeOrChar
CFWL_MessageKillFocus(CFWL_Widget *pDstTarget)
const MouseCommand m_dwCmd
CFWL_Widget * GetDstTarget() const
CFX_Matrix(float a1, float b1, float c1, float d1, float e1, float f1)
void Concat(const CFX_Matrix &right)
void Offset(float dx, float dy)
bool IsEmpty(float fEpsilon) const
void Deflate(float off_left, float off_top, float off_right, float off_bottom)
void Inflate(float x, float y)
CFX_RectF & operator=(const CFX_RectF &other)=default
bool Contains(const PointType &p) const
constexpr CFX_RectF(float dst_left, float dst_top, float dst_width, float dst_height)
void Union(const CFX_RectF &rt)
virtual CFX_RectF GetUIMargin(const CFWL_ThemePart &pThemePart) const =0
virtual float GetScrollBarWidth() const =0
bool operator==(const WideString &other) const
#define CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED