bump product version to 4.1.6.2
[LibreOffice.git] / include / sfx2 / sfxbasemodel.hxx
blob524c86b0b99dd9fb3234beeb99d1f59444177655
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef _SFX_SFXBASEMODEL_HXX_
21 #define _SFX_SFXBASEMODEL_HXX_
23 #include "sal/config.h"
24 #include "sfx2/dllapi.h"
25 #include "sal/types.h"
26 #include <com/sun/star/lang/XTypeProvider.hpp>
27 #include <com/sun/star/frame/XModule.hpp>
28 #include <com/sun/star/frame/XTitle.hpp>
29 #include <com/sun/star/frame/XTitleChangeBroadcaster.hpp>
30 #include <com/sun/star/frame/XUntitledNumbers.hpp>
31 #include <com/sun/star/container/XChild.hpp>
32 #include <com/sun/star/container/XNameContainer.hpp>
33 #include <com/sun/star/container/XNameReplace.hpp>
34 #include <com/sun/star/frame/XController2.hpp>
35 #include <com/sun/star/document/XCmisDocument.hpp>
36 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
37 #include <com/sun/star/document/XDocumentRecovery.hpp>
38 #include <com/sun/star/document/XUndoManagerSupplier.hpp>
39 #include <com/sun/star/rdf/XDocumentMetadataAccess.hpp>
40 #include <com/sun/star/document/XEventBroadcaster.hpp>
41 #include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
42 #include <com/sun/star/document/XEventListener.hpp>
43 #include <com/sun/star/document/XEventsSupplier.hpp>
44 #include <com/sun/star/document/XEmbeddedScripts.hpp>
45 #include <com/sun/star/document/EventObject.hpp>
46 #include <com/sun/star/document/XDocumentSubStorageSupplier.hpp>
47 #include <com/sun/star/document/XStorageBasedDocument.hpp>
48 #include <com/sun/star/document/XScriptInvocationContext.hpp>
49 #include <com/sun/star/lang/XEventListener.hpp>
50 #include <com/sun/star/lang/NotInitializedException.hpp>
51 #include <com/sun/star/lang/DisposedException.hpp>
52 #include <com/sun/star/frame/XModel2.hpp>
53 #include <com/sun/star/frame/DoubleInitializationException.hpp>
54 #include <com/sun/star/util/XModifiable2.hpp>
55 #include <com/sun/star/util/XModifyListener.hpp>
56 #include <com/sun/star/util/XCloseable.hpp>
57 #include <com/sun/star/util/XCloseBroadcaster.hpp>
58 #include <com/sun/star/util/XCloseListener.hpp>
59 #include <com/sun/star/util/CloseVetoException.hpp>
60 #include <com/sun/star/view/XPrintable.hpp>
61 #include <com/sun/star/view/XPrintJobBroadcaster.hpp>
62 #include <com/sun/star/frame/XStorable.hpp>
63 #include <com/sun/star/frame/XStorable2.hpp>
64 #include <com/sun/star/frame/XLoadable.hpp>
65 #include <com/sun/star/beans/PropertyValue.hpp>
66 #include <com/sun/star/lang/EventObject.hpp>
67 #include <com/sun/star/datatransfer/XTransferable.hpp>
68 #include <com/sun/star/script/provider/XScriptProviderSupplier.hpp>
69 #include <com/sun/star/ui/XUIConfigurationManager2.hpp>
70 #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
71 #include <com/sun/star/embed/XVisualObject.hpp>
72 #include <com/sun/star/uno/Sequence.hxx>
73 #include <com/sun/star/uno/Reference.hxx>
74 #include <com/sun/star/uno/Any.hxx>
75 #include <cppuhelper/weak.hxx>
76 #include <cppuhelper/basemutex.hxx>
77 #include <cppuhelper/typeprovider.hxx>
78 #include <com/sun/star/script/XStarBasicAccess.hpp>
79 #include <osl/mutex.hxx>
80 #include <vcl/svapp.hxx>
82 #include <com/sun/star/document/XViewDataSupplier.hpp>
83 #include <com/sun/star/lang/XUnoTunnel.hpp>
84 #include <com/sun/star/task/XInteractionHandler.hpp>
86 #ifndef INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_32
87 #define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_32
88 #define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 32
89 #include <comphelper/implbase_var.hxx>
90 #endif
92 #include <svl/lstner.hxx>
94 class SfxMedium;
95 class SfxPrinter;
96 class SfxViewShell;
97 class SfxObjectShell ;
98 class SfxEventHint;
99 class SfxViewFrame;
100 struct IMPL_SfxBaseModel_DataContainer ; // impl. struct to hold member of class SfxBaseModel
102 namespace sfx { namespace intern {
103 class ViewCreationGuard;
105 //________________________________________________________________________________________________________
106 // class declarations
107 //________________________________________________________________________________________________________
109 /**_______________________________________________________________________________________________________
110 @short -
112 @descr -
114 @implements XChild
115 XComponent
116 document::XDocumentPropertiesSupplier
117 rdf::XDocumentMetadataAccess
118 XEventListener
119 XModel
120 XModifiable2
121 XPrintable
122 XStorable2
123 document::XEventBroadcaster
124 document::XEventsSupplier
125 document::XEmbeddedScripts
126 document::XScriptInvocationContext
127 XCloseable
128 XCloseBroadcaster
130 @base cppu::BaseMutex
131 SfxListener
134 typedef ::comphelper::WeakImplHelper32 < css::container::XChild
135 , css::document::XDocumentPropertiesSupplier
136 , css::document::XCmisDocument
137 , css::rdf::XDocumentMetadataAccess
138 , css::document::XDocumentRecovery
139 , css::document::XUndoManagerSupplier
140 , css::document::XEventBroadcaster
141 , css::document::XDocumentEventBroadcaster
142 , css::lang::XEventListener
143 , css::document::XEventsSupplier
144 , css::document::XEmbeddedScripts
145 , css::document::XScriptInvocationContext
146 , css::frame::XModel2
147 , css::util::XModifiable2
148 , css::view::XPrintable
149 , css::view::XPrintJobBroadcaster
150 , css::frame::XStorable2
151 , css::frame::XLoadable
152 , css::script::XStarBasicAccess
153 , css::document::XViewDataSupplier
154 , css::util::XCloseable // => css::util::XCloseBroadcaster
155 , css::datatransfer::XTransferable
156 , css::document::XDocumentSubStorageSupplier
157 , css::document::XStorageBasedDocument
158 , css::script::provider::XScriptProviderSupplier
159 , css::ui::XUIConfigurationManagerSupplier
160 , css::embed::XVisualObject
161 , css::lang::XUnoTunnel
162 , css::frame::XModule
163 , css::frame::XTitle
164 , css::frame::XTitleChangeBroadcaster
165 , css::frame::XUntitledNumbers
166 > SfxBaseModel_Base;
168 class SFX2_DLLPUBLIC SfxBaseModel : protected ::cppu::BaseMutex
169 , public SfxBaseModel_Base
170 , public SfxListener
173 //________________________________________________________________________________________________________
174 // public methods
175 //________________________________________________________________________________________________________
177 public:
179 //____________________________________________________________________________________________________
180 // constructor/destructor
181 //____________________________________________________________________________________________________
183 /**___________________________________________________________________________________________________
184 @short -
185 @descr -
187 @seealso -
189 @param -
191 @return -
193 @onerror -
196 SfxBaseModel( SfxObjectShell *pObjektShell = NULL ) ;
198 /**___________________________________________________________________________________________________
199 @short -
200 @descr -
202 @seealso -
204 @param -
206 @return -
208 @onerror -
211 virtual ~SfxBaseModel() ;
213 //____________________________________________________________________________________________________
214 // XInterface
215 //____________________________________________________________________________________________________
217 /**___________________________________________________________________________________________________
218 @short give answer, if interface is supported
219 @descr The interfaces are searched by type.
221 @seealso XInterface
223 @param "rType" is the type of searched interface.
225 @return Any information about found interface
227 @onerror A RuntimeException is thrown.
230 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) throw( css::uno::RuntimeException ) ;
232 /**___________________________________________________________________________________________________
233 @short increment refcount
234 @descr -
236 @seealso XInterface
237 @seealso release()
239 @param -
241 @return -
243 @onerror A RuntimeException is thrown.
246 virtual void SAL_CALL acquire() throw() ;
248 /**___________________________________________________________________________________________________
249 @short decrement refcount
250 @descr -
252 @seealso XInterface
253 @seealso acquire()
255 @param -
257 @return -
259 @onerror A RuntimeException is thrown.
262 virtual void SAL_CALL release() throw() ;
264 //____________________________________________________________________________________________________
265 // XTypeProvider
266 //____________________________________________________________________________________________________
268 /**___________________________________________________________________________________________________
269 @short get information about supported interfaces
270 @descr -
272 @seealso XTypeProvider
274 @param -
276 @return Sequence of types of all supported interfaces
278 @onerror A RuntimeException is thrown.
281 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() throw( css::uno::RuntimeException ) ;
283 /**___________________________________________________________________________________________________
284 @short get implementation id
285 @descr This ID is neccessary for UNO-caching. If there no ID, cache is disabled.
286 Another way, cache is enabled.
288 @seealso XTypeProvider
290 @param -
292 @return ID as Sequence of byte
294 @onerror A RuntimeException is thrown.
297 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw( css::uno::RuntimeException ) ;
300 //____________________________________________________________________________________________________
301 // XStarBasicAccess
302 //____________________________________________________________________________________________________
304 /**___________________________________________________________________________________________________
305 @seealso XStarBasicAccess
307 virtual css::uno::Reference< css::container::XNameContainer > SAL_CALL getLibraryContainer() throw( css::uno::RuntimeException );
309 /**___________________________________________________________________________________________________
310 @seealso XStarBasicAccess
312 virtual void SAL_CALL createLibrary( const OUString& LibName, const OUString& Password,
313 const OUString& ExternalSourceURL, const OUString& LinkTargetURL )
314 throw(css::container::ElementExistException, css::uno::RuntimeException);
316 /**___________________________________________________________________________________________________
317 @seealso XStarBasicAccess
319 virtual void SAL_CALL addModule( const OUString& LibraryName, const OUString& ModuleName,
320 const OUString& Language, const OUString& Source )
321 throw( css::container::NoSuchElementException, css::uno::RuntimeException);
323 /**___________________________________________________________________________________________________
324 @seealso XStarBasicAccess
326 virtual void SAL_CALL addDialog( const OUString& LibraryName, const OUString& DialogName,
327 const css::uno::Sequence< sal_Int8 >& Data )
328 throw(css::container::NoSuchElementException, css::uno::RuntimeException);
331 //____________________________________________________________________________________________________
332 // XChild
333 //____________________________________________________________________________________________________
335 /**___________________________________________________________________________________________________
336 @short -
337 @descr -
339 @seealso -
341 @param -
343 @return -
345 @onerror -
348 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() throw( css::uno::RuntimeException ) ;
350 /**___________________________________________________________________________________________________
351 @short -
352 @descr -
354 @seealso -
356 @param -
358 @return -
360 @onerror -
363 virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& xParent ) throw(css::lang::NoSupportException,
364 css::uno::RuntimeException);
366 //____________________________________________________________________________________________________
367 // XComponent
368 //____________________________________________________________________________________________________
370 /**___________________________________________________________________________________________________
371 @short -
372 @descr -
374 @seealso -
376 @param -
378 @return -
380 @onerror -
383 virtual void SAL_CALL dispose() throw (css::uno::RuntimeException);
385 /**___________________________________________________________________________________________________
386 @short -
387 @descr -
389 @seealso -
391 @param -
393 @return -
395 @onerror -
398 virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener >& aListener) throw (css::uno::RuntimeException);
400 /**___________________________________________________________________________________________________
401 @short -
402 @descr -
404 @seealso -
406 @param -
408 @return -
410 @onerror -
413 virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener >& aListener ) throw (css::uno::RuntimeException);
415 // XDocumentPropertiesSupplier
416 virtual css::uno::Reference< css::document::XDocumentProperties >
417 SAL_CALL getDocumentProperties()
418 throw (css::uno::RuntimeException);
420 //____________________________________________________________________________________________________
421 // XEventListener
422 //____________________________________________________________________________________________________
424 /**___________________________________________________________________________________________________
425 @short -
426 @descr -
428 @seealso -
430 @param -
432 @return -
434 @onerror -
437 virtual void SAL_CALL disposing( const css::lang::EventObject& aEvent ) throw (css::uno::RuntimeException);
439 //____________________________________________________________________________________________________
440 // XModel
441 //____________________________________________________________________________________________________
443 /**___________________________________________________________________________________________________
444 @short -
445 @descr -
447 @seealso -
449 @param -
451 @return -
453 @onerror -
456 virtual sal_Bool SAL_CALL attachResource(const OUString& sURL,
457 const css::uno::Sequence< css::beans::PropertyValue >& aArgs)
458 throw (css::uno::RuntimeException);
460 /**___________________________________________________________________________________________________
461 @short -
462 @descr -
464 @seealso -
466 @param -
468 @return -
470 @onerror -
473 virtual OUString SAL_CALL getURL() throw (css::uno::RuntimeException);
475 /**___________________________________________________________________________________________________
476 @short -
477 @descr -
479 @seealso -
481 @param -
483 @return -
485 @onerror -
488 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getArgs() throw (css::uno::RuntimeException);
490 /**___________________________________________________________________________________________________
491 @short -
492 @descr -
494 @seealso -
496 @param -
498 @return -
500 @onerror -
503 virtual void SAL_CALL connectController( const css::uno::Reference< css::frame::XController >& xController ) throw (css::uno::RuntimeException);
505 /**___________________________________________________________________________________________________
506 @short -
507 @descr -
509 @seealso -
511 @param -
513 @return -
515 @onerror -
518 virtual void SAL_CALL disconnectController( const css::uno::Reference< css::frame::XController >& xController ) throw (css::uno::RuntimeException);
520 /**___________________________________________________________________________________________________
521 @short -
522 @descr -
524 @seealso -
526 @param -
528 @return -
530 @onerror -
533 virtual void SAL_CALL lockControllers() throw (css::uno::RuntimeException);
535 /**___________________________________________________________________________________________________
536 @short -
537 @descr -
539 @seealso -
541 @param -
543 @return -
545 @onerror -
548 virtual void SAL_CALL unlockControllers() throw (css::uno::RuntimeException);
550 /**___________________________________________________________________________________________________
551 @short -
552 @descr -
554 @seealso -
556 @param -
558 @return -
560 @onerror -
563 virtual sal_Bool SAL_CALL hasControllersLocked() throw (css::uno::RuntimeException);
565 /**___________________________________________________________________________________________________
566 @short -
567 @descr -
569 @seealso -
571 @param -
573 @return -
575 @onerror -
578 virtual css::uno::Reference< css::frame::XController > SAL_CALL getCurrentController() throw (css::uno::RuntimeException);
580 /**___________________________________________________________________________________________________
581 @short -
582 @descr -
584 @seealso -
586 @param -
588 @return -
590 @onerror -
593 virtual void SAL_CALL setCurrentController( const css::uno::Reference< css::frame::XController >& xController )
594 throw (css::container::NoSuchElementException, css::uno::RuntimeException);
596 /**___________________________________________________________________________________________________
597 @short -
598 @descr -
600 @seealso -
602 @param -
604 @return -
606 @onerror -
609 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getCurrentSelection() throw (css::uno::RuntimeException);
611 //____________________________________________________________________________________________________
612 // XModel2
613 //____________________________________________________________________________________________________
614 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL getControllers()
615 throw (css::uno::RuntimeException);
617 virtual css::uno::Sequence< OUString > SAL_CALL getAvailableViewControllerNames()
618 throw (css::uno::RuntimeException);
620 virtual css::uno::Reference< css::frame::XController2 > SAL_CALL createDefaultViewController(const css::uno::Reference< css::frame::XFrame >& Frame )
621 throw (css::uno::RuntimeException ,
622 css::lang::IllegalArgumentException,
623 css::uno::Exception );
625 virtual css::uno::Reference< css::frame::XController2 > SAL_CALL createViewController(const OUString& ViewName ,
626 const css::uno::Sequence< css::beans::PropertyValue >& Arguments ,
627 const css::uno::Reference< css::frame::XFrame >& Frame )
628 throw (css::uno::RuntimeException ,
629 css::lang::IllegalArgumentException,
630 css::uno::Exception );
632 //____________________________________________________________________________________________________
633 // XModifiable2
634 //____________________________________________________________________________________________________
636 virtual ::sal_Bool SAL_CALL disableSetModified( ) throw (css::uno::RuntimeException);
637 virtual ::sal_Bool SAL_CALL enableSetModified( ) throw (css::uno::RuntimeException);
638 virtual ::sal_Bool SAL_CALL isSetModifiedEnabled( ) throw (css::uno::RuntimeException);
640 /**___________________________________________________________________________________________________
641 @short -
642 @descr -
644 @seealso -
646 @param -
648 @return -
650 @onerror -
653 virtual sal_Bool SAL_CALL isModified() throw (css::uno::RuntimeException);
655 /**___________________________________________________________________________________________________
656 @short -
657 @descr -
659 @seealso -
661 @param -
663 @return -
665 @onerror -
668 virtual void SAL_CALL setModified( sal_Bool bModified )
669 throw (css::beans::PropertyVetoException, css::uno::RuntimeException);
671 /**___________________________________________________________________________________________________
672 @short -
673 @descr -
675 @seealso -
677 @param -
679 @return -
681 @onerror -
684 virtual void SAL_CALL addModifyListener( const css::uno::Reference< css::util::XModifyListener >& xListener ) throw( css::uno::RuntimeException ) ;
686 /**___________________________________________________________________________________________________
687 @short -
688 @descr -
690 @seealso -
692 @param -
694 @return -
696 @onerror -
699 virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener > & xListener) throw( css::uno::RuntimeException ) ;
701 //____________________________________________________________________________________________________
702 // XCloseable
703 //____________________________________________________________________________________________________
705 virtual void SAL_CALL close( sal_Bool bDeliverOwnership ) throw (css::util::CloseVetoException, css::uno::RuntimeException);
707 //____________________________________________________________________________________________________
708 // XCloseBroadcaster
709 //____________________________________________________________________________________________________
711 virtual void SAL_CALL addCloseListener( const css::uno::Reference< css::util::XCloseListener >& xListener ) throw (css::uno::RuntimeException);
712 virtual void SAL_CALL removeCloseListener( const css::uno::Reference< css::util::XCloseListener >& xListener ) throw (css::uno::RuntimeException);
714 //____________________________________________________________________________________________________
715 // XPrintJobBroadcaster
716 //____________________________________________________________________________________________________
718 virtual void SAL_CALL addPrintJobListener( const css::uno::Reference< css::view::XPrintJobListener >& xListener ) throw (css::uno::RuntimeException);
719 virtual void SAL_CALL removePrintJobListener( const css::uno::Reference< css::view::XPrintJobListener >& xListener ) throw (css::uno::RuntimeException);
721 //____________________________________________________________________________________________________
722 // XPrintable
723 //____________________________________________________________________________________________________
725 /**___________________________________________________________________________________________________
726 @short -
727 @descr -
729 @seealso -
731 @param -
733 @return -
735 @onerror -
738 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getPrinter() throw (css::uno::RuntimeException);
740 /**___________________________________________________________________________________________________
741 @short -
742 @descr -
744 @seealso -
746 @param -
748 @return -
750 @onerror -
753 virtual void SAL_CALL setPrinter( const css::uno::Sequence< css::beans::PropertyValue >& seqPrinter )
754 throw (css::lang::IllegalArgumentException, css::uno::RuntimeException);
755 /**___________________________________________________________________________________________________
756 @short -
757 @descr -
759 @seealso -
761 @param -
763 @return -
765 @onerror -
768 virtual void SAL_CALL print( const css::uno::Sequence< css::beans::PropertyValue >& seqOptions )
769 throw (css::lang::IllegalArgumentException, css::uno::RuntimeException);
771 //____________________________________________________________________________________________________
772 // XStorable2
773 //____________________________________________________________________________________________________
775 virtual void SAL_CALL storeSelf( const css::uno::Sequence< css::beans::PropertyValue >& seqArguments )
776 throw (css::lang::IllegalArgumentException, css::io::IOException, css::uno::RuntimeException);
778 //____________________________________________________________________________________________________
779 // XStorable
780 //____________________________________________________________________________________________________
782 /**___________________________________________________________________________________________________
783 @short -
784 @descr -
786 @seealso -
788 @param -
790 @return -
792 @onerror -
795 virtual sal_Bool SAL_CALL hasLocation() throw (css::uno::RuntimeException);
797 /**___________________________________________________________________________________________________
798 @short -
799 @descr -
801 @seealso -
803 @param -
805 @return -
807 @onerror -
810 virtual OUString SAL_CALL getLocation() throw (css::uno::RuntimeException);
812 /**___________________________________________________________________________________________________
813 @short -
814 @descr -
816 @seealso -
818 @param -
820 @return -
822 @onerror -
825 virtual sal_Bool SAL_CALL isReadonly() throw (css::uno::RuntimeException);
827 /**___________________________________________________________________________________________________
828 @short -
829 @descr -
831 @seealso -
833 @param -
835 @return -
837 @onerror -
840 virtual void SAL_CALL store() throw (css::io::IOException, css::uno::RuntimeException);
842 /**___________________________________________________________________________________________________
843 @short -
844 @descr -
846 @seealso -
848 @param -
850 @return -
852 @onerror -
855 virtual void SAL_CALL storeAsURL( const OUString& sURL,
856 const css::uno::Sequence< css::beans::PropertyValue >& seqArguments )
857 throw (css::io::IOException, css::uno::RuntimeException) ;
859 /**___________________________________________________________________________________________________
860 @short -
861 @descr -
863 @seealso -
865 @param -
867 @return -
869 @onerror -
872 virtual void SAL_CALL storeToURL( const OUString& sURL,
873 const css::uno::Sequence< css::beans::PropertyValue >& seqArguments )
874 throw (css::io::IOException, css::uno::RuntimeException);
878 //____________________________________________________________________________________________________
879 // XLoadable
880 //____________________________________________________________________________________________________
882 /**___________________________________________________________________________________________________
883 @short -
884 @descr -
886 @seealso -
888 @param -
890 @return -
892 @onerror -
895 virtual void SAL_CALL initNew()
896 throw (css::frame::DoubleInitializationException,
897 css::io::IOException,
898 css::uno::RuntimeException,
899 css::uno::Exception);
901 /**___________________________________________________________________________________________________
902 @short -
903 @descr -
905 @seealso -
907 @param -
909 @return -
911 @onerror -
914 virtual void SAL_CALL load( const css::uno::Sequence< css::beans::PropertyValue >& seqArguments )
915 throw (css::frame::DoubleInitializationException,
916 css::io::IOException,
917 css::uno::RuntimeException,
918 css::uno::Exception);
920 //____________________________________________________________________________________________________
921 // XDocumentSubStorageSupplier
922 //____________________________________________________________________________________________________
924 virtual css::uno::Reference< css::embed::XStorage > SAL_CALL getDocumentSubStorage( const OUString& aStorageName, sal_Int32 nMode )
925 throw ( css::uno::RuntimeException );
927 virtual css::uno::Sequence< OUString > SAL_CALL getDocumentSubStoragesNames()
928 throw ( css::io::IOException, css::uno::RuntimeException );
930 //____________________________________________________________________________________________________
931 // XStorageBasedDocument
932 //____________________________________________________________________________________________________
934 virtual void SAL_CALL loadFromStorage( const css::uno::Reference< css::embed::XStorage >& xStorage,
935 const css::uno::Sequence< css::beans::PropertyValue >& aMediaDescriptor )
936 throw ( css::lang::IllegalArgumentException,
937 com::sun::star::frame::DoubleInitializationException,
938 css::io::IOException,
939 css::uno::Exception,
940 css::uno::RuntimeException );
942 virtual void SAL_CALL storeToStorage( const css::uno::Reference< css::embed::XStorage >& xStorage,
943 const css::uno::Sequence< css::beans::PropertyValue >& aMediaDescriptor )
944 throw ( css::lang::IllegalArgumentException,
945 css::io::IOException,
946 css::uno::Exception,
947 css::uno::RuntimeException );
949 virtual void SAL_CALL switchToStorage( const css::uno::Reference< css::embed::XStorage >& xStorage )
950 throw ( css::lang::IllegalArgumentException,
951 css::io::IOException,
952 css::uno::Exception,
953 css::uno::RuntimeException );
955 virtual css::uno::Reference< css::embed::XStorage > SAL_CALL getDocumentStorage()
956 throw ( css::io::IOException,
957 css::uno::Exception,
958 css::uno::RuntimeException );
960 virtual void SAL_CALL addStorageChangeListener(
961 const css::uno::Reference< css::document::XStorageChangeListener >& xListener )
962 throw ( css::uno::RuntimeException );
964 virtual void SAL_CALL removeStorageChangeListener(
965 const css::uno::Reference< css::document::XStorageChangeListener >& xListener )
966 throw ( css::uno::RuntimeException );
968 //____________________________________________________________________________________________________
969 // XVisualObject
970 //____________________________________________________________________________________________________
972 virtual void SAL_CALL setVisualAreaSize( sal_Int64 nAspect, const css::awt::Size& aSize )
973 throw ( css::lang::IllegalArgumentException,
974 css::embed::WrongStateException,
975 css::uno::Exception,
976 css::uno::RuntimeException );
978 virtual css::awt::Size SAL_CALL getVisualAreaSize( sal_Int64 nAspect )
979 throw ( css::lang::IllegalArgumentException,
980 css::embed::WrongStateException,
981 css::uno::Exception,
982 css::uno::RuntimeException );
984 virtual css::embed::VisualRepresentation SAL_CALL getPreferredVisualRepresentation( ::sal_Int64 nAspect )
985 throw ( css::lang::IllegalArgumentException,
986 css::embed::WrongStateException,
987 css::uno::Exception,
988 css::uno::RuntimeException );
990 virtual sal_Int32 SAL_CALL getMapUnit( sal_Int64 nAspect )
991 throw ( css::uno::Exception,
992 css::uno::RuntimeException );
994 //____________________________________________________________________________________________________
995 // XScriptProviderSupplier
996 //____________________________________________________________________________________________________
998 virtual css::uno::Reference< css::script::provider::XScriptProvider > SAL_CALL getScriptProvider() throw ( css::uno::RuntimeException );
1000 //____________________________________________________________________________________________________
1001 // XUIConfigurationManagerSupplier
1002 //____________________________________________________________________________________________________
1003 virtual css::uno::Reference< css::ui::XUIConfigurationManager > SAL_CALL getUIConfigurationManager() throw ( css::uno::RuntimeException );
1005 //____________________________________________________________________________________________________
1006 // XTransferable
1007 //____________________________________________________________________________________________________
1009 /**___________________________________________________________________________________________________
1010 @short -
1011 @descr -
1013 @seealso -
1015 @param -
1017 @return -
1019 @onerror -
1022 virtual css::uno::Any SAL_CALL getTransferData( const css::datatransfer::DataFlavor& aFlavor )
1023 throw (css::datatransfer::UnsupportedFlavorException,
1024 css::io::IOException,
1025 css::uno::RuntimeException);
1027 /**___________________________________________________________________________________________________
1028 @short -
1029 @descr -
1031 @seealso -
1033 @param -
1035 @return -
1037 @onerror -
1041 virtual css::uno::Sequence< css::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors()
1042 throw (css::uno::RuntimeException);
1044 /**___________________________________________________________________________________________________
1045 @short -
1046 @descr -
1048 @seealso -
1050 @param -
1052 @return -
1054 @onerror -
1057 virtual sal_Bool SAL_CALL isDataFlavorSupported( const css::datatransfer::DataFlavor& aFlavor )
1058 throw (css::uno::RuntimeException);
1061 //____________________________________________________________________________________________________
1062 // XEventsSupplier
1063 //____________________________________________________________________________________________________
1065 /**___________________________________________________________________________________________________
1066 @short -
1067 @descr - offers a list of event handlers which are be bound to events of
1068 this object.
1069 @seealso -
1071 @param -
1073 @return - an <type>Events</type> object.
1075 @onerror -
1078 virtual css::uno::Reference< css::container::XNameReplace > SAL_CALL getEvents() throw( css::uno::RuntimeException );
1081 //____________________________________________________________________________________________________
1082 // XEmbeddedScripts
1083 //____________________________________________________________________________________________________
1085 virtual css::uno::Reference< css::script::XStorageBasedLibraryContainer > SAL_CALL getBasicLibraries() throw (css::uno::RuntimeException);
1086 virtual css::uno::Reference< css::script::XStorageBasedLibraryContainer > SAL_CALL getDialogLibraries() throw (css::uno::RuntimeException);
1087 virtual ::sal_Bool SAL_CALL getAllowMacroExecution() throw (css::uno::RuntimeException);
1089 //____________________________________________________________________________________________________
1090 // XScriptInvocationContext
1091 //____________________________________________________________________________________________________
1093 virtual css::uno::Reference< css::document::XEmbeddedScripts > SAL_CALL getScriptContainer() throw (css::uno::RuntimeException);
1095 //____________________________________________________________________________________________________
1096 // XEventBroadcaster
1097 //____________________________________________________________________________________________________
1099 /**___________________________________________________________________________________________________
1100 @short -
1101 @descr - registers the given <type>XEventListener</type>.
1103 @seealso -
1105 @param -
1107 @return -
1109 @onerror -
1112 virtual void SAL_CALL addEventListener( const css::uno::Reference< css::document::XEventListener >& xListener ) throw( css::uno::RuntimeException );
1114 /**___________________________________________________________________________________________________
1115 @short -
1116 @descr - unregisters the given <type>XEventListener</type>.
1118 @seealso -
1120 @param -
1122 @return -
1124 @onerror -
1127 virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::document::XEventListener >& xListener ) throw( css::uno::RuntimeException );
1129 //____________________________________________________________________________________________________
1130 // XDocumentEventBroadcaster
1131 //____________________________________________________________________________________________________
1133 virtual void SAL_CALL addDocumentEventListener( const css::uno::Reference< css::document::XDocumentEventListener >& _Listener ) throw (css::uno::RuntimeException);
1134 virtual void SAL_CALL removeDocumentEventListener( const css::uno::Reference< css::document::XDocumentEventListener >& _Listener ) throw (css::uno::RuntimeException);
1135 virtual void SAL_CALL notifyDocumentEvent( const OUString& _EventName, const css::uno::Reference< css::frame::XController2 >& _ViewController, const css::uno::Any& _Supplement ) throw (css::lang::IllegalArgumentException, css::lang::NoSupportException, css::uno::RuntimeException);
1137 //____________________________________________________________________________________________________
1138 // XUnoTunnel
1139 //____________________________________________________________________________________________________
1141 virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) throw(css::uno::RuntimeException);
1143 // css.frame.XModule
1144 virtual void SAL_CALL setIdentifier(const OUString& sIdentifier)
1145 throw (css::uno::RuntimeException);
1147 // css.frame.XModule
1148 virtual OUString SAL_CALL getIdentifier()
1149 throw (css::uno::RuntimeException);
1151 // css.frame.XTitle
1152 virtual OUString SAL_CALL getTitle()
1153 throw (css::uno::RuntimeException);
1155 // css.frame.XTitle
1156 virtual void SAL_CALL setTitle( const OUString& sTitle )
1157 throw (css::uno::RuntimeException);
1159 // css.frame.XTitleChangeBroadcaster
1160 virtual void SAL_CALL addTitleChangeListener( const css::uno::Reference< css::frame::XTitleChangeListener >& xListener )
1161 throw (css::uno::RuntimeException);
1163 // css.frame.XTitleChangeBroadcaster
1164 virtual void SAL_CALL removeTitleChangeListener( const css::uno::Reference< css::frame::XTitleChangeListener >& xListener )
1165 throw (css::uno::RuntimeException);
1167 // css.frame.XUntitledNumbers
1168 virtual ::sal_Int32 SAL_CALL leaseNumber( const css::uno::Reference< css::uno::XInterface >& xComponent )
1169 throw (css::lang::IllegalArgumentException,
1170 css::uno::RuntimeException );
1172 // css.frame.XUntitledNumbers
1173 virtual void SAL_CALL releaseNumber( ::sal_Int32 nNumber )
1174 throw (css::lang::IllegalArgumentException,
1175 css::uno::RuntimeException );
1177 // css.frame.XUntitledNumbers
1178 virtual void SAL_CALL releaseNumberForComponent( const css::uno::Reference< css::uno::XInterface >& xComponent )
1179 throw (css::lang::IllegalArgumentException,
1180 css::uno::RuntimeException );
1182 // css.frame.XUntitledNumbers
1183 virtual OUString SAL_CALL getUntitledPrefix()
1184 throw (css::uno::RuntimeException);
1186 // css.document.XDocumentRecovery
1187 virtual ::sal_Bool SAL_CALL wasModifiedSinceLastSave()
1188 throw ( css::uno::RuntimeException );
1189 virtual void SAL_CALL storeToRecoveryFile( const OUString& i_TargetLocation, const css::uno::Sequence< css::beans::PropertyValue >& i_MediaDescriptor )
1190 throw ( css::uno::RuntimeException,
1191 css::io::IOException,
1192 css::lang::WrappedTargetException );
1193 virtual void SAL_CALL recoverFromFile( const OUString& i_SourceLocation, const OUString& i_SalvagedFile, const css::uno::Sequence< css::beans::PropertyValue >& i_MediaDescriptor )
1194 throw ( css::uno::RuntimeException,
1195 css::io::IOException,
1196 css::lang::WrappedTargetException );
1198 // css.document.XUndoManagerSupplier
1199 virtual css::uno::Reference< css::document::XUndoManager > SAL_CALL getUndoManager( ) throw (css::uno::RuntimeException);
1201 //____________________________________________________________________________________________________
1203 // css::rdf::XNode:
1204 virtual OUString SAL_CALL getStringValue()
1205 throw (css::uno::RuntimeException);
1207 // css::rdf::XURI:
1208 virtual OUString SAL_CALL getNamespace()
1209 throw (css::uno::RuntimeException);
1210 virtual OUString SAL_CALL getLocalName()
1211 throw (css::uno::RuntimeException);
1213 // css::rdf::XRepositorySupplier:
1214 virtual css::uno::Reference<
1215 css::rdf::XRepository > SAL_CALL getRDFRepository()
1216 throw (css::uno::RuntimeException);
1218 // css::rdf::XDocumentMetadataAccess:
1219 virtual css::uno::Reference<
1220 css::rdf::XMetadatable > SAL_CALL
1221 getElementByMetadataReference(
1222 const css::beans::StringPair & i_rReference)
1223 throw (css::uno::RuntimeException);
1224 virtual css::uno::Reference<
1225 css::rdf::XMetadatable > SAL_CALL
1226 getElementByURI(const css::uno::Reference<
1227 css::rdf::XURI > & i_xURI)
1228 throw (css::uno::RuntimeException,
1229 css::lang::IllegalArgumentException);
1230 virtual css::uno::Sequence< css::uno::Reference<
1231 css::rdf::XURI > > SAL_CALL getMetadataGraphsWithType(
1232 const css::uno::Reference<
1233 css::rdf::XURI > & i_xType)
1234 throw (css::uno::RuntimeException,
1235 css::lang::IllegalArgumentException);
1236 virtual css::uno::Reference<
1237 css::rdf::XURI> SAL_CALL
1238 addMetadataFile(const OUString & i_rFileName,
1239 const css::uno::Sequence<
1240 css::uno::Reference< css::rdf::XURI >
1241 > & i_rTypes)
1242 throw (css::uno::RuntimeException,
1243 css::lang::IllegalArgumentException,
1244 css::container::ElementExistException);
1245 virtual css::uno::Reference<
1246 css::rdf::XURI> SAL_CALL
1247 importMetadataFile(::sal_Int16 i_Format,
1248 const css::uno::Reference<
1249 css::io::XInputStream > & i_xInStream,
1250 const OUString & i_rFileName,
1251 const css::uno::Reference<
1252 css::rdf::XURI > & i_xBaseURI,
1253 const css::uno::Sequence<
1254 css::uno::Reference< css::rdf::XURI >
1255 > & i_rTypes)
1256 throw (css::uno::RuntimeException,
1257 css::lang::IllegalArgumentException,
1258 css::datatransfer::UnsupportedFlavorException,
1259 css::container::ElementExistException,
1260 css::rdf::ParseException,
1261 css::io::IOException);
1262 virtual void SAL_CALL removeMetadataFile(
1263 const css::uno::Reference<
1264 css::rdf::XURI > & i_xGraphName)
1265 throw (css::uno::RuntimeException,
1266 css::lang::IllegalArgumentException,
1267 css::container::NoSuchElementException);
1268 virtual void SAL_CALL addContentOrStylesFile(
1269 const OUString & i_rFileName)
1270 throw (css::uno::RuntimeException,
1271 css::lang::IllegalArgumentException,
1272 css::container::ElementExistException);
1273 virtual void SAL_CALL removeContentOrStylesFile(
1274 const OUString & i_rFileName)
1275 throw (css::uno::RuntimeException,
1276 css::lang::IllegalArgumentException,
1277 css::container::NoSuchElementException);
1279 virtual void SAL_CALL loadMetadataFromStorage(
1280 const css::uno::Reference<
1281 css::embed::XStorage > & i_xStorage,
1282 const css::uno::Reference<
1283 css::rdf::XURI > & i_xBaseURI,
1284 const css::uno::Reference<
1285 css::task::XInteractionHandler> & i_xHandler)
1286 throw (css::uno::RuntimeException,
1287 css::lang::IllegalArgumentException,
1288 css::lang::WrappedTargetException);
1289 virtual void SAL_CALL storeMetadataToStorage(
1290 const css::uno::Reference<
1291 css::embed::XStorage > & i_xStorage)
1292 throw (css::uno::RuntimeException,
1293 css::lang::IllegalArgumentException,
1294 css::lang::WrappedTargetException);
1295 virtual void SAL_CALL loadMetadataFromMedium(
1296 const css::uno::Sequence<
1297 css::beans::PropertyValue > & i_rMedium)
1298 throw (css::uno::RuntimeException,
1299 css::lang::IllegalArgumentException,
1300 css::lang::WrappedTargetException);
1301 virtual void SAL_CALL storeMetadataToMedium(
1302 const css::uno::Sequence<
1303 css::beans::PropertyValue > & i_rMedium)
1304 throw (css::uno::RuntimeException,
1305 css::lang::IllegalArgumentException,
1306 css::lang::WrappedTargetException);
1308 // XCmisDocument
1310 virtual css::uno::Sequence< css::beans::PropertyValue >
1311 SAL_CALL getCmisPropertiesValues()
1312 throw (css::uno::RuntimeException);
1313 virtual void SAL_CALL setCmisPropertiesValues(
1314 const css::uno::Sequence<
1315 css::beans::PropertyValue >& _cmispropertiesvalues )
1316 throw (css::uno::RuntimeException);
1317 virtual css::uno::Sequence< css::beans::PropertyValue >
1318 SAL_CALL getCmisPropertiesDisplayNames()
1319 throw (css::uno::RuntimeException);
1320 virtual void SAL_CALL setCmisPropertiesDisplayNames(
1321 const css::uno::Sequence<
1322 css::beans::PropertyValue >& _cmispropertiesdisplaynames )
1323 throw (css::uno::RuntimeException);
1325 virtual void SAL_CALL checkOut( ) throw ( css::uno::RuntimeException );
1326 virtual void SAL_CALL cancelCheckOut( ) throw ( css::uno::RuntimeException );
1327 virtual void SAL_CALL checkIn( sal_Bool bIsMajor, const OUString & rMessage )
1328 throw ( css::uno::RuntimeException );
1330 virtual sal_Bool SAL_CALL isVersionable( ) throw ( css::uno::RuntimeException );
1331 virtual sal_Bool SAL_CALL canCheckOut( ) throw ( css::uno::RuntimeException );
1332 virtual sal_Bool SAL_CALL canCancelCheckOut( ) throw ( css::uno::RuntimeException );
1333 virtual sal_Bool SAL_CALL canCheckIn( ) throw ( css::uno::RuntimeException );
1335 sal_Bool getBoolPropertyValue( const OUString& rName ) throw ( css::uno::RuntimeException );
1337 //____________________________________________________________________________________________________
1338 // SfxListener
1339 //____________________________________________________________________________________________________
1341 /**___________________________________________________________________________________________________
1342 @short -
1343 @descr -
1345 @seealso -
1347 @param -
1349 @return -
1351 @onerror -
1354 void Notify( SfxBroadcaster& aBC ,
1355 const SfxHint& aHint ) ;
1357 //____________________________________________________________________________________________________
1358 // public IMPL?
1359 //____________________________________________________________________________________________________
1361 /**___________________________________________________________________________________________________
1362 @short -
1363 @descr -
1365 @seealso -
1367 @param -
1369 @return -
1371 @onerror -
1374 void changing() ;
1376 /**___________________________________________________________________________________________________
1377 @short -
1378 @descr -
1380 @seealso -
1382 @param -
1384 @return -
1386 @onerror -
1389 SfxObjectShell* GetObjectShell() const ;
1391 SAL_DLLPRIVATE sal_Bool impl_isDisposed() const ;
1392 sal_Bool IsInitialized() const;
1393 sal_Bool IsDisposed() const { return impl_isDisposed(); }
1394 void MethodEntryCheck( const bool i_mustBeInitialized ) const;
1395 ::osl::Mutex& getMutex() const { return m_aMutex; }
1397 css::uno::Reference < css::container::XIndexAccess > SAL_CALL getViewData() throw (css::uno::RuntimeException);
1398 void SAL_CALL setViewData( const css::uno::Reference < css::container::XIndexAccess >& aData ) throw (css::uno::RuntimeException);
1400 /** calls all XEventListeners */
1401 void notifyEvent( const css::document::EventObject& aEvent ) const;
1403 /** returns true if someone added a XEventListener to this XEventBroadcaster */
1404 sal_Bool hasEventListeners() const;
1406 protected:
1408 /* returns a unique id for the model that is valid as long as the document
1409 is loaded. The id is not saved across document close/reload. */
1410 OUString getRuntimeUID() const;
1412 /* returns true if the document signatures are valid, otherwise false */
1413 sal_Bool hasValidSignatures() const;
1415 //________________________________________________________________________________________________________
1416 // private methods
1417 //________________________________________________________________________________________________________
1419 private:
1421 /**___________________________________________________________________________________________________
1422 @short -
1423 @descr -
1425 @seealso -
1427 @param -
1429 @return -
1431 @onerror -
1434 css::uno::Reference< css::ui::XUIConfigurationManager2 > getUIConfigurationManager2() throw ( css::uno::RuntimeException );
1435 bool impl_getPrintHelper();
1436 SAL_DLLPRIVATE void ListenForStorage_Impl( const css::uno::Reference< css::embed::XStorage >& xStorage );
1437 SAL_DLLPRIVATE OUString GetMediumFilterName_Impl();
1439 SAL_DLLPRIVATE void impl_store( const OUString& sURL,
1440 const css::uno::Sequence< css::beans::PropertyValue >& seqArguments ,
1441 sal_Bool bSaveTo ) ;
1443 SAL_DLLPRIVATE void postEvent_Impl( const OUString& aName, const css::uno::Reference< css::frame::XController2 >& xController = css::uno::Reference< css::frame::XController2 >() );
1445 SAL_DLLPRIVATE String getEventName_Impl( long nID );
1446 SAL_DLLPRIVATE bool QuerySaveSizeExceededModules( const com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler >& xHandler );
1448 SAL_DLLPRIVATE css::uno::Reference< css::frame::XTitle > impl_getTitleHelper ();
1449 SAL_DLLPRIVATE css::uno::Reference< css::frame::XUntitledNumbers > impl_getUntitledHelper ();
1451 SAL_DLLPRIVATE SfxViewFrame* FindOrCreateViewFrame_Impl(
1452 const css::uno::Reference< css::frame::XFrame >& i_rFrame,
1453 ::sfx::intern::ViewCreationGuard& i_rGuard
1454 ) const;
1456 SAL_DLLPRIVATE void NotifyModifyListeners_Impl() const;
1458 SAL_DLLPRIVATE void loadCmisProperties();
1460 SAL_DLLPRIVATE void handleLoadError( sal_uInt32 nError, SfxMedium* pMedium );
1462 //________________________________________________________________________________________________________
1463 // private variables and methods
1464 //________________________________________________________________________________________________________
1466 private:
1468 IMPL_SfxBaseModel_DataContainer* m_pData ;
1469 // cannot be held in m_pData, since it needs to be accessed in non-threadsafe context
1470 const bool m_bSupportEmbeddedScripts;
1471 const bool m_bSupportDocRecovery;
1473 } ; // class SfxBaseModel
1475 /** base class for sub components of an SfxBaseModel, which share their ref count and lifetime with the SfxBaseModel
1477 class SFX2_DLLPUBLIC SfxModelSubComponent
1479 public:
1480 /** checks whether the instance is alive, i.e. properly initialized, and not yet disposed
1482 void MethodEntryCheck()
1484 m_rModel.MethodEntryCheck( true );
1487 // called when the SfxBaseModel which the component is superordinate of is being disposed
1488 virtual void disposing();
1490 protected:
1491 SfxModelSubComponent( SfxBaseModel& i_model )
1492 :m_rModel( i_model )
1495 virtual ~SfxModelSubComponent();
1497 // helpers for implementing XInterface - delegates ref counting to the SfxBaseModel
1498 void acquire() { m_rModel.acquire(); }
1499 void release() { m_rModel.release(); }
1501 bool isDisposed() const { return m_rModel.IsDisposed(); }
1503 protected:
1504 const SfxBaseModel& getBaseModel() const { return m_rModel; }
1505 SfxBaseModel& getBaseModel() { return m_rModel; }
1507 ::osl::Mutex& getMutex() { return m_rModel.getMutex(); }
1509 private:
1510 SfxBaseModel& m_rModel;
1513 class SFX2_DLLPUBLIC SfxModelGuard
1515 public:
1516 enum AllowedModelState
1518 // not yet initialized
1519 E_INITIALIZING,
1520 // fully alive, i.e. initialized, and not yet disposed
1521 E_FULLY_ALIVE
1524 SfxModelGuard( SfxBaseModel& i_rModel, const AllowedModelState i_eState = E_FULLY_ALIVE )
1525 : m_aGuard()
1527 i_rModel.MethodEntryCheck( i_eState != E_INITIALIZING );
1529 SfxModelGuard( SfxModelSubComponent& i_rSubComponent )
1530 :m_aGuard()
1532 i_rSubComponent.MethodEntryCheck();
1534 ~SfxModelGuard()
1538 void reset()
1540 m_aGuard.reset();
1543 void clear()
1545 m_aGuard.clear();
1548 private:
1549 SolarMutexResettableGuard m_aGuard;
1552 #endif // _SFX_SFXBASEMODEL_HXX_
1554 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */