Bump version to 21.06.18.1
[LibreOffice.git] / cppcanvas / source / mtfrenderer / textlineshelper.hxx
blob38105961ee05d1954e5e0abbb71cad21a24ee7b3
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.
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 */
10 #pragma once
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>
18 namespace com::sun::star::rendering
20 class XPolyPolygon2D;
23 namespace cppcanvas
25 namespace tools
27 struct TextLineInfo;
30 namespace internal
32 struct OutDevState;
34 class TextLinesHelper
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;
41 ::basegfx::B2DSize maOverallSize;
43 bool mbIsOverlineColorSet;
44 const css::uno::Sequence<double> maOverlineColor;
46 bool mbIsUnderlineColorSet;
47 const css::uno::Sequence<double> maUnderlineColor;
49 bool mbOverlineWaveline;
50 bool mbUnderlineWaveline;
52 bool mbOverlineWavelineBold;
53 bool mbUnderlineWavelineBold;
55 public:
56 TextLinesHelper(const CanvasSharedPtr& rCanvas, const OutDevState& rState);
58 ::basegfx::B2DSize const& getOverallSize() const { return maOverallSize; }
60 /** Init textlines with specified linewidth and TextLineInfo.
62 void init(double nLineWidth, const tools::TextLineInfo& rLineInfo);
64 /** Fill the textlines with colors.
65 OutDevState::textUnderlineColor.
67 @param rRenderState
68 Used to invoke XCanvas::fillPolyPolygon.
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 ).
74 void render(const css::rendering::RenderState& rRenderState, bool bNormalText) const;
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */