build fix: no comphelper/profilezone.hxx in this branch
[LibreOffice.git] / include / drawinglayer / primitive2d / textstrikeoutprimitive2d.hxx
blobb3771c56e8c6509acfa6344c50c7765cd2b32083
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
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
35 namespace primitive2d
37 class DRAWINGLAYER_DLLPUBLIC BaseTextStrikeoutPrimitive2D : public BufferedDecompositionPrimitive2D
39 private:
40 /// geometric definitions
41 basegfx::B2DHomMatrix maObjectTransformation;
42 double mfWidth;
44 /// decoration definitions
45 basegfx::BColor maFontColor;
47 public:
48 /// constructor
49 BaseTextStrikeoutPrimitive2D(
50 const basegfx::B2DHomMatrix& rObjectTransformation,
51 double fWidth,
52 const basegfx::BColor& rFontColor);
54 /// data read access
55 const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
56 double getWidth() const { return mfWidth; }
57 const basegfx::BColor& getFontColor() const { return maFontColor; }
59 /// compare operator
60 virtual bool operator==( const BasePrimitive2D& rPrimitive ) const override;
62 } // end of namespace primitive2d
63 } // end of namespace drawinglayer
66 namespace drawinglayer
68 namespace primitive2d
70 class DRAWINGLAYER_DLLPUBLIC TextCharacterStrikeoutPrimitive2D : public BaseTextStrikeoutPrimitive2D
72 private:
73 sal_Unicode maStrikeoutChar;
74 attribute::FontAttribute maFontAttribute;
75 css::lang::Locale maLocale;
77 protected:
78 /// local decomposition.
79 virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
81 public:
82 /// constructor
83 TextCharacterStrikeoutPrimitive2D(
84 const basegfx::B2DHomMatrix& rObjectTransformation,
85 double fWidth,
86 const basegfx::BColor& rFontColor,
87 sal_Unicode aStrikeoutChar,
88 const attribute::FontAttribute& rFontAttribute,
89 const css::lang::Locale& rLocale);
91 /// data read access
92 sal_Unicode getStrikeoutChar() const { return maStrikeoutChar; }
93 const attribute::FontAttribute& getFontAttribute() const { return maFontAttribute; }
94 const css::lang::Locale& getLocale() const { return maLocale; }
96 /// compare operator
97 virtual bool operator==( const BasePrimitive2D& rPrimitive ) const override;
99 /// provide unique ID
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
112 private:
113 double mfHeight;
114 double mfOffset;
115 TextStrikeout meTextStrikeout;
117 protected:
118 /// local decomposition.
119 virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
121 public:
122 /// constructor
123 TextGeometryStrikeoutPrimitive2D(
124 const basegfx::B2DHomMatrix& rObjectTransformation,
125 double fWidth,
126 const basegfx::BColor& rFontColor,
127 double fHeight,
128 double fOffset,
129 TextStrikeout eTextStrikeout);
131 /// data read access
132 double getHeight() const { return mfHeight; }
133 double getOffset() const { return mfOffset; }
134 TextStrikeout getTextStrikeout() const { return meTextStrikeout; }
136 /// compare operator
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: */