LibreOffice Module svx (master)  1
StylesPreviewWindow.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <StylesPreviewWindow.hxx>
21 
23 #include <vcl/svapp.hxx>
24 #include <sfx2/objsh.hxx>
25 #include <svl/itemset.hxx>
26 #include <sfx2/tbxctrl.hxx>
27 #include <sfx2/sfxsids.hrc>
28 #include <sfx2/tplpitem.hxx>
29 #include <sfx2/viewsh.hxx>
30 #include <vcl/glyphitemcache.hxx>
31 #include <vcl/virdev.hxx>
32 #include <vcl/settings.hxx>
33 
34 #include <editeng/editids.hrc>
35 #include <editeng/fontitem.hxx>
36 #include <editeng/fhgtitem.hxx>
37 #include <editeng/svxfont.hxx>
38 #include <editeng/wghtitem.hxx>
39 #include <editeng/postitem.hxx>
40 #include <editeng/contouritem.hxx>
41 #include <editeng/shdditem.hxx>
43 #include <editeng/udlnitem.hxx>
45 #include <editeng/colritem.hxx>
46 #include <editeng/cmapitem.hxx>
48 #include <editeng/brushitem.hxx>
49 
50 #include <i18nlangtag/mslangid.hxx>
51 
52 #include <svx/xfillit0.hxx>
53 #include <svx/xdef.hxx>
54 #include <svx/xflclit.hxx>
55 
56 #include <com/sun/star/drawing/FillStyle.hpp>
57 #include <com/sun/star/i18n/ScriptType.hpp>
58 #include <com/sun/star/uno/Sequence.hxx>
59 
60 #include <vcl/commandevent.hxx>
61 
63  StylesPreviewWindow_Base* pPreviewControl,
64  const css::uno::Reference<css::frame::XDispatchProvider>& xDispatchProvider)
65  : SfxStatusListener(xDispatchProvider, SID_STYLE_FAMILY2, ".uno:ParaStyle")
66  , m_pPreviewControl(pPreviewControl)
67 {
68  ReBind();
69 }
70 
72  const SfxPoolItem* pState)
73 {
74  const SfxTemplateItem* pStateItem = dynamic_cast<const SfxTemplateItem*>(pState);
75  if (pStateItem)
76  {
77  if (pStateItem->GetStyleIdentifier().isEmpty())
78  m_pPreviewControl->Select(pStateItem->GetStyleName());
79  else
81  }
82 }
83 
85  : m_pPreviewControl(pPreviewControl)
86 {
88 
89  m_pStyleSheetPool = pDocShell ? pDocShell->GetStyleSheetPool() : nullptr;
90 
92  {
94  }
95 }
96 
98 {
101 }
102 
104 {
106 }
107 
108 StyleItemController::StyleItemController(const std::pair<OUString, OUString>& aStyleName)
109  : m_eStyleFamily(SfxStyleFamily::Para)
110  , m_aStyleName(aStyleName)
111 {
112 }
113 
115 {
118 
119  DrawEntry(rRenderContext);
120 
121  rRenderContext.Pop();
122 }
123 
125 {
126  if (rEvent.GetCommand() != CommandEventId::ContextMenu)
127  return false;
128 
129  std::unique_ptr<weld::Builder> xBuilder(
130  Application::CreateBuilder(m_xStylesView.get(), "svx/ui/stylemenu.ui"));
131  std::unique_ptr<weld::Menu> xMenu(xBuilder->weld_menu("menu"));
132  OString rIdent = xMenu->popup_at_rect(m_xStylesView.get(),
133  tools::Rectangle(rEvent.GetMousePosPixel(), Size(1, 1)));
134  if (rIdent == "update" || rIdent == "edit")
135  {
136  css::uno::Sequence<css::beans::PropertyValue> aArgs(0);
137 
139  rIdent == "update" ? OUString(".uno:StyleUpdateByExample")
140  : OUString(".uno:EditStyle"),
141  aArgs);
142 
143  return true;
144  }
145 
146  return false;
147 }
148 
149 static Color GetTextColorFromItemSet(std::optional<SfxItemSet> const& pItemSet)
150 {
151  const SfxPoolItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_COLOR);
152  if (pItem)
153  return static_cast<const SvxColorItem*>(pItem)->GetValue();
154 
155  return COL_AUTO;
156 }
157 
158 static Color GetHighlightColorFromItemSet(std::optional<SfxItemSet> const& pItemSet)
159 {
160  const SfxPoolItem* pItem = pItemSet->GetItem(SID_ATTR_BRUSH_CHAR);
161  if (pItem)
162  return static_cast<const SvxBrushItem*>(pItem)->GetColor();
163 
164  return COL_AUTO;
165 }
166 
167 static Color GetBackgroundColorFromItemSet(std::optional<SfxItemSet> const& pItemSet)
168 {
169  const SfxPoolItem* pItem = pItemSet->GetItem(XATTR_FILLCOLOR);
170  if (pItem)
171  return static_cast<const XFillColorItem*>(pItem)->GetColorValue();
172 
173  return COL_AUTO;
174 }
175 
176 static css::drawing::FillStyle GetFillStyleFromItemSet(std::optional<SfxItemSet> const& pItemSet)
177 {
178  const SfxPoolItem* pItem = pItemSet->GetItem(XATTR_FILLSTYLE);
179  if (pItem)
180  return static_cast<const XFillStyleItem*>(pItem)->GetValue();
181 
182  return css::drawing::FillStyle_NONE;
183 }
184 
185 static SvxFont GetFontFromItems(const SvxFontItem* pFontItem, Size aPixelFontSize,
186  std::optional<SfxItemSet> const& pItemSet)
187 {
188  SvxFont aFont;
189 
190  aFont.SetFamilyName(pFontItem->GetFamilyName());
191  aFont.SetStyleName(pFontItem->GetStyleName());
192  aFont.SetFontSize(aPixelFontSize);
193 
194  const SfxPoolItem* pItem = pItemSet->GetItem(SID_ATTR_CHAR_WEIGHT);
195  if (pItem)
196  aFont.SetWeight(static_cast<const SvxWeightItem*>(pItem)->GetWeight());
197 
198  pItem = pItemSet->GetItem(SID_ATTR_CHAR_POSTURE);
199  if (pItem)
200  aFont.SetItalic(static_cast<const SvxPostureItem*>(pItem)->GetPosture());
201 
202  pItem = pItemSet->GetItem(SID_ATTR_CHAR_CONTOUR);
203  if (pItem)
204  aFont.SetOutline(static_cast<const SvxContourItem*>(pItem)->GetValue());
205 
206  pItem = pItemSet->GetItem(SID_ATTR_CHAR_SHADOWED);
207  if (pItem)
208  aFont.SetShadow(static_cast<const SvxShadowedItem*>(pItem)->GetValue());
209 
210  pItem = pItemSet->GetItem(SID_ATTR_CHAR_RELIEF);
211  if (pItem)
212  aFont.SetRelief(static_cast<const SvxCharReliefItem*>(pItem)->GetValue());
213 
214  pItem = pItemSet->GetItem(SID_ATTR_CHAR_UNDERLINE);
215  if (pItem)
216  aFont.SetUnderline(static_cast<const SvxUnderlineItem*>(pItem)->GetLineStyle());
217 
218  pItem = pItemSet->GetItem(SID_ATTR_CHAR_OVERLINE);
219  if (pItem)
220  aFont.SetOverline(static_cast<const SvxOverlineItem*>(pItem)->GetValue());
221 
222  pItem = pItemSet->GetItem(SID_ATTR_CHAR_STRIKEOUT);
223  if (pItem)
224  aFont.SetStrikeout(static_cast<const SvxCrossedOutItem*>(pItem)->GetStrikeout());
225 
226  pItem = pItemSet->GetItem(SID_ATTR_CHAR_CASEMAP);
227  if (pItem)
228  aFont.SetCaseMap(static_cast<const SvxCaseMapItem*>(pItem)->GetCaseMap());
229 
230  pItem = pItemSet->GetItem(SID_ATTR_CHAR_EMPHASISMARK);
231  if (pItem)
232  aFont.SetEmphasisMark(static_cast<const SvxEmphasisMarkItem*>(pItem)->GetEmphasisMark());
233 
234  return aFont;
235 }
236 
238 {
240  if (!pShell)
241  return;
242 
243  SfxStyleSheetBasePool* pPool = pShell->GetStyleSheetPool();
244  SfxStyleSheetBase* pStyle = nullptr;
245 
246  if (!pPool)
247  return;
248 
249  pStyle = pPool->First(m_eStyleFamily);
250  while (pStyle && pStyle->GetName() != m_aStyleName.first
251  && pStyle->GetName() != m_aStyleName.second)
252  pStyle = pPool->Next();
253 
254  if (!pStyle)
255  return;
256 
257  Size aSize(rRenderContext.GetOutputSizePixel());
258  tools::Rectangle aFullRect(Point(0, 0), aSize);
259  tools::Rectangle aContentRect(aFullRect);
260 
261  Color aOriginalColor = rRenderContext.GetFillColor();
262  Color aOriginalLineColor = rRenderContext.GetLineColor();
263 
264  DrawContentBackground(rRenderContext, aContentRect, aOriginalColor);
265 
266  std::optional<SfxItemSet> const pItemSet(pStyle->GetItemSetForPreview());
267  if (!pItemSet)
268  return;
269 
270  Color aFontHighlight = COL_AUTO;
271 
272  sal_Int16 nScriptType
273  = MsLangId::getScriptType(Application::GetSettings().GetUILanguageTag().getLanguageType());
274 
275  sal_uInt16 nFontSlot = SID_ATTR_CHAR_FONT;
276  if (nScriptType == css::i18n::ScriptType::ASIAN)
277  nFontSlot = SID_ATTR_CHAR_CJK_FONT;
278  else if (nScriptType == css::i18n::ScriptType::COMPLEX)
279  nFontSlot = SID_ATTR_CHAR_CTL_FONT;
280 
281  const SvxFontItem* const pFontItem = pItemSet->GetItem<SvxFontItem>(nFontSlot);
282  const SvxFontHeightItem* const pFontHeightItem
283  = pItemSet->GetItem<SvxFontHeightItem>(SID_ATTR_CHAR_FONTHEIGHT);
284 
285  if (pFontItem && pFontHeightItem)
286  {
287  Size aFontSize(0, pFontHeightItem->GetHeight());
288  Size aPixelSize(rRenderContext.LogicToPixel(aFontSize, MapMode(pShell->GetMapUnit())));
289 
290  SvxFont aFont = GetFontFromItems(pFontItem, aPixelSize, pItemSet);
291  rRenderContext.SetFont(aFont);
292 
293  Color aFontCol = GetTextColorFromItemSet(pItemSet);
294  if (aFontCol != COL_AUTO)
295  rRenderContext.SetTextColor(aFontCol);
296 
297  aFontHighlight = GetHighlightColorFromItemSet(pItemSet);
298 
299  css::drawing::FillStyle style = GetFillStyleFromItemSet(pItemSet);
300 
301  switch (style)
302  {
303  case css::drawing::FillStyle_SOLID:
304  {
305  Color aBackCol = GetBackgroundColorFromItemSet(pItemSet);
306  if (aBackCol != COL_AUTO)
307  DrawContentBackground(rRenderContext, aContentRect, aBackCol);
308  }
309  break;
310 
311  default:
312  break;
313  //TODO Draw the other background styles: gradient, hatching and bitmap
314  }
315  }
316 
317  if (aFontHighlight != COL_AUTO)
318  DrawHighlight(rRenderContext, aFontHighlight);
319 
320  DrawText(rRenderContext);
321 
322  rRenderContext.SetFillColor(aOriginalColor);
323  rRenderContext.SetLineColor(aOriginalLineColor);
324 }
325 
327  const tools::Rectangle& aContentRect,
328  const Color& aColor)
329 {
330  rRenderContext.SetLineColor(aColor);
331  rRenderContext.SetFillColor(aColor);
332  rRenderContext.DrawRect(aContentRect);
333 }
334 
336 {
337  tools::Rectangle aTextRect;
338  rRenderContext.GetTextBoundRect(aTextRect, m_aStyleName.second);
339 
340  Size aSize = aTextRect.GetSize();
341  aSize.AdjustHeight(aSize.getHeight());
342  aTextRect.SetSize(aSize);
343 
344  Point aPos(0, 0);
345  aPos.AdjustX(LEFT_MARGIN);
346  aPos.AdjustY((rRenderContext.GetOutputHeightPixel() - aTextRect.Bottom()) / 2);
347  aTextRect.SetPos(aPos);
348 
349  rRenderContext.SetLineColor(aFontBack);
350  rRenderContext.SetFillColor(aFontBack);
351 
352  rRenderContext.DrawRect(aTextRect);
353 }
354 
356 {
357  const SalLayoutGlyphs* layoutGlyphs
358  = SalLayoutGlyphsCache::self()->GetLayoutGlyphs(&rRenderContext, m_aStyleName.second);
359  tools::Rectangle aTextRect;
360  rRenderContext.GetTextBoundRect(aTextRect, m_aStyleName.second, 0, 0, -1, 0, {}, layoutGlyphs);
361 
362  Point aPos(0, 0);
363  aPos.AdjustX(LEFT_MARGIN);
364  aPos.AdjustY((rRenderContext.GetOutputHeightPixel() - aTextRect.Bottom()) / 2);
365 
366  rRenderContext.DrawText(aPos, m_aStyleName.second, 0, -1, nullptr, nullptr, layoutGlyphs);
367 }
368 
370  weld::Builder& xBuilder, std::vector<std::pair<OUString, OUString>>&& aDefaultStyles,
371  const css::uno::Reference<css::frame::XDispatchProvider>& xDispatchProvider)
372  : m_xDispatchProvider(xDispatchProvider)
373  , m_xStylesView(xBuilder.weld_icon_view("stylesview"))
374  , m_aUpdateTask(*this)
375  , m_aDefaultStyles(std::move(aDefaultStyles))
376 {
377  m_xStylesView->connect_selection_changed(LINK(this, StylesPreviewWindow_Base, Selected));
378  m_xStylesView->connect_item_activated(LINK(this, StylesPreviewWindow_Base, DoubleClick));
379  m_xStylesView->connect_command(LINK(this, StylesPreviewWindow_Base, DoCommand));
380 
381  m_xStatusListener = new StyleStatusListener(this, xDispatchProvider);
382 
384 
386 }
387 
388 IMPL_LINK(StylesPreviewWindow_Base, Selected, weld::IconView&, rIconView, void)
389 {
390  OUString sStyleName = rIconView.get_selected_text();
391 
392  css::uno::Sequence<css::beans::PropertyValue> aArgs{
393  comphelper::makePropertyValue("Template", sStyleName),
394  comphelper::makePropertyValue("Family", sal_Int16(SfxStyleFamily::Para))
395  };
396  SfxToolBoxControl::Dispatch(m_xDispatchProvider, ".uno:StyleApply", aArgs);
397 }
398 
399 IMPL_LINK(StylesPreviewWindow_Base, DoubleClick, weld::IconView&, rIconView, bool)
400 {
401  OUString sStyleName = rIconView.get_selected_text();
402 
403  css::uno::Sequence<css::beans::PropertyValue> aArgs{
404  comphelper::makePropertyValue("Param", sStyleName),
405  comphelper::makePropertyValue("Family", sal_Int16(SfxStyleFamily::Para))
406  };
407  SfxToolBoxControl::Dispatch(m_xDispatchProvider, ".uno:EditStyle", aArgs);
408 
409  return true;
410 }
411 
412 IMPL_LINK(StylesPreviewWindow_Base, DoCommand, const CommandEvent&, rPos, bool)
413 {
414  return Command(rPos);
415 }
416 
418 {
419  m_xStatusListener->UnBind();
420 
422 
423  try
424  {
425  m_xStatusListener->dispose();
426  }
427  catch (css::uno::Exception&)
428  {
429  }
430 
431  m_xStatusListener = nullptr;
432 }
433 
434 void StylesPreviewWindow_Base::Select(const OUString& rStyleName)
435 {
436  m_sSelectedStyle = rStyleName;
437 
438  UpdateSelection();
439 }
440 
442 {
443  for (std::vector<std::pair<OUString, OUString>>::size_type i = 0; i < m_aAllStyles.size(); ++i)
444  {
446  {
447  m_xStylesView->select(i);
448  break;
449  }
450  }
451 }
452 
454 
456 {
459 }
460 
462 {
464 
466  SfxStyleSheetBasePool* pStyleSheetPool = nullptr;
467 
468  if (pDocShell)
469  pStyleSheetPool = pDocShell->GetStyleSheetPool();
470 
471  if (pStyleSheetPool)
472  {
473  auto xIter = pStyleSheetPool->CreateIterator(SfxStyleFamily::Para,
474  SfxStyleSearchBits::UserDefined);
475 
476  SfxStyleSheetBase* pStyle = xIter->First();
477 
478  while (pStyle)
479  {
480  m_aAllStyles.push_back(std::pair<OUString, OUString>("", pStyle->GetName()));
481  pStyle = xIter->Next();
482  }
483  }
484 
485  m_xStylesView->clear();
486  for (const auto& rStyle : m_aAllStyles)
487  {
489  const Size aSize(100, 30);
490  pImg->SetOutputSizePixel(aSize);
491 
492  StyleItemController aStyleController(rStyle);
493  aStyleController.Paint(*pImg);
494 
495  m_xStylesView->append(rStyle.first, rStyle.second, pImg);
496  }
497 }
498 
500  vcl::Window* pParent, std::vector<std::pair<OUString, OUString>>&& aDefaultStyles,
501  const css::uno::Reference<css::frame::XDispatchProvider>& xDispatchProvider)
502  : InterimItemWindow(pParent, "svx/ui/stylespreview.ui", "ApplyStyleBox", true,
503  reinterpret_cast<sal_uInt64>(SfxViewShell::Current()))
504  , StylesPreviewWindow_Base(*m_xBuilder, std::move(aDefaultStyles), xDispatchProvider)
505 {
506  SetOptimalSize();
507 }
508 
510 
512 {
513  m_xStylesView.reset();
514 
516 }
517 
519 
520 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
virtual std::unique_ptr< SfxStyleSheetIterator > CreateIterator(SfxStyleFamily, SfxStyleSearchBits nMask=SfxStyleSearchBits::All)
StylesPreviewWindow_Base & m_rStylesList
void SetPos(const Point &rPoint)
StyleStatusListener(StylesPreviewWindow_Base *pPreviewControl, const css::uno::Reference< css::frame::XDispatchProvider > &xDispatchProvider)
SfxStyleSheetBase * First(SfxStyleFamily eFamily, SfxStyleSearchBits eMask=SfxStyleSearchBits::All)
void DrawEntry(vcl::RenderContext &rRenderContext)
virtual std::optional< SfxItemSet > GetItemSetForPreview()
bool Command(const CommandEvent &rEvent)
virtual void Invoke() override
std::vector< std::pair< OUString, OUString > > m_aDefaultStyles
std::string GetValue
const SalLayoutGlyphs * GetLayoutGlyphs(VclPtr< const OutputDevice > outputDevice, const OUString &text, const vcl::text::TextLayoutCache *layoutCache=nullptr)
std::unique_ptr< StylePoolChangeListener > m_pStylePoolChangeListener
Listener for style selection.
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
static const AllSettings & GetSettings()
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
constexpr::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
virtual void SetSizePixel(const Size &rNewSize)
static SfxObjectShell * Current()
static void DrawContentBackground(vcl::RenderContext &rRenderContext, const tools::Rectangle &aContentRect, const Color &aColor)
SfxStyleSheetBasePool * m_pStyleSheetPool
virtual SfxStyleSheetBasePool * GetStyleSheetPool()
const OUString & GetName() const
StylesPreviewWindow_Base(weld::Builder &xBuilder, std::vector< std::pair< OUString, OUString >> &&aDefaultStyles, const css::uno::Reference< css::frame::XDispatchProvider > &xDispatchProvider)
void StateChangedAtStatusListener(SfxItemState eState, const SfxPoolItem *pState) override
bool GetTextBoundRect(tools::Rectangle &rRect, const OUString &rStr, sal_Int32 nBase=0, sal_Int32 nIndex=0, sal_Int32 nLen=-1, sal_uLong nLayoutWidth=0, o3tl::span< const sal_Int32 > pDXArray={}, const SalLayoutGlyphs *pGlyphs=nullptr) const
SfxStyleFamily
constexpr tools::Long getHeight() const
void DrawRect(const tools::Rectangle &rRect)
const OUString & GetStyleName() const
css::uno::Reference< css::frame::XDispatchProvider > m_xDispatchProvider
void SetLineColor()
std::vector< std::pair< OUString, OUString > > m_aAllStyles
int i
static SalLayoutGlyphsCache * self()
tools::Long GetOutputHeightPixel() const
static css::drawing::FillStyle GetFillStyleFromItemSet(std::optional< SfxItemSet > const &pItemSet)
void SetSize(const Size &rSize)
void SetFillColor()
const Color & GetLineColor() const
CommandEventId GetCommand() const
static Color GetBackgroundColorFromItemSet(std::optional< SfxItemSet > const &pItemSet)
void SetTextColor(const Color &rColor)
Size get_preferred_size() const
Size GetOutputSizePixel() const
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
SfxStyleFamily m_eStyleFamily
const OUString & GetStyleName() const
static sal_Int16 getScriptType(LanguageType nLang)
exports com.sun.star. style
StylesPreviewWindow_Impl(vcl::Window *pParent, std::vector< std::pair< OUString, OUString >> &&aDefaultStyles, const css::uno::Reference< css::frame::XDispatchProvider > &xDispatchProvider)
constexpr tools::Long Bottom() const
const Point & GetMousePosPixel() const
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
std::pair< OUString, OUString > m_aStyleName
void Paint(vcl::RenderContext &rRenderContext)
const OUString & GetFamilyName() const
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)
StylesPreviewWindow_Base * m_pPreviewControl
static constexpr unsigned LEFT_MARGIN
void SetCaseMap(const SvxCaseMap eNew)
void Select(const OUString &rStyleName)
constexpr Size GetSize() const
void DrawHighlight(vcl::RenderContext &rRenderContext, Color aFontBack)
SfxItemState
Listener for styles creation or modification.
void Stop()
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
void SetFont(const vcl::Font &rNewFont)
SfxStyleSheetBase * Next()
virtual void dispose() override
void DrawText(vcl::RenderContext &rRenderContext)
MapUnit GetMapUnit() const
std::unique_ptr< weld::IconView > m_xStylesView
const OUString & GetStyleIdentifier() const
static VclPtr< reference_type > Create(Arg &&...arg)
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
StylesPreviewWindow_Base * m_pPreviewControl
tools::Long AdjustHeight(tools::Long n)
IMPL_LINK(StylesPreviewWindow_Base, Selected, weld::IconView &, rIconView, void)
StylesListUpdateTask m_aUpdateTask
virtual void Start(bool bStartTimer=true) override
static Color GetTextColorFromItemSet(std::optional< SfxItemSet > const &pItemSet)
rtl::Reference< StyleStatusListener > m_xStatusListener
StylePoolChangeListener(StylesPreviewWindow_Base *pPreviewControl)
constexpr OUStringLiteral first
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)
StyleItemController(const std::pair< OUString, OUString > &aStyleName)
void Dispatch(const OUString &aCommand, css::uno::Sequence< css::beans::PropertyValue > const &aArgs)
sal_Int16 GetCaseMap(sal_Int32 nToken)
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
const Color & GetFillColor() const
static Color GetHighlightColorFromItemSet(std::optional< SfxItemSet > const &pItemSet)
static SvxFont GetFontFromItems(const SvxFontItem *pFontItem, Size aPixelFontSize, std::optional< SfxItemSet > const &pItemSet)