20#ifndef INCLUDED_VCL_INC_LISTBOX_HXX
21#define INCLUDED_VCL_INC_LISTBOX_HXX
42#define IMG_TXT_DISTANCE 6
120 sal_Int32
FindMatchingEntry(
const OUString& rStr, sal_Int32 nStart,
bool bLazy )
const;
121 sal_Int32
FindEntry( std::u16string_view rStr,
bool bSearchMRUArea =
false )
const;
243 virtual void Resize()
override;
247 bool SelectEntries( sal_Int32 nSelect,
LB_EVENT_TYPE eLET,
bool bShift =
false,
bool bCtrl =
false,
bool bSelectPosChange =
false );
265 virtual void dispose()
override;
293 using Window::IsVisible;
294 bool IsVisible( sal_Int32 nEntry )
const;
410 virtual void dispose()
override;
415 virtual void Resize()
override;
418 sal_Int32
InsertEntry( sal_Int32 nPos,
const OUString& rStr );
419 sal_Int32
InsertEntry( sal_Int32 nPos,
const OUString& rStr,
const Image& rImage );
453 using Window::IsVisible;
515 virtual void dispose()
override;
534 virtual void Resize()
override;
559 virtual void Resize()
override;
Link< void *, void > maMBDownHdl
void SetMBDownHdl(const Link< void *, void > &rLink)
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
ImplBtn(vcl::Window *pParent, WinBits nWinStyle)
void SetEntryFlags(sal_Int32 nPos, ListBoxEntryFlags nFlags)
void SetMaxMRUCount(sal_Int32 n)
bool IsEntrySelectable(sal_Int32 nPos) const
An Entry is selectable if its mnFlags does not have the ListBoxEntryFlags::DisableSelection flag set.
void SetMRUCount(sal_Int32 n)
bool HasEntryImage(sal_Int32 nPos) const
void SetEntryData(sal_Int32 nPos, void *pNewData)
void SetCallSelectionChangedHdl(bool bCall)
sal_Int32 GetSelectedEntryPos(sal_Int32 nIndex) const
Image GetEntryImage(sal_Int32 nPos) const
sal_Int32 GetSelectedEntryCount() const
OUString GetSelectedEntry(sal_Int32 nIndex) const
VclPtr< vcl::Window > mpWindow
For getting the current locale when matching strings.
void SelectEntry(sal_Int32 nPos, bool bSelect)
sal_Int32 mnSelectionAnchor
void RemoveEntry(sal_Int32 nPos)
sal_Int32 FindEntry(std::u16string_view rStr, bool bSearchMRUArea=false) const
OUString GetEntryText(sal_Int32 nPos) const
bool mbCallSelectionChangedHdl
sal_Int32 FindFirstSelectable(sal_Int32 nPos, bool bForward=true) const
const ImplEntryType * GetEntryPtr(sal_Int32 nPos) const
ImplEntryType * GetEntry(sal_Int32 nPos) const
ImplEntryType * GetMutableEntryPtr(sal_Int32 nPos) const
sal_Int32 GetLastSelected() const
sal_Int32 GetMaxMRUCount() const
void * GetEntryData(sal_Int32 nPos) const
ImplEntryList(vcl::Window *pWindow)
sal_Int32 GetEntryCount() const
sal_Int32 GetMRUCount() const
void SetLastSelected(sal_Int32 nPos)
void SetSelectionChangedHdl(const Link< sal_Int32, void > &rLnk)
sal_Int32 GetSelectionAnchor() const
tools::Long GetEntryHeight(sal_Int32 nPos) const
std::vector< std::unique_ptr< ImplEntryType > > maEntries
sal_Int32 FindMatchingEntry(const OUString &rStr, sal_Int32 nStart, bool bLazy) const
tools::Long GetAddedHeight(sal_Int32 nEndIndex, sal_Int32 nBeginIndex) const
helper: add up heights up to index nEndIndex.
Link< sal_Int32, void > maSelectionChangedHdl
bool IsEntryPosSelected(sal_Int32 nIndex) const
void SetSelectionAnchor(sal_Int32 nPos)
sal_Int32 InsertEntry(sal_Int32 nPos, ImplEntryType *pNewEntry, bool bSort)
virtual void Resize() override
sal_uInt16 GetDropDownLineCount() const
void SetDropDownLineCount(sal_uInt16 n)
void SetAutoWidth(bool b)
virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags=PosSizeFlags::All) override
VclPtr< ImplListBox > mpImplLB
ImplListBoxFloatingWindow(vcl::Window *pParent)
sal_Int32 GetPopupModeStartSaveSelection() const
void SetImplListBox(ImplListBox *pLB)
const Size & GetPrefSize() const
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
virtual bool PreNotify(NotifyEvent &rNEvt) override
Size CalcFloatSize() const
void SetPrefSize(const Size &rSz)
sal_Int32 mnPopupModeStartSaveSelection
virtual ~ImplListBoxFloatingWindow() override
void StartFloat(bool bStartTracking)
std::set< sal_Int32 > maSeparators
Separator positions.
sal_Int32 mnUserDrawEntry
virtual void Tracking(const TrackingEvent &rTEvt) override
void ImplPaint(vcl::RenderContext &rRenderContext, sal_Int32 nPos)
sal_Int32 mnTop
output from line on
sal_Int32 InsertEntry(sal_Int32 nPos, ImplEntryType *pNewEntry)
virtual void Resize() override
bool IsMultiSelectionEnabled() const
tools::Long mnMaxImgTxtWidth
Maximum width of a text item.
sal_uInt16 GetSelectModifier() const
sal_Int32 mnTrackingSaveSelection
Selection before Tracking();.
void AllowGrabFocus(bool b)
void SetMultiSelectionSimpleMode(bool bSimple)
virtual vcl::StringEntryIdentifier NextEntry(vcl::StringEntryIdentifier _currentEntry, OUString &_out_entryText) const override
returns the next entry in the list.
sal_Int32 mnCurrentPos
Position (Focus)
vcl::QuickSelectionEngine maQuickSelectionEngine
virtual void LoseFocus() override
tools::Long mnMaxWidth
Maximum width of an entry.
void SetLeftIndent(tools::Long n)
virtual ~ImplListBoxWindow() override
bool ProcessKeyInput(const KeyEvent &rKEvt)
sal_Int32 GetSeparatorPos() const
Gets the position of the separator which was added first.
sal_Int32 GetLastVisibleEntry() const
virtual void KeyInput(const KeyEvent &rKEvt) override
tools::Long GetEntryHeightWithMargin() const
bool mbUserDrawEnabled
UserDraw possible.
bool isSeparator(const sal_Int32 &n) const
Checks if the given number n is an element of the separator positions set.
sal_Int32 GetEntryPosForPoint(const Point &rPoint) const
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
sal_Int32 GetTopEntry() const
void SetFocusHdl(const Link< sal_Int32, void > &rLink)
bool IsVisible(sal_Int32 nEntry) const
tools::Long mnLeft
output from column on
void AddSeparator(sal_Int32 n)
Adds a new separator at the given position n.
ImplListBoxWindow(vcl::Window *pParent, WinBits nWinStyle)
bool mbRight
right align Text output
tools::Rectangle GetBoundingRectangle(sal_Int32 nItem) const
tools::Long GetLeftIndent() const
void ImplDoPaint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
bool SelectEntries(sal_Int32 nSelect, LB_EVENT_TYPE eLET, bool bShift=false, bool bCtrl=false, bool bSelectPosChange=false)
bool mbSort
ListBox sorted.
tools::Long GetMaxEntryWidth() const
bool mbGrabFocus
Grab focus at MBDown.
bool IsMouseMoveSelect() const
void SetDoubleClickHdl(const Link< ImplListBoxWindow *, void > &rLink)
tools::Rectangle maFocusRect
void SetReadOnly(bool bReadOnly)
Size CalcSize(sal_Int32 nMaxLines) const
void SetSeparatorPos(sal_Int32 n)
Removes existing separators, and sets the position of the one and only separator.
Link< ImplListBoxWindow *, void > maDoubleClickHdl
const ImplEntryList & GetEntryList() const
Link< LinkParamNone *, void > maListItemSelectHdl
void ShowProminentEntry(sal_Int32 nEntryPos)
ShowProminentEntry will set the entry corresponding to nEntryPos either at top or in the middle depen...
void SetTravelSelect(bool bTravelSelect)
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
bool mbCenter
center Text output
void SetEdgeBlending(bool bNew)
Link< UserDrawEvent *, void > maUserDrawHdl
bool IsTrackingSelect() const
void SetEntryFlags(sal_Int32 nPos, ListBoxEntryFlags nFlags)
virtual vcl::StringEntryIdentifier CurrentEntry(OUString &_out_entryText) const override
returns the current entry in the list of searchable strings.
ImplEntryList maEntryList
EntryList.
void SetSelectHdl(const Link< LinkParamNone *, void > &rLink)
void DrawEntry(vcl::RenderContext &rRenderContext, sal_Int32 nPos, bool bDrawImage, bool bDrawText)
bool mbMouseMoveSelect
Select at MouseMove.
void RemoveEntry(sal_Int32 nPos)
void EnableUserDraw(bool bUserDraw)
Link< LinkParamNone *, void > maSelectHdl
virtual void FillLayoutData() const override
tools::Long mnMaxTxtHeight
Maximum height of a text item.
bool mbInUserDraw
In UserDraw.
bool mbSelectionChanged
Do not call Select() too often ...
bool mbMulti
MultiListBox.
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
Link< LinkParamNone *, void > maCancelHdl
virtual void MouseMove(const MouseEvent &rMEvt) override
void SetScrollHdl(const Link< ImplListBoxWindow *, void > &rLink)
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
tools::Long mnMaxTxtWidth
Maximum width of a text item.
void SetCancelHdl(const Link< LinkParamNone *, void > &rLink)
virtual void StateChanged(StateChangedType nType) override
void ScrollHorz(tools::Long nDiff)
Link< LinkParamNone *, void > maMRUChangedHdl
sal_uInt16 mnSelectModifier
Modifiers.
Link< ImplListBoxWindow *, void > maScrollHdl
tools::Long GetEntryHeight() const
tools::Long mnMaxImgHeight
Maximum height of an image item.
void SetUserItemSize(const Size &rSz)
void ImplUpdateEntryMetrics(ImplEntryType &rEntry)
void EnableMouseMoveSelect(bool bMouseMoveSelect)
tools::Long mnMaxImgWidth
Maximum width of an image item.
void SetTopEntry(sal_Int32 nTop)
sal_Int32 GetCurrentPos() const
tools::Long mnTextHeight
text height
void EnableMultiSelection(bool bMulti)
void SetUserDrawHdl(const Link< UserDrawEvent *, void > &rLink)
bool IsTravelSelect() const
void SetMRUChangedHdl(const Link< LinkParamNone *, void > &rLink)
bool IsGrabFocusAllowed() const
tools::Long mnMaxHeight
Maximum height of an entry.
sal_uInt16 GetDisplayLineCount() const
DrawTextFlags ImplGetTextStyle() const
void SetListItemSelectHdl(const Link< LinkParamNone *, void > &rLink)
bool GetEdgeBlending() const
bool IsUserDrawEnabled() const
ImplEntryList & GetEntryList()
bool mbTrackingSelect
Selected at a MouseMove.
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
Link< sal_Int32, void > maFocusHdl
bool mbTravelSelect
TravelSelect.
void SelectEntry(sal_Int32 nPos, bool bSelect)
virtual void GetFocus() override
bool mbSimpleMode
SimpleMode for MultiListBox.
bool IsSelectionChanged() const
bool mbIsDropdown
Listbox is actually a dropdown (either combobox, or popup window treated as dropdown)
void SetUserDrawHdl(const Link< UserDrawEvent *, void > &rLink)
sal_uInt16 GetDisplayLineCount() const
VclPtr< ScrollBar > mpHScrollBar
ImplListBoxWindow * GetMainWindow()
virtual void StateChanged(StateChangedType nType) override
void ImplResizeControls()
tools::Long GetMaxEntryWidth() const
Size CalcSize(sal_Int32 nMaxLines) const
bool IsMultiSelectionEnabled() const
void ImplInitScrollBars()
VclPtr< ScrollBar > mpVScrollBar
void SetSeparatorPos(sal_Int32 n)
Removes existing separators, and sets the position of the one and only separator.
bool IsVisible(sal_Int32 nEntry) const
void SelectEntry(sal_Int32 nPos, bool bSelect)
void RemoveEntry(sal_Int32 nPos)
void SetTravelSelect(bool bTravelSelect)
void SetDoubleClickHdl(const Link< ImplListBoxWindow *, void > &rLink)
OUString GetMRUEntries(sal_Unicode cSep) const
void SetSelectHdl(const Link< LinkParamNone *, void > &rLink)
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
bool IsTrackingSelect() const
void SetHighlightColor(const Color &rColor)
void SetHighlightTextColor(const Color &rColor)
void SetEntryFlags(sal_Int32 nPos, ListBoxEntryFlags nFlags)
VclPtr< ImplListBoxWindow > maLBWindow
virtual const Wallpaper & GetDisplayBackground() const override
bool ProcessKeyInput(const KeyEvent &rKEvt)
sal_uInt16 GetSelectModifier() const
VclPtr< ScrollBarBox > mpScrollBarBox
void SetListItemSelectHdl(const Link< LinkParamNone *, void > &rLink)
void SetMRUEntries(std::u16string_view rEntries, sal_Unicode cSep)
virtual ~ImplListBox() override
virtual void Resize() override
sal_Int32 GetTopEntry() const
virtual bool EventNotify(NotifyEvent &rNEvt) override
DECL_LINK(MRUChanged, LinkParamNone *, void)
void SetTopEntry(sal_Int32 nTop)
const ImplEntryList & GetEntryList() const
bool IsTravelSelect() const
bool HandleWheelAsCursorTravel(const CommandEvent &rCEvt, Control &rControl)
void ShowProminentEntry(sal_Int32 nPos)
void SetLeftIndent(sal_uInt16 n)
DECL_LINK(LBWindowScrolled, ImplListBoxWindow *, void)
bool GetEdgeBlending() const
void SetScrollHdl(const Link< ImplListBox *, void > &rLink)
void SetMaxMRUCount(sal_Int32 n)
void SetCancelHdl(const Link< LinkParamNone *, void > &rLink)
void AddSeparator(sal_Int32 n)
Adds a new separator at the given position n.
tools::Long GetEntryHeightWithMargin() const
void SetFocusHdl(const Link< sal_Int32, void > &rLink)
sal_Int32 InsertEntry(sal_Int32 nPos, const OUString &rStr)
DECL_LINK(ScrollBarHdl, ScrollBar *, void)
void SetMultiSelectionSimpleMode(bool bSimple)
bool IsSelectionChanged() const
void ImplCheckScrollBars()
void EnableMultiSelection(bool bMulti)
sal_Int32 GetMaxMRUCount() const
void SetEdgeBlending(bool bNew)
sal_Int32 GetSeparatorPos() const
Gets the position of the separator which was added first.
void SetSelectionChangedHdl(const Link< sal_Int32, void > &rLnk)
ImplListBox(vcl::Window *pParent, WinBits nWinStyle)
void SetEntryData(sal_Int32 nPos, void *pNewData)
void SetCallSelectionChangedHdl(bool bCall)
tools::Long GetLeftIndent() const
virtual void GetFocus() override
tools::Long GetEntryHeight() const
sal_Int32 GetCurrentPos() const
Link< ImplListBox *, void > maScrollHdl
tools::Rectangle maFocusRect
Link< void *, void > maMBDownHdl
void SetImage(const Image &rImg)
sal_Int32 GetItemPos() const
void SetString(const OUString &rStr)
virtual void ShowFocus(const tools::Rectangle &rRect) override
virtual void GetFocus() override
virtual void LoseFocus() override
sal_Int32 mnItemPos
because of UserDraw I have to know which item I draw
void ImplDraw(vcl::RenderContext &rRenderContext, bool bLayout=false)
ImplWin(vcl::Window *pParent, WinBits nWinStyle)
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
virtual void FillLayoutData() const override
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
void SetEdgeBlending(bool bNew)
bool GetEdgeBlending() const
void DrawEntry(vcl::RenderContext &rRenderContext, bool bLayout)
void SetMBDownHdl(const Link< void *, void > &rLink)
void SetItemPos(sal_Int32 n)
virtual void Resize() override
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
reference_type * get() const
Get the body.
void ImplInitDropDownButton(PushButton *pButton)
#define LISTBOX_ENTRY_NOTFOUND
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
const void * StringEntryIdentifier
ListBoxEntryFlags mnFlags
SalLayoutGlyphs * GetTextGlyphs(const OutputDevice *pOutputDevice)
Computes maStr's text layout (glyphs), cached in maStrGlyphs.
tools::Long getHeightWithMargin() const
ImplEntryType(OUString aStr)
ImplEntryType(OUString aStr, Image aImage)
SalLayoutGlyphs maStrGlyphs