/src/libreoffice/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
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/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
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 . |
18 | | */ |
19 | | |
20 | | #pragma once |
21 | | |
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> |
28 | | |
29 | | |
30 | | namespace drawinglayer::primitive2d |
31 | | { |
32 | | class BaseTextStrikeoutPrimitive2D : public BufferedDecompositionPrimitive2D |
33 | | { |
34 | | private: |
35 | | /// geometric definitions |
36 | | basegfx::B2DHomMatrix maObjectTransformation; |
37 | | double mfWidth; |
38 | | |
39 | | /// decoration definitions |
40 | | basegfx::BColor maFontColor; |
41 | | |
42 | | public: |
43 | | /// constructor |
44 | | BaseTextStrikeoutPrimitive2D( |
45 | | basegfx::B2DHomMatrix aObjectTransformation, |
46 | | double fWidth, |
47 | | const basegfx::BColor& rFontColor); |
48 | | |
49 | | /// data read access |
50 | 0 | const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; } |
51 | 0 | double getWidth() const { return mfWidth; } |
52 | 0 | const basegfx::BColor& getFontColor() const { return maFontColor; } |
53 | | |
54 | | /// compare operator |
55 | | virtual bool operator==( const BasePrimitive2D& rPrimitive ) const override; |
56 | | }; |
57 | | |
58 | | } // end of namespace drawinglayer::primitive2d |
59 | | |
60 | | |
61 | | namespace drawinglayer::primitive2d |
62 | | { |
63 | | class TextCharacterStrikeoutPrimitive2D final : public BaseTextStrikeoutPrimitive2D |
64 | | { |
65 | | private: |
66 | | sal_Unicode maStrikeoutChar; |
67 | | attribute::FontAttribute maFontAttribute; |
68 | | css::lang::Locale maLocale; |
69 | | |
70 | | /// local decomposition. |
71 | | virtual Primitive2DReference create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const override; |
72 | | |
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); |
82 | | |
83 | | /// data read access |
84 | 0 | sal_Unicode getStrikeoutChar() const { return maStrikeoutChar; } |
85 | 0 | const attribute::FontAttribute& getFontAttribute() const { return maFontAttribute; } |
86 | 0 | const css::lang::Locale& getLocale() const { return maLocale; } |
87 | | |
88 | | /// compare operator |
89 | | virtual bool operator==( const BasePrimitive2D& rPrimitive ) const override; |
90 | | |
91 | | /// provide unique ID |
92 | | virtual sal_uInt32 getPrimitive2DID() const override; |
93 | | }; |
94 | | |
95 | | } // end of namespace drawinglayer::primitive2d |
96 | | |
97 | | |
98 | | namespace drawinglayer::primitive2d |
99 | | { |
100 | | class TextGeometryStrikeoutPrimitive2D final : public BaseTextStrikeoutPrimitive2D |
101 | | { |
102 | | private: |
103 | | double mfHeight; |
104 | | double mfOffset; |
105 | | TextStrikeout meTextStrikeout; |
106 | | |
107 | | /// local decomposition. |
108 | | virtual Primitive2DReference create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const override; |
109 | | |
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); |
119 | | |
120 | | /// data read access |
121 | 0 | double getHeight() const { return mfHeight; } |
122 | 0 | double getOffset() const { return mfOffset; } |
123 | 0 | TextStrikeout getTextStrikeout() const { return meTextStrikeout; } |
124 | | |
125 | | /// compare operator |
126 | | virtual bool operator==( const BasePrimitive2D& rPrimitive ) const override; |
127 | | |
128 | | /// provide unique ID |
129 | | virtual sal_uInt32 getPrimitive2DID() const override; |
130 | | }; |
131 | | |
132 | | } // end of namespace drawinglayer::primitive2d |
133 | | |
134 | | |
135 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |