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 24 #ifndef _SFX_SFXBASEMODEL_HXX_ 25 #define _SFX_SFXBASEMODEL_HXX_ 26 27 #include "sal/config.h" 28 #include "sfx2/dllapi.h" 29 #include "sal/types.h" 30 #include <com/sun/star/lang/XTypeProvider.hpp> 31 #include <com/sun/star/frame/XModule.hpp> 32 #include <com/sun/star/frame/XTitle.hpp> 33 #include <com/sun/star/frame/XTitleChangeBroadcaster.hpp> 34 #include <com/sun/star/frame/XUntitledNumbers.hpp> 35 #include <com/sun/star/container/XChild.hpp> 36 #include <com/sun/star/container/XNameContainer.hpp> 37 #include <com/sun/star/container/XNameReplace.hpp> 38 #include <com/sun/star/frame/XController2.hpp> 39 #include <com/sun/star/document/XDocumentInfo.hpp> 40 #include <com/sun/star/document/XDocumentInfoSupplier.hpp> 41 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> 42 #include <com/sun/star/document/XDocumentRecovery.hpp> 43 #include <com/sun/star/document/XUndoManagerSupplier.hpp> 44 45 #include <com/sun/star/rdf/XDocumentMetadataAccess.hpp> 46 47 #include <com/sun/star/document/XEventBroadcaster.hpp> 48 #include <com/sun/star/document/XDocumentEventBroadcaster.hpp> 49 #include <com/sun/star/document/XEventListener.hpp> 50 #include <com/sun/star/document/XEventsSupplier.hpp> 51 #include <com/sun/star/document/XEmbeddedScripts.hpp> 52 #include <com/sun/star/document/EventObject.hpp> 53 #include <com/sun/star/document/XDocumentSubStorageSupplier.hpp> 54 #include <com/sun/star/document/XStorageBasedDocument.hpp> 55 #include <com/sun/star/document/XScriptInvocationContext.hpp> 56 #include <com/sun/star/lang/XEventListener.hpp> 57 #include <com/sun/star/lang/NotInitializedException.hpp> 58 #include <com/sun/star/lang/DisposedException.hpp> 59 #include <com/sun/star/frame/XModel2.hpp> 60 #include <com/sun/star/frame/DoubleInitializationException.hpp> 61 #include <com/sun/star/util/XModifiable2.hpp> 62 #include <com/sun/star/util/XModifyListener.hpp> 63 #include <com/sun/star/util/XCloseable.hpp> 64 #include <com/sun/star/util/XCloseBroadcaster.hpp> 65 #include <com/sun/star/util/XCloseListener.hpp> 66 #include <com/sun/star/util/CloseVetoException.hpp> 67 #include <com/sun/star/view/XPrintable.hpp> 68 #include <com/sun/star/view/XPrintJobBroadcaster.hpp> 69 #include <com/sun/star/frame/XStorable.hpp> 70 #include <com/sun/star/frame/XStorable2.hpp> 71 #include <com/sun/star/frame/XLoadable.hpp> 72 #include <com/sun/star/beans/PropertyValue.hpp> 73 #include <com/sun/star/lang/EventObject.hpp> 74 #include <com/sun/star/datatransfer/XTransferable.hpp> 75 #include <com/sun/star/script/provider/XScriptProviderSupplier.hpp> 76 #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp> 77 #include <com/sun/star/embed/XVisualObject.hpp> 78 #include <com/sun/star/uno/Sequence.hxx> 79 #include <com/sun/star/uno/Reference.hxx> 80 #include <com/sun/star/uno/Any.hxx> 81 #include <cppuhelper/weak.hxx> 82 #include <cppuhelper/basemutex.hxx> 83 #include <cppuhelper/typeprovider.hxx> 84 #include <com/sun/star/script/XStarBasicAccess.hpp> 85 #include <osl/mutex.hxx> 86 #include <vos/mutex.hxx> 87 #include <vcl/svapp.hxx> 88 89 #include <tools/link.hxx> 90 91 #include <com/sun/star/document/XViewDataSupplier.hpp> 92 #include <com/sun/star/lang/XUnoTunnel.hpp> 93 94 #include <com/sun/star/task/XInteractionHandler.hpp> 95 96 //________________________________________________________________________________________________________ 97 #if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_32) 98 #define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_32 99 #define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 32 100 #include <comphelper/implbase_var.hxx> 101 #endif 102 103 // include of my own project 104 //________________________________________________________________________________________________________ 105 #include <svl/lstner.hxx> 106 107 //________________________________________________________________________________________________________ 108 // defines 109 //________________________________________________________________________________________________________ 110 111 // Some defines to write better code :-) 112 #define XCHILD ::com::sun::star::container::XChild 113 #define XNAMECONTAINER ::com::sun::star::container::XNameContainer 114 #define XCONTROLLER ::com::sun::star::frame::XController 115 #define XEVENTLISTENER ::com::sun::star::lang::XEventListener 116 #define XINTERFACE ::com::sun::star::uno::XInterface 117 #define XCOMPONENT ::com::sun::star::lang::XComponent 118 #define XMODEL ::com::sun::star::frame::XModel 119 #define XMODEL2 ::com::sun::star::frame::XModel2 120 #define XMODIFIABLE ::com::sun::star::util::XModifiable 121 #define XMODIFIABLE2 ::com::sun::star::util::XModifiable2 122 #define XMODIFYBROADCASTER ::com::sun::star::util::XModifyBroadcaster 123 #define XMODIFYLISTENER ::com::sun::star::util::XModifyListener 124 #define XCLOSEABLE ::com::sun::star::util::XCloseable 125 #define XCLOSEBROADCASTER ::com::sun::star::util::XCloseBroadcaster 126 #define XCLOSELISTENER ::com::sun::star::util::XCloseListener 127 #define XPRINTABLE ::com::sun::star::view::XPrintable 128 #define XPRINTJOBBROADCASTER ::com::sun::star::view::XPrintJobBroadcaster 129 #define XSTORABLE ::com::sun::star::frame::XStorable 130 #define XSTORABLE2 ::com::sun::star::frame::XStorable2 131 #define XLOADABLE ::com::sun::star::frame::XLoadable 132 #define XTYPEPROVIDER ::com::sun::star::lang::XTypeProvider 133 #define XSTARBASICACCESS ::com::sun::star::script::XStarBasicAccess 134 #define NOSUCHELEMENTEXCEPTION ::com::sun::star::container::NoSuchElementException 135 #define ELEMENTEXISTEXCEPTION ::com::sun::star::container::ElementExistException 136 #define XNAMEREPLACE ::com::sun::star::container::XNameReplace 137 #define XINDEXCONTAINER ::com::sun::star::container::XIndexContainer 138 #define DISPOSEDEXCEPTION ::com::sun::star::lang::DisposedException 139 #define DOCEVENTOBJECT ::com::sun::star::document::EventObject 140 #define XDOCEVENTLISTENER ::com::sun::star::document::XEventListener 141 #define XDOCUMENTINFO ::com::sun::star::document::XDocumentInfo 142 #define XDOCUMENTINFOSUPPLIER ::com::sun::star::document::XDocumentInfoSupplier 143 #define XEVENTBROADCASTER ::com::sun::star::document::XEventBroadcaster 144 #define XDOCUMENTEVENTBROADCASTER ::com::sun::star::document::XDocumentEventBroadcaster 145 #define XEVENTSSUPPLIER ::com::sun::star::document::XEventsSupplier 146 #define XEMBEDDEDSCRIPTS ::com::sun::star::document::XEmbeddedScripts 147 #define XSCRIPTINVOCATIONCONTEXT ::com::sun::star::document::XScriptInvocationContext 148 149 #define NOSUPPORTEXCEPTION ::com::sun::star::lang::NoSupportException 150 #define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException 151 #define CLOSEVETOEXCEPTION ::com::sun::star::util::CloseVetoException 152 #define DOUBLEINITIALIZATIONEXCEPTION ::com::sun::star::frame::DoubleInitializationException 153 #define ILLEGALARGUMENTEXCEPTION ::com::sun::star::lang::IllegalArgumentException 154 #define IOEXCEPTION ::com::sun::star::io::IOException 155 #define EXCEPTION ::com::sun::star::uno::Exception 156 157 #define ANY ::com::sun::star::uno::Any 158 #define EVENTOBJECT ::com::sun::star::lang::EventObject 159 #define PROPERTYVALUE ::com::sun::star::beans::PropertyValue 160 #define REFERENCE ::com::sun::star::uno::Reference 161 #define MUTEX ::osl::Mutex 162 #define OUSTRING ::rtl::OUString 163 #define UNOTYPE ::com::sun::star::uno::Type 164 #define XVIEWDATASUPPLIER ::com::sun::star::document::XViewDataSupplier 165 #define XINDEXACCESS ::com::sun::star::container::XIndexAccess 166 #define XTRANSFERABLE ::com::sun::star::datatransfer::XTransferable 167 #define DATAFLAVOR ::com::sun::star::datatransfer::DataFlavor 168 169 #define XUNOTUNNEL ::com::sun::star::lang::XUnoTunnel 170 171 #define XDOCUMENTSUBSTORAGESUPPLIER ::com::sun::star::document::XDocumentSubStorageSupplier 172 #define XSTORAGEBASEDDOCUMENT ::com::sun::star::document::XStorageBasedDocument 173 #define XSTORAGE ::com::sun::star::embed::XStorage 174 #define XVISUALOBJECT ::com::sun::star::embed::XVisualObject 175 176 #define XSCRIPTPROVIDERSUPPLIER ::com::sun::star::script::provider::XScriptProviderSupplier 177 #define XSCRIPTPROVIDER ::com::sun::star::script::provider::XScriptProvider 178 179 #define XUICONFIGURATIONMANAGERSUPPLIER ::com::sun::star::ui::XUIConfigurationManagerSupplier 180 #define XUICONFIGURATIONMANAGER ::com::sun::star::ui::XUIConfigurationManager 181 #define XMODULE ::com::sun::star::frame::XModule 182 #define XTITLE ::com::sun::star::frame::XTitle 183 #define XTITLECHANGEBROADCASTER ::com::sun::star::frame::XTitleChangeBroadcaster 184 #define XUNTITLEDNUMBERS ::com::sun::star::frame::XUntitledNumbers 185 186 //________________________________________________________________________________________________________ 187 // namespace 188 //________________________________________________________________________________________________________ 189 #ifdef css 190 #error "class is using css as namespace define .-)" 191 #else 192 #define css ::com::sun::star 193 #endif 194 195 //________________________________________________________________________________________________________ 196 // forwards 197 //________________________________________________________________________________________________________ 198 class SfxPrinter; 199 class SfxViewShell; 200 class SfxObjectShell ; 201 class SfxEventHint; 202 class SfxViewFrame; 203 struct IMPL_SfxBaseModel_DataContainer ; // impl. struct to hold member of class SfxBaseModel 204 205 namespace sfx { namespace intern { 206 class ViewCreationGuard; 207 } } 208 //________________________________________________________________________________________________________ 209 // class declarations 210 //________________________________________________________________________________________________________ 211 212 /**_______________________________________________________________________________________________________ 213 @short - 214 215 @descr - 216 217 @implements XChild 218 XComponent 219 XDocumentInfoSupplier 220 document::XDocumentPropertiesSupplier 221 rdf::XDocumentMetadataAccess 222 XEventListener 223 XModel 224 XModifiable2 225 XPrintable 226 XStorable2 227 document::XEventBroadcaster 228 document::XEventsSupplier 229 document::XEmbeddedScripts 230 document::XScriptInvocationContext 231 XCloseable 232 XCloseBroadcaster 233 234 @base cppu::BaseMutex 235 SfxListener 236 */ 237 238 typedef ::comphelper::WeakImplHelper32 < XCHILD 239 , XDOCUMENTINFOSUPPLIER 240 , ::com::sun::star::document::XDocumentPropertiesSupplier 241 , ::com::sun::star::rdf::XDocumentMetadataAccess 242 , ::com::sun::star::document::XDocumentRecovery 243 , ::com::sun::star::document::XUndoManagerSupplier 244 , XEVENTBROADCASTER 245 , XDOCUMENTEVENTBROADCASTER 246 , XEVENTLISTENER 247 , XEVENTSSUPPLIER 248 , XEMBEDDEDSCRIPTS 249 , XSCRIPTINVOCATIONCONTEXT 250 , XMODEL2 251 , XMODIFIABLE2 252 , XPRINTABLE 253 , XPRINTJOBBROADCASTER 254 , XSTORABLE2 255 , XLOADABLE 256 , XSTARBASICACCESS 257 , XVIEWDATASUPPLIER 258 , XCLOSEABLE // => XCLOSEBROADCASTER 259 , XTRANSFERABLE 260 , XDOCUMENTSUBSTORAGESUPPLIER 261 , XSTORAGEBASEDDOCUMENT 262 , XSCRIPTPROVIDERSUPPLIER 263 , XUICONFIGURATIONMANAGERSUPPLIER 264 , XVISUALOBJECT 265 , XUNOTUNNEL 266 , XMODULE 267 , XTITLE 268 , XTITLECHANGEBROADCASTER 269 , XUNTITLEDNUMBERS 270 > SfxBaseModel_Base; 271 272 class SFX2_DLLPUBLIC SfxBaseModel : protected ::cppu::BaseMutex 273 , public SfxBaseModel_Base 274 , public SfxListener 275 { 276 277 //________________________________________________________________________________________________________ 278 // public methods 279 //________________________________________________________________________________________________________ 280 281 public: 282 283 //____________________________________________________________________________________________________ 284 // constructor/destructor 285 //____________________________________________________________________________________________________ 286 287 /**___________________________________________________________________________________________________ 288 @short - 289 @descr - 290 291 @seealso - 292 293 @param - 294 295 @return - 296 297 @onerror - 298 */ 299 300 SfxBaseModel( SfxObjectShell *pObjektShell = NULL ) ; 301 302 /**___________________________________________________________________________________________________ 303 @short - 304 @descr - 305 306 @seealso - 307 308 @param - 309 310 @return - 311 312 @onerror - 313 */ 314 315 virtual ~SfxBaseModel() ; 316 317 //____________________________________________________________________________________________________ 318 // XInterface 319 //____________________________________________________________________________________________________ 320 321 /**___________________________________________________________________________________________________ 322 @short give answer, if interface is supported 323 @descr The interfaces are searched by type. 324 325 @seealso XInterface 326 327 @param "rType" is the type of searched interface. 328 329 @return Any information about found interface 330 331 @onerror A RuntimeException is thrown. 332 */ 333 334 virtual ANY SAL_CALL queryInterface( const UNOTYPE& rType ) ; 335 336 /**___________________________________________________________________________________________________ 337 @short increment refcount 338 @descr - 339 340 @seealso XInterface 341 @seealso release() 342 343 @param - 344 345 @return - 346 347 @onerror A RuntimeException is thrown. 348 */ 349 350 virtual void SAL_CALL acquire() throw() ; 351 352 /**___________________________________________________________________________________________________ 353 @short decrement refcount 354 @descr - 355 356 @seealso XInterface 357 @seealso acquire() 358 359 @param - 360 361 @return - 362 363 @onerror A RuntimeException is thrown. 364 */ 365 366 virtual void SAL_CALL release() throw() ; 367 368 //____________________________________________________________________________________________________ 369 // XTypeProvider 370 //____________________________________________________________________________________________________ 371 372 /**___________________________________________________________________________________________________ 373 @short get information about supported interfaces 374 @descr - 375 376 @seealso XTypeProvider 377 378 @param - 379 380 @return Sequence of types of all supported interfaces 381 382 @onerror A RuntimeException is thrown. 383 */ 384 385 virtual ::com::sun::star::uno::Sequence< UNOTYPE > SAL_CALL getTypes() ; 386 387 /**___________________________________________________________________________________________________ 388 @short get implementation id 389 @descr This ID is necessary for UNO-caching. If there no ID, cache is disabled. 390 Another way, cache is enabled. 391 392 @seealso XTypeProvider 393 394 @param - 395 396 @return ID as Sequence of byte 397 398 @onerror A RuntimeException is thrown. 399 */ 400 401 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() ; 402 403 404 //____________________________________________________________________________________________________ 405 // XStarBasicAccess 406 //____________________________________________________________________________________________________ 407 408 /**___________________________________________________________________________________________________ 409 @seealso XStarBasicAccess 410 */ 411 virtual REFERENCE< XNAMECONTAINER > SAL_CALL getLibraryContainer(); 412 413 /**___________________________________________________________________________________________________ 414 @seealso XStarBasicAccess 415 */ 416 virtual void SAL_CALL createLibrary( const OUSTRING& LibName, const OUSTRING& Password, 417 const OUSTRING& ExternalSourceURL, const OUSTRING& LinkTargetURL ); 418 419 /**___________________________________________________________________________________________________ 420 @seealso XStarBasicAccess 421 */ 422 virtual void SAL_CALL addModule( const OUSTRING& LibraryName, const OUSTRING& ModuleName, 423 const OUSTRING& Language, const OUSTRING& Source ); 424 425 /**___________________________________________________________________________________________________ 426 @seealso XStarBasicAccess 427 */ 428 virtual void SAL_CALL addDialog( const OUSTRING& LibraryName, const OUSTRING& DialogName, 429 const ::com::sun::star::uno::Sequence< sal_Int8 >& Data ); 430 431 432 //____________________________________________________________________________________________________ 433 // XChild 434 //____________________________________________________________________________________________________ 435 436 /**___________________________________________________________________________________________________ 437 @short - 438 @descr - 439 440 @seealso - 441 442 @param - 443 444 @return - 445 446 @onerror - 447 */ 448 449 virtual REFERENCE< XINTERFACE > SAL_CALL getParent() ; 450 451 /**___________________________________________________________________________________________________ 452 @short - 453 @descr - 454 455 @seealso - 456 457 @param - 458 459 @return - 460 461 @onerror - 462 */ 463 464 virtual void SAL_CALL setParent( const REFERENCE< XINTERFACE >& xParent ) ; 465 466 //____________________________________________________________________________________________________ 467 // XComponent 468 //____________________________________________________________________________________________________ 469 470 /**___________________________________________________________________________________________________ 471 @short - 472 @descr - 473 474 @seealso - 475 476 @param - 477 478 @return - 479 480 @onerror - 481 */ 482 483 virtual void SAL_CALL dispose(); 484 485 /**___________________________________________________________________________________________________ 486 @short - 487 @descr - 488 489 @seealso - 490 491 @param - 492 493 @return - 494 495 @onerror - 496 */ 497 498 virtual void SAL_CALL addEventListener(const REFERENCE< XEVENTLISTENER >& aListener); 499 500 /**___________________________________________________________________________________________________ 501 @short - 502 @descr - 503 504 @seealso - 505 506 @param - 507 508 @return - 509 510 @onerror - 511 */ 512 513 virtual void SAL_CALL removeEventListener(const REFERENCE< XEVENTLISTENER >& aListener ); 514 515 //____________________________________________________________________________________________________ 516 // XDocumentInfoSupplier 517 //____________________________________________________________________________________________________ 518 519 /**___________________________________________________________________________________________________ 520 @short - 521 @descr - 522 523 @seealso - 524 525 @param - 526 527 @return - 528 529 @onerror - 530 */ 531 532 virtual REFERENCE< XDOCUMENTINFO > SAL_CALL getDocumentInfo(); 533 534 // XDocumentPropertiesSupplier 535 virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentProperties > 536 SAL_CALL getDocumentProperties(); 537 538 //____________________________________________________________________________________________________ 539 // XEventListener 540 //____________________________________________________________________________________________________ 541 542 /**___________________________________________________________________________________________________ 543 @short - 544 @descr - 545 546 @seealso - 547 548 @param - 549 550 @return - 551 552 @onerror - 553 */ 554 555 virtual void SAL_CALL disposing( const EVENTOBJECT& aEvent ); 556 557 //____________________________________________________________________________________________________ 558 // XModel 559 //____________________________________________________________________________________________________ 560 561 /**___________________________________________________________________________________________________ 562 @short - 563 @descr - 564 565 @seealso - 566 567 @param - 568 569 @return - 570 571 @onerror - 572 */ 573 574 virtual sal_Bool SAL_CALL attachResource( const OUSTRING& sURL , 575 const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& aArgs ); 576 577 /**___________________________________________________________________________________________________ 578 @short - 579 @descr - 580 581 @seealso - 582 583 @param - 584 585 @return - 586 587 @onerror - 588 */ 589 590 virtual OUSTRING SAL_CALL getURL(); 591 592 /**___________________________________________________________________________________________________ 593 @short - 594 @descr - 595 596 @seealso - 597 598 @param - 599 600 @return - 601 602 @onerror - 603 */ 604 605 virtual ::com::sun::star::uno::Sequence< PROPERTYVALUE > SAL_CALL getArgs(); 606 607 /**___________________________________________________________________________________________________ 608 @short - 609 @descr - 610 611 @seealso - 612 613 @param - 614 615 @return - 616 617 @onerror - 618 */ 619 620 virtual void SAL_CALL connectController( const REFERENCE< XCONTROLLER >& xController ); 621 622 /**___________________________________________________________________________________________________ 623 @short - 624 @descr - 625 626 @seealso - 627 628 @param - 629 630 @return - 631 632 @onerror - 633 */ 634 635 virtual void SAL_CALL disconnectController( const REFERENCE< XCONTROLLER >& xController ); 636 637 /**___________________________________________________________________________________________________ 638 @short - 639 @descr - 640 641 @seealso - 642 643 @param - 644 645 @return - 646 647 @onerror - 648 */ 649 650 virtual void SAL_CALL lockControllers(); 651 652 /**___________________________________________________________________________________________________ 653 @short - 654 @descr - 655 656 @seealso - 657 658 @param - 659 660 @return - 661 662 @onerror - 663 */ 664 665 virtual void SAL_CALL unlockControllers(); 666 667 /**___________________________________________________________________________________________________ 668 @short - 669 @descr - 670 671 @seealso - 672 673 @param - 674 675 @return - 676 677 @onerror - 678 */ 679 680 virtual sal_Bool SAL_CALL hasControllersLocked(); 681 682 /**___________________________________________________________________________________________________ 683 @short - 684 @descr - 685 686 @seealso - 687 688 @param - 689 690 @return - 691 692 @onerror - 693 */ 694 695 virtual REFERENCE< XCONTROLLER > SAL_CALL getCurrentController(); 696 697 /**___________________________________________________________________________________________________ 698 @short - 699 @descr - 700 701 @seealso - 702 703 @param - 704 705 @return - 706 707 @onerror - 708 */ 709 710 virtual void SAL_CALL setCurrentController( const REFERENCE< XCONTROLLER >& xController ); 711 712 /**___________________________________________________________________________________________________ 713 @short - 714 @descr - 715 716 @seealso - 717 718 @param - 719 720 @return - 721 722 @onerror - 723 */ 724 725 virtual REFERENCE< XINTERFACE > SAL_CALL getCurrentSelection(); 726 727 //____________________________________________________________________________________________________ 728 // XModel2 729 //____________________________________________________________________________________________________ 730 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL getControllers(); 731 732 virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableViewControllerNames(); 733 734 virtual css::uno::Reference< css::frame::XController2 > SAL_CALL createDefaultViewController(const css::uno::Reference< css::frame::XFrame >& Frame ); 735 736 virtual css::uno::Reference< css::frame::XController2 > SAL_CALL createViewController(const ::rtl::OUString& ViewName , 737 const css::uno::Sequence< css::beans::PropertyValue >& Arguments , 738 const css::uno::Reference< css::frame::XFrame >& Frame ); 739 740 //____________________________________________________________________________________________________ 741 // XModifiable2 742 //____________________________________________________________________________________________________ 743 744 virtual ::sal_Bool SAL_CALL disableSetModified( ); 745 virtual ::sal_Bool SAL_CALL enableSetModified( ); 746 virtual ::sal_Bool SAL_CALL isSetModifiedEnabled( ); 747 748 /**___________________________________________________________________________________________________ 749 @short - 750 @descr - 751 752 @seealso - 753 754 @param - 755 756 @return - 757 758 @onerror - 759 */ 760 761 virtual sal_Bool SAL_CALL isModified(); 762 763 /**___________________________________________________________________________________________________ 764 @short - 765 @descr - 766 767 @seealso - 768 769 @param - 770 771 @return - 772 773 @onerror - 774 */ 775 776 virtual void SAL_CALL setModified( sal_Bool bModified ); 777 778 /**___________________________________________________________________________________________________ 779 @short - 780 @descr - 781 782 @seealso - 783 784 @param - 785 786 @return - 787 788 @onerror - 789 */ 790 791 virtual void SAL_CALL addModifyListener( const REFERENCE< XMODIFYLISTENER >& xListener ) ; 792 793 /**___________________________________________________________________________________________________ 794 @short - 795 @descr - 796 797 @seealso - 798 799 @param - 800 801 @return - 802 803 @onerror - 804 */ 805 806 virtual void SAL_CALL removeModifyListener(const REFERENCE< XMODIFYLISTENER > & xListener) ; 807 808 //____________________________________________________________________________________________________ 809 // XCloseable 810 //____________________________________________________________________________________________________ 811 812 virtual void SAL_CALL close( sal_Bool bDeliverOwnership ); 813 814 //____________________________________________________________________________________________________ 815 // XCloseBroadcaster 816 //____________________________________________________________________________________________________ 817 818 virtual void SAL_CALL addCloseListener( const REFERENCE< XCLOSELISTENER >& xListener ); 819 virtual void SAL_CALL removeCloseListener( const REFERENCE< XCLOSELISTENER >& xListener ); 820 821 //____________________________________________________________________________________________________ 822 // XPrintJobBroadcaster 823 //____________________________________________________________________________________________________ 824 825 virtual void SAL_CALL addPrintJobListener( const ::com::sun::star::uno::Reference< ::com::sun::star::view::XPrintJobListener >& xListener ); 826 virtual void SAL_CALL removePrintJobListener( const ::com::sun::star::uno::Reference< ::com::sun::star::view::XPrintJobListener >& xListener ); 827 828 //____________________________________________________________________________________________________ 829 // XPrintable 830 //____________________________________________________________________________________________________ 831 832 /**___________________________________________________________________________________________________ 833 @short - 834 @descr - 835 836 @seealso - 837 838 @param - 839 840 @return - 841 842 @onerror - 843 */ 844 845 virtual ::com::sun::star::uno::Sequence< PROPERTYVALUE > SAL_CALL getPrinter(); 846 847 /**___________________________________________________________________________________________________ 848 @short - 849 @descr - 850 851 @seealso - 852 853 @param - 854 855 @return - 856 857 @onerror - 858 */ 859 860 virtual void SAL_CALL setPrinter( const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& seqPrinter ); 861 /**___________________________________________________________________________________________________ 862 @short - 863 @descr - 864 865 @seealso - 866 867 @param - 868 869 @return - 870 871 @onerror - 872 */ 873 874 virtual void SAL_CALL print( const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& seqOptions ); 875 876 //____________________________________________________________________________________________________ 877 // XStorable2 878 //____________________________________________________________________________________________________ 879 880 virtual void SAL_CALL storeSelf( const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& seqArguments ); 881 882 //____________________________________________________________________________________________________ 883 // XStorable 884 //____________________________________________________________________________________________________ 885 886 /**___________________________________________________________________________________________________ 887 @short - 888 @descr - 889 890 @seealso - 891 892 @param - 893 894 @return - 895 896 @onerror - 897 */ 898 899 virtual sal_Bool SAL_CALL hasLocation(); 900 901 /**___________________________________________________________________________________________________ 902 @short - 903 @descr - 904 905 @seealso - 906 907 @param - 908 909 @return - 910 911 @onerror - 912 */ 913 914 virtual OUSTRING SAL_CALL getLocation(); 915 916 /**___________________________________________________________________________________________________ 917 @short - 918 @descr - 919 920 @seealso - 921 922 @param - 923 924 @return - 925 926 @onerror - 927 */ 928 929 virtual sal_Bool SAL_CALL isReadonly(); 930 931 /**___________________________________________________________________________________________________ 932 @short - 933 @descr - 934 935 @seealso - 936 937 @param - 938 939 @return - 940 941 @onerror - 942 */ 943 944 virtual void SAL_CALL store(); 945 946 /**___________________________________________________________________________________________________ 947 @short - 948 @descr - 949 950 @seealso - 951 952 @param - 953 954 @return - 955 956 @onerror - 957 */ 958 959 virtual void SAL_CALL storeAsURL( const OUSTRING& sURL , 960 const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& seqArguments ) ; 961 962 /**___________________________________________________________________________________________________ 963 @short - 964 @descr - 965 966 @seealso - 967 968 @param - 969 970 @return - 971 972 @onerror - 973 */ 974 975 virtual void SAL_CALL storeToURL( const OUSTRING& sURL , 976 const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& seqArguments ); 977 978 979 980 //____________________________________________________________________________________________________ 981 // XLoadable 982 //____________________________________________________________________________________________________ 983 984 /**___________________________________________________________________________________________________ 985 @short - 986 @descr - 987 988 @seealso - 989 990 @param - 991 992 @return - 993 994 @onerror - 995 */ 996 997 virtual void SAL_CALL initNew(); 998 999 /**___________________________________________________________________________________________________ 1000 @short - 1001 @descr - 1002 1003 @seealso - 1004 1005 @param - 1006 1007 @return - 1008 1009 @onerror - 1010 */ 1011 1012 virtual void SAL_CALL load( const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& seqArguments ); 1013 1014 //____________________________________________________________________________________________________ 1015 // XDocumentSubStorageSupplier 1016 //____________________________________________________________________________________________________ 1017 1018 virtual REFERENCE< XSTORAGE > SAL_CALL getDocumentSubStorage( const ::rtl::OUString& aStorageName, sal_Int32 nMode ); 1019 1020 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getDocumentSubStoragesNames(); 1021 1022 //____________________________________________________________________________________________________ 1023 // XStorageBasedDocument 1024 //____________________________________________________________________________________________________ 1025 1026 virtual void SAL_CALL loadFromStorage( const REFERENCE< XSTORAGE >& xStorage, 1027 const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& aMediaDescriptor ); 1028 1029 virtual void SAL_CALL storeToStorage( const REFERENCE< XSTORAGE >& xStorage, 1030 const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& aMediaDescriptor ); 1031 1032 virtual void SAL_CALL switchToStorage( const REFERENCE< XSTORAGE >& xStorage ); 1033 1034 virtual REFERENCE< XSTORAGE > SAL_CALL getDocumentStorage(); 1035 1036 virtual void SAL_CALL addStorageChangeListener( 1037 const REFERENCE< ::com::sun::star::document::XStorageChangeListener >& xListener ); 1038 1039 virtual void SAL_CALL removeStorageChangeListener( 1040 const REFERENCE< ::com::sun::star::document::XStorageChangeListener >& xListener ); 1041 1042 //____________________________________________________________________________________________________ 1043 // XVisualObject 1044 //____________________________________________________________________________________________________ 1045 1046 virtual void SAL_CALL setVisualAreaSize( sal_Int64 nAspect, const ::com::sun::star::awt::Size& aSize ); 1047 1048 virtual ::com::sun::star::awt::Size SAL_CALL getVisualAreaSize( sal_Int64 nAspect ); 1049 1050 virtual ::com::sun::star::embed::VisualRepresentation SAL_CALL getPreferredVisualRepresentation( ::sal_Int64 nAspect ); 1051 1052 virtual sal_Int32 SAL_CALL getMapUnit( sal_Int64 nAspect ); 1053 1054 //____________________________________________________________________________________________________ 1055 // XScriptProviderSupplier 1056 //____________________________________________________________________________________________________ 1057 1058 virtual REFERENCE< XSCRIPTPROVIDER > SAL_CALL getScriptProvider(); 1059 1060 //____________________________________________________________________________________________________ 1061 // XUIConfigurationManagerSupplier 1062 //____________________________________________________________________________________________________ 1063 virtual REFERENCE< XUICONFIGURATIONMANAGER > SAL_CALL getUIConfigurationManager(); 1064 1065 //____________________________________________________________________________________________________ 1066 // XTransferable 1067 //____________________________________________________________________________________________________ 1068 1069 /**___________________________________________________________________________________________________ 1070 @short - 1071 @descr - 1072 1073 @seealso - 1074 1075 @param - 1076 1077 @return - 1078 1079 @onerror - 1080 */ 1081 1082 virtual ANY SAL_CALL getTransferData( const DATAFLAVOR& aFlavor ); 1083 1084 /**___________________________________________________________________________________________________ 1085 @short - 1086 @descr - 1087 1088 @seealso - 1089 1090 @param - 1091 1092 @return - 1093 1094 @onerror - 1095 */ 1096 1097 1098 virtual ::com::sun::star::uno::Sequence< DATAFLAVOR > SAL_CALL getTransferDataFlavors(); 1099 1100 /**___________________________________________________________________________________________________ 1101 @short - 1102 @descr - 1103 1104 @seealso - 1105 1106 @param - 1107 1108 @return - 1109 1110 @onerror - 1111 */ 1112 1113 virtual sal_Bool SAL_CALL isDataFlavorSupported( const DATAFLAVOR& aFlavor ); 1114 1115 1116 //____________________________________________________________________________________________________ 1117 // XEventsSupplier 1118 //____________________________________________________________________________________________________ 1119 1120 /**___________________________________________________________________________________________________ 1121 @short - 1122 @descr - offers a list of event handlers which are be bound to events of 1123 this object. 1124 @seealso - 1125 1126 @param - 1127 1128 @return - an <type>Events</type> object. 1129 1130 @onerror - 1131 */ 1132 1133 virtual REFERENCE< XNAMEREPLACE > SAL_CALL getEvents(); 1134 1135 1136 //____________________________________________________________________________________________________ 1137 // XEmbeddedScripts 1138 //____________________________________________________________________________________________________ 1139 1140 virtual ::com::sun::star::uno::Reference< ::com::sun::star::script::XStorageBasedLibraryContainer > SAL_CALL getBasicLibraries(); 1141 virtual ::com::sun::star::uno::Reference< ::com::sun::star::script::XStorageBasedLibraryContainer > SAL_CALL getDialogLibraries(); 1142 virtual ::sal_Bool SAL_CALL getAllowMacroExecution(); 1143 1144 //____________________________________________________________________________________________________ 1145 // XScriptInvocationContext 1146 //____________________________________________________________________________________________________ 1147 1148 virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XEmbeddedScripts > SAL_CALL getScriptContainer(); 1149 1150 //____________________________________________________________________________________________________ 1151 // XEventBroadcaster 1152 //____________________________________________________________________________________________________ 1153 1154 /**___________________________________________________________________________________________________ 1155 @short - 1156 @descr - registers the given <type>XEventListener</type>. 1157 1158 @seealso - 1159 1160 @param - 1161 1162 @return - 1163 1164 @onerror - 1165 */ 1166 1167 virtual void SAL_CALL addEventListener( const REFERENCE< XDOCEVENTLISTENER >& xListener ); 1168 1169 /**___________________________________________________________________________________________________ 1170 @short - 1171 @descr - unregisters the given <type>XEventListener</type>. 1172 1173 @seealso - 1174 1175 @param - 1176 1177 @return - 1178 1179 @onerror - 1180 */ 1181 1182 virtual void SAL_CALL removeEventListener( const REFERENCE< XDOCEVENTLISTENER >& xListener ); 1183 1184 //____________________________________________________________________________________________________ 1185 // XDocumentEventBroadcaster 1186 //____________________________________________________________________________________________________ 1187 1188 virtual void SAL_CALL addDocumentEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentEventListener >& _Listener ); 1189 virtual void SAL_CALL removeDocumentEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentEventListener >& _Listener ); 1190 virtual void SAL_CALL notifyDocumentEvent( const ::rtl::OUString& _EventName, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 >& _ViewController, const ::com::sun::star::uno::Any& _Supplement ); 1191 1192 //____________________________________________________________________________________________________ 1193 // XUnoTunnel 1194 //____________________________________________________________________________________________________ 1195 1196 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ); 1197 1198 // css.frame.XModule 1199 virtual void SAL_CALL setIdentifier(const ::rtl::OUString& sIdentifier); 1200 1201 // css.frame.XModule 1202 virtual ::rtl::OUString SAL_CALL getIdentifier(); 1203 1204 // css.frame.XTitle 1205 virtual ::rtl::OUString SAL_CALL getTitle(); 1206 1207 // css.frame.XTitle 1208 virtual void SAL_CALL setTitle( const ::rtl::OUString& sTitle ); 1209 1210 // css.frame.XTitleChangeBroadcaster 1211 virtual void SAL_CALL addTitleChangeListener( const css::uno::Reference< css::frame::XTitleChangeListener >& xListener ); 1212 1213 // css.frame.XTitleChangeBroadcaster 1214 virtual void SAL_CALL removeTitleChangeListener( const css::uno::Reference< css::frame::XTitleChangeListener >& xListener ); 1215 1216 // css.frame.XUntitledNumbers 1217 virtual ::sal_Int32 SAL_CALL leaseNumber( const css::uno::Reference< css::uno::XInterface >& xComponent ); 1218 1219 // css.frame.XUntitledNumbers 1220 virtual void SAL_CALL releaseNumber( ::sal_Int32 nNumber ); 1221 1222 // css.frame.XUntitledNumbers 1223 virtual void SAL_CALL releaseNumberForComponent( const css::uno::Reference< css::uno::XInterface >& xComponent ); 1224 1225 // css.frame.XUntitledNumbers 1226 virtual ::rtl::OUString SAL_CALL getUntitledPrefix(); 1227 1228 // css.document.XDocumentRecovery 1229 virtual ::sal_Bool SAL_CALL wasModifiedSinceLastSave(); 1230 virtual void SAL_CALL storeToRecoveryFile( const ::rtl::OUString& i_TargetLocation, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_MediaDescriptor ); 1231 virtual void SAL_CALL recoverFromFile( const ::rtl::OUString& i_SourceLocation, const ::rtl::OUString& i_SalvagedFile, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_MediaDescriptor ); 1232 1233 // css.document.XUndoManagerSupplier 1234 virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > SAL_CALL getUndoManager( ); 1235 1236 //____________________________________________________________________________________________________ 1237 1238 // ::com::sun::star::rdf::XNode: 1239 virtual ::rtl::OUString SAL_CALL getStringValue(); 1240 1241 // ::com::sun::star::rdf::XURI: 1242 virtual ::rtl::OUString SAL_CALL getNamespace(); 1243 virtual ::rtl::OUString SAL_CALL getLocalName(); 1244 1245 // ::com::sun::star::rdf::XRepositorySupplier: 1246 virtual ::com::sun::star::uno::Reference< 1247 ::com::sun::star::rdf::XRepository > SAL_CALL getRDFRepository(); 1248 1249 // ::com::sun::star::rdf::XDocumentMetadataAccess: 1250 virtual ::com::sun::star::uno::Reference< 1251 ::com::sun::star::rdf::XMetadatable > SAL_CALL 1252 getElementByMetadataReference( 1253 const ::com::sun::star::beans::StringPair & i_rReference); 1254 virtual ::com::sun::star::uno::Reference< 1255 ::com::sun::star::rdf::XMetadatable > SAL_CALL 1256 getElementByURI(const ::com::sun::star::uno::Reference< 1257 ::com::sun::star::rdf::XURI > & i_xURI); 1258 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< 1259 ::com::sun::star::rdf::XURI > > SAL_CALL getMetadataGraphsWithType( 1260 const ::com::sun::star::uno::Reference< 1261 ::com::sun::star::rdf::XURI > & i_xType); 1262 virtual ::com::sun::star::uno::Reference< 1263 ::com::sun::star::rdf::XURI> SAL_CALL 1264 addMetadataFile(const ::rtl::OUString & i_rFileName, 1265 const ::com::sun::star::uno::Sequence< 1266 ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XURI > 1267 > & i_rTypes); 1268 virtual ::com::sun::star::uno::Reference< 1269 ::com::sun::star::rdf::XURI> SAL_CALL 1270 importMetadataFile(::sal_Int16 i_Format, 1271 const ::com::sun::star::uno::Reference< 1272 ::com::sun::star::io::XInputStream > & i_xInStream, 1273 const ::rtl::OUString & i_rFileName, 1274 const ::com::sun::star::uno::Reference< 1275 ::com::sun::star::rdf::XURI > & i_xBaseURI, 1276 const ::com::sun::star::uno::Sequence< 1277 ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XURI > 1278 > & i_rTypes); 1279 virtual void SAL_CALL removeMetadataFile( 1280 const ::com::sun::star::uno::Reference< 1281 ::com::sun::star::rdf::XURI > & i_xGraphName); 1282 virtual void SAL_CALL addContentOrStylesFile( 1283 const ::rtl::OUString & i_rFileName); 1284 virtual void SAL_CALL removeContentOrStylesFile( 1285 const ::rtl::OUString & i_rFileName); 1286 1287 virtual void SAL_CALL loadMetadataFromStorage( 1288 const ::com::sun::star::uno::Reference< 1289 ::com::sun::star::embed::XStorage > & i_xStorage, 1290 const ::com::sun::star::uno::Reference< 1291 ::com::sun::star::rdf::XURI > & i_xBaseURI, 1292 const ::com::sun::star::uno::Reference< 1293 ::com::sun::star::task::XInteractionHandler> & i_xHandler); 1294 virtual void SAL_CALL storeMetadataToStorage( 1295 const ::com::sun::star::uno::Reference< 1296 ::com::sun::star::embed::XStorage > & i_xStorage); 1297 virtual void SAL_CALL loadMetadataFromMedium( 1298 const ::com::sun::star::uno::Sequence< 1299 ::com::sun::star::beans::PropertyValue > & i_rMedium); 1300 virtual void SAL_CALL storeMetadataToMedium( 1301 const ::com::sun::star::uno::Sequence< 1302 ::com::sun::star::beans::PropertyValue > & i_rMedium); 1303 1304 1305 //____________________________________________________________________________________________________ 1306 // SfxListener 1307 //____________________________________________________________________________________________________ 1308 1309 /**___________________________________________________________________________________________________ 1310 @short - 1311 @descr - 1312 1313 @seealso - 1314 1315 @param - 1316 1317 @return - 1318 1319 @onerror - 1320 */ 1321 1322 void Notify( SfxBroadcaster& aBC , 1323 const SfxHint& aHint ) ; 1324 1325 //____________________________________________________________________________________________________ 1326 // public IMPL? 1327 //____________________________________________________________________________________________________ 1328 1329 /**___________________________________________________________________________________________________ 1330 @short - 1331 @descr - 1332 1333 @seealso - 1334 1335 @param - 1336 1337 @return - 1338 1339 @onerror - 1340 */ 1341 1342 void changing() ; 1343 SAL_DLLPRIVATE void impl_change() ; 1344 1345 /**___________________________________________________________________________________________________ 1346 @short - 1347 @descr - 1348 1349 @seealso - 1350 1351 @param - 1352 1353 @return - 1354 1355 @onerror - 1356 */ 1357 1358 SfxObjectShell* GetObjectShell() const ; 1359 SAL_DLLPRIVATE SfxObjectShell* impl_getObjectShell() const ; 1360 1361 SAL_DLLPRIVATE sal_Bool impl_isDisposed() const ; 1362 sal_Bool IsInitialized() const; IsDisposed() const1363 sal_Bool IsDisposed() const { return impl_isDisposed(); } 1364 void MethodEntryCheck( const bool i_mustBeInitialized ) const; getMutex() const1365 ::osl::Mutex& getMutex() const { return m_aMutex; } 1366 1367 ::com::sun::star::uno::Reference < ::com::sun::star::container::XIndexAccess > SAL_CALL getViewData(); 1368 void SAL_CALL setViewData( const ::com::sun::star::uno::Reference < ::com::sun::star::container::XIndexAccess >& aData ); 1369 1370 /** calls all XEventListeners */ 1371 void notifyEvent( const ::com::sun::star::document::EventObject& aEvent ) const; 1372 1373 /** returns true if someone added a XEventListener to this XEventBroadcaster */ 1374 sal_Bool hasEventListeners() const; 1375 1376 protected: 1377 1378 /* returns a unique id for the model that is valid as long as the document 1379 is loaded. The id is not saved across document close/reload. */ 1380 rtl::OUString getRuntimeUID() const; 1381 1382 /* returns true if the document signatures are valid, otherwise false */ 1383 sal_Bool hasValidSignatures() const; 1384 1385 //________________________________________________________________________________________________________ 1386 // private methods 1387 //________________________________________________________________________________________________________ 1388 1389 private: 1390 1391 /**___________________________________________________________________________________________________ 1392 @short - 1393 @descr - 1394 1395 @seealso - 1396 1397 @param - 1398 1399 @return - 1400 1401 @onerror - 1402 */ 1403 1404 bool impl_getPrintHelper(); 1405 SAL_DLLPRIVATE void ListenForStorage_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage ); 1406 SAL_DLLPRIVATE ::rtl::OUString GetMediumFilterName_Impl(); 1407 1408 SAL_DLLPRIVATE void impl_store( const OUSTRING& sURL , 1409 const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& seqArguments , 1410 sal_Bool bSaveTo ) ; 1411 1412 SAL_DLLPRIVATE void postEvent_Impl( const ::rtl::OUString& aName, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 >& xController = ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 >() ); 1413 1414 SAL_DLLPRIVATE String getEventName_Impl( long nID ); 1415 SAL_DLLPRIVATE void NotifyStorageListeners_Impl(); 1416 SAL_DLLPRIVATE bool QuerySaveSizeExceededModules( const com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler >& xHandler ); 1417 1418 SAL_DLLPRIVATE css::uno::Reference< css::frame::XTitle > impl_getTitleHelper (); 1419 SAL_DLLPRIVATE css::uno::Reference< css::frame::XUntitledNumbers > impl_getUntitledHelper (); 1420 1421 SAL_DLLPRIVATE SfxViewFrame* FindOrCreateViewFrame_Impl( 1422 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, 1423 ::sfx::intern::ViewCreationGuard& i_rGuard 1424 ) const; 1425 1426 SAL_DLLPRIVATE void NotifyModifyListeners_Impl() const; 1427 1428 //________________________________________________________________________________________________________ 1429 // private variables and methods 1430 //________________________________________________________________________________________________________ 1431 1432 private: 1433 1434 IMPL_SfxBaseModel_DataContainer* m_pData ; 1435 // cannot be held in m_pData, since it needs to be accessed in non-threadsafe context 1436 const bool m_bSupportEmbeddedScripts; 1437 const bool m_bSupportDocRecovery; 1438 1439 } ; // class SfxBaseModel 1440 1441 /** base class for sub components of an SfxBaseModel, which share their ref count and lifetime with the SfxBaseModel 1442 */ 1443 class SFX2_DLLPUBLIC SfxModelSubComponent 1444 { 1445 public: 1446 /** checks whether the instance is alive, i.e. properly initialized, and not yet disposed 1447 */ MethodEntryCheck()1448 void MethodEntryCheck() 1449 { 1450 m_rModel.MethodEntryCheck( true ); 1451 } 1452 1453 // called when the SfxBaseModel which the component is superordinate of is being disposed 1454 virtual void disposing(); 1455 1456 protected: SfxModelSubComponent(SfxBaseModel & i_model)1457 SfxModelSubComponent( SfxBaseModel& i_model ) 1458 :m_rModel( i_model ) 1459 { 1460 } 1461 virtual ~SfxModelSubComponent(); 1462 1463 // helpers for implementing XInterface - delegates ref counting to the SfxBaseModel acquire()1464 void acquire() { m_rModel.acquire(); } release()1465 void release() { m_rModel.release(); } 1466 isDisposed() const1467 bool isDisposed() const { return m_rModel.IsDisposed(); } 1468 1469 protected: getBaseModel() const1470 const SfxBaseModel& getBaseModel() const { return m_rModel; } getBaseModel()1471 SfxBaseModel& getBaseModel() { return m_rModel; } 1472 getMutex()1473 ::osl::Mutex& getMutex() { return m_rModel.getMutex(); } 1474 1475 private: 1476 SfxBaseModel& m_rModel; 1477 }; 1478 1479 class SFX2_DLLPUBLIC SfxModelGuard 1480 { 1481 public: 1482 enum AllowedModelState 1483 { 1484 // not yet initialized 1485 E_INITIALIZING, 1486 // fully alive, i.e. initialized, and not yet disposed 1487 E_FULLY_ALIVE 1488 }; 1489 SfxModelGuard(SfxBaseModel & i_rModel,const AllowedModelState i_eState=E_FULLY_ALIVE)1490 SfxModelGuard( SfxBaseModel& i_rModel, const AllowedModelState i_eState = E_FULLY_ALIVE ) 1491 :m_aGuard( Application::GetSolarMutex() ) 1492 { 1493 i_rModel.MethodEntryCheck( i_eState != E_INITIALIZING ); 1494 } SfxModelGuard(SfxModelSubComponent & i_rSubComponent)1495 SfxModelGuard( SfxModelSubComponent& i_rSubComponent ) 1496 :m_aGuard( Application::GetSolarMutex() ) 1497 { 1498 i_rSubComponent.MethodEntryCheck(); 1499 } ~SfxModelGuard()1500 ~SfxModelGuard() 1501 { 1502 } 1503 reset()1504 void reset() 1505 { 1506 m_aGuard.reset(); 1507 } 1508 clear()1509 void clear() 1510 { 1511 m_aGuard.clear(); 1512 } 1513 1514 private: 1515 ::osl::ResettableGuard< ::vos::IMutex > m_aGuard; 1516 }; 1517 1518 #undef css 1519 1520 #endif // _SFX_SFXBASEMODEL_HXX_ 1521