nss: upgrade to release 3.73
[LibreOffice.git] / include / drawinglayer / primitive2d / wrongspellprimitive2d.hxx
blobe872ae82e75de311444cd4538d9d7381e60ba1ab
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 #pragma once
22 #include <drawinglayer/drawinglayerdllapi.h>
24 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
25 #include <basegfx/color/bcolor.hxx>
26 #include <basegfx/matrix/b2dhommatrix.hxx>
29 // WrongSpellPrimitive2D class
31 namespace drawinglayer::primitive2d
33 /** WrongSpellPrimitive2D class
35 This is a helper primitive to hold evtl. WrongSpell visualisations
36 in the sequence of primitives. The primitive holds this information
37 separated from the TextPortions to where it belongs to, to expand the
38 TextSimplePortionPrimitive2D more as needed.
40 A renderer who does not want to visualize this (if contained at all)
41 can detect and ignore this primitive. If its decomposition is used,
42 it will be visualized as red wavelines.
44 The geometric definition defines a line on the X-Axis (no Y-coordinates)
45 which will when transformed by Transformation, create the coordinate data.
47 class DRAWINGLAYER_DLLPUBLIC WrongSpellPrimitive2D final : public BufferedDecompositionPrimitive2D
49 private:
50 /// geometry definition
51 basegfx::B2DHomMatrix maTransformation;
52 double mfStart;
53 double mfStop;
55 /// color (usually red)
56 basegfx::BColor maColor;
58 /// create local decomposition
59 virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
61 public:
62 /// constructor
63 WrongSpellPrimitive2D(
64 const basegfx::B2DHomMatrix& rTransformation,
65 double fStart,
66 double fStop,
67 const basegfx::BColor& rColor);
69 /// data read access
70 const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; }
71 double getStart() const { return mfStart; }
72 double getStop() const { return mfStop; }
73 const basegfx::BColor& getColor() const { return maColor; }
75 /// compare operator
76 virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
78 /// provide unique ID
79 virtual sal_uInt32 getPrimitive2DID() const override;
81 } // end of namespace drawinglayer::primitive2d
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */