LibreOffice Module svx (master) 1
CommonStylePreviewRenderer.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
10#pragma once
11
12#include <optional>
13#include <vector>
14
15#include <editeng/svxfont.hxx>
16#include <sfx2/objsh.hxx>
18#include <rtl/ustring.hxx>
19#include <tools/color.hxx>
20#include <tools/gen.hxx>
21
22#include <com/sun/star/uno/Reference.h>
23#include <com/sun/star/i18n/BreakIterator.hpp>
24
25class OutputDevice;
27
28using namespace css;
29
30namespace svx
31{
33{
34 std::optional<SvxFont> m_oFont;
35 std::optional<SvxFont> m_oCJKFont;
36 std::optional<SvxFont> m_oCTLFont;
42 OUString maStyleName;
43 OUString maScriptText;
44 css::uno::Reference<css::i18n::XBreakIterator> mxBreak;
46 {
48 sal_uInt16 scriptType;
49 sal_Int32 changePos;
50 ScriptInfo(sal_uInt16 scrptType, sal_Int32 position)
51 : textWidth(0)
52 , scriptType(scrptType)
54 {
55 }
56 };
57 std::vector<ScriptInfo> maScriptChanges;
58
59 bool SetFontSize(const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont& rFont);
60 void CalcRenderSize();
61 void CheckScript();
62
63public:
65 SfxStyleSheetBase* pStyle, tools::Long nMaxHeight);
66 virtual ~CommonStylePreviewRenderer() override;
67
68 virtual bool recalculate() override;
69 virtual bool render(const tools::Rectangle& aRectangle,
70 RenderAlign eRenderAlign = RenderAlign::CENTER) override;
71};
72
73} // end namespace svx
74
75/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
CommonStylePreviewRenderer(const SfxObjectShell &rShell, OutputDevice &rOutputDev, SfxStyleSheetBase *pStyle, tools::Long nMaxHeight)
virtual bool render(const tools::Rectangle &aRectangle, RenderAlign eRenderAlign=RenderAlign::CENTER) override
css::uno::Reference< css::i18n::XBreakIterator > mxBreak
bool SetFontSize(const SfxItemSet &rSet, sal_uInt16 nSlot, SvxFont &rFont)
def position(n=-1)
long Long
ScriptInfo(sal_uInt16 scrptType, sal_Int32 position)