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 .
20 #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX
21 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX
23 #include <drawinglayer/drawinglayerdllapi.h>
25 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
26 #include <drawinglayer/primitive2d/textenumsprimitive2d.hxx>
27 #include <basegfx/matrix/b2dhommatrix.hxx>
28 #include <basegfx/color/bcolor.hxx>
29 #include <drawinglayer/attribute/fontattribute.hxx>
30 #include <com/sun/star/lang/Locale.hpp>
33 namespace drawinglayer
37 class DRAWINGLAYER_DLLPUBLIC BaseTextStrikeoutPrimitive2D
: public BufferedDecompositionPrimitive2D
40 /// geometric definitions
41 basegfx::B2DHomMatrix maObjectTransformation
;
44 /// decoration definitions
45 basegfx::BColor maFontColor
;
49 BaseTextStrikeoutPrimitive2D(
50 const basegfx::B2DHomMatrix
& rObjectTransformation
,
52 const basegfx::BColor
& rFontColor
);
55 const basegfx::B2DHomMatrix
& getObjectTransformation() const { return maObjectTransformation
; }
56 double getWidth() const { return mfWidth
; }
57 const basegfx::BColor
& getFontColor() const { return maFontColor
; }
60 virtual bool operator==( const BasePrimitive2D
& rPrimitive
) const override
;
62 } // end of namespace primitive2d
63 } // end of namespace drawinglayer
66 namespace drawinglayer
70 class DRAWINGLAYER_DLLPUBLIC TextCharacterStrikeoutPrimitive2D
: public BaseTextStrikeoutPrimitive2D
73 sal_Unicode maStrikeoutChar
;
74 attribute::FontAttribute maFontAttribute
;
75 css::lang::Locale maLocale
;
78 /// local decomposition.
79 virtual void create2DDecomposition(Primitive2DContainer
& rContainer
, const geometry::ViewInformation2D
& rViewInformation
) const override
;
83 TextCharacterStrikeoutPrimitive2D(
84 const basegfx::B2DHomMatrix
& rObjectTransformation
,
86 const basegfx::BColor
& rFontColor
,
87 sal_Unicode aStrikeoutChar
,
88 const attribute::FontAttribute
& rFontAttribute
,
89 const css::lang::Locale
& rLocale
);
92 sal_Unicode
getStrikeoutChar() const { return maStrikeoutChar
; }
93 const attribute::FontAttribute
& getFontAttribute() const { return maFontAttribute
; }
94 const css::lang::Locale
& getLocale() const { return maLocale
; }
97 virtual bool operator==( const BasePrimitive2D
& rPrimitive
) const override
;
100 DeclPrimitive2DIDBlock()
102 } // end of namespace primitive2d
103 } // end of namespace drawinglayer
106 namespace drawinglayer
108 namespace primitive2d
110 class DRAWINGLAYER_DLLPUBLIC TextGeometryStrikeoutPrimitive2D
: public BaseTextStrikeoutPrimitive2D
115 TextStrikeout meTextStrikeout
;
118 /// local decomposition.
119 virtual void create2DDecomposition(Primitive2DContainer
& rContainer
, const geometry::ViewInformation2D
& rViewInformation
) const override
;
123 TextGeometryStrikeoutPrimitive2D(
124 const basegfx::B2DHomMatrix
& rObjectTransformation
,
126 const basegfx::BColor
& rFontColor
,
129 TextStrikeout eTextStrikeout
);
132 double getHeight() const { return mfHeight
; }
133 double getOffset() const { return mfOffset
; }
134 TextStrikeout
getTextStrikeout() const { return meTextStrikeout
; }
137 virtual bool operator==( const BasePrimitive2D
& rPrimitive
) const override
;
139 /// provide unique ID
140 DeclPrimitive2DIDBlock()
142 } // end of namespace primitive2d
143 } // end of namespace drawinglayer
146 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX
148 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */