Coverage Report

Created: 2026-03-31 11:00

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/sfx2/StylePreviewRenderer.hxx
Line
Count
Source
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_SFX2_STYLEPREVIEWRENDERER_HXX
11
#define INCLUDED_SFX2_STYLEPREVIEWRENDERER_HXX
12
13
#include <sfx2/dllapi.h>
14
#include <tools/long.hxx>
15
16
#include <string_view>
17
18
class Color;
19
class OutputDevice;
20
class SfxObjectShell;
21
class SfxStyleSheetBase;
22
namespace tools { class Rectangle; }
23
24
namespace sfx2
25
{
26
27
class SFX2_DLLPUBLIC StylePreviewRenderer
28
{
29
protected:
30
    const SfxObjectShell& mrShell;
31
    OutputDevice& mrOutputDev;
32
    SfxStyleSheetBase* mpStyle;
33
    tools::Long mnMaxHeight;
34
35
public:
36
    enum class RenderAlign
37
    {
38
        TOP, CENTER
39
    };
40
41
    StylePreviewRenderer(const SfxObjectShell& rShell,
42
                         OutputDevice& rOutputDev,
43
                         SfxStyleSheetBase* pStyle,
44
                         tools::Long nMaxHeight)
45
        : mrShell(rShell)
46
        , mrOutputDev(rOutputDev)
47
        , mpStyle(pStyle)
48
        , mnMaxHeight(nMaxHeight)
49
0
    {}
50
51
    virtual ~StylePreviewRenderer()
52
0
    {}
53
54
    virtual bool recalculate() = 0;
55
    virtual bool render(const tools::Rectangle& aRectangle, RenderAlign eRenderAlign = RenderAlign::CENTER) = 0;
56
};
57
58
} // end namespace sfx2
59
60
SFX2_DLLPUBLIC Color ColorHash(std::u16string_view rString);
61
62
#endif // INCLUDED_SVX_STYLEPREVIEWRENDERER_HXX
63
64
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */