1e3508121SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3e3508121SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4e3508121SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5e3508121SAndrew Rist  * distributed with this work for additional information
6e3508121SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7e3508121SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8e3508121SAndrew Rist  * "License"); you may not use this file except in compliance
9e3508121SAndrew Rist  * with the License.  You may obtain a copy of the License at
10e3508121SAndrew Rist  *
11e3508121SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12e3508121SAndrew Rist  *
13e3508121SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14e3508121SAndrew Rist  * software distributed under the License is distributed on an
15e3508121SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16e3508121SAndrew Rist  * KIND, either express or implied.  See the License for the
17e3508121SAndrew Rist  * specific language governing permissions and limitations
18e3508121SAndrew Rist  * under the License.
19e3508121SAndrew Rist  *
20e3508121SAndrew Rist  *************************************************************/
21e3508121SAndrew Rist 
22e3508121SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef OOX_DRAWINGML_TEXTPARAGRAPHPROPERTIES_HXX
25cdf0e10cSrcweir #define OOX_DRAWINGML_TEXTPARAGRAPHPROPERTIES_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
28cdf0e10cSrcweir #include "oox/drawingml/fillpropertiesgroupcontext.hxx"
29cdf0e10cSrcweir #include "oox/drawingml/textcharacterproperties.hxx"
30cdf0e10cSrcweir #include <com/sun/star/style/NumberingType.hpp>
31cdf0e10cSrcweir #include "oox/drawingml/textfont.hxx"
32cdf0e10cSrcweir #include "textspacing.hxx"
33cdf0e10cSrcweir #include <boost/optional.hpp>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir namespace com { namespace sun { namespace star {
36cdf0e10cSrcweir     namespace graphic { class XGraphic; }
37cdf0e10cSrcweir } } }
38cdf0e10cSrcweir 
39cdf0e10cSrcweir namespace oox { namespace drawingml {
40cdf0e10cSrcweir 
41cdf0e10cSrcweir class TextParagraphProperties;
42cdf0e10cSrcweir 
43cdf0e10cSrcweir typedef boost::shared_ptr< TextParagraphProperties > TextParagraphPropertiesPtr;
44cdf0e10cSrcweir 
45cdf0e10cSrcweir class BulletList
46cdf0e10cSrcweir {
47cdf0e10cSrcweir public:
48cdf0e10cSrcweir 	BulletList( );
49cdf0e10cSrcweir 	bool is() const;
50cdf0e10cSrcweir 	void apply( const BulletList& );
51cdf0e10cSrcweir     void pushToPropMap( const ::oox::core::XmlFilterBase& rFilterBase, PropertyMap& rPropMap ) const;
52cdf0e10cSrcweir 	void setBulletChar( const ::rtl::OUString & sChar );
setStartAt(sal_Int32 nStartAt)53cdf0e10cSrcweir 	void setStartAt( sal_Int32 nStartAt ){ mnStartAt <<= static_cast< sal_Int16 >( nStartAt ); }
54cdf0e10cSrcweir 	void setType( sal_Int32 nType );
55cdf0e10cSrcweir 	void setNone( );
56cdf0e10cSrcweir 	void setSuffixParenBoth();
57cdf0e10cSrcweir 	void setSuffixParenRight();
58cdf0e10cSrcweir 	void setSuffixPeriod();
59cdf0e10cSrcweir 	void setSuffixNone();
60cdf0e10cSrcweir 	void setSuffixMinusRight();
61cdf0e10cSrcweir 	void setBulletSize(sal_Int16 nSize);
62cdf0e10cSrcweir 	void setFontSize(sal_Int16 nSize);
setStyleName(const rtl::OUString & rStyleName)63cdf0e10cSrcweir 	void setStyleName( const rtl::OUString& rStyleName ) { maStyleName <<= rStyleName; }
64cdf0e10cSrcweir 	void setGraphic( ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& rXGraphic );
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 	::oox::drawingml::ColorPtr	maBulletColorPtr;
67cdf0e10cSrcweir 	::com::sun::star::uno::Any	mbBulletColorFollowText;
68cdf0e10cSrcweir 	::com::sun::star::uno::Any	mbBulletFontFollowText;
69cdf0e10cSrcweir 	::oox::drawingml::TextFont	maBulletFont;
70cdf0e10cSrcweir 	::com::sun::star::uno::Any	msBulletChar;
71cdf0e10cSrcweir 	::com::sun::star::uno::Any	mnStartAt;
72cdf0e10cSrcweir 	::com::sun::star::uno::Any	mnNumberingType;
73cdf0e10cSrcweir 	::com::sun::star::uno::Any	msNumberingPrefix;
74cdf0e10cSrcweir 	::com::sun::star::uno::Any	msNumberingSuffix;
75cdf0e10cSrcweir 	::com::sun::star::uno::Any	mnSize;
76cdf0e10cSrcweir 	::com::sun::star::uno::Any	mnFontSize;
77cdf0e10cSrcweir 	::com::sun::star::uno::Any	maStyleName;
78cdf0e10cSrcweir 	::com::sun::star::uno::Any  maGraphic;
79cdf0e10cSrcweir 	boost::optional< float >	maFollowFontSize;
80cdf0e10cSrcweir };
81cdf0e10cSrcweir 
82cdf0e10cSrcweir class TextParagraphProperties
83cdf0e10cSrcweir {
84cdf0e10cSrcweir public:
85cdf0e10cSrcweir 
86cdf0e10cSrcweir 	TextParagraphProperties();
87cdf0e10cSrcweir     ~TextParagraphProperties();
88cdf0e10cSrcweir 
setLevel(sal_Int16 nLevel)89cdf0e10cSrcweir 	void                                setLevel( sal_Int16 nLevel ) { mnLevel = nLevel; }
getLevel() const90cdf0e10cSrcweir     sal_Int16                           getLevel( ) const { return mnLevel; }
getTextParagraphPropertyMap()91cdf0e10cSrcweir     PropertyMap&                        getTextParagraphPropertyMap() { return maTextParagraphPropertyMap; }
getBulletList()92cdf0e10cSrcweir     BulletList&                         getBulletList() { return maBulletList; }
getBulletList() const93*7fe2509eSJürgen Schmidt     const BulletList&                   getBulletList() const { return maBulletList; }
getTextCharacterProperties()94cdf0e10cSrcweir     TextCharacterProperties&            getTextCharacterProperties() { return maTextCharacterProperties; }
getTextCharacterProperties() const95cdf0e10cSrcweir     const TextCharacterProperties&      getTextCharacterProperties() const { return maTextCharacterProperties; }
96cdf0e10cSrcweir 
getParaTopMargin()97cdf0e10cSrcweir     TextSpacing&                        getParaTopMargin() { return maParaTopMargin; }
getParaBottomMargin()98cdf0e10cSrcweir     TextSpacing&                        getParaBottomMargin() { return maParaBottomMargin; }
getParaLeftMargin()99cdf0e10cSrcweir     boost::optional< sal_Int32 >&       getParaLeftMargin(){ return moParaLeftMargin; }
getFirstLineIndentation()100cdf0e10cSrcweir     boost::optional< sal_Int32 >&       getFirstLineIndentation(){ return moFirstLineIndentation; }
101cdf0e10cSrcweir 
102cdf0e10cSrcweir     void                                apply( const TextParagraphProperties& rSourceProps );
103cdf0e10cSrcweir     void                                pushToPropSet( const ::oox::core::XmlFilterBase& rFilterBase,
104cdf0e10cSrcweir 											const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & xPropSet,
105cdf0e10cSrcweir                                                 PropertyMap& rioBulletList, const BulletList* pMasterBuList, sal_Bool bApplyBulletList, float fFontSize ) const;
106cdf0e10cSrcweir 
107cdf0e10cSrcweir     /** Returns the largest character size of this paragraph. If possible the
108cdf0e10cSrcweir         masterstyle should have been applied before, otherwise the character
109cdf0e10cSrcweir         size can be zero and the default value is returned. */
110cdf0e10cSrcweir     float                               getCharHeightPoints( float fDefault ) const;
111cdf0e10cSrcweir 
112cdf0e10cSrcweir protected:
113cdf0e10cSrcweir 
114cdf0e10cSrcweir     TextCharacterProperties         maTextCharacterProperties;
115cdf0e10cSrcweir     PropertyMap                     maTextParagraphPropertyMap;
116cdf0e10cSrcweir     BulletList                      maBulletList;
117cdf0e10cSrcweir     TextSpacing                     maParaTopMargin;
118cdf0e10cSrcweir     TextSpacing                     maParaBottomMargin;
119cdf0e10cSrcweir     boost::optional< sal_Int32 >    moParaLeftMargin;
120cdf0e10cSrcweir     boost::optional< sal_Int32 >    moFirstLineIndentation;
121cdf0e10cSrcweir     sal_Int16                       mnLevel;
122cdf0e10cSrcweir };
123cdf0e10cSrcweir 
124cdf0e10cSrcweir } }
125cdf0e10cSrcweir 
126cdf0e10cSrcweir #endif  //  OOX_DRAWINGML_TEXTPARAGRAPHPROPERTIES_HXX
127