Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / oox / inc / drawingml / textparagraphproperties.hxx
blob5b8093bab3918f2a3f06d5b1457e5cb8213122d2
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/misccontexts.hxx>
25 #include <drawingml/textcharacterproperties.hxx>
26 #include <com/sun/star/style/NumberingType.hpp>
27 #include <com/sun/star/style/ParagraphAdjust.hpp>
28 #include <drawingml/textfont.hxx>
29 #include <drawingml/textspacing.hxx>
30 #include <boost/optional.hpp>
32 namespace com { namespace sun { namespace star {
33 namespace graphic { class XGraphic; }
34 } } }
36 namespace oox { namespace drawingml {
38 class TextParagraphProperties;
40 typedef std::shared_ptr< TextParagraphProperties > TextParagraphPropertiesPtr;
42 class BulletList
44 public:
45 BulletList( );
46 bool is() const;
47 void apply( const BulletList& );
48 void pushToPropMap( const ::oox::core::XmlFilterBase* pFilterBase, PropertyMap& xPropMap ) const;
49 void setBulletChar( const OUString & sChar );
50 void setStartAt( sal_Int32 nStartAt ){ mnStartAt <<= static_cast< sal_Int16 >( nStartAt ); }
51 void setType( sal_Int32 nType );
52 void setNone( );
53 void setSuffixParenBoth();
54 void setSuffixParenRight();
55 void setSuffixPeriod();
56 void setSuffixNone();
57 void setSuffixMinusRight();
58 void setBulletSize(sal_Int16 nSize);
59 void setFontSize(sal_Int16 nSize);
60 void setStyleName( const OUString& rStyleName ) { maStyleName <<= rStyleName; }
61 void setGraphic( css::uno::Reference< css::graphic::XGraphic > const & rXGraphic );
63 std::shared_ptr< ::oox::drawingml::Color > maBulletColorPtr;
64 css::uno::Any mbBulletColorFollowText;
65 css::uno::Any mbBulletFontFollowText;
66 ::oox::drawingml::TextFont maBulletFont;
67 css::uno::Any msBulletChar;
68 css::uno::Any mnStartAt;
69 css::uno::Any mnNumberingType;
70 css::uno::Any msNumberingPrefix;
71 css::uno::Any msNumberingSuffix;
72 css::uno::Any mnSize;
73 css::uno::Any mnFontSize;
74 css::uno::Any maStyleName;
75 css::uno::Any maGraphic;
78 class TextParagraphProperties
80 public:
82 TextParagraphProperties();
84 void setLevel( sal_Int16 nLevel ) { mnLevel = nLevel; }
85 sal_Int16 getLevel( ) const { return mnLevel; }
86 PropertyMap& getTextParagraphPropertyMap() { return maTextParagraphPropertyMap; }
87 BulletList& getBulletList() { return maBulletList; }
88 TextCharacterProperties& getTextCharacterProperties() { return maTextCharacterProperties; }
89 const TextCharacterProperties& getTextCharacterProperties() const { return maTextCharacterProperties; }
91 TextSpacing& getParaTopMargin() { return maParaTopMargin; }
92 TextSpacing& getParaBottomMargin() { return maParaBottomMargin; }
93 boost::optional< sal_Int32 >& getParaLeftMargin(){ return moParaLeftMargin; }
94 boost::optional< sal_Int32 >& getFirstLineIndentation(){ return moFirstLineIndentation; }
96 boost::optional< css::style::ParagraphAdjust >& getParaAdjust() { return moParaAdjust; }
97 void setParaAdjust( css::style::ParagraphAdjust nParaAdjust ) { moParaAdjust = nParaAdjust; }
99 TextSpacing& getLineSpacing() { return maLineSpacing; }
100 void setLineSpacing( const TextSpacing& rLineSpacing ) { maLineSpacing = rLineSpacing; }
102 void apply( const TextParagraphProperties& rSourceProps );
103 void pushToPropSet( const ::oox::core::XmlFilterBase* pFilterBase,
104 const css::uno::Reference < css::beans::XPropertySet > & xPropSet,
105 PropertyMap& rioBulletList,
106 const BulletList* pMasterBuList,
107 bool bApplyBulletList,
108 float fFontSize,
109 bool bPushDefaultValues = false ) const;
111 /** Returns the largest character size of this paragraph. If possible the
112 masterstyle should have been applied before, otherwise the character
113 size can be zero and the default value is returned. */
114 float getCharHeightPoints( float fDefault ) const;
116 #ifdef DBG_UTIL
117 void dump() const;
118 #endif
120 protected:
122 TextCharacterProperties maTextCharacterProperties;
123 PropertyMap maTextParagraphPropertyMap;
124 BulletList maBulletList;
125 TextSpacing maParaTopMargin;
126 TextSpacing maParaBottomMargin;
127 boost::optional< sal_Int32 > moParaLeftMargin;
128 boost::optional< sal_Int32 > moFirstLineIndentation;
129 boost::optional< css::style::ParagraphAdjust > moParaAdjust;
130 sal_Int16 mnLevel;
131 TextSpacing maLineSpacing;
136 #endif // INCLUDED_OOX_DRAWINGML_TEXTPARAGRAPHPROPERTIES_HXX
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */