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 #ifndef INCLUDED_SVX_COMMONSTYLEPREVIEWRENDERER_HXX
11 #define INCLUDED_SVX_COMMONSTYLEPREVIEWRENDERER_HXX
12 
13 #include <memory>
14 
15 #include <sfx2/objsh.hxx>
16 #include <sfx2/StylePreviewRenderer.hxx>
17 #include <svx/svxdllapi.h>
18 #include <rtl/ustring.hxx>
19 #include <tools/color.hxx>
20 #include <tools/gen.hxx>
21 
22 class OutputDevice;
23 class SfxStyleSheetBase;
24 class SvxFont;
25 
26 namespace svx
27 {
28 
29 class SVX_DLLPUBLIC CommonStylePreviewRenderer final : public sfx2::StylePreviewRenderer
30 {
31     std::unique_ptr<SvxFont> m_pFont;
32     Color maFontColor;
33     Color maBackgroundColor;
34     Size maPixelSize;
35     OUString const maStyleName;
36 
37 public:
38     CommonStylePreviewRenderer(const SfxObjectShell& rShell, OutputDevice& rOutputDev,
39                                SfxStyleSheetBase* pStyle, long nMaxHeight);
40     virtual ~CommonStylePreviewRenderer() override;
41 
42     virtual bool recalculate() override;
43     virtual Size getRenderSize() override;
44     virtual bool render(const tools::Rectangle& aRectangle, RenderAlign eRenderAlign = RenderAlign::CENTER) override;
45 };
46 
47 } // end namespace svx
48 
49 #endif // INCLUDED_SVX_COMMONSTYLEPREVIEWRENDERER_HXX
50 
51 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
52