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