1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef SC_DOCUNO_HXX 29 #define SC_DOCUNO_HXX 30 31 #include "address.hxx" 32 #include <sfx2/sfxbasemodel.hxx> 33 #include <svl/lstner.hxx> 34 #include <svx/fmdmod.hxx> 35 #include <com/sun/star/view/XRenderable.hpp> 36 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> 37 #include <com/sun/star/document/XActionLockable.hpp> 38 #include <com/sun/star/document/XLinkTargetSupplier.hpp> 39 #include <com/sun/star/drawing/XDrawPagesSupplier.hpp> 40 #include <com/sun/star/drawing/XDrawPages.hpp> 41 #include <com/sun/star/sheet/XGoalSeek.hpp> 42 #include <com/sun/star/sheet/XCalculatable.hpp> 43 #include <com/sun/star/sheet/XScenarios.hpp> 44 #include <com/sun/star/sheet/XConsolidatable.hpp> 45 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp> 46 #include <com/sun/star/sheet/XDocumentAuditing.hpp> 47 #include <com/sun/star/lang/XServiceInfo.hpp> 48 #include <com/sun/star/util/XProtectable.hpp> 49 #include <com/sun/star/container/XEnumerationAccess.hpp> 50 #include <com/sun/star/table/XTableColumns.hpp> 51 #include <com/sun/star/table/XTableRows.hpp> 52 #include <com/sun/star/sheet/XSheetAnnotations.hpp> 53 #include <com/sun/star/beans/XPropertySet.hpp> 54 #include <com/sun/star/sheet/XCellRangesAccess.hpp> 55 #include <com/sun/star/util/XChangesNotifier.hpp> 56 #include <cppuhelper/implbase2.hxx> 57 #include <cppuhelper/implbase3.hxx> 58 #include <cppuhelper/implbase4.hxx> 59 #include <cppuhelper/implbase5.hxx> 60 #include <cppuhelper/interfacecontainer.h> 61 #include <svl/itemprop.hxx> 62 #include "drwlayer.hxx" 63 64 class ScDocShell; 65 class ScAnnotationObj; 66 class ScMarkData; 67 class ScPrintFuncCache; 68 class ScPrintSelectionStatus; 69 class ScTableColumnObj; 70 class ScTableRowObj; 71 class ScTableSheetObj; 72 class SvxFmDrawPage; 73 class SvxDrawPage; 74 class ScRangeList; 75 class ScPrintUIOptions; 76 class ScSheetSaveData; 77 78 class SC_DLLPUBLIC ScModelObj : public SfxBaseModel, 79 public com::sun::star::sheet::XSpreadsheetDocument, 80 public com::sun::star::document::XActionLockable, 81 public com::sun::star::sheet::XCalculatable, 82 public com::sun::star::util::XProtectable, 83 public com::sun::star::drawing::XDrawPagesSupplier, 84 public com::sun::star::sheet::XGoalSeek, 85 public com::sun::star::sheet::XConsolidatable, 86 public com::sun::star::sheet::XDocumentAuditing, 87 public com::sun::star::style::XStyleFamiliesSupplier, 88 public com::sun::star::view::XRenderable, 89 public com::sun::star::document::XLinkTargetSupplier, 90 public com::sun::star::beans::XPropertySet, 91 public SvxFmMSFactory, // derived from XMultiServiceFactory 92 public com::sun::star::lang::XServiceInfo, 93 public ::com::sun::star::util::XChangesNotifier 94 { 95 private: 96 SfxItemPropertySet aPropSet; 97 ScDocShell* pDocShell; 98 ScPrintFuncCache* pPrintFuncCache; 99 ScPrintUIOptions* pPrinterOptions; 100 com::sun::star::uno::Reference<com::sun::star::uno::XAggregation> xNumberAgg; 101 com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xDrawGradTab; 102 com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xDrawHatchTab; 103 com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xDrawBitmapTab; 104 com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xDrawTrGradTab; 105 com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xDrawMarkerTab; 106 com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xDrawDashTab; 107 com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xChartDataProv; 108 com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xObjProvider; 109 110 ::cppu::OInterfaceContainerHelper maChangesListeners; 111 112 sal_Bool FillRenderMarkData( const com::sun::star::uno::Any& aSelection, 113 const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rOptions, 114 ScMarkData& rMark, ScPrintSelectionStatus& rStatus, String& rPagesStr ) const; 115 com::sun::star::uno::Reference<com::sun::star::uno::XAggregation> GetFormatter(); 116 void HandleCalculateEvents(); 117 118 rtl::OUString maBuildId; 119 protected: 120 const SfxItemPropertySet& GetPropertySet() const { return aPropSet; } 121 122 public: 123 ScModelObj(ScDocShell* pDocSh); 124 virtual ~ScModelObj(); 125 126 // create ScModelObj and set at pDocSh (SetBaseModel) 127 static void CreateAndSet(ScDocShell* pDocSh); 128 129 ScDocument* GetDocument() const; 130 SfxObjectShell* GetEmbeddedObject() const; 131 132 void UpdateAllRowHeights( const ScMarkData* pTabMark = NULL, bool bCalcOutputFactor = false ); 133 134 void BeforeXMLLoading(); 135 void AfterXMLLoading(sal_Bool bRet); 136 ScSheetSaveData* GetSheetSaveData(); 137 138 void RepaintRange( const ScRange& rRange ); 139 140 bool HasChangesListeners() const; 141 142 void NotifyChanges( const ::rtl::OUString& rOperation, const ScRangeList& rRanges, 143 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rProperties = 144 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >() ); 145 146 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( 147 const ::com::sun::star::uno::Type & rType ) 148 throw(::com::sun::star::uno::RuntimeException); 149 virtual void SAL_CALL acquire() throw(); 150 virtual void SAL_CALL release() throw(); 151 152 //? virtual UString getClassName(void); 153 154 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); 155 156 // XSpreadsheetDocument 157 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheets > SAL_CALL 158 getSheets() throw(::com::sun::star::uno::RuntimeException); 159 160 // XStyleFamiliesSupplier 161 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL 162 getStyleFamilies() throw(::com::sun::star::uno::RuntimeException); 163 164 // XRenderable 165 virtual sal_Int32 SAL_CALL getRendererCount( const ::com::sun::star::uno::Any& aSelection, 166 const ::com::sun::star::uno::Sequence< 167 ::com::sun::star::beans::PropertyValue >& xOptions ) 168 throw (::com::sun::star::lang::IllegalArgumentException, 169 ::com::sun::star::uno::RuntimeException); 170 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL 171 getRenderer( sal_Int32 nRenderer, const ::com::sun::star::uno::Any& aSelection, 172 const ::com::sun::star::uno::Sequence< 173 ::com::sun::star::beans::PropertyValue >& xOptions ) 174 throw (::com::sun::star::lang::IllegalArgumentException, 175 ::com::sun::star::uno::RuntimeException); 176 virtual void SAL_CALL render( sal_Int32 nRenderer, const ::com::sun::star::uno::Any& aSelection, 177 const ::com::sun::star::uno::Sequence< 178 ::com::sun::star::beans::PropertyValue >& xOptions ) 179 throw (::com::sun::star::lang::IllegalArgumentException, 180 ::com::sun::star::uno::RuntimeException); 181 182 // XLinkTargetSupplier 183 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL 184 getLinks() throw(::com::sun::star::uno::RuntimeException); 185 186 // XActionLockable 187 virtual sal_Bool SAL_CALL isActionLocked() throw(::com::sun::star::uno::RuntimeException); 188 virtual void SAL_CALL addActionLock() throw(::com::sun::star::uno::RuntimeException); 189 virtual void SAL_CALL removeActionLock() throw(::com::sun::star::uno::RuntimeException); 190 virtual void SAL_CALL setActionLocks( sal_Int16 nLock ) 191 throw(::com::sun::star::uno::RuntimeException); 192 virtual sal_Int16 SAL_CALL resetActionLocks() throw(::com::sun::star::uno::RuntimeException); 193 194 virtual void SAL_CALL lockControllers() throw (::com::sun::star::uno::RuntimeException); 195 virtual void SAL_CALL unlockControllers() throw (::com::sun::star::uno::RuntimeException); 196 197 // XCalculatable 198 virtual void SAL_CALL calculate() throw(::com::sun::star::uno::RuntimeException); 199 virtual void SAL_CALL calculateAll() throw(::com::sun::star::uno::RuntimeException); 200 virtual sal_Bool SAL_CALL isAutomaticCalculationEnabled() 201 throw(::com::sun::star::uno::RuntimeException); 202 virtual void SAL_CALL enableAutomaticCalculation( sal_Bool bEnabled ) 203 throw(::com::sun::star::uno::RuntimeException); 204 205 // XProtectable 206 virtual void SAL_CALL protect( const ::rtl::OUString& aPassword ) 207 throw(::com::sun::star::uno::RuntimeException); 208 virtual void SAL_CALL unprotect( const ::rtl::OUString& aPassword ) 209 throw(::com::sun::star::lang::IllegalArgumentException, 210 ::com::sun::star::uno::RuntimeException); 211 virtual sal_Bool SAL_CALL isProtected() throw(::com::sun::star::uno::RuntimeException); 212 213 // XDrawPagesSupplier 214 virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPages > SAL_CALL 215 getDrawPages() throw(::com::sun::star::uno::RuntimeException); 216 217 //! XPrintable?? 218 219 // XGoalSeek 220 virtual ::com::sun::star::sheet::GoalResult SAL_CALL seekGoal( 221 const ::com::sun::star::table::CellAddress& aFormulaPosition, 222 const ::com::sun::star::table::CellAddress& aVariablePosition, 223 const ::rtl::OUString& aGoalValue ) 224 throw(::com::sun::star::uno::RuntimeException); 225 226 // XConsolidatable 227 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XConsolidationDescriptor > 228 SAL_CALL createConsolidationDescriptor( sal_Bool bEmpty ) 229 throw(::com::sun::star::uno::RuntimeException); 230 virtual void SAL_CALL consolidate( const ::com::sun::star::uno::Reference< 231 ::com::sun::star::sheet::XConsolidationDescriptor >& xDescriptor ) 232 throw(::com::sun::star::uno::RuntimeException); 233 234 // XDocumentAuditing 235 virtual void SAL_CALL refreshArrows() throw(::com::sun::star::uno::RuntimeException); 236 237 // XViewDataSupplier 238 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getViewData( ) 239 throw (::com::sun::star::uno::RuntimeException); 240 241 // XPropertySet 242 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > 243 SAL_CALL getPropertySetInfo() 244 throw(::com::sun::star::uno::RuntimeException); 245 virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, 246 const ::com::sun::star::uno::Any& aValue ) 247 throw(::com::sun::star::beans::UnknownPropertyException, 248 ::com::sun::star::beans::PropertyVetoException, 249 ::com::sun::star::lang::IllegalArgumentException, 250 ::com::sun::star::lang::WrappedTargetException, 251 ::com::sun::star::uno::RuntimeException); 252 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( 253 const ::rtl::OUString& PropertyName ) 254 throw(::com::sun::star::beans::UnknownPropertyException, 255 ::com::sun::star::lang::WrappedTargetException, 256 ::com::sun::star::uno::RuntimeException); 257 virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, 258 const ::com::sun::star::uno::Reference< 259 ::com::sun::star::beans::XPropertyChangeListener >& xListener ) 260 throw(::com::sun::star::beans::UnknownPropertyException, 261 ::com::sun::star::lang::WrappedTargetException, 262 ::com::sun::star::uno::RuntimeException); 263 virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, 264 const ::com::sun::star::uno::Reference< 265 ::com::sun::star::beans::XPropertyChangeListener >& aListener ) 266 throw(::com::sun::star::beans::UnknownPropertyException, 267 ::com::sun::star::lang::WrappedTargetException, 268 ::com::sun::star::uno::RuntimeException); 269 virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, 270 const ::com::sun::star::uno::Reference< 271 ::com::sun::star::beans::XVetoableChangeListener >& aListener ) 272 throw(::com::sun::star::beans::UnknownPropertyException, 273 ::com::sun::star::lang::WrappedTargetException, 274 ::com::sun::star::uno::RuntimeException); 275 virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, 276 const ::com::sun::star::uno::Reference< 277 ::com::sun::star::beans::XVetoableChangeListener >& aListener ) 278 throw(::com::sun::star::beans::UnknownPropertyException, 279 ::com::sun::star::lang::WrappedTargetException, 280 ::com::sun::star::uno::RuntimeException); 281 282 // XMultiServiceFactory 283 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL 284 createInstance( const ::rtl::OUString& aServiceSpecifier ) 285 throw(::com::sun::star::uno::Exception, 286 ::com::sun::star::uno::RuntimeException); 287 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL 288 createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, 289 const ::com::sun::star::uno::Sequence< 290 ::com::sun::star::uno::Any >& Arguments ) 291 throw(::com::sun::star::uno::Exception, 292 ::com::sun::star::uno::RuntimeException); 293 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames() 294 throw(::com::sun::star::uno::RuntimeException); 295 296 // XServiceInfo 297 virtual ::rtl::OUString SAL_CALL getImplementationName() 298 throw(::com::sun::star::uno::RuntimeException); 299 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) 300 throw(::com::sun::star::uno::RuntimeException); 301 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() 302 throw(::com::sun::star::uno::RuntimeException); 303 304 // XUnoTunnel 305 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< 306 sal_Int8 >& aIdentifier ) 307 throw(::com::sun::star::uno::RuntimeException); 308 309 static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId(); 310 static ScModelObj* getImplementation( const com::sun::star::uno::Reference< 311 com::sun::star::uno::XInterface> xObj ); 312 313 // XTypeProvider 314 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() 315 throw(::com::sun::star::uno::RuntimeException); 316 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() 317 throw(::com::sun::star::uno::RuntimeException); 318 319 // XChangesNotifier 320 virtual void SAL_CALL addChangesListener( const ::com::sun::star::uno::Reference< 321 ::com::sun::star::util::XChangesListener >& aListener ) 322 throw (::com::sun::star::uno::RuntimeException); 323 virtual void SAL_CALL removeChangesListener( const ::com::sun::star::uno::Reference< 324 ::com::sun::star::util::XChangesListener >& aListener ) 325 throw (::com::sun::star::uno::RuntimeException); 326 }; 327 328 329 class ScDrawPagesObj : public cppu::WeakImplHelper2< 330 com::sun::star::drawing::XDrawPages, 331 com::sun::star::lang::XServiceInfo>, 332 public SfxListener 333 { 334 private: 335 ScDocShell* pDocShell; 336 337 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > 338 GetObjectByIndex_Impl(sal_Int32 nIndex) const; 339 340 public: 341 ScDrawPagesObj(ScDocShell* pDocSh); 342 virtual ~ScDrawPagesObj(); 343 344 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); 345 346 // XDrawPages 347 virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > SAL_CALL 348 insertNewByIndex( sal_Int32 nIndex ) 349 throw(::com::sun::star::uno::RuntimeException); 350 virtual void SAL_CALL remove( const ::com::sun::star::uno::Reference< 351 ::com::sun::star::drawing::XDrawPage >& xPage ) 352 throw(::com::sun::star::uno::RuntimeException); 353 354 // XIndexAccess 355 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException); 356 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) 357 throw(::com::sun::star::lang::IndexOutOfBoundsException, 358 ::com::sun::star::lang::WrappedTargetException, 359 ::com::sun::star::uno::RuntimeException); 360 361 // XElementAccess 362 virtual ::com::sun::star::uno::Type SAL_CALL getElementType() 363 throw(::com::sun::star::uno::RuntimeException); 364 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException); 365 366 // XServiceInfo 367 virtual ::rtl::OUString SAL_CALL getImplementationName() 368 throw(::com::sun::star::uno::RuntimeException); 369 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) 370 throw(::com::sun::star::uno::RuntimeException); 371 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() 372 throw(::com::sun::star::uno::RuntimeException); 373 }; 374 375 376 class ScTableSheetsObj : public cppu::WeakImplHelper5< 377 com::sun::star::sheet::XSpreadsheets, 378 com::sun::star::sheet::XCellRangesAccess, 379 com::sun::star::container::XEnumerationAccess, 380 com::sun::star::container::XIndexAccess, 381 com::sun::star::lang::XServiceInfo>, 382 public SfxListener 383 { 384 private: 385 ScDocShell* pDocShell; 386 387 ScTableSheetObj* GetObjectByIndex_Impl(sal_Int32 nIndex) const; 388 ScTableSheetObj* GetObjectByName_Impl(const ::rtl::OUString& aName) const; 389 390 public: 391 ScTableSheetsObj(ScDocShell* pDocSh); 392 virtual ~ScTableSheetsObj(); 393 394 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); 395 396 // XSpreadsheets 397 virtual void SAL_CALL insertNewByName( const ::rtl::OUString& aName, sal_Int16 nPosition ) 398 throw(::com::sun::star::uno::RuntimeException); 399 virtual void SAL_CALL moveByName( const ::rtl::OUString& aName, sal_Int16 nDestination ) 400 throw(::com::sun::star::uno::RuntimeException); 401 virtual void SAL_CALL copyByName( const ::rtl::OUString& aName, 402 const ::rtl::OUString& aCopy, sal_Int16 nDestination ) 403 throw(::com::sun::star::uno::RuntimeException); 404 405 // XCellRangesAccess 406 407 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell > 408 SAL_CALL getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow, sal_Int32 nSheet ) 409 throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 410 411 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > 412 SAL_CALL getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom, sal_Int32 nSheet ) 413 throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 414 415 virtual ::com::sun::star::uno::Sequence < ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > > 416 SAL_CALL getCellRangesByName( const ::rtl::OUString& aRange ) 417 throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); 418 419 // XNameContainer 420 virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, 421 const ::com::sun::star::uno::Any& aElement ) 422 throw(::com::sun::star::lang::IllegalArgumentException, 423 ::com::sun::star::container::ElementExistException, 424 ::com::sun::star::lang::WrappedTargetException, 425 ::com::sun::star::uno::RuntimeException); 426 virtual void SAL_CALL removeByName( const ::rtl::OUString& Name ) 427 throw(::com::sun::star::container::NoSuchElementException, 428 ::com::sun::star::lang::WrappedTargetException, 429 ::com::sun::star::uno::RuntimeException); 430 431 // XNameReplace 432 virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, 433 const ::com::sun::star::uno::Any& aElement ) 434 throw(::com::sun::star::lang::IllegalArgumentException, 435 ::com::sun::star::container::NoSuchElementException, 436 ::com::sun::star::lang::WrappedTargetException, 437 ::com::sun::star::uno::RuntimeException); 438 439 // XEnumerationAccess 440 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL 441 createEnumeration() throw(::com::sun::star::uno::RuntimeException); 442 443 // XElementAccess 444 virtual ::com::sun::star::uno::Type SAL_CALL getElementType() 445 throw(::com::sun::star::uno::RuntimeException); 446 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException); 447 448 // XIndexAccess 449 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException); 450 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) 451 throw(::com::sun::star::lang::IndexOutOfBoundsException, 452 ::com::sun::star::lang::WrappedTargetException, 453 ::com::sun::star::uno::RuntimeException); 454 455 // XNameAccess 456 virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) 457 throw(::com::sun::star::container::NoSuchElementException, 458 ::com::sun::star::lang::WrappedTargetException, 459 ::com::sun::star::uno::RuntimeException); 460 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames() 461 throw(::com::sun::star::uno::RuntimeException); 462 virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) 463 throw(::com::sun::star::uno::RuntimeException); 464 465 // XServiceInfo 466 virtual ::rtl::OUString SAL_CALL getImplementationName() 467 throw(::com::sun::star::uno::RuntimeException); 468 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) 469 throw(::com::sun::star::uno::RuntimeException); 470 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() 471 throw(::com::sun::star::uno::RuntimeException); 472 }; 473 474 475 class ScTableColumnsObj : public cppu::WeakImplHelper5< 476 com::sun::star::table::XTableColumns, 477 com::sun::star::container::XEnumerationAccess, 478 com::sun::star::container::XNameAccess, 479 com::sun::star::beans::XPropertySet, 480 com::sun::star::lang::XServiceInfo>, 481 public SfxListener 482 { 483 private: 484 ScDocShell* pDocShell; 485 SCTAB nTab; 486 SCCOL nStartCol; 487 SCCOL nEndCol; 488 489 ScTableColumnObj* GetObjectByIndex_Impl(sal_Int32 nIndex) const; 490 ScTableColumnObj* GetObjectByName_Impl(const ::rtl::OUString& aName) const; 491 492 public: 493 ScTableColumnsObj(ScDocShell* pDocSh, SCTAB nT, 494 SCCOL nSC, SCCOL nEC); 495 virtual ~ScTableColumnsObj(); 496 497 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); 498 499 // XTableColumns 500 virtual void SAL_CALL insertByIndex( sal_Int32 nIndex, sal_Int32 nCount ) 501 throw(::com::sun::star::uno::RuntimeException); 502 virtual void SAL_CALL removeByIndex( sal_Int32 nIndex, sal_Int32 nCount ) 503 throw(::com::sun::star::uno::RuntimeException); 504 505 // XNameAccess 506 virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) 507 throw(::com::sun::star::container::NoSuchElementException, 508 ::com::sun::star::lang::WrappedTargetException, 509 ::com::sun::star::uno::RuntimeException); 510 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames() 511 throw(::com::sun::star::uno::RuntimeException); 512 virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) 513 throw(::com::sun::star::uno::RuntimeException); 514 515 // XIndexAccess 516 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException); 517 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) 518 throw(::com::sun::star::lang::IndexOutOfBoundsException, 519 ::com::sun::star::lang::WrappedTargetException, 520 ::com::sun::star::uno::RuntimeException); 521 522 // XEnumerationAccess 523 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL 524 createEnumeration() throw(::com::sun::star::uno::RuntimeException); 525 526 // XElementAccess 527 virtual ::com::sun::star::uno::Type SAL_CALL getElementType() 528 throw(::com::sun::star::uno::RuntimeException); 529 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException); 530 531 // XPropertySet 532 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > 533 SAL_CALL getPropertySetInfo() 534 throw(::com::sun::star::uno::RuntimeException); 535 virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, 536 const ::com::sun::star::uno::Any& aValue ) 537 throw(::com::sun::star::beans::UnknownPropertyException, 538 ::com::sun::star::beans::PropertyVetoException, 539 ::com::sun::star::lang::IllegalArgumentException, 540 ::com::sun::star::lang::WrappedTargetException, 541 ::com::sun::star::uno::RuntimeException); 542 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( 543 const ::rtl::OUString& PropertyName ) 544 throw(::com::sun::star::beans::UnknownPropertyException, 545 ::com::sun::star::lang::WrappedTargetException, 546 ::com::sun::star::uno::RuntimeException); 547 virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, 548 const ::com::sun::star::uno::Reference< 549 ::com::sun::star::beans::XPropertyChangeListener >& xListener ) 550 throw(::com::sun::star::beans::UnknownPropertyException, 551 ::com::sun::star::lang::WrappedTargetException, 552 ::com::sun::star::uno::RuntimeException); 553 virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, 554 const ::com::sun::star::uno::Reference< 555 ::com::sun::star::beans::XPropertyChangeListener >& aListener ) 556 throw(::com::sun::star::beans::UnknownPropertyException, 557 ::com::sun::star::lang::WrappedTargetException, 558 ::com::sun::star::uno::RuntimeException); 559 virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, 560 const ::com::sun::star::uno::Reference< 561 ::com::sun::star::beans::XVetoableChangeListener >& aListener ) 562 throw(::com::sun::star::beans::UnknownPropertyException, 563 ::com::sun::star::lang::WrappedTargetException, 564 ::com::sun::star::uno::RuntimeException); 565 virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, 566 const ::com::sun::star::uno::Reference< 567 ::com::sun::star::beans::XVetoableChangeListener >& aListener ) 568 throw(::com::sun::star::beans::UnknownPropertyException, 569 ::com::sun::star::lang::WrappedTargetException, 570 ::com::sun::star::uno::RuntimeException); 571 572 // XServiceInfo 573 virtual ::rtl::OUString SAL_CALL getImplementationName() 574 throw(::com::sun::star::uno::RuntimeException); 575 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) 576 throw(::com::sun::star::uno::RuntimeException); 577 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() 578 throw(::com::sun::star::uno::RuntimeException); 579 }; 580 581 582 class ScTableRowsObj : public cppu::WeakImplHelper4< 583 com::sun::star::table::XTableRows, 584 com::sun::star::container::XEnumerationAccess, 585 com::sun::star::beans::XPropertySet, 586 com::sun::star::lang::XServiceInfo>, 587 public SfxListener 588 { 589 private: 590 ScDocShell* pDocShell; 591 SCTAB nTab; 592 SCROW nStartRow; 593 SCROW nEndRow; 594 595 ScTableRowObj* GetObjectByIndex_Impl(sal_Int32 nIndex) const; 596 597 public: 598 ScTableRowsObj(ScDocShell* pDocSh, SCTAB nT, 599 SCROW nSR, SCROW nER); 600 virtual ~ScTableRowsObj(); 601 602 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); 603 604 // XTableRows 605 virtual void SAL_CALL insertByIndex( sal_Int32 nIndex, sal_Int32 nCount ) 606 throw(::com::sun::star::uno::RuntimeException); 607 virtual void SAL_CALL removeByIndex( sal_Int32 nIndex, sal_Int32 nCount ) 608 throw(::com::sun::star::uno::RuntimeException); 609 610 // XIndexAccess 611 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException); 612 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) 613 throw(::com::sun::star::lang::IndexOutOfBoundsException, 614 ::com::sun::star::lang::WrappedTargetException, 615 ::com::sun::star::uno::RuntimeException); 616 617 // XEnumerationAccess 618 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL 619 createEnumeration() throw(::com::sun::star::uno::RuntimeException); 620 621 // XElementAccess 622 virtual ::com::sun::star::uno::Type SAL_CALL getElementType() 623 throw(::com::sun::star::uno::RuntimeException); 624 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException); 625 626 // XPropertySet 627 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > 628 SAL_CALL getPropertySetInfo() 629 throw(::com::sun::star::uno::RuntimeException); 630 virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, 631 const ::com::sun::star::uno::Any& aValue ) 632 throw(::com::sun::star::beans::UnknownPropertyException, 633 ::com::sun::star::beans::PropertyVetoException, 634 ::com::sun::star::lang::IllegalArgumentException, 635 ::com::sun::star::lang::WrappedTargetException, 636 ::com::sun::star::uno::RuntimeException); 637 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( 638 const ::rtl::OUString& PropertyName ) 639 throw(::com::sun::star::beans::UnknownPropertyException, 640 ::com::sun::star::lang::WrappedTargetException, 641 ::com::sun::star::uno::RuntimeException); 642 virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, 643 const ::com::sun::star::uno::Reference< 644 ::com::sun::star::beans::XPropertyChangeListener >& xListener ) 645 throw(::com::sun::star::beans::UnknownPropertyException, 646 ::com::sun::star::lang::WrappedTargetException, 647 ::com::sun::star::uno::RuntimeException); 648 virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, 649 const ::com::sun::star::uno::Reference< 650 ::com::sun::star::beans::XPropertyChangeListener >& aListener ) 651 throw(::com::sun::star::beans::UnknownPropertyException, 652 ::com::sun::star::lang::WrappedTargetException, 653 ::com::sun::star::uno::RuntimeException); 654 virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, 655 const ::com::sun::star::uno::Reference< 656 ::com::sun::star::beans::XVetoableChangeListener >& aListener ) 657 throw(::com::sun::star::beans::UnknownPropertyException, 658 ::com::sun::star::lang::WrappedTargetException, 659 ::com::sun::star::uno::RuntimeException); 660 virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, 661 const ::com::sun::star::uno::Reference< 662 ::com::sun::star::beans::XVetoableChangeListener >& aListener ) 663 throw(::com::sun::star::beans::UnknownPropertyException, 664 ::com::sun::star::lang::WrappedTargetException, 665 ::com::sun::star::uno::RuntimeException); 666 667 // XServiceInfo 668 virtual ::rtl::OUString SAL_CALL getImplementationName() 669 throw(::com::sun::star::uno::RuntimeException); 670 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) 671 throw(::com::sun::star::uno::RuntimeException); 672 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() 673 throw(::com::sun::star::uno::RuntimeException); 674 }; 675 676 677 class ScSpreadsheetSettingsObj : public cppu::WeakImplHelper2< 678 com::sun::star::beans::XPropertySet, 679 com::sun::star::lang::XServiceInfo>, 680 public SfxListener 681 { 682 private: 683 ScDocShell* pDocShell; 684 685 public: 686 //UNUSED2008-05 ScSpreadsheetSettingsObj(ScDocShell* pDocSh); 687 virtual ~ScSpreadsheetSettingsObj(); 688 689 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); 690 691 // XPropertySet 692 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > 693 SAL_CALL getPropertySetInfo() 694 throw(::com::sun::star::uno::RuntimeException); 695 virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, 696 const ::com::sun::star::uno::Any& aValue ) 697 throw(::com::sun::star::beans::UnknownPropertyException, 698 ::com::sun::star::beans::PropertyVetoException, 699 ::com::sun::star::lang::IllegalArgumentException, 700 ::com::sun::star::lang::WrappedTargetException, 701 ::com::sun::star::uno::RuntimeException); 702 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( 703 const ::rtl::OUString& PropertyName ) 704 throw(::com::sun::star::beans::UnknownPropertyException, 705 ::com::sun::star::lang::WrappedTargetException, 706 ::com::sun::star::uno::RuntimeException); 707 virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, 708 const ::com::sun::star::uno::Reference< 709 ::com::sun::star::beans::XPropertyChangeListener >& xListener ) 710 throw(::com::sun::star::beans::UnknownPropertyException, 711 ::com::sun::star::lang::WrappedTargetException, 712 ::com::sun::star::uno::RuntimeException); 713 virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, 714 const ::com::sun::star::uno::Reference< 715 ::com::sun::star::beans::XPropertyChangeListener >& aListener ) 716 throw(::com::sun::star::beans::UnknownPropertyException, 717 ::com::sun::star::lang::WrappedTargetException, 718 ::com::sun::star::uno::RuntimeException); 719 virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, 720 const ::com::sun::star::uno::Reference< 721 ::com::sun::star::beans::XVetoableChangeListener >& aListener ) 722 throw(::com::sun::star::beans::UnknownPropertyException, 723 ::com::sun::star::lang::WrappedTargetException, 724 ::com::sun::star::uno::RuntimeException); 725 virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, 726 const ::com::sun::star::uno::Reference< 727 ::com::sun::star::beans::XVetoableChangeListener >& aListener ) 728 throw(::com::sun::star::beans::UnknownPropertyException, 729 ::com::sun::star::lang::WrappedTargetException, 730 ::com::sun::star::uno::RuntimeException); 731 732 // XServiceInfo 733 virtual ::rtl::OUString SAL_CALL getImplementationName() 734 throw(::com::sun::star::uno::RuntimeException); 735 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) 736 throw(::com::sun::star::uno::RuntimeException); 737 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() 738 throw(::com::sun::star::uno::RuntimeException); 739 }; 740 741 742 class ScAnnotationsObj : public cppu::WeakImplHelper3< 743 com::sun::star::sheet::XSheetAnnotations, 744 com::sun::star::container::XEnumerationAccess, 745 com::sun::star::lang::XServiceInfo>, 746 public SfxListener 747 { 748 private: 749 ScDocShell* pDocShell; 750 SCTAB nTab; // Collection haengt am Sheet 751 752 bool GetAddressByIndex_Impl( sal_Int32 nIndex, ScAddress& rPos ) const; 753 ScAnnotationObj* GetObjectByIndex_Impl( sal_Int32 nIndex ) const; 754 755 public: 756 ScAnnotationsObj(ScDocShell* pDocSh, SCTAB nT); 757 virtual ~ScAnnotationsObj(); 758 759 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); 760 761 // XSheetAnnotations 762 virtual void SAL_CALL insertNew( const ::com::sun::star::table::CellAddress& aPosition, 763 const ::rtl::OUString& aText ) 764 throw(::com::sun::star::uno::RuntimeException); 765 virtual void SAL_CALL removeByIndex( sal_Int32 nIndex ) 766 throw(::com::sun::star::uno::RuntimeException); 767 768 // XIndexAccess 769 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException); 770 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) 771 throw(::com::sun::star::lang::IndexOutOfBoundsException, 772 ::com::sun::star::lang::WrappedTargetException, 773 ::com::sun::star::uno::RuntimeException); 774 775 // XEnumerationAccess 776 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL 777 createEnumeration() throw(::com::sun::star::uno::RuntimeException); 778 779 // XElementAccess 780 virtual ::com::sun::star::uno::Type SAL_CALL getElementType() 781 throw(::com::sun::star::uno::RuntimeException); 782 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException); 783 784 // XServiceInfo 785 virtual ::rtl::OUString SAL_CALL getImplementationName() 786 throw(::com::sun::star::uno::RuntimeException); 787 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) 788 throw(::com::sun::star::uno::RuntimeException); 789 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() 790 throw(::com::sun::star::uno::RuntimeException); 791 }; 792 793 794 class ScScenariosObj : public cppu::WeakImplHelper4< 795 com::sun::star::sheet::XScenarios, 796 com::sun::star::container::XEnumerationAccess, 797 com::sun::star::container::XIndexAccess, 798 com::sun::star::lang::XServiceInfo>, 799 public SfxListener 800 { 801 private: 802 ScDocShell* pDocShell; 803 SCTAB nTab; 804 805 sal_Bool GetScenarioIndex_Impl( const ::rtl::OUString& rName, SCTAB& rIndex ); 806 ScTableSheetObj* GetObjectByIndex_Impl(sal_Int32 nIndex); 807 ScTableSheetObj* GetObjectByName_Impl(const ::rtl::OUString& aName); 808 809 public: 810 ScScenariosObj(ScDocShell* pDocSh, SCTAB nT); 811 virtual ~ScScenariosObj(); 812 813 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); 814 815 // XScenarios 816 virtual void SAL_CALL addNewByName( const ::rtl::OUString& aName, 817 const ::com::sun::star::uno::Sequence< 818 ::com::sun::star::table::CellRangeAddress >& aRanges, 819 const ::rtl::OUString& aComment ) 820 throw(::com::sun::star::uno::RuntimeException); 821 virtual void SAL_CALL removeByName( const ::rtl::OUString& aName ) 822 throw(::com::sun::star::uno::RuntimeException); 823 824 // XNameAccess 825 virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) 826 throw(::com::sun::star::container::NoSuchElementException, 827 ::com::sun::star::lang::WrappedTargetException, 828 ::com::sun::star::uno::RuntimeException); 829 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames() 830 throw(::com::sun::star::uno::RuntimeException); 831 virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) 832 throw(::com::sun::star::uno::RuntimeException); 833 834 // XIndexAccess 835 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException); 836 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) 837 throw(::com::sun::star::lang::IndexOutOfBoundsException, 838 ::com::sun::star::lang::WrappedTargetException, 839 ::com::sun::star::uno::RuntimeException); 840 841 // XEnumerationAccess 842 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL 843 createEnumeration() throw(::com::sun::star::uno::RuntimeException); 844 845 // XElementAccess 846 virtual ::com::sun::star::uno::Type SAL_CALL getElementType() 847 throw(::com::sun::star::uno::RuntimeException); 848 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException); 849 850 // XServiceInfo 851 virtual ::rtl::OUString SAL_CALL getImplementationName() 852 throw(::com::sun::star::uno::RuntimeException); 853 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) 854 throw(::com::sun::star::uno::RuntimeException); 855 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() 856 throw(::com::sun::star::uno::RuntimeException); 857 }; 858 859 860 861 862 #endif 863 864