LibreOffice Module sfx2 (master) 1
Public Member Functions | Protected Member Functions | List of all members
sfx2::IMacroDocumentAccess Class Referenceabstract

provides access to several settings of a document, which are needed by ->DocumentMacroMode to properly determine the current macro execution mode of this document More...

#include <docmacromode.hxx>

Inheritance diagram for sfx2::IMacroDocumentAccess:
[legend]

Public Member Functions

virtual sal_Int16 getCurrentMacroExecMode () const =0
 retrieves the current MacroExecutionMode. More...
 
virtual void setCurrentMacroExecMode (sal_uInt16)=0
 sets the MacroExecutionMode of the document, as calculated by the DocumentMacroMode class. More...
 
virtual OUString getDocumentLocation () const =0
 returns the origin of the document More...
 
virtual bool documentStorageHasMacros () const =0
 checks whether the document's storage contains sub storages with macros or scripts More...
 
virtual bool macroCallsSeenWhileLoading () const =0
 checks whether the document's contained calls to macros or scripts after loading More...
 
virtual css::uno::Reference< css::document::XEmbeddedScripts > getEmbeddedDocumentScripts () const =0
 provides access to the XEmbeddedScripts interface of the document More...
 
virtual SignatureState getScriptingSignatureState ()=0
 returns the state of the signatures for the scripts embedded in the document More...
 
virtual bool hasTrustedScriptingSignature (bool bAllowUIToAddAuthor)=0
 allows to detect whether there is a trusted scripting signature More...
 

Protected Member Functions

 ~IMacroDocumentAccess ()
 

Detailed Description

provides access to several settings of a document, which are needed by ->DocumentMacroMode to properly determine the current macro execution mode of this document

Definition at line 45 of file docmacromode.hxx.

Constructor & Destructor Documentation

◆ ~IMacroDocumentAccess()

sfx2::IMacroDocumentAccess::~IMacroDocumentAccess ( )
inlineprotected

Definition at line 161 of file docmacromode.hxx.

Member Function Documentation

◆ documentStorageHasMacros()

virtual bool sfx2::IMacroDocumentAccess::documentStorageHasMacros ( ) const
pure virtual

checks whether the document's storage contains sub storages with macros or scripts

A default implementation of this method will simply call DocumentMacroMode::storageHasMacros with the document's root storage. However, there might be document types where this isn't sufficient (e.g. database documents which contain sub documents which can also contain macro/script storages).

Implemented in SfxObjectShell_Impl.

◆ getCurrentMacroExecMode()

virtual sal_Int16 sfx2::IMacroDocumentAccess::getCurrentMacroExecMode ( ) const
pure virtual

retrieves the current MacroExecutionMode.

Usually, this is initialized from the media descriptor used to load the document, respectively the one passed into the document's XModel::attachResource call.

If no such mode was passed there, document implementations should return MacroExecMode::NEVER_EXECUTE.

See also
css::document::MediaDescriptor::MacroExecutionMode
css::frame::XComponentLoader::loadComponentFromURL
css::frame::XModel::attachResource
setCurrentMacroExecMode

Implemented in SfxObjectShell_Impl.

◆ getDocumentLocation()

virtual OUString sfx2::IMacroDocumentAccess::getDocumentLocation ( ) const
pure virtual

returns the origin of the document

This usually is the document's location, or, if the document has been newly created from a template, then the location of the template. Location here means the complete path of the document, including the file name.

Implemented in SfxObjectShell_Impl.

◆ getEmbeddedDocumentScripts()

virtual css::uno::Reference< css::document::XEmbeddedScripts > sfx2::IMacroDocumentAccess::getEmbeddedDocumentScripts ( ) const
pure virtual

provides access to the XEmbeddedScripts interface of the document

Implementations are allowed to return <NULL> here if and only if they do not (yet) support embedding scripts.

Implemented in SfxObjectShell_Impl.

◆ getScriptingSignatureState()

virtual SignatureState sfx2::IMacroDocumentAccess::getScriptingSignatureState ( )
pure virtual

returns the state of the signatures for the scripts embedded in the document

Note: On the medium run, the signature handling of a document should be outsourced into a dedicated class, instead of being hard-wired into the SfxObjectShell. This class could then be used outside the SfxObjectShell (e.g. in Base documents), too. When this happens, this method here becomes should be replaced by a method at this new class.

@seealso <sfx2/signaturestate.hxx>

Implemented in SfxObjectShell_Impl.

◆ hasTrustedScriptingSignature()

virtual bool sfx2::IMacroDocumentAccess::hasTrustedScriptingSignature ( bool  bAllowUIToAddAuthor)
pure virtual

allows to detect whether there is a trusted scripting signature

Note: On the medium run, the signature handling of a document should be outsourced into a dedicated class, instead of being hard-wired into the SfxObjectShell. This class could then be used outside the SfxObjectShell (e.g. in Base documents), too. When this happens, this method here should be replaced by a method at this new class.

@seealso <sfx2/signaturestate.hxx>

Implemented in SfxObjectShell_Impl.

◆ macroCallsSeenWhileLoading()

virtual bool sfx2::IMacroDocumentAccess::macroCallsSeenWhileLoading ( ) const
pure virtual

checks whether the document's contained calls to macros or scripts after loading

Implemented in SfxObjectShell_Impl.

◆ setCurrentMacroExecMode()

virtual void sfx2::IMacroDocumentAccess::setCurrentMacroExecMode ( sal_uInt16  )
pure virtual

sets the MacroExecutionMode of the document, as calculated by the DocumentMacroMode class.

Effectively, the existence of this method means that the responsibility to store the current macro execution mode is not with the DocumentMacroMode instance, but with the document instance itself.

Usually, a document implementation will simply put the macro execution mode into its media descriptor, as returned by XModel::getArgs.

See also
css::document::MediaDescriptor::MacroExecutionMode
css::frame::XComponentLoader::loadComponentFromURL
css::frame::XModel::attachResource

see getCurrentMacroExecMode

Implemented in SfxObjectShell_Impl.


The documentation for this class was generated from the following file: