LibreOffice Module oox (master)  1
textparagraphproperties.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_OOX_DRAWINGML_TEXTPARAGRAPHPROPERTIES_HXX
21 #define INCLUDED_OOX_DRAWINGML_TEXTPARAGRAPHPROPERTIES_HXX
22 
23 #include <com/sun/star/beans/XPropertySet.hpp>
25 #include <com/sun/star/style/ParagraphAdjust.hpp>
26 #include <drawingml/textfont.hxx>
28 #include <optional>
29 
30 namespace com::sun::star {
31  namespace graphic { class XGraphic; }
32 }
33 
34 namespace oox::drawingml {
35 
37 {
38 public:
39  BulletList( );
40  bool is() const;
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 );
46  void setNone( );
47  void setSuffixParenBoth();
48  void setSuffixParenRight();
49  void setSuffixPeriod();
50  void setSuffixNone();
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 );
57 
58  std::shared_ptr< ::oox::drawingml::Color > maBulletColorPtr;
59  css::uno::Any mbBulletColorFollowText;
60  css::uno::Any mbBulletFontFollowText;
62  css::uno::Any msBulletChar;
63  css::uno::Any mnStartAt;
64  css::uno::Any mnNumberingType;
65  css::uno::Any msNumberingPrefix;
66  css::uno::Any msNumberingSuffix;
67  css::uno::Any mnSize;
68  css::uno::Any mnAspectRatio; // Width/Height
69  css::uno::Any mnFontSize;
70  css::uno::Any maStyleName;
71  css::uno::Any maGraphic;
72 };
73 
75 {
76 public:
77 
79 
80  void setLevel( sal_Int16 nLevel ) { mnLevel = nLevel; }
81  sal_Int16 getLevel( ) const { return mnLevel; }
86 
89  std::optional< sal_Int32 >& getParaLeftMargin(){ return moParaLeftMargin; }
90  std::optional< sal_Int32 >& getFirstLineIndentation(){ return moFirstLineIndentation; }
91 
92  std::optional< css::style::ParagraphAdjust >& getParaAdjust() { return moParaAdjust; }
93  void setParaAdjust( css::style::ParagraphAdjust nParaAdjust ) { moParaAdjust = nParaAdjust; }
94 
96  void setLineSpacing( const TextSpacing& rLineSpacing ) { maLineSpacing = rLineSpacing; }
97 
98  void apply( const TextParagraphProperties& rSourceProps );
99  void pushToPropSet( const ::oox::core::XmlFilterBase* pFilterBase,
100  const css::uno::Reference < css::beans::XPropertySet > & xPropSet,
101  PropertyMap& rioBulletList,
102  const BulletList* pMasterBuList,
103  bool bApplyBulletList,
104  float fFontSize,
105  bool bPushDefaultValues = false ) const;
106 
110  float getCharHeightPoints( float fDefault ) const;
111 
112 #ifdef DBG_UTIL
113  void dump() const;
114 #endif
115 
116 protected:
117 
123  std::optional< sal_Int32 > moParaLeftMargin;
124  std::optional< sal_Int32 > moFirstLineIndentation;
125  std::optional< css::style::ParagraphAdjust > moParaAdjust;
126  sal_Int16 mnLevel;
128 };
129 
130 }
131 
132 #endif // INCLUDED_OOX_DRAWINGML_TEXTPARAGRAPHPROPERTIES_HXX
133 
134 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::optional< css::style::ParagraphAdjust > moParaAdjust
std::optional< css::style::ParagraphAdjust > & getParaAdjust()
A helper that maps property identifiers to property values.
Definition: propertymap.hxx:52
exports com.sun.star. graphic
carries a CT_TextSpacing
Definition: textspacing.hxx:31
float getCharHeightPoints(float fDefault) const
Returns the largest character size of this paragraph.
void setBulletChar(const OUString &sChar)
std::optional< sal_Int32 > & getFirstLineIndentation()
::oox::drawingml::TextFont maBulletFont
void setBulletAspectRatio(double nAspectRatio)
void setStyleName(const OUString &rStyleName)
void apply(const TextParagraphProperties &rSourceProps)
void setGraphic(css::uno::Reference< css::graphic::XGraphic > const &rXGraphic)
void setLineSpacing(const TextSpacing &rLineSpacing)
const TextCharacterProperties & getTextCharacterProperties() const
void setStartAt(sal_Int32 nStartAt)
std::optional< sal_Int32 > & getParaLeftMargin()
void pushToPropSet(const ::oox::core::XmlFilterBase *pFilterBase, const css::uno::Reference< css::beans::XPropertySet > &xPropSet, PropertyMap &rioBulletList, const BulletList *pMasterBuList, bool bApplyBulletList, float fFontSize, bool bPushDefaultValues=false) const
std::shared_ptr< ::oox::drawingml::Color > maBulletColorPtr
void pushToPropMap(const ::oox::core::XmlFilterBase *pFilterBase, PropertyMap &xPropMap) const
TextCharacterProperties & getTextCharacterProperties()
carries a CT_TextFont
Definition: textfont.hxx:32
void setParaAdjust(css::style::ParagraphAdjust nParaAdjust)