1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef OOX_DRAWINGML_TEXTPARAGRAPH_HXX
25 #define OOX_DRAWINGML_TEXTPARAGRAPH_HXX
26 
27 #include <com/sun/star/text/XTextCursor.hpp>
28 #include <com/sun/star/text/XText.hpp>
29 
30 #include "oox/core/xmlfilterbase.hxx"
31 #include "oox/drawingml/textrun.hxx"
32 #include "oox/drawingml/textliststyle.hxx"
33 #include "oox/drawingml/textparagraphproperties.hxx"
34 
35 namespace oox { namespace drawingml {
36 
37 typedef RefVector< TextRun > TextRunVector;
38 
39 class TextParagraph
40 {
41 public:
42     TextParagraph();
43     ~TextParagraph();
44 
getRuns()45     inline TextRunVector&       getRuns() { return maRuns; }
getRuns() const46     inline const TextRunVector& getRuns() const { return maRuns; }
addRun(const TextRunPtr & pRun)47     inline void                 addRun( const TextRunPtr & pRun ) { maRuns.push_back( pRun ); }
48 
getProperties()49     inline TextParagraphProperties&         getProperties() { return maProperties; }
getProperties() const50     inline const TextParagraphProperties&   getProperties() const { return maProperties; }
51 
getEndProperties()52     inline TextCharacterProperties&         getEndProperties() { return maEndProperties; }
getEndProperties() const53     inline const TextCharacterProperties&   getEndProperties() const { return maEndProperties; }
54 
55     //inline void                        setProperties( TextParagraphPropertiesPtr pProps ) { mpProperties = pProps; }
56 
57     void                        insertAt(
58                                     const ::oox::core::XmlFilterBase& rFilterBase,
59                                     const ::com::sun::star::uno::Reference < ::com::sun::star::text::XText > & xText,
60                                     const ::com::sun::star::uno::Reference < ::com::sun::star::text::XTextCursor > &xAt,
61                                     const TextCharacterProperties& rTextStyleProperties,
62                                     const TextListStyle& rTextListStyle,
63                                     bool bFirst = false ) const;
64 
65 private:
66     TextParagraphProperties     maProperties;
67     TextCharacterProperties     maEndProperties;
68     TextRunVector               maRuns;
69 };
70 
71 typedef boost::shared_ptr< TextParagraph > TextParagraphPtr;
72 
73 } }
74 
75 #endif  //  OOX_DRAWINGML_TEXTPARAGRAPH_HXX
76