Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX
30 : : #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX
31 : :
32 : : #include <drawinglayer/drawinglayerdllapi.h>
33 : :
34 : : #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
35 : : #include <drawinglayer/primitive2d/textenumsprimitive2d.hxx>
36 : : #include <basegfx/matrix/b2dhommatrix.hxx>
37 : : #include <basegfx/color/bcolor.hxx>
38 : : #include <drawinglayer/attribute/fontattribute.hxx>
39 : : #include <com/sun/star/lang/Locale.hpp>
40 : :
41 : : //////////////////////////////////////////////////////////////////////////////
42 : :
43 : : namespace drawinglayer
44 : : {
45 : : namespace primitive2d
46 : : {
47 [ + - ][ - + ]: 1247 : class DRAWINGLAYER_DLLPUBLIC BaseTextStrikeoutPrimitive2D : public BufferedDecompositionPrimitive2D
48 : : {
49 : : private:
50 : : /// geometric definitions
51 : : basegfx::B2DHomMatrix maObjectTransformation;
52 : : double mfWidth;
53 : :
54 : : /// decoration definitions
55 : : basegfx::BColor maFontColor;
56 : :
57 : : public:
58 : : /// constructor
59 : : BaseTextStrikeoutPrimitive2D(
60 : : const basegfx::B2DHomMatrix& rObjectTransformation,
61 : : double fWidth,
62 : : const basegfx::BColor& rFontColor);
63 : :
64 : : /// data read access
65 : 1319 : const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
66 : 1247 : double getWidth() const { return mfWidth; }
67 : 1247 : const basegfx::BColor& getFontColor() const { return maFontColor; }
68 : :
69 : : /// compare operator
70 : : virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
71 : : };
72 : : } // end of namespace primitive2d
73 : : } // end of namespace drawinglayer
74 : :
75 : : //////////////////////////////////////////////////////////////////////////////
76 : :
77 : : namespace drawinglayer
78 : : {
79 : : namespace primitive2d
80 : : {
81 [ + - ][ - + ]: 144 : class DRAWINGLAYER_DLLPUBLIC TextCharacterStrikeoutPrimitive2D : public BaseTextStrikeoutPrimitive2D
82 : : {
83 : : private:
84 : : sal_Unicode maStrikeoutChar;
85 : : attribute::FontAttribute maFontAttribute;
86 : : ::com::sun::star::lang::Locale maLocale;
87 : :
88 : : protected:
89 : : /// local decomposition.
90 : : virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
91 : :
92 : : public:
93 : : /// constructor
94 : : TextCharacterStrikeoutPrimitive2D(
95 : : const basegfx::B2DHomMatrix& rObjectTransformation,
96 : : double fWidth,
97 : : const basegfx::BColor& rFontColor,
98 : : sal_Unicode aStrikeoutChar,
99 : : const attribute::FontAttribute& rFontAttribute,
100 : : const ::com::sun::star::lang::Locale& rLocale);
101 : :
102 : : /// data read access
103 : 72 : sal_Unicode getStrikeoutChar() const { return maStrikeoutChar; }
104 : 144 : const attribute::FontAttribute& getFontAttribute() const { return maFontAttribute; }
105 : 144 : const ::com::sun::star::lang::Locale& getLocale() const { return maLocale; }
106 : :
107 : : /// compare operator
108 : : virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
109 : :
110 : : /// provide unique ID
111 : : DeclPrimitrive2DIDBlock()
112 : : };
113 : : } // end of namespace primitive2d
114 : : } // end of namespace drawinglayer
115 : :
116 : : //////////////////////////////////////////////////////////////////////////////
117 : :
118 : : namespace drawinglayer
119 : : {
120 : : namespace primitive2d
121 : : {
122 [ - + ]: 2350 : class DRAWINGLAYER_DLLPUBLIC TextGeometryStrikeoutPrimitive2D : public BaseTextStrikeoutPrimitive2D
123 : : {
124 : : private:
125 : : double mfHeight;
126 : : double mfOffset;
127 : : TextStrikeout meTextStrikeout;
128 : :
129 : : protected:
130 : : /// local decomposition.
131 : : virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
132 : :
133 : : public:
134 : : /// constructor
135 : : TextGeometryStrikeoutPrimitive2D(
136 : : const basegfx::B2DHomMatrix& rObjectTransformation,
137 : : double fWidth,
138 : : const basegfx::BColor& rFontColor,
139 : : double fHeight,
140 : : double fOffset,
141 : : TextStrikeout eTextStrikeout);
142 : :
143 : : /// data read access
144 : 1175 : double getHeight() const { return mfHeight; }
145 : 1175 : double getOffset() const { return mfOffset; }
146 : 1175 : TextStrikeout getTextStrikeout() const { return meTextStrikeout; }
147 : :
148 : : /// compare operator
149 : : virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
150 : :
151 : : /// provide unique ID
152 : : DeclPrimitrive2DIDBlock()
153 : : };
154 : : } // end of namespace primitive2d
155 : : } // end of namespace drawinglayer
156 : :
157 : : //////////////////////////////////////////////////////////////////////////////
158 : :
159 : : #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX
160 : :
161 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|