1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX 25 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX 26 27 #include <drawinglayer/drawinglayerdllapi.h> 28 #include <drawinglayer/primitive2d/baseprimitive2d.hxx> 29 #include <drawinglayer/primitive2d/textenumsprimitive2d.hxx> 30 #include <basegfx/matrix/b2dhommatrix.hxx> 31 #include <basegfx/color/bcolor.hxx> 32 #include <drawinglayer/attribute/fontattribute.hxx> 33 #include <com/sun/star/lang/Locale.hpp> 34 35 ////////////////////////////////////////////////////////////////////////////// 36 37 namespace drawinglayer 38 { 39 namespace primitive2d 40 { 41 class DRAWINGLAYER_DLLPUBLIC BaseTextStrikeoutPrimitive2D : public BufferedDecompositionPrimitive2D 42 { 43 private: 44 /// geometric definitions 45 basegfx::B2DHomMatrix maObjectTransformation; 46 double mfWidth; 47 48 /// decoration definitions 49 basegfx::BColor maFontColor; 50 51 public: 52 /// constructor 53 BaseTextStrikeoutPrimitive2D( 54 const basegfx::B2DHomMatrix& rObjectTransformation, 55 double fWidth, 56 const basegfx::BColor& rFontColor); 57 58 /// data read access getObjectTransformation() const59 const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; } getWidth() const60 double getWidth() const { return mfWidth; } getFontColor() const61 const basegfx::BColor& getFontColor() const { return maFontColor; } 62 63 /// compare operator 64 virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; 65 }; 66 } // end of namespace primitive2d 67 } // end of namespace drawinglayer 68 69 ////////////////////////////////////////////////////////////////////////////// 70 71 namespace drawinglayer 72 { 73 namespace primitive2d 74 { 75 class DRAWINGLAYER_DLLPUBLIC TextCharacterStrikeoutPrimitive2D : public BaseTextStrikeoutPrimitive2D 76 { 77 private: 78 sal_Unicode maStrikeoutChar; 79 attribute::FontAttribute maFontAttribute; 80 ::com::sun::star::lang::Locale maLocale; 81 82 protected: 83 /// local decomposition. 84 virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; 85 86 public: 87 /// constructor 88 TextCharacterStrikeoutPrimitive2D( 89 const basegfx::B2DHomMatrix& rObjectTransformation, 90 double fWidth, 91 const basegfx::BColor& rFontColor, 92 sal_Unicode aStrikeoutChar, 93 const attribute::FontAttribute& rFontAttribute, 94 const ::com::sun::star::lang::Locale& rLocale); 95 96 /// data read access getStrikeoutChar() const97 sal_Unicode getStrikeoutChar() const { return maStrikeoutChar; } getFontAttribute() const98 const attribute::FontAttribute& getFontAttribute() const { return maFontAttribute; } getLocale() const99 const ::com::sun::star::lang::Locale& getLocale() const { return maLocale; } 100 101 /// compare operator 102 virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; 103 104 /// provide unique ID 105 DeclPrimitrive2DIDBlock() 106 }; 107 } // end of namespace primitive2d 108 } // end of namespace drawinglayer 109 110 ////////////////////////////////////////////////////////////////////////////// 111 112 namespace drawinglayer 113 { 114 namespace primitive2d 115 { 116 class DRAWINGLAYER_DLLPUBLIC TextGeometryStrikeoutPrimitive2D : public BaseTextStrikeoutPrimitive2D 117 { 118 private: 119 double mfHeight; 120 double mfOffset; 121 TextStrikeout meTextStrikeout; 122 123 protected: 124 /// local decomposition. 125 virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; 126 127 public: 128 /// constructor 129 TextGeometryStrikeoutPrimitive2D( 130 const basegfx::B2DHomMatrix& rObjectTransformation, 131 double fWidth, 132 const basegfx::BColor& rFontColor, 133 double fHeight, 134 double fOffset, 135 TextStrikeout eTextStrikeout); 136 137 /// data read access getHeight() const138 double getHeight() const { return mfHeight; } getOffset() const139 double getOffset() const { return mfOffset; } getTextStrikeout() const140 TextStrikeout getTextStrikeout() const { return meTextStrikeout; } 141 142 /// compare operator 143 virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; 144 145 /// provide unique ID 146 DeclPrimitrive2DIDBlock() 147 }; 148 } // end of namespace primitive2d 149 } // end of namespace drawinglayer 150 151 ////////////////////////////////////////////////////////////////////////////// 152 153 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX 154 155 ////////////////////////////////////////////////////////////////////////////// 156 // eof 157