class ScriptDocument; typedef std::vector< ScriptDocument > ScriptDocuments;
/** encapsulates a document which contains Basic scripts and dialogs
*/ class BASCTL_DLLPUBLIC ScriptDocument
{ private: class Impl;
std::shared_ptr<Impl> m_pImpl;
private: /** creates a ScriptDocument instance which operates on the application-wide scriptsanddialogs
*/
ScriptDocument();
public: enum SpecialDocument { NoDocument }; /** creates a ScriptDocument instance which does refers to neither the application-wide, noraspecificrealdocument'sscripts.
/** returns a reference to a shared ScriptDocument instance which operatesontheapplication-widescriptsanddialogs
*/ staticconst ScriptDocument&
getApplicationScriptDocument();
/** returns a (newly created) ScriptDocument instance for the document to whichagivenBasicManagerbelongs
/** operation mode for getAllScriptDocuments
*/ enum ScriptDocumentList
{ /** all ScriptDocuments, including the dedicated one which represents theapplication-widescripts/dialogs.
*/
AllWithApplication, /** real documents only, sorted lexicographically by their title (using the sys locale's default collator)
*/
DocumentsSorted
};
/** returns the set of ScriptDocument instances, one for each open document which containsBasic/Dialogcontainers;plusanadditionalinstancefor theapplication,ifdesired
/** determines whether there exists a library of the given type, with the given name
*/ bool hasLibrary( LibraryContainerType _eType, const OUString& _rLibName ) const;
/** returns a script or dialog library given by name
/** returns the names of the modules in a given script or dialog library of the document
*/
css::uno::Sequence< OUString >
getObjectNames( LibraryContainerType _eType, const OUString& _rLibName ) const;
/** retrieves a name for a newly to be created module or dialog
*/
OUString createObjectName( LibraryContainerType _eType, const OUString& _rLibName ) const;
/** loads a script or dialog library given by name, if there is such a library
*/ void loadLibraryIfExists( LibraryContainerType _eType, const OUString& _rLibrary );
/// retrieves the (combined) names of all script and dialog libraries
css::uno::Sequence< OUString >
getLibraryNames() const;
/** removes a given script module from the document
/** creates a module with the given name in the given library @param_rLibName thelibraryname @param_rModName thenameoftheto-be-createdmodule @param_bCreateMain determineswhetherornotafunctionMainshouldbecreated @param_out_rNewModuleCode thesourcecodeofthenewlycreatedmodule @return <TRUE/>ifandonlyifthecreationwassuccessful
*/ bool createModule( const OUString& _rLibName, const OUString& _rModName, bool _bCreateMain, OUString& _out_rNewModuleCode ) const;
/** inserts a given piece as code as module @param_rLibName thenameofthelibrarytoinsertthemoduleinto.Ifalibrarywiththisnamedoes notyetexist,itwillbecreated. @param_rModName thenameofthemoduletoinsertthecodeas.Mustdenoteanamewhichisnotyet usedinthemodulelibrary. @param_rModuleCode thecodeofthenewmodule @return <TRUE/>ifandonlyiftheinsertionwassuccessful.
*/ bool insertModule( const OUString& _rLibName, const OUString& _rModName, const OUString& _rModuleCode ) const;
/** updates a given module with new code @param_rLibName thenameofthelibrarythemoduleslivesin.Mustdenoteanexistingmodulelibrary. @param_rModName thenameofthemoduletoupdate.Mustdenoteanexistingmoduleinthegivenlibrary. @param_rModuleCode thenewmodulecode. @return <TRUE/>ifandonlyiftheinsertionwassuccessful.
*/ bool updateModule( const OUString& _rLibName, const OUString& _rModName, const OUString& _rModuleCode ) const;
/// determines whether a module with the given name exists in the given library bool hasModule( const OUString& _rLibName, const OUString& _rModName ) const;
/// determines whether a dialog with the given name exists in the given library bool hasDialog( const OUString& _rLibName, const OUString& _rDialogName ) const;
/** determines whether the ScriptDocument instance operates on the whole application, asopposedtoarealdocument
*/ bool isApplication() const;
/** determines whether the ScriptDocument instance operates on a real document, asopposedtothewholeapplication
*/ bool isDocument() const { return isValid() && !isApplication(); }
/** marks the document as modified @precond theinstanceoperatesonarealdocument,notontheapplication @seeisDocument
*/ void setDocumentModified() const;
/** determines whether the document is modified @precond theinstanceoperatesonarealdocument,notontheapplication @seeisDocument
*/ bool isDocumentModified() const;
/** saves the document, if the instance refers to a real document @precond <code>isApplication</code>returns<FALSE/>
*/ void saveDocument( const css::uno::Reference< css::task::XStatusIndicator >& _rxStatusIndicator
) const;
/// returns the location of a library given by name
LibraryLocation
getLibraryLocation( const OUString& _rLibName ) const;
/// returns the title for the document
OUString getTitle( LibraryLocation _eLocation, LibraryType _eType = LibraryType::All ) const;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.