xref: /aoo41x/main/sw/source/ui/inc/tablemgr.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _TABLEMGR_HXX
28 #define _TABLEMGR_HXX
29 
30 #include "swdllapi.h"
31 #include "swtypes.hxx"
32 #include "tabcol.hxx"
33 
34 class SwFrmFmt;
35 class SwWrtShell;
36 class Window;
37 class SfxItemSet;
38 class SwFlyFrmFmt;
39 
40 namespace com { namespace sun { namespace star {
41     namespace frame {
42         class XModel; }
43     namespace chart2 {
44     namespace data {
45         class XDataProvider; } }
46 }}}
47 
48 const SwTwips lAutoWidth = INVALID_TWIPS;
49 const char cParaDelim = 0x0a;
50 
51 class SW_DLLPUBLIC SwTableFUNC
52 {
53 	SwFrmFmt	*pFmt;
54 	SwWrtShell	*pSh;
55 	sal_Bool		bCopy;
56 	SwTabCols	aCols;
57 
58 private:
59 	SW_DLLPRIVATE int GetRightSeparator(int nNum) const;
60 
61 public:
62 	inline SwTableFUNC(SwFrmFmt &);
63 		   SwTableFUNC(SwWrtShell *pShell, sal_Bool bCopyFmt = sal_False);
64 		   ~SwTableFUNC();
65 
66 	void	InitTabCols();
67 	void	ColWidthDlg(Window *pParent );
68 	SwTwips GetColWidth(sal_uInt16 nNum) const;
69 	SwTwips GetMaxColWidth(sal_uInt16 nNum) const;
70 	void	SetColWidth(sal_uInt16 nNum, SwTwips nWidth );
71 	sal_uInt16	GetColCount() const;
72 	sal_uInt16	GetCurColNum() const;
73 
74 	sal_Bool IsTableSelected() const { return pFmt != 0; }
75 
76 	const SwFrmFmt *GetTableFmt() const { return pFmt; }
77 
78 	SwWrtShell* GetShell() const { return pSh; }
79 
80     // @deprecated
81 	void UpdateChart();
82 
83     /// @return the XModel of the newly inserted chart if successfull
84     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
85         InsertChart( ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataProvider > &rxDataProvider, sal_Bool bFillWithData, const rtl::OUString &rCellRange, SwFlyFrmFmt** ppFlyFrmFmt = 0 );
86 };
87 
88 inline SwTableFUNC::SwTableFUNC(SwFrmFmt &rFmt) :
89 	pFmt(&rFmt),
90 	pSh(0),
91 	bCopy(sal_False)
92 {
93 }
94 
95 #endif
96