34#include <com/sun/star/accessibility/AccessibleRole.hpp>
39#include <osl/diagnose.h>
45#define MULTILINE_ENTRY_DRAW_FLAGS ( DrawTextFlags::WordBreak | DrawTextFlags::MultiLine | DrawTextFlags::VCenter )
93 std::vector<std::unique_ptr<ImplEntryType> >::iterator iter =
maEntries.begin()+
nPos;
95 if ( ( (*iter)->mbIsSelected != bSelect ) &&
98 (*iter)->mbIsSelected = bSelect;
110 ::comphelper::getProcessComponentContext(),
121 return rSorter.
compare(rA, rB);
133 sal_Int32 insPos = 0;
134 const sal_Int32 nEntriesSize =
static_cast<sal_Int32
>(
maEntries.size());
138 if (0 <=
nPos &&
nPos < nEntriesSize)
145 insPos = nEntriesSize;
146 maEntries.push_back(std::unique_ptr<ImplEntryType>(pNewEntry));
153 const OUString& rStr = pNewEntry->
maStr;
164 insPos = nEntriesSize;
165 maEntries.push_back(std::unique_ptr<ImplEntryType>(pNewEntry));
186 nMid =
static_cast<sal_Int32
>((nLow + nHigh) / 2);
201 while ( nLow <= nHigh );
211 catch (uno::RuntimeException& )
230 std::vector<std::unique_ptr<ImplEntryType> >::iterator iter =
maEntries.begin()+
nPos;
232 if ( !!(*iter)->maImage )
241 const sal_Int32 nEntries =
static_cast<sal_Int32
>(
maEntries.size());
242 for ( sal_Int32
n = bSearchMRUArea ? 0 :
GetMRUCount();
n < nEntries;
n++ )
245 if ( aComp == rString )
257 for ( sal_Int32
n = nStart;
n < nEntryCount; )
267 bMatch = pImplEntry->
maStr.startsWith(rStr);
284 sal_Int32 nStart = std::min(i_nEndIndex, i_nBeginIndex);
285 sal_Int32 nStop = std::max(i_nEndIndex, i_nBeginIndex);
290 if( nStop > nEntryCount-1 )
291 nStop = nEntryCount-1;
294 else if( nStart > nEntryCount-1 )
295 nStart = nEntryCount-1;
297 sal_Int32
nIndex = nStart;
301 if (nHeight > ::std::numeric_limits<tools::Long>::max() - nPosHeight)
303 SAL_WARN(
"vcl",
"ImplEntryList::GetAddedHeight: truncated");
306 nHeight += nPosHeight;
312 return i_nEndIndex > i_nBeginIndex ? nHeight : -nHeight;
326 aEntryText = pImplEntry->
maStr;
335 bImage = !!pImplEntry->
maImage;
358 return pImplEntry ? pImplEntry->
mpUserData :
nullptr;
370 sal_Int32 nSelCount = 0;
391 for ( sal_Int32
n = 0;
n < nEntryCount;
n++ )
449 maQuickSelectionEngine( *this )
568struct ImplEntryMetrics
592 std::unique_ptr<SalLayout> pLayout = pOutputDevice->
ImplLayout(
605 ImplEntryMetrics aMetrics;
606 aMetrics.bText = !rEntry.
maStr.isEmpty();
607 aMetrics.bImage = !!rEntry.
maImage;
608 aMetrics.nEntryWidth = 0;
609 aMetrics.nEntryHeight = 0;
610 aMetrics.nTextWidth = 0;
611 aMetrics.nImgWidth = 0;
612 aMetrics.nImgHeight = 0;
614 if ( aMetrics.bText )
625 aMetrics.nTextWidth = aTextRect.
GetWidth();
643 if ( aMetrics.bImage )
646 aMetrics.nImgWidth =
static_cast<sal_uInt16
>(
CalcZoom( aImgSz.
Width() ));
647 aMetrics.nImgHeight =
static_cast<sal_uInt16
>(
CalcZoom( aImgSz.
Height() ));
655 aMetrics.nEntryHeight = std::max( aMetrics.nImgHeight, aMetrics.nEntryHeight );
660 if (bIsUserDrawEnabled || aMetrics.bImage)
663 if (!bIsUserDrawEnabled && aMetrics.bText)
666 aMetrics.nEntryHeight );
669 if (!aMetrics.bText && !aMetrics.bImage && !bIsUserDrawEnabled)
681 rEntry.
mnHeight = aMetrics.nEntryHeight;
693 if ( nFirstMatchingEntryPos || !nMRUCount )
695 bool bSelectNewEntry =
false;
696 if ( nFirstMatchingEntryPos < nMRUCount )
700 if ( nFirstMatchingEntryPos == nSelected )
701 bSelectNewEntry =
true;
703 else if ( nMRUCount ==
GetEntryList().GetMaxMRUCount() )
783 sal_Int32 nSelect =
mnTop;
788 if (rPoint.
Y() <= nEntryHeight + nY)
793 if( pEntry ==
nullptr )
803 if( i_nEntry >=
mnTop )
830 if( nDiff > nWindowHeight &&
nPos >
mnTop )
983 bool bSelectionChanged =
false;
987 bool bFocusChanged =
false;
993 if( nSelect != nDeselect )
997 bFocusChanged =
true;
998 bSelectionChanged =
true;
1007 bool bSelect =
nPos == nSelect;
1011 bFocusChanged =
true;
1012 bSelectionChanged =
true;
1030 bFocusChanged =
true;
1031 bSelectionChanged =
true;
1037 bFocusChanged =
true;
1047 sal_Int32 nStart = std::min( nSelect, nAnchor );
1048 sal_Int32 nEnd = std::max( nSelect, nAnchor );
1049 for ( sal_Int32
n = nStart;
n <= nEnd;
n++ )
1054 bSelectionChanged =
true;
1062 if ( ( nLast > nSelect ) && ( nLast > nAnchor ) )
1064 for ( sal_Int32
n = nSelect+1;
n <= nLast;
n++ )
1069 bSelectionChanged =
true;
1073 else if ( ( nLast < nSelect ) && ( nLast < nAnchor ) )
1075 for ( sal_Int32
n = nLast;
n < nSelect;
n++ )
1080 bSelectionChanged =
true;
1092 bFocusChanged =
true;
1097 bFocusChanged =
true;
1100 if( bSelectionChanged )
1112 if (bSelectPosChange)
1119 return bSelectionChanged;
1158 bool bTrackOrQuickClick =
mbTrack;
1169 bTrackOrQuickClick =
true;
1174 if( bTrackOrQuickClick )
1178 bool bShift = aMEvt.
IsShift();
1179 bool bCtrl = aMEvt.
IsMod1();
1187 if( nSelect <
mnTop )
1256 bool bShift = aKeyCode.
IsShift();
1258 bool bMod2 = aKeyCode.
IsMod2();
1260 bool bHandleKey =
false;
1325 (
mnTop-nCurVis) : 0 );
1327 else if ( !bCtrl && !bMod2 )
1356 else if ( !bCtrl && !bMod2 )
1366 sal_Int32 nTmp = std::min( nCurVis,
nCount );
1372 nTmp =
static_cast<sal_Int32
>(nTmp2+(nCurVis-1) );
1408 else if ( !bCtrl && !bMod2 )
1430 if ( !bCtrl && !bMod2 )
1441 if ( !bCtrl && !bMod2 )
1486 for( sal_Int32
i = 0;
i < nEntryCount;
i++ )
1528 if(
SelectEntries( nSelect, eLET, bShift, bCtrl, bCurPosChange))
1548 if ( _nPos >= nEntryCount )
1560 return static_cast< sal_Int32
>(
reinterpret_cast< sal_Int64
>( _entry ) ) - 1;
1571 sal_Int32 nNextPos = lcl_getEntryPos( _currentEntry ) + 1;
1572 return lcl_getEntry(
GetEntryList(), nNextPos, _out_entryText );
1577 sal_Int32 nSelect = lcl_getEntryPos( _entry );
1677 rRenderContext.
DrawImage(aPtImg, aImage);
1683 rRenderContext.
DrawImage(aPtImg, aImgSz, aImage);
1689 if (nEdgeBlendingPercent && aImgSz.
Width() && aImgSz.
Height())
1693 const sal_uInt8 nAlpha((nEdgeBlendingPercent * 255) / 100);
1707 if (!
aStr.isEmpty())
1715 Size(nMaxWidth, nEntryHeight));
1737 Point aStartPos(0, nY);
1740 Point aEndPos(aStartPos);
1742 rRenderContext.
DrawLine(aStartPos, aEndPos);
1768 if (nY + nEntryHeight >= rRect.
Top() &&
1804 nEntries =
static_cast<sal_uInt16
>(
nCount);
1814 if ( bShowFocusRect )
1823 if ( bShowFocusRect )
1856 if( nTop > nLastEntry )
1862 if ( nTop ==
mnTop )
1879 sal_Int32
nPos = nEntryPos;
1906 nDiff = - std::min(
mnLeft, nAbs );
1913 mnLeft = sal::static_int_cast<sal_uInt16>(
mnLeft + nDiff);
2038 Control( pParent, nWinStyle ),
2150 if( nSet > mpVScrollBar->GetRangeMax() )
2151 mpVScrollBar->SetRangeMax( GetEntryList().GetEntryCount() );
2152 mpVScrollBar->SetThumbPos( GetTopEntry() );
2154 mpHScrollBar->SetThumbPos( GetLeftIndent() );
2156 maScrollHdl.Call(
this );
2161 sal_uInt16
nPos =
static_cast<sal_uInt16
>(pSB->GetThumbPos());
2162 if( pSB == mpVScrollBar )
2163 SetTopEntry(
nPos );
2164 else if( pSB == mpHScrollBar )
2165 SetLeftIndent(
nPos );
2172 bool bArrange =
false;
2179 if( nEntries > nMaxVisEntries )
2208 if( nWidth < nMaxWidth )
2217 if( nEntries > nMaxVisEntries )
2232 sal_uInt16 nMaxLI =
static_cast<sal_uInt16
>(nMaxWidth - nWidth);
2282 Size aInnerSz( aOutSz );
2288 Point aWinPos( 0, 0 );
2402 return bDone || Window::EventNotify( rNEvt );
2436 sal_Int32 nMRUCount = 0;
2468 return aEntries.makeStringAndClear();
2511 Control ( pParent, nWinStyle )
2546 bool bNativeOK =
false;
2570 sal_Int32 nLeft, nTop, nRight, nBottom;
2571 pWin->
GetBorder( nLeft, nTop, nRight, nBottom );
2572 Point aPoint( -nLeft, -nTop );
2601 nState, aControlValue, OUString(), aBackgroundColor);
2605 nState, aControlValue, OUString(), aBackgroundColor);
2610 if (bHasFocus && !
ImplGetSVData()->maNWFData.mbDDListBoxNoTextArea)
2684 if (bImage && !bLayout)
2696 rRenderContext.
DrawImage( aPtImg, *pImage, nStyle );
2702 rRenderContext.
DrawImage( aPtImg, aImgSz, *pImage, nStyle );
2707 if(nEdgeBlendingPercent)
2711 const sal_uInt8 nAlpha((nEdgeBlendingPercent * 255) / 100);
2725 if ( bImage && !bLayout )
2741 std::vector< tools::Rectangle >* pVector = bLayout ? &
mxLayoutData->m_aUnicodeBoundRects :
nullptr;
2742 OUString* pDisplayText = bLayout ? &
mxLayoutData->m_aDisplayText :
nullptr;
2743 rRenderContext.
DrawText( aTextRect,
maString, nTextStyle, pVector, pDisplayText );
2906 sal_Int32 nLeft, nTop, nRight, nBottom;
2907 GetBorder( nLeft, nTop, nRight, nBottom );
2926 if ( ( aFloatSz.
Height() < nMaxHeight ) || (
mnDDLineCount && ( mnDDLineCount < mpImplLB->GetEntryList().GetEntryCount() ) ) )
2934 if (aFloatSz.
Width() > nDesktopWidth)
2936 aFloatSz.
setWidth( nDesktopWidth );
2939 if ( aFloatSz.
Height() > nMaxHeight )
2955 if ( nInnerHeight % nEntryHeight )
2957 nInnerHeight /= nEntryHeight;
2959 nInnerHeight *= nEntryHeight;
2960 aFloatSz.
setHeight( nInnerHeight + nTop + nBottom );
2995 const sal_Int32 nLeft = 4, nTop = 4, nRight = 4, nBottom = 4;
3010 pGrandparentOutDev->
ReMirror( aRect );
3018 if( bStartTracking )
BitmapEx createBlendFrame(const Size &rSize, sal_uInt8 nAlpha, Color aColorTopLeft, Color aColorBottomRight)
Create a blend frame as BitmapEx.
const vcl::I18nHelper & GetLocaleI18nHelper() const
const StyleSettings & GetStyleSettings() const
void SetStyleSettings(const StyleSettings &rSet)
static const AllSettings & GetSettings()
Gets the application's settings.
CommandEventId GetCommand() const
const CommandWheelData * GetWheelData() const
std::optional< vcl::ControlLayoutData > mxLayoutData
SAL_DLLPRIVATE void ImplClearLayoutData() const
virtual void StateChanged(StateChangedType nStateChange) override
virtual void Resize() override
virtual void EnableRTL(bool bEnable=true) override
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
DataChangedEventType GetType() const
AllSettingsFlags GetFlags() const
void StartPopupMode(const tools::Rectangle &rRect, FloatWinPopupFlags nFlags)
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
static Point ImplCalcPos(vcl::Window *pWindow, const tools::Rectangle &rRect, FloatWinPopupFlags nFlags, sal_uInt16 &rArrangeIndex, Point *pLOKTwipsPos=nullptr)
void EndPopupMode(FloatWinPopupEndFlags nFlags=FloatWinPopupEndFlags::NONE)
bool IsInPopupMode() const
Size GetSizePixel() const
Link< void *, void > maMBDownHdl
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
ImplBtn(vcl::Window *pParent, WinBits nWinStyle)
void SetEntryFlags(sal_Int32 nPos, ListBoxEntryFlags nFlags)
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)
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
void * GetEntryData(sal_Int32 nPos) const
ImplEntryList(vcl::Window *pWindow)
sal_Int32 GetEntryCount() const
sal_Int32 GetMRUCount() const
void SetLastSelected(sal_Int32 nPos)
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
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)
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
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
tools::Long mnMaxImgTxtWidth
Maximum width of a text item.
sal_Int32 mnTrackingSaveSelection
Selection before Tracking();.
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
tools::Long mnLeft
output from column on
ImplListBoxWindow(vcl::Window *pParent, WinBits nWinStyle)
bool mbRight
right align Text output
tools::Rectangle GetBoundingRectangle(sal_Int32 nItem) 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.
bool mbGrabFocus
Grab focus at MBDown.
bool IsMouseMoveSelect() const
tools::Rectangle maFocusRect
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...
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
bool mbCenter
center Text output
void SetEdgeBlending(bool bNew)
Link< UserDrawEvent *, void > maUserDrawHdl
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 DrawEntry(vcl::RenderContext &rRenderContext, sal_Int32 nPos, bool bDrawImage, bool bDrawText)
bool mbMouseMoveSelect
Select at MouseMove.
void RemoveEntry(sal_Int32 nPos)
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.
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 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)
tools::Long mnTextHeight
text height
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
bool GetEdgeBlending() const
bool IsUserDrawEnabled() const
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 mbIsDropdown
Listbox is actually a dropdown (either combobox, or popup window treated as dropdown)
VclPtr< ScrollBar > mpHScrollBar
ImplListBoxWindow * GetMainWindow()
virtual void StateChanged(StateChangedType nType) override
void ImplResizeControls()
tools::Long GetMaxEntryWidth() const
Size CalcSize(sal_Int32 nMaxLines) const
void ImplInitScrollBars()
VclPtr< ScrollBar > mpVScrollBar
void SetSeparatorPos(sal_Int32 n)
Removes existing separators, and sets the position of the one and only separator.
void SelectEntry(sal_Int32 nPos, bool bSelect)
void RemoveEntry(sal_Int32 nPos)
OUString GetMRUEntries(sal_Unicode cSep) const
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
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)
VclPtr< ScrollBarBox > mpScrollBarBox
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
void SetTopEntry(sal_Int32 nTop)
const ImplEntryList & GetEntryList() const
bool HandleWheelAsCursorTravel(const CommandEvent &rCEvt, Control &rControl)
void ShowProminentEntry(sal_Int32 nPos)
void SetLeftIndent(sal_uInt16 n)
bool GetEdgeBlending() const
tools::Long GetEntryHeightWithMargin() const
sal_Int32 InsertEntry(sal_Int32 nPos, const OUString &rStr)
void ImplCheckScrollBars()
void SetEdgeBlending(bool bNew)
ImplListBox(vcl::Window *pParent, WinBits nWinStyle)
tools::Long GetLeftIndent() const
virtual void GetFocus() override
tools::Rectangle maFocusRect
Link< void *, void > maMBDownHdl
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
bool GetEdgeBlending() const
void DrawEntry(vcl::RenderContext &rRenderContext, bool bLayout)
virtual void Resize() override
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
const vcl::KeyCode & GetKeyCode() const
bool IsLeaveWindow() const
sal_uInt16 GetModifier() const
sal_uInt16 GetClicks() const
const Point & GetPosPixel() const
const CommandEvent * GetCommandEvent() const
NotifyEventType GetType() const
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
void DrawBitmapEx(const Point &rDestPt, const BitmapEx &rBitmapEx)
SAL_DLLPRIVATE bool ImplIsAntiparallel() const
void DrawRect(const tools::Rectangle &rRect)
void DrawLine(const Point &rStartPt, const Point &rEndPt)
void SetTextColor(const Color &rColor)
void DrawImage(const Point &rPos, const Image &rImage, DrawImageFlags nStyle=DrawImageFlags::NONE)
This is an overloaded member function, provided for convenience. It differs from the above function o...
SAL_DLLPRIVATE void ReMirror(Point &rPoint) const
const Color & GetLineColor() const
std::unique_ptr< SalLayout > ImplLayout(const OUString &, sal_Int32 nIndex, sal_Int32 nLen, const Point &rLogicPos=Point(0, 0), tools::Long nLogicWidth=0, KernArraySpan aKernArray=KernArraySpan(), o3tl::span< const sal_Bool > pKashidaArray={}, SalLayoutFlags flags=SalLayoutFlags::NONE, vcl::text::TextLayoutCache const *=nullptr, const SalLayoutGlyphs *pGlyphs=nullptr) const
bool DrawNativeControl(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, const OUString &aCaption, const Color &rBackgroundColor=COL_AUTO)
Request rendering of a particular control and/or part.
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
const AllSettings & GetSettings() const
bool IsNativeControlSupported(ControlType nType, ControlPart nPart) const
Query the platform layer for control support.
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
const Color & GetListBoxWindowHighlightColor() const
sal_Int32 GetScrollBarSize() const
const Color & GetListBoxWindowTextColor() const
const Color & GetFieldTextColor() const
void SetHighlightTextColor(const Color &rColor)
const Color & GetFieldColor() const
void SetListBoxWindowHighlightColor(const Color &rColor)
void SetListBoxWindowHighlightTextColor(const Color &rColor)
const vcl::Font & GetFieldFont() const
const Color & GetListBoxWindowHighlightTextColor() const
void SetHighlightColor(const Color &rColor)
const Color & GetEdgeBlendingTopLeftColor() const
const Color & GetHighlightColor() const
const Color & GetHighlightTextColor() const
sal_uInt16 GetEdgeBlending() const
const Color & GetDisableColor() const
const Color & GetButtonTextColor() const
const Color & GetListBoxWindowBackgroundColor() const
const Color & GetButtonRolloverTextColor() const
const Color & GetFieldRolloverTextColor() const
const Color & GetEdgeBlendingBottomRightColor() const
virtual bool PreNotify(NotifyEvent &rNEvt) override
virtual void Resize() override
bool IsTrackingEnded() const
bool IsTrackingCanceled() const
const MouseEvent & GetMouseEvent() const
Event to pass information for UserDraw() handling eg. in comboboxes.
A thin wrapper around rtl::Reference to implement the acquire and dispose semantics we want for refer...
static VclPtr< reference_type > Create(Arg &&... arg)
A construction helper for VclPtr.
sal_Int32 compare(const OUString &rLHS, const OUString &rRHS) const
static OUString filterFormattingChars(const OUString &)
bool MatchString(const OUString &rStr1, const OUString &rStr2) const
sal_uInt16 GetCode() const
sal_uInt16 GetModifier() const
bool HandleKeyEvent(const KeyEvent &_rKEvt)
Point OutputToScreenPixel(const Point &rPos) const
tools::Rectangle GetTextRect(const tools::Rectangle &rRect, const OUString &rStr, DrawTextFlags nStyle=DrawTextFlags::WordBreak, TextRectInfo *pInfo=nullptr, const vcl::ITextLayout *_pTextLayout=nullptr) const
const Wallpaper & GetBackground() const
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
Width of the text.
void SetUpdateMode(bool bUpdate)
bool IsNativeWidgetEnabled() const
bool IsReallyVisible() const
void StartTracking(StartTrackingFlags nFlags=StartTrackingFlags::NONE)
vcl::Window * GetParent() const
void SetControlForeground()
bool HasChildPathFocus(bool bSystemWindow=false) const
tools::Rectangle GetDesktopRectPixel() const
bool HandleScrollCommand(const CommandEvent &rCmd, Scrollable *pHScrl, Scrollable *pVScrl)
virtual const Wallpaper & GetDisplayBackground() const
bool SupportsDoubleBuffering() const
Can the widget derived from this Window do the double-buffering via RenderContext properly?
virtual void SetSizePixel(const Size &rNewSize)
void GetBorder(sal_Int32 &rLeftBorder, sal_Int32 &rTopBorder, sal_Int32 &rRightBorder, sal_Int32 &rBottomBorder) const
tools::Long CalcZoom(tools::Long n) const
vcl::Window * GetWindow(GetWindowType nType) const
SAL_DLLPRIVATE vcl::Window * ImplGetBorderWindow() const
const Color & GetControlForeground() const
void SetControlBackground()
bool IsUpdateMode() const
virtual Point GetPosPixel() const
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
void Enable(bool bEnable=true, bool bChild=true)
bool IsControlForeground() const
const Fraction & GetZoom() const
const AllSettings & GetSettings() const
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
virtual void KeyInput(const KeyEvent &rKEvt)
bool IsNativeControlSupported(ControlType nType, ControlPart nPart) const
Query the platform layer for control support.
vcl::Font GetControlFont() const
::OutputDevice const * GetOutDev() const
virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags=PosSizeFlags::All)
void SetAccessibleRole(sal_uInt16 nRole)
SAL_DLLPRIVATE WindowImpl * ImplGetWindowImpl() const
void SetSettings(const AllSettings &rSettings)
void SetZoom(const Fraction &rZoom)
virtual void Scroll(tools::Long nHorzScroll, tools::Long nVertScroll, ScrollFlags nFlags=ScrollFlags::NONE)
virtual void ShowFocus(const tools::Rectangle &rRect)
bool IsRTLEnabled() const
Point PixelToLogic(const Point &rDevicePt) const
virtual Size GetSizePixel() const
Size GetOutputSizePixel() const
bool IsControlBackground() const
virtual void DataChanged(const DataChangedEvent &rDCEvt)
const Color & GetControlBackground() const
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
virtual void SetPosPixel(const Point &rNewPos)
void ApplyControlFont(vcl::RenderContext &rRenderContext, const vcl::Font &rDefaultFont)
void SetType(WindowType nType)
void ApplyControlForeground(vcl::RenderContext &rRenderContext, const Color &rDefaultColor)
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
SAL_DLLPRIVATE void CompatStateChanged(StateChangedType nStateChange)
constexpr ::Color COL_GRAY(0x80, 0x80, 0x80)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr ::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
ScXMLEditAttributeMap::Entry const aEntries[]
constexpr tools::Long gnBorder
IMPL_LINK(ImplListBox, ScrollBarHdl, ScrollBar *, pSB, void)
#define MULTILINE_ENTRY_DRAW_FLAGS
IMPL_LINK_NOARG(ImplListBox, MRUChanged, LinkParamNone *, void)
void ImplInitDropDownButton(PushButton *pButton)
constexpr sal_uInt16 KEY_RETURN
constexpr sal_uInt16 KEY_HOME
constexpr sal_uInt16 KEY_LEFT
constexpr sal_uInt16 KEY_PAGEDOWN
constexpr sal_uInt16 KEY_UP
constexpr sal_uInt16 KEY_A
constexpr sal_uInt16 KEY_RIGHT
constexpr sal_uInt16 KEY_DOWN
constexpr sal_uInt16 KEY_SPACE
constexpr sal_uInt16 KEY_PAGEUP
constexpr sal_uInt16 KEY_END
#define LINK(Instance, Class, Member)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
#define LISTBOX_ENTRY_NOTFOUND
#define LISTBOX_MAX_ENTRIES
@ DrawDisabled
this flags lets the item be drawn disabled (e.g.
@ DisableSelection
this flag disables a selection of an entry completely.
@ MultiLine
this flag can be used to make an entry multiline capable A normal entry is single line and will there...
std::unique_ptr< sal_Int32[]> pData
tools::Long const nBorder
const LanguageTag & getLocale()
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
sal_Int32 NaturalSortCompare(const OUString &rA, const OUString &rB)
const void * StringEntryIdentifier
ListBoxEntryFlags mnFlags
SalLayoutGlyphs * GetTextGlyphs(const OutputDevice *pOutputDevice)
Computes maStr's text layout (glyphs), cached in maStrGlyphs.
tools::Long getHeightWithMargin() const
SalLayoutGlyphs maStrGlyphs
ImplSVData * ImplGetSVData()
@ Update
The invalidated area is updated immediately.
WinBits const WB_DROPDOWN
WinBits const WB_SYSTEMWINDOW
WinBits const WB_SIMPLEMODE
WinBits const WB_AUTOHSCROLL
WinBits const WB_WORDBREAK
WinBits const WB_NOBORDER
WinBits const WB_NOSHADOW