Branch libreoffice-6-3
[LibreOffice.git] / include / drawinglayer / primitive2d / wrongspellprimitive2d.hxx
blob996d703622884ae04376a0f5d68ba0798ed62db3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WRONGSPELLPRIMITIVE2D_HXX
21 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WRONGSPELLPRIMITIVE2D_HXX
23 #include <drawinglayer/drawinglayerdllapi.h>
25 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
26 #include <basegfx/color/bcolor.hxx>
27 #include <basegfx/matrix/b2dhommatrix.hxx>
30 // WrongSpellPrimitive2D class
32 namespace drawinglayer
34 namespace primitive2d
36 /** WrongSpellPrimitive2D class
38 This is a helper primitive to hold evtl. WrongSpell visualisations
39 in the sequence of primitives. The primitive holds this information
40 separated form the TextPortions to where it belongs to tot expand the
41 TextSimplePortionPrimitive2D more as needed.
43 A renderer who does not want to visualize this (if contained at all)
44 can detect and ignore this primitive. If its decomposition is used,
45 it will be visualized as red wavelines.
47 The geometric definition defines a line on the X-Axis (no Y-coordinates)
48 which will when transformed by Transformation, create the coordinate data.
50 class DRAWINGLAYER_DLLPUBLIC WrongSpellPrimitive2D : public BufferedDecompositionPrimitive2D
52 private:
53 /// geometry definition
54 basegfx::B2DHomMatrix maTransformation;
55 double mfStart;
56 double mfStop;
58 /// color (usually red)
59 basegfx::BColor maColor;
61 protected:
62 /// create local decomposition
63 virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
65 public:
66 /// constructor
67 WrongSpellPrimitive2D(
68 const basegfx::B2DHomMatrix& rTransformation,
69 double fStart,
70 double fStop,
71 const basegfx::BColor& rColor);
73 /// data read access
74 const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; }
75 double getStart() const { return mfStart; }
76 double getStop() const { return mfStop; }
77 const basegfx::BColor& getColor() const { return maColor; }
79 /// compare operator
80 virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
82 /// provide unique ID
83 DeclPrimitive2DIDBlock()
85 } // end of namespace primitive2d
86 } // end of namespace drawinglayer
89 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WRONGSPELLPRIMITIVE2D_HXX
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */