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 _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>
92 #include <svl/lstner.hxx>
97 class SfxObjectShell
;
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 /**_______________________________________________________________________________________________________
116 document::XDocumentPropertiesSupplier
117 rdf::XDocumentMetadataAccess
123 document::XEventBroadcaster
124 document::XEventsSupplier
125 document::XEmbeddedScripts
126 document::XScriptInvocationContext
130 @base cppu::BaseMutex
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
164 , css::frame::XTitleChangeBroadcaster
165 , css::frame::XUntitledNumbers
168 class SFX2_DLLPUBLIC SfxBaseModel
: protected ::cppu::BaseMutex
169 , public SfxBaseModel_Base
173 //________________________________________________________________________________________________________
175 //________________________________________________________________________________________________________
179 //____________________________________________________________________________________________________
180 // constructor/destructor
181 //____________________________________________________________________________________________________
183 /**___________________________________________________________________________________________________
196 SfxBaseModel( SfxObjectShell
*pObjektShell
= NULL
) ;
198 /**___________________________________________________________________________________________________
211 virtual ~SfxBaseModel() ;
213 //____________________________________________________________________________________________________
215 //____________________________________________________________________________________________________
217 /**___________________________________________________________________________________________________
218 @short give answer, if interface is supported
219 @descr The interfaces are searched by type.
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
243 @onerror A RuntimeException is thrown.
246 virtual void SAL_CALL
acquire() throw() ;
248 /**___________________________________________________________________________________________________
249 @short decrement refcount
259 @onerror A RuntimeException is thrown.
262 virtual void SAL_CALL
release() throw() ;
264 //____________________________________________________________________________________________________
266 //____________________________________________________________________________________________________
268 /**___________________________________________________________________________________________________
269 @short get information about supported interfaces
272 @seealso XTypeProvider
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
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 //____________________________________________________________________________________________________
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 //____________________________________________________________________________________________________
333 //____________________________________________________________________________________________________
335 /**___________________________________________________________________________________________________
348 virtual css::uno::Reference
< css::uno::XInterface
> SAL_CALL
getParent() throw( css::uno::RuntimeException
) ;
350 /**___________________________________________________________________________________________________
363 virtual void SAL_CALL
setParent( const css::uno::Reference
< css::uno::XInterface
>& xParent
) throw(css::lang::NoSupportException
,
364 css::uno::RuntimeException
);
366 //____________________________________________________________________________________________________
368 //____________________________________________________________________________________________________
370 /**___________________________________________________________________________________________________
383 virtual void SAL_CALL
dispose() throw (css::uno::RuntimeException
);
385 /**___________________________________________________________________________________________________
398 virtual void SAL_CALL
addEventListener(const css::uno::Reference
< css::lang::XEventListener
>& aListener
) throw (css::uno::RuntimeException
);
400 /**___________________________________________________________________________________________________
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 //____________________________________________________________________________________________________
422 //____________________________________________________________________________________________________
424 /**___________________________________________________________________________________________________
437 virtual void SAL_CALL
disposing( const css::lang::EventObject
& aEvent
) throw (css::uno::RuntimeException
);
439 //____________________________________________________________________________________________________
441 //____________________________________________________________________________________________________
443 /**___________________________________________________________________________________________________
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 /**___________________________________________________________________________________________________
473 virtual OUString SAL_CALL
getURL() throw (css::uno::RuntimeException
);
475 /**___________________________________________________________________________________________________
488 virtual css::uno::Sequence
< css::beans::PropertyValue
> SAL_CALL
getArgs() throw (css::uno::RuntimeException
);
490 /**___________________________________________________________________________________________________
503 virtual void SAL_CALL
connectController( const css::uno::Reference
< css::frame::XController
>& xController
) throw (css::uno::RuntimeException
);
505 /**___________________________________________________________________________________________________
518 virtual void SAL_CALL
disconnectController( const css::uno::Reference
< css::frame::XController
>& xController
) throw (css::uno::RuntimeException
);
520 /**___________________________________________________________________________________________________
533 virtual void SAL_CALL
lockControllers() throw (css::uno::RuntimeException
);
535 /**___________________________________________________________________________________________________
548 virtual void SAL_CALL
unlockControllers() throw (css::uno::RuntimeException
);
550 /**___________________________________________________________________________________________________
563 virtual sal_Bool SAL_CALL
hasControllersLocked() throw (css::uno::RuntimeException
);
565 /**___________________________________________________________________________________________________
578 virtual css::uno::Reference
< css::frame::XController
> SAL_CALL
getCurrentController() throw (css::uno::RuntimeException
);
580 /**___________________________________________________________________________________________________
593 virtual void SAL_CALL
setCurrentController( const css::uno::Reference
< css::frame::XController
>& xController
)
594 throw (css::container::NoSuchElementException
, css::uno::RuntimeException
);
596 /**___________________________________________________________________________________________________
609 virtual css::uno::Reference
< css::uno::XInterface
> SAL_CALL
getCurrentSelection() throw (css::uno::RuntimeException
);
611 //____________________________________________________________________________________________________
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 //____________________________________________________________________________________________________
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 /**___________________________________________________________________________________________________
653 virtual sal_Bool SAL_CALL
isModified() throw (css::uno::RuntimeException
);
655 /**___________________________________________________________________________________________________
668 virtual void SAL_CALL
setModified( sal_Bool bModified
)
669 throw (css::beans::PropertyVetoException
, css::uno::RuntimeException
);
671 /**___________________________________________________________________________________________________
684 virtual void SAL_CALL
addModifyListener( const css::uno::Reference
< css::util::XModifyListener
>& xListener
) throw( css::uno::RuntimeException
) ;
686 /**___________________________________________________________________________________________________
699 virtual void SAL_CALL
removeModifyListener(const css::uno::Reference
< css::util::XModifyListener
> & xListener
) throw( css::uno::RuntimeException
) ;
701 //____________________________________________________________________________________________________
703 //____________________________________________________________________________________________________
705 virtual void SAL_CALL
close( sal_Bool bDeliverOwnership
) throw (css::util::CloseVetoException
, css::uno::RuntimeException
);
707 //____________________________________________________________________________________________________
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 //____________________________________________________________________________________________________
723 //____________________________________________________________________________________________________
725 /**___________________________________________________________________________________________________
738 virtual css::uno::Sequence
< css::beans::PropertyValue
> SAL_CALL
getPrinter() throw (css::uno::RuntimeException
);
740 /**___________________________________________________________________________________________________
753 virtual void SAL_CALL
setPrinter( const css::uno::Sequence
< css::beans::PropertyValue
>& seqPrinter
)
754 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
);
755 /**___________________________________________________________________________________________________
768 virtual void SAL_CALL
print( const css::uno::Sequence
< css::beans::PropertyValue
>& seqOptions
)
769 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
);
771 //____________________________________________________________________________________________________
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 //____________________________________________________________________________________________________
780 //____________________________________________________________________________________________________
782 /**___________________________________________________________________________________________________
795 virtual sal_Bool SAL_CALL
hasLocation() throw (css::uno::RuntimeException
);
797 /**___________________________________________________________________________________________________
810 virtual OUString SAL_CALL
getLocation() throw (css::uno::RuntimeException
);
812 /**___________________________________________________________________________________________________
825 virtual sal_Bool SAL_CALL
isReadonly() throw (css::uno::RuntimeException
);
827 /**___________________________________________________________________________________________________
840 virtual void SAL_CALL
store() throw (css::io::IOException
, css::uno::RuntimeException
);
842 /**___________________________________________________________________________________________________
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 /**___________________________________________________________________________________________________
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 //____________________________________________________________________________________________________
880 //____________________________________________________________________________________________________
882 /**___________________________________________________________________________________________________
895 virtual void SAL_CALL
initNew()
896 throw (css::frame::DoubleInitializationException
,
897 css::io::IOException
,
898 css::uno::RuntimeException
,
899 css::uno::Exception
);
901 /**___________________________________________________________________________________________________
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
,
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
,
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
,
953 css::uno::RuntimeException
);
955 virtual css::uno::Reference
< css::embed::XStorage
> SAL_CALL
getDocumentStorage()
956 throw ( css::io::IOException
,
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 //____________________________________________________________________________________________________
970 //____________________________________________________________________________________________________
972 virtual void SAL_CALL
setVisualAreaSize( sal_Int64 nAspect
, const css::awt::Size
& aSize
)
973 throw ( css::lang::IllegalArgumentException
,
974 css::embed::WrongStateException
,
976 css::uno::RuntimeException
);
978 virtual css::awt::Size SAL_CALL
getVisualAreaSize( sal_Int64 nAspect
)
979 throw ( css::lang::IllegalArgumentException
,
980 css::embed::WrongStateException
,
982 css::uno::RuntimeException
);
984 virtual css::embed::VisualRepresentation SAL_CALL
getPreferredVisualRepresentation( ::sal_Int64 nAspect
)
985 throw ( css::lang::IllegalArgumentException
,
986 css::embed::WrongStateException
,
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 //____________________________________________________________________________________________________
1007 //____________________________________________________________________________________________________
1009 /**___________________________________________________________________________________________________
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 /**___________________________________________________________________________________________________
1041 virtual css::uno::Sequence
< css::datatransfer::DataFlavor
> SAL_CALL
getTransferDataFlavors()
1042 throw (css::uno::RuntimeException
);
1044 /**___________________________________________________________________________________________________
1057 virtual sal_Bool SAL_CALL
isDataFlavorSupported( const css::datatransfer::DataFlavor
& aFlavor
)
1058 throw (css::uno::RuntimeException
);
1061 //____________________________________________________________________________________________________
1063 //____________________________________________________________________________________________________
1065 /**___________________________________________________________________________________________________
1067 @descr - offers a list of event handlers which are be bound to events of
1073 @return - an <type>Events</type> object.
1078 virtual css::uno::Reference
< css::container::XNameReplace
> SAL_CALL
getEvents() throw( css::uno::RuntimeException
);
1081 //____________________________________________________________________________________________________
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 /**___________________________________________________________________________________________________
1101 @descr - registers the given <type>XEventListener</type>.
1112 virtual void SAL_CALL
addEventListener( const css::uno::Reference
< css::document::XEventListener
>& xListener
) throw( css::uno::RuntimeException
);
1114 /**___________________________________________________________________________________________________
1116 @descr - unregisters the given <type>XEventListener</type>.
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 //____________________________________________________________________________________________________
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
);
1152 virtual OUString SAL_CALL
getTitle()
1153 throw (css::uno::RuntimeException
);
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 //____________________________________________________________________________________________________
1204 virtual OUString SAL_CALL
getStringValue()
1205 throw (css::uno::RuntimeException
);
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
>
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
>
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
);
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 //____________________________________________________________________________________________________
1339 //____________________________________________________________________________________________________
1341 /**___________________________________________________________________________________________________
1354 void Notify( SfxBroadcaster
& aBC
,
1355 const SfxHint
& aHint
) ;
1357 //____________________________________________________________________________________________________
1359 //____________________________________________________________________________________________________
1361 /**___________________________________________________________________________________________________
1376 /**___________________________________________________________________________________________________
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;
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 //________________________________________________________________________________________________________
1417 //________________________________________________________________________________________________________
1421 /**___________________________________________________________________________________________________
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
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 //________________________________________________________________________________________________________
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
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();
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(); }
1504 const SfxBaseModel
& getBaseModel() const { return m_rModel
; }
1505 SfxBaseModel
& getBaseModel() { return m_rModel
; }
1507 ::osl::Mutex
& getMutex() { return m_rModel
.getMutex(); }
1510 SfxBaseModel
& m_rModel
;
1513 class SFX2_DLLPUBLIC SfxModelGuard
1516 enum AllowedModelState
1518 // not yet initialized
1520 // fully alive, i.e. initialized, and not yet disposed
1524 SfxModelGuard( SfxBaseModel
& i_rModel
, const AllowedModelState i_eState
= E_FULLY_ALIVE
)
1527 i_rModel
.MethodEntryCheck( i_eState
!= E_INITIALIZING
);
1529 SfxModelGuard( SfxModelSubComponent
& i_rSubComponent
)
1532 i_rSubComponent
.MethodEntryCheck();
1549 SolarMutexResettableGuard m_aGuard
;
1552 #endif // _SFX_SFXBASEMODEL_HXX_
1554 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */