xref: /aoo42x/main/sw/inc/unotbl.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 _UNOTBL_HXX
28 #define _UNOTBL_HXX
29 
30 #include <com/sun/star/container/XNamed.hpp>
31 #include <com/sun/star/container/XEnumerationAccess.hpp>
32 #include <com/sun/star/util/XSortable.hpp>
33 #include <com/sun/star/chart/XChartData.hpp>
34 #include <com/sun/star/chart/XChartDataArray.hpp>
35 #include <com/sun/star/chart2/data/XLabeledDataSequence.hpp>
36 #include <com/sun/star/text/XTextTableCursor.hpp>
37 #include <com/sun/star/text/XTextTable.hpp>
38 #include <com/sun/star/table/XCellRange.hpp>
39 #include <com/sun/star/sheet/XCellRangeData.hpp>
40 #include <com/sun/star/table/XAutoFormattable.hpp>
41 
42 #include <cppuhelper/implbase3.hxx>
43 #include <cppuhelper/implbase4.hxx>
44 #include <cppuhelper/implbase5.hxx>
45 #include <cppuhelper/implbase7.hxx>
46 #include <cppuhelper/implbase10.hxx>
47 
48 #include <comphelper/uno3.hxx>
49 #include <tools/string.hxx>
50 
51 #include <calbck.hxx>
52 #include <TextCursorHelper.hxx>
53 #include <unoevtlstnr.hxx>
54 #include <unotext.hxx>
55 
56 
57 class SwUnoCrsr;
58 class SwTable;
59 class SwTableBox;
60 class SwTableLine;
61 class SwTableCursor;
62 class SwTableBoxFmt;
63 class SwChartDataProvider;
64 class SwFrmFmt;
65 
66 
67 /* -----------------------------22.09.00 11:10--------------------------------
68 
69  ---------------------------------------------------------------------------*/
70 class SwChartEventListenerContainer : public SwEventListenerContainer
71 {
72 	public:
73         SwChartEventListenerContainer( ::com::sun::star::uno::XInterface* pxParentL) :
74             SwEventListenerContainer(pxParentL){}
75     	void ChartDataChanged();
76 };
77 /* ---------------------------------------------------------------------------
78 
79  ---------------------------------------------------------------------------*/
80 typedef
81 cppu::WeakImplHelper4
82 <
83 	::com::sun::star::table::XCell,
84 	::com::sun::star::lang::XServiceInfo,
85 	::com::sun::star::beans::XPropertySet,
86 	::com::sun::star::container::XEnumerationAccess
87 >
88 SwXCellBaseClass;
89 class SwXCell : public SwXCellBaseClass,
90 	public SwXText,
91 	public SwClient
92 {
93     friend void   lcl_setString( SwXCell &rCell, const rtl::OUString &rTxt,
94                                  sal_Bool bKeepNumberFmt = sal_False );
95     friend double lcl_getValue( SwXCell &rCell );
96     friend void   lcl_setValue( SwXCell &rCell, double nVal );
97 
98 
99     const SfxItemPropertySet*   m_pPropSet;
100     SwTableBox*                 pBox;       // only set in non-XML import
101 	const SwStartNode* 		pStartNode; // only set in XML import
102 
103     // table position where pBox was found last
104     sal_uInt16              nFndPos;
105 
106 protected:
107 	virtual const SwStartNode *GetStartNode() const;
108 
109     virtual ::com::sun::star::uno::Reference<
110                 ::com::sun::star::text::XTextCursor >
111         CreateCursor()
112         throw (::com::sun::star::uno::RuntimeException);
113 
114     bool IsValid() const;
115 
116 	virtual ~SwXCell();
117 
118 	//SwClient
119    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
120 
121 public:
122     SwXCell(SwFrmFmt* pTblFmt, SwTableBox* pBox, sal_uInt16 nPos=USHRT_MAX );
123 	SwXCell(SwFrmFmt* pTblFmt, const SwStartNode& rStartNode); // XML import interface
124 
125 
126 	TYPEINFO();
127 
128     static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
129 
130 	//XUnoTunnel
131 	virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
132 
133     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException);
134     virtual void SAL_CALL acquire(  ) throw();
135     virtual void SAL_CALL release(  ) throw();
136 
137 	//XTypeProvider
138 	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw(::com::sun::star::uno::RuntimeException);
139     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) throw(::com::sun::star::uno::RuntimeException);
140 
141 	//XCell
142     virtual ::rtl::OUString SAL_CALL getFormula(  ) throw(::com::sun::star::uno::RuntimeException);
143     virtual void SAL_CALL setFormula( const ::rtl::OUString& aFormula ) throw(::com::sun::star::uno::RuntimeException);
144     virtual double SAL_CALL getValue(  ) throw(::com::sun::star::uno::RuntimeException);
145     virtual void SAL_CALL setValue( double nValue ) throw(::com::sun::star::uno::RuntimeException);
146     virtual ::com::sun::star::table::CellContentType SAL_CALL getType(  ) throw(::com::sun::star::uno::RuntimeException);
147     virtual sal_Int32 SAL_CALL getError(  ) throw(::com::sun::star::uno::RuntimeException);
148 
149 	//XText
150 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor >  SAL_CALL createTextCursor(void) throw( ::com::sun::star::uno::RuntimeException );
151 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor >  SAL_CALL createTextCursorByRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & aTextPosition) throw( ::com::sun::star::uno::RuntimeException );
152 	virtual void SAL_CALL  setString(const rtl::OUString& aString) throw( ::com::sun::star::uno::RuntimeException );
153 
154 	//XPropertySet
155     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
156     virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
157     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
158     virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
159     virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
160     virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
161     virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
162 
163 	//XServiceInfo
164 	virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
165 	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
166 	virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
167 
168 	//XEnumerationAccess - frueher XParagraphEnumerationAccess
169 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration >  SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException );
170 
171 	//XElementAccess
172     virtual ::com::sun::star::uno::Type SAL_CALL getElementType(  ) throw(::com::sun::star::uno::RuntimeException);
173     virtual sal_Bool SAL_CALL hasElements(  ) throw(::com::sun::star::uno::RuntimeException);
174 
175     SwTableBox*   GetTblBox()const {return pBox;}
176 	static SwXCell*		CreateXCell(SwFrmFmt* pTblFmt, SwTableBox* pBox, SwTable *pTbl = 0 );
177 	SwTableBox* 	FindBox(SwTable* pTable, SwTableBox* pBox);
178 
179     SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
180 };
181 /* -----------------27.06.98 15:40-------------------
182  *
183  * --------------------------------------------------*/
184 class SwXTextTableRow : public cppu::WeakImplHelper2
185 <
186 	::com::sun::star::beans::XPropertySet,
187     ::com::sun::star::lang::XServiceInfo
188 >,
189 	public SwClient
190 {
191     const SfxItemPropertySet*   m_pPropSet;
192 	SwTableLine* 			pLine;
193 
194 	SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
195 protected:
196 	virtual ~SwXTextTableRow();
197 	//SwClient
198    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
199 
200 public:
201 	SwXTextTableRow(SwFrmFmt* pFmt, SwTableLine* pLine);
202 
203 
204 	TYPEINFO();
205 
206 	//XPropertySet
207     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
208     virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
209     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
210     virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
211     virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
212     virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
213     virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
214 
215 	//XServiceInfo
216 	virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
217 	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
218 	virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
219 
220 	const SwTableLine* 	GetTblRow() const {return pLine;}
221 	static SwTableLine* FindLine(SwTable* pTable, SwTableLine* pLine);
222 };
223 /* -----------------20.07.98 13:03-------------------
224  *
225  * --------------------------------------------------*/
226 typedef cppu::WeakImplHelper3<
227 								::com::sun::star::text::XTextTableCursor,
228 								::com::sun::star::lang::XServiceInfo,
229 								::com::sun::star::beans::XPropertySet
230 							> SwXTextTableCursor_Base;
231 class SW_DLLPUBLIC SwXTextTableCursor : public SwXTextTableCursor_Base
232 	,public SwClient
233 	,public OTextCursorHelper
234 {
235 	SwDepend 				aCrsrDepend;
236     const SfxItemPropertySet*   m_pPropSet;
237 
238 	//	SwUnoCrsr* 		GetCrsr() const { return (SwUnoCrsr*)aCrsrDepend.GetRegisteredIn(); }
239 
240 protected:
241 	virtual ~SwXTextTableCursor();
242 public:
243 	SwXTextTableCursor(SwFrmFmt* pFmt, SwTableBox* pBox);
244 	SwXTextTableCursor(SwFrmFmt& rTableFmt,
245 						const SwTableCursor* pTableSelection);
246 
247 
248 	DECLARE_XINTERFACE()
249 
250 	//XTextTableCursor
251     virtual ::rtl::OUString SAL_CALL getRangeName(  ) throw(::com::sun::star::uno::RuntimeException);
252     virtual sal_Bool SAL_CALL gotoCellByName( const ::rtl::OUString& aCellName, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException);
253     virtual sal_Bool SAL_CALL goLeft( sal_Int16 nCount, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException);
254     virtual sal_Bool SAL_CALL goRight( sal_Int16 nCount, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException);
255     virtual sal_Bool SAL_CALL goUp( sal_Int16 nCount, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException);
256     virtual sal_Bool SAL_CALL goDown( sal_Int16 nCount, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException);
257     virtual void SAL_CALL gotoStart( sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException);
258     virtual void SAL_CALL gotoEnd( sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException);
259     virtual sal_Bool SAL_CALL mergeRange(  ) throw(::com::sun::star::uno::RuntimeException);
260     virtual sal_Bool SAL_CALL splitRange( sal_Int16 Count, sal_Bool Horizontal ) throw(::com::sun::star::uno::RuntimeException);
261 
262 	//XPropertySet
263     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
264     virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
265     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
266     virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
267     virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
268     virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
269     virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
270 
271 	//XServiceInfo
272 	virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
273 	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
274 	virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
275 
276 	//SwClient
277    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
278 
279 	// ITextCursorHelper
280 	virtual const SwPaM*		GetPaM() const;
281 	virtual	SwPaM*				GetPaM();
282 	virtual const SwDoc* 		GetDoc() const;
283 	virtual SwDoc* 				GetDoc();
284 
285 	const SwUnoCrsr*			GetCrsr() const;
286 	SwUnoCrsr*					GetCrsr();
287 	SwFrmFmt* 		GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
288 };
289 
290 /*-----------------11.12.97 09:38-------------------
291 
292 --------------------------------------------------*/
293 struct SwRangeDescriptor
294 {
295     sal_Int32 nTop;
296     sal_Int32 nLeft;
297     sal_Int32 nBottom;
298     sal_Int32 nRight;
299 
300     void Normalize();
301 };
302 
303 class SwTableProperties_Impl;
304 class SwXTextTable : public cppu::WeakImplHelper10
305 <
306 	::com::sun::star::text::XTextTable,
307 	::com::sun::star::lang::XServiceInfo,
308 	::com::sun::star::table::XCellRange,
309 	::com::sun::star::chart::XChartDataArray,
310 	::com::sun::star::beans::XPropertySet,
311 	::com::sun::star::container::XNamed,
312 	::com::sun::star::table::XAutoFormattable,
313 	::com::sun::star::util::XSortable,
314     ::com::sun::star::lang::XUnoTunnel,
315     ::com::sun::star::sheet::XCellRangeData
316 >,
317 	public SwClient
318 {
319 	SwEventListenerContainer		aLstnrCntnr;
320 	SwChartEventListenerContainer	aChartLstnrCntnr;
321     const SfxItemPropertySet*       m_pPropSet;
322 
323 	// Descriptor-interface
324 	SwTableProperties_Impl*		pTableProps;
325 	String 						m_sTableName;
326 	sal_Bool 						bIsDescriptor;
327 	unsigned short 				nRows;
328 	unsigned short 				nColumns;
329 
330 
331 	sal_Bool						bFirstRowAsLabel 	:1;
332 	sal_Bool						bFirstColumnAsLabel	:1;
333 protected:
334 	virtual ~SwXTextTable();
335 public:
336 	SwXTextTable();
337 	SwXTextTable(SwFrmFmt& rFrmFmt);
338 
339 
340 	static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
341 
342 	//XUnoTunnel
343 	virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
344 
345 	TYPEINFO();
346 
347 	//XTextTable
348     virtual void SAL_CALL initialize( sal_Int32 nRows, sal_Int32 nColumns ) throw(::com::sun::star::uno::RuntimeException);
349     virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XTableRows > SAL_CALL getRows(  ) throw(::com::sun::star::uno::RuntimeException);
350     virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XTableColumns > SAL_CALL getColumns(  ) throw(::com::sun::star::uno::RuntimeException);
351     virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell > SAL_CALL getCellByName( const ::rtl::OUString& aCellName ) throw(::com::sun::star::uno::RuntimeException);
352     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getCellNames(  ) throw(::com::sun::star::uno::RuntimeException);
353     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextTableCursor > SAL_CALL createCursorByCellName( const ::rtl::OUString& aCellName ) throw(::com::sun::star::uno::RuntimeException);
354 
355 	//XTextContent
356 	virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
357     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor(  ) throw(::com::sun::star::uno::RuntimeException);
358 
359 	//XComponent
360 	virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException );
361 	virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
362 	virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
363 
364 	//XCellRange
365     virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell > SAL_CALL getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow ) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
366     virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom ) throw(com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
367     virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL getCellRangeByName( const ::rtl::OUString& aRange ) throw(::com::sun::star::uno::RuntimeException);
368 
369 	//XChartDataArray
370     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > > SAL_CALL getData(  ) throw(::com::sun::star::uno::RuntimeException);
371     virtual void SAL_CALL setData( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > >& aData ) throw(::com::sun::star::uno::RuntimeException);
372     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getRowDescriptions(  ) throw(::com::sun::star::uno::RuntimeException);
373     virtual void SAL_CALL setRowDescriptions( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRowDescriptions ) throw(::com::sun::star::uno::RuntimeException);
374     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getColumnDescriptions(  ) throw(::com::sun::star::uno::RuntimeException);
375     virtual void SAL_CALL setColumnDescriptions( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aColumnDescriptions ) throw(::com::sun::star::uno::RuntimeException);
376 
377 	//XChartData
378 	virtual void SAL_CALL addChartDataChangeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException);
379     virtual void SAL_CALL removeChartDataChangeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException);
380     virtual double SAL_CALL getNotANumber(  ) throw(::com::sun::star::uno::RuntimeException);
381     virtual sal_Bool SAL_CALL isNotANumber( double nNumber ) throw(::com::sun::star::uno::RuntimeException);
382 
383 	//XSortable
384 	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL createSortDescriptor(void) throw( ::com::sun::star::uno::RuntimeException );
385 	virtual void SAL_CALL sort(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& xDescriptor) throw( ::com::sun::star::uno::RuntimeException );
386 
387 	//XAutoFormattable
388 	virtual void SAL_CALL autoFormat(const rtl::OUString& aName) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
389 
390 	//XPropertySet
391     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
392     virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
393     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
394     virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
395     virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
396     virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
397     virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
398 
399 	//XNamed
400 	virtual rtl::OUString SAL_CALL getName(void) throw( ::com::sun::star::uno::RuntimeException );
401 	virtual void SAL_CALL setName(const rtl::OUString& Name_) throw( ::com::sun::star::uno::RuntimeException );
402 
403     //XCellRangeData
404     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > > SAL_CALL getDataArray(  ) throw (::com::sun::star::uno::RuntimeException);
405     virtual void SAL_CALL setDataArray( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& aArray ) throw (::com::sun::star::uno::RuntimeException);
406 
407 	//XServiceInfo
408 	virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
409 	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
410 	virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
411 
412     void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
413 
414 	sal_uInt16 			getRowCount(void);
415 	sal_uInt16 			getColumnCount(void);
416 	::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange >  	GetRangeByName(SwFrmFmt* pFmt, SwTable* pTable,
417 						const String& sTLName, const String& sBRName,
418 						SwRangeDescriptor& rDesc);
419 
420 	//SwClient
421    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
422 
423 	SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
424 };
425 
426 /* -----------------27.04.98 16:41-------------------
427  *
428  * --------------------------------------------------*/
429 class SwXCellRange : public cppu::WeakImplHelper7
430 <
431 	::com::sun::star::table::XCellRange,
432 	::com::sun::star::lang::XServiceInfo,
433 	::com::sun::star::lang::XUnoTunnel,
434 	::com::sun::star::beans::XPropertySet,
435 	::com::sun::star::chart::XChartDataArray,
436     ::com::sun::star::util::XSortable,
437     ::com::sun::star::sheet::XCellRangeData
438 >,
439 	public SwClient
440 {
441 	SwDepend						aCursorDepend; //the cursor is removed after the doc has been removed
442 	SwChartEventListenerContainer	aChartLstnrCntnr;
443 
444 	SwRangeDescriptor 			aRgDesc;
445     const SfxItemPropertySet*   m_pPropSet;
446 
447 	SwUnoCrsr* 					pTblCrsr;
448 
449 	sal_Bool						bFirstRowAsLabel 	:1;
450 	sal_Bool						bFirstColumnAsLabel	:1;
451 
452 public:
453 	SwXCellRange(SwUnoCrsr* pCrsr, SwFrmFmt& rFrmFmt, SwRangeDescriptor& rDesc);
454 	~SwXCellRange();
455 
456 	TYPEINFO();
457 
458 	static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
459 
460 	//XUnoTunnel
461 	virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
462 
463 
464 	//XCellRange
465     virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell > SAL_CALL getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow ) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
466     virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom ) throw(com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
467     virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL getCellRangeByName( const ::rtl::OUString& aRange ) throw(::com::sun::star::uno::RuntimeException);
468 
469 	//XPropertySet
470     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
471     virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
472     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
473     virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
474     virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
475     virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
476     virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
477 
478 	//XChartData
479     virtual void SAL_CALL addChartDataChangeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException);
480     virtual void SAL_CALL removeChartDataChangeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException);
481     virtual double SAL_CALL getNotANumber(  ) throw(::com::sun::star::uno::RuntimeException);
482     virtual sal_Bool SAL_CALL isNotANumber( double nNumber ) throw(::com::sun::star::uno::RuntimeException);
483 
484 	//XChartDataArray
485     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > > SAL_CALL getData(  ) throw(::com::sun::star::uno::RuntimeException);
486     virtual void SAL_CALL setData( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > >& aData ) throw(::com::sun::star::uno::RuntimeException);
487     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getRowDescriptions(  ) throw(::com::sun::star::uno::RuntimeException);
488     virtual void SAL_CALL setRowDescriptions( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRowDescriptions ) throw(::com::sun::star::uno::RuntimeException);
489     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getColumnDescriptions(  ) throw(::com::sun::star::uno::RuntimeException);
490     virtual void SAL_CALL setColumnDescriptions( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aColumnDescriptions ) throw(::com::sun::star::uno::RuntimeException);
491 
492 	//XSortable
493 	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL createSortDescriptor(void) throw( ::com::sun::star::uno::RuntimeException );
494 	virtual void SAL_CALL sort(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& xDescriptor) throw( ::com::sun::star::uno::RuntimeException );
495 
496     //XCellRangeData
497     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > > SAL_CALL getDataArray(  ) throw (::com::sun::star::uno::RuntimeException);
498     virtual void SAL_CALL setDataArray( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& aArray ) throw (::com::sun::star::uno::RuntimeException);
499 
500 	//XServiceInfo
501 	virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
502 	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
503 	virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
504 
505 	//SwClient
506    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
507 
508 	SwFrmFmt* 	GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
509 	sal_uInt16 		getRowCount(void);
510 	sal_uInt16 		getColumnCount(void);
511 
512     const SwUnoCrsr* GetTblCrsr() const;
513 
514     // for SwChartDataSequence
515     void GetDataSequence(
516             ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > *pAnySeq,
517             ::com::sun::star::uno::Sequence< ::rtl::OUString > *pTxtSeq,
518             ::com::sun::star::uno::Sequence< double > *pDblSeq,
519             sal_Bool bForceNumberResults = sal_False ) throw (::com::sun::star::uno::RuntimeException);
520 
521 };
522 /* -----------------03.02.99 07:31-------------------
523  *
524  * --------------------------------------------------*/
525 class SwXTableRows : public cppu::WeakImplHelper2
526 <
527 	::com::sun::star::table::XTableRows,
528 	::com::sun::star::lang::XServiceInfo
529 >,
530 	public SwClient
531 
532 {
533 	SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
534 protected:
535 	virtual ~SwXTableRows();
536 public:
537 	SwXTableRows(SwFrmFmt& rFrmFmt);
538 
539 
540 	TYPEINFO();
541 
542 // automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen!
543 //	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass >  > getIdlClasses(void) throw( ::com::sun::star::uno::RuntimeException );
544 
545 // automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen!
546 //	virtual sal_Bool		queryInterface( ::com::sun::star::uno::Uik aUik, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >  & rOut );
547 
548 //	SMART_UNO_DECLARATION( SwXTableRows, UsrObject );
549 
550 	//XIndexAccess
551 	virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException );
552 	virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
553 
554 	//XElementAccess
555     virtual ::com::sun::star::uno::Type SAL_CALL getElementType(  ) throw(::com::sun::star::uno::RuntimeException);
556     virtual sal_Bool SAL_CALL hasElements(  ) throw(::com::sun::star::uno::RuntimeException);
557 
558 	//XTableRows
559 	virtual void SAL_CALL insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( ::com::sun::star::uno::RuntimeException );
560 	virtual void SAL_CALL removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( ::com::sun::star::uno::RuntimeException );
561 
562 	//XServiceInfo
563 	virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
564 	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
565 	virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
566 
567 	//SwClient
568    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
569 };
570 
571 /* -----------------03.02.99 07:31-------------------
572  *
573  * --------------------------------------------------*/
574 class SwXTableColumns : public cppu::WeakImplHelper2
575 <
576 	::com::sun::star::table::XTableColumns,
577 	::com::sun::star::lang::XServiceInfo
578 >,
579 	public SwClient
580 
581 {
582 	SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
583 protected:
584 	virtual ~SwXTableColumns();
585 public:
586 	SwXTableColumns(SwFrmFmt& rFrmFmt);
587 
588 
589 	TYPEINFO();
590 // automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen!
591 //	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass >  > getIdlClasses(void) throw( ::com::sun::star::uno::RuntimeException );
592 
593 // automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen!
594 //	virtual sal_Bool		queryInterface( ::com::sun::star::uno::Uik aUik, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >  & rOut );
595 
596 //	SMART_UNO_DECLARATION( SwXTableColumns, UsrObject );
597 
598 	//XIndexAccess
599 	virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException );
600 	virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
601 
602 	//XElementAccess
603     virtual ::com::sun::star::uno::Type SAL_CALL getElementType(  ) throw(::com::sun::star::uno::RuntimeException);
604     virtual sal_Bool SAL_CALL hasElements(  ) throw(::com::sun::star::uno::RuntimeException);
605 
606 	//XTableColumns
607 	virtual void SAL_CALL insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( ::com::sun::star::uno::RuntimeException );
608 	virtual void SAL_CALL removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( ::com::sun::star::uno::RuntimeException );
609 
610 	//XServiceInfo
611 	virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
612 	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
613 	virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
614 
615 	//SwClient
616    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
617 };
618 
619 #endif
620 
621 
622 
623 
624