1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
15 #include <editeng/editeng.hxx>
16 #include <editeng/svxfont.hxx>
17 #include <sfx2/objsh.hxx>
18 #include <sfx2/StylePreviewRenderer.hxx>
19 #include <rtl/ustring.hxx>
20 #include <tools/color.hxx>
21 #include <tools/gen.hxx>
24 class SfxStyleSheetBase
;
30 class CommonStylePreviewRenderer final
: public sfx2::StylePreviewRenderer
32 std::optional
<SvxFont
> m_oFont
;
33 std::optional
<SvxFont
> m_oCJKFont
;
34 std::optional
<SvxFont
> m_oCTLFont
;
36 Color maHighlightColor
;
37 Color maBackgroundColor
;
39 tools::Long mnBaseLine
;
41 OUString maScriptText
;
44 tools::Long textWidth
;
45 SvtScriptType scriptType
;
47 ScriptInfo(SvtScriptType scrptType
, sal_Int32 position
)
49 , scriptType(scrptType
)
54 std::vector
<ScriptInfo
> maScriptChanges
;
56 bool SetFontSize(const SfxItemSet
& rSet
, sal_uInt16 nSlot
, SvxFont
& rFont
);
57 void CalcRenderSize();
61 CommonStylePreviewRenderer(const SfxObjectShell
& rShell
, OutputDevice
& rOutputDev
,
62 SfxStyleSheetBase
* pStyle
, tools::Long nMaxHeight
);
63 virtual ~CommonStylePreviewRenderer() override
;
65 virtual bool recalculate() override
;
66 virtual bool render(const tools::Rectangle
& aRectangle
,
67 RenderAlign eRenderAlign
= RenderAlign::CENTER
) override
;
70 } // end namespace svx
72 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */