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/fillpropertiesgroupcontext.hxx>
25 #include <drawingml/textcharacterproperties.hxx>
26 #include <com/sun/star/style/NumberingType.hpp>
27 #include <drawingml/textfont.hxx>
28 #include <drawingml/textspacing.hxx>
29 #include <boost/optional.hpp>
31 namespace com
{ namespace sun
{ namespace star
{
32 namespace graphic
{ class XGraphic
; }
35 namespace oox
{ namespace drawingml
{
37 class TextParagraphProperties
;
39 typedef std::shared_ptr
< TextParagraphProperties
> TextParagraphPropertiesPtr
;
46 void apply( const BulletList
& );
47 void pushToPropMap( const ::oox::core::XmlFilterBase
* pFilterBase
, PropertyMap
& xPropMap
) const;
48 void setBulletChar( const OUString
& sChar
);
49 void setStartAt( sal_Int32 nStartAt
){ mnStartAt
<<= static_cast< sal_Int16
>( nStartAt
); }
50 void setType( sal_Int32 nType
);
52 void setSuffixParenBoth();
53 void setSuffixParenRight();
54 void setSuffixPeriod();
56 void setSuffixMinusRight();
57 void setBulletSize(sal_Int16 nSize
);
58 void setFontSize(sal_Int16 nSize
);
59 void setStyleName( const OUString
& rStyleName
) { maStyleName
<<= rStyleName
; }
60 void setGraphic( ::com::sun::star::uno::Reference
< ::com::sun::star::graphic::XGraphic
>& rXGraphic
);
62 ::oox::drawingml::ColorPtr maBulletColorPtr
;
63 ::com::sun::star::uno::Any mbBulletColorFollowText
;
64 ::com::sun::star::uno::Any mbBulletFontFollowText
;
65 ::oox::drawingml::TextFont maBulletFont
;
66 ::com::sun::star::uno::Any msBulletChar
;
67 ::com::sun::star::uno::Any mnStartAt
;
68 ::com::sun::star::uno::Any mnNumberingType
;
69 ::com::sun::star::uno::Any msNumberingPrefix
;
70 ::com::sun::star::uno::Any msNumberingSuffix
;
71 ::com::sun::star::uno::Any mnSize
;
72 ::com::sun::star::uno::Any mnFontSize
;
73 ::com::sun::star::uno::Any maStyleName
;
74 ::com::sun::star::uno::Any maGraphic
;
75 boost::optional
< float > maFollowFontSize
;
78 class TextParagraphProperties
82 TextParagraphProperties();
83 ~TextParagraphProperties();
85 void setLevel( sal_Int16 nLevel
) { mnLevel
= nLevel
; }
86 sal_Int16
getLevel( ) const { return mnLevel
; }
87 PropertyMap
& getTextParagraphPropertyMap() { return maTextParagraphPropertyMap
; }
88 BulletList
& getBulletList() { return maBulletList
; }
89 TextCharacterProperties
& getTextCharacterProperties() { return maTextCharacterProperties
; }
90 const TextCharacterProperties
& getTextCharacterProperties() const { return maTextCharacterProperties
; }
92 TextSpacing
& getParaTopMargin() { return maParaTopMargin
; }
93 TextSpacing
& getParaBottomMargin() { return maParaBottomMargin
; }
94 boost::optional
< sal_Int32
>& getParaLeftMargin(){ return moParaLeftMargin
; }
95 boost::optional
< sal_Int32
>& getFirstLineIndentation(){ return moFirstLineIndentation
; }
97 boost::optional
< sal_Int16
>& getParaAdjust() { return moParaAdjust
; }
98 void setParaAdjust( sal_Int16 nParaAdjust
) { moParaAdjust
= nParaAdjust
; }
100 void apply( const TextParagraphProperties
& rSourceProps
);
101 void pushToPropSet( const ::oox::core::XmlFilterBase
* pFilterBase
,
102 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> & xPropSet
,
103 PropertyMap
& rioBulletList
, const BulletList
* pMasterBuList
, bool bApplyBulletList
, float fFontSize
, bool bPushDefaultValues
= false ) const;
104 void pushToPropSet( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> & xPropSet
) const;
106 /** Returns the largest character size of this paragraph. If possible the
107 masterstyle should have been applied before, otherwise the character
108 size can be zero and the default value is returned. */
109 float getCharHeightPoints( float fDefault
) const;
117 TextCharacterProperties maTextCharacterProperties
;
118 PropertyMap maTextParagraphPropertyMap
;
119 BulletList maBulletList
;
120 TextSpacing maParaTopMargin
;
121 TextSpacing maParaBottomMargin
;
122 boost::optional
< sal_Int32
> moParaLeftMargin
;
123 boost::optional
< sal_Int32
> moFirstLineIndentation
;
124 boost::optional
< sal_Int16
> moParaAdjust
;
130 #endif // INCLUDED_OOX_DRAWINGML_TEXTPARAGRAPHPROPERTIES_HXX
132 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */