update ooo310-m15
[ooovba.git] / sw / inc / unotbl.hxx
blobbed7e6a10f5cecff9d889016ab5501b631056b4e
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: unotbl.hxx,v $
10 * $Revision: 1.23 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _UNOTBL_HXX
31 #define _UNOTBL_HXX
33 #include <unoobj.hxx>
34 #include <com/sun/star/chart/XChartData.hpp>
35 #include <com/sun/star/chart/XChartDataArray.hpp>
36 #include <com/sun/star/chart2/data/XLabeledDataSequence.hpp>
37 #include <com/sun/star/text/XTextTableCursor.hpp>
38 #include <com/sun/star/text/XTextTable.hpp>
39 #include <com/sun/star/table/XCellRange.hpp>
40 #include <com/sun/star/sheet/XCellRangeData.hpp>
41 #include <com/sun/star/table/XAutoFormattable.hpp>
42 #include <cppuhelper/implbase10.hxx> // helper for implementations
43 #include <cppuhelper/implbase7.hxx> // helper for implementations
44 #include <cppuhelper/implbase5.hxx> // helper for implementations
46 class SwTableBoxFmt;
47 class SwTableLine;
48 class SwTableCursor;
49 class SwTableBoxFmt;
50 class SwTableLine;
51 class SwTableCursor;
52 class SwChartDataProvider;
55 /* -----------------------------22.09.00 11:10--------------------------------
57 ---------------------------------------------------------------------------*/
58 class SwChartEventListenerContainer : public SwEventListenerContainer
60 public:
61 SwChartEventListenerContainer( ::com::sun::star::uno::XInterface* pxParentL) :
62 SwEventListenerContainer(pxParentL){}
63 void ChartDataChanged();
65 /* ---------------------------------------------------------------------------
67 ---------------------------------------------------------------------------*/
68 typedef
69 cppu::WeakImplHelper4
71 ::com::sun::star::table::XCell,
72 ::com::sun::star::lang::XServiceInfo,
73 ::com::sun::star::beans::XPropertySet,
74 ::com::sun::star::container::XEnumerationAccess
76 SwXCellBaseClass;
77 class SwXCell : public SwXCellBaseClass,
78 public SwXText,
79 public SwClient
81 friend void lcl_setString( SwXCell &rCell, const rtl::OUString &rTxt,
82 BOOL bKeepNumberFmt = FALSE );
83 friend double lcl_getValue( SwXCell &rCell );
84 friend void lcl_setValue( SwXCell &rCell, double nVal );
87 SfxItemPropertySet aPropSet;
88 SwTableBox* pBox; // only set in non-XML import
89 const SwStartNode* pStartNode; // only set in XML import
91 // table position where pBox was found last
92 sal_uInt16 nFndPos;
94 using SwXText::IsValid;
96 protected:
97 virtual const SwStartNode *GetStartNode() const;
98 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > createCursor()throw(::com::sun::star::uno::RuntimeException);
100 sal_Bool IsValid();
102 virtual ~SwXCell();
104 public:
105 SwXCell(SwFrmFmt* pTblFmt, SwTableBox* pBox, sal_uInt16 nPos=USHRT_MAX );
106 SwXCell(SwFrmFmt* pTblFmt, const SwStartNode& rStartNode); // XML import interface
109 TYPEINFO();
111 static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
113 //XUnoTunnel
114 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
116 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException);
117 virtual void SAL_CALL acquire( ) throw();
118 virtual void SAL_CALL release( ) throw();
120 //XTypeProvider
121 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
122 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
124 //XCell
125 virtual ::rtl::OUString SAL_CALL getFormula( ) throw(::com::sun::star::uno::RuntimeException);
126 virtual void SAL_CALL setFormula( const ::rtl::OUString& aFormula ) throw(::com::sun::star::uno::RuntimeException);
127 virtual double SAL_CALL getValue( ) throw(::com::sun::star::uno::RuntimeException);
128 virtual void SAL_CALL setValue( double nValue ) throw(::com::sun::star::uno::RuntimeException);
129 virtual ::com::sun::star::table::CellContentType SAL_CALL getType( ) throw(::com::sun::star::uno::RuntimeException);
130 virtual sal_Int32 SAL_CALL getError( ) throw(::com::sun::star::uno::RuntimeException);
132 //XText
133 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor(void) throw( ::com::sun::star::uno::RuntimeException );
134 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 );
135 virtual void SAL_CALL setString(const rtl::OUString& aString) throw( ::com::sun::star::uno::RuntimeException );
137 //XPropertySet
138 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
139 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);
140 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);
141 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);
142 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);
143 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);
144 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);
146 //XServiceInfo
147 virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
148 virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
149 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
151 //SwClient
152 virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
154 //XEnumerationAccess - frueher XParagraphEnumerationAccess
155 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException );
157 //XElementAccess
158 virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
159 virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
161 SwTableBox* GetTblBox()const {return pBox;}
162 static SwXCell* CreateXCell(SwFrmFmt* pTblFmt, SwTableBox* pBox, SwTable *pTbl = 0 );
163 SwTableBox* FindBox(SwTable* pTable, SwTableBox* pBox);
165 SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
167 /* -----------------27.06.98 15:40-------------------
169 * --------------------------------------------------*/
170 class SwXTextTableRow : public cppu::WeakImplHelper2
172 ::com::sun::star::beans::XPropertySet,
173 ::com::sun::star::lang::XServiceInfo
175 public SwClient
177 SfxItemPropertySet aPropSet;
178 SwTableLine* pLine;
180 SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
181 protected:
182 virtual ~SwXTextTableRow();
183 public:
184 SwXTextTableRow(SwFrmFmt* pFmt, SwTableLine* pLine);
187 TYPEINFO();
189 //XPropertySet
190 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
191 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);
192 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);
193 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);
194 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);
195 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);
196 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);
198 //XServiceInfo
199 virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
200 virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
201 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
203 //SwClient
204 virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
206 const SwTableLine* GetTblRow() const {return pLine;}
207 static SwTableLine* FindLine(SwTable* pTable, SwTableLine* pLine);
209 /* -----------------20.07.98 13:03-------------------
211 * --------------------------------------------------*/
212 typedef cppu::WeakImplHelper3<
213 ::com::sun::star::text::XTextTableCursor,
214 ::com::sun::star::lang::XServiceInfo,
215 ::com::sun::star::beans::XPropertySet
216 > SwXTextTableCursor_Base;
217 class SW_DLLPUBLIC SwXTextTableCursor : public SwXTextTableCursor_Base
218 ,public SwClient
219 ,public OTextCursorHelper
221 SwDepend aCrsrDepend;
222 SfxItemPropertySet aPropSet;
224 // SwUnoCrsr* GetCrsr() const { return (SwUnoCrsr*)aCrsrDepend.GetRegisteredIn(); }
226 protected:
227 virtual ~SwXTextTableCursor();
228 public:
229 SwXTextTableCursor(SwFrmFmt* pFmt, SwTableBox* pBox);
230 SwXTextTableCursor(SwFrmFmt& rTableFmt,
231 const SwTableCursor* pTableSelection);
234 DECLARE_XINTERFACE()
236 //XTextTableCursor
237 virtual ::rtl::OUString SAL_CALL getRangeName( ) throw(::com::sun::star::uno::RuntimeException);
238 virtual sal_Bool SAL_CALL gotoCellByName( const ::rtl::OUString& aCellName, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException);
239 virtual sal_Bool SAL_CALL goLeft( sal_Int16 nCount, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException);
240 virtual sal_Bool SAL_CALL goRight( sal_Int16 nCount, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException);
241 virtual sal_Bool SAL_CALL goUp( sal_Int16 nCount, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException);
242 virtual sal_Bool SAL_CALL goDown( sal_Int16 nCount, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException);
243 virtual void SAL_CALL gotoStart( sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException);
244 virtual void SAL_CALL gotoEnd( sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException);
245 virtual sal_Bool SAL_CALL mergeRange( ) throw(::com::sun::star::uno::RuntimeException);
246 virtual sal_Bool SAL_CALL splitRange( sal_Int16 Count, sal_Bool Horizontal ) throw(::com::sun::star::uno::RuntimeException);
248 //XPropertySet
249 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
250 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);
251 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);
252 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);
253 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);
254 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);
255 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);
257 //XServiceInfo
258 virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
259 virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
260 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
262 //SwClient
263 virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
265 // ITextCursorHelper
266 virtual const SwPaM* GetPaM() const;
267 virtual SwPaM* GetPaM();
268 virtual const SwDoc* GetDoc() const;
269 virtual SwDoc* GetDoc();
271 const SwUnoCrsr* GetCrsr() const;
272 SwUnoCrsr* GetCrsr();
273 SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
276 /*-----------------11.12.97 09:38-------------------
278 --------------------------------------------------*/
279 struct SwRangeDescriptor
281 sal_Int32 nTop;
282 sal_Int32 nLeft;
283 sal_Int32 nBottom;
284 sal_Int32 nRight;
286 void Normalize();
289 class SwTableProperties_Impl;
290 class SwXTextTable : public cppu::WeakImplHelper10
292 ::com::sun::star::text::XTextTable,
293 ::com::sun::star::lang::XServiceInfo,
294 ::com::sun::star::table::XCellRange,
295 ::com::sun::star::chart::XChartDataArray,
296 ::com::sun::star::beans::XPropertySet,
297 ::com::sun::star::container::XNamed,
298 ::com::sun::star::table::XAutoFormattable,
299 ::com::sun::star::util::XSortable,
300 ::com::sun::star::lang::XUnoTunnel,
301 ::com::sun::star::sheet::XCellRangeData
303 public SwClient
305 SwEventListenerContainer aLstnrCntnr;
306 SwChartEventListenerContainer aChartLstnrCntnr;
307 SfxItemPropertySet aPropSet;
308 const SfxItemPropertyMap* _pMap;
310 // Descriptor-interface
311 SwTableProperties_Impl* pTableProps;
312 String m_sTableName;
313 sal_Bool bIsDescriptor;
314 unsigned short nRows;
315 unsigned short nColumns;
318 sal_Bool bFirstRowAsLabel :1;
319 sal_Bool bFirstColumnAsLabel :1;
320 protected:
321 virtual ~SwXTextTable();
322 public:
323 SwXTextTable();
324 SwXTextTable(SwFrmFmt& rFrmFmt);
327 static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
329 //XUnoTunnel
330 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
332 TYPEINFO();
334 //XTextTable
335 virtual void SAL_CALL initialize( sal_Int32 nRows, sal_Int32 nColumns ) throw(::com::sun::star::uno::RuntimeException);
336 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XTableRows > SAL_CALL getRows( ) throw(::com::sun::star::uno::RuntimeException);
337 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XTableColumns > SAL_CALL getColumns( ) throw(::com::sun::star::uno::RuntimeException);
338 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell > SAL_CALL getCellByName( const ::rtl::OUString& aCellName ) throw(::com::sun::star::uno::RuntimeException);
339 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getCellNames( ) throw(::com::sun::star::uno::RuntimeException);
340 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextTableCursor > SAL_CALL createCursorByCellName( const ::rtl::OUString& aCellName ) throw(::com::sun::star::uno::RuntimeException);
342 //XTextContent
343 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 );
344 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor( ) throw(::com::sun::star::uno::RuntimeException);
346 //XComponent
347 virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException );
348 virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
349 virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
351 //XCellRange
352 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);
353 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);
354 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL getCellRangeByName( const ::rtl::OUString& aRange ) throw(::com::sun::star::uno::RuntimeException);
356 //XChartDataArray
357 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > > SAL_CALL getData( ) throw(::com::sun::star::uno::RuntimeException);
358 virtual void SAL_CALL setData( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > >& aData ) throw(::com::sun::star::uno::RuntimeException);
359 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getRowDescriptions( ) throw(::com::sun::star::uno::RuntimeException);
360 virtual void SAL_CALL setRowDescriptions( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRowDescriptions ) throw(::com::sun::star::uno::RuntimeException);
361 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getColumnDescriptions( ) throw(::com::sun::star::uno::RuntimeException);
362 virtual void SAL_CALL setColumnDescriptions( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aColumnDescriptions ) throw(::com::sun::star::uno::RuntimeException);
364 //XChartData
365 virtual void SAL_CALL addChartDataChangeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException);
366 virtual void SAL_CALL removeChartDataChangeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException);
367 virtual double SAL_CALL getNotANumber( ) throw(::com::sun::star::uno::RuntimeException);
368 virtual sal_Bool SAL_CALL isNotANumber( double nNumber ) throw(::com::sun::star::uno::RuntimeException);
370 //XSortable
371 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL createSortDescriptor(void) throw( ::com::sun::star::uno::RuntimeException );
372 virtual void SAL_CALL sort(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& xDescriptor) throw( ::com::sun::star::uno::RuntimeException );
374 //XAutoFormattable
375 virtual void SAL_CALL autoFormat(const rtl::OUString& aName) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
377 //XPropertySet
378 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
379 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);
380 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);
381 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);
382 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);
383 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);
384 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);
386 //XNamed
387 virtual rtl::OUString SAL_CALL getName(void) throw( ::com::sun::star::uno::RuntimeException );
388 virtual void SAL_CALL setName(const rtl::OUString& Name_) throw( ::com::sun::star::uno::RuntimeException );
390 //XCellRangeData
391 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);
392 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);
394 //XServiceInfo
395 virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
396 virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
397 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
399 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 );
401 sal_uInt16 getRowCount(void);
402 sal_uInt16 getColumnCount(void);
403 ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > GetRangeByName(SwFrmFmt* pFmt, SwTable* pTable,
404 const String& sTLName, const String& sBRName,
405 SwRangeDescriptor& rDesc);
407 //SwClient
408 virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
410 SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
412 static SwXTextTable* GetImplementation(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> xRef );
415 /* -----------------27.04.98 16:41-------------------
417 * --------------------------------------------------*/
418 class SwXCellRange : public cppu::WeakImplHelper7
420 ::com::sun::star::table::XCellRange,
421 ::com::sun::star::lang::XServiceInfo,
422 ::com::sun::star::lang::XUnoTunnel,
423 ::com::sun::star::beans::XPropertySet,
424 ::com::sun::star::chart::XChartDataArray,
425 ::com::sun::star::util::XSortable,
426 ::com::sun::star::sheet::XCellRangeData
428 public SwClient
430 SwDepend aCursorDepend; //the cursor is removed after the doc has been removed
431 SwChartEventListenerContainer aChartLstnrCntnr;
433 SwRangeDescriptor aRgDesc;
434 SfxItemPropertySet aPropSet;
436 SwUnoCrsr* pTblCrsr;
437 const SfxItemPropertyMap* _pMap;
439 sal_Bool bFirstRowAsLabel :1;
440 sal_Bool bFirstColumnAsLabel :1;
442 public:
443 SwXCellRange(SwUnoCrsr* pCrsr, SwFrmFmt& rFrmFmt, SwRangeDescriptor& rDesc);
444 ~SwXCellRange();
446 TYPEINFO();
448 static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
450 //XUnoTunnel
451 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
454 //XCellRange
455 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);
456 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);
457 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL getCellRangeByName( const ::rtl::OUString& aRange ) throw(::com::sun::star::uno::RuntimeException);
459 //XPropertySet
460 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
461 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);
462 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);
463 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);
464 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);
465 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);
466 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);
468 //XChartData
469 virtual void SAL_CALL addChartDataChangeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException);
470 virtual void SAL_CALL removeChartDataChangeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException);
471 virtual double SAL_CALL getNotANumber( ) throw(::com::sun::star::uno::RuntimeException);
472 virtual sal_Bool SAL_CALL isNotANumber( double nNumber ) throw(::com::sun::star::uno::RuntimeException);
474 //XChartDataArray
475 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > > SAL_CALL getData( ) throw(::com::sun::star::uno::RuntimeException);
476 virtual void SAL_CALL setData( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > >& aData ) throw(::com::sun::star::uno::RuntimeException);
477 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getRowDescriptions( ) throw(::com::sun::star::uno::RuntimeException);
478 virtual void SAL_CALL setRowDescriptions( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRowDescriptions ) throw(::com::sun::star::uno::RuntimeException);
479 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getColumnDescriptions( ) throw(::com::sun::star::uno::RuntimeException);
480 virtual void SAL_CALL setColumnDescriptions( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aColumnDescriptions ) throw(::com::sun::star::uno::RuntimeException);
482 //XSortable
483 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL createSortDescriptor(void) throw( ::com::sun::star::uno::RuntimeException );
484 virtual void SAL_CALL sort(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& xDescriptor) throw( ::com::sun::star::uno::RuntimeException );
486 //XCellRangeData
487 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);
488 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);
490 //XServiceInfo
491 virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
492 virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
493 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
495 //SwClient
496 virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
498 SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
499 sal_uInt16 getRowCount(void);
500 sal_uInt16 getColumnCount(void);
502 const SwUnoCrsr* GetTblCrsr() const;
504 // for SwChartDataSequence
505 void GetDataSequence(
506 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > *pAnySeq,
507 ::com::sun::star::uno::Sequence< ::rtl::OUString > *pTxtSeq,
508 ::com::sun::star::uno::Sequence< double > *pDblSeq,
509 sal_Bool bForceNumberResults = sal_False ) throw (::com::sun::star::uno::RuntimeException);
512 /* -----------------03.02.99 07:31-------------------
514 * --------------------------------------------------*/
515 class SwXTableRows : public cppu::WeakImplHelper2
517 ::com::sun::star::table::XTableRows,
518 ::com::sun::star::lang::XServiceInfo
520 public SwClient
523 SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
524 protected:
525 virtual ~SwXTableRows();
526 public:
527 SwXTableRows(SwFrmFmt& rFrmFmt);
530 TYPEINFO();
532 // automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen!
533 // virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass > > getIdlClasses(void) throw( ::com::sun::star::uno::RuntimeException );
535 // automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen!
536 // virtual sal_Bool queryInterface( ::com::sun::star::uno::Uik aUik, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & rOut );
538 // SMART_UNO_DECLARATION( SwXTableRows, UsrObject );
540 //XIndexAccess
541 virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException );
542 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 );
544 //XElementAccess
545 virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
546 virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
548 //XTableRows
549 virtual void SAL_CALL insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( ::com::sun::star::uno::RuntimeException );
550 virtual void SAL_CALL removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( ::com::sun::star::uno::RuntimeException );
552 //XServiceInfo
553 virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
554 virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
555 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
557 //SwClient
558 virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
561 /* -----------------03.02.99 07:31-------------------
563 * --------------------------------------------------*/
564 class SwXTableColumns : public cppu::WeakImplHelper2
566 ::com::sun::star::table::XTableColumns,
567 ::com::sun::star::lang::XServiceInfo
569 public SwClient
572 SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
573 protected:
574 virtual ~SwXTableColumns();
575 public:
576 SwXTableColumns(SwFrmFmt& rFrmFmt);
579 TYPEINFO();
580 // automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen!
581 // virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass > > getIdlClasses(void) throw( ::com::sun::star::uno::RuntimeException );
583 // automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen!
584 // virtual sal_Bool queryInterface( ::com::sun::star::uno::Uik aUik, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & rOut );
586 // SMART_UNO_DECLARATION( SwXTableColumns, UsrObject );
588 //XIndexAccess
589 virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException );
590 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 );
592 //XElementAccess
593 virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
594 virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
596 //XTableColumns
597 virtual void SAL_CALL insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( ::com::sun::star::uno::RuntimeException );
598 virtual void SAL_CALL removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( ::com::sun::star::uno::RuntimeException );
600 //XServiceInfo
601 virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
602 virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
603 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
605 //SwClient
606 virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
609 #endif