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>
87 #include <cppuhelper/implbase.hxx>
88 #include <svl/lstner.hxx>
93 class SfxObjectShell
;
96 struct IMPL_SfxBaseModel_DataContainer
; // impl. struct to hold member of class SfxBaseModel
98 namespace sfx
{ namespace intern
{
99 class ViewCreationGuard
;
102 // class declarations
105 /**_______________________________________________________________________________________________________
108 document::XDocumentPropertiesSupplier
109 rdf::XDocumentMetadataAccess
115 document::XEventBroadcaster
116 document::XEventsSupplier
117 document::XEmbeddedScripts
118 document::XScriptInvocationContext
122 @base cppu::BaseMutex
126 typedef ::cppu::WeakImplHelper
< css::container::XChild
127 , css::document::XDocumentPropertiesSupplier
128 , css::document::XCmisDocument
129 , css::rdf::XDocumentMetadataAccess
130 , css::document::XDocumentRecovery
131 , css::document::XUndoManagerSupplier
132 , css::document::XEventBroadcaster
133 , css::document::XDocumentEventBroadcaster
134 , css::lang::XEventListener
135 , css::document::XEventsSupplier
136 , css::document::XEmbeddedScripts
137 , css::document::XScriptInvocationContext
138 , css::frame::XModel2
139 , css::util::XModifiable2
140 , css::view::XPrintable
141 , css::view::XPrintJobBroadcaster
142 , css::frame::XStorable2
143 , css::frame::XLoadable
144 , css::script::XStarBasicAccess
145 , css::document::XViewDataSupplier
146 , css::util::XCloseable
// => css::util::XCloseBroadcaster
147 , css::datatransfer::XTransferable
148 , css::document::XDocumentSubStorageSupplier
149 , css::document::XStorageBasedDocument
150 , css::script::provider::XScriptProviderSupplier
151 , css::ui::XUIConfigurationManagerSupplier
152 , css::embed::XVisualObject
153 , css::lang::XUnoTunnel
154 , css::frame::XModule
156 , css::frame::XTitleChangeBroadcaster
157 , css::frame::XUntitledNumbers
160 class SFX2_DLLPUBLIC SfxBaseModel
: protected ::cppu::BaseMutex
161 , public SfxBaseModel_Base
172 // constructor/destructor
175 SfxBaseModel( SfxObjectShell
*pObjectShell
= nullptr ) ;
177 virtual ~SfxBaseModel() ;
183 /**___________________________________________________________________________________________________
184 @short give answer, if interface is supported
185 @descr The interfaces are searched by type.
189 @param "rType" is the type of searched interface.
191 @return Any information about found interface
193 @onerror A RuntimeException is thrown.
196 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) throw( css::uno::RuntimeException
, std::exception
) override
;
198 /**___________________________________________________________________________________________________
199 @short increment refcount
202 @onerror A RuntimeException is thrown.
205 virtual void SAL_CALL
acquire() throw() override
;
207 /**___________________________________________________________________________________________________
208 @short decrement refcount
211 @onerror A RuntimeException is thrown.
214 virtual void SAL_CALL
release() throw() override
;
220 /**___________________________________________________________________________________________________
221 @short get information about supported interfaces
222 @seealso XTypeProvider
223 @return Sequence of types of all supported interfaces
225 @onerror A RuntimeException is thrown.
228 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() throw( css::uno::RuntimeException
, std::exception
) override
;
230 /**___________________________________________________________________________________________________
231 @short get implementation id
232 @descr This ID is necessary for UNO-caching. If there no ID, cache is disabled.
233 Another way, cache is enabled.
235 @seealso XTypeProvider
236 @return ID as Sequence of byte
238 @onerror A RuntimeException is thrown.
241 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() throw( css::uno::RuntimeException
, std::exception
) override
;
247 /**___________________________________________________________________________________________________
248 @seealso XStarBasicAccess
250 virtual css::uno::Reference
< css::container::XNameContainer
> SAL_CALL
getLibraryContainer() throw( css::uno::RuntimeException
, std::exception
) override
;
252 /**___________________________________________________________________________________________________
253 @seealso XStarBasicAccess
255 virtual void SAL_CALL
createLibrary( const OUString
& LibName
, const OUString
& Password
,
256 const OUString
& ExternalSourceURL
, const OUString
& LinkTargetURL
)
257 throw(css::container::ElementExistException
, css::uno::RuntimeException
, std::exception
) override
;
259 /**___________________________________________________________________________________________________
260 @seealso XStarBasicAccess
262 virtual void SAL_CALL
addModule( const OUString
& LibraryName
, const OUString
& ModuleName
,
263 const OUString
& Language
, const OUString
& Source
)
264 throw( css::container::NoSuchElementException
, css::uno::RuntimeException
, std::exception
) override
;
266 /**___________________________________________________________________________________________________
267 @seealso XStarBasicAccess
269 virtual void SAL_CALL
addDialog( const OUString
& LibraryName
, const OUString
& DialogName
,
270 const css::uno::Sequence
< sal_Int8
>& Data
)
271 throw(css::container::NoSuchElementException
, css::uno::RuntimeException
, std::exception
) override
;
277 virtual css::uno::Reference
< css::uno::XInterface
> SAL_CALL
getParent() throw( css::uno::RuntimeException
, std::exception
) override
;
279 virtual void SAL_CALL
setParent( const css::uno::Reference
< css::uno::XInterface
>& xParent
) throw(css::lang::NoSupportException
,
280 css::uno::RuntimeException
, std::exception
) override
;
286 virtual void SAL_CALL
dispose() throw (css::uno::RuntimeException
, std::exception
) override
;
288 virtual void SAL_CALL
addEventListener(const css::uno::Reference
< css::lang::XEventListener
>& aListener
) throw (css::uno::RuntimeException
, std::exception
) override
;
290 virtual void SAL_CALL
removeEventListener(const css::uno::Reference
< css::lang::XEventListener
>& aListener
) throw (css::uno::RuntimeException
, std::exception
) override
;
292 // XDocumentPropertiesSupplier
293 virtual css::uno::Reference
< css::document::XDocumentProperties
>
294 SAL_CALL
getDocumentProperties()
295 throw (css::uno::RuntimeException
, std::exception
) override
;
301 virtual void SAL_CALL
disposing( const css::lang::EventObject
& aEvent
) throw (css::uno::RuntimeException
, std::exception
) override
;
307 virtual sal_Bool SAL_CALL
attachResource(const OUString
& sURL
,
308 const css::uno::Sequence
< css::beans::PropertyValue
>& aArgs
)
309 throw (css::uno::RuntimeException
, std::exception
) override
;
311 virtual OUString SAL_CALL
getURL() throw (css::uno::RuntimeException
, std::exception
) override
;
313 virtual css::uno::Sequence
< css::beans::PropertyValue
> SAL_CALL
getArgs() throw (css::uno::RuntimeException
, std::exception
) override
;
315 virtual void SAL_CALL
connectController( const css::uno::Reference
< css::frame::XController
>& xController
) throw (css::uno::RuntimeException
, std::exception
) override
;
317 virtual void SAL_CALL
disconnectController( const css::uno::Reference
< css::frame::XController
>& xController
) throw (css::uno::RuntimeException
, std::exception
) override
;
319 virtual void SAL_CALL
lockControllers() throw (css::uno::RuntimeException
, std::exception
) override
;
321 virtual void SAL_CALL
unlockControllers() throw (css::uno::RuntimeException
, std::exception
) override
;
323 virtual sal_Bool SAL_CALL
hasControllersLocked() throw (css::uno::RuntimeException
, std::exception
) override
;
325 virtual css::uno::Reference
< css::frame::XController
> SAL_CALL
getCurrentController() throw (css::uno::RuntimeException
, std::exception
) override
;
327 virtual void SAL_CALL
setCurrentController( const css::uno::Reference
< css::frame::XController
>& xController
)
328 throw (css::container::NoSuchElementException
, css::uno::RuntimeException
, std::exception
) override
;
330 virtual css::uno::Reference
< css::uno::XInterface
> SAL_CALL
getCurrentSelection() throw (css::uno::RuntimeException
, std::exception
) override
;
335 virtual css::uno::Reference
< css::container::XEnumeration
> SAL_CALL
getControllers()
336 throw (css::uno::RuntimeException
, std::exception
) override
;
338 virtual css::uno::Sequence
< OUString
> SAL_CALL
getAvailableViewControllerNames()
339 throw (css::uno::RuntimeException
, std::exception
) override
;
341 virtual css::uno::Reference
< css::frame::XController2
> SAL_CALL
createDefaultViewController(const css::uno::Reference
< css::frame::XFrame
>& Frame
)
342 throw (css::uno::RuntimeException
,
343 css::lang::IllegalArgumentException
,
344 css::uno::Exception
, std::exception
) override
;
346 virtual css::uno::Reference
< css::frame::XController2
> SAL_CALL
createViewController(const OUString
& ViewName
,
347 const css::uno::Sequence
< css::beans::PropertyValue
>& Arguments
,
348 const css::uno::Reference
< css::frame::XFrame
>& Frame
)
349 throw (css::uno::RuntimeException
,
350 css::lang::IllegalArgumentException
,
351 css::uno::Exception
, std::exception
) override
;
357 virtual sal_Bool SAL_CALL
disableSetModified( ) throw (css::uno::RuntimeException
, std::exception
) override
;
358 virtual sal_Bool SAL_CALL
enableSetModified( ) throw (css::uno::RuntimeException
, std::exception
) override
;
359 virtual sal_Bool SAL_CALL
isSetModifiedEnabled( ) throw (css::uno::RuntimeException
, std::exception
) override
;
361 virtual sal_Bool SAL_CALL
isModified() throw (css::uno::RuntimeException
, std::exception
) override
;
363 virtual void SAL_CALL
setModified( sal_Bool bModified
)
364 throw (css::beans::PropertyVetoException
, css::uno::RuntimeException
, std::exception
) override
;
366 virtual void SAL_CALL
addModifyListener( const css::uno::Reference
< css::util::XModifyListener
>& xListener
) throw( css::uno::RuntimeException
, std::exception
) override
;
368 virtual void SAL_CALL
removeModifyListener(const css::uno::Reference
< css::util::XModifyListener
> & xListener
) throw( css::uno::RuntimeException
, std::exception
) override
;
374 virtual void SAL_CALL
close( sal_Bool bDeliverOwnership
) throw (css::util::CloseVetoException
, css::uno::RuntimeException
, std::exception
) override
;
380 virtual void SAL_CALL
addCloseListener( const css::uno::Reference
< css::util::XCloseListener
>& xListener
) throw (css::uno::RuntimeException
, std::exception
) override
;
381 virtual void SAL_CALL
removeCloseListener( const css::uno::Reference
< css::util::XCloseListener
>& xListener
) throw (css::uno::RuntimeException
, std::exception
) override
;
384 // XPrintJobBroadcaster
387 virtual void SAL_CALL
addPrintJobListener( const css::uno::Reference
< css::view::XPrintJobListener
>& xListener
) throw (css::uno::RuntimeException
, std::exception
) override
;
388 virtual void SAL_CALL
removePrintJobListener( const css::uno::Reference
< css::view::XPrintJobListener
>& xListener
) throw (css::uno::RuntimeException
, std::exception
) override
;
394 virtual css::uno::Sequence
< css::beans::PropertyValue
> SAL_CALL
getPrinter() throw (css::uno::RuntimeException
, std::exception
) override
;
396 virtual void SAL_CALL
setPrinter( const css::uno::Sequence
< css::beans::PropertyValue
>& seqPrinter
)
397 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
, std::exception
) override
;
398 virtual void SAL_CALL
print( const css::uno::Sequence
< css::beans::PropertyValue
>& seqOptions
)
399 throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
, std::exception
) override
;
405 virtual void SAL_CALL
storeSelf( const css::uno::Sequence
< css::beans::PropertyValue
>& seqArguments
)
406 throw (css::lang::IllegalArgumentException
, css::io::IOException
, css::uno::RuntimeException
, std::exception
) override
;
412 virtual sal_Bool SAL_CALL
hasLocation() throw (css::uno::RuntimeException
, std::exception
) override
;
414 virtual OUString SAL_CALL
getLocation() throw (css::uno::RuntimeException
, std::exception
) override
;
416 virtual sal_Bool SAL_CALL
isReadonly() throw (css::uno::RuntimeException
, std::exception
) override
;
418 virtual void SAL_CALL
store() throw (css::io::IOException
, css::uno::RuntimeException
, std::exception
) override
;
420 virtual void SAL_CALL
storeAsURL( const OUString
& sURL
,
421 const css::uno::Sequence
< css::beans::PropertyValue
>& seqArguments
)
422 throw (css::io::IOException
, css::uno::RuntimeException
, std::exception
) override
;
424 virtual void SAL_CALL
storeToURL( const OUString
& sURL
,
425 const css::uno::Sequence
< css::beans::PropertyValue
>& seqArguments
)
426 throw (css::io::IOException
, css::uno::RuntimeException
, std::exception
) override
;
432 virtual void SAL_CALL
initNew()
433 throw (css::frame::DoubleInitializationException
,
434 css::io::IOException
,
435 css::uno::RuntimeException
,
436 css::uno::Exception
, std::exception
) override
;
438 virtual void SAL_CALL
load( const css::uno::Sequence
< css::beans::PropertyValue
>& seqArguments
)
439 throw (css::frame::DoubleInitializationException
,
440 css::io::IOException
,
441 css::uno::RuntimeException
,
442 css::uno::Exception
, std::exception
) override
;
445 // XDocumentSubStorageSupplier
448 virtual css::uno::Reference
< css::embed::XStorage
> SAL_CALL
getDocumentSubStorage( const OUString
& aStorageName
, sal_Int32 nMode
)
449 throw ( css::uno::RuntimeException
, std::exception
) override
;
451 virtual css::uno::Sequence
< OUString
> SAL_CALL
getDocumentSubStoragesNames()
452 throw ( css::io::IOException
, css::uno::RuntimeException
, std::exception
) override
;
455 // XStorageBasedDocument
458 virtual void SAL_CALL
loadFromStorage( const css::uno::Reference
< css::embed::XStorage
>& xStorage
,
459 const css::uno::Sequence
< css::beans::PropertyValue
>& aMediaDescriptor
)
460 throw ( css::lang::IllegalArgumentException
,
461 css::frame::DoubleInitializationException
,
462 css::io::IOException
,
464 css::uno::RuntimeException
, std::exception
) override
;
466 virtual void SAL_CALL
storeToStorage( const css::uno::Reference
< css::embed::XStorage
>& xStorage
,
467 const css::uno::Sequence
< css::beans::PropertyValue
>& aMediaDescriptor
)
468 throw ( css::lang::IllegalArgumentException
,
469 css::io::IOException
,
471 css::uno::RuntimeException
, std::exception
) override
;
473 virtual void SAL_CALL
switchToStorage( const css::uno::Reference
< css::embed::XStorage
>& xStorage
)
474 throw ( css::lang::IllegalArgumentException
,
475 css::io::IOException
,
477 css::uno::RuntimeException
, std::exception
) override
;
479 virtual css::uno::Reference
< css::embed::XStorage
> SAL_CALL
getDocumentStorage()
480 throw ( css::io::IOException
,
482 css::uno::RuntimeException
, std::exception
) override
;
484 virtual void SAL_CALL
addStorageChangeListener(
485 const css::uno::Reference
< css::document::XStorageChangeListener
>& xListener
)
486 throw ( css::uno::RuntimeException
, std::exception
) override
;
488 virtual void SAL_CALL
removeStorageChangeListener(
489 const css::uno::Reference
< css::document::XStorageChangeListener
>& xListener
)
490 throw ( css::uno::RuntimeException
, std::exception
) override
;
496 virtual void SAL_CALL
setVisualAreaSize( sal_Int64 nAspect
, const css::awt::Size
& aSize
)
497 throw ( css::lang::IllegalArgumentException
,
498 css::embed::WrongStateException
,
500 css::uno::RuntimeException
, std::exception
) override
;
502 virtual css::awt::Size SAL_CALL
getVisualAreaSize( sal_Int64 nAspect
)
503 throw ( css::lang::IllegalArgumentException
,
504 css::embed::WrongStateException
,
506 css::uno::RuntimeException
, std::exception
) override
;
508 virtual css::embed::VisualRepresentation SAL_CALL
getPreferredVisualRepresentation( ::sal_Int64 nAspect
)
509 throw ( css::lang::IllegalArgumentException
,
510 css::embed::WrongStateException
,
512 css::uno::RuntimeException
, std::exception
) override
;
514 virtual sal_Int32 SAL_CALL
getMapUnit( sal_Int64 nAspect
)
515 throw ( css::uno::Exception
,
516 css::uno::RuntimeException
, std::exception
) override
;
519 // XScriptProviderSupplier
522 virtual css::uno::Reference
< css::script::provider::XScriptProvider
> SAL_CALL
getScriptProvider() throw ( css::uno::RuntimeException
, std::exception
) override
;
525 // XUIConfigurationManagerSupplier
526 virtual css::uno::Reference
< css::ui::XUIConfigurationManager
> SAL_CALL
getUIConfigurationManager() throw ( css::uno::RuntimeException
, std::exception
) override
;
532 virtual css::uno::Any SAL_CALL
getTransferData( const css::datatransfer::DataFlavor
& aFlavor
)
533 throw (css::datatransfer::UnsupportedFlavorException
,
534 css::io::IOException
,
535 css::uno::RuntimeException
, std::exception
) override
;
537 virtual css::uno::Sequence
< css::datatransfer::DataFlavor
> SAL_CALL
getTransferDataFlavors()
538 throw (css::uno::RuntimeException
, std::exception
) override
;
540 virtual sal_Bool SAL_CALL
isDataFlavorSupported( const css::datatransfer::DataFlavor
& aFlavor
)
541 throw (css::uno::RuntimeException
, std::exception
) override
;
547 /**___________________________________________________________________________________________________
548 @descr - offers a list of event handlers which are be bound to events of
550 @return - an Events object.
553 virtual css::uno::Reference
< css::container::XNameReplace
> SAL_CALL
getEvents() throw( css::uno::RuntimeException
, std::exception
) override
;
559 virtual css::uno::Reference
< css::script::XStorageBasedLibraryContainer
> SAL_CALL
getBasicLibraries() throw (css::uno::RuntimeException
, std::exception
) override
;
560 virtual css::uno::Reference
< css::script::XStorageBasedLibraryContainer
> SAL_CALL
getDialogLibraries() throw (css::uno::RuntimeException
, std::exception
) override
;
561 virtual sal_Bool SAL_CALL
getAllowMacroExecution() throw (css::uno::RuntimeException
, std::exception
) override
;
564 // XScriptInvocationContext
567 virtual css::uno::Reference
< css::document::XEmbeddedScripts
> SAL_CALL
getScriptContainer() throw (css::uno::RuntimeException
, std::exception
) override
;
573 /**___________________________________________________________________________________________________
574 @descr - registers the given XEventListener.
577 virtual void SAL_CALL
addEventListener( const css::uno::Reference
< css::document::XEventListener
>& xListener
) throw( css::uno::RuntimeException
, std::exception
) override
;
579 /**___________________________________________________________________________________________________
580 @descr - unregisters the given XEventListener.
583 virtual void SAL_CALL
removeEventListener( const css::uno::Reference
< css::document::XEventListener
>& xListener
) throw( css::uno::RuntimeException
, std::exception
) override
;
586 // XDocumentEventBroadcaster
589 virtual void SAL_CALL
addDocumentEventListener( const css::uno::Reference
< css::document::XDocumentEventListener
>& Listener
) throw (css::uno::RuntimeException
, std::exception
) override
;
590 virtual void SAL_CALL
removeDocumentEventListener( const css::uno::Reference
< css::document::XDocumentEventListener
>& Listener
) throw (css::uno::RuntimeException
, std::exception
) override
;
591 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
, std::exception
) override
;
597 virtual sal_Int64 SAL_CALL
getSomething( const css::uno::Sequence
< sal_Int8
>& aIdentifier
) throw(css::uno::RuntimeException
, std::exception
) override
;
600 virtual void SAL_CALL
setIdentifier(const OUString
& sIdentifier
)
601 throw (css::uno::RuntimeException
, std::exception
) override
;
604 virtual OUString SAL_CALL
getIdentifier()
605 throw (css::uno::RuntimeException
, std::exception
) override
;
608 virtual OUString SAL_CALL
getTitle()
609 throw (css::uno::RuntimeException
, std::exception
) override
;
612 virtual void SAL_CALL
setTitle( const OUString
& sTitle
)
613 throw (css::uno::RuntimeException
, std::exception
) override
;
615 // css.frame.XTitleChangeBroadcaster
616 virtual void SAL_CALL
addTitleChangeListener( const css::uno::Reference
< css::frame::XTitleChangeListener
>& xListener
)
617 throw (css::uno::RuntimeException
, std::exception
) override
;
619 // css.frame.XTitleChangeBroadcaster
620 virtual void SAL_CALL
removeTitleChangeListener( const css::uno::Reference
< css::frame::XTitleChangeListener
>& xListener
)
621 throw (css::uno::RuntimeException
, std::exception
) override
;
623 // css.frame.XUntitledNumbers
624 virtual ::sal_Int32 SAL_CALL
leaseNumber( const css::uno::Reference
< css::uno::XInterface
>& xComponent
)
625 throw (css::lang::IllegalArgumentException
,
626 css::uno::RuntimeException
, std::exception
) override
;
628 // css.frame.XUntitledNumbers
629 virtual void SAL_CALL
releaseNumber( ::sal_Int32 nNumber
)
630 throw (css::lang::IllegalArgumentException
,
631 css::uno::RuntimeException
, std::exception
) override
;
633 // css.frame.XUntitledNumbers
634 virtual void SAL_CALL
releaseNumberForComponent( const css::uno::Reference
< css::uno::XInterface
>& xComponent
)
635 throw (css::lang::IllegalArgumentException
,
636 css::uno::RuntimeException
, std::exception
) override
;
638 // css.frame.XUntitledNumbers
639 virtual OUString SAL_CALL
getUntitledPrefix()
640 throw (css::uno::RuntimeException
, std::exception
) override
;
642 // css.document.XDocumentRecovery
643 virtual sal_Bool SAL_CALL
wasModifiedSinceLastSave()
644 throw ( css::uno::RuntimeException
, std::exception
) override
;
645 virtual void SAL_CALL
storeToRecoveryFile( const OUString
& i_TargetLocation
, const css::uno::Sequence
< css::beans::PropertyValue
>& i_MediaDescriptor
)
646 throw ( css::uno::RuntimeException
,
647 css::io::IOException
,
648 css::lang::WrappedTargetException
, std::exception
) override
;
649 virtual void SAL_CALL
recoverFromFile( const OUString
& i_SourceLocation
, const OUString
& i_SalvagedFile
, const css::uno::Sequence
< css::beans::PropertyValue
>& i_MediaDescriptor
)
650 throw ( css::uno::RuntimeException
,
651 css::io::IOException
,
652 css::lang::WrappedTargetException
, std::exception
) override
;
654 // css.document.XUndoManagerSupplier
655 virtual css::uno::Reference
< css::document::XUndoManager
> SAL_CALL
getUndoManager( ) throw (css::uno::RuntimeException
, std::exception
) override
;
659 virtual OUString SAL_CALL
getStringValue()
660 throw (css::uno::RuntimeException
, std::exception
) override
;
663 virtual OUString SAL_CALL
getNamespace()
664 throw (css::uno::RuntimeException
, std::exception
) override
;
665 virtual OUString SAL_CALL
getLocalName()
666 throw (css::uno::RuntimeException
, std::exception
) override
;
668 // css::rdf::XRepositorySupplier:
669 virtual css::uno::Reference
<
670 css::rdf::XRepository
> SAL_CALL
getRDFRepository()
671 throw (css::uno::RuntimeException
, std::exception
) override
;
673 // css::rdf::XDocumentMetadataAccess:
674 virtual css::uno::Reference
<
675 css::rdf::XMetadatable
> SAL_CALL
676 getElementByMetadataReference(
677 const css::beans::StringPair
& i_rReference
)
678 throw (css::uno::RuntimeException
, std::exception
) override
;
679 virtual css::uno::Reference
<
680 css::rdf::XMetadatable
> SAL_CALL
681 getElementByURI(const css::uno::Reference
<
682 css::rdf::XURI
> & i_xURI
)
683 throw (css::uno::RuntimeException
,
684 css::lang::IllegalArgumentException
, std::exception
) override
;
685 virtual css::uno::Sequence
< css::uno::Reference
<
686 css::rdf::XURI
> > SAL_CALL
getMetadataGraphsWithType(
687 const css::uno::Reference
<
688 css::rdf::XURI
> & i_xType
)
689 throw (css::uno::RuntimeException
,
690 css::lang::IllegalArgumentException
, std::exception
) override
;
691 virtual css::uno::Reference
<
692 css::rdf::XURI
> SAL_CALL
693 addMetadataFile(const OUString
& i_rFileName
,
694 const css::uno::Sequence
<
695 css::uno::Reference
< css::rdf::XURI
>
697 throw (css::uno::RuntimeException
,
698 css::lang::IllegalArgumentException
,
699 css::container::ElementExistException
, std::exception
) override
;
700 virtual css::uno::Reference
<
701 css::rdf::XURI
> SAL_CALL
702 importMetadataFile(::sal_Int16 i_Format
,
703 const css::uno::Reference
<
704 css::io::XInputStream
> & i_xInStream
,
705 const OUString
& i_rFileName
,
706 const css::uno::Reference
<
707 css::rdf::XURI
> & i_xBaseURI
,
708 const css::uno::Sequence
<
709 css::uno::Reference
< css::rdf::XURI
>
711 throw (css::uno::RuntimeException
,
712 css::lang::IllegalArgumentException
,
713 css::datatransfer::UnsupportedFlavorException
,
714 css::container::ElementExistException
,
715 css::rdf::ParseException
,
716 css::io::IOException
, std::exception
) override
;
717 virtual void SAL_CALL
removeMetadataFile(
718 const css::uno::Reference
<
719 css::rdf::XURI
> & i_xGraphName
)
720 throw (css::uno::RuntimeException
,
721 css::lang::IllegalArgumentException
,
722 css::container::NoSuchElementException
, std::exception
) override
;
723 virtual void SAL_CALL
addContentOrStylesFile(
724 const OUString
& i_rFileName
)
725 throw (css::uno::RuntimeException
,
726 css::lang::IllegalArgumentException
,
727 css::container::ElementExistException
, std::exception
) override
;
728 virtual void SAL_CALL
removeContentOrStylesFile(
729 const OUString
& i_rFileName
)
730 throw (css::uno::RuntimeException
,
731 css::lang::IllegalArgumentException
,
732 css::container::NoSuchElementException
, std::exception
) override
;
734 virtual void SAL_CALL
loadMetadataFromStorage(
735 const css::uno::Reference
<
736 css::embed::XStorage
> & i_xStorage
,
737 const css::uno::Reference
<
738 css::rdf::XURI
> & i_xBaseURI
,
739 const css::uno::Reference
<
740 css::task::XInteractionHandler
> & i_xHandler
)
741 throw (css::uno::RuntimeException
,
742 css::lang::IllegalArgumentException
,
743 css::lang::WrappedTargetException
, std::exception
) override
;
744 virtual void SAL_CALL
storeMetadataToStorage(
745 const css::uno::Reference
<
746 css::embed::XStorage
> & i_xStorage
)
747 throw (css::uno::RuntimeException
,
748 css::lang::IllegalArgumentException
,
749 css::lang::WrappedTargetException
, std::exception
) override
;
750 virtual void SAL_CALL
loadMetadataFromMedium(
751 const css::uno::Sequence
<
752 css::beans::PropertyValue
> & i_rMedium
)
753 throw (css::uno::RuntimeException
,
754 css::lang::IllegalArgumentException
,
755 css::lang::WrappedTargetException
, std::exception
) override
;
756 virtual void SAL_CALL
storeMetadataToMedium(
757 const css::uno::Sequence
<
758 css::beans::PropertyValue
> & i_rMedium
)
759 throw (css::uno::RuntimeException
,
760 css::lang::IllegalArgumentException
,
761 css::lang::WrappedTargetException
, std::exception
) override
;
765 virtual css::uno::Sequence
< css::document::CmisProperty
>
766 SAL_CALL
getCmisProperties()
767 throw (css::uno::RuntimeException
, std::exception
) override
;
768 virtual void SAL_CALL
setCmisProperties(
769 const css::uno::Sequence
<
770 css::document::CmisProperty
>& _cmisproperties
)
771 throw (css::uno::RuntimeException
, std::exception
) override
;
773 virtual void SAL_CALL
updateCmisProperties(
774 const css::uno::Sequence
<
775 css::document::CmisProperty
>& _cmisproperties
)
776 throw (css::uno::RuntimeException
, std::exception
) override
;
778 virtual css::uno::Sequence
< css::document::CmisVersion
> SAL_CALL
getAllVersions ( )
779 throw (css::uno::RuntimeException
, std::exception
) override
;
781 virtual void SAL_CALL
checkOut( ) throw ( css::uno::RuntimeException
, std::exception
) override
;
782 virtual void SAL_CALL
cancelCheckOut( ) throw ( css::uno::RuntimeException
, std::exception
) override
;
783 virtual void SAL_CALL
checkIn( sal_Bool bIsMajor
, const OUString
& rMessage
)
784 throw ( css::uno::RuntimeException
, std::exception
) override
;
786 virtual sal_Bool SAL_CALL
isVersionable( ) throw ( css::uno::RuntimeException
, std::exception
) override
;
787 virtual sal_Bool SAL_CALL
canCheckOut( ) throw ( css::uno::RuntimeException
, std::exception
) override
;
788 virtual sal_Bool SAL_CALL
canCancelCheckOut( ) throw ( css::uno::RuntimeException
, std::exception
) override
;
789 virtual sal_Bool SAL_CALL
canCheckIn( ) throw ( css::uno::RuntimeException
, std::exception
) override
;
791 bool getBoolPropertyValue( const OUString
& rName
) throw ( css::uno::RuntimeException
);
797 void Notify( SfxBroadcaster
& aBC
,
798 const SfxHint
& aHint
) override
;
806 SfxObjectShell
* GetObjectShell() const ;
808 SAL_DLLPRIVATE
bool impl_isDisposed() const ;
809 bool IsInitialized() const;
810 void MethodEntryCheck( const bool i_mustBeInitialized
) const;
812 css::uno::Reference
< css::container::XIndexAccess
> SAL_CALL
getViewData() throw (css::uno::RuntimeException
, std::exception
) override
;
813 void SAL_CALL
setViewData( const css::uno::Reference
< css::container::XIndexAccess
>& aData
) throw (css::uno::RuntimeException
, std::exception
) override
;
815 /** calls all XEventListeners */
816 void notifyEvent( const css::document::EventObject
& aEvent
) const;
818 /** returns true if someone added a XEventListener to this XEventBroadcaster */
819 bool hasEventListeners() const;
823 /* returns a unique id for the model that is valid as long as the document
824 is loaded. The id is not saved across document close/reload. */
825 OUString
getRuntimeUID() const;
827 /* returns true if the document signatures are valid, otherwise false */
828 bool hasValidSignatures() const;
830 /* GrabBagItem for interim interop purposes */
831 void getGrabBagItem(css::uno::Any
& rVal
) const;
833 void setGrabBagItem(const css::uno::Any
& rVal
);
841 css::uno::Reference
< css::ui::XUIConfigurationManager2
> getUIConfigurationManager2() throw ( css::uno::RuntimeException
);
842 bool impl_getPrintHelper();
843 SAL_DLLPRIVATE
void ListenForStorage_Impl( const css::uno::Reference
< css::embed::XStorage
>& xStorage
);
844 SAL_DLLPRIVATE OUString
GetMediumFilterName_Impl();
846 SAL_DLLPRIVATE
void impl_store( const OUString
& sURL
,
847 const css::uno::Sequence
< css::beans::PropertyValue
>& seqArguments
,
850 SAL_DLLPRIVATE
void postEvent_Impl( const OUString
& aName
, const css::uno::Reference
< css::frame::XController2
>& xController
= css::uno::Reference
< css::frame::XController2
>() );
852 SAL_DLLPRIVATE
css::uno::Reference
< css::frame::XTitle
> impl_getTitleHelper ();
853 SAL_DLLPRIVATE
css::uno::Reference
< css::frame::XUntitledNumbers
> impl_getUntitledHelper ();
855 SAL_DLLPRIVATE SfxViewFrame
* FindOrCreateViewFrame_Impl(
856 const css::uno::Reference
< css::frame::XFrame
>& i_rFrame
,
857 ::sfx::intern::ViewCreationGuard
& i_rGuard
860 SAL_DLLPRIVATE
void NotifyModifyListeners_Impl() const;
862 SAL_DLLPRIVATE
void loadCmisProperties();
864 SAL_DLLPRIVATE SfxMedium
* handleLoadError( sal_uInt32 nError
, SfxMedium
* pMedium
);
867 // private variables and methods
872 IMPL_SfxBaseModel_DataContainer
* m_pData
;
873 // cannot be held in m_pData, since it needs to be accessed in non-threadsafe context
874 const bool m_bSupportEmbeddedScripts
;
875 const bool m_bSupportDocRecovery
;
877 } ; // class SfxBaseModel
879 #endif // INCLUDED_SFX2_SFXBASEMODEL_HXX
881 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */