38#include <svtools/strings.hrc>
43#include <bitmaps.hlst>
48constexpr sal_uInt16 TABBAR_DRAG_SCROLLOFF = 5;
49constexpr sal_uInt16 TABBAR_MINSIZE = 5;
51constexpr sal_uInt16 ADDNEWPAGE_AREAWIDTH = 10;
62 Color maSelectedColor;
67 bool mbCustomColored:1;
72 : mrRenderContext(rRenderContext)
73 , mrStyleSettings(rRenderContext.GetSettings().GetStyleSettings())
75 , mbCustomColored(false)
93 else if (mbCustomColored)
102 void drawText(
const OUString& aText)
112 mrRenderContext.
DrawText(aPos, aText);
114 mrRenderContext.
DrawCtrlText(aPos, aText, 0, aText.getLength(), (DrawTextFlags::Disable | DrawTextFlags::Mnemonic));
117 void drawOverTopBorder()
132 Color aLineColor = (mbCustomColored && maCustomColor != maSelectedColor)
137 mrRenderContext.
DrawRect(maLineRect);
153 if (!mbSelected && !mbCustomColored)
172 void setSelected(
bool bSelected)
174 mbSelected = bSelected;
177 void setCustomColored(
bool bCustomColored)
179 mbCustomColored = bCustomColored;
182 void setEnabled(
bool bEnabled)
184 mbEnabled = bEnabled;
187 void setSelectedFillColor(
const Color& rColor)
189 maSelectedColor = rColor;
192 void setCustomColor(
const Color& rColor)
194 maCustomColor = rColor;
236 return mbSelect || (pCurItem ==
this);
323 std::unique_ptr<weld::Entry> m_xEntry;
324 Idle maLoseFocusIdle;
327 DECL_LINK( ImplEndEditHdl,
void*,
void );
334 TabBarEdit(
TabBar* pParent);
335 virtual void dispose()
override;
341 void SetPostEvent() { mbPostEvt =
true; }
342 void ResetPostEvent() { mbPostEvt =
false; }
347TabBarEdit::TabBarEdit(
TabBar* pParent)
349 , m_xEntry(m_xBuilder->weld_entry(
"entry"))
350 , maLoseFocusIdle(
"svtools::TabBarEdit maLoseFocusIdle" )
352 InitControlBase(m_xEntry.get());
355 maLoseFocusIdle.SetPriority( TaskPriority::REPAINT );
356 maLoseFocusIdle.SetInvokeHandler(
LINK(
this, TabBarEdit, ImplEndTimerHdl ) );
358 m_xEntry->connect_activate(
LINK(
this, TabBarEdit, ActivatedHdl));
359 m_xEntry->connect_key_press(
LINK(
this, TabBarEdit, KeyInputHdl));
360 m_xEntry->connect_focus_out(
LINK(
this, TabBarEdit, FocusOutHdl));
363void TabBarEdit::dispose()
373 if ( PostUserEvent(
LINK(
this, TabBarEdit, ImplEndEditHdl ),
reinterpret_cast<void*
>(
false),
true ) )
381 if (!rKEvt.GetKeyCode().GetModifier() && rKEvt.GetKeyCode().GetCode() ==
KEY_ESCAPE)
385 if ( PostUserEvent(
LINK(
this, TabBarEdit, ImplEndEditHdl ),
reinterpret_cast<void*
>(
true),
true ) )
397 if ( PostUserEvent(
LINK(
this, TabBarEdit, ImplEndEditHdl ),
reinterpret_cast<void*
>(
false),
true ) )
402IMPL_LINK( TabBarEdit, ImplEndEditHdl,
void*, pCancel,
void )
405 maLoseFocusIdle.Stop();
409 if (!m_xEntry->has_focus() && m_xEntry->has_child_focus())
410 maLoseFocusIdle.Start();
412 GetParent()->EndEditMode( pCancel !=
nullptr );
417 if (m_xEntry->has_focus())
422 if (m_xEntry->has_child_focus())
423 maLoseFocusIdle.Start();
425 GetParent()->EndEditMode(
true );
433 std::unique_ptr<weld::Button> m_xFirstButton;
434 std::unique_ptr<weld::Button> m_xPrevButton;
435 std::unique_ptr<weld::Button> m_xNextButton;
436 std::unique_ptr<weld::Button> m_xLastButton;
437 std::unique_ptr<weld::Button> m_xAddButton;
438 std::shared_ptr<weld::ButtonPressRepeater> m_xAddRepeater;
439 std::shared_ptr<weld::ButtonPressRepeater> m_xPrevRepeater;
440 std::shared_ptr<weld::ButtonPressRepeater> m_xNextRepeater;
442 TabButtons(
TabBar* pParent,
bool bSheets)
444 pParent->
IsMirrored() ? OUString(
"svt/ui/tabbuttonsmirrored.ui")
445 : OUString(
"svt/ui/tabbuttons.ui"),
447 , m_xFirstButton(m_xBuilder->weld_button(
"first"))
448 , m_xPrevButton(m_xBuilder->weld_button(
"prev"))
449 , m_xNextButton(m_xBuilder->weld_button(
"next"))
450 , m_xLastButton(m_xBuilder->weld_button(
"last"))
451 , m_xAddButton(m_xBuilder->weld_button(
"add"))
457 m_xFirstButton->set_accessible_name(
SvtResId(STR_TABBAR_PUSHBUTTON_MOVET0HOME));
458 m_xPrevButton->set_accessible_name(
SvtResId(STR_TABBAR_PUSHBUTTON_MOVELEFT));
459 m_xNextButton->set_accessible_name(
SvtResId(STR_TABBAR_PUSHBUTTON_MOVERIGHT));
460 m_xLastButton->set_accessible_name(
SvtResId(STR_TABBAR_PUSHBUTTON_MOVETOEND));
461 m_xAddButton->set_accessible_name(
SvtResId(STR_TABBAR_PUSHBUTTON_ADDTAB));
465 m_xFirstButton->set_tooltip_text(
SvtResId(STR_TABBAR_HINT_MOVETOHOME_SHEETS));
466 m_xPrevButton->set_tooltip_text(
SvtResId(STR_TABBAR_HINT_MOVELEFT_SHEETS));
467 m_xNextButton->set_tooltip_text(
SvtResId(STR_TABBAR_HINT_MOVERIGHT_SHEETS));
468 m_xLastButton->set_tooltip_text(
SvtResId(STR_TABBAR_HINT_MOVETOEND_SHEETS));
469 m_xAddButton->set_tooltip_text(
SvtResId(STR_TABBAR_HINT_ADDTAB_SHEETS));
473 void AdaptToHeight(
int nHeight)
475 if (m_xFirstButton->get_preferred_size() ==
Size(nHeight, nHeight))
477 m_xFirstButton->set_size_request(nHeight, nHeight);
478 m_xPrevButton->set_size_request(nHeight, nHeight);
479 m_xNextButton->set_size_request(nHeight, nHeight);
480 m_xLastButton->set_size_request(nHeight, nHeight);
481 m_xAddButton->set_size_request(nHeight, nHeight);
485 virtual void dispose()
override
487 m_xNextRepeater.reset();
488 m_xPrevRepeater.reset();
489 m_xAddRepeater.reset();
490 m_xAddButton.reset();
491 m_xLastButton.reset();
492 m_xNextButton.reset();
493 m_xPrevButton.reset();
494 m_xFirstButton.reset();
512 return static_cast<sal_uInt16
>(
maItemList.size());
535const sal_uInt16
TabBar::APPEND = ::std::numeric_limits<sal_uInt16>::max();
574 if ( i < mpImpl->maItemList.size() )
668 bool bChanged =
false;
669 for (
auto& rItem :
mpImpl->maItemList)
674 rItem.mbShort =
true;
679 rItem.mbShort =
false;
686 nNewWidth += nFontWidth * 2;
688 if (rItem.mnWidth != nNewWidth)
690 rItem.mnWidth = nNewWidth;
691 if (!rItem.maRect.IsEmpty())
709 const size_t nItemListSize =
mpImpl->maItemList.size();
710 for (
size_t nItemIndex = 0; nItemIndex < nItemListSize; nItemIndex++)
713 auto& rItem =
mbMirrored ?
mpImpl->maItemList[nItemListSize - nItemIndex - 1]
714 :
mpImpl->maItemList[nItemIndex];
718 rItem.maRect.SetEmpty();
725 rItem.maRect.SetLeft(
x - rItem.mnWidth);
729 rItem.maRect.SetLeft(
x);
732 rItem.maRect.SetRight(
x);
739 rItem.maRect.SetRight(nNewRight);
740 rItem.maRect.SetLeft(nNewLeft);
757 sal_uInt16 nLastFirstPos =
nCount - 1;
761 while (nLastFirstPos && (nWidth < nWinWidth))
764 nWidth +=
mpImpl->maItemList[nLastFirstPos].mnWidth;
766 if ((nLastFirstPos !=
static_cast<sal_uInt16
>(
mpImpl->maItemList.size() - 1)) && (nWidth > nWinWidth))
768 return nLastFirstPos;
773 maScrollAreaContextHdl.Call(rCommandEvent);
778 if (rMouseEvent.IsRight())
779 ContextMenuHdl(
CommandEvent(rMouseEvent.GetPosPixel(), CommandEventId::ContextMenu,
true));
795 mpImpl->mpSizer.disposeAndClear();
805 mpImpl->mxButtonBox->m_xAddRepeater = std::make_shared<weld::ButtonPressRepeater>(
806 *
mpImpl->mxButtonBox->m_xAddButton, aLink, aContextLink);
807 mpImpl->mxButtonBox->m_xAddButton->show();
814 mpImpl->mxButtonBox->m_xPrevRepeater = std::make_shared<weld::ButtonPressRepeater>(
815 *
mpImpl->mxButtonBox->m_xPrevButton, aLink, aContextLink);
816 mpImpl->mxButtonBox->m_xPrevButton->show();
817 mpImpl->mxButtonBox->m_xNextRepeater = std::make_shared<weld::ButtonPressRepeater>(
818 *
mpImpl->mxButtonBox->m_xNextButton, aLink, aContextLink);
819 mpImpl->mxButtonBox->m_xNextButton->show();
826 mpImpl->mxButtonBox->m_xFirstButton->connect_clicked(aLink);
827 mpImpl->mxButtonBox->m_xFirstButton->connect_mouse_press(aBtnContextLink);
828 mpImpl->mxButtonBox->m_xFirstButton->show();
829 mpImpl->mxButtonBox->m_xLastButton->connect_clicked(aLink);
830 mpImpl->mxButtonBox->m_xLastButton->connect_mouse_press(aBtnContextLink);
831 mpImpl->mxButtonBox->m_xLastButton->show();
834 mpImpl->mxButtonBox->Show();
844 mpImpl->mxButtonBox->m_xFirstButton->set_sensitive(bEnableBtn);
845 mpImpl->mxButtonBox->m_xPrevButton->set_sensitive(bEnableBtn);
846 if (!bEnableBtn &&
mpImpl->mxButtonBox->m_xPrevRepeater)
847 mpImpl->mxButtonBox->m_xPrevRepeater->Stop();
849 mpImpl->mxButtonBox->m_xLastButton->set_sensitive(bEnableBtn);
850 mpImpl->mxButtonBox->m_xNextButton->set_sensitive(bEnableBtn);
851 if (!bEnableBtn &&
mpImpl->mxButtonBox->m_xNextRepeater)
852 mpImpl->mxButtonBox->m_xNextRepeater->Stop();
872 else if (rItem.maRect.Right() > nWidth)
874 while (rItem.maRect.Right() > nWidth)
887 if (&rBtn != mpImpl->mxButtonBox->m_xFirstButton.get() && &rBtn != mpImpl->mxButtonBox->m_xLastButton.get())
893 mpImpl->mxButtonBox->m_xPrevRepeater->Stop();
894 mpImpl->mxButtonBox->m_xNextRepeater->Stop();
901 sal_uInt16 nNewPos = mnFirstPos;
903 if (&rBtn == mpImpl->mxButtonBox->m_xFirstButton.get() || (&rBtn == mpImpl->mxButtonBox->m_xPrevButton.get() &&
904 mpImpl->mxButtonBox->m_xPrevRepeater->IsModKeyPressed()))
908 else if (&rBtn == mpImpl->mxButtonBox->m_xLastButton.get() || (&rBtn == mpImpl->mxButtonBox->m_xNextButton.get() &&
909 mpImpl->mxButtonBox->m_xNextRepeater->IsModKeyPressed()))
911 sal_uInt16
nCount = GetPageCount();
915 else if (&rBtn == mpImpl->mxButtonBox->m_xPrevButton.get())
918 nNewPos = mnFirstPos - 1;
920 else if (&rBtn == mpImpl->mxButtonBox->m_xNextButton.get())
922 sal_uInt16
nCount = GetPageCount();
924 nNewPos = mnFirstPos+1;
931 if (nNewPos != mnFirstPos)
932 SetFirstPageId(GetPageId(nNewPos));
941 mpImpl->mxButtonBox->m_xAddRepeater->Stop();
954 Window::MouseMove(rMEvt);
971 Window::MouseButtonDown(rMEvt);
992 if ((rMEvt.
GetMode() & (MouseEventModifiers::MULTISELECT | MouseEventModifiers::RANGESELECT)) && (rMEvt.
GetClicks() == 1))
998 bool bSelectTab =
false;
1014 if (
nPos <= nCurPos)
1022 auto& rItem =
mpImpl->maItemList[
n];
1023 bSelect =
n >=
nPos;
1025 if (rItem.mbSelect != bSelect)
1027 rItem.mbSelect = bSelect;
1028 if (!rItem.maRect.IsEmpty())
1036 if (
nPos >= nCurPos)
1045 auto& rItem =
mpImpl->maItemList[
n];
1047 bSelect =
n <=
nPos;
1049 if (rItem.mbSelect != bSelect)
1051 rItem.mbSelect = bSelect;
1052 if (!rItem.maRect.IsEmpty())
1100 if (!rItem.mbSelect)
1103 bool bUpdate =
false;
1108 for (
auto& xItem :
mpImpl->maItemList)
1110 if (xItem.mbSelect || (xItem.mnId ==
mnCurPageId))
1112 xItem.mbSelect =
false;
1134 Window::MouseButtonDown(rMEvt);
1140 Window::MouseButtonUp(rMEvt);
1147 rRenderContext.
DrawNativeControl(ControlType::WindowBackground,ControlPart::Entire,rect,
1151 sal_uInt16 nItemCount =
mpImpl->getItemSize();
1157 Color aFaceColor, aSelectColor, aFaceTextColor, aSelectTextColor;
1159 ImplGetColors(rStyleSettings, aFaceColor, aFaceTextColor, aSelectColor, aSelectTextColor);
1169 TabDrawer aDrawer(rRenderContext);
1171 aDrawer.setSelectedFillColor(aSelectColor);
1189 bool bCurrent = pItem == pCurItem;
1194 bool bSelected = pItem->
IsSelected(pCurItem);
1197 OUString aText = pItem->
mbShort ?
1201 aDrawer.setRect(aRect);
1202 aDrawer.setSelected(bSelected);
1203 aDrawer.setCustomColored(bCustomBgColor);
1204 aDrawer.setEnabled(
true);
1211 rRenderContext.
SetFont(aFont);
1213 rRenderContext.
SetFont(aLightFont);
1219 else if (bCustomBgColor)
1233 aSpecialFont.
SetItalic(FontItalic::ITALIC_NORMAL);
1234 rRenderContext.
SetFont(aSpecialFont);
1240 rRenderContext.
SetFont(aSpecialFont);
1243 aDrawer.drawText(aText);
1249 aDrawer.drawOverTopBorder();
1266 rRenderContext.
Pop();
1278 Size aSizerSize =
mpImpl->mpSizer->GetSizePixel();
1281 mpImpl->mpSizer->SetPosSizePixel( aNewSizerPos, aNewSizerSize );
1282 nSizerWidth = aSizerSize.
Width();
1290 mpImpl->mxButtonBox->AdaptToHeight(nHeight);
1291 Size const aBtnsSize(
mpImpl->mxButtonBox->get_preferred_size().Width(), nHeight);
1293 mpImpl->mxButtonBox->SetPosSizePixel(aPos, aBtnsSize);
1339 if (rNEvt.
GetType() == NotifyEventType::COMMAND)
1345 if (
pData->GetNotchDelta() > 0)
1350 else if (
pData->GetNotchDelta() < 0)
1360 return Window::PreNotify(rNEvt);
1368 if (rHEvt.
GetMode() & HelpEventMode::BALLOON)
1371 if (!
aStr.isEmpty())
1387 if (rHEvt.
GetMode() & (HelpEventMode::QUICK | HelpEventMode::BALLOON))
1391 if (rItem.mbShort || (rItem.maRect.Right() - 5 >
mnLastOffX))
1401 if (!
aStr.isEmpty())
1403 if (rHEvt.
GetMode() & HelpEventMode::BALLOON)
1413 Window::RequestHelp(rHEvt);
1418 Window::StateChanged(
nType);
1420 if (
nType == StateChangedType::InitShow)
1425 else if (
nType == StateChangedType::Zoom ||
1426 nType == StateChangedType::ControlFont)
1431 else if (
nType == StateChangedType::ControlForeground)
1433 else if (
nType == StateChangedType::ControlBackground)
1438 else if (
nType == StateChangedType::Mirroring)
1443 mpImpl->mpSizer->EnableRTL(bIsRTLEnabled);
1446 mpImpl->mxButtonBox->m_xFirstButton->set_direction(bIsRTLEnabled);
1447 mpImpl->mxButtonBox->m_xPrevButton->set_direction(bIsRTLEnabled);
1448 mpImpl->mxButtonBox->m_xNextButton->set_direction(bIsRTLEnabled);
1449 mpImpl->mxButtonBox->m_xLastButton->set_direction(bIsRTLEnabled);
1450 mpImpl->mxButtonBox->m_xAddButton->set_direction(bIsRTLEnabled);
1462 Window::DataChanged(rDCEvt);
1464 if (rDCEvt.
GetType() == DataChangedEventType::FONTS
1465 || rDCEvt.
GetType() == DataChangedEventType::FONTSUBSTITUTION
1466 || (rDCEvt.
GetType() == DataChangedEventType::SETTINGS
1467 && rDCEvt.
GetFlags() & AllSettingsFlags::STYLE))
1515 sal_uInt16 nItemCount =
mpImpl->getItemSize();
1532 if (rItem.maRect.IsEmpty())
1547 if (
n >= nItemCount)
1564 else if (
n >= nItemCount)
1602 assert (
nPageId &&
"TabBar::InsertPage(): PageId must not be 0");
1608 if (nPos < mpImpl->maItemList.size())
1610 auto it =
mpImpl->maItemList.begin();
1612 mpImpl->maItemList.insert(it, aItem);
1616 mpImpl->maItemList.push_back(aItem);
1636 return mpImpl->maItemList[
nPos].maTabBgColor;
1650 rItem.maTabBgColor = aTabBgColor;
1679 auto it =
mpImpl->maItemList.begin();
1681 mpImpl->maItemList.erase(it);
1698 if (
nPos == nNewPos)
1706 auto it =
mpImpl->maItemList.begin();
1709 mpImpl->maItemList.erase(it);
1710 if (nNewPos < mpImpl->maItemList.size())
1712 it =
mpImpl->maItemList.begin();
1714 mpImpl->maItemList.insert(it, aItem);
1718 mpImpl->maItemList.push_back(aItem);
1731 mpImpl->maItemList.clear();
1764 if (rItem.mnBits != nBits)
1766 rItem.mnBits = nBits;
1786 return mpImpl->getItemSize();
1796 for (
size_t i = 0;
i <
mpImpl->maItemList.size(); ++
i)
1800 return static_cast<sal_uInt16
>(
i);
1808 for (
const auto& rItem :
mpImpl->maItemList)
1810 if (rItem.maRect.Contains(rPos))
1840 bool bUpdate =
false;
1854 if (!rItem.mbSelect && pOldItem)
1857 if (nSelPageCount == 1)
1859 rItem.mbSelect =
true;
1874 if (nWidth > ADDNEWPAGE_AREAWIDTH)
1875 nWidth -= ADDNEWPAGE_AREAWIDTH;
1877 if (rItem.maRect.IsEmpty())
1880 while ((
mbMirrored ? (rItem.maRect.Left() <
mnOffX) : (rItem.maRect.Right() > nWidth)) ||
1881 rItem.maRect.IsEmpty())
1885 if (nNewPos >=
nPos)
1929 if (
mbFormat || rItem.maRect.IsEmpty())
1935 while ((rItem.maRect.Right() > nWidth) ||
1936 rItem.maRect.IsEmpty())
1940 if (nNewPos >=
nPos)
1970 if (
nPos > nLastFirstPos)
1971 nNewPos = nLastFirstPos;
1996 if (rItem.mbSelect != bSelect)
1998 rItem.mbSelect = bSelect;
2008 sal_uInt16 nSelected = 0;
2009 for (
const auto& rItem :
mpImpl->maItemList)
2032 if (
mpImpl->maItemList[
nPos].mbProtect != bProtection)
2034 mpImpl->maItemList[
nPos].mbProtect = bProtection;
2075 Color aForegroundColor;
2076 Color aBackgroundColor;
2079 Color aFaceTextColor;
2080 Color aSelectTextColor;
2090 aForegroundColor = aSelectTextColor;
2091 aBackgroundColor = aSelectColor;
2095 aForegroundColor = aFaceTextColor;
2096 aBackgroundColor = aFaceColor;
2104 mpImpl->mxEdit->SetControlBackground(aBackgroundColor);
2119 return bool(
mpImpl->mxEdit);
2132 mpImpl->mxEdit->SetPostEvent();
2147 mpImpl->mxEdit->ResetPostEvent();
2153 mpImpl->mxEdit.disposeAndClear();
2211 CallEventListeners(VclEventId::TabbarPageTextChanged,
reinterpret_cast<void*
>(sal::static_int_cast<sal_IntPtr>(
nPageId)));
2227 return mpImpl->maItemList[
nPos].maAuxiliaryText;
2236 mpImpl->maItemList[
nPos].maAuxiliaryText = rText;
2247 if (rItem.maHelpText.isEmpty() && !rItem.maHelpId.isEmpty())
2251 rItem.maHelpText = pHelp->
GetHelpText(OStringToOUString(rItem.maHelpId, RTL_TEXTENCODING_UTF8),
this);
2254 return rItem.maHelpText;
2304 sal_uInt16 nNewDropPos;
2305 sal_uInt16 nItemCount =
mpImpl->getItemSize();
2306 sal_Int16 nScroll = 0;
2310 auto& rItem =
mpImpl->maItemList[
mpImpl->maItemList.size() - 1];
2311 if (!rItem.maRect.IsEmpty() && (rPos.
X() > rItem.maRect.Right()))
2312 nNewDropPos =
mpImpl->getItemSize();
2319 else if ((rPos.
X() <=
mnOffX) ||
2320 (!
mnOffX && (rPos.
X() <= TABBAR_DRAG_SCROLLOFF)))
2340 nNewDropPos = nItemCount;
2381 nX = rItem.maRect.Left();
2387 if (!rItem.IsDefaultTabBgColor() && !rItem.mbSelect)
2395 aPoly.
SetPoint(
Point(nX + nTriangleWidth, nY - nTriangleWidth), 1);
2396 aPoly.
SetPoint(
Point(nX + nTriangleWidth, nY + nTriangleWidth), 2);
2405 nX = rItem.maRect.Right();
2408 if (!rItem.IsDefaultTabBgColor() && !rItem.mbSelect)
2415 aPoly.
SetPoint(
Point(nX - nTriangleWidth, nY - nTriangleWidth), 1);
2416 aPoly.
SetPoint(
Point(nX - nTriangleWidth, nY + nTriangleWidth), 2);
2431 sal_uInt16 nItemCount =
mpImpl->getItemSize();
2436 nX = rItem.maRect.Left();
2447 nX = rItem.maRect.Right();
2513 if (!
mpImpl->maItemList.empty())
2516 for (
const auto& rItem :
mpImpl->maItemList)
2518 nWidth += rItem.mnWidth;
2522 return Size(nWidth,
GetSettings().GetStyleSettings().GetScrollBarSize());
2533 mpImpl->mxButtonBox->m_xAddButton->set_sensitive(bAddButtonEnabled);
2538 return mpImpl->maAccessibleFactory.getFactory().createAccessibleTabBar(*
this);
const StyleSettings & GetStyleSettings() const
static bool GetLayoutRTL()
static const AllSettings & GetSettings()
sal_uInt8 GetLuminance() const
CommandEventId GetCommand() const
const CommandWheelData * GetWheelData() const
const Point & GetMousePosPixel() const
bool IsMouseEvent() const
DataChangedEventType GetType() const
AllSettingsFlags GetFlags() const
void DrawHandle(const tools::Rectangle &rRectangle)
HelpEventMode GetMode() const
const Point & GetMousePosPixel() const
virtual OUString GetHelpText(const OUString &aHelpURL, const weld::Widget *pWidget)
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)
void ImplTrack(const Point &rScreenPos)
ImplTabSizer(TabBar *pParent, WinBits nWinStyle)
virtual void Paint(vcl::RenderContext &, const tools::Rectangle &rRect) override
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
TabBar * GetParent() const
virtual void Tracking(const TrackingEvent &rTEvt) override
virtual void dispose() override
void InvalidateChildSizeCache()
MouseEventModifiers GetMode() const
bool IsLeaveWindow() const
sal_uInt16 GetModifier() const
sal_uInt16 GetClicks() const
const Point & GetPosPixel() const
const CommandEvent * GetCommandEvent() const
NotifyEventType GetType() const
void DrawCtrlText(const Point &rPos, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, DrawTextFlags nStyle=DrawTextFlags::Mnemonic, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pGlyphs=nullptr)
const vcl::Font & GetFont() const
void DrawBitmapEx(const Point &rDestPt, const BitmapEx &rBitmapEx)
void SetFont(const vcl::Font &rNewFont)
void DrawRect(const tools::Rectangle &rRect)
void DrawLine(const Point &rStartPt, const Point &rEndPt)
OUString GetEllipsisString(const OUString &rStr, tools::Long nMaxWidth, DrawTextFlags nStyle=DrawTextFlags::EndEllipsis) 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
void DrawPolygon(const tools::Polygon &rPoly)
void SetTextColor(const Color &rColor)
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
tools::Long GetTextHeight() const
bool DrawNativeControl(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, const OUString &aCaption, const Color &rBackgroundColor=COL_AUTO)
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
constexpr tools::Long Y() const
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
const Color & GetDarkShadowColor() const
bool GetHighContrastMode() const
const Color & GetShadowColor() const
const Color & GetLabelTextColor() const
const Color & GetWindowTextColor() const
const vcl::Font & GetToolFont() const
const Color & GetActiveTabColor() const
const Color & GetInactiveTabColor() const
const Color & GetFaceColor() const
const Color & GetButtonTextColor() const
TabBar(vcl::Window *pParent, WinBits nWinStyle, bool bSheets=false)
SVT_DLLPRIVATE void ImplFormat()
virtual void Resize() override
void SetTabBgColor(sal_uInt16 nPageId, const Color &aTabBgColor)
bool IsInEditMode() const
bool IsPageSelected(sal_uInt16 nPageId) const
SVT_DLLPRIVATE void ImplPrePaint()
void SetCurPageId(sal_uInt16 nPageId)
virtual void ActivatePage()
sal_uInt16 ShowDropPos(const Point &rPos)
static const sal_uInt16 PAGE_NOT_FOUND
void SetPageBits(sal_uInt16 nPageId, TabBarPageBits nBits)
Size CalcWindowSizePixel() const
void SelectPage(sal_uInt16 nPageId, bool bSelect)
bool IsEffectiveRTL() const
Returns true, if the control draws from right to left (see SetEffectiveRTL()).
std::unique_ptr< TabBar_Impl > mpImpl
tools::Rectangle GetPageArea() const
virtual void MouseButtonUp(const MouseEvent &rMEvt) override
bool IsMirrored() const
Returns true, if the control is set to mirrored mode (see SetMirrored()).
void SetAuxiliaryText(sal_uInt16 nPageId, const OUString &rText)
SVT_DLLPRIVATE void ImplGetColors(const StyleSettings &rStyleSettings, Color &rFaceColor, Color &rFaceTextColor, Color &rSelectColor, Color &rSelectTextColor)
SVT_DLLPRIVATE void ImplShowPage(sal_uInt16 nPos)
SVT_DLLPRIVATE void ImplInitControls()
virtual void MouseMove(const MouseEvent &rMEvt) override
void EndEditMode(bool bCancel=false)
void SetAddButtonEnabled(bool bAddButtonEnabled)
SVT_DLLPRIVATE ImplTabBarItem * ImplGetLastTabBarItem(sal_uInt16 nItemCount)
void SetScrollAlwaysEnabled(bool bScrollAlwaysEnabled)
void SetEffectiveRTL(bool bRTL)
Sets the control to LTR or RTL mode regardless of the GUI direction.
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override
void MovePage(sal_uInt16 nPageId, sal_uInt16 nNewPos)
virtual bool DeactivatePage()
SVT_DLLPRIVATE bool ImplCalcWidth()
sal_uInt16 GetPagePos(sal_uInt16 nPageId) const
virtual void StateChanged(StateChangedType nStateChange) override
bool StartEditMode(sal_uInt16 nPageId)
virtual TabBarAllowRenamingReturnCode AllowRenaming()
OUString GetAuxiliaryText(sal_uInt16 nPageId) const
void SetStyle(WinBits nStyle)
void SetMirrored(bool bMirrored)
Mirrors the entire control including position of buttons and splitter.
virtual void SetPageText(sal_uInt16 nPageId, const OUString &rText)
bool mbScrollAlwaysEnabled
tools::Rectangle GetPageRect(sal_uInt16 nPageId) const
SVT_DLLPRIVATE void ImplEnableControls()
virtual bool PreNotify(NotifyEvent &rNEvt) override
sal_uInt16 GetSelectPageCount() const
void MakeVisible(sal_uInt16 nPageId)
tools::Long mnCurMaxWidth
bool IsPageEnabled(sal_uInt16 nPageId) const
virtual void RequestHelp(const HelpEvent &rHEvt) override
Link< TabBar *, void > maSelectHdl
void RemovePage(sal_uInt16 nPageId)
SVT_DLLPRIVATE bool ImplDeactivatePage()
void SetMaxPageWidth(tools::Long nMaxWidth)
SVT_DLLPRIVATE sal_uInt16 ImplGetLastFirstPos()
OUString GetPageText(sal_uInt16 nPageId) const
sal_uInt16 GetPageCount() const
virtual void DoubleClick()
virtual void InsertPage(sal_uInt16 nPageId, const OUString &rText, TabBarPageBits nBits=TabBarPageBits::NONE, sal_uInt16 nPos=TabBar::APPEND)
bool StartDrag(const CommandEvent &rCEvt, vcl::Region &rRegion)
sal_uInt16 GetPageId(sal_uInt16 nPos) const
virtual void EndRenaming()
TabBarPageBits GetPageBits(sal_uInt16 nPageId) const
virtual ~TabBar() override
SVT_DLLPRIVATE void ImplInitSettings(bool bFont, bool bBackground)
void SwitchPage(const Point &rPos)
virtual bool StartRenaming()
void SetFirstPageId(sal_uInt16 nPageId)
SVT_DLLPRIVATE void ImplActivatePage()
sal_uInt16 GetCurPageId() const
static const sal_uInt16 APPEND
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
void SetProtectionSymbol(sal_uInt16 nPageId, bool bProtection)
Color GetTabBgColor(sal_uInt16 nPageId) const
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
SVT_DLLPRIVATE void ImplSelect()
virtual void AddTabClick()
virtual void dispose() override
Link< TabBar *, void > maSplitHdl
tools::Long mnMaxPageWidth
SVT_DLLPRIVATE void ImplInit(WinBits nWinStyle, bool bSheets)
ImplTabBarItem * seek(size_t i)
bool IsTrackingEnded() const
bool IsTrackingCanceled() const
const MouseEvent & GetMouseEvent() const
tools::Long GetFontHeight() const
void SetItalic(FontItalic)
void SetWeight(FontWeight)
void SetFontHeight(tools::Long nHeight)
void SetUnderline(FontLineStyle)
Point OutputToScreenPixel(const Point &rPos) 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
void SetFont(const vcl::Font &rNewFont)
float GetDPIScaleFactor() const
bool IsReallyVisible() const
void StartTracking(StartTrackingFlags nFlags=StartTrackingFlags::NONE)
vcl::Window * GetParent() const
void ApplyControlBackground(vcl::RenderContext &rRenderContext, const Color &rDefaultColor)
virtual void SetSizePixel(const Size &rNewSize)
const Color & GetControlForeground() const
bool IsUpdateMode() const
tools::Long GetTextHeight() const
bool IsControlForeground() const
const AllSettings & GetSettings() const
vcl::Font GetPointFont(vcl::RenderContext const &rRenderContext) const
::OutputDevice const * GetOutDev() const
const vcl::Font & GetFont() const
bool IsRTLEnabled() const
virtual Size GetSizePixel() const
Size GetOutputSizePixel() const
bool IsControlBackground() const
const Color & GetControlBackground() const
virtual void SetPointer(PointerStyle)
void SetPaintTransparent(bool bTransparent)
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
void CallEventListeners(VclEventId nEvent, void *pData=nullptr)
void ApplyControlFont(vcl::RenderContext &rRenderContext, const vcl::Font &rDefaultFont)
Point ScreenToOutputPixel(const Point &rPos) const
const OUString & GetHelpText() const
virtual void set_font(const vcl::Font &rFont)=0
virtual void select_region(int nStartPos, int nEndPos)=0
virtual void set_text(const OUString &rText)=0
virtual void set_font_color(const Color &rColor)=0
virtual OUString get_text() const=0
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr ::Color COL_LIGHTBLUE(0x00, 0x00, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
DECL_LINK(CheckNameHdl, SvxNameDialog &, bool)
constexpr sal_uInt16 KEY_ESCAPE
#define LINK(Instance, Class, Member)
std::unique_ptr< sal_Int32[]> pData
bool IsSelected(ImplTabBarItem const *pCurItem) const
OUString const & GetRenderText() const
ImplTabBarItem(sal_uInt16 nItemId, OUString aText, TabBarPageBits nPageBits)
bool IsDefaultTabBgColor() const
ScopedVclPtr< ImplTabSizer > mpSizer
vcl::AccessibleFactoryAccess maAccessibleFactory
sal_uInt16 getItemSize() const
ScopedVclPtr< TabBarEdit > mxEdit
std::vector< ImplTabBarItem > maItemList
ScopedVclPtr< TabButtons > mxButtonBox
OUString SvtResId(TranslateId aId)
IMPL_LINK(TabBarEdit, KeyInputHdl, const KeyEvent &, rKEvt, bool)
IMPL_LINK_NOARG(TabBarEdit, ActivatedHdl, weld::Entry &, bool)
TabBarAllowRenamingReturnCode
#define TPB_DISPLAY_NAME_ALLFLAGS
const tools::Long nButtonWidth
WinBits const WB_SIZEABLE
WinBits const WB_CLIPCHILDREN