xref: /aoo42x/main/sw/source/ui/inc/tablemgr.hxx (revision 86e1cf34)
11d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
31d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
41d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
51d2dbeb0SAndrew Rist  * distributed with this work for additional information
61d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
71d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
81d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
91d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
101d2dbeb0SAndrew Rist  *
111d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
121d2dbeb0SAndrew Rist  *
131d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
141d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
151d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
161d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
171d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
181d2dbeb0SAndrew Rist  * under the License.
191d2dbeb0SAndrew Rist  *
201d2dbeb0SAndrew Rist  *************************************************************/
211d2dbeb0SAndrew Rist 
221d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir #ifndef _TABLEMGR_HXX
24cdf0e10cSrcweir #define _TABLEMGR_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include "swdllapi.h"
27cdf0e10cSrcweir #include "swtypes.hxx"
28cdf0e10cSrcweir #include "tabcol.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir class SwFrmFmt;
31cdf0e10cSrcweir class SwWrtShell;
32cdf0e10cSrcweir class Window;
33cdf0e10cSrcweir class SfxItemSet;
34cdf0e10cSrcweir class SwFlyFrmFmt;
35cdf0e10cSrcweir 
36cdf0e10cSrcweir namespace com { namespace sun { namespace star {
37cdf0e10cSrcweir     namespace frame {
38cdf0e10cSrcweir         class XModel; }
39cdf0e10cSrcweir     namespace chart2 {
40cdf0e10cSrcweir     namespace data {
41cdf0e10cSrcweir         class XDataProvider; } }
42cdf0e10cSrcweir }}}
43cdf0e10cSrcweir 
44cdf0e10cSrcweir const SwTwips lAutoWidth = INVALID_TWIPS;
45cdf0e10cSrcweir const char cParaDelim = 0x0a;
46cdf0e10cSrcweir 
47cdf0e10cSrcweir class SW_DLLPUBLIC SwTableFUNC
48cdf0e10cSrcweir {
49cdf0e10cSrcweir 	SwFrmFmt	*pFmt;
50cdf0e10cSrcweir 	SwWrtShell	*pSh;
51cdf0e10cSrcweir 	sal_Bool		bCopy;
52cdf0e10cSrcweir 	SwTabCols	aCols;
53cdf0e10cSrcweir 
54cdf0e10cSrcweir private:
55cdf0e10cSrcweir 	SW_DLLPRIVATE int GetRightSeparator(int nNum) const;
56cdf0e10cSrcweir 
57cdf0e10cSrcweir public:
58cdf0e10cSrcweir 	inline SwTableFUNC(SwFrmFmt &);
59cdf0e10cSrcweir 		   SwTableFUNC(SwWrtShell *pShell, sal_Bool bCopyFmt = sal_False);
60cdf0e10cSrcweir 		   ~SwTableFUNC();
61cdf0e10cSrcweir 
62cdf0e10cSrcweir 	void	InitTabCols();
63cdf0e10cSrcweir 	void	ColWidthDlg(Window *pParent );
64cdf0e10cSrcweir 	SwTwips GetColWidth(sal_uInt16 nNum) const;
65cdf0e10cSrcweir 	SwTwips GetMaxColWidth(sal_uInt16 nNum) const;
66cdf0e10cSrcweir 	void	SetColWidth(sal_uInt16 nNum, SwTwips nWidth );
67cdf0e10cSrcweir 	sal_uInt16	GetColCount() const;
68cdf0e10cSrcweir 	sal_uInt16	GetCurColNum() const;
69cdf0e10cSrcweir 
IsTableSelected() const70cdf0e10cSrcweir 	sal_Bool IsTableSelected() const { return pFmt != 0; }
71cdf0e10cSrcweir 
GetTableFmt() const72cdf0e10cSrcweir 	const SwFrmFmt *GetTableFmt() const { return pFmt; }
73cdf0e10cSrcweir 
GetShell() const74cdf0e10cSrcweir 	SwWrtShell* GetShell() const { return pSh; }
75cdf0e10cSrcweir 
76cdf0e10cSrcweir     // @deprecated
77cdf0e10cSrcweir 	void UpdateChart();
78cdf0e10cSrcweir 
79*86e1cf34SPedro Giffuni     /// @return the XModel of the newly inserted chart if successful
80cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
81cdf0e10cSrcweir         InsertChart( ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataProvider > &rxDataProvider, sal_Bool bFillWithData, const rtl::OUString &rCellRange, SwFlyFrmFmt** ppFlyFrmFmt = 0 );
82cdf0e10cSrcweir };
83cdf0e10cSrcweir 
SwTableFUNC(SwFrmFmt & rFmt)84cdf0e10cSrcweir inline SwTableFUNC::SwTableFUNC(SwFrmFmt &rFmt) :
85cdf0e10cSrcweir 	pFmt(&rFmt),
86cdf0e10cSrcweir 	pSh(0),
87cdf0e10cSrcweir 	bCopy(sal_False)
88cdf0e10cSrcweir {
89cdf0e10cSrcweir }
90cdf0e10cSrcweir 
91cdf0e10cSrcweir #endif
92