Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX
21 : #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX
22 :
23 : #include <drawinglayer/drawinglayerdllapi.h>
24 :
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>
31 :
32 :
33 :
34 : namespace drawinglayer
35 : {
36 : namespace primitive2d
37 : {
38 1360 : class DRAWINGLAYER_DLLPUBLIC BaseTextStrikeoutPrimitive2D : public BufferedDecompositionPrimitive2D
39 : {
40 : private:
41 : /// geometric definitions
42 : basegfx::B2DHomMatrix maObjectTransformation;
43 : double mfWidth;
44 :
45 : /// decoration definitions
46 : basegfx::BColor maFontColor;
47 :
48 : public:
49 : /// constructor
50 : BaseTextStrikeoutPrimitive2D(
51 : const basegfx::B2DHomMatrix& rObjectTransformation,
52 : double fWidth,
53 : const basegfx::BColor& rFontColor);
54 :
55 : /// data read access
56 1374 : const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
57 1366 : double getWidth() const { return mfWidth; }
58 1366 : const basegfx::BColor& getFontColor() const { return maFontColor; }
59 :
60 : /// compare operator
61 : virtual bool operator==( const BasePrimitive2D& rPrimitive ) const SAL_OVERRIDE;
62 : };
63 : } // end of namespace primitive2d
64 : } // end of namespace drawinglayer
65 :
66 :
67 :
68 : namespace drawinglayer
69 : {
70 : namespace primitive2d
71 : {
72 4 : class DRAWINGLAYER_DLLPUBLIC TextCharacterStrikeoutPrimitive2D : public BaseTextStrikeoutPrimitive2D
73 : {
74 : private:
75 : sal_Unicode maStrikeoutChar;
76 : attribute::FontAttribute maFontAttribute;
77 : ::com::sun::star::lang::Locale maLocale;
78 :
79 : protected:
80 : /// local decomposition.
81 : virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const SAL_OVERRIDE;
82 :
83 : public:
84 : /// constructor
85 : TextCharacterStrikeoutPrimitive2D(
86 : const basegfx::B2DHomMatrix& rObjectTransformation,
87 : double fWidth,
88 : const basegfx::BColor& rFontColor,
89 : sal_Unicode aStrikeoutChar,
90 : const attribute::FontAttribute& rFontAttribute,
91 : const ::com::sun::star::lang::Locale& rLocale);
92 :
93 : /// data read access
94 8 : sal_Unicode getStrikeoutChar() const { return maStrikeoutChar; }
95 16 : const attribute::FontAttribute& getFontAttribute() const { return maFontAttribute; }
96 16 : const ::com::sun::star::lang::Locale& getLocale() const { return maLocale; }
97 :
98 : /// compare operator
99 : virtual bool operator==( const BasePrimitive2D& rPrimitive ) const SAL_OVERRIDE;
100 :
101 : /// provide unique ID
102 : DeclPrimitive2DIDBlock()
103 : };
104 : } // end of namespace primitive2d
105 : } // end of namespace drawinglayer
106 :
107 :
108 :
109 : namespace drawinglayer
110 : {
111 : namespace primitive2d
112 : {
113 2716 : class DRAWINGLAYER_DLLPUBLIC TextGeometryStrikeoutPrimitive2D : public BaseTextStrikeoutPrimitive2D
114 : {
115 : private:
116 : double mfHeight;
117 : double mfOffset;
118 : TextStrikeout meTextStrikeout;
119 :
120 : protected:
121 : /// local decomposition.
122 : virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const SAL_OVERRIDE;
123 :
124 : public:
125 : /// constructor
126 : TextGeometryStrikeoutPrimitive2D(
127 : const basegfx::B2DHomMatrix& rObjectTransformation,
128 : double fWidth,
129 : const basegfx::BColor& rFontColor,
130 : double fHeight,
131 : double fOffset,
132 : TextStrikeout eTextStrikeout);
133 :
134 : /// data read access
135 1358 : double getHeight() const { return mfHeight; }
136 1358 : double getOffset() const { return mfOffset; }
137 1358 : TextStrikeout getTextStrikeout() const { return meTextStrikeout; }
138 :
139 : /// compare operator
140 : virtual bool operator==( const BasePrimitive2D& rPrimitive ) const SAL_OVERRIDE;
141 :
142 : /// provide unique ID
143 : DeclPrimitive2DIDBlock()
144 : };
145 : } // end of namespace primitive2d
146 : } // end of namespace drawinglayer
147 :
148 :
149 :
150 : #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX
151 :
152 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|