1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 /* 3 * This file is part of the LibreOffice project. 4 * 5 * This Source Code Form is subject to the terms of the Mozilla Public 6 * License, v. 2.0. If a copy of the MPL was not distributed with this 7 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 * 9 * This file incorporates work covered by the following license notice: 10 * 11 * Licensed to the Apache Software Foundation (ASF) under one or more 12 * contributor license agreements. See the NOTICE file distributed 13 * with this work for additional information regarding copyright 14 * ownership. The ASF licenses this file to you under the Apache 15 * License, Version 2.0 (the "License"); you may not use this file 16 * except in compliance with the License. You may obtain a copy of 17 * the License at http://www.apache.org/licenses/LICENSE-2.0 . 18 */ 19 20 #pragma once 21 22 #include <sal/config.h> 23 #include <sfx2/dllapi.h> 24 #include <sal/types.h> 25 #include <com/sun/star/frame/XModule.hpp> 26 #include <com/sun/star/frame/XTitle.hpp> 27 #include <com/sun/star/frame/XTitleChangeBroadcaster.hpp> 28 #include <com/sun/star/frame/XUntitledNumbers.hpp> 29 #include <com/sun/star/container/XChild.hpp> 30 #include <com/sun/star/document/XCmisDocument.hpp> 31 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> 32 #include <com/sun/star/document/XDocumentRecovery.hpp> 33 #include <com/sun/star/document/XUndoManagerSupplier.hpp> 34 #include <com/sun/star/rdf/XDocumentMetadataAccess.hpp> 35 #include <com/sun/star/document/XEventBroadcaster.hpp> 36 #include <com/sun/star/document/XShapeEventBroadcaster.hpp> 37 #include <com/sun/star/document/XDocumentEventBroadcaster.hpp> 38 #include <com/sun/star/document/XEventsSupplier.hpp> 39 #include <com/sun/star/document/XEmbeddedScripts.hpp> 40 #include <com/sun/star/document/XDocumentSubStorageSupplier.hpp> 41 #include <com/sun/star/document/XStorageBasedDocument.hpp> 42 #include <com/sun/star/document/XScriptInvocationContext.hpp> 43 #include <com/sun/star/lang/XEventListener.hpp> 44 #include <com/sun/star/frame/XModel3.hpp> 45 #include <com/sun/star/util/XModifiable2.hpp> 46 #include <com/sun/star/util/XCloseable.hpp> 47 #include <com/sun/star/view/XPrintable.hpp> 48 #include <com/sun/star/view/XPrintJobBroadcaster.hpp> 49 #include <com/sun/star/frame/XStorable2.hpp> 50 #include <com/sun/star/frame/XLoadable.hpp> 51 #include <com/sun/star/lang/EventObject.hpp> 52 #include <com/sun/star/datatransfer/XTransferable.hpp> 53 #include <com/sun/star/script/provider/XScriptProviderSupplier.hpp> 54 #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp> 55 #include <com/sun/star/embed/XVisualObject.hpp> 56 #include <com/sun/star/uno/Sequence.hxx> 57 #include <com/sun/star/uno/Reference.hxx> 58 #include <com/sun/star/uno/Any.hxx> 59 #include <cppuhelper/basemutex.hxx> 60 #include <com/sun/star/script/XStarBasicAccess.hpp> 61 62 #include <com/sun/star/document/XViewDataSupplier.hpp> 63 #include <com/sun/star/lang/XUnoTunnel.hpp> 64 #include <cppuhelper/implbase.hxx> 65 #include <svl/lstner.hxx> 66 67 #include <memory> 68 69 class ErrCode; 70 class SfxMedium; 71 class SfxObjectShell ; 72 class SfxViewFrame; 73 struct IMPL_SfxBaseModel_DataContainer ; // impl. struct to hold member of class SfxBaseModel 74 75 namespace sfx::intern { 76 class ViewCreationGuard; 77 } 78 79 namespace com::sun::star::beans { struct PropertyValue; } 80 namespace com::sun::star::container { class XNameContainer; } 81 namespace com::sun::star::container { class XNameReplace; } 82 namespace com::sun::star::document { class XEventListener; } 83 namespace com::sun::star::document { struct CmisProperty; } 84 namespace com::sun::star::document { struct CmisVersion; } 85 namespace com::sun::star::document { struct EventObject; } 86 namespace com::sun::star::frame { class XController2; } 87 namespace com::sun::star::task { class XInteractionHandler; } 88 namespace com::sun::star::ui { class XUIConfigurationManager2; } 89 namespace com::sun::star::util { class XCloseListener; } 90 namespace com::sun::star::util { class XModifyListener; } 91 92 93 94 /**_______________________________________________________________________________________________________ 95 @implements XChild 96 XComponent 97 document::XDocumentPropertiesSupplier 98 rdf::XDocumentMetadataAccess 99 XEventListener 100 XModel 101 XModifiable2 102 XPrintable 103 XStorable2 104 document::XEventBroadcaster 105 document::XEventsSupplier 106 document::XEmbeddedScripts 107 document::XScriptInvocationContext 108 XCloseable 109 XCloseBroadcaster 110 111 @base cppu::BaseMutex 112 SfxListener 113 */ 114 115 typedef ::cppu::WeakImplHelper < css::container::XChild 116 , css::document::XDocumentPropertiesSupplier 117 , css::document::XCmisDocument 118 , css::rdf::XDocumentMetadataAccess 119 , css::document::XDocumentRecovery 120 , css::document::XUndoManagerSupplier 121 , css::document::XShapeEventBroadcaster 122 , css::document::XDocumentEventBroadcaster 123 , css::lang::XEventListener 124 , css::document::XEventsSupplier 125 , css::document::XEmbeddedScripts 126 , css::document::XScriptInvocationContext 127 , css::frame::XModel3 128 , css::util::XModifiable2 129 , css::view::XPrintable 130 , css::view::XPrintJobBroadcaster 131 , css::frame::XStorable2 132 , css::frame::XLoadable 133 , css::script::XStarBasicAccess 134 , css::document::XViewDataSupplier 135 , css::util::XCloseable // => css::util::XCloseBroadcaster 136 , css::datatransfer::XTransferable 137 , css::document::XDocumentSubStorageSupplier 138 , css::document::XStorageBasedDocument 139 , css::script::provider::XScriptProviderSupplier 140 , css::ui::XUIConfigurationManagerSupplier 141 , css::embed::XVisualObject 142 , css::lang::XUnoTunnel 143 , css::frame::XModule 144 , css::frame::XTitle 145 , css::frame::XTitleChangeBroadcaster 146 , css::frame::XUntitledNumbers 147 > SfxBaseModel_Base; 148 149 class SFX2_DLLPUBLIC SfxBaseModel : protected ::cppu::BaseMutex 150 , public SfxBaseModel_Base 151 , public SfxListener 152 { 153 154 155 // public methods 156 157 158 public: 159 160 161 // constructor/destructor 162 163 164 SfxBaseModel( SfxObjectShell *pObjectShell ) ; 165 166 virtual ~SfxBaseModel() override ; 167 168 169 // XInterface 170 171 172 /**___________________________________________________________________________________________________ 173 @short give answer, if interface is supported 174 @descr The interfaces are searched by type. 175 176 @seealso XInterface 177 178 @param "rType" is the type of searched interface. 179 180 @return Any information about found interface 181 182 @onerror A RuntimeException is thrown. 183 */ 184 185 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) override ; 186 187 /**___________________________________________________________________________________________________ 188 @short increment refcount 189 @seealso XInterface 190 @seealso release() 191 @onerror A RuntimeException is thrown. 192 */ 193 acquire()194 virtual void SAL_CALL acquire() noexcept override 195 { OWeakObject::acquire(); } 196 197 /**___________________________________________________________________________________________________ 198 @short decrement refcount 199 @seealso XInterface 200 @seealso acquire() 201 @onerror A RuntimeException is thrown. 202 */ 203 release()204 virtual void SAL_CALL release() noexcept override 205 { OWeakObject::release(); } 206 207 208 // XTypeProvider 209 210 211 /**___________________________________________________________________________________________________ 212 @short get information about supported interfaces 213 @seealso XTypeProvider 214 @return Sequence of types of all supported interfaces 215 216 @onerror A RuntimeException is thrown. 217 */ 218 219 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override ; 220 221 /**___________________________________________________________________________________________________ 222 @short get implementation id 223 @descr This ID is necessary for UNO-caching. If there no ID, cache is disabled. 224 Another way, cache is enabled. 225 226 @seealso XTypeProvider 227 @return ID as Sequence of byte 228 229 @onerror A RuntimeException is thrown. 230 */ 231 232 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override ; 233 234 235 // XStarBasicAccess 236 237 238 /**___________________________________________________________________________________________________ 239 @seealso XStarBasicAccess 240 */ 241 virtual css::uno::Reference< css::container::XNameContainer > SAL_CALL getLibraryContainer() override; 242 243 /**___________________________________________________________________________________________________ 244 @seealso XStarBasicAccess 245 */ 246 virtual void SAL_CALL createLibrary( const OUString& LibName, const OUString& Password, 247 const OUString& ExternalSourceURL, const OUString& LinkTargetURL ) override; 248 249 /**___________________________________________________________________________________________________ 250 @seealso XStarBasicAccess 251 */ 252 virtual void SAL_CALL addModule( const OUString& LibraryName, const OUString& ModuleName, 253 const OUString& Language, const OUString& Source ) override; 254 255 /**___________________________________________________________________________________________________ 256 @seealso XStarBasicAccess 257 */ 258 virtual void SAL_CALL addDialog( const OUString& LibraryName, const OUString& DialogName, 259 const css::uno::Sequence< sal_Int8 >& Data ) override; 260 261 262 // XChild 263 264 265 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override ; 266 267 virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& xParent ) override; 268 269 270 // XComponent 271 272 273 virtual void SAL_CALL dispose() override; 274 275 virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener >& aListener) override; 276 277 virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener >& aListener ) override; 278 279 // XDocumentPropertiesSupplier 280 virtual css::uno::Reference< css::document::XDocumentProperties > 281 SAL_CALL getDocumentProperties() override; 282 283 284 // XEventListener 285 286 287 virtual void SAL_CALL disposing( const css::lang::EventObject& aEvent ) override; 288 289 290 // XModel 291 292 293 virtual sal_Bool SAL_CALL attachResource(const OUString& sURL, 294 const css::uno::Sequence< css::beans::PropertyValue >& aArgs) override; 295 296 virtual OUString SAL_CALL getURL() override; 297 298 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getArgs() override; 299 300 virtual void SAL_CALL connectController( const css::uno::Reference< css::frame::XController >& xController ) override; 301 302 virtual void SAL_CALL disconnectController( const css::uno::Reference< css::frame::XController >& xController ) override; 303 304 virtual void SAL_CALL lockControllers() override; 305 306 virtual void SAL_CALL unlockControllers() override; 307 308 virtual sal_Bool SAL_CALL hasControllersLocked() override; 309 310 virtual css::uno::Reference< css::frame::XController > SAL_CALL getCurrentController() override; 311 312 virtual void SAL_CALL setCurrentController( const css::uno::Reference< css::frame::XController >& xController ) override; 313 314 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getCurrentSelection() override; 315 316 317 // XModel2 318 319 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL getControllers() override; 320 321 virtual css::uno::Sequence< OUString > SAL_CALL getAvailableViewControllerNames() override; 322 323 virtual css::uno::Reference< css::frame::XController2 > SAL_CALL createDefaultViewController(const css::uno::Reference< css::frame::XFrame >& Frame ) override; 324 325 virtual css::uno::Reference< css::frame::XController2 > SAL_CALL createViewController(const OUString& ViewName , 326 const css::uno::Sequence< css::beans::PropertyValue >& Arguments , 327 const css::uno::Reference< css::frame::XFrame >& Frame ) override; 328 329 virtual void SAL_CALL setArgs(const css::uno::Sequence<css::beans::PropertyValue>& aArgs) override; 330 331 332 // XModel3 333 334 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getArgs2( const css::uno::Sequence< OUString > & requestedArgs ) override; 335 336 // XModifiable2 337 338 339 virtual sal_Bool SAL_CALL disableSetModified( ) override; 340 virtual sal_Bool SAL_CALL enableSetModified( ) override; 341 virtual sal_Bool SAL_CALL isSetModifiedEnabled( ) override; 342 343 virtual sal_Bool SAL_CALL isModified() override; 344 345 virtual void SAL_CALL setModified( sal_Bool bModified ) override; 346 347 virtual void SAL_CALL addModifyListener( const css::uno::Reference< css::util::XModifyListener >& xListener ) override ; 348 349 virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener > & xListener) override ; 350 351 352 // XCloseable 353 354 355 virtual void SAL_CALL close( sal_Bool bDeliverOwnership ) override; 356 357 358 // XCloseBroadcaster 359 360 361 virtual void SAL_CALL addCloseListener( const css::uno::Reference< css::util::XCloseListener >& xListener ) override; 362 virtual void SAL_CALL removeCloseListener( const css::uno::Reference< css::util::XCloseListener >& xListener ) override; 363 364 365 // XPrintJobBroadcaster 366 367 368 virtual void SAL_CALL addPrintJobListener( const css::uno::Reference< css::view::XPrintJobListener >& xListener ) override; 369 virtual void SAL_CALL removePrintJobListener( const css::uno::Reference< css::view::XPrintJobListener >& xListener ) override; 370 371 372 // XPrintable 373 374 375 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getPrinter() override; 376 377 virtual void SAL_CALL setPrinter( const css::uno::Sequence< css::beans::PropertyValue >& seqPrinter ) override; 378 virtual void SAL_CALL print( const css::uno::Sequence< css::beans::PropertyValue >& seqOptions ) override; 379 380 381 // XStorable2 382 383 384 virtual void SAL_CALL storeSelf( const css::uno::Sequence< css::beans::PropertyValue >& seqArguments ) override; 385 386 387 // XStorable 388 389 390 virtual sal_Bool SAL_CALL hasLocation() override; 391 392 virtual OUString SAL_CALL getLocation() override; 393 394 virtual sal_Bool SAL_CALL isReadonly() override; 395 396 virtual void SAL_CALL store() override; 397 398 virtual void SAL_CALL storeAsURL( const OUString& sURL, 399 const css::uno::Sequence< css::beans::PropertyValue >& seqArguments ) override ; 400 401 virtual void SAL_CALL storeToURL( const OUString& sURL, 402 const css::uno::Sequence< css::beans::PropertyValue >& seqArguments ) override; 403 404 SAL_DLLPRIVATE void 405 impl_store(const OUString& sURL, 406 const css::uno::Sequence<css::beans::PropertyValue>& seqArguments, bool bSaveTo); 407 408 // XLoadable 409 410 411 virtual void SAL_CALL initNew() override; 412 413 virtual void SAL_CALL load( const css::uno::Sequence< css::beans::PropertyValue >& seqArguments ) override; 414 415 416 // XDocumentSubStorageSupplier 417 418 419 virtual css::uno::Reference< css::embed::XStorage > SAL_CALL getDocumentSubStorage( const OUString& aStorageName, sal_Int32 nMode ) override; 420 421 virtual css::uno::Sequence< OUString > SAL_CALL getDocumentSubStoragesNames() override; 422 423 424 // XStorageBasedDocument 425 426 427 virtual void SAL_CALL loadFromStorage( const css::uno::Reference< css::embed::XStorage >& xStorage, 428 const css::uno::Sequence< css::beans::PropertyValue >& aMediaDescriptor ) override; 429 430 virtual void SAL_CALL storeToStorage( const css::uno::Reference< css::embed::XStorage >& xStorage, 431 const css::uno::Sequence< css::beans::PropertyValue >& aMediaDescriptor ) override; 432 433 virtual void SAL_CALL switchToStorage( const css::uno::Reference< css::embed::XStorage >& xStorage ) override; 434 435 virtual css::uno::Reference< css::embed::XStorage > SAL_CALL getDocumentStorage() override; 436 437 virtual void SAL_CALL addStorageChangeListener( 438 const css::uno::Reference< css::document::XStorageChangeListener >& xListener ) override; 439 440 virtual void SAL_CALL removeStorageChangeListener( 441 const css::uno::Reference< css::document::XStorageChangeListener >& xListener ) override; 442 443 444 // XVisualObject 445 446 447 virtual void SAL_CALL setVisualAreaSize( sal_Int64 nAspect, const css::awt::Size& aSize ) override; 448 449 virtual css::awt::Size SAL_CALL getVisualAreaSize( sal_Int64 nAspect ) override; 450 451 virtual css::embed::VisualRepresentation SAL_CALL getPreferredVisualRepresentation( ::sal_Int64 nAspect ) override; 452 453 virtual sal_Int32 SAL_CALL getMapUnit( sal_Int64 nAspect ) override; 454 455 456 // XScriptProviderSupplier 457 458 459 virtual css::uno::Reference< css::script::provider::XScriptProvider > SAL_CALL getScriptProvider() override; 460 461 462 // XUIConfigurationManagerSupplier 463 virtual css::uno::Reference< css::ui::XUIConfigurationManager > SAL_CALL getUIConfigurationManager() override; 464 465 466 // XTransferable 467 468 469 virtual css::uno::Any SAL_CALL getTransferData( const css::datatransfer::DataFlavor& aFlavor ) override; 470 471 virtual css::uno::Sequence< css::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors() override; 472 473 virtual sal_Bool SAL_CALL isDataFlavorSupported( const css::datatransfer::DataFlavor& aFlavor ) override; 474 475 476 // XEventsSupplier 477 478 479 /**___________________________________________________________________________________________________ 480 @descr - offers a list of event handlers which are be bound to events of 481 this object. 482 @return - an Events object. 483 */ 484 485 virtual css::uno::Reference< css::container::XNameReplace > SAL_CALL getEvents() override; 486 487 488 // XEmbeddedScripts 489 490 491 virtual css::uno::Reference< css::script::XStorageBasedLibraryContainer > SAL_CALL getBasicLibraries() override; 492 virtual css::uno::Reference< css::script::XStorageBasedLibraryContainer > SAL_CALL getDialogLibraries() override; 493 virtual sal_Bool SAL_CALL getAllowMacroExecution() override; 494 495 496 // XScriptInvocationContext 497 498 499 virtual css::uno::Reference< css::document::XEmbeddedScripts > SAL_CALL getScriptContainer() override; 500 501 502 // document::XEventBroadcaster 503 504 /**___________________________________________________________________________________________________ 505 @descr - registers the given XEventListener. 506 */ 507 virtual void SAL_CALL addEventListener( const css::uno::Reference< css::document::XEventListener >& xListener ) override; 508 509 /**___________________________________________________________________________________________________ 510 @descr - unregisters the given XEventListener. 511 */ 512 virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::document::XEventListener >& xListener ) override; 513 514 515 // document::XShapeEventBroadcaster 516 517 /**___________________________________________________________________________________________________ 518 @descr - registers the given XEventListener. 519 */ 520 virtual void SAL_CALL addShapeEventListener( const css::uno::Reference< css::drawing::XShape >& xShape, const css::uno::Reference< css::document::XShapeEventListener >& xListener ) override; 521 522 /**___________________________________________________________________________________________________ 523 @descr - unregisters the given XEventListener. 524 */ 525 virtual void SAL_CALL removeShapeEventListener( const css::uno::Reference< css::drawing::XShape >& xShape, const css::uno::Reference< css::document::XShapeEventListener >& xListener ) override; 526 527 528 // XDocumentEventBroadcaster 529 530 virtual void SAL_CALL addDocumentEventListener( const css::uno::Reference< css::document::XDocumentEventListener >& Listener ) override; 531 virtual void SAL_CALL removeDocumentEventListener( const css::uno::Reference< css::document::XDocumentEventListener >& Listener ) override; 532 virtual void SAL_CALL notifyDocumentEvent( const OUString& EventName, const css::uno::Reference< css::frame::XController2 >& ViewController, const css::uno::Any& Supplement ) override; 533 534 535 // XUnoTunnel 536 537 538 virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; 539 540 // css.frame.XModule 541 virtual void SAL_CALL setIdentifier(const OUString& sIdentifier) override; 542 543 // css.frame.XModule 544 virtual OUString SAL_CALL getIdentifier() override; 545 546 // css.frame.XTitle 547 virtual OUString SAL_CALL getTitle() override; 548 549 // css.frame.XTitle 550 virtual void SAL_CALL setTitle( const OUString& sTitle ) override; 551 552 // css.frame.XTitleChangeBroadcaster 553 virtual void SAL_CALL addTitleChangeListener( const css::uno::Reference< css::frame::XTitleChangeListener >& xListener ) override; 554 555 // css.frame.XTitleChangeBroadcaster 556 virtual void SAL_CALL removeTitleChangeListener( const css::uno::Reference< css::frame::XTitleChangeListener >& xListener ) override; 557 558 // css.frame.XUntitledNumbers 559 virtual ::sal_Int32 SAL_CALL leaseNumber( const css::uno::Reference< css::uno::XInterface >& xComponent ) override; 560 561 // css.frame.XUntitledNumbers 562 virtual void SAL_CALL releaseNumber( ::sal_Int32 nNumber ) override; 563 564 // css.frame.XUntitledNumbers 565 virtual void SAL_CALL releaseNumberForComponent( const css::uno::Reference< css::uno::XInterface >& xComponent ) override; 566 567 // css.frame.XUntitledNumbers 568 virtual OUString SAL_CALL getUntitledPrefix() override; 569 570 // css.document.XDocumentRecovery 571 virtual sal_Bool SAL_CALL wasModifiedSinceLastSave() override; 572 virtual void SAL_CALL storeToRecoveryFile( const OUString& i_TargetLocation, const css::uno::Sequence< css::beans::PropertyValue >& i_MediaDescriptor ) override; 573 virtual void SAL_CALL recoverFromFile( const OUString& i_SourceLocation, const OUString& i_SalvagedFile, const css::uno::Sequence< css::beans::PropertyValue >& i_MediaDescriptor ) override; 574 575 // css.document.XUndoManagerSupplier 576 virtual css::uno::Reference< css::document::XUndoManager > SAL_CALL getUndoManager( ) override; 577 578 579 // css::rdf::XNode: 580 virtual OUString SAL_CALL getStringValue() override; 581 582 // css::rdf::XURI: 583 virtual OUString SAL_CALL getNamespace() override; 584 virtual OUString SAL_CALL getLocalName() override; 585 586 // css::rdf::XRepositorySupplier: 587 virtual css::uno::Reference< 588 css::rdf::XRepository > SAL_CALL getRDFRepository() override; 589 590 // css::rdf::XDocumentMetadataAccess: 591 virtual css::uno::Reference< 592 css::rdf::XMetadatable > SAL_CALL 593 getElementByMetadataReference( 594 const css::beans::StringPair & i_rReference) override; 595 virtual css::uno::Reference< 596 css::rdf::XMetadatable > SAL_CALL 597 getElementByURI(const css::uno::Reference< 598 css::rdf::XURI > & i_xURI) override; 599 virtual css::uno::Sequence< css::uno::Reference< 600 css::rdf::XURI > > SAL_CALL getMetadataGraphsWithType( 601 const css::uno::Reference< 602 css::rdf::XURI > & i_xType) override; 603 virtual css::uno::Reference< 604 css::rdf::XURI> SAL_CALL 605 addMetadataFile(const OUString & i_rFileName, 606 const css::uno::Sequence< 607 css::uno::Reference< css::rdf::XURI > 608 > & i_rTypes) override; 609 virtual css::uno::Reference< 610 css::rdf::XURI> SAL_CALL 611 importMetadataFile(::sal_Int16 i_Format, 612 const css::uno::Reference< 613 css::io::XInputStream > & i_xInStream, 614 const OUString & i_rFileName, 615 const css::uno::Reference< 616 css::rdf::XURI > & i_xBaseURI, 617 const css::uno::Sequence< 618 css::uno::Reference< css::rdf::XURI > 619 > & i_rTypes) override; 620 virtual void SAL_CALL removeMetadataFile( 621 const css::uno::Reference< 622 css::rdf::XURI > & i_xGraphName) override; 623 virtual void SAL_CALL addContentOrStylesFile( 624 const OUString & i_rFileName) override; 625 virtual void SAL_CALL removeContentOrStylesFile( 626 const OUString & i_rFileName) override; 627 628 virtual void SAL_CALL loadMetadataFromStorage( 629 const css::uno::Reference< 630 css::embed::XStorage > & i_xStorage, 631 const css::uno::Reference< 632 css::rdf::XURI > & i_xBaseURI, 633 const css::uno::Reference< 634 css::task::XInteractionHandler> & i_xHandler) override; 635 virtual void SAL_CALL storeMetadataToStorage( 636 const css::uno::Reference< 637 css::embed::XStorage > & i_xStorage) override; 638 virtual void SAL_CALL loadMetadataFromMedium( 639 const css::uno::Sequence< 640 css::beans::PropertyValue > & i_rMedium) override; 641 virtual void SAL_CALL storeMetadataToMedium( 642 const css::uno::Sequence< 643 css::beans::PropertyValue > & i_rMedium) override; 644 645 // XCmisDocument 646 647 virtual css::uno::Sequence< css::document::CmisProperty > 648 SAL_CALL getCmisProperties() override; 649 virtual void SAL_CALL setCmisProperties( 650 const css::uno::Sequence< 651 css::document::CmisProperty >& _cmisproperties ) override; 652 653 virtual void SAL_CALL updateCmisProperties( 654 const css::uno::Sequence< 655 css::document::CmisProperty >& _cmisproperties ) override; 656 657 virtual css::uno::Sequence< css::document::CmisVersion > SAL_CALL getAllVersions ( ) override; 658 659 virtual void SAL_CALL checkOut( ) override; 660 virtual void SAL_CALL cancelCheckOut( ) override; 661 virtual void SAL_CALL checkIn( sal_Bool bIsMajor, const OUString & rMessage ) override; 662 663 virtual sal_Bool SAL_CALL isVersionable( ) override; 664 virtual sal_Bool SAL_CALL canCheckOut( ) override; 665 virtual sal_Bool SAL_CALL canCancelCheckOut( ) override; 666 virtual sal_Bool SAL_CALL canCheckIn( ) override; 667 668 /// @throws css::uno::RuntimeException 669 bool getBoolPropertyValue( const OUString& rName ); 670 671 672 // SfxListener 673 674 675 void Notify( SfxBroadcaster& aBC , 676 const SfxHint& aHint ) override ; 677 678 679 // public IMPL? 680 681 682 void changing() ; 683 684 SfxObjectShell* GetObjectShell() const ; 685 686 SAL_DLLPRIVATE bool impl_isDisposed() const ; 687 bool IsInitialized() const; 688 void MethodEntryCheck( const bool i_mustBeInitialized ) const; 689 690 css::uno::Reference < css::container::XIndexAccess > SAL_CALL getViewData() override; 691 void SAL_CALL setViewData( const css::uno::Reference < css::container::XIndexAccess >& aData ) override; 692 693 /** calls all XEventListeners */ 694 void notifyEvent( const css::document::EventObject& aEvent ) const; 695 696 /** returns true if someone added a XEventListener to this XEventBroadcaster */ 697 bool hasEventListeners() const; 698 699 protected: 700 701 /* returns a unique id for the model that is valid as long as the document 702 is loaded. The id is not saved across document close/reload. */ 703 OUString const & getRuntimeUID() const; 704 705 /* returns true if the document signatures are valid, otherwise false */ 706 bool hasValidSignatures() const; 707 708 /* GrabBagItem for interim interop purposes */ 709 void getGrabBagItem(css::uno::Any& rVal) const; 710 711 void setGrabBagItem(const css::uno::Any& rVal); 712 713 714 // private methods 715 716 717 private: 718 /// @throws css::uno::RuntimeException 719 css::uno::Reference< css::ui::XUIConfigurationManager2 > getUIConfigurationManager2(); 720 void impl_getPrintHelper(); 721 SAL_DLLPRIVATE void ListenForStorage_Impl( const css::uno::Reference< css::embed::XStorage >& xStorage ); 722 SAL_DLLPRIVATE OUString GetMediumFilterName_Impl() const; 723 724 SAL_DLLPRIVATE void postEvent_Impl( const OUString& aName, const css::uno::Reference< css::frame::XController2 >& xController = css::uno::Reference< css::frame::XController2 >() ); 725 726 SAL_DLLPRIVATE css::uno::Reference< css::frame::XTitle > impl_getTitleHelper (); 727 SAL_DLLPRIVATE css::uno::Reference< css::frame::XUntitledNumbers > impl_getUntitledHelper (); 728 729 SAL_DLLPRIVATE SfxViewFrame* FindOrCreateViewFrame_Impl( 730 const css::uno::Reference< css::frame::XFrame >& i_rFrame, 731 ::sfx::intern::ViewCreationGuard& i_rGuard 732 ) const; 733 734 SAL_DLLPRIVATE void NotifyModifyListeners_Impl() const; 735 736 SAL_DLLPRIVATE void loadCmisProperties(); 737 738 SAL_DLLPRIVATE SfxMedium* handleLoadError( ErrCode nError, SfxMedium* pMedium ); 739 740 741 // private variables and methods 742 743 744 private: 745 746 std::shared_ptr<IMPL_SfxBaseModel_DataContainer> m_pData; 747 // cannot be held in m_pData, since it needs to be accessed in non-threadsafe context 748 const bool m_bSupportEmbeddedScripts; 749 const bool m_bSupportDocRecovery; 750 751 } ; // class SfxBaseModel 752 753 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 754