xref: /AOO41X/main/oox/inc/oox/drawingml/table/tablecell.hxx (revision e35081216278e1848f1c12af2e117a766f306f4b)
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_TABLECELL_HXX
25 #define OOX_DRAWINGML_TABLECELL_HXX
26 
27 #include "oox/helper/propertymap.hxx"
28 #include "oox/drawingml/color.hxx"
29 #include "oox/drawingml/drawingmltypes.hxx"
30 #include "oox/drawingml/lineproperties.hxx"
31 #include "oox/drawingml/fillproperties.hxx"
32 #include "oox/drawingml/textliststyle.hxx"
33 #include <com/sun/star/table/XCell.hpp>
34 
35 #include <boost/shared_ptr.hpp>
36 #include <boost/optional.hpp>
37 #include <vector>
38 #include <map>
39 
40 namespace oox { namespace drawingml { namespace table {
41 
42 class TableCellContext;
43 class TableProperties;
44 class TableStyle;
45 
46 class TableCell
47 {
48     friend class TableCellContext;
49 
50 public:
51 
52     TableCell();
53     ~TableCell();
54 
getRowSpan() const55     sal_Int32   getRowSpan() const { return mnRowSpan; };
setRowSpan(sal_Int32 nRowSpan)56     void        setRowSpan( sal_Int32 nRowSpan ){ mnRowSpan = nRowSpan; };
getGridSpan() const57     sal_Int32   getGridSpan() const { return mnGridSpan; };
setGridSpan(sal_Int32 nGridSpan)58     void        setGridSpan( sal_Int32 nGridSpan ){ mnGridSpan = nGridSpan; };
gethMerge() const59     sal_Bool    gethMerge() const { return mbhMerge; };
sethMerge(sal_Bool bhMerge)60     void        sethMerge( sal_Bool bhMerge ){ mbhMerge = bhMerge; };
getvMerge() const61     sal_Bool    getvMerge() const { return mbvMerge; };
setvMerge(sal_Bool bvMerge)62     void        setvMerge( sal_Bool bvMerge ){ mbvMerge = bvMerge; };
getLeftMargin() const63     sal_Int32   getLeftMargin() const { return mnMarL; };
setLeftMargin(sal_Int32 nMargin)64     void        setLeftMargin( sal_Int32 nMargin ){ mnMarL = nMargin; };
getRightMargin() const65     sal_Int32   getRightMargin() const { return mnMarR; };
setRightMargin(sal_Int32 nMargin)66     void        setRightMargin( sal_Int32 nMargin ){ mnMarR = nMargin; };
getTopMargin() const67     sal_Int32   getTopMargin() const { return mnMarT; };
setTopMargin(sal_Int32 nMargin)68     void        setTopMargin( sal_Int32 nMargin ){ mnMarT = nMargin; };
getBottomMargin() const69     sal_Int32   getBottomMargin() const { return mnMarB; };
setBottomMargin(sal_Int32 nMargin)70     void        setBottomMargin( sal_Int32 nMargin ){ mnMarB = nMargin; };
getVertToken() const71     sal_Int32   getVertToken() const { return mnVertToken; };
setVertToken(sal_Int32 nToken)72     void        setVertToken( sal_Int32 nToken ){ mnVertToken = nToken; };
getAnchorToken() const73     sal_Int32   getAnchorToken() const { return mnAnchorToken; };
setAnchorToken(sal_Int32 nToken)74     void        setAnchorToken( sal_Int32 nToken ){ mnAnchorToken = nToken; };
getAnchorCtr() const75     sal_Bool    getAnchorCtr() const { return mbAnchorCtr; };
setAnchorCtr(sal_Bool bAnchorCtr)76     void        setAnchorCtr( sal_Bool bAnchorCtr ){ mbAnchorCtr = bAnchorCtr; };
getHorzOverflowToken() const77     sal_Int32   getHorzOverflowToken() const { return mnHorzOverflowToken; };
setHorzOverflowToken(sal_Int32 nToken)78     void        setHorzOverflowToken( sal_Int32 nToken ){ mnHorzOverflowToken = nToken; };
79 
setTextBody(const oox::drawingml::TextBodyPtr & pTextBody)80     void                        setTextBody( const oox::drawingml::TextBodyPtr& pTextBody ){ mpTextBody = pTextBody; };
getTextBody()81     oox::drawingml::TextBodyPtr getTextBody(){ return mpTextBody; };
82 
83     void pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oox::drawingml::TextListStylePtr pMasterTextListStyle,
84         const ::com::sun::star::uno::Reference < ::com::sun::star::table::XCell >& rxCell, const TableProperties& rTableProperties,
85             const TableStyle& rTable, sal_Int32 nColumn, sal_Int32 nMaxColumn, sal_Int32 nRow, sal_Int32 nMaxRow );
86 
87 private:
88 
89     oox::drawingml::TextBodyPtr mpTextBody;
90 
91     oox::drawingml::LineProperties  maLinePropertiesLeft;
92     oox::drawingml::LineProperties  maLinePropertiesRight;
93     oox::drawingml::LineProperties  maLinePropertiesTop;
94     oox::drawingml::LineProperties  maLinePropertiesBottom;
95     oox::drawingml::LineProperties  maLinePropertiesTopLeftToBottomRight;
96     oox::drawingml::LineProperties  maLinePropertiesBottomLeftToTopRight;
97 
98     oox::drawingml::FillProperties  maFillProperties;
99 
100     sal_Int32 mnRowSpan;
101     sal_Int32 mnGridSpan;
102     sal_Bool mbhMerge;
103     sal_Bool mbvMerge;
104 
105     sal_Int32 mnMarL;
106     sal_Int32 mnMarR;
107     sal_Int32 mnMarT;
108     sal_Int32 mnMarB;
109     sal_Int32 mnVertToken;
110     sal_Int32 mnAnchorToken;
111     sal_Bool  mbAnchorCtr;
112     sal_Int32 mnHorzOverflowToken;
113 };
114 
115 } } }
116 
117 #endif  //  OOX_DRAWINGML_TABLECELL_HXX
118