37#include <bitmaps.hlst>
44#include <unordered_map>
74 , mbFullVisible(false)
89#define TAB_PAGERECT 0xFFFF
204 if (pParent && pParent->IsDialog())
220 if (item.id() ==
nId)
231 Size aImageSize( 0, 0 );
252 aBoundingRgn, aContentRgn ) )
263 if ( aSize.
Width()+4 >= nMaxWidth )
265 OUString aAppendStr(
"...");
269 if (pItem->
maFormatText.getLength() > aAppendStr.getLength())
275 while ( (aSize.
Width()+4 >= nMaxWidth) && (pItem->
maFormatText.getLength() > aAppendStr.getLength()) );
276 if ( aSize.
Width()+4 >= nMaxWidth )
298 static std::deque<size_t>
GetEndOfLineIndexes(
const std::vector<sal_Int32>& rWidthsOf, sal_Int32 nLineWidth)
302 size_t nWidthsCount = rWidthsOf.size();
303 std::vector<sal_Int32> aCosts(nWidthsCount * nWidthsCount);
307 for (
size_t i = 0;
i < nWidthsCount; ++
i)
309 for (
size_t j = 0; j < nWidthsCount; ++j)
314 for (
size_t k =
i; k <= j; ++k)
317 aCosts[j * nWidthsCount +
i] = c;
326 std::vector<sal_Int32> aFunction(nWidthsCount);
327 std::vector<sal_Int32> aWrapPoints(nWidthsCount);
330 for (
size_t j = 0; j < nWidthsCount; ++j)
332 aFunction[j] = aCosts[j * nWidthsCount];
335 for (
size_t k = 0; k < j; ++k)
341 s = aFunction[k] + aCosts[j * nWidthsCount + k + 1];
342 if (aFunction[j] > s)
345 aWrapPoints[j] = k + 1;
351 std::deque<size_t> aSolution;
358 size_t j = nWidthsCount - 1;
361 aSolution.push_front(j);
364 j = aWrapPoints[j] - 1;
376 int nRightSpace = nMaxWidth;
377 for (
auto const& item : pTabCtrlData->
maItemList)
379 if (!item.m_bVisible)
381 nRightSpace -= item.maRect.GetWidth();
387 if (!item.m_bVisible)
389 item.maRect.AdjustLeft(nRightSpace);
390 item.maRect.AdjustRight(nRightSpace);
410 std::vector<sal_Int32> aWidths;
413 if (!item.m_bVisible)
424 sal_uInt16 nLines = 0;
425 sal_uInt16 nCurLine = 0;
428 sal_uInt16 nLinePosAry[101];
429 nLineWidthAry[0] = 0;
436 if (!item.m_bVisible)
441 bool bNewLine =
false;
442 if (!aBreakIndexes.empty() &&
nIndex > aBreakIndexes.front())
444 aBreakIndexes.pop_front();
448 if ( bNewLine && (nWidth > 2+nOffsetX) )
456 nLineWidthAry[nLines] = 0;
457 nLinePosAry[nLines] =
nIndex;
463 item.maRect = aNewRect;
464 item.mnLine = nLines;
465 item.mbFullVisible =
true;
467 nLineWidthAry[nLines] += aSize.
Width();
482 if (!item.m_bVisible)
484 nIH = item.maRect.Bottom() - 1;
488 for ( sal_uInt16
i = 0;
i < nLines+1;
i++ )
491 nLineHeightAry[
i] = nIH*(nLines-(nCurLine-
i));
493 nLineHeightAry[
i] = nIH*(
i-nCurLine-1);
496 nLinePosAry[nLines+1] =
static_cast<sal_uInt16
>(
mpTabCtrlData->maItemList.size());
507 if (!item.m_bVisible)
510 if (
i == nLinePosAry[
n] )
516 if( nLinePosAry[
n+1]-
i > 0 )
518 nDX = ( nWidth - nOffsetX - nLineWidthAry[
n] ) / ( nLinePosAry[
n+1] -
i );
519 nModDX = ( nWidth - nOffsetX - nLineWidthAry[
n] ) % ( nLinePosAry[
n+1] -
i );
530 item.maRect.AdjustLeft(nIDX );
531 item.maRect.AdjustRight(nIDX + nDX );
532 item.maRect.SetTop( nLineHeightAry[
n-1] );
533 item.maRect.SetBottom(nLineHeightAry[
n-1] + nIH - 1);
539 item.maRect.AdjustRight( 1 );
556 nWidth = aWinSize.
Width();
558 nHeight = aWinSize.
Height();
564 return (nW > 0 && nH > 0)
588 return (nW > 0 && nH > 0)
600 if ((nWidth <= 1) || (nHeight <= 0) || !pItem || !pItem->
m_bVisible)
638 if ( !pOldItem || !pItem || (pOldItem->
mnLine != pItem->
mnLine) )
659 if ( pOldPage == pPage )
763 Size aImageSize( 0, 0 );
797 aRect.
SetTop( nYPos - 2 );
805 bool bFirstInGroup,
bool bLastInGroup )
814 bool bLeftBorder =
true;
815 bool bRightBorder =
true;
817 bool bNativeOK =
false;
819 sal_uInt16 nOff2 = 0;
820 sal_uInt16 nOff3 = 0;
838 if (aLeftTestPos.Y() == rCurRect.
Bottom())
840 aLeftTestPos.AdjustX( -2 );
841 if (rCurRect.
Contains(aLeftTestPos))
843 aRightTestPos.AdjustX(2 );
844 if (rCurRect.
Contains(aRightTestPos))
845 bRightBorder =
false;
849 if (rCurRect.
Contains(aLeftTestPos))
851 if (rCurRect.
Contains(aRightTestPos))
871 if ((&item != pItem) && item.m_bVisible && item.maRect.Contains(
GetPointerPosPixel()))
898 aCtrlRegion,
nState, tiValue, OUString() );
910 Point(aRect.
Left() - nOff2, nLeftBottom - 1));
919 Point(aRect.
Right() + nOff2 - 2, nRightBottom - 1));
923 Point(aRect.
Right() + nOff2 - 1, nRightBottom - 1));
934 Point(aRect.
Left() - nOff2, nLeftBottom - 1));
941 Point(aRect.
Right() + nOff2 - 1, nRightBottom - 1));
953 Size aImageSize(0, 0);
980 nXPos + aImageSize.
Width() + nTextWidth, nYPos + nTextHeight);
1003 sal_uInt16 nKeyCode = aKeyCode.
GetCode();
1031 SelectTabPage( GetPageId( mpTabCtrlData->mpListBox->GetSelectedEntryPos() ) );
1039 if ( !IsWindowOrChild( rEvent.GetWindow() ) )
1042 ImplHandleKeyEvent( *pKeyEvent );
1064 sal_uInt16 nKeyCode = aKeyCode.
GetCode();
1121 bool bNoTabPage =
false;
1123 if (!pCurPage || !pCurPage->
IsVisible())
1141 if (!item.m_bVisible)
1143 nRight = std::max(nRight, item.maRect.Right());
1144 nLeft = std::min(nLeft, item.maRect.Left());
1150 if (bPaneWithHeader)
1163 aRect,
nState, aTabPaneValue, OUString());
1168 aHeaderRect,
nState, aTabPaneValue, OUString());
1179 aCurRect = pCurItem->
maRect;
1233 pLastTab = pFirstTab +
mpTabCtrlData->maItemList.size() - 1;
1239 pFirstTab = pLastTab +
mpTabCtrlData->maItemList.size() - 1;
1243 while (idx < mpTabCtrlData->maItemList.size())
1248 ImplDrawItem(rRenderContext, pItem, aCurRect, pItem == pFirstTab, pItem == pLastTab);
1257 ImplDrawItem(rRenderContext, pCurItem, aCurRect, pCurItem == pFirstTab, pCurItem == pLastTab);
1278 if( nPrefWidth > aTabCtrlSize.
Width() )
1279 nPrefWidth = aTabCtrlSize.
Width();
1281 Point aNewPos( (aTabCtrlSize.
Width() - nPrefWidth) / 2, 0 );
1282 mpTabCtrlData->mpListBox->SetPosSizePixel( aNewPos, aNewSize );
1291 Size aNewSize = rAllocation;
1295 if (!item.m_bVisible)
1297 if (!item.mbFullVisible || (item.maRect.Right()-2 >= nNewWidth))
1330 Window::SetPosSizePixel(rNewPos, rNewSize);
1338 Window::SetSizePixel(rNewSize);
1346 Window::SetPosPixel(rPos);
1402 if ( !
aStr.isEmpty() )
1407 aItemRect.
SetTop( aPt.Y() );
1420 const OUString& rStr = pItem->
maText;
1426 aItemRect.
SetTop( aPt.Y() );
1430 if ( !rStr.isEmpty() )
1444 const OUString& rHelpText = pItem->
maHelpText;
1445 if (!rHelpText.isEmpty())
1450 aItemRect.
SetTop( aPt.Y() );
1487 aMenu->CheckItem(item.id());
1488 aMenu->SetHelpId(item.id(), {});
1491 sal_uInt16
nId = aMenu->Execute(
this, aMenuPos );
1554 if (item.m_bVisible && item.maRect.Contains(rPt))
1562 assert(nFound <= 1);
1563 return nFound == 1 ? pFoundItem :
nullptr;
1590 aClipRgn.
Union( aRect );
1602 aClipRgn.
Union( aRect );
1639 Size aNewSize( rSize );
1644 Window::SetOutputSizePixel( aNewSize );
1652 "TabControl::InsertPage(): PageId already exists" );
1665 std::vector< ImplTabItem >::iterator new_it =
1706 std::vector< ImplTabItem >::iterator it =
mpTabCtrlData->maItemList.begin() +
nPos;
1716 if ( bIsCurrentPage )
1747 if (!pItem || pItem->
m_bEnabled == i_bEnable)
1791 return static_cast<sal_uInt16
>(
mpTabCtrlData->maItemList.size());
1803 sal_uInt16
nPos = 0;
1818 const auto it = std::find_if(rList.begin(), rList.end(), [&rPos, &winSize,
this](
const auto &item) {
1819 return const_cast<TabControl*>(this)->ImplGetTabRect(&item, winSize.Width(), winSize.Height()).Contains(rPos); });
1820 return (it != rList.end()) ? it->id() : 0;
1826 const auto it = std::find_if(rList.begin(), rList.end(), [&rName](
const auto &item) {
1827 return item.maTabName == rName; });
1828 return (it != rList.end()) ? it->id() : 0;
1935 if ( !pItem || pItem->
maText == rText )
2049 std::unordered_map< int, int >::const_iterator it =
mpTabCtrlData->maLayoutPageIdToLine.find(
static_cast<int>(
nPageId) );
2053 if( (aPair.
B() - aPair.
A()) >=
nIndex )
2076 while( ++nLine < nLines )
2082 rPageId =
static_cast<sal_uInt16
>(
mpTabCtrlData->maLayoutLineToPageId[ nLine ]);
2112 Size aOptimalPageSize(0, 0);
2117 const TabPage *pPage = item.mpTabPage;
2125 pPage = item.mpTabPage;
2133 if (aPageSize.
Width() > aOptimalPageSize.
Width())
2149 tools::Long nTabLabelsBottom = 0, nTabLabelsRight = 0;
2152 for (sal_uInt16
nPos(0), sizeList(
static_cast <sal_uInt16
> (
mpTabCtrlData->maItemList.size()));
2158 if (aTabRect.
Bottom() > nTabLabelsBottom)
2160 nTabLabelsBottom = aTabRect.
Bottom();
2161 nHeaderHeight = nTabLabelsBottom;
2163 if (!aTabRect.
IsEmpty() && aTabRect.
Right() > nTabLabelsRight)
2164 nTabLabelsRight = aTabRect.
Right();
2168 Size aOptimalSize(aOptimalPageSize);
2170 aOptimalSize.
setWidth( std::max(nTabLabelsRight, aOptimalSize.
Width()) );
2175 return aOptimalSize;
2180 sal_uInt16 nHeaderHeight;
2192 Window::queue_resize(eReason);
2197 std::vector<sal_uInt16> aIDs;
2200 aIDs.push_back(item.id());
2208 if (rKey ==
"show-tabs")
2226 rJsonWriter.
put(
"type",
"tabcontrol");
2230 auto childrenNode = rJsonWriter.
startArray(
"children");
2241 rJsonWriter.
put(
"hidden",
true);
2246 auto tabsNode = rJsonWriter.
startArray(
"tabs");
2251 rJsonWriter.
put(
"id",
id);
2257sal_uInt16 NotebookbarTabControlBase::m_nHeaderHeight = 0;
2261 m_aIconClickHdl.Call(
static_cast<NotebookBar*
>(GetParent()->GetParent()));
2264NotebookbarTabControlBase::NotebookbarTabControlBase(
vcl::Window* pParent)
2266 , bLastContextWasSupported(true)
2267 , eLastContext(
vcl::EnumContext::Context::
Any)
2270 m_pOpenMenu->SetClickHdl(
LINK(
this, NotebookbarTabControlBase, OpenMenu));
2272 m_pOpenMenu->SetSizePixel(m_pOpenMenu->GetOptimalSize());
2273 m_pOpenMenu->Show();
2276NotebookbarTabControlBase::~NotebookbarTabControlBase()
2283 if (eLastContext == eContext)
2286 bool bHandled =
false;
2288 for (
int nChild = 0; nChild < GetPageCount(); ++nChild)
2291 TabPage* pPage = GetTabPage(nPageId);
2297 if (!bHandled && bLastContextWasSupported
2307 bLastContextWasSupported =
true;
2313 bLastContextWasSupported =
false;
2314 eLastContext = eContext;
2322void NotebookbarTabControlBase::dispose()
2324 m_pShortcuts.disposeAndClear();
2325 m_pOpenMenu.disposeAndClear();
2329void NotebookbarTabControlBase::SetToolBox(
ToolBox* pToolBox )
2331 m_pShortcuts.set( pToolBox );
2336 m_aIconClickHdl = aHdl;
2346void NotebookbarTabControlBase::ImplActivateTabPage(
bool bNext )
2348 const sal_uInt16 nOldPos = GetPagePos(GetCurPageId());
2349 bool bFound =
false;
2350 sal_Int32 nCurPos = nOldPos;
2354 for (nCurPos++; nCurPos < GetPageCount(); nCurPos++)
2360 for (nCurPos--; nCurPos >= 0; nCurPos--)
2370sal_uInt16 NotebookbarTabControlBase::GetHeaderHeight()
2372 return m_nHeaderHeight;
2375bool NotebookbarTabControlBase::ImplPlaceTabs(
tools::Long nWidth )
2379 if ( mpTabCtrlData->maItemList.empty() )
2381 if (!m_pOpenMenu || m_pOpenMenu->isDisposed())
2384 const tools::Long nHamburgerWidth = m_pOpenMenu->GetSizePixel().Width();
2386 tools::Long nShortcutsWidth = m_pShortcuts !=
nullptr ? m_pShortcuts->GetSizePixel().getWidth() + 1 : 0;
2395 for (
auto & item : mpTabCtrlData->maItemList)
2398 if (item.m_bVisible)
2400 nTabWidth = ImplGetItemSize(&item, nMaxWidth).getWidth();
2401 if (!item.maText.isEmpty() && nTabWidth < 100)
2404 nFullWidth += nTabWidth;
2411 nLineWidthAry[0] = 0;
2413 for (
auto & item : mpTabCtrlData->maItemList)
2415 if (!item.m_bVisible)
2418 Size aSize = ImplGetItemSize( &item, nMaxWidth );
2421 if( nFullWidth < nMaxWidth && !item.maText.isEmpty() && aSize.
getWidth() < 100)
2424 if( !item.maText.isEmpty() && aSize.
getHeight() < 28 )
2428 if ( mbSmallInvalidate && (item.maRect != aNewRect) )
2429 mbSmallInvalidate =
false;
2431 item.maRect = aNewRect;
2433 item.mbFullVisible =
true;
2435 nLineWidthAry[0] += aSize.
Width();
2436 nX += aSize.
Width();
2445 tools::Long nPosY = (m_nHeaderHeight - m_pShortcuts->GetSizePixel().getHeight()) / 2;
2446 m_pShortcuts->SetPosPixel(
Point(0, nPosY));
2449 tools::Long nPosY = (m_nHeaderHeight - m_pOpenMenu->GetSizePixel().getHeight()) / 2;
2451 m_pOpenMenu->SetPosPixel(
Point(nWidth - nHamburgerWidth, nPosY));
2456Size NotebookbarTabControlBase::calculateRequisition()
const
2461Control* NotebookbarTabControlBase::GetOpenMenu()
static bool toBool(std::string_view rValue)
const StyleSettings & GetStyleSettings() const
CommandEventId GetCommand() const
const Point & GetMousePosPixel() const
bool IsMouseEvent() const
std::optional< vcl::ControlLayoutData > mxLayoutData
SAL_DLLPRIVATE void ImplClearLayoutData() const
tools::Rectangle DrawControlText(OutputDevice &_rTargetDevice, const tools::Rectangle &_rRect, const OUString &_rStr, DrawTextFlags _nStyle, std::vector< tools::Rectangle > *_pVector, OUString *_pDisplayText, const Size *i_pDeviceSize=nullptr) const
draws the given text onto the given device
virtual bool EventNotify(NotifyEvent &rNEvt) override
virtual void StateChanged(StateChangedType nStateChange) override
bool HasLayoutData() const
determines whether we currently have layout data
void CallEventListeners(VclEventId nEvent, void *pData=nullptr)
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
HelpEventMode GetMode() const
bool KeyboardActivated() const
const Point & GetMousePosPixel() const
static void ShowQuickHelp(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rHelpText, QuickHelpFlags nStyle=QuickHelpFlags::NONE)
static void ShowBalloon(vcl::Window *pParent, const Point &rScreenPos, const tools::Rectangle &, const OUString &rHelpText)
Size GetSizePixel() const
ImplTabItem(sal_uInt16 nId)
OUString maAccessibleName
bool m_bVisible
the tab / page can be visible
VclPtr< TabPage > mpTabPage
bool m_bEnabled
the tab / page is selectable
OUString maAccessibleDescription
const vcl::KeyCode & GetKeyCode() const
A widget used to choose from a list of items and which has no entry.
bool IsEnterWindow() const
bool IsLeaveWindow() const
sal_uInt16 GetButtons() const
const Point & GetPosPixel() const
bool IsModifierChanged() const
This implements Widget Layout-based notebook-like menu bar.
const KeyEvent * GetKeyEvent() const
const MouseEvent * GetMouseEvent() const
NotifyEventType GetType() const
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
virtual vcl::Region GetActiveClipRegion() const
tools::Long GetCtrlTextWidth(const OUString &rStr, const SalLayoutGlyphs *pLayoutCache=nullptr) const
const vcl::Font & GetFont() const
void SetFont(const vcl::Font &rNewFont)
void DrawLine(const Point &rStartPt, const Point &rEndPt)
void SetTextColor(const Color &rColor)
void DrawPixel(const Point &rPt)
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...
const Color & GetTextColor() const
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
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.
const AllSettings & GetSettings() const
bool IsNativeControlSupported(ControlType nType, ControlPart nPart) const
Query the platform layer for control support.
A construction helper for ScopedVclPtr.
constexpr tools::Long getHeight() const
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
constexpr tools::Long getWidth() const
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
const Color & GetDarkShadowColor() const
const Color & GetShadowColor() const
StyleSettingsOptions GetOptions() const
const Color & GetTabRolloverTextColor() const
const Color & GetTabTextColor() const
const vcl::Font & GetTabFont() const
const Color & GetLightColor() const
const Color & GetDialogColor() const
const Color & GetTabHighlightTextColor() const
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
virtual void FillLayoutData() const override
sal_uInt16 GetPageCount() const
virtual bool EventNotify(NotifyEvent &rNEvt) override
tools::Long GetIndexForPoint(const Point &rPoint, sal_uInt16 &rPageId) const
virtual Size calculateRequisition() const
virtual void RequestHelp(const HelpEvent &rHEvt) override
tools::Rectangle GetTabBounds(sal_uInt16 nPageId) const
SAL_DLLPRIVATE Size ImplGetItemSize(ImplTabItem *pItem, tools::Long nMaxWidth)
virtual void GetFocus() override
Link< TabControl *, bool > maDeactivateHdl
void setAllocation(const Size &rAllocation)
std::vector< sal_uInt16 > GetPageIDs() const
virtual void StateChanged(StateChangedType nType) override
virtual const Color & GetCanonicalTextColor(const StyleSettings &_rStyle) const override
TabControl(vcl::Window *pParent, WinBits nStyle=WB_STDTABCONTROL)
void SetAccessibleDescription(sal_uInt16 nItemId, const OUString &rStr)
void SetTabPage(sal_uInt16 nPageId, TabPage *pPage)
virtual ~TabControl() override
SAL_DLLPRIVATE void ImplChangeTabPage(sal_uInt16 nId, sal_uInt16 nOldId)
virtual const vcl::Font & GetCanonicalFont(const StyleSettings &_rStyle) const override
virtual bool set_property(const OUString &rKey, const OUString &rValue) override
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize) override
void SetAccessibleName(sal_uInt16 nItemId, const OUString &rStr)
std::unique_ptr< ImplTabCtrlData > mpTabCtrlData
virtual void SetSizePixel(const Size &rNewSize) override
virtual void Resize() override
sal_uInt16 GetPagePos(sal_uInt16 nPageId) const
void SetPageVisible(sal_uInt16 nPageId, bool bVisible=true)
OUString GetPageName(sal_uInt16 nPageId) const
SAL_DLLPRIVATE tools::Rectangle ImplGetTabRect(sal_uInt16 nPos, tools::Long nWidth=-1, tools::Long nHeight=-1)
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
SAL_DLLPRIVATE void ImplFreeLayoutData()
tools::Rectangle GetCharacterBounds(sal_uInt16 nPageId, tools::Long nIndex) const
SAL_DLLPRIVATE Size ImplCalculateRequisition(sal_uInt16 &nHeaderHeight) const
void SetPageName(sal_uInt16 nPageId, const OUString &rName) const
TabPage * GetTabPage(sal_uInt16 nPageId) const
virtual void ImplActivateTabPage(bool bNext)
void SetPageEnabled(sal_uInt16 nPageId, bool bEnable=true)
void SetCurPageId(sal_uInt16 nPageId)
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
void SetTabPageSizePixel(const Size &rSize)
virtual void SetPosPixel(const Point &rPos) override
virtual void LoseFocus() override
SAL_DLLPRIVATE bool ImplPosCurTabPage()
virtual Size GetOptimalSize() const override
void SelectTabPage(sal_uInt16 nPageId)
virtual void KeyInput(const KeyEvent &rKEvt) override
void SetPageImage(sal_uInt16 nPageId, const Image &rImage)
SAL_DLLPRIVATE void ImplInit(vcl::Window *pParent, WinBits nStyle)
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
SAL_DLLPRIVATE bool ImplHandleKeyEvent(const KeyEvent &rKeyEvent)
void InsertPage(sal_uInt16 nPageId, const OUString &rText, sal_uInt16 nPos=TAB_APPEND)
sal_uInt16 GetCurPageId() const
SAL_DLLPRIVATE ImplTabItem * ImplGetItem(sal_uInt16 nId) const
OUString const & GetPageText(sal_uInt16 nPageId) const
virtual bool ImplPlaceTabs(tools::Long nWidth)
sal_uInt16 GetPageId(sal_uInt16 nPos) const
SAL_DLLPRIVATE void ImplShowFocus()
void SetHelpText(sal_uInt16 nPageId, const OUString &rText)
virtual void Command(const CommandEvent &rCEvt) override
Link< TabControl *, void > maActivateHdl
void SetPageText(sal_uInt16 nPageId, const OUString &rText)
virtual bool PreNotify(NotifyEvent &rNEvt) override
virtual FactoryFunction GetUITestFactory() const override
virtual void DumpAsPropertyTree(tools::JsonWriter &) override
Dumps itself and potentially its children to a property tree, to be written easily to JSON.
SAL_DLLPRIVATE void ImplDrawItem(vcl::RenderContext &rRenderContext, ImplTabItem const *pItem, const tools::Rectangle &rCurRect, bool bFirstInGroup, bool bLastInGroup)
void RemovePage(sal_uInt16 nPageId)
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout) override
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize) override
static Size getLayoutRequisition(const vcl::Window &rWindow)
reference_type * get() const
Get the body.
static VclPtr< reference_type > Create(Arg &&... arg)
A construction helper for VclPtr.
void SetTransparent(bool bTransparent)
sal_uInt16 GetCode() const
void Intersect(const tools::Rectangle &rRegion)
void Union(const tools::Rectangle &rRegion)
Point OutputToScreenPixel(const Point &rPos) const
const Wallpaper & GetBackground() const
void SetFont(const vcl::Font &rNewFont)
void SetInputContext(const InputContext &rInputContext)
bool IsReallyVisible() const
vcl::Window * GetParent() const
virtual void RequestHelp(const HelpEvent &rHEvt)
SAL_DLLPRIVATE vcl::Window * ImplGetDlgWindow(sal_uInt16 n, GetDlgWindowType nType, sal_uInt16 nStart=0, sal_uInt16 nEnd=0xFFFF, sal_uInt16 *pIndex=nullptr)
bool HasChildPathFocus(bool bSystemWindow=false) const
Point LogicToPixel(const Point &rLogicPt) const
const OUString & get_id() const
Get the ID of the window.
virtual void Command(const CommandEvent &rCEvt)
void SetParentClipMode(ParentClipMode nMode=ParentClipMode::NONE)
bool IsUpdateMode() const
bool IsChildTransparentModeEnabled() const
bool GetNativeControlRegion(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion) const
Query the native control's actual drawing region (including adornment)
Point GetLastPointerPosPixel()
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
const AllSettings & GetSettings() const
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
virtual void KeyInput(const KeyEvent &rKEvt)
bool IsReallyShown() const
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
const OUString & GetHelpId() const
virtual bool PreNotify(NotifyEvent &rNEvt)
bool IsNativeControlSupported(ControlType nType, ControlPart nPart) const
Query the platform layer for control support.
::OutputDevice const * GetOutDev() const
const vcl::Font & GetFont() const
SAL_DLLPRIVATE WindowImpl * ImplGetWindowImpl() const
void AddChildEventListener(const Link< VclWindowEvent &, void > &rEventListener)
virtual void ShowFocus(const tools::Rectangle &rRect)
virtual void DumpAsPropertyTree(tools::JsonWriter &)
Dumps itself and potentially its children to a property tree, to be written easily to JSON.
virtual Size GetSizePixel() const
Size GetOutputSizePixel() const
bool IsControlBackground() const
virtual void DataChanged(const DataChangedEvent &rDCEvt)
Point GetPointerPosPixel()
const Color & GetControlBackground() const
OUString GetAccessibleName() const
void SetPaintTransparent(bool bTransparent)
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
bool IsDefaultSize() const
virtual bool set_property(const OUString &rKey, const OUString &rValue)
Point ScreenToOutputPixel(const Point &rPos) const
void RemoveChildEventListener(const Link< VclWindowEvent &, void > &rEventListener)
OUString GetAccessibleDescription() const
SAL_DLLPRIVATE void ImplInit(vcl::Window *pParent, WinBits nStyle, SystemParentData *pSystemParentData)
const OUString & GetHelpText() const
void EnableChildTransparentMode(bool bEnable=true)
void SetHelpId(const OUString &)
SAL_DLLPRIVATE void ImplControlFocus(GetFocusFlags nFlags=GetFocusFlags::NONE)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
virtual void SetCurPageId(const OUString &rName) override
std::function< std::unique_ptr< UIObject >(vcl::Window *)> FactoryFunction
constexpr sal_uInt16 KEY_LEFT
constexpr sal_uInt16 KEY_PAGEDOWN
constexpr sal_uInt16 KEY_TAB
constexpr sal_uInt16 KEY_RIGHT
constexpr sal_uInt16 KEY_PAGEUP
#define LINK(Instance, Class, Member)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_INFO(area, stream)
@ DrawDisabled
this flags lets the item be drawn disabled (e.g.
@ DisableSelection
this flag disables a selection of an entry completely.
static std::deque< size_t > GetEndOfLineIndexes(const std::vector< sal_Int32 > &rWidthsOf, sal_Int32 nLineWidth)
VclPtr< ListBox > mpListBox
std::unordered_map< int, int > maLayoutLineToPageId
std::unordered_map< int, int > maLayoutPageIdToLine
std::vector< ImplTabItem > maItemList
ImplSVData * ImplGetSVData()
IMPL_LINK_NOARG(TabControl, ImplListBoxSelectHdl, ListBox &, void)
static bool lcl_canPaint(const vcl::RenderContext &rRenderContext, const tools::Rectangle &rDrawRect, const tools::Rectangle &rItemRect)
IMPL_LINK(TabControl, ImplWindowEventListener, VclWindowEvent &, rEvent, void)
static bool lcl_isValidPage(const ImplTabItem &rItem, bool &bFound)
static void lcl_AdjustSingleLineTabs(tools::Long nMaxWidth, ImplTabCtrlData *pTabCtrlData)
#define TAB_PAGE_NOTFOUND
#define TAB_BORDER_BOTTOM
OUString removeMnemonicFromString(OUString const &rStr)
@ NoChildren
The child windows are not invalidated.
WinBits const WB_DIALOGCONTROL
WinBits const WB_DROPDOWN
WinBits const WB_STDTABCONTROL
WinBits const WB_NOTABSTOP
WinBits const WB_NODIALOGCONTROL
WinBits const WB_NOBORDER