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 OOX_DRAWINGML_TEXTPARAGRAPHPROPERTIES_HXX
21 #define OOX_DRAWINGML_TEXTPARAGRAPHPROPERTIES_HXX
23 #include <com/sun/star/beans/XPropertySet.hpp>
24 #include "oox/drawingml/fillpropertiesgroupcontext.hxx"
25 #include "oox/drawingml/textcharacterproperties.hxx"
26 #include <com/sun/star/style/NumberingType.hpp>
27 #include "oox/drawingml/textfont.hxx"
28 #include "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 boost::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 void apply( const TextParagraphProperties
& rSourceProps
);
98 void pushToPropSet( const ::oox::core::XmlFilterBase
* pFilterBase
,
99 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> & xPropSet
,
100 PropertyMap
& rioBulletList
, const BulletList
* pMasterBuList
, sal_Bool bApplyBulletList
, float fFontSize
, bool bPushDefaultValues
= false ) const;
101 void pushToPropSet( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> & xPropSet
) const;
103 /** Returns the largest character size of this paragraph. If possible the
104 masterstyle should have been applied before, otherwise the character
105 size can be zero and the default value is returned. */
106 float getCharHeightPoints( float fDefault
) const;
114 TextCharacterProperties maTextCharacterProperties
;
115 PropertyMap maTextParagraphPropertyMap
;
116 BulletList maBulletList
;
117 TextSpacing maParaTopMargin
;
118 TextSpacing maParaBottomMargin
;
119 boost::optional
< sal_Int32
> moParaLeftMargin
;
120 boost::optional
< sal_Int32
> moFirstLineIndentation
;
126 #endif // OOX_DRAWINGML_TEXTPARAGRAPHPROPERTIES_HXX
128 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */