xref: /aoo4110/main/sw/source/ui/inc/tablemgr.hxx (revision b1cdbd2c)
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 #ifndef _TABLEMGR_HXX
24 #define _TABLEMGR_HXX
25 
26 #include "swdllapi.h"
27 #include "swtypes.hxx"
28 #include "tabcol.hxx"
29 
30 class SwFrmFmt;
31 class SwWrtShell;
32 class Window;
33 class SfxItemSet;
34 class SwFlyFrmFmt;
35 
36 namespace com { namespace sun { namespace star {
37     namespace frame {
38         class XModel; }
39     namespace chart2 {
40     namespace data {
41         class XDataProvider; } }
42 }}}
43 
44 const SwTwips lAutoWidth = INVALID_TWIPS;
45 const char cParaDelim = 0x0a;
46 
47 class SW_DLLPUBLIC SwTableFUNC
48 {
49 	SwFrmFmt	*pFmt;
50 	SwWrtShell	*pSh;
51 	sal_Bool		bCopy;
52 	SwTabCols	aCols;
53 
54 private:
55 	SW_DLLPRIVATE int GetRightSeparator(int nNum) const;
56 
57 public:
58 	inline SwTableFUNC(SwFrmFmt &);
59 		   SwTableFUNC(SwWrtShell *pShell, sal_Bool bCopyFmt = sal_False);
60 		   ~SwTableFUNC();
61 
62 	void	InitTabCols();
63 	void	ColWidthDlg(Window *pParent );
64 	SwTwips GetColWidth(sal_uInt16 nNum) const;
65 	SwTwips GetMaxColWidth(sal_uInt16 nNum) const;
66 	void	SetColWidth(sal_uInt16 nNum, SwTwips nWidth );
67 	sal_uInt16	GetColCount() const;
68 	sal_uInt16	GetCurColNum() const;
69 
IsTableSelected() const70 	sal_Bool IsTableSelected() const { return pFmt != 0; }
71 
GetTableFmt() const72 	const SwFrmFmt *GetTableFmt() const { return pFmt; }
73 
GetShell() const74 	SwWrtShell* GetShell() const { return pSh; }
75 
76     // @deprecated
77 	void UpdateChart();
78 
79     /// @return the XModel of the newly inserted chart if successfull
80     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
81         InsertChart( ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataProvider > &rxDataProvider, sal_Bool bFillWithData, const rtl::OUString &rCellRange, SwFlyFrmFmt** ppFlyFrmFmt = 0 );
82 };
83 
SwTableFUNC(SwFrmFmt & rFmt)84 inline SwTableFUNC::SwTableFUNC(SwFrmFmt &rFmt) :
85 	pFmt(&rFmt),
86 	pSh(0),
87 	bCopy(sal_False)
88 {
89 }
90 
91 #endif
92