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