xref: /AOO41X/main/oox/inc/oox/drawingml/table/tableproperties.hxx (revision 506e65412a40484e10815ed9bdf3df3cf476574f)
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_TABLEPROPERTIES_HXX
25 #define OOX_DRAWINGML_TABLEPROPERTIES_HXX
26 
27 #include "oox/drawingml/table/tablerow.hxx"
28 #include "oox/drawingml/table/tablestyle.hxx"
29 #include "oox/helper/propertymap.hxx"
30 #include "oox/drawingml/color.hxx"
31 
32 #include <boost/shared_ptr.hpp>
33 #include <boost/optional.hpp>
34 #include <vector>
35 #include <map>
36 
37 namespace oox { namespace drawingml { namespace table {
38 
39 class TableProperties
40 {
41 public:
42 
43     TableProperties();
44     ~TableProperties();
45 
getTableGrid()46     std::vector< sal_Int32 >& getTableGrid() { return mvTableGrid; };
getTableRows()47     std::vector< TableRow >& getTableRows() { return mvTableRows; };
48 
getStyleId()49     rtl::OUString&                      getStyleId(){ return maStyleId; };
getTableStyle()50     boost::shared_ptr< TableStyle >&    getTableStyle(){ return mpTableStyle; };
isRtl()51     sal_Bool&                           isRtl(){ return mbRtl; };
isFirstRow()52     sal_Bool&                           isFirstRow(){ return mbFirstRow; };
isFirstCol()53     sal_Bool&                           isFirstCol(){ return mbFirstCol; };
isLastRow()54     sal_Bool&                           isLastRow(){ return mbLastRow; };
isLastCol()55     sal_Bool&                           isLastCol(){ return mbLastCol; };
isBandRow()56     sal_Bool&                           isBandRow(){ return mbBandRow; };
isBandCol()57     sal_Bool&                           isBandCol(){ return mbBandCol; };
58 
59     void apply( const TablePropertiesPtr& );
60     void pushToPropSet( const ::oox::core::XmlFilterBase& rFilterBase,
61         const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & xPropSet, ::oox::drawingml::TextListStylePtr pMasterTextListStyle );
62 
63 private:
64 
65     const TableStyle&                   getUsedTableStyle( const ::oox::core::XmlFilterBase& rFilterBase,  sal_Bool &isCreateTabStyle);
66 
67     rtl::OUString                       maStyleId;              // either StyleId is available
68     boost::shared_ptr< TableStyle >     mpTableStyle;           // or the complete TableStyle
69     std::vector< sal_Int32 >            mvTableGrid;
70     std::vector< TableRow >             mvTableRows;
71 
72     sal_Bool                            mbRtl;
73     sal_Bool                            mbFirstRow;
74     sal_Bool                            mbFirstCol;
75     sal_Bool                            mbLastRow;
76     sal_Bool                            mbLastCol;
77     sal_Bool                            mbBandRow;
78     sal_Bool                            mbBandCol;
79 };
80 
81 } } }
82 
83 #endif  //  OOX_DRAWINGML_TABLEPROPERTIES_HXX
84