22#include <com/sun/star/script/XLibraryContainer.hpp>
23#include <com/sun/star/frame/XModel.hpp>
24#include <com/sun/star/task/XStatusIndicator.hpp>
25#include <com/sun/star/io/XInputStreamProvider.hpp>
96 explicit ScriptDocument(
const css::uno::Reference< css::frame::XModel >& _rxDocument );
197 css::uno::Reference< css::frame::XModel >
205 css::uno::Reference< css::frame::XModel >
212 css::uno::Reference< css::script::XLibraryContainer >
231 css::uno::Reference< css::container::XNameContainer >
239 css::uno::Reference< css::container::XNameContainer >
244 css::uno::Sequence< OUString >
256 css::uno::Sequence< OUString >
265 bool removeModule(
const OUString& _rLibName,
const OUString& _rModuleName )
const;
279 bool createModule(
const OUString& _rLibName,
const OUString& _rModName,
bool _bCreateMain, OUString& _out_rNewModuleCode )
const;
293 bool insertModule(
const OUString& _rLibName,
const OUString& _rModName,
const OUString& _rModuleCode )
const;
305 bool updateModule(
const OUString& _rLibName,
const OUString& _rModName,
const OUString& _rModuleCode )
const;
308 bool hasModule(
const OUString& _rLibName,
const OUString& _rModName )
const;
320 bool getModule(
const OUString& _rLibName,
const OUString& _rModName, OUString& _rModuleSource )
const;
332 bool renameModule(
const OUString& _rLibName,
const OUString& _rOldName,
const OUString& _rNewName )
const;
340 bool removeDialog(
const OUString& _rLibName,
const OUString& _rDialogName )
const;
343 bool hasDialog(
const OUString& _rLibName,
const OUString& _rDialogName )
const;
356 const OUString& _rLibName,
357 const OUString& _rDialogName,
358 css::uno::Reference< css::io::XInputStreamProvider >& _out_rDialogProvider
374 const OUString& _rLibName,
375 const OUString& _rOldName,
376 const OUString& _rNewName,
377 const css::uno::Reference< css::container::XNameContainer >& _rxExistingDialogModel
391 const OUString& _rLibName,
392 const OUString& _rDialogName,
393 css::uno::Reference< css::io::XInputStreamProvider >& _out_rDialogProvider
410 const OUString& _rLibName,
411 const OUString& _rDialogName,
412 const css::uno::Reference< css::io::XInputStreamProvider >& _rDialogProvider
450 const css::uno::Reference< css::task::XStatusIndicator >& _rxStatusIndicator
encapsulates a document which contains Basic scripts and dialogs
css::uno::Reference< css::container::XNameContainer > getOrCreateLibrary(LibraryContainerType _eType, const OUString &_rLibName) const
creates a script or dialog library in the document, or returns an existing one
bool getModule(const OUString &_rLibName, const OUString &_rModName, OUString &_rModuleSource) const
retrieves a module's source
sal_Int32 hashCode() const
retrieves a (pretty simple) hash code for the document
bool insertModule(const OUString &_rLibName, const OUString &_rModName, const OUString &_rModuleCode) const
inserts a given piece as code as module
bool renameDialog(const OUString &_rLibName, const OUString &_rOldName, const OUString &_rNewName, const css::uno::Reference< css::container::XNameContainer > &_rxExistingDialogModel) const
renames a dialog
bool allowMacros() const
determines whether macro execution for this document is allowed
bool hasLibrary(LibraryContainerType _eType, const OUString &_rLibName) const
determines whether there exists a library of the given type, with the given name
css::uno::Reference< css::script::XLibraryContainer > getLibraryContainer(LibraryContainerType _eType) const
returns the Basic or Dialog library container of the document
bool isDocumentModified() const
determines whether the document is modified @precond the instance operates on a real document,...
bool removeModule(const OUString &_rLibName, const OUString &_rModuleName) const
removes a given script module from the document
css::uno::Reference< css::frame::XModel > getDocumentOrNull() const
returns the UNO component representing the document which the instance operates on
bool getDialog(const OUString &_rLibName, const OUString &_rDialogName, css::uno::Reference< css::io::XInputStreamProvider > &_out_rDialogProvider) const
retrieves a dialog
css::uno::Reference< css::frame::XModel > getDocument() const
returns the UNO component representing the document which the instance operates on
bool isDocument() const
determines whether the ScriptDocument instance operates on a real document, as opposed to the whole a...
BasicManager * getBasicManager() const
returns the BasicManager associated with this instance
ScriptDocumentList
operation mode for getAllScriptDocuments
@ AllWithApplication
all ScriptDocuments, including the dedicated one which represents the application-wide scripts/dialog...
@ DocumentsSorted
real documents only, sorted lexicographically by their title (using the sys locale's default collator...
static ScriptDocuments getAllScriptDocuments(ScriptDocumentList _eListType)
returns the set of ScriptDocument instances, one for each open document which contains Basic/Dialog c...
ScriptDocument(const css::uno::Reference< css::frame::XModel > &_rxDocument)
creates a ScriptDocument instance which refers to a document given as XModel
ScriptDocument()
creates a ScriptDocument instance which operates on the application-wide scripts and dialogs
bool removeDialog(const OUString &_rLibName, const OUString &_rDialogName) const
removes a given dialog from the document
bool updateModule(const OUString &_rLibName, const OUString &_rModName, const OUString &_rModuleCode) const
updates a given module with new code
static const ScriptDocument & getApplicationScriptDocument()
returns a reference to a shared ScriptDocument instance which operates on the application-wide script...
css::uno::Reference< css::container::XNameContainer > getLibrary(LibraryContainerType _eType, const OUString &_rLibName, bool _bLoadLibrary) const
returns a script or dialog library given by name
std::shared_ptr< Impl > m_pImpl
bool isReadOnly() const
determines whether the document is read-only
static ScriptDocument getDocumentForBasicManager(const BasicManager *_pManager)
returns a (newly created) ScriptDocument instance for the document to which a given BasicManager belo...
bool createModule(const OUString &_rLibName, const OUString &_rModName, bool _bCreateMain, OUString &_out_rNewModuleCode) const
creates a module with the given name in the given library
bool renameModule(const OUString &_rLibName, const OUString &_rOldName, const OUString &_rNewName) const
renames a module
bool isAlive() const
determines whether the document instance is alive
static ScriptDocument getDocumentWithURLOrCaption(std::u16string_view _rUrlOrCaption)
returns a (newly created) ScriptDocument instance for the document with a given caption or URL
void saveDocument(const css::uno::Reference< css::task::XStatusIndicator > &_rxStatusIndicator) const
saves the document, if the instance refers to a real document @precond isApplication returns <FALSE>
void setDocumentModified() const
marks the document as modified @precond the instance operates on a real document, not on the applicat...
bool insertDialog(const OUString &_rLibName, const OUString &_rDialogName, const css::uno::Reference< css::io::XInputStreamProvider > &_rDialogProvider) const
inserts a given dialog into a given library
css::uno::Sequence< OUString > getLibraryNames() const
retrieves the (combined) names of all script and dialog libraries
OUString getTitle() const
returns the title of the document
bool operator==(const ScriptDocument &_rhs) const
bool isActive() const
determines whether the document is currently the one-and-only application-wide active document
bool hasDialog(const OUString &_rLibName, const OUString &_rDialogName) const
determines whether a dialog with the given name exists in the given library
bool operator!=(const ScriptDocument &_rhs) const
css::uno::Sequence< OUString > getObjectNames(LibraryContainerType _eType, const OUString &_rLibName) const
returns the names of the modules in a given script or dialog library of the document
bool hasModule(const OUString &_rLibName, const OUString &_rModName) const
determines whether a module with the given name exists in the given library
void loadLibraryIfExists(LibraryContainerType _eType, const OUString &_rLibrary)
loads a script or dialog library given by name, if there is such a library
bool createDialog(const OUString &_rLibName, const OUString &_rDialogName, css::uno::Reference< css::io::XInputStreamProvider > &_out_rDialogProvider) const
create a dialog
LibraryLocation getLibraryLocation(const OUString &_rLibName) const
returns the location of a library given by name
bool isApplication() const
determines whether the ScriptDocument instance operates on the whole application, as opposed to a rea...
bool isValid() const
determines whether the document is actually able to contain Basic/Dialog libraries
OUString createObjectName(LibraryContainerType _eType, const OUString &_rLibName) const
retrieves a name for a newly to be created module or dialog
@ LIBRARY_LOCATION_UNKNOWN
@ LIBRARY_LOCATION_DOCUMENT
std::vector< ScriptDocument > ScriptDocuments