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/editeng.hxx>
16#include <editeng/svxfont.hxx>
17#include <sfx2/objsh.hxx>
19#include <rtl/ustring.hxx>
20#include <tools/color.hxx>
21#include <tools/gen.hxx>
22
23class OutputDevice;
25
26using namespace css;
27
28namespace svx
29{
31{
32 std::optional<SvxFont> m_oFont;
33 std::optional<SvxFont> m_oCJKFont;
34 std::optional<SvxFont> m_oCTLFont;
40 OUString maStyleName;
41 OUString maScriptText;
43 {
46 sal_Int32 changePos;
47 ScriptInfo(SvtScriptType scrptType, sal_Int32 position)
48 : textWidth(0)
49 , scriptType(scrptType)
51 {
52 }
53 };
54 std::vector<ScriptInfo> maScriptChanges;
55
56 bool SetFontSize(const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont& rFont);
57 void CalcRenderSize();
58 void CheckScript();
59
60public:
62 SfxStyleSheetBase* pStyle, tools::Long nMaxHeight);
63 virtual ~CommonStylePreviewRenderer() override;
64
65 virtual bool recalculate() override;
66 virtual bool render(const tools::Rectangle& aRectangle,
67 RenderAlign eRenderAlign = RenderAlign::CENTER) override;
68};
69
70} // end namespace svx
71
72/* 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
bool SetFontSize(const SfxItemSet &rSet, sal_uInt16 nSlot, SvxFont &rFont)
SvtScriptType
def position(n=-1)
long Long
ScriptInfo(SvtScriptType scrptType, sal_Int32 position)