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