LibreOffice Module basctl (master) 1
|
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 |
BasicManager * | getBasicManager () 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 ScriptDocument & | getApplicationScriptDocument () |
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< Impl > | m_pImpl |
encapsulates a document which contains Basic scripts and dialogs
Definition at line 64 of file scriptdocument.hxx.
operation mode for getAllScriptDocuments
Definition at line 128 of file scriptdocument.hxx.
Enumerator | |
---|---|
NoDocument |
Definition at line 77 of file scriptdocument.hxx.
|
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().
|
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.
|
explicit |
creates a ScriptDocument instance which refers to a document given as XModel
_rxDocument | the document. Must not be <NULL>. |
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().
bool basctl::ScriptDocument::createDialog | ( | const OUString & | _rLibName, |
const OUString & | _rDialogName, | ||
css::uno::Reference< css::io::XInputStreamProvider > & | _out_rDialogProvider | ||
) | const |
create a dialog
_rLibName | the library name where the module is located |
_rDialogName | the dialog's name |
_out_rDialogSource | takes the provider for the dialog's description, upon successful return |
Definition at line 1372 of file scriptdocument.cxx.
References m_pImpl, and basctl::MarkDocumentModified().
Referenced by basctl::Shell::CreateDlgWin().
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
_rLibName | the library name |
_rModName | the name of the to-be-created module |
_bCreateMain | determines whether or not a function Main should be created |
_out_rNewModuleCode | the source code of the newly created module |
Definition at line 1321 of file scriptdocument.cxx.
References m_pImpl, and basctl::MarkDocumentModified().
Referenced by basctl::Shell::CreateBasWin(), basctl::createLibImpl(), and basctl::createModImpl().
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().
|
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.
_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().
|
static |
returns a reference to a shared ScriptDocument instance which operates on the application-wide scripts and dialogs
Definition at line 1039 of file scriptdocument.cxx.
Referenced by basctl::Shell::ExecuteGlobal(), basctl::LibBox::FillBox(), basctl::Shell::FindApplicationWindow(), basctl::SbTreeListBox::FindVariable(), getAllScriptDocuments(), getDocumentForBasicManager(), getDocumentWithURLOrCaption(), basctl::SbTreeListBox::GetEntryDescriptor(), basctl::IMPL_LINK(), basctl::Shell::Init(), basctl::ObjectPage::NewDialog(), basctl::ObjectPage::NewModule(), basctl::Shell::onDocumentClosed(), basctl::SbTreeListBox::ScanAllEntries(), basctl::SbTreeListBox::SetCurrentEntry(), and basctl::Shell::ShowActiveModuleWindow().
BasicManager * basctl::ScriptDocument::getBasicManager | ( | ) | const |
returns the BasicManager associated with this instance
Definition at line 1273 of file scriptdocument.cxx.
References m_pImpl.
Referenced by basctl::createModImpl(), basctl::GetMethodNames(), basctl::Shell::GetState(), basctl::HasMethod(), basctl::IMPL_LINK(), and basctl::ModulWindow::XModule().
bool basctl::ScriptDocument::getDialog | ( | const OUString & | _rLibName, |
const OUString & | _rDialogName, | ||
css::uno::Reference< css::io::XInputStreamProvider > & | _out_rDialogProvider | ||
) | const |
retrieves a dialog
_rLibName | the library name where the module is located |
_rDialogName | the dialog's name |
_out_rDialogSource | takes the provider for the dialog's description, upon successful return |
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().
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().
|
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.
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().
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().
|
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.
Definition at line 1070 of file scriptdocument.cxx.
References aDocument, getApplicationScriptDocument(), getTitle(), and m_pImpl.
Referenced by basctl::Shell::ExecuteGlobal().
Reference< XNameContainer > basctl::ScriptDocument::getLibrary | ( | LibraryContainerType | _eType, |
const OUString & | _rLibName, | ||
bool | _bLoadLibrary | ||
) | const |
returns a script or dialog library given by name
_eType | the type of library to load |
_rLibName | the name of the script library |
_bLoadLibrary | <TRUE> if and only if the library should be loaded. |
NoSuchElementException | if there is no script library with the given name |
Definition at line 1169 of file scriptdocument.cxx.
References m_pImpl.
Referenced by basctl::ContainerListenerImpl::addContainerListener(), basctl::Shell::CopyDialogResources(), basctl::ScriptDocument::Impl::createDialog(), basctl::ScriptDocument::Impl::createModule(), basctl::ScriptDocument::Impl::getModuleOrDialog(), getObjectNames(), basctl::ScriptDocument::Impl::hasModuleOrDialog(), basctl::ContainerListenerImpl::removeContainerListener(), basctl::ScriptDocument::Impl::removeModuleOrDialog(), basctl::LocalizationMgr::removeResourceForDialog(), basctl::ScriptDocument::Impl::renameModuleOrDialog(), basctl::LocalizationMgr::renameStringResourceIDs(), basctl::Shell::SetCurLibForLocalization(), and basctl::LocalizationMgr::setStringResourceAtDialog().
Reference< XLibraryContainer > basctl::ScriptDocument::getLibraryContainer | ( | LibraryContainerType | _eType | ) | const |
returns the Basic or Dialog library container of the document
If the document is not valid, <NULL> is returned.
Definition at line 1163 of file scriptdocument.cxx.
References m_pImpl.
Referenced by basctl::LibPage::CheckButtons(), basctl::createLibImpl(), basctl::SbTreeListBoxDropTarget::ExecuteDrop(), basctl::ScriptDocument::Impl::getLibrary(), getLibraryNames(), basctl::ScriptDocument::Impl::getOrCreateLibrary(), basctl::ObjectPage::GetSelection(), basctl::Shell::GetState(), basctl::HandleBasicError(), basctl::ScriptDocument::Impl::hasLibrary(), basctl::SbTreeListBox::ImpCreateLibEntries(), basctl::SbTreeListBox::ImpCreateLibSubEntries(), basctl::IMPL_LINK(), basctl::IMPL_STATIC_LINK(), basctl::SbTreeListBox::IsEntryProtected(), basctl::ScriptDocument::Impl::isInVBAMode(), basctl::ScriptDocument::Impl::isLibraryShared(), and basctl::ScriptDocument::Impl::loadLibraryIfExists().
LibraryLocation basctl::ScriptDocument::getLibraryLocation | ( | const OUString & | _rLibName | ) | const |
returns the location of a library given by name
Definition at line 1406 of file scriptdocument.cxx.
References basctl::E_DIALOGS, basctl::E_SCRIPTS, hasLibrary(), isDocument(), basctl::LIBRARY_LOCATION_DOCUMENT, basctl::LIBRARY_LOCATION_SHARE, basctl::LIBRARY_LOCATION_UNKNOWN, basctl::LIBRARY_LOCATION_USER, and m_pImpl.
Referenced by basctl::createModImpl(), basctl::BaseWindow::CreateQualifiedName(), basctl::Shell::GetState(), basctl::SbTreeListBox::ImpCreateLibEntries(), basctl::LibBox::InsertEntries(), and basctl::Shell::SetMDITitle().
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().
bool basctl::ScriptDocument::getModule | ( | const OUString & | _rLibName, |
const OUString & | _rModName, | ||
OUString & | _rModuleSource | ||
) | const |
retrieves a module's source
_rLibName | the library name where the module is located |
_rModName | the module name |
_out_rModuleSource | takes the module's source upon successful return |
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().
Sequence< OUString > basctl::ScriptDocument::getObjectNames | ( | LibraryContainerType | _eType, |
const OUString & | _rLibName | ||
) | const |
returns the names of the modules in a given script or dialog library of the document
Definition at line 1193 of file scriptdocument.cxx.
References begin, DBG_UNHANDLED_EXCEPTION, end, Exception, getLibrary(), getLocale(), comphelper::getProcessComponentContext(), Application::GetSettings(), and hasLibrary().
Referenced by createObjectName(), basctl::SbTreeListBox::ImpCreateLibSubEntries(), basctl::SbTreeListBox::ImpCreateLibSubSubEntriesInVBAMode(), and basctl::LocalizationMgr::implEnableDisableResourceForAllLibraryDialogs().
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().
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().
OUString basctl::ScriptDocument::getTitle | ( | LibraryLocation | _eLocation, |
LibraryType | _eType = LibraryType::All |
||
) | const |
returns the title for the document
Definition at line 1434 of file scriptdocument.cxx.
References basctl::All, basctl::Dialog, getTitle(), basctl::IDEResId(), basctl::LIBRARY_LOCATION_DOCUMENT, basctl::LIBRARY_LOCATION_SHARE, basctl::LIBRARY_LOCATION_USER, and basctl::Module.
Referenced by basctl::BaseWindow::CreateQualifiedName(), getDocumentWithURLOrCaption(), basctl::SbTreeListBox::GetRootEntryName(), basctl::Shell::GetState(), basctl::LibBox::InsertEntries(), basctl::LibPage::InsertListBoxEntry(), and basctl::Shell::SetMDITitle().
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().
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()().
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().
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().
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
_rLibName | the name of the library to insert the dialog into. If a library with this name does not yet exist, it will be created. |
_rModName | the name of the dialog to insert. Must denote a name which is not yet used in the dialog library. |
_rDialogProvider | the provider of the dialog's description |
Definition at line 1382 of file scriptdocument.cxx.
References Any, basctl::E_DIALOGS, and m_pImpl.
Referenced by basctl::SbTreeListBoxDropTarget::NotifyCopyingMoving().
bool basctl::ScriptDocument::insertModule | ( | const OUString & | _rLibName, |
const OUString & | _rModName, | ||
const OUString & | _rModuleCode | ||
) | const |
inserts a given piece as code as module
_rLibName | the name of the library to insert the module into. If a library with this name does not yet exist, it will be created. |
_rModName | the name of the module to insert the code as. Must denote a name which is not yet used in the module library. |
_rModuleCode | the code of the new module |
Definition at line 1332 of file scriptdocument.cxx.
References Any, basctl::E_SCRIPTS, and m_pImpl.
Referenced by basctl::SbTreeListBoxDropTarget::NotifyCopyingMoving().
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().
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.
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().
bool basctl::ScriptDocument::isApplication | ( | ) | const |
determines whether the ScriptDocument instance operates on the whole application, as opposed to a real document
Definition at line 1262 of file scriptdocument.cxx.
References m_pImpl.
Referenced by basctl::ScriptDocument::Impl::getBasicManager(), basctl::ScriptDocument::Impl::getLibraryContainer(), isDocument(), basctl::ScriptDocument::Impl::isInVBAMode(), basctl::ScriptDocument::Impl::isReadOnly(), and basctl::MarkDocumentModified().
|
inline |
determines whether the ScriptDocument instance operates on a real document, as opposed to the whole application
Definition at line 429 of file scriptdocument.hxx.
References isApplication(), and isValid().
Referenced by basctl::ScriptDocument::Impl::allowMacros(), basctl::ChooseMacro(), basctl::Shell::CopyDialogResources(), basctl::ScriptDocument::Impl::createDialog(), basctl::Shell::CreateDlgWin(), basctl::DialogWindow::DialogWindow(), basctl::DocumentSignature::DocumentSignature(), basctl::ScriptDocument::Impl::getCurrentFrame(), basctl::ScriptDocument::Impl::getDocument(), getDocumentOrNull(), getLibraryLocation(), basctl::SbTreeListBox::GetRootEntryBitmaps(), basctl::ScriptDocument::Impl::getTitle(), basctl::ScriptDocument::Impl::getURL(), basctl::IMPL_LINK(), basctl::IMPL_LINK_NOARG(), basctl::ScriptDocument::Impl::isDocumentModified(), basctl::Shell::onDocumentModeChanged(), basctl::ScriptDocument::Impl::renameModuleOrDialog(), basctl::MacroChooser::run(), and basctl::ScriptDocument::Impl::setDocumentModified().
bool basctl::ScriptDocument::isDocumentModified | ( | ) | const |
determines whether the document is modified @precond the instance operates on a real document, not on the application
Definition at line 1394 of file scriptdocument.cxx.
References m_pImpl.
bool basctl::ScriptDocument::isInVBAMode | ( | ) | const |
Definition at line 1267 of file scriptdocument.cxx.
References m_pImpl.
Referenced by basctl::Shell::CreateBasWin(), basctl::createModImpl(), basctl::Shell::GetState(), basctl::SbTreeListBox::ImpCreateLibSubEntries(), and basctl::Shell::RemoveWindow().
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().
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>.
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().
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.
|
inline |
Definition at line 155 of file scriptdocument.hxx.
bool basctl::ScriptDocument::operator== | ( | const ScriptDocument & | _rhs | ) | const |
Definition at line 1139 of file scriptdocument.cxx.
References m_pImpl.
bool basctl::ScriptDocument::removeDialog | ( | const OUString & | _rLibName, |
const OUString & | _rDialogName | ||
) | const |
removes a given dialog from the document
Definition at line 1344 of file scriptdocument.cxx.
References basctl::E_DIALOGS, and m_pImpl.
Referenced by basctl::RemoveDialog().
bool basctl::ScriptDocument::removeModule | ( | const OUString & | _rLibName, |
const OUString & | _rModuleName | ||
) | const |
removes a given script module from the document
Definition at line 1293 of file scriptdocument.cxx.
References basctl::E_SCRIPTS, and m_pImpl.
Referenced by basctl::ModulWindow::ExecuteCommand(), and basctl::SbTreeListBoxDropTarget::NotifyCopyingMoving().
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
_rLibName | the library where the dialog lives in. Must denote an existing library. |
_rOldName | the old dialog name. Must denote an existing dialog. |
_rNewName | the new dialog name |
_rxExistingDialogModel | the existing model of the dialog, if already loaded in the IDE |
Definition at line 1366 of file scriptdocument.cxx.
References basctl::E_DIALOGS, and m_pImpl.
Referenced by basctl::RenameDialog().
bool basctl::ScriptDocument::renameModule | ( | const OUString & | _rLibName, |
const OUString & | _rOldName, | ||
const OUString & | _rNewName | ||
) | const |
renames a module
_rLibName | the library where the module lives in. Must denote an existing library. |
_rOldName | the old module name. Must denote an existing module. |
_rNewName | the new module name |
Definition at line 1315 of file scriptdocument.cxx.
References basctl::E_SCRIPTS, and m_pImpl.
Referenced by basctl::RenameModule().
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.
void basctl::ScriptDocument::setDocumentModified | ( | ) | const |
marks the document as modified @precond the instance operates on a real document, not on the application
Definition at line 1388 of file scriptdocument.cxx.
References m_pImpl.
Referenced by basctl::MarkDocumentModified().
bool basctl::ScriptDocument::updateModule | ( | const OUString & | _rLibName, |
const OUString & | _rModName, | ||
const OUString & | _rModuleCode | ||
) | const |
updates a given module with new code
_rLibName | the name of the library the modules lives in. Must denote an existing module library. |
_rModName | the name of the module to update. Must denote an existing module in the given library. |
_rModuleCode | the new module code. |
Definition at line 1338 of file scriptdocument.cxx.
References m_pImpl.
Referenced by basctl::CreateMacro(), and basctl::ModulWindow::UpdateModule().
|
private |
Definition at line 68 of file scriptdocument.hxx.
Referenced by allowMacros(), createDialog(), createModule(), getBasicManager(), getDialog(), getDocument(), getDocumentOrNull(), getDocumentWithURLOrCaption(), getLibrary(), getLibraryContainer(), getLibraryLocation(), getModule(), getOrCreateLibrary(), getTitle(), hasDialog(), hashCode(), hasLibrary(), hasModule(), insertDialog(), insertModule(), isActive(), isAlive(), isApplication(), isDocumentModified(), isInVBAMode(), isReadOnly(), isValid(), loadLibraryIfExists(), operator==(), removeDialog(), removeModule(), renameDialog(), renameModule(), saveDocument(), setDocumentModified(), and updateModule().