docthemes: Save themes def. to a file when added to ColorSets
[LibreOffice.git] / drawinglayer / inc / primitive2d / textstrikeoutprimitive2d.hxx
blobffb8c144e77fd64705726687594bc3c4749bcc7b
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/primitive2d/BufferedDecompositionPrimitive2D.hxx>
23 #include <drawinglayer/primitive2d/textenumsprimitive2d.hxx>
24 #include <basegfx/matrix/b2dhommatrix.hxx>
25 #include <basegfx/color/bcolor.hxx>
26 #include <drawinglayer/attribute/fontattribute.hxx>
27 #include <com/sun/star/lang/Locale.hpp>
30 namespace drawinglayer::primitive2d
32 class BaseTextStrikeoutPrimitive2D : public BufferedDecompositionPrimitive2D
34 private:
35 /// geometric definitions
36 basegfx::B2DHomMatrix maObjectTransformation;
37 double mfWidth;
39 /// decoration definitions
40 basegfx::BColor maFontColor;
42 public:
43 /// constructor
44 BaseTextStrikeoutPrimitive2D(
45 basegfx::B2DHomMatrix aObjectTransformation,
46 double fWidth,
47 const basegfx::BColor& rFontColor);
49 /// data read access
50 const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
51 double getWidth() const { return mfWidth; }
52 const basegfx::BColor& getFontColor() const { return maFontColor; }
54 /// compare operator
55 virtual bool operator==( const BasePrimitive2D& rPrimitive ) const override;
58 } // end of namespace drawinglayer::primitive2d
61 namespace drawinglayer::primitive2d
63 class TextCharacterStrikeoutPrimitive2D final : public BaseTextStrikeoutPrimitive2D
65 private:
66 sal_Unicode maStrikeoutChar;
67 attribute::FontAttribute maFontAttribute;
68 css::lang::Locale maLocale;
70 /// local decomposition.
71 virtual Primitive2DReference create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const override;
73 public:
74 /// constructor
75 TextCharacterStrikeoutPrimitive2D(
76 const basegfx::B2DHomMatrix& rObjectTransformation,
77 double fWidth,
78 const basegfx::BColor& rFontColor,
79 sal_Unicode aStrikeoutChar,
80 attribute::FontAttribute aFontAttribute,
81 css::lang::Locale aLocale);
83 /// data read access
84 sal_Unicode getStrikeoutChar() const { return maStrikeoutChar; }
85 const attribute::FontAttribute& getFontAttribute() const { return maFontAttribute; }
86 const css::lang::Locale& getLocale() const { return maLocale; }
88 /// compare operator
89 virtual bool operator==( const BasePrimitive2D& rPrimitive ) const override;
91 /// provide unique ID
92 virtual sal_uInt32 getPrimitive2DID() const override;
95 } // end of namespace drawinglayer::primitive2d
98 namespace drawinglayer::primitive2d
100 class TextGeometryStrikeoutPrimitive2D final : public BaseTextStrikeoutPrimitive2D
102 private:
103 double mfHeight;
104 double mfOffset;
105 TextStrikeout meTextStrikeout;
107 /// local decomposition.
108 virtual Primitive2DReference create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const override;
110 public:
111 /// constructor
112 TextGeometryStrikeoutPrimitive2D(
113 const basegfx::B2DHomMatrix& rObjectTransformation,
114 double fWidth,
115 const basegfx::BColor& rFontColor,
116 double fHeight,
117 double fOffset,
118 TextStrikeout eTextStrikeout);
120 /// data read access
121 double getHeight() const { return mfHeight; }
122 double getOffset() const { return mfOffset; }
123 TextStrikeout getTextStrikeout() const { return meTextStrikeout; }
125 /// compare operator
126 virtual bool operator==( const BasePrimitive2D& rPrimitive ) const override;
128 /// provide unique ID
129 virtual sal_uInt32 getPrimitive2DID() const override;
132 } // end of namespace drawinglayer::primitive2d
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */