LibreOffice Module basctl (master) 1
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
basctl::ScriptDocument Class Reference

encapsulates a document which contains Basic scripts and dialogs More...

#include <scriptdocument.hxx>

Classes

class  Impl
 

Public Types

enum  SpecialDocument { NoDocument }
 
enum  ScriptDocumentList {
  AllWithApplication ,
  DocumentsSorted
}
 operation mode for getAllScriptDocuments More...
 

Public Member Functions

 ScriptDocument (SpecialDocument _eType)
 creates a ScriptDocument instance which does refers to neither the application-wide, nor a specific real document's scripts. More...
 
 ScriptDocument (const css::uno::Reference< css::frame::XModel > &_rxDocument)
 creates a ScriptDocument instance which refers to a document given as XModel More...
 
bool operator== (const ScriptDocument &_rhs) const
 
bool operator!= (const ScriptDocument &_rhs) const
 
sal_Int32 hashCode () const
 retrieves a (pretty simple) hash code for the document More...
 
bool isValid () const
 determines whether the document is actually able to contain Basic/Dialog libraries More...
 
bool isAlive () const
 determines whether the document instance is alive More...
 
bool isInVBAMode () const
 
BasicManagergetBasicManager () const
 returns the BasicManager associated with this instance More...
 
css::uno::Reference< css::frame::XModel > getDocument () const
 returns the UNO component representing the document which the instance operates on More...
 
css::uno::Reference< css::frame::XModel > getDocumentOrNull () const
 returns the UNO component representing the document which the instance operates on More...
 
css::uno::Reference< css::script::XLibraryContainer > getLibraryContainer (LibraryContainerType _eType) const
 returns the Basic or Dialog library container of the document More...
 
bool hasLibrary (LibraryContainerType _eType, const OUString &_rLibName) const
 determines whether there exists a library of the given type, with the given name More...
 
css::uno::Reference< css::container::XNameContainer > getLibrary (LibraryContainerType _eType, const OUString &_rLibName, bool _bLoadLibrary) const
 returns a script or dialog library given by name More...
 
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 More...
 
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 More...
 
OUString createObjectName (LibraryContainerType _eType, const OUString &_rLibName) const
 retrieves a name for a newly to be created module or dialog More...
 
void loadLibraryIfExists (LibraryContainerType _eType, const OUString &_rLibrary)
 loads a script or dialog library given by name, if there is such a library More...
 
css::uno::Sequence< OUString > getLibraryNames () const
 retrieves the (combined) names of all script and dialog libraries More...
 
bool removeModule (const OUString &_rLibName, const OUString &_rModuleName) const
 removes a given script module from the document More...
 
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 More...
 
bool insertModule (const OUString &_rLibName, const OUString &_rModName, const OUString &_rModuleCode) const
 inserts a given piece as code as module More...
 
bool updateModule (const OUString &_rLibName, const OUString &_rModName, const OUString &_rModuleCode) const
 updates a given module with new code More...
 
bool hasModule (const OUString &_rLibName, const OUString &_rModName) const
 determines whether a module with the given name exists in the given library More...
 
bool getModule (const OUString &_rLibName, const OUString &_rModName, OUString &_rModuleSource) const
 retrieves a module's source More...
 
bool renameModule (const OUString &_rLibName, const OUString &_rOldName, const OUString &_rNewName) const
 renames a module More...
 
bool removeDialog (const OUString &_rLibName, const OUString &_rDialogName) const
 removes a given dialog from the document More...
 
bool hasDialog (const OUString &_rLibName, const OUString &_rDialogName) const
 determines whether a dialog with the given name exists in the given library More...
 
bool getDialog (const OUString &_rLibName, const OUString &_rDialogName, css::uno::Reference< css::io::XInputStreamProvider > &_out_rDialogProvider) const
 retrieves a dialog More...
 
bool renameDialog (const OUString &_rLibName, const OUString &_rOldName, const OUString &_rNewName, const css::uno::Reference< css::container::XNameContainer > &_rxExistingDialogModel) const
 renames a dialog More...
 
bool createDialog (const OUString &_rLibName, const OUString &_rDialogName, css::uno::Reference< css::io::XInputStreamProvider > &_out_rDialogProvider) const
 create a dialog More...
 
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 More...
 
bool isReadOnly () const
 determines whether the document is read-only More...
 
bool isApplication () const
 determines whether the ScriptDocument instance operates on the whole application, as opposed to a real document More...
 
bool isDocument () const
 determines whether the ScriptDocument instance operates on a real document, as opposed to the whole application More...
 
void setDocumentModified () const
 marks the document as modified @precond the instance operates on a real document, not on the application More...
 
bool isDocumentModified () const
 determines whether the document is modified @precond the instance operates on a real document, not on the application More...
 
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> More...
 
LibraryLocation getLibraryLocation (const OUString &_rLibName) const
 returns the location of a library given by name More...
 
OUString getTitle (LibraryLocation _eLocation, LibraryType _eType=LibraryType::All) const
 returns the title for the document More...
 
OUString getTitle () const
 returns the title of the document More...
 
bool isActive () const
 determines whether the document is currently the one-and-only application-wide active document More...
 
bool allowMacros () const
 determines whether macro execution for this document is allowed More...
 

Static Public Member Functions

static const ScriptDocumentgetApplicationScriptDocument ()
 returns a reference to a shared ScriptDocument instance which operates on the application-wide scripts and dialogs More...
 
static ScriptDocument getDocumentForBasicManager (const BasicManager *_pManager)
 returns a (newly created) ScriptDocument instance for the document to which a given BasicManager belongs More...
 
static ScriptDocument getDocumentWithURLOrCaption (std::u16string_view _rUrlOrCaption)
 returns a (newly created) ScriptDocument instance for the document with a given caption or URL More...
 
static ScriptDocuments getAllScriptDocuments (ScriptDocumentList _eListType)
 returns the set of ScriptDocument instances, one for each open document which contains Basic/Dialog containers; plus an additional instance for the application, if desired More...
 

Private Member Functions

 ScriptDocument ()
 creates a ScriptDocument instance which operates on the application-wide scripts and dialogs More...
 

Private Attributes

std::shared_ptr< Implm_pImpl
 

Detailed Description

encapsulates a document which contains Basic scripts and dialogs

Definition at line 64 of file scriptdocument.hxx.

Member Enumeration Documentation

◆ ScriptDocumentList

operation mode for getAllScriptDocuments

Enumerator
AllWithApplication 

all ScriptDocuments, including the dedicated one which represents the application-wide scripts/dialogs.

DocumentsSorted 

real documents only, sorted lexicographically by their title (using the sys locale's default collator)

Definition at line 128 of file scriptdocument.hxx.

◆ SpecialDocument

Enumerator
NoDocument 

Definition at line 77 of file scriptdocument.hxx.

Constructor & Destructor Documentation

◆ ScriptDocument() [1/3]

basctl::ScriptDocument::ScriptDocument ( )
private

creates a ScriptDocument instance which operates on the application-wide scripts and dialogs

Definition at line 1018 of file scriptdocument.cxx.

References make_shared().

Referenced by getDocumentForBasicManager().

◆ ScriptDocument() [2/3]

basctl::ScriptDocument::ScriptDocument ( ScriptDocument::SpecialDocument  _eType)
explicit

creates a ScriptDocument instance which does refers to neither the application-wide, nor a specific real document's scripts.

This constructor might come handy when you need some kind of uninitialized ScriptDocument, which you do not want to operate on (yet), but initialize later by assignment.

<member>isValid</member> will return <FALSE> for a ScriptDocument constructed this way.

Definition at line 1023 of file scriptdocument.cxx.

References m_pImpl, make_shared(), and NoDocument.

◆ ScriptDocument() [3/3]

basctl::ScriptDocument::ScriptDocument ( const css::uno::Reference< css::frame::XModel > &  _rxDocument)
explicit

creates a ScriptDocument instance which refers to a document given as XModel

Parameters
_rxDocumentthe document. Must not be <NULL>.

Member Function Documentation

◆ allowMacros()

bool basctl::ScriptDocument::allowMacros ( ) const

determines whether macro execution for this document is allowed

only to be called for real documents (->isDocument)

Definition at line 1498 of file scriptdocument.cxx.

References m_pImpl.

Referenced by basctl::IMPL_LINK(), and basctl::IMPL_LINK_NOARG().

◆ createDialog()

bool basctl::ScriptDocument::createDialog ( const OUString &  _rLibName,
const OUString &  _rDialogName,
css::uno::Reference< css::io::XInputStreamProvider > &  _out_rDialogProvider 
) const

create a dialog

Parameters
_rLibNamethe library name where the module is located
_rDialogNamethe dialog's name
_out_rDialogSourcetakes the provider for the dialog's description, upon successful return
Returns
<TRUE> if and only if the dialog could be successfully retrieved, <FALSE> otherwise

Definition at line 1372 of file scriptdocument.cxx.

References m_pImpl, and basctl::MarkDocumentModified().

Referenced by basctl::Shell::CreateDlgWin().

◆ createModule()

bool basctl::ScriptDocument::createModule ( const OUString &  _rLibName,
const OUString &  _rModName,
bool  _bCreateMain,
OUString &  _out_rNewModuleCode 
) const

creates a module with the given name in the given library

Parameters
_rLibNamethe library name
_rModNamethe name of the to-be-created module
_bCreateMaindetermines whether or not a function Main should be created
_out_rNewModuleCodethe source code of the newly created module
Returns
<TRUE> if and only if the creation was successful

Definition at line 1321 of file scriptdocument.cxx.

References m_pImpl, and basctl::MarkDocumentModified().

Referenced by basctl::Shell::CreateBasWin(), basctl::createLibImpl(), and basctl::createModImpl().

◆ createObjectName()

OUString basctl::ScriptDocument::createObjectName ( LibraryContainerType  _eType,
const OUString &  _rLibName 
) const

retrieves a name for a newly to be created module or dialog

Definition at line 1224 of file scriptdocument.cxx.

References basctl::E_SCRIPTS, getObjectNames(), and i.

Referenced by basctl::Shell::CreateBasWin(), basctl::Shell::CreateDlgWin(), basctl::createLibImpl(), and basctl::createModImpl().

◆ getAllScriptDocuments()

ScriptDocuments basctl::ScriptDocument::getAllScriptDocuments ( ScriptDocument::ScriptDocumentList  _eListType)
static

returns the set of ScriptDocument instances, one for each open document which contains Basic/Dialog containers; plus an additional instance for the application, if desired

Documents which are not visible - i.e. do not have a visible frame.

Parameters
_bIncludingApplication<TRUE> if the application-wide scripts/dialogs should also be represented by a ScriptDocument

Definition at line 1094 of file scriptdocument.cxx.

References AllWithApplication, DBG_UNHANDLED_EXCEPTION, DocumentsSorted, Exception, getApplicationScriptDocument(), getLocale(), comphelper::getProcessComponentContext(), Application::GetSettings(), and isValid().

Referenced by basctl::LibBox::FillBox(), basctl::FindBasicManager(), basctl::SbTreeListBox::ScanAllEntries(), and basctl::Shell::UpdateWindows().

◆ getApplicationScriptDocument()

const ScriptDocument & basctl::ScriptDocument::getApplicationScriptDocument ( )
static

◆ getBasicManager()

BasicManager * basctl::ScriptDocument::getBasicManager ( ) const

◆ getDialog()

bool basctl::ScriptDocument::getDialog ( const OUString &  _rLibName,
const OUString &  _rDialogName,
css::uno::Reference< css::io::XInputStreamProvider > &  _out_rDialogProvider 
) const

retrieves a dialog

Parameters
_rLibNamethe library name where the module is located
_rDialogNamethe dialog's name
_out_rDialogSourcetakes the provider for the dialog's description, upon successful return
Returns
<TRUE> if and only if the dialog could be successfully retrieved, <FALSE> otherwise

Definition at line 1356 of file scriptdocument.cxx.

References Any, basctl::E_DIALOGS, and m_pImpl.

Referenced by basctl::Shell::CreateDlgWin(), and basctl::SbTreeListBoxDropTarget::NotifyCopyingMoving().

◆ getDocument()

Reference< XModel > basctl::ScriptDocument::getDocument ( ) const

returns the UNO component representing the document which the instance operates on

Must not be used when the instance operates on the application-wide Basic/Dialog libraries.

Definition at line 1279 of file scriptdocument.cxx.

References m_pImpl.

Referenced by basctl::ChooseMacro(), basctl::Shell::CopyDialogResources(), basctl::ScriptDocument::Impl::createDialog(), basctl::Shell::CreateDlgWin(), basctl::DocumentSignature::DocumentSignature(), basctl::SbTreeListBox::GetRootEntryBitmaps(), basctl::DialogWindow::GetState(), basctl::ScriptDocument::Impl::onDocumentClosed(), and basctl::ScriptDocument::Impl::renameModuleOrDialog().

◆ getDocumentForBasicManager()

ScriptDocument basctl::ScriptDocument::getDocumentForBasicManager ( const BasicManager _pManager)
static

returns a (newly created) ScriptDocument instance for the document to which a given BasicManager belongs

If the basic manager is the application's basic manager, then the (shared) ScriptDocument instance which is responsible for the application is returned.

See also
getApplicationScriptDocument

Definition at line 1046 of file scriptdocument.cxx.

References getApplicationScriptDocument(), SfxApplication::GetBasicManager(), basic::BasicManagerRepository::getDocumentBasicManager(), NoDocument, and ScriptDocument().

Referenced by basctl::ChooseMacro(), basctl::CreateMacro(), basctl::MacroChooser::DeleteMacro(), basctl::Shell::ExecuteGlobal(), basctl::HandleBasicError(), basctl::IMPL_LINK(), basctl::IMPL_LINK_NOARG(), basctl::IMPL_STATIC_LINK(), and basctl::Shell::ShowActiveModuleWindow().

◆ getDocumentOrNull()

Reference< XModel > basctl::ScriptDocument::getDocumentOrNull ( ) const

returns the UNO component representing the document which the instance operates on

May be used when the instance operates on the application-wide Basic/Dialog libraries, in this case it returns <NULL>.

Definition at line 1285 of file scriptdocument.cxx.

References isDocument(), and m_pImpl.

Referenced by basctl::IMPL_LINK().

◆ getDocumentWithURLOrCaption()

ScriptDocument basctl::ScriptDocument::getDocumentWithURLOrCaption ( std::u16string_view  _rUrlOrCaption)
static

returns a (newly created) ScriptDocument instance for the document with a given caption or URL

If there is no document with the given caption, then the (shared) ScriptDocument instance which is responsible for the application is returned.

See also
getApplicationScriptDocument

Definition at line 1070 of file scriptdocument.cxx.

References aDocument, getApplicationScriptDocument(), getTitle(), and m_pImpl.

Referenced by basctl::Shell::ExecuteGlobal().

◆ getLibrary()

Reference< XNameContainer > basctl::ScriptDocument::getLibrary ( LibraryContainerType  _eType,
const OUString &  _rLibName,
bool  _bLoadLibrary 
) const

◆ getLibraryContainer()

Reference< XLibraryContainer > basctl::ScriptDocument::getLibraryContainer ( LibraryContainerType  _eType) const

◆ getLibraryLocation()

LibraryLocation basctl::ScriptDocument::getLibraryLocation ( const OUString &  _rLibName) const

◆ getLibraryNames()

Sequence< OUString > basctl::ScriptDocument::getLibraryNames ( ) const

retrieves the (combined) names of all script and dialog libraries

Definition at line 1250 of file scriptdocument.cxx.

References basctl::E_DIALOGS, basctl::E_SCRIPTS, getLibraryContainer(), and basctl::GetMergedLibraryNames().

Referenced by basctl::SbTreeListBox::ImpCreateLibEntries(), and basctl::LibBox::InsertEntries().

◆ getModule()

bool basctl::ScriptDocument::getModule ( const OUString &  _rLibName,
const OUString &  _rModName,
OUString &  _rModuleSource 
) const

retrieves a module's source

Parameters
_rLibNamethe library name where the module is located
_rModNamethe module name
_out_rModuleSourcetakes the module's source upon successful return
Returns
<TRUE> if and only if the code could be successfully retrieved, <FALSE> otherwise

Definition at line 1305 of file scriptdocument.cxx.

References Any, basctl::E_SCRIPTS, and m_pImpl.

Referenced by basctl::Shell::CreateBasWin(), basctl::GetMethodNames(), basctl::HasMethod(), and basctl::SbTreeListBoxDropTarget::NotifyCopyingMoving().

◆ getObjectNames()

Sequence< OUString > basctl::ScriptDocument::getObjectNames ( LibraryContainerType  _eType,
const OUString &  _rLibName 
) const

◆ getOrCreateLibrary()

Reference< XNameContainer > basctl::ScriptDocument::getOrCreateLibrary ( LibraryContainerType  _eType,
const OUString &  _rLibName 
) const

creates a script or dialog library in the document, or returns an existing one

If _rLibName denotes an existing library which does not need to be created, then this library will automatically be loaded, and then returned.

Definition at line 1181 of file scriptdocument.cxx.

References m_pImpl.

Referenced by basctl::Shell::CreateBasWin(), basctl::Shell::CreateDlgWin(), basctl::createLibImpl(), basctl::createModImpl(), basctl::SbTreeListBox::ImpCreateLibSubSubEntriesInVBAMode(), basctl::ScriptDocument::Impl::insertModuleOrDialog(), and basctl::ScriptDocument::Impl::updateModule().

◆ getTitle() [1/2]

OUString basctl::ScriptDocument::getTitle ( ) const

returns the title of the document

to be used for valid documents only

Definition at line 1475 of file scriptdocument.cxx.

References m_pImpl.

Referenced by getTitle().

◆ getTitle() [2/2]

OUString basctl::ScriptDocument::getTitle ( LibraryLocation  _eLocation,
LibraryType  _eType = LibraryType::All 
) const

◆ hasDialog()

bool basctl::ScriptDocument::hasDialog ( const OUString &  _rLibName,
const OUString &  _rDialogName 
) const

determines whether a dialog with the given name exists in the given library

Definition at line 1350 of file scriptdocument.cxx.

References basctl::E_DIALOGS, and m_pImpl.

Referenced by basctl::Shell::CreateDlgWin(), basctl::SbTreeListBoxDropTarget::ExecuteDrop(), and basctl::RenameDialog().

◆ hashCode()

sal_Int32 basctl::ScriptDocument::hashCode ( ) const

retrieves a (pretty simple) hash code for the document

Definition at line 1145 of file scriptdocument.cxx.

References m_pImpl.

Referenced by basctl::LibInfo::Key::Hash::operator()().

◆ hasLibrary()

bool basctl::ScriptDocument::hasLibrary ( LibraryContainerType  _eType,
const OUString &  _rLibName 
) const

determines whether there exists a library of the given type, with the given name

Definition at line 1175 of file scriptdocument.cxx.

References m_pImpl.

Referenced by basctl::createLibImpl(), getLibraryLocation(), and getObjectNames().

◆ hasModule()

bool basctl::ScriptDocument::hasModule ( const OUString &  _rLibName,
const OUString &  _rModName 
) const

determines whether a module with the given name exists in the given library

Definition at line 1299 of file scriptdocument.cxx.

References basctl::E_SCRIPTS, and m_pImpl.

Referenced by basctl::Shell::CreateBasWin(), basctl::createModImpl(), basctl::SbTreeListBoxDropTarget::ExecuteDrop(), basctl::HasMethod(), and basctl::RenameModule().

◆ insertDialog()

bool basctl::ScriptDocument::insertDialog ( const OUString &  _rLibName,
const OUString &  _rDialogName,
const css::uno::Reference< css::io::XInputStreamProvider > &  _rDialogProvider 
) const

inserts a given dialog into a given library

Parameters
_rLibNamethe name of the library to insert the dialog into. If a library with this name does not yet exist, it will be created.
_rModNamethe name of the dialog to insert. Must denote a name which is not yet used in the dialog library.
_rDialogProviderthe provider of the dialog's description
Returns
<TRUE> if and only if the insertion was successful.

Definition at line 1382 of file scriptdocument.cxx.

References Any, basctl::E_DIALOGS, and m_pImpl.

Referenced by basctl::SbTreeListBoxDropTarget::NotifyCopyingMoving().

◆ insertModule()

bool basctl::ScriptDocument::insertModule ( const OUString &  _rLibName,
const OUString &  _rModName,
const OUString &  _rModuleCode 
) const

inserts a given piece as code as module

Parameters
_rLibNamethe name of the library to insert the module into. If a library with this name does not yet exist, it will be created.
_rModNamethe name of the module to insert the code as. Must denote a name which is not yet used in the module library.
_rModuleCodethe code of the new module
Returns
<TRUE> if and only if the insertion was successful.

Definition at line 1332 of file scriptdocument.cxx.

References Any, basctl::E_SCRIPTS, and m_pImpl.

Referenced by basctl::SbTreeListBoxDropTarget::NotifyCopyingMoving().

◆ isActive()

bool basctl::ScriptDocument::isActive ( ) const

determines whether the document is currently the one-and-only application-wide active document

Definition at line 1481 of file scriptdocument.cxx.

References DBG_UNHANDLED_EXCEPTION, Exception, m_pImpl, and xFrame.

Referenced by basctl::MacroChooser::run().

◆ isAlive()

bool basctl::ScriptDocument::isAlive ( ) const

determines whether the document instance is alive

If the instance is not valid, <FALSE> is returned.

If the instance refers to a real document, which is already closed, or just being closed, the method returns <FALSE>.

If the instance refers to the application, <TRUE> is returned.

See also
isValid

Definition at line 1157 of file scriptdocument.cxx.

References m_pImpl.

Referenced by basctl::createLibImpl(), basctl::CreateMacro(), basctl::createModImpl(), basctl::ObjectPage::GetSelection(), basctl::IMPL_LINK(), basctl::SbTreeListBox::IsEntryProtected(), and basctl::SbTreeListBox::ScanEntry().

◆ isApplication()

bool basctl::ScriptDocument::isApplication ( ) const

◆ isDocument()

bool basctl::ScriptDocument::isDocument ( ) const
inline

◆ isDocumentModified()

bool basctl::ScriptDocument::isDocumentModified ( ) const

determines whether the document is modified @precond the instance operates on a real document, not on the application

See also
isDocument

Definition at line 1394 of file scriptdocument.cxx.

References m_pImpl.

◆ isInVBAMode()

bool basctl::ScriptDocument::isInVBAMode ( ) const

◆ isReadOnly()

bool basctl::ScriptDocument::isReadOnly ( ) const

determines whether the document is read-only

cannot be called if the document operates on the application-wide scripts

Definition at line 1256 of file scriptdocument.cxx.

References m_pImpl.

Referenced by basctl::DialogWindow::DialogWindow(), and basctl::Shell::onDocumentModeChanged().

◆ isValid()

bool basctl::ScriptDocument::isValid ( ) const

determines whether the document is actually able to contain Basic/Dialog libraries

Note that validity does not automatically imply the document can be used for active work. Instead, it is possible the document is closed already (or being closed currently). In this case, isValid will return <TRUE>, but isAlive will return <FALSE>.

Returns
<TRUE> if the instance refers to a document which contains Basic/Dialog libraries, or the application as a whole, <FALSE> otherwise.
See also
isAlive

Definition at line 1151 of file scriptdocument.cxx.

References m_pImpl.

Referenced by basctl::ScriptDocument::Impl::allowMacros(), basctl::CreateMacro(), basctl::DocumentEntry::DocumentEntry(), basctl::EntryDescriptor::EntryDescriptor(), basctl::SbTreeListBox::FindRootEntry(), getAllScriptDocuments(), basctl::ScriptDocument::Impl::getBasicManager(), basctl::ScriptDocument::Impl::getCurrentFrame(), basctl::ScriptDocument::Impl::getDocument(), basctl::ScriptDocument::Impl::getLibrary(), basctl::ScriptDocument::Impl::getLibraryContainer(), basctl::ScriptDocument::Impl::getModuleOrDialog(), basctl::SbTreeListBox::GetRootEntryBitmaps(), basctl::ScriptDocument::Impl::getTitle(), basctl::ScriptDocument::Impl::getURL(), basctl::HandleBasicError(), basctl::ScriptDocument::Impl::hasModuleOrDialog(), basctl::IMPL_LINK(), basctl::IMPL_STATIC_LINK(), isDocument(), basctl::ScriptDocument::Impl::isDocumentModified(), basctl::ScriptDocument::Impl::isReadOnly(), basctl::ScriptDocument::Impl::onDocumentClosed(), basctl::Shell::onDocumentClosed(), basctl::ScriptDocument::Impl::removeModuleOrDialog(), basctl::ScriptDocument::Impl::renameModuleOrDialog(), and basctl::ScriptDocument::Impl::setDocumentModified().

◆ loadLibraryIfExists()

void basctl::ScriptDocument::loadLibraryIfExists ( LibraryContainerType  _eType,
const OUString &  _rLibrary 
)

loads a script or dialog library given by name, if there is such a library

Definition at line 1187 of file scriptdocument.cxx.

References m_pImpl.

◆ operator!=()

bool basctl::ScriptDocument::operator!= ( const ScriptDocument _rhs) const
inline

Definition at line 155 of file scriptdocument.hxx.

◆ operator==()

bool basctl::ScriptDocument::operator== ( const ScriptDocument _rhs) const

Definition at line 1139 of file scriptdocument.cxx.

References m_pImpl.

◆ removeDialog()

bool basctl::ScriptDocument::removeDialog ( const OUString &  _rLibName,
const OUString &  _rDialogName 
) const

removes a given dialog from the document

Returns
<TRUE> if and only if the removal was successful. When <FALSE> is returned, this will reported as assertion in a non-product build.

Definition at line 1344 of file scriptdocument.cxx.

References basctl::E_DIALOGS, and m_pImpl.

Referenced by basctl::RemoveDialog().

◆ removeModule()

bool basctl::ScriptDocument::removeModule ( const OUString &  _rLibName,
const OUString &  _rModuleName 
) const

removes a given script module from the document

Returns
<TRUE> if and only if the removal was successful. When <FALSE> is returned, this will reported as assertion in a non-product build.

Definition at line 1293 of file scriptdocument.cxx.

References basctl::E_SCRIPTS, and m_pImpl.

Referenced by basctl::ModulWindow::ExecuteCommand(), and basctl::SbTreeListBoxDropTarget::NotifyCopyingMoving().

◆ renameDialog()

bool basctl::ScriptDocument::renameDialog ( const OUString &  _rLibName,
const OUString &  _rOldName,
const OUString &  _rNewName,
const css::uno::Reference< css::container::XNameContainer > &  _rxExistingDialogModel 
) const

renames a dialog

Parameters
_rLibNamethe library where the dialog lives in. Must denote an existing library.
_rOldNamethe old dialog name. Must denote an existing dialog.
_rNewNamethe new dialog name
_rxExistingDialogModelthe existing model of the dialog, if already loaded in the IDE
Returns
<TRUE> if and only if renaming was successful.

Definition at line 1366 of file scriptdocument.cxx.

References basctl::E_DIALOGS, and m_pImpl.

Referenced by basctl::RenameDialog().

◆ renameModule()

bool basctl::ScriptDocument::renameModule ( const OUString &  _rLibName,
const OUString &  _rOldName,
const OUString &  _rNewName 
) const

renames a module

Parameters
_rLibNamethe library where the module lives in. Must denote an existing library.
_rOldNamethe old module name. Must denote an existing module.
_rNewNamethe new module name
Returns
<TRUE> if and only if renaming was successful.

Definition at line 1315 of file scriptdocument.cxx.

References basctl::E_SCRIPTS, and m_pImpl.

Referenced by basctl::RenameModule().

◆ saveDocument()

void basctl::ScriptDocument::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>

Definition at line 1400 of file scriptdocument.cxx.

References m_pImpl.

◆ setDocumentModified()

void basctl::ScriptDocument::setDocumentModified ( ) const

marks the document as modified @precond the instance operates on a real document, not on the application

See also
isDocument

Definition at line 1388 of file scriptdocument.cxx.

References m_pImpl.

Referenced by basctl::MarkDocumentModified().

◆ updateModule()

bool basctl::ScriptDocument::updateModule ( const OUString &  _rLibName,
const OUString &  _rModName,
const OUString &  _rModuleCode 
) const

updates a given module with new code

Parameters
_rLibNamethe name of the library the modules lives in. Must denote an existing module library.
_rModNamethe name of the module to update. Must denote an existing module in the given library.
_rModuleCodethe new module code.
Returns
<TRUE> if and only if the insertion was successful.

Definition at line 1338 of file scriptdocument.cxx.

References m_pImpl.

Referenced by basctl::CreateMacro(), and basctl::ModulWindow::UpdateModule().

Member Data Documentation

◆ m_pImpl

std::shared_ptr<Impl> basctl::ScriptDocument::m_pImpl
private

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