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_OOX_DRAWINGML_TEXTPARAGRAPHPROPERTIES_HXX
21 #define INCLUDED_OOX_DRAWINGML_TEXTPARAGRAPHPROPERTIES_HXX
23 #include <com/sun/star/beans/XPropertySet.hpp>
24 #include <drawingml/textcharacterproperties.hxx>
25 #include <com/sun/star/style/ParagraphAdjust.hpp>
26 #include <drawingml/textfont.hxx>
27 #include <drawingml/textspacing.hxx>
30 namespace com::sun::star
{
31 namespace graphic
{ class XGraphic
; }
34 namespace oox::drawingml
{
41 void apply( const BulletList
& );
42 void pushToPropMap( const ::oox::core::XmlFilterBase
* pFilterBase
, PropertyMap
& xPropMap
) const;
43 void setBulletChar( const OUString
& sChar
);
44 void setStartAt( sal_Int32 nStartAt
){ mnStartAt
<<= static_cast< sal_Int16
>( nStartAt
); }
45 void setType( sal_Int32 nType
);
47 void setSuffixParenBoth();
48 void setSuffixParenRight();
49 void setSuffixPeriod();
51 void setSuffixMinusRight();
52 void setBulletSize(sal_Int16 nSize
);
53 void setBulletAspectRatio(double nAspectRatio
);
54 void setFontSize(sal_Int16 nSize
);
55 void setStyleName( const OUString
& rStyleName
) { maStyleName
<<= rStyleName
; }
56 void setGraphic( css::uno::Reference
< css::graphic::XGraphic
> const & rXGraphic
);
58 std::shared_ptr
< ::oox::drawingml::Color
> maBulletColorPtr
;
59 css::uno::Any mbBulletColorFollowText
;
60 css::uno::Any mbBulletFontFollowText
;
61 css::uno::Any mbBulletSizeFollowText
;
62 ::oox::drawingml::TextFont maBulletFont
;
63 css::uno::Any msBulletChar
;
64 css::uno::Any mnStartAt
;
65 css::uno::Any mnNumberingType
;
66 css::uno::Any msNumberingPrefix
;
67 css::uno::Any msNumberingSuffix
;
69 css::uno::Any mnAspectRatio
; // Width/Height
70 css::uno::Any mnFontSize
;
71 css::uno::Any maStyleName
;
72 css::uno::Any maGraphic
;
75 class TextParagraphProperties
79 TextParagraphProperties();
81 void setLevel( sal_Int16 nLevel
) { mnLevel
= nLevel
; }
82 sal_Int16
getLevel( ) const { return mnLevel
; }
83 PropertyMap
& getTextParagraphPropertyMap() { return maTextParagraphPropertyMap
; }
84 BulletList
& getBulletList() { return maBulletList
; }
85 TextCharacterProperties
& getTextCharacterProperties() { return maTextCharacterProperties
; }
86 const TextCharacterProperties
& getTextCharacterProperties() const { return maTextCharacterProperties
; }
88 TextSpacing
& getParaTopMargin() { return maParaTopMargin
; }
89 TextSpacing
& getParaBottomMargin() { return maParaBottomMargin
; }
90 std::optional
< sal_Int32
>& getParaLeftMargin(){ return moParaLeftMargin
; }
91 std::optional
< sal_Int32
>& getFirstLineIndentation(){ return moFirstLineIndentation
; }
92 std::optional
<sal_Int32
>& getDefaultTabSize() { return moDefaultTabSize
; }
94 std::optional
< css::style::ParagraphAdjust
>& getParaAdjust() { return moParaAdjust
; }
95 void setParaAdjust( css::style::ParagraphAdjust nParaAdjust
) { moParaAdjust
= nParaAdjust
; }
97 TextSpacing
& getLineSpacing() { return maLineSpacing
; }
98 void setLineSpacing( const TextSpacing
& rLineSpacing
) { maLineSpacing
= rLineSpacing
; }
100 void apply( const TextParagraphProperties
& rSourceProps
);
101 void pushToPropSet( const ::oox::core::XmlFilterBase
* pFilterBase
,
102 const css::uno::Reference
< css::beans::XPropertySet
> & xPropSet
,
103 PropertyMap
& rioBulletList
,
104 const BulletList
* pMasterBuList
,
105 bool bApplyBulletList
,
107 bool bPushDefaultValues
= false ) const;
109 /** Returns the largest character size of this paragraph. If possible the
110 masterstyle should have been applied before, otherwise the character
111 size can be zero and the default value is returned. */
112 float getCharHeightPoints( float fDefault
) const;
120 TextCharacterProperties maTextCharacterProperties
;
121 PropertyMap maTextParagraphPropertyMap
;
122 BulletList maBulletList
;
123 TextSpacing maParaTopMargin
;
124 TextSpacing maParaBottomMargin
;
125 std::optional
< sal_Int32
> moParaLeftMargin
;
126 std::optional
< sal_Int32
> moFirstLineIndentation
;
127 std::optional
< css::style::ParagraphAdjust
> moParaAdjust
;
128 std::optional
< sal_Int32
> moDefaultTabSize
;
130 TextSpacing maLineSpacing
;
135 #endif // INCLUDED_OOX_DRAWINGML_TEXTPARAGRAPHPROPERTIES_HXX
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */