1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 INCLUDED_SFX2_SFXBASEMODEL_HXX
21 #define INCLUDED_SFX2_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/CmisVersion.hpp>
37 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
38 #include <com/sun/star/document/XDocumentRecovery.hpp>
39 #include <com/sun/star/document/XUndoManagerSupplier.hpp>
40 #include <com/sun/star/rdf/XDocumentMetadataAccess.hpp>
41 #include <com/sun/star/document/XEventBroadcaster.hpp>
42 #include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
43 #include <com/sun/star/document/XEventListener.hpp>
44 #include <com/sun/star/document/XEventsSupplier.hpp>
45 #include <com/sun/star/document/XEmbeddedScripts.hpp>
46 #include <com/sun/star/document/EventObject.hpp>
47 #include <com/sun/star/document/XDocumentSubStorageSupplier.hpp>
48 #include <com/sun/star/document/XStorageBasedDocument.hpp>
49 #include <com/sun/star/document/XScriptInvocationContext.hpp>
50 #include <com/sun/star/lang/XEventListener.hpp>
51 #include <com/sun/star/lang/NotInitializedException.hpp>
52 #include <com/sun/star/lang/DisposedException.hpp>
53 #include <com/sun/star/frame/XModel2.hpp>
54 #include <com/sun/star/frame/DoubleInitializationException.hpp>
55 #include <com/sun/star/util/XModifiable2.hpp>
56 #include <com/sun/star/util/XModifyListener.hpp>
57 #include <com/sun/star/util/XCloseable.hpp>
58 #include <com/sun/star/util/XCloseBroadcaster.hpp>
59 #include <com/sun/star/util/XCloseListener.hpp>
60 #include <com/sun/star/util/CloseVetoException.hpp>
61 #include <com/sun/star/view/XPrintable.hpp>
62 #include <com/sun/star/view/XPrintJobBroadcaster.hpp>
63 #include <com/sun/star/frame/XStorable.hpp>
64 #include <com/sun/star/frame/XStorable2.hpp>
65 #include <com/sun/star/frame/XLoadable.hpp>
66 #include <com/sun/star/beans/PropertyValue.hpp>
67 #include <com/sun/star/document/CmisProperty.hpp>
68 #include <com/sun/star/lang/EventObject.hpp>
69 #include <com/sun/star/datatransfer/XTransferable.hpp>
70 #include <com/sun/star/script/provider/XScriptProviderSupplier.hpp>
71 #include <com/sun/star/ui/XUIConfigurationManager2.hpp>
72 #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
73 #include <com/sun/star/embed/XVisualObject.hpp>
74 #include <com/sun/star/uno/Sequence.hxx>
75 #include <com/sun/star/uno/Reference.hxx>
76 #include <com/sun/star/uno/Any.hxx>
77 #include <cppuhelper/weak.hxx>
78 #include <cppuhelper/basemutex.hxx>
79 #include <cppuhelper/typeprovider.hxx>
80 #include <com/sun/star/script/XStarBasicAccess.hpp>
81 #include <osl/mutex.hxx>
82 #include <vcl/svapp.hxx>
84 #include <com/sun/star/document/XViewDataSupplier.hpp>
85 #include <com/sun/star/lang/XUnoTunnel.hpp>
86 #include <com/sun/star/task/XInteractionHandler.hpp>
88 #ifndef INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_32
89 #define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_32
90 #define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 32
91 #include <comphelper/implbase_var.hxx>
94 #include <svl/lstner.hxx>
99 class SfxObjectShell
;
102 struct IMPL_SfxBaseModel_DataContainer
; // impl. struct to hold member of class SfxBaseModel
104 namespace sfx
{ namespace intern
{
105 class ViewCreationGuard
;
107 //________________________________________________________________________________________________________
108 // class declarations
109 //________________________________________________________________________________________________________
111 /**_______________________________________________________________________________________________________
118 document::XDocumentPropertiesSupplier
119 rdf::XDocumentMetadataAccess
125 document::XEventBroadcaster
126 document::XEventsSupplier
127 document::XEmbeddedScripts
128 document::XScriptInvocationContext
132 @base cppu::BaseMutex
136 typedef ::comphelper::WeakImplHelper32
< css::container::XChild
137 , css::document::XDocumentPropertiesSupplier
138 , css::document::XCmisDocument
139 , css::rdf::XDocumentMetadataAccess
140 , css::document::XDocumentRecovery
141 , css::document::XUndoManagerSupplier
142 , css::document::XEventBroadcaster
143 , css::document::XDocumentEventBroadcaster
144 , css::lang::XEventListener
145 , css::document::XEventsSupplier
146 , css::document::XEmbeddedScripts
147 , css::document::XScriptInvocationContext
148 , css::frame::XModel2
149 , css::util::XModifiable2
150 , css::view::XPrintable
151 , css::view::XPrintJobBroadcaster
152 , css::frame::XStorable2
153 , css::frame::XLoadable
154 , css::script::XStarBasicAccess
155 , css::document::XViewDataSupplier
156 , css::util::XCloseable
// => css::util::XCloseBroadcaster
157 , css::datatransfer::XTransferable
158 , css::document::XDocumentSubStorageSupplier
159 , css::document::XStorageBasedDocument
160 , css::script::provider::XScriptProviderSupplier
161 , css::ui::XUIConfigurationManagerSupplier
162 , css::embed::XVisualObject
163 , css::lang::XUnoTunnel
164 , css::frame::XModule
166 , css::frame::XTitleChangeBroadcaster
167 , css::frame::XUntitledNumbers
170 class SFX2_DLLPUBLIC SfxBaseModel
: protected ::cppu::BaseMutex
171 , public SfxBaseModel_Base
175 //________________________________________________________________________________________________________
177 //________________________________________________________________________________________________________
181 //____________________________________________________________________________________________________
182 // constructor/destructor
183 //____________________________________________________________________________________________________
185 /**___________________________________________________________________________________________________
198 SfxBaseModel( SfxObjectShell
*pObjectShell
= NULL
) ;
200 /**___________________________________________________________________________________________________
213 virtual ~SfxBaseModel() ;
215 //____________________________________________________________________________________________________
217 //____________________________________________________________________________________________________
219 /**___________________________________________________________________________________________________
220 @short give answer, if interface is supported
221 @descr The interfaces are searched by type.
225 @param "rType" is the type of searched interface.
227 @return Any information about found interface
229 @onerror A RuntimeException is thrown.
232 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) throw( css::uno::RuntimeException
) ;
234 /**___________________________________________________________________________________________________
235 @short increment refcount
245 @onerror A RuntimeException is thrown.
248 virtual void SAL_CALL
acquire() throw() ;
250 /**___________________________________________________________________________________________________
251 @short decrement refcount
261 @onerror A RuntimeException is thrown.
264 virtual void SAL_CALL
release() throw() ;
266 //____________________________________________________________________________________________________
268 //____________________________________________________________________________________________________
270 /**___________________________________________________________________________________________________
271 @short get information about supported interfaces
274 @seealso XTypeProvider
278 @return Sequence of types of all supported interfaces
280 @onerror A RuntimeException is thrown.
283 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() throw( css::uno::RuntimeException
) ;
285 /**___________________________________________________________________________________________________
286 @short get implementation id
287 @descr This ID is neccessary for UNO-caching. If there no ID, cache is disabled.
288 Another way, cache is enabled.
290 @seealso XTypeProvider
294 @return ID as Sequence of byte
296 @onerror A RuntimeException is thrown.
299 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() throw( css::uno::RuntimeException
) ;
302 //____________________________________________________________________________________________________
304 //____________________________________________________________________________________________________
306 /**___________________________________________________________________________________________________
307 @seealso XStarBasicAccess
309 virtual css::uno::Reference
< css::container::XNameContainer
> SAL_CALL
getLibraryContainer() throw( css::uno::RuntimeException
);
311 /**___________________________________________________________________________________________________
312 @seealso XStarBasicAccess
314 virtual void SAL_CALL
createLibrary( const OUString
& LibName
, const OUString
& Password
,
315 const OUString
& ExternalSourceURL
, const OUString
& LinkTargetURL
)
316 throw(css::container::ElementExistException
, css::uno::RuntimeException
);
318 /**___________________________________________________________________________________________________
319 @seealso XStarBasicAccess
321 virtual void SAL_CALL
addModule( const OUString
& LibraryName
, const OUString
& ModuleName
,
322 const OUString
& Language
, const OUString
& Source
)
323 throw( css::container::NoSuchElementException
, css::uno::RuntimeException
);
325 /**___________________________________________________________________________________________________
326 @seealso XStarBasicAccess
328 virtual void SAL_CALL
addDialog( const OUString
& LibraryName
, const OUString
& DialogName
,
329 const css::uno::Sequence
< sal_Int8
>& Data
)
330 throw(css::container::NoSuchElementException
, css::uno::RuntimeException
);
333 //____________________________________________________________________________________________________
335 //____________________________________________________________________________________________________
337 /**___________________________________________________________________________________________________
350 virtual css::uno::Reference
< css::uno::XInterface
> SAL_CALL
getParent() throw( css::uno::RuntimeException
) ;
352 /**___________________________________________________________________________________________________
365 virtual void SAL_CALL
setParent( const css::uno::Reference
< css::uno::XInterface
>& xParent
) throw(css::lang::NoSupportException
,
366 css::uno::RuntimeException
);
368 //____________________________________________________________________________________________________
370 //____________________________________________________________________________________________________
372 /**___________________________________________________________________________________________________
385 virtual void SAL_CALL
dispose() throw (css::uno::RuntimeException
);
387 /**___________________________________________________________________________________________________
400 virtual void SAL_CALL
addEventListener(const css::uno::Reference
< css::lang::XEventListener
>& aListener
) throw (css::uno::RuntimeException
);
402 /**___________________________________________________________________________________________________
415 virtual void SAL_CALL
removeEventListener(const css::uno::Reference
< css::lang::XEventListener
>& aListener
) throw (css::uno::RuntimeException
);
417 // XDocumentPropertiesSupplier
418 virtual css::uno::Reference
< css::document::XDocumentProperties
>
419 SAL_CALL
getDocumentProperties()
420 throw (css::uno::RuntimeException
);
422 //____________________________________________________________________________________________________
424 //____________________________________________________________________________________________________
426 /**___________________________________________________________________________________________________
439 virtual void SAL_CALL
disposing( const css::lang::EventObject
& aEvent
) throw (css::uno::RuntimeException
);
441 //____________________________________________________________________________________________________
443 //____________________________________________________________________________________________________
445 /**___________________________________________________________________________________________________
458 virtual sal_Bool SAL_CALL
attachResource(const OUString
& sURL
,
459 const css::uno::Sequence
< css::beans::PropertyValue
>& aArgs
)
460 throw (css::uno::RuntimeException
);
462 /**___________________________________________________________________________________________________
475 virtual OUString SAL_CALL
getURL() throw (css::uno::RuntimeException
);
477 /**___________________________________________________________________________________________________
490 virtual css::uno::Sequence
< css::beans::PropertyValue
> SAL_CALL
getArgs() throw (css::uno::RuntimeException
);
492 /**___________________________________________________________________________________________________
505 virtual void SAL_CALL
connectController( const css::uno::Reference
< css::frame::XController
>& xController
) throw (css::uno::RuntimeException
);
507 /**___________________________________________________________________________________________________
520 virtual void SAL_CALL
disconnectController( const css::uno::Reference
< css::frame::XController
>& xController
) throw (css::uno::RuntimeException
);
522 /**___________________________________________________________________________________________________
535 virtual void SAL_CALL
lockControllers() throw (css::uno::RuntimeException
);
537 /**___________________________________________________________________________________________________
550 virtual void SAL_CALL
unlockControllers() throw (css::uno::RuntimeException
);
552 /**___________________________________________________________________________________________________
565 virtual sal_Bool SAL_CALL
hasControllersLocked() throw (css::uno::RuntimeException
);
567 /**___________________________________________________________________________________________________
580 virtual css::uno::Reference
< css::frame::XController
> SAL_CALL
getCurrentController() throw (css::uno::RuntimeException
);
582 /**___________________________________________________________________________________________________
595 virtual void SAL_CALL
setCurrentController( const css::uno::Reference
< css::frame::XController
>& xController
)
596 throw (css::container::NoSuchElementException
, css::uno::RuntimeException
);
598 /**___________________________________________________________________________________________________
611 virtual css::uno::Reference
< css::uno::XInterface
> SAL_CALL
getCurrentSelection() throw (css::uno::RuntimeException
);
613 //____________________________________________________________________________________________________
615 //____________________________________________________________________________________________________
616 virtual css::uno::Reference
< css::container::XEnumeration
> SAL_CALL
getControllers()
617 throw (css::uno::RuntimeException
);
619 virtual css::uno::Sequence
< OUString
> SAL_CALL
getAvailableViewControllerNames()
620 throw (css::uno::RuntimeException
);
622 virtual css::uno::Reference
< css::frame::XController2
> SAL_CALL
createDefaultViewController(const css::uno::Reference
< css::frame::XFrame
>& Frame
)
623 throw (css::uno::RuntimeException
,
624 css::lang::IllegalArgumentException
,
625 css::uno::Exception
);
627 virtual css::uno::Reference
< css::frame::XController2
> SAL_CALL
createViewController(const OUString
& ViewName
,
628 const css::uno::Sequence
< css::beans::PropertyValue
>& Arguments
,
629 const css::uno::Reference
< css::frame::XFrame
>& Frame
)
630 throw (css::uno::RuntimeException
,
631 css::lang::IllegalArgumentException
,
632 css::uno::Exception
);
634 //____________________________________________________________________________________________________
636 //____________________________________________________________________________________________________
638 virtual ::sal_Bool SAL_CALL
disableSetModified( ) throw (css::uno::RuntimeException
);
639 virtual ::sal_Bool SAL_CALL
enableSetModified( ) throw (css::uno::RuntimeException
);
640 virtual ::sal_Bool SAL_CALL
isSetModifiedEnabled( ) throw (css::uno::RuntimeException
);
642 /**___________________________________________________________________________________________________
655 virtual sal_Bool SAL_CALL
isModified() throw (css::uno::RuntimeException
);
657 /**___________________________________________________________________________________________________
670 virtual void SAL_CALL
setModified( sal_Bool bModified
)
671 throw (css::beans::PropertyVetoException
, css::uno::RuntimeException
);
673 /**___________________________________________________________________________________________________
686 virtual void SAL_CALL
addModifyListener( const css::uno::Reference
< css::util::XModifyListener
>& xListener
) throw( css::uno::RuntimeException
) ;
688 /**___________________________________________________________________________________________________
701 virtual void SAL_CALL
removeModifyListener(const css::uno::Reference
< css::util::XModifyListener
> & xListener
) throw( css::uno::RuntimeException
) ;
703 //____________________________________________________________________________________________________
705 //____________________________________________________________________________________________________
707 virtual void SAL_CALL
close( sal_Bool bDeliverOwnership
) throw (css::util::CloseVetoException
, css::uno::RuntimeException
);
709 //____________________________________________________________________________________________________
711 //____________________________________________________________________________________________________
713 virtual void SAL_CALL
addCloseListener( const css::uno::Reference
< css::util::XCloseListener
>& xListener
) throw (css::uno::RuntimeException
);
714 virtual void SAL_CALL
removeCloseListener( const css::uno::Reference
< css::util::XCloseListener
>& xListener
) throw (css::uno::RuntimeException
);
716 //____________________________________________________________________________________________________
717 // XPrintJobBroadcaster
718 //____________________________________________________________________________________________________
720 virtual void SAL_CALL
addPrintJobListener( const css::uno::Reference
< css::view::XPrintJobListener
>& xListener
) throw (css::uno::RuntimeException
);
721 virtual void SAL_CALL
removePrintJobListener( const css::uno::Reference
< css::view::XPrintJobListener
>& xListener
) throw (css::uno::RuntimeException
);
723 //____________________________________________________________________________________________________
725 //____________________________________________________________________________________________________
727 /**___________________________________________________________________________________________________
740 virtual css::uno::Sequence
< css::beans::PropertyValue
> SAL_CALL
getPrinter() throw (css::uno::RuntimeException
);
742 /**___________________________________________________________________________________________________
755 virtual void SAL_CALL
setPrinter( const css::uno::Sequence
< css::beans::PropertyValue
>& seqPrinter
)
756 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
);
757 /**___________________________________________________________________________________________________
770 virtual void SAL_CALL
print( const css::uno::Sequence
< css::beans::PropertyValue
>& seqOptions
)
771 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
);
773 //____________________________________________________________________________________________________
775 //____________________________________________________________________________________________________
777 virtual void SAL_CALL
storeSelf( const css::uno::Sequence
< css::beans::PropertyValue
>& seqArguments
)
778 throw (css::lang::IllegalArgumentException
, css::io::IOException
, css::uno::RuntimeException
);
780 //____________________________________________________________________________________________________
782 //____________________________________________________________________________________________________
784 /**___________________________________________________________________________________________________
797 virtual sal_Bool SAL_CALL
hasLocation() throw (css::uno::RuntimeException
);
799 /**___________________________________________________________________________________________________
812 virtual OUString SAL_CALL
getLocation() throw (css::uno::RuntimeException
);
814 /**___________________________________________________________________________________________________
827 virtual sal_Bool SAL_CALL
isReadonly() throw (css::uno::RuntimeException
);
829 /**___________________________________________________________________________________________________
842 virtual void SAL_CALL
store() throw (css::io::IOException
, css::uno::RuntimeException
);
844 /**___________________________________________________________________________________________________
857 virtual void SAL_CALL
storeAsURL( const OUString
& sURL
,
858 const css::uno::Sequence
< css::beans::PropertyValue
>& seqArguments
)
859 throw (css::io::IOException
, css::uno::RuntimeException
) ;
861 /**___________________________________________________________________________________________________
874 virtual void SAL_CALL
storeToURL( const OUString
& sURL
,
875 const css::uno::Sequence
< css::beans::PropertyValue
>& seqArguments
)
876 throw (css::io::IOException
, css::uno::RuntimeException
);
880 //____________________________________________________________________________________________________
882 //____________________________________________________________________________________________________
884 /**___________________________________________________________________________________________________
897 virtual void SAL_CALL
initNew()
898 throw (css::frame::DoubleInitializationException
,
899 css::io::IOException
,
900 css::uno::RuntimeException
,
901 css::uno::Exception
);
903 /**___________________________________________________________________________________________________
916 virtual void SAL_CALL
load( const css::uno::Sequence
< css::beans::PropertyValue
>& seqArguments
)
917 throw (css::frame::DoubleInitializationException
,
918 css::io::IOException
,
919 css::uno::RuntimeException
,
920 css::uno::Exception
);
922 //____________________________________________________________________________________________________
923 // XDocumentSubStorageSupplier
924 //____________________________________________________________________________________________________
926 virtual css::uno::Reference
< css::embed::XStorage
> SAL_CALL
getDocumentSubStorage( const OUString
& aStorageName
, sal_Int32 nMode
)
927 throw ( css::uno::RuntimeException
);
929 virtual css::uno::Sequence
< OUString
> SAL_CALL
getDocumentSubStoragesNames()
930 throw ( css::io::IOException
, css::uno::RuntimeException
);
932 //____________________________________________________________________________________________________
933 // XStorageBasedDocument
934 //____________________________________________________________________________________________________
936 virtual void SAL_CALL
loadFromStorage( const css::uno::Reference
< css::embed::XStorage
>& xStorage
,
937 const css::uno::Sequence
< css::beans::PropertyValue
>& aMediaDescriptor
)
938 throw ( css::lang::IllegalArgumentException
,
939 com::sun::star::frame::DoubleInitializationException
,
940 css::io::IOException
,
942 css::uno::RuntimeException
);
944 virtual void SAL_CALL
storeToStorage( const css::uno::Reference
< css::embed::XStorage
>& xStorage
,
945 const css::uno::Sequence
< css::beans::PropertyValue
>& aMediaDescriptor
)
946 throw ( css::lang::IllegalArgumentException
,
947 css::io::IOException
,
949 css::uno::RuntimeException
);
951 virtual void SAL_CALL
switchToStorage( const css::uno::Reference
< css::embed::XStorage
>& xStorage
)
952 throw ( css::lang::IllegalArgumentException
,
953 css::io::IOException
,
955 css::uno::RuntimeException
);
957 virtual css::uno::Reference
< css::embed::XStorage
> SAL_CALL
getDocumentStorage()
958 throw ( css::io::IOException
,
960 css::uno::RuntimeException
);
962 virtual void SAL_CALL
addStorageChangeListener(
963 const css::uno::Reference
< css::document::XStorageChangeListener
>& xListener
)
964 throw ( css::uno::RuntimeException
);
966 virtual void SAL_CALL
removeStorageChangeListener(
967 const css::uno::Reference
< css::document::XStorageChangeListener
>& xListener
)
968 throw ( css::uno::RuntimeException
);
970 //____________________________________________________________________________________________________
972 //____________________________________________________________________________________________________
974 virtual void SAL_CALL
setVisualAreaSize( sal_Int64 nAspect
, const css::awt::Size
& aSize
)
975 throw ( css::lang::IllegalArgumentException
,
976 css::embed::WrongStateException
,
978 css::uno::RuntimeException
);
980 virtual css::awt::Size SAL_CALL
getVisualAreaSize( sal_Int64 nAspect
)
981 throw ( css::lang::IllegalArgumentException
,
982 css::embed::WrongStateException
,
984 css::uno::RuntimeException
);
986 virtual css::embed::VisualRepresentation SAL_CALL
getPreferredVisualRepresentation( ::sal_Int64 nAspect
)
987 throw ( css::lang::IllegalArgumentException
,
988 css::embed::WrongStateException
,
990 css::uno::RuntimeException
);
992 virtual sal_Int32 SAL_CALL
getMapUnit( sal_Int64 nAspect
)
993 throw ( css::uno::Exception
,
994 css::uno::RuntimeException
);
996 //____________________________________________________________________________________________________
997 // XScriptProviderSupplier
998 //____________________________________________________________________________________________________
1000 virtual css::uno::Reference
< css::script::provider::XScriptProvider
> SAL_CALL
getScriptProvider() throw ( css::uno::RuntimeException
);
1002 //____________________________________________________________________________________________________
1003 // XUIConfigurationManagerSupplier
1004 //____________________________________________________________________________________________________
1005 virtual css::uno::Reference
< css::ui::XUIConfigurationManager
> SAL_CALL
getUIConfigurationManager() throw ( css::uno::RuntimeException
);
1007 //____________________________________________________________________________________________________
1009 //____________________________________________________________________________________________________
1011 /**___________________________________________________________________________________________________
1024 virtual css::uno::Any SAL_CALL
getTransferData( const css::datatransfer::DataFlavor
& aFlavor
)
1025 throw (css::datatransfer::UnsupportedFlavorException
,
1026 css::io::IOException
,
1027 css::uno::RuntimeException
);
1029 /**___________________________________________________________________________________________________
1043 virtual css::uno::Sequence
< css::datatransfer::DataFlavor
> SAL_CALL
getTransferDataFlavors()
1044 throw (css::uno::RuntimeException
);
1046 /**___________________________________________________________________________________________________
1059 virtual sal_Bool SAL_CALL
isDataFlavorSupported( const css::datatransfer::DataFlavor
& aFlavor
)
1060 throw (css::uno::RuntimeException
);
1063 //____________________________________________________________________________________________________
1065 //____________________________________________________________________________________________________
1067 /**___________________________________________________________________________________________________
1069 @descr - offers a list of event handlers which are be bound to events of
1075 @return - an Events object.
1080 virtual css::uno::Reference
< css::container::XNameReplace
> SAL_CALL
getEvents() throw( css::uno::RuntimeException
);
1083 //____________________________________________________________________________________________________
1085 //____________________________________________________________________________________________________
1087 virtual css::uno::Reference
< css::script::XStorageBasedLibraryContainer
> SAL_CALL
getBasicLibraries() throw (css::uno::RuntimeException
);
1088 virtual css::uno::Reference
< css::script::XStorageBasedLibraryContainer
> SAL_CALL
getDialogLibraries() throw (css::uno::RuntimeException
);
1089 virtual ::sal_Bool SAL_CALL
getAllowMacroExecution() throw (css::uno::RuntimeException
);
1091 //____________________________________________________________________________________________________
1092 // XScriptInvocationContext
1093 //____________________________________________________________________________________________________
1095 virtual css::uno::Reference
< css::document::XEmbeddedScripts
> SAL_CALL
getScriptContainer() throw (css::uno::RuntimeException
);
1097 //____________________________________________________________________________________________________
1098 // XEventBroadcaster
1099 //____________________________________________________________________________________________________
1101 /**___________________________________________________________________________________________________
1103 @descr - registers the given XEventListener.
1114 virtual void SAL_CALL
addEventListener( const css::uno::Reference
< css::document::XEventListener
>& xListener
) throw( css::uno::RuntimeException
);
1116 /**___________________________________________________________________________________________________
1118 @descr - unregisters the given XEventListener.
1129 virtual void SAL_CALL
removeEventListener( const css::uno::Reference
< css::document::XEventListener
>& xListener
) throw( css::uno::RuntimeException
);
1131 //____________________________________________________________________________________________________
1132 // XDocumentEventBroadcaster
1133 //____________________________________________________________________________________________________
1135 virtual void SAL_CALL
addDocumentEventListener( const css::uno::Reference
< css::document::XDocumentEventListener
>& _Listener
) throw (css::uno::RuntimeException
);
1136 virtual void SAL_CALL
removeDocumentEventListener( const css::uno::Reference
< css::document::XDocumentEventListener
>& _Listener
) throw (css::uno::RuntimeException
);
1137 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
);
1139 //____________________________________________________________________________________________________
1141 //____________________________________________________________________________________________________
1143 virtual sal_Int64 SAL_CALL
getSomething( const css::uno::Sequence
< sal_Int8
>& aIdentifier
) throw(css::uno::RuntimeException
);
1145 // css.frame.XModule
1146 virtual void SAL_CALL
setIdentifier(const OUString
& sIdentifier
)
1147 throw (css::uno::RuntimeException
);
1149 // css.frame.XModule
1150 virtual OUString SAL_CALL
getIdentifier()
1151 throw (css::uno::RuntimeException
);
1154 virtual OUString SAL_CALL
getTitle()
1155 throw (css::uno::RuntimeException
);
1158 virtual void SAL_CALL
setTitle( const OUString
& sTitle
)
1159 throw (css::uno::RuntimeException
);
1161 // css.frame.XTitleChangeBroadcaster
1162 virtual void SAL_CALL
addTitleChangeListener( const css::uno::Reference
< css::frame::XTitleChangeListener
>& xListener
)
1163 throw (css::uno::RuntimeException
);
1165 // css.frame.XTitleChangeBroadcaster
1166 virtual void SAL_CALL
removeTitleChangeListener( const css::uno::Reference
< css::frame::XTitleChangeListener
>& xListener
)
1167 throw (css::uno::RuntimeException
);
1169 // css.frame.XUntitledNumbers
1170 virtual ::sal_Int32 SAL_CALL
leaseNumber( const css::uno::Reference
< css::uno::XInterface
>& xComponent
)
1171 throw (css::lang::IllegalArgumentException
,
1172 css::uno::RuntimeException
);
1174 // css.frame.XUntitledNumbers
1175 virtual void SAL_CALL
releaseNumber( ::sal_Int32 nNumber
)
1176 throw (css::lang::IllegalArgumentException
,
1177 css::uno::RuntimeException
);
1179 // css.frame.XUntitledNumbers
1180 virtual void SAL_CALL
releaseNumberForComponent( const css::uno::Reference
< css::uno::XInterface
>& xComponent
)
1181 throw (css::lang::IllegalArgumentException
,
1182 css::uno::RuntimeException
);
1184 // css.frame.XUntitledNumbers
1185 virtual OUString SAL_CALL
getUntitledPrefix()
1186 throw (css::uno::RuntimeException
);
1188 // css.document.XDocumentRecovery
1189 virtual ::sal_Bool SAL_CALL
wasModifiedSinceLastSave()
1190 throw ( css::uno::RuntimeException
);
1191 virtual void SAL_CALL
storeToRecoveryFile( const OUString
& i_TargetLocation
, const css::uno::Sequence
< css::beans::PropertyValue
>& i_MediaDescriptor
)
1192 throw ( css::uno::RuntimeException
,
1193 css::io::IOException
,
1194 css::lang::WrappedTargetException
);
1195 virtual void SAL_CALL
recoverFromFile( const OUString
& i_SourceLocation
, const OUString
& i_SalvagedFile
, const css::uno::Sequence
< css::beans::PropertyValue
>& i_MediaDescriptor
)
1196 throw ( css::uno::RuntimeException
,
1197 css::io::IOException
,
1198 css::lang::WrappedTargetException
);
1200 // css.document.XUndoManagerSupplier
1201 virtual css::uno::Reference
< css::document::XUndoManager
> SAL_CALL
getUndoManager( ) throw (css::uno::RuntimeException
);
1203 //____________________________________________________________________________________________________
1206 virtual OUString SAL_CALL
getStringValue()
1207 throw (css::uno::RuntimeException
);
1210 virtual OUString SAL_CALL
getNamespace()
1211 throw (css::uno::RuntimeException
);
1212 virtual OUString SAL_CALL
getLocalName()
1213 throw (css::uno::RuntimeException
);
1215 // css::rdf::XRepositorySupplier:
1216 virtual css::uno::Reference
<
1217 css::rdf::XRepository
> SAL_CALL
getRDFRepository()
1218 throw (css::uno::RuntimeException
);
1220 // css::rdf::XDocumentMetadataAccess:
1221 virtual css::uno::Reference
<
1222 css::rdf::XMetadatable
> SAL_CALL
1223 getElementByMetadataReference(
1224 const css::beans::StringPair
& i_rReference
)
1225 throw (css::uno::RuntimeException
);
1226 virtual css::uno::Reference
<
1227 css::rdf::XMetadatable
> SAL_CALL
1228 getElementByURI(const css::uno::Reference
<
1229 css::rdf::XURI
> & i_xURI
)
1230 throw (css::uno::RuntimeException
,
1231 css::lang::IllegalArgumentException
);
1232 virtual css::uno::Sequence
< css::uno::Reference
<
1233 css::rdf::XURI
> > SAL_CALL
getMetadataGraphsWithType(
1234 const css::uno::Reference
<
1235 css::rdf::XURI
> & i_xType
)
1236 throw (css::uno::RuntimeException
,
1237 css::lang::IllegalArgumentException
);
1238 virtual css::uno::Reference
<
1239 css::rdf::XURI
> SAL_CALL
1240 addMetadataFile(const OUString
& i_rFileName
,
1241 const css::uno::Sequence
<
1242 css::uno::Reference
< css::rdf::XURI
>
1244 throw (css::uno::RuntimeException
,
1245 css::lang::IllegalArgumentException
,
1246 css::container::ElementExistException
);
1247 virtual css::uno::Reference
<
1248 css::rdf::XURI
> SAL_CALL
1249 importMetadataFile(::sal_Int16 i_Format
,
1250 const css::uno::Reference
<
1251 css::io::XInputStream
> & i_xInStream
,
1252 const OUString
& i_rFileName
,
1253 const css::uno::Reference
<
1254 css::rdf::XURI
> & i_xBaseURI
,
1255 const css::uno::Sequence
<
1256 css::uno::Reference
< css::rdf::XURI
>
1258 throw (css::uno::RuntimeException
,
1259 css::lang::IllegalArgumentException
,
1260 css::datatransfer::UnsupportedFlavorException
,
1261 css::container::ElementExistException
,
1262 css::rdf::ParseException
,
1263 css::io::IOException
);
1264 virtual void SAL_CALL
removeMetadataFile(
1265 const css::uno::Reference
<
1266 css::rdf::XURI
> & i_xGraphName
)
1267 throw (css::uno::RuntimeException
,
1268 css::lang::IllegalArgumentException
,
1269 css::container::NoSuchElementException
);
1270 virtual void SAL_CALL
addContentOrStylesFile(
1271 const OUString
& i_rFileName
)
1272 throw (css::uno::RuntimeException
,
1273 css::lang::IllegalArgumentException
,
1274 css::container::ElementExistException
);
1275 virtual void SAL_CALL
removeContentOrStylesFile(
1276 const OUString
& i_rFileName
)
1277 throw (css::uno::RuntimeException
,
1278 css::lang::IllegalArgumentException
,
1279 css::container::NoSuchElementException
);
1281 virtual void SAL_CALL
loadMetadataFromStorage(
1282 const css::uno::Reference
<
1283 css::embed::XStorage
> & i_xStorage
,
1284 const css::uno::Reference
<
1285 css::rdf::XURI
> & i_xBaseURI
,
1286 const css::uno::Reference
<
1287 css::task::XInteractionHandler
> & i_xHandler
)
1288 throw (css::uno::RuntimeException
,
1289 css::lang::IllegalArgumentException
,
1290 css::lang::WrappedTargetException
);
1291 virtual void SAL_CALL
storeMetadataToStorage(
1292 const css::uno::Reference
<
1293 css::embed::XStorage
> & i_xStorage
)
1294 throw (css::uno::RuntimeException
,
1295 css::lang::IllegalArgumentException
,
1296 css::lang::WrappedTargetException
);
1297 virtual void SAL_CALL
loadMetadataFromMedium(
1298 const css::uno::Sequence
<
1299 css::beans::PropertyValue
> & i_rMedium
)
1300 throw (css::uno::RuntimeException
,
1301 css::lang::IllegalArgumentException
,
1302 css::lang::WrappedTargetException
);
1303 virtual void SAL_CALL
storeMetadataToMedium(
1304 const css::uno::Sequence
<
1305 css::beans::PropertyValue
> & i_rMedium
)
1306 throw (css::uno::RuntimeException
,
1307 css::lang::IllegalArgumentException
,
1308 css::lang::WrappedTargetException
);
1312 virtual css::uno::Sequence
< css::document::CmisProperty
>
1313 SAL_CALL
getCmisProperties()
1314 throw (css::uno::RuntimeException
);
1315 virtual void SAL_CALL
setCmisProperties(
1316 const css::uno::Sequence
<
1317 css::document::CmisProperty
>& _cmisproperties
)
1318 throw (css::uno::RuntimeException
);
1320 virtual void SAL_CALL
updateCmisProperties(
1321 const css::uno::Sequence
<
1322 css::document::CmisProperty
>& _cmisproperties
)
1323 throw (css::uno::RuntimeException
);
1325 virtual css::uno::Sequence
< css::document::CmisVersion
> SAL_CALL
getAllVersions ( )
1326 throw (css::uno::RuntimeException
);
1328 virtual void SAL_CALL
checkOut( ) throw ( css::uno::RuntimeException
);
1329 virtual void SAL_CALL
cancelCheckOut( ) throw ( css::uno::RuntimeException
);
1330 virtual void SAL_CALL
checkIn( sal_Bool bIsMajor
, const OUString
& rMessage
)
1331 throw ( css::uno::RuntimeException
);
1333 virtual sal_Bool SAL_CALL
isVersionable( ) throw ( css::uno::RuntimeException
);
1334 virtual sal_Bool SAL_CALL
canCheckOut( ) throw ( css::uno::RuntimeException
);
1335 virtual sal_Bool SAL_CALL
canCancelCheckOut( ) throw ( css::uno::RuntimeException
);
1336 virtual sal_Bool SAL_CALL
canCheckIn( ) throw ( css::uno::RuntimeException
);
1338 sal_Bool
getBoolPropertyValue( const OUString
& rName
) throw ( css::uno::RuntimeException
);
1340 //____________________________________________________________________________________________________
1342 //____________________________________________________________________________________________________
1344 /**___________________________________________________________________________________________________
1357 void Notify( SfxBroadcaster
& aBC
,
1358 const SfxHint
& aHint
) ;
1360 //____________________________________________________________________________________________________
1362 //____________________________________________________________________________________________________
1364 /**___________________________________________________________________________________________________
1379 /**___________________________________________________________________________________________________
1392 SfxObjectShell
* GetObjectShell() const ;
1394 SAL_DLLPRIVATE sal_Bool
impl_isDisposed() const ;
1395 sal_Bool
IsInitialized() const;
1396 sal_Bool
IsDisposed() const { return impl_isDisposed(); }
1397 void MethodEntryCheck( const bool i_mustBeInitialized
) const;
1398 ::osl::Mutex
& getMutex() const { return m_aMutex
; }
1400 css::uno::Reference
< css::container::XIndexAccess
> SAL_CALL
getViewData() throw (css::uno::RuntimeException
);
1401 void SAL_CALL
setViewData( const css::uno::Reference
< css::container::XIndexAccess
>& aData
) throw (css::uno::RuntimeException
);
1403 /** calls all XEventListeners */
1404 void notifyEvent( const css::document::EventObject
& aEvent
) const;
1406 /** returns true if someone added a XEventListener to this XEventBroadcaster */
1407 sal_Bool
hasEventListeners() const;
1411 /* returns a unique id for the model that is valid as long as the document
1412 is loaded. The id is not saved across document close/reload. */
1413 OUString
getRuntimeUID() const;
1415 /* returns true if the document signatures are valid, otherwise false */
1416 sal_Bool
hasValidSignatures() const;
1418 /* GrabBagItem for interim interop purposes */
1419 void getGrabBagItem(com::sun::star::uno::Any
& rVal
) const;
1421 void setGrabBagItem(const com::sun::star::uno::Any
& rVal
);
1423 //________________________________________________________________________________________________________
1425 //________________________________________________________________________________________________________
1429 /**___________________________________________________________________________________________________
1442 css::uno::Reference
< css::ui::XUIConfigurationManager2
> getUIConfigurationManager2() throw ( css::uno::RuntimeException
);
1443 bool impl_getPrintHelper();
1444 SAL_DLLPRIVATE
void ListenForStorage_Impl( const css::uno::Reference
< css::embed::XStorage
>& xStorage
);
1445 SAL_DLLPRIVATE OUString
GetMediumFilterName_Impl();
1447 SAL_DLLPRIVATE
void impl_store( const OUString
& sURL
,
1448 const css::uno::Sequence
< css::beans::PropertyValue
>& seqArguments
,
1449 sal_Bool bSaveTo
) ;
1451 SAL_DLLPRIVATE
void postEvent_Impl( const OUString
& aName
, const css::uno::Reference
< css::frame::XController2
>& xController
= css::uno::Reference
< css::frame::XController2
>() );
1453 SAL_DLLPRIVATE OUString
getEventName_Impl( long nID
);
1454 SAL_DLLPRIVATE
bool QuerySaveSizeExceededModules( const com::sun::star::uno::Reference
< com::sun::star::task::XInteractionHandler
>& xHandler
);
1456 SAL_DLLPRIVATE
css::uno::Reference
< css::frame::XTitle
> impl_getTitleHelper ();
1457 SAL_DLLPRIVATE
css::uno::Reference
< css::frame::XUntitledNumbers
> impl_getUntitledHelper ();
1459 SAL_DLLPRIVATE SfxViewFrame
* FindOrCreateViewFrame_Impl(
1460 const css::uno::Reference
< css::frame::XFrame
>& i_rFrame
,
1461 ::sfx::intern::ViewCreationGuard
& i_rGuard
1464 SAL_DLLPRIVATE
void NotifyModifyListeners_Impl() const;
1466 SAL_DLLPRIVATE
void loadCmisProperties();
1468 SAL_DLLPRIVATE
void handleLoadError( sal_uInt32 nError
, SfxMedium
* pMedium
);
1470 //________________________________________________________________________________________________________
1471 // private variables and methods
1472 //________________________________________________________________________________________________________
1476 IMPL_SfxBaseModel_DataContainer
* m_pData
;
1477 // cannot be held in m_pData, since it needs to be accessed in non-threadsafe context
1478 const bool m_bSupportEmbeddedScripts
;
1479 const bool m_bSupportDocRecovery
;
1481 } ; // class SfxBaseModel
1483 /** base class for sub components of an SfxBaseModel, which share their ref count and lifetime with the SfxBaseModel
1485 class SFX2_DLLPUBLIC SfxModelSubComponent
1488 /** checks whether the instance is alive, i.e. properly initialized, and not yet disposed
1490 void MethodEntryCheck()
1492 m_rModel
.MethodEntryCheck( true );
1495 // called when the SfxBaseModel which the component is superordinate of is being disposed
1496 virtual void disposing();
1499 SfxModelSubComponent( SfxBaseModel
& i_model
)
1500 :m_rModel( i_model
)
1503 virtual ~SfxModelSubComponent();
1505 // helpers for implementing XInterface - delegates ref counting to the SfxBaseModel
1506 void acquire() { m_rModel
.acquire(); }
1507 void release() { m_rModel
.release(); }
1509 bool isDisposed() const { return m_rModel
.IsDisposed(); }
1512 const SfxBaseModel
& getBaseModel() const { return m_rModel
; }
1513 SfxBaseModel
& getBaseModel() { return m_rModel
; }
1515 ::osl::Mutex
& getMutex() { return m_rModel
.getMutex(); }
1518 SfxBaseModel
& m_rModel
;
1521 class SFX2_DLLPUBLIC SfxModelGuard
1524 enum AllowedModelState
1526 // not yet initialized
1528 // fully alive, i.e. initialized, and not yet disposed
1532 SfxModelGuard( SfxBaseModel
& i_rModel
, const AllowedModelState i_eState
= E_FULLY_ALIVE
)
1535 i_rModel
.MethodEntryCheck( i_eState
!= E_INITIALIZING
);
1537 SfxModelGuard( SfxModelSubComponent
& i_rSubComponent
)
1540 i_rSubComponent
.MethodEntryCheck();
1557 SolarMutexResettableGuard m_aGuard
;
1560 #endif // INCLUDED_SFX2_SFXBASEMODEL_HXX
1562 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */