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>
34 namespace drawinglayer
38 class DRAWINGLAYER_DLLPUBLIC BaseTextStrikeoutPrimitive2D
: public BufferedDecompositionPrimitive2D
41 /// geometric definitions
42 basegfx::B2DHomMatrix maObjectTransformation
;
45 /// decoration definitions
46 basegfx::BColor maFontColor
;
50 BaseTextStrikeoutPrimitive2D(
51 const basegfx::B2DHomMatrix
& rObjectTransformation
,
53 const basegfx::BColor
& rFontColor
);
56 const basegfx::B2DHomMatrix
& getObjectTransformation() const { return maObjectTransformation
; }
57 double getWidth() const { return mfWidth
; }
58 const basegfx::BColor
& getFontColor() const { return maFontColor
; }
61 virtual bool operator==( const BasePrimitive2D
& rPrimitive
) const SAL_OVERRIDE
;
63 } // end of namespace primitive2d
64 } // end of namespace drawinglayer
68 namespace drawinglayer
72 class DRAWINGLAYER_DLLPUBLIC TextCharacterStrikeoutPrimitive2D
: public BaseTextStrikeoutPrimitive2D
75 sal_Unicode maStrikeoutChar
;
76 attribute::FontAttribute maFontAttribute
;
77 ::com::sun::star::lang::Locale maLocale
;
80 /// local decomposition.
81 virtual Primitive2DSequence
create2DDecomposition(const geometry::ViewInformation2D
& rViewInformation
) const SAL_OVERRIDE
;
85 TextCharacterStrikeoutPrimitive2D(
86 const basegfx::B2DHomMatrix
& rObjectTransformation
,
88 const basegfx::BColor
& rFontColor
,
89 sal_Unicode aStrikeoutChar
,
90 const attribute::FontAttribute
& rFontAttribute
,
91 const ::com::sun::star::lang::Locale
& rLocale
);
94 sal_Unicode
getStrikeoutChar() const { return maStrikeoutChar
; }
95 const attribute::FontAttribute
& getFontAttribute() const { return maFontAttribute
; }
96 const ::com::sun::star::lang::Locale
& getLocale() const { return maLocale
; }
99 virtual bool operator==( const BasePrimitive2D
& rPrimitive
) const SAL_OVERRIDE
;
101 /// provide unique ID
102 DeclPrimitive2DIDBlock()
104 } // end of namespace primitive2d
105 } // end of namespace drawinglayer
109 namespace drawinglayer
111 namespace primitive2d
113 class DRAWINGLAYER_DLLPUBLIC TextGeometryStrikeoutPrimitive2D
: public BaseTextStrikeoutPrimitive2D
118 TextStrikeout meTextStrikeout
;
121 /// local decomposition.
122 virtual Primitive2DSequence
create2DDecomposition(const geometry::ViewInformation2D
& rViewInformation
) const SAL_OVERRIDE
;
126 TextGeometryStrikeoutPrimitive2D(
127 const basegfx::B2DHomMatrix
& rObjectTransformation
,
129 const basegfx::BColor
& rFontColor
,
132 TextStrikeout eTextStrikeout
);
135 double getHeight() const { return mfHeight
; }
136 double getOffset() const { return mfOffset
; }
137 TextStrikeout
getTextStrikeout() const { return meTextStrikeout
; }
140 virtual bool operator==( const BasePrimitive2D
& rPrimitive
) const SAL_OVERRIDE
;
142 /// provide unique ID
143 DeclPrimitive2DIDBlock()
145 } // end of namespace primitive2d
146 } // end of namespace drawinglayer
150 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX
152 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */