LibreOffice Module basic (master) 1
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
BasicManager Class Referencefinal

#include <basmgr.hxx>

Inheritance diagram for BasicManager:
[legend]
Collaboration diagram for BasicManager:
[legend]

Public Member Functions

 BasicManager (SotStorage &rStorage, std::u16string_view rBaseURL, StarBASIC *pParentFromStdLib=nullptr, OUString const *pLibPath=nullptr, bool bDocMgr=false)
 
 BasicManager (StarBASIC *pStdLib, OUString const *pLibPath=nullptr, bool bDocMgr=false)
 
virtual ~BasicManager () override
 
void SetStorageName (const OUString &rName)
 
const OUString & GetStorageName () const
 
void SetName (const OUString &rName)
 
const OUString & GetName () const
 
sal_uInt16 GetLibCount () const
 
StarBASICGetLib (sal_uInt16 nLib) const
 
StarBASICGetLib (std::u16string_view rName) const
 
sal_uInt16 GetLibId (std::u16string_view rName) const
 
OUString GetLibName (sal_uInt16 nLib)
 
void SetLibraryContainerInfo (const LibraryContainerInfo &rInfo)
 announces the library containers which belong to this BasicManager More...
 
const css::uno::Reference< css::script::XPersistentLibraryContainer > & GetDialogLibraryContainer () const
 
const css::uno::Reference< css::script::XPersistentLibraryContainer > & GetScriptLibraryContainer () const
 
bool LoadLib (sal_uInt16 nLib)
 
bool RemoveLib (sal_uInt16 nLib, bool bDelBasicFromStorage)
 
bool IsBasicModified () const
 
std::vector< BasicError > & GetErrors ()
 
void SetGlobalUNOConstant (const OUString &rName, const css::uno::Any &_rValue, css::uno::Any *pOldValue=nullptr)
 sets a global constant in the basic library, referring to some UNO object, to a new value. More...
 
bool GetGlobalUNOConstant (const OUString &rName, css::uno::Any &aOut)
 retrieves a global constant in the basic library, referring to some UNO object, returns true if a value is found ( value is in aOut ) false otherwise. More...
 
bool ImgVersion12PsswdBinaryLimitExceeded (std::vector< OUString > &_out_rModuleNames)
 determines whether there are password-protected modules whose size exceeds the B_IMG_VERSION_12 module size More...
 
bool HasExeCode (std::u16string_view)
 
bool HasMacro (OUString const &i_fullyQualifiedName) const
 determines whether the Basic Manager has a given macro, given by fully qualified name More...
 
ErrCode ExecuteMacro (OUString const &i_fullyQualifiedName, SbxArray *i_arguments, SbxValue *i_retValue)
 executes a given macro More...
 
ErrCode ExecuteMacro (OUString const &i_fullyQualifiedName, std::u16string_view i_commaSeparatedArgs, SbxValue *i_retValue)
 executes a given macro More...
 
- Public Member Functions inherited from SfxBroadcaster
 SfxBroadcaster ()
 
 SfxBroadcaster (const SfxBroadcaster &rBC)
 
virtual ~SfxBroadcaster () COVERITY_NOEXCEPT_FALSE
 
void Broadcast (const SfxHint &rHint)
 
bool HasListeners () const
 
size_t GetListenerCount () const
 
void ForAllListeners (std::function< bool(SfxListener *)> f) const
 

Private Member Functions

bool ImpLoadLibrary (BasicLibInfo *pLibInfo, SotStorage *pCurStorage)
 
void ImpCreateStdLib (StarBASIC *pParentFromStdLib)
 
void ImpMgrNotLoaded (const OUString &rStorageName)
 
BasicLibInfoCreateLibInfo ()
 
void LoadBasicManager (SotStorage &rStorage, std::u16string_view rBaseURL)
 
void LoadOldBasicManager (SotStorage &rStorage)
 
bool ImplLoadBasic (SvStream &rStrm, StarBASICRef &rOldBasic) const
 
BasicLibInfoFindLibInfo (StarBASIC const *pBasic)
 
BASIC_DLLPRIVATE bool IsReference (sal_uInt16 nLib)
 
BASIC_DLLPRIVATE StarBASICGetStdLib () const
 
BASIC_DLLPRIVATE StarBASICAddLib (SotStorage &rStorage, const OUString &rLibName, bool bReference)
 
BASIC_DLLPRIVATE void RemoveLib (sal_uInt16 nLib)
 
BASIC_DLLPRIVATE bool HasLib (std::u16string_view rName) const
 
BASIC_DLLPRIVATE StarBASICCreateLibForLibContainer (const OUString &rLibName, const css::uno::Reference< css::script::XLibraryContainer > &xScriptCont)
 
BASIC_DLLPRIVATE StarBASICCreateLib (const OUString &rLibName)
 
BASIC_DLLPRIVATE StarBASICCreateLib (const OUString &rLibName, const OUString &Password, const OUString &LinkTargetURL)
 
BasicManageroperator= (BasicManager const &)=delete
 
 BasicManager (BasicManager const &)=delete
 

Static Private Member Functions

static bool ImplEncryptStream (SvStream &rStream)
 
static void CheckModules (StarBASIC *pBasic, bool bReference)
 

Private Attributes

std::vector< BasicErroraErrors
 
OUString aName
 
OUString maStorageName
 
bool mbDocMgr
 
LibraryContainerInfo maContainerInfo
 
std::vector< std::unique_ptr< BasicLibInfo > > maLibs
 
OUString aBasicLibPath
 

Friends

class LibraryContainer_Impl
 
class StarBasicAccess_Impl
 
class BasMgrContainerListenerImpl
 
class ::basic::ImplRepository
 

Additional Inherited Members

- Protected Member Functions inherited from SfxBroadcaster
void Forward (SfxBroadcaster &rBC, const SfxHint &rHint)
 

Detailed Description

Definition at line 97 of file basmgr.hxx.

Constructor & Destructor Documentation

◆ BasicManager() [1/3]

BasicManager::BasicManager ( SotStorage rStorage,
std::u16string_view  rBaseURL,
StarBASIC pParentFromStdLib = nullptr,
OUString const *  pLibPath = nullptr,
bool  bDocMgr = false 
)

◆ BasicManager() [2/3]

BasicManager::BasicManager ( StarBASIC pStdLib,
OUString const *  pLibPath = nullptr,
bool  bDocMgr = false 
)

◆ ~BasicManager()

BasicManager::~BasicManager ( )
overridevirtual

Definition at line 808 of file basmgr.cxx.

References SfxBroadcaster::Broadcast().

◆ BasicManager() [3/3]

BasicManager::BasicManager ( BasicManager const &  )
privatedelete

Member Function Documentation

◆ AddLib()

StarBASIC * BasicManager::AddLib ( SotStorage rStorage,
const OUString &  rLibName,
bool  bReference 
)
private

◆ CheckModules()

void BasicManager::CheckModules ( StarBASIC pBasic,
bool  bReference 
)
staticprivate

Definition at line 986 of file basmgr.cxx.

References DBG_ASSERT, StarBASIC::GetErrorCode(), and pLib.

Referenced by ImpLoadLibrary().

◆ CreateLib() [1/2]

StarBASIC * BasicManager::CreateLib ( const OUString &  rLibName)
private

◆ CreateLib() [2/2]

StarBASIC * BasicManager::CreateLib ( const OUString &  rLibName,
const OUString &  Password,
const OUString &  LinkTargetURL 
)
private

◆ CreateLibForLibContainer()

StarBASIC * BasicManager::CreateLibForLibContainer ( const OUString &  rLibName,
const css::uno::Reference< css::script::XLibraryContainer > &  xScriptCont 
)
private

◆ CreateLibInfo()

BasicLibInfo * BasicManager::CreateLibInfo ( )
private

◆ ExecuteMacro() [1/2]

ErrCode BasicManager::ExecuteMacro ( OUString const &  i_fullyQualifiedName,
SbxArray i_arguments,
SbxValue i_retValue 
)

executes a given macro

Definition at line 1494 of file basmgr.cxx.

References SbMethod::Call(), ERRCODE_BASIC_PROC_UNDEFINED, ERRCODE_NONE, and SbxVariable::SetParameters().

◆ ExecuteMacro() [2/2]

ErrCode BasicManager::ExecuteMacro ( OUString const &  i_fullyQualifiedName,
std::u16string_view  i_commaSeparatedArgs,
SbxValue i_retValue 
)

◆ FindLibInfo()

BasicLibInfo * BasicManager::FindLibInfo ( StarBASIC const *  pBasic)
private

Definition at line 1337 of file basmgr.cxx.

References maLibs.

Referenced by CreateLib(), and LibraryContainer_Impl::getByName().

◆ GetDialogLibraryContainer()

const uno::Reference< script::XPersistentLibraryContainer > & BasicManager::GetDialogLibraryContainer ( ) const

Definition at line 516 of file basmgr.cxx.

References maContainerInfo, and LibraryContainerInfo::mxDialogCont.

◆ GetErrors()

std::vector< BasicError > & BasicManager::GetErrors ( )
inline

Definition at line 163 of file basmgr.hxx.

◆ GetGlobalUNOConstant()

bool BasicManager::GetGlobalUNOConstant ( const OUString &  rName,
css::uno::Any &  aOut 
)

retrieves a global constant in the basic library, referring to some UNO object, returns true if a value is found ( value is in aOut ) false otherwise.

Definition at line 1363 of file basmgr.cxx.

References GetStdLib(), and StarBASIC::GetUNOConstant().

◆ GetLib() [1/2]

StarBASIC * BasicManager::GetLib ( sal_uInt16  nLib) const

◆ GetLib() [2/2]

StarBASIC * BasicManager::GetLib ( std::u16string_view  rName) const

Definition at line 1185 of file basmgr.cxx.

References maLibs.

◆ GetLibCount()

sal_uInt16 BasicManager::GetLibCount ( ) const

◆ GetLibId()

sal_uInt16 BasicManager::GetLibId ( std::u16string_view  rName) const

◆ GetLibName()

OUString BasicManager::GetLibName ( sal_uInt16  nLib)

Definition at line 1221 of file basmgr.cxx.

References DBG_ASSERT, and maLibs.

Referenced by LibraryContainer_Impl::getElementNames(), and GetLibId().

◆ GetName()

const OUString & BasicManager::GetName ( ) const
inline

Definition at line 135 of file basmgr.hxx.

References aName.

Referenced by basic::SfxLibraryContainer::setVBACompatibilityMode().

◆ GetScriptLibraryContainer()

const uno::Reference< script::XPersistentLibraryContainer > & BasicManager::GetScriptLibraryContainer ( ) const

◆ GetStdLib()

StarBASIC * BasicManager::GetStdLib ( ) const
private

◆ GetStorageName()

const OUString & BasicManager::GetStorageName ( ) const
inline

Definition at line 133 of file basmgr.hxx.

Referenced by ImpLoadLibrary(), and RemoveLib().

◆ HasExeCode()

bool BasicManager::HasExeCode ( std::u16string_view  sLib)

Definition at line 814 of file basmgr.cxx.

References GetLib(), and pLib.

Referenced by basic::SfxScriptLibraryContainer::HasExecutableCode().

◆ HasLib()

bool BasicManager::HasLib ( std::u16string_view  rName) const
private

Definition at line 1209 of file basmgr.cxx.

References maLibs.

Referenced by AddLib(), LibraryContainer_Impl::getByName(), and LibraryContainer_Impl::hasByName().

◆ HasMacro()

bool BasicManager::HasMacro ( OUString const &  i_fullyQualifiedName) const

determines whether the Basic Manager has a given macro, given by fully qualified name

Definition at line 1489 of file basmgr.cxx.

◆ ImgVersion12PsswdBinaryLimitExceeded()

bool BasicManager::ImgVersion12PsswdBinaryLimitExceeded ( std::vector< OUString > &  _out_rModuleNames)

determines whether there are password-protected modules whose size exceeds the B_IMG_VERSION_12 module size

Parameters
_out_rModuleNamestakes the names of modules whose size exceeds the B_IMG_VERSION_12 limit

Definition at line 1393 of file basmgr.cxx.

References DBG_UNHANDLED_EXCEPTION, SbModule::ExceedsImgVersion12ModuleSize(), StarBASIC::FindModule(), GetLib(), and GetScriptLibraryContainer().

◆ ImpCreateStdLib()

void BasicManager::ImpCreateStdLib ( StarBASIC pParentFromStdLib)
private

◆ ImplEncryptStream()

bool BasicManager::ImplEncryptStream ( SvStream rStream)
staticprivate

◆ ImplLoadBasic()

bool BasicManager::ImplLoadBasic ( SvStream rStrm,
StarBASICRef rOldBasic 
) const
private

◆ ImpLoadLibrary()

bool BasicManager::ImpLoadLibrary ( BasicLibInfo pLibInfo,
SotStorage pCurStorage 
)
private

◆ ImpMgrNotLoaded()

void BasicManager::ImpMgrNotLoaded ( const OUString &  rStorageName)
private

◆ IsBasicModified()

bool BasicManager::IsBasicModified ( ) const

Definition at line 1350 of file basmgr.cxx.

References maLibs.

◆ IsReference()

bool BasicManager::IsReference ( sal_uInt16  nLib)
private

Definition at line 1063 of file basmgr.cxx.

References DBG_ASSERT, and maLibs.

Referenced by RemoveLib().

◆ LoadBasicManager()

void BasicManager::LoadBasicManager ( SotStorage rStorage,
std::u16string_view  rBaseURL 
)
private

◆ LoadLib()

bool BasicManager::LoadLib ( sal_uInt16  nLib)

◆ LoadOldBasicManager()

void BasicManager::LoadOldBasicManager ( SotStorage rStorage)
private

◆ operator=()

BasicManager & BasicManager::operator= ( BasicManager const &  )
privatedelete

◆ RemoveLib() [1/2]

void BasicManager::RemoveLib ( sal_uInt16  nLib)
private

Definition at line 1073 of file basmgr.cxx.

References IsReference(), and RemoveLib().

◆ RemoveLib() [2/2]

bool BasicManager::RemoveLib ( sal_uInt16  nLib,
bool  bDelBasicFromStorage 
)

◆ SetGlobalUNOConstant()

void BasicManager::SetGlobalUNOConstant ( const OUString &  rName,
const css::uno::Any &  _rValue,
css::uno::Any *  pOldValue = nullptr 
)

sets a global constant in the basic library, referring to some UNO object, to a new value.

If a constant with this name already existed before, its value is changed, and the old constant is returned in pOldValue. If it does not yet exist, it is newly created, and inserted into the basic library.

Definition at line 1373 of file basmgr.cxx.

References DontStore, StarBASIC::Find(), tools::SvRef< typename T >::get(), GetSbUnoObject(), GetStdLib(), StarBASIC::Insert(), Object, and sbxToUnoValue().

Referenced by basic::ImplRepository::impl_createApplicationBasicManager(), and SetLibraryContainerInfo().

◆ SetLibraryContainerInfo()

void BasicManager::SetLibraryContainerInfo ( const LibraryContainerInfo rInfo)

◆ SetName()

void BasicManager::SetName ( const OUString &  rName)
inline

Definition at line 134 of file basmgr.hxx.

References aName.

Referenced by basic::SfxLibraryContainer::setProjectName().

◆ SetStorageName()

void BasicManager::SetStorageName ( const OUString &  rName)
inline

Friends And Related Function Documentation

◆ ::basic::ImplRepository

friend class ::basic::ImplRepository
friend

Definition at line 102 of file basmgr.hxx.

◆ BasMgrContainerListenerImpl

friend class BasMgrContainerListenerImpl
friend

Definition at line 101 of file basmgr.hxx.

Referenced by SetLibraryContainerInfo().

◆ LibraryContainer_Impl

friend class LibraryContainer_Impl
friend

Definition at line 99 of file basmgr.hxx.

◆ StarBasicAccess_Impl

friend class StarBasicAccess_Impl
friend

Definition at line 100 of file basmgr.hxx.

Member Data Documentation

◆ aBasicLibPath

OUString BasicManager::aBasicLibPath
private

Definition at line 113 of file basmgr.hxx.

Referenced by BasicManager(), and LoadBasicManager().

◆ aErrors

std::vector<BasicError> BasicManager::aErrors
private

Definition at line 105 of file basmgr.hxx.

Referenced by ImpLoadLibrary(), ImpMgrNotLoaded(), LoadLib(), LoadOldBasicManager(), and RemoveLib().

◆ aName

OUString BasicManager::aName
private

Definition at line 107 of file basmgr.hxx.

◆ maContainerInfo

LibraryContainerInfo BasicManager::maContainerInfo
private

◆ maLibs

std::vector<std::unique_ptr<BasicLibInfo> > BasicManager::maLibs
private

◆ maStorageName

OUString BasicManager::maStorageName
private

Definition at line 108 of file basmgr.hxx.

Referenced by BasicManager(), and LoadBasicManager().

◆ mbDocMgr

bool BasicManager::mbDocMgr
private

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