22#if !defined(VCL_DLLIMPLEMENTATION) && !defined(TOOLKIT_DLLIMPLEMENTATION) && !defined(VCL_INTERNALS)
23#error "don't use this in new code"
26#include <config_options.h>
36#define LISTBOX_APPEND (SAL_MAX_INT32)
37#define LISTBOX_ENTRY_NOTFOUND (SAL_MAX_INT32)
38#define LISTBOX_MAX_ENTRIES (SAL_MAX_INT32 - 1)
97 SAL_DLLPRIVATE
void ImplInitListBoxData();
111 using Window::ImplInit;
124 virtual void dispose()
override;
128 virtual void Resize()
override;
145 void AdaptDropDownLineCountToMaximum();
146 void SetDropDownLineCount( sal_uInt16 nLines );
147 sal_uInt16 GetDropDownLineCount()
const;
149 void EnableAutoSize(
bool bAuto );
152 sal_Int32 InsertEntry(
const OUString& rStr, sal_Int32 nPos =
LISTBOX_APPEND );
153 sal_Int32 InsertEntry(
const OUString& rStr,
const Image& rImage, sal_Int32 nPos =
LISTBOX_APPEND );
154 void RemoveEntry( sal_Int32 nPos );
158 sal_Int32 GetEntryPos( std::u16string_view rStr )
const;
159 Image GetEntryImage( sal_Int32 nPos )
const;
160 OUString GetEntry( sal_Int32 nPos )
const;
161 sal_Int32 GetEntryCount()
const;
163 void SelectEntry( std::u16string_view rStr,
bool bSelect =
true );
164 void SelectEntryPos( sal_Int32 nPos,
bool bSelect =
true );
165 void SelectEntriesPos(
const std::vector<sal_Int32>& rPositions,
bool bSelect =
true );
167 sal_Int32 GetSelectedEntryCount()
const;
168 OUString GetSelectedEntry( sal_Int32 nSelIndex = 0 )
const;
169 sal_Int32 GetSelectedEntryPos( sal_Int32 nSelIndex = 0 )
const;
171 bool IsEntryPosSelected( sal_Int32 nPos )
const;
172 void SetNoSelection();
174 void SetEntryData( sal_Int32 nPos,
void* pNewData );
175 void* GetEntryData( sal_Int32 nPos )
const;
187 void SetTopEntry( sal_Int32 nPos );
188 sal_Int32 GetTopEntry()
const;
194 void SetSeparatorPos( sal_Int32 n );
199 sal_Int32 GetSeparatorPos()
const;
204 void AddSeparator( sal_Int32 n );
206 bool IsTravelSelect()
const;
207 bool IsInDropDown()
const;
208 void ToggleDropDown();
210 void EnableMultiSelection(
bool bMulti );
211 bool IsMultiSelectionEnabled()
const;
212 void SetHighlightColor(
const Color& rColor);
213 void SetHighlightTextColor(
const Color& rColor);
215 void SetReadOnly(
bool bReadOnly =
true );
222 Size CalcSubEditSize()
const;
223 Size CalcMinimumSize()
const;
225 Size CalcAdjustedSize(
const Size& rPrefSize )
const;
226 Size CalcBlockSize( sal_uInt16 nColumns, sal_uInt16 nLines )
const;
227 void GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines )
const;
229 sal_uInt16 GetDisplayLineCount()
const;
252 void setMaxWidthChars(sal_Int32 nWidth);
254 virtual bool set_property(
const OUString &rKey,
const OUString &rValue)
override;
261class UNLESS_MERGELIBS(VCL_DLLPUBLIC) MultiListBox final :
public ListBox
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
tools::Long GetIndexForPoint(const Point &rPoint) const
virtual void FillLayoutData() const
virtual void StateChanged(StateChangedType nStateChange) override
virtual void Resize() override
virtual Size GetOptimalSize() const override
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
A widget used to choose from a list of items and which has no entry.
DECL_DLLPRIVATE_LINK(ImplPopupModeEndHdl, FloatingWindow *, void)
DECL_DLLPRIVATE_LINK(ImplClickBtnHdl, void *, void)
DECL_DLLPRIVATE_LINK(ImplCancelHdl, LinkParamNone *, void)
DECL_DLLPRIVATE_LINK(ImplSelectHdl, LinkParamNone *, void)
VclPtr< ImplListBox > mpImplLB
bool IsDropDownBox() const
Link< ListBox &, void > maSelectHdl
VclPtr< ImplListBoxFloatingWindow > mpFloatWin
sal_Int32 m_nMaxWidthChars
DECL_DLLPRIVATE_LINK(ImplFocusHdl, sal_Int32, void)
VclPtr< ImplWin > mpImplWin
bool IsAutoSizeEnabled() const
DECL_DLLPRIVATE_LINK(ImplDoubleClickHdl, ImplListBoxWindow *, void)
DECL_DLLPRIVATE_LINK(ImplSelectionChangedHdl, sal_Int32, void)
DECL_DLLPRIVATE_LINK(ImplListItemSelectHdl, LinkParamNone *, void)
DECL_DLLPRIVATE_LINK(ImplScrollHdl, ImplListBox *, void)
void SetSelectHdl(const Link< ListBox &, void > &rLink)
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Event to pass information for UserDraw() handling eg. in comboboxes.
virtual const Wallpaper & GetDisplayBackground() const
virtual bool PreNotify(NotifyEvent &rNEvt)
virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags=PosSizeFlags::All)
virtual void DumpAsPropertyTree(tools::JsonWriter &)
Dumps itself and potentially its children to a property tree, to be written easily to JSON.
virtual void Draw(::OutputDevice *pDev, const Point &rPos, SystemTextColorFlags nFlags)
virtual void DataChanged(const DataChangedEvent &rDCEvt)
virtual bool set_property(const OUString &rKey, const OUString &rValue)
SAL_DLLPRIVATE void ImplInit(vcl::Window *pParent, WinBits nStyle, SystemParentData *pSystemParentData)
virtual FactoryFunction GetUITestFactory() const
constexpr OUStringLiteral IsReadOnly(u"IsReadOnly")
std::function< std::unique_ptr< UIObject >(vcl::Window *)> FactoryFunction
@ DrawDisabled
this flags lets the item be drawn disabled (e.g.
@ DisableSelection
this flag disables a selection of an entry completely.
void Clear(EHistoryType eHistory)