1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_TEXTDECORATEDPRIMITIVE2D_HXX
21 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTDECORATEDPRIMITIVE2D_HXX
23 #include <drawinglayer/drawinglayerdllapi.h>
25 #include <drawinglayer/primitive2d/textprimitive2d.hxx>
26 #include <drawinglayer/primitive2d/textenumsprimitive2d.hxx>
28 namespace basegfx
{ namespace tools
{
29 class B2DHomMatrixBufferedOnDemandDecompose
;
32 namespace com
{ namespace sun
{ namespace star
{ namespace i18n
{
36 namespace drawinglayer
40 /** TextDecoratedPortionPrimitive2D class
42 This primitive expands the TextSimplePortionPrimitive2D by common
43 decorations used in the office. It can be decomposed and will create
44 a TextSimplePortionPrimitive2D and all the contained decorations (if used)
47 class DRAWINGLAYER_DLLPUBLIC TextDecoratedPortionPrimitive2D
: public TextSimplePortionPrimitive2D
50 /// decoration definitions
51 basegfx::BColor maOverlineColor
;
52 basegfx::BColor maTextlineColor
;
53 TextLine meFontOverline
;
54 TextLine meFontUnderline
;
55 TextStrikeout meTextStrikeout
;
56 TextEmphasisMark meTextEmphasisMark
;
57 TextRelief meTextRelief
;
59 bool mbUnderlineAbove
: 1;
60 bool mbWordLineMode
: 1;
61 bool mbEmphasisMarkAbove
: 1;
62 bool mbEmphasisMarkBelow
: 1;
66 void impCreateGeometryContent(
67 std::vector
< Primitive2DReference
>& rTarget
,
68 basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose
& rDecTrans
,
69 const OUString
& rText
,
70 sal_Int32 nTextPosition
,
71 sal_Int32 nTextLength
,
72 const ::std::vector
< double >& rDXArray
,
73 const attribute::FontAttribute
& rFontAttribute
) const;
76 /// local decomposition.
77 virtual void create2DDecomposition(Primitive2DContainer
& rContainer
, const geometry::ViewInformation2D
& rViewInformation
) const override
;
81 TextDecoratedPortionPrimitive2D(
82 /// TextSimplePortionPrimitive2D parameters
83 const basegfx::B2DHomMatrix
& rNewTransform
,
84 const OUString
& rText
,
85 sal_Int32 nTextPosition
,
86 sal_Int32 nTextLength
,
87 const ::std::vector
< double >& rDXArray
,
88 const attribute::FontAttribute
& rFontAttribute
,
89 const css::lang::Locale
& rLocale
,
90 const basegfx::BColor
& rFontColor
,
91 const Color
& rFillColor
,
94 const basegfx::BColor
& rOverlineColor
,
95 const basegfx::BColor
& rTextlineColor
,
96 TextLine eFontOverline
= TEXT_LINE_NONE
,
97 TextLine eFontUnderline
= TEXT_LINE_NONE
,
98 bool bUnderlineAbove
= false,
99 TextStrikeout eTextStrikeout
= TEXT_STRIKEOUT_NONE
,
100 bool bWordLineMode
= false,
101 TextEmphasisMark eTextEmphasisMark
= TEXT_FONT_EMPHASIS_MARK_NONE
,
102 bool bEmphasisMarkAbove
= true,
103 bool bEmphasisMarkBelow
= false,
104 TextRelief eTextRelief
= TEXT_RELIEF_NONE
,
105 bool bShadow
= false);
108 TextLine
getFontOverline() const { return meFontOverline
; }
109 TextLine
getFontUnderline() const { return meFontUnderline
; }
110 TextStrikeout
getTextStrikeout() const { return meTextStrikeout
; }
111 TextEmphasisMark
getTextEmphasisMark() const { return meTextEmphasisMark
; }
112 TextRelief
getTextRelief() const { return meTextRelief
; }
113 const basegfx::BColor
& getOverlineColor() const { return maOverlineColor
; }
114 const basegfx::BColor
& getTextlineColor() const { return maTextlineColor
; }
115 bool getUnderlineAbove() const { return mbUnderlineAbove
; }
116 bool getWordLineMode() const { return mbWordLineMode
; }
117 bool getEmphasisMarkAbove() const { return mbEmphasisMarkAbove
; }
118 bool getEmphasisMarkBelow() const { return mbEmphasisMarkBelow
; }
119 bool getShadow() const { return mbShadow
; }
122 virtual bool operator==( const BasePrimitive2D
& rPrimitive
) const override
;
125 virtual basegfx::B2DRange
getB2DRange(const geometry::ViewInformation2D
& rViewInformation
) const override
;
127 /// provide unique ID
128 DeclPrimitive2DIDBlock()
130 } // end of namespace primitive2d
131 } // end of namespace drawinglayer
133 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTDECORATEDPRIMITIVE2D_HXX
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */