1*e3508121SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*e3508121SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*e3508121SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*e3508121SAndrew Rist  * distributed with this work for additional information
6*e3508121SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*e3508121SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*e3508121SAndrew Rist  * "License"); you may not use this file except in compliance
9*e3508121SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*e3508121SAndrew Rist  *
11*e3508121SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*e3508121SAndrew Rist  *
13*e3508121SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*e3508121SAndrew Rist  * software distributed under the License is distributed on an
15*e3508121SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*e3508121SAndrew Rist  * KIND, either express or implied.  See the License for the
17*e3508121SAndrew Rist  * specific language governing permissions and limitations
18*e3508121SAndrew Rist  * under the License.
19*e3508121SAndrew Rist  *
20*e3508121SAndrew Rist  *************************************************************/
21*e3508121SAndrew Rist 
22*e3508121SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef OOX_DRAWINGML_TABLECELL_HXX
25cdf0e10cSrcweir #define OOX_DRAWINGML_TABLECELL_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "oox/helper/propertymap.hxx"
28cdf0e10cSrcweir #include "oox/drawingml/color.hxx"
29cdf0e10cSrcweir #include "oox/drawingml/drawingmltypes.hxx"
30cdf0e10cSrcweir #include "oox/drawingml/lineproperties.hxx"
31cdf0e10cSrcweir #include "oox/drawingml/fillproperties.hxx"
32cdf0e10cSrcweir #include "oox/drawingml/textliststyle.hxx"
33cdf0e10cSrcweir #include <com/sun/star/table/XCell.hpp>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir #include <boost/shared_ptr.hpp>
36cdf0e10cSrcweir #include <boost/optional.hpp>
37cdf0e10cSrcweir #include <vector>
38cdf0e10cSrcweir #include <map>
39cdf0e10cSrcweir 
40cdf0e10cSrcweir namespace oox { namespace drawingml { namespace table {
41cdf0e10cSrcweir 
42cdf0e10cSrcweir class TableCellContext;
43cdf0e10cSrcweir class TableProperties;
44cdf0e10cSrcweir class TableStyle;
45cdf0e10cSrcweir 
46cdf0e10cSrcweir class TableCell
47cdf0e10cSrcweir {
48cdf0e10cSrcweir 	friend class TableCellContext;
49cdf0e10cSrcweir 
50cdf0e10cSrcweir public:
51cdf0e10cSrcweir 
52cdf0e10cSrcweir 	TableCell();
53cdf0e10cSrcweir     ~TableCell();
54cdf0e10cSrcweir 
getRowSpan() const55cdf0e10cSrcweir 	sal_Int32	getRowSpan() const { return mnRowSpan; };
setRowSpan(sal_Int32 nRowSpan)56cdf0e10cSrcweir 	void		setRowSpan( sal_Int32 nRowSpan ){ mnRowSpan = nRowSpan; };
getGridSpan() const57cdf0e10cSrcweir 	sal_Int32	getGridSpan() const { return mnGridSpan; };
setGridSpan(sal_Int32 nGridSpan)58cdf0e10cSrcweir 	void		setGridSpan( sal_Int32 nGridSpan ){ mnGridSpan = nGridSpan; };
gethMerge() const59cdf0e10cSrcweir 	sal_Bool	gethMerge() const { return mbhMerge; };
sethMerge(sal_Bool bhMerge)60cdf0e10cSrcweir 	void		sethMerge( sal_Bool bhMerge ){ mbhMerge = bhMerge; };
getvMerge() const61cdf0e10cSrcweir 	sal_Bool	getvMerge() const { return mbvMerge; };
setvMerge(sal_Bool bvMerge)62cdf0e10cSrcweir 	void		setvMerge( sal_Bool bvMerge ){ mbvMerge = bvMerge; };
getLeftMargin() const63cdf0e10cSrcweir 	sal_Int32	getLeftMargin() const { return mnMarL; };
setLeftMargin(sal_Int32 nMargin)64cdf0e10cSrcweir 	void		setLeftMargin( sal_Int32 nMargin ){ mnMarL = nMargin; };
getRightMargin() const65cdf0e10cSrcweir 	sal_Int32	getRightMargin() const { return mnMarR; };
setRightMargin(sal_Int32 nMargin)66cdf0e10cSrcweir 	void		setRightMargin( sal_Int32 nMargin ){ mnMarR = nMargin; };
getTopMargin() const67cdf0e10cSrcweir 	sal_Int32	getTopMargin() const { return mnMarT; };
setTopMargin(sal_Int32 nMargin)68cdf0e10cSrcweir 	void		setTopMargin( sal_Int32 nMargin ){ mnMarT = nMargin; };
getBottomMargin() const69cdf0e10cSrcweir 	sal_Int32	getBottomMargin() const { return mnMarB; };
setBottomMargin(sal_Int32 nMargin)70cdf0e10cSrcweir 	void		setBottomMargin( sal_Int32 nMargin ){ mnMarB = nMargin; };
getVertToken() const71cdf0e10cSrcweir 	sal_Int32	getVertToken() const { return mnVertToken; };
setVertToken(sal_Int32 nToken)72cdf0e10cSrcweir 	void		setVertToken( sal_Int32 nToken ){ mnVertToken = nToken; };
getAnchorToken() const73cdf0e10cSrcweir 	sal_Int32	getAnchorToken() const { return mnAnchorToken; };
setAnchorToken(sal_Int32 nToken)74cdf0e10cSrcweir 	void		setAnchorToken( sal_Int32 nToken ){ mnAnchorToken = nToken; };
getAnchorCtr() const75cdf0e10cSrcweir 	sal_Bool	getAnchorCtr() const { return mbAnchorCtr; };
setAnchorCtr(sal_Bool bAnchorCtr)76cdf0e10cSrcweir 	void		setAnchorCtr( sal_Bool bAnchorCtr ){ mbAnchorCtr = bAnchorCtr; };
getHorzOverflowToken() const77cdf0e10cSrcweir 	sal_Int32	getHorzOverflowToken() const { return mnHorzOverflowToken; };
setHorzOverflowToken(sal_Int32 nToken)78cdf0e10cSrcweir 	void		setHorzOverflowToken( sal_Int32 nToken ){ mnHorzOverflowToken = nToken; };
79cdf0e10cSrcweir 
setTextBody(const oox::drawingml::TextBodyPtr & pTextBody)80cdf0e10cSrcweir 	void						setTextBody( const oox::drawingml::TextBodyPtr& pTextBody ){ mpTextBody = pTextBody; };
getTextBody()81cdf0e10cSrcweir 	oox::drawingml::TextBodyPtr	getTextBody(){ return mpTextBody; };
82cdf0e10cSrcweir 
83cdf0e10cSrcweir 	void pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oox::drawingml::TextListStylePtr pMasterTextListStyle,
84cdf0e10cSrcweir 		const ::com::sun::star::uno::Reference < ::com::sun::star::table::XCell >& rxCell, const TableProperties& rTableProperties,
85cdf0e10cSrcweir 			const TableStyle& rTable, sal_Int32 nColumn, sal_Int32 nMaxColumn, sal_Int32 nRow, sal_Int32 nMaxRow );
86cdf0e10cSrcweir 
87cdf0e10cSrcweir private:
88cdf0e10cSrcweir 
89cdf0e10cSrcweir     oox::drawingml::TextBodyPtr mpTextBody;
90cdf0e10cSrcweir 
91cdf0e10cSrcweir 	oox::drawingml::LineProperties	maLinePropertiesLeft;
92cdf0e10cSrcweir 	oox::drawingml::LineProperties	maLinePropertiesRight;
93cdf0e10cSrcweir 	oox::drawingml::LineProperties	maLinePropertiesTop;
94cdf0e10cSrcweir 	oox::drawingml::LineProperties	maLinePropertiesBottom;
95cdf0e10cSrcweir 	oox::drawingml::LineProperties	maLinePropertiesTopLeftToBottomRight;
96cdf0e10cSrcweir 	oox::drawingml::LineProperties	maLinePropertiesBottomLeftToTopRight;
97cdf0e10cSrcweir 
98cdf0e10cSrcweir 	oox::drawingml::FillProperties	maFillProperties;
99cdf0e10cSrcweir 
100cdf0e10cSrcweir 	sal_Int32 mnRowSpan;
101cdf0e10cSrcweir 	sal_Int32 mnGridSpan;
102cdf0e10cSrcweir 	sal_Bool mbhMerge;
103cdf0e10cSrcweir 	sal_Bool mbvMerge;
104cdf0e10cSrcweir 
105cdf0e10cSrcweir 	sal_Int32 mnMarL;
106cdf0e10cSrcweir 	sal_Int32 mnMarR;
107cdf0e10cSrcweir 	sal_Int32 mnMarT;
108cdf0e10cSrcweir 	sal_Int32 mnMarB;
109cdf0e10cSrcweir 	sal_Int32 mnVertToken;
110cdf0e10cSrcweir 	sal_Int32 mnAnchorToken;
111cdf0e10cSrcweir 	sal_Bool  mbAnchorCtr;
112cdf0e10cSrcweir 	sal_Int32 mnHorzOverflowToken;
113cdf0e10cSrcweir };
114cdf0e10cSrcweir 
115cdf0e10cSrcweir } } }
116cdf0e10cSrcweir 
117cdf0e10cSrcweir #endif  //  OOX_DRAWINGML_TABLECELL_HXX
118