Coverage Report

Created: 2026-04-09 11:41

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/cppcanvas/source/mtfrenderer/textlineshelper.hxx
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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 <com/sun/star/uno/Sequence.hxx>
13
#include <com/sun/star/uno/Reference.hxx>
14
#include <com/sun/star/rendering/RenderState.hpp>
15
#include <basegfx/vector/b2dsize.hxx>
16
#include <cppcanvas/canvas.hxx>
17
18
namespace com::sun::star::rendering
19
{
20
class XPolyPolygon2D;
21
}
22
23
namespace cppcanvastools
24
{
25
struct TextLineInfo;
26
}
27
28
namespace cppcanvas
29
{
30
namespace internal
31
{
32
struct OutDevState;
33
34
class TextLinesHelper
35
{
36
    const CanvasSharedPtr mpCanvas;
37
    css::uno::Reference<css::rendering::XPolyPolygon2D> mxOverline;
38
    css::uno::Reference<css::rendering::XPolyPolygon2D> mxUnderline;
39
    css::uno::Reference<css::rendering::XPolyPolygon2D> mxStrikeout;
40
41
    ::basegfx::B2DSize maOverallSize;
42
43
    bool mbIsOverlineColorSet;
44
    const css::uno::Sequence<double> maOverlineColor;
45
46
    bool mbIsUnderlineColorSet;
47
    const css::uno::Sequence<double> maUnderlineColor;
48
49
    bool mbOverlineWaveline;
50
    bool mbUnderlineWaveline;
51
52
    bool mbOverlineWavelineBold;
53
    bool mbUnderlineWavelineBold;
54
55
public:
56
    TextLinesHelper(CanvasSharedPtr xCanvas, const OutDevState& rState);
57
58
0
    ::basegfx::B2DSize const& getOverallSize() const { return maOverallSize; }
59
60
    /** Init textlines with specified linewidth and TextLineInfo.
61
     */
62
    void init(double nLineWidth, const cppcanvastools::TextLineInfo& rLineInfo);
63
64
    /** Fill the textlines with colors.
65
        OutDevState::textUnderlineColor.
66
67
        @param rRenderState
68
        Used to invoke XCanvas::fillPolyPolygon.
69
70
        @param bNormalText
71
        Use overline color and underline color if the value is true, ignore those
72
        colors otherwise ( typical case is to render the shadow ).
73
     */
74
    void render(const css::rendering::RenderState& rRenderState, bool bNormalText) const;
75
};
76
}
77
}
78
79
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */