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_WRONGSPELLPRIMITIVE2D_HXX 25 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WRONGSPELLPRIMITIVE2D_HXX 26 27 #include <drawinglayer/drawinglayerdllapi.h> 28 #include <drawinglayer/primitive2d/baseprimitive2d.hxx> 29 #include <basegfx/color/bcolor.hxx> 30 #include <basegfx/matrix/b2dhommatrix.hxx> 31 32 ////////////////////////////////////////////////////////////////////////////// 33 // WrongSpellPrimitive2D class 34 35 namespace drawinglayer 36 { 37 namespace primitive2d 38 { 39 /** WrongSpellPrimitive2D class 40 41 This is a helper primitive to hold evtl. WrongSpell visualisations 42 in the sequence of primitives. The primitive holds this information 43 separated form the TextPortions to where it belongs to tot expand the 44 TextSimplePortionPrimitive2D more as needed. 45 46 A renderer who does not want to visualize this (if contained at all) 47 can detect and ignore this primitive. If it's decomposition is used, 48 it will be visualized as red wavelines. 49 50 The geometric definition defines a line on the X-Axis (no Y-coordinates) 51 which will when transformed by Transformation, create the coordinate data. 52 */ 53 class DRAWINGLAYER_DLLPUBLIC WrongSpellPrimitive2D : public BufferedDecompositionPrimitive2D 54 { 55 private: 56 /// geometry definition 57 basegfx::B2DHomMatrix maTransformation; 58 double mfStart; 59 double mfStop; 60 61 /// color (usually red) 62 basegfx::BColor maColor; 63 64 protected: 65 /// create local decomposition 66 virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; 67 68 public: 69 /// constructor 70 WrongSpellPrimitive2D( 71 const basegfx::B2DHomMatrix& rTransformation, 72 double fStart, 73 double fStop, 74 const basegfx::BColor& rColor); 75 76 /// data read access getTransformation() const77 const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; } getStart() const78 double getStart() const { return mfStart; } getStop() const79 double getStop() const { return mfStop; } getColor() const80 const basegfx::BColor& getColor() const { return maColor; } 81 82 /// compare operator 83 virtual bool operator==(const BasePrimitive2D& rPrimitive) const; 84 85 /// provide unique ID 86 DeclPrimitrive2DIDBlock() 87 }; 88 } // end of namespace primitive2d 89 } // end of namespace drawinglayer 90 91 ////////////////////////////////////////////////////////////////////////////// 92 93 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WRONGSPELLPRIMITIVE2D_HXX 94 95 ////////////////////////////////////////////////////////////////////////////// 96 // eof 97