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