1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 #include <drawinglayer/primitive2d/BufferedDecompositionPrimitive2D.hxx>
23 #include <drawinglayer/primitive2d/textenumsprimitive2d.hxx>
24 #include <basegfx/matrix/b2dhommatrix.hxx>
25 #include <basegfx/color/bcolor.hxx>
26 #include <drawinglayer/attribute/fontattribute.hxx>
27 #include <com/sun/star/lang/Locale.hpp>
30 namespace drawinglayer::primitive2d
32 class BaseTextStrikeoutPrimitive2D
: public BufferedDecompositionPrimitive2D
35 /// geometric definitions
36 basegfx::B2DHomMatrix maObjectTransformation
;
39 /// decoration definitions
40 basegfx::BColor maFontColor
;
44 BaseTextStrikeoutPrimitive2D(
45 basegfx::B2DHomMatrix aObjectTransformation
,
47 const basegfx::BColor
& rFontColor
);
50 const basegfx::B2DHomMatrix
& getObjectTransformation() const { return maObjectTransformation
; }
51 double getWidth() const { return mfWidth
; }
52 const basegfx::BColor
& getFontColor() const { return maFontColor
; }
55 virtual bool operator==( const BasePrimitive2D
& rPrimitive
) const override
;
58 } // end of namespace drawinglayer::primitive2d
61 namespace drawinglayer::primitive2d
63 class TextCharacterStrikeoutPrimitive2D final
: public BaseTextStrikeoutPrimitive2D
66 sal_Unicode maStrikeoutChar
;
67 attribute::FontAttribute maFontAttribute
;
68 css::lang::Locale maLocale
;
70 /// local decomposition.
71 virtual void create2DDecomposition(Primitive2DContainer
& rContainer
, const geometry::ViewInformation2D
& rViewInformation
) const override
;
75 TextCharacterStrikeoutPrimitive2D(
76 const basegfx::B2DHomMatrix
& rObjectTransformation
,
78 const basegfx::BColor
& rFontColor
,
79 sal_Unicode aStrikeoutChar
,
80 attribute::FontAttribute aFontAttribute
,
81 css::lang::Locale aLocale
);
84 sal_Unicode
getStrikeoutChar() const { return maStrikeoutChar
; }
85 const attribute::FontAttribute
& getFontAttribute() const { return maFontAttribute
; }
86 const css::lang::Locale
& getLocale() const { return maLocale
; }
89 virtual bool operator==( const BasePrimitive2D
& rPrimitive
) const override
;
92 virtual sal_uInt32
getPrimitive2DID() const override
;
95 } // end of namespace drawinglayer::primitive2d
98 namespace drawinglayer::primitive2d
100 class TextGeometryStrikeoutPrimitive2D final
: public BaseTextStrikeoutPrimitive2D
105 TextStrikeout meTextStrikeout
;
107 /// local decomposition.
108 virtual void create2DDecomposition(Primitive2DContainer
& rContainer
, const geometry::ViewInformation2D
& rViewInformation
) const override
;
112 TextGeometryStrikeoutPrimitive2D(
113 const basegfx::B2DHomMatrix
& rObjectTransformation
,
115 const basegfx::BColor
& rFontColor
,
118 TextStrikeout eTextStrikeout
);
121 double getHeight() const { return mfHeight
; }
122 double getOffset() const { return mfOffset
; }
123 TextStrikeout
getTextStrikeout() const { return meTextStrikeout
; }
126 virtual bool operator==( const BasePrimitive2D
& rPrimitive
) const override
;
128 /// provide unique ID
129 virtual sal_uInt32
getPrimitive2DID() const override
;
132 } // end of namespace drawinglayer::primitive2d
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */