LibreOffice Module basic (master) 1
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
basic::ImplRepository Class Reference
Inheritance diagram for basic::ImplRepository:
[legend]
Collaboration diagram for basic::ImplRepository:
[legend]

Public Member Functions

BasicManagergetDocumentBasicManager (const Reference< XModel > &_rxDocumentModel)
 
BasicManagergetOrCreateApplicationBasicManager ()
 
void registerCreationListener (BasicManagerCreationListener &_rListener)
 
void revokeCreationListener (BasicManagerCreationListener &_rListener)
 
- Public Member Functions inherited from SfxListener
 SfxListener ()
 
 SfxListener (const SfxListener &rCopy)
 
virtual ~SfxListener () COVERITY_NOEXCEPT_FALSE
 
void StartListening (SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
 
void EndListening (SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
 
void EndListeningAll ()
 
bool IsListening (SfxBroadcaster &rBroadcaster) const
 
sal_uInt16 GetBroadcasterCount () const
 
SfxBroadcasterGetBroadcasterJOE (sal_uInt16 nNo) const
 
virtual void Notify (SfxBroadcaster &rBC, const SfxHint &rHint)
 
void RemoveBroadcaster_Impl (SfxBroadcaster &rBC)
 
virtual bool IsSdrView () const
 
- Public Member Functions inherited from SvRefBase
 SvRefBase ()
 
 SvRefBase (const SvRefBase &)
 
SvRefBaseoperator= (const SvRefBase &)
 
void RestoreNoDelete ()
 
void AddNextRef ()
 
void AddFirstRef ()
 
void ReleaseRef ()
 
unsigned int GetRefCount () const
 

Static Public Member Functions

static ImplRepositoryInstance ()
 
static BasicManagergetApplicationBasicManager ()
 
static void setApplicationBasicManager (std::unique_ptr< BasicManager > _pBasicManager)
 

Private Member Functions

 ImplRepository ()
 
 ~ImplRepository ()
 
BasicManagerStore::iterator impl_getLocationForModel (const Reference< XModel > &_rxDocumentModel)
 retrieves the location at which the BasicManager for the given model is stored. More...
 
bool impl_hasLocationForModel (const Reference< XModel > &_rxDocumentModel) const
 tests if there is a location set at which the BasicManager for the given model is stored. More...
 
bool impl_createManagerForModel (BasicManagerStore::iterator location, const Reference< XModel > &_rxDocumentModel)
 creates a new BasicManager instance for the given model More...
 
BasicManagerimpl_createApplicationBasicManager ()
 creates the application-wide BasicManager More...
 
void impl_notifyCreationListeners (const Reference< XModel > &_rxDocumentModel, BasicManager &_rManager)
 notifies all listeners which expressed interest in the creation of BasicManager instances. More...
 
virtual void _disposing (const css::lang::EventObject &_rSource) override
 
virtual void Notify (SfxBroadcaster &_rBC, const SfxHint &_rHint) override
 
void impl_removeFromRepository (const BasicManagerStore::iterator &_pos)
 removes the Model/BasicManager pair given by iterator from our store More...
 
StarBASICimpl_getDefaultAppBasicLibrary ()
 

Static Private Member Functions

static bool impl_getDocumentStorage_nothrow (const Reference< XModel > &_rxDocument, Reference< XStorage > &_out_rStorage)
 retrieves the current storage of a given document More...
 
static bool impl_getDocumentLibraryContainers_nothrow (const Reference< XModel > &_rxDocument, Reference< XPersistentLibraryContainer > &_out_rxBasicLibraries, Reference< XPersistentLibraryContainer > &_out_rxDialogLibraries)
 retrieves the containers for Basic and Dialog libraries for a given document More...
 
static void impl_initDocLibraryContainers_nothrow (const Reference< XPersistentLibraryContainer > &_rxBasicLibraries, const Reference< XPersistentLibraryContainer > &_rxDialogLibraries)
 initializes the given library containers, which belong to a document More...
 

Private Attributes

BasicManagerStore m_aStore
 
CreationListeners m_aCreationListeners
 

Additional Inherited Members

- Protected Member Functions inherited from utl::OEventListenerAdapter
 OEventListenerAdapter ()
 
virtual ~OEventListenerAdapter ()
 
void startComponentListening (const css::uno::Reference< css::lang::XComponent > &_rxComp)
 
void stopComponentListening (const css::uno::Reference< css::lang::XComponent > &_rxComp)
 
void stopAllComponentListening ()
 
virtual void _disposing (const css::lang::EventObject &_rSource)=0
 
- Protected Member Functions inherited from SvRefBase
virtual ~SvRefBase () COVERITY_NOEXCEPT_FALSE
 

Detailed Description

Definition at line 68 of file basicmanagerrepository.cxx.

Constructor & Destructor Documentation

◆ ImplRepository()

basic::ImplRepository::ImplRepository ( )
private

Definition at line 196 of file basicmanagerrepository.cxx.

Referenced by Instance().

◆ ~ImplRepository()

basic::ImplRepository::~ImplRepository ( )
private

Definition at line 200 of file basicmanagerrepository.cxx.

References SfxListener::EndListening(), and m_aStore.

Member Function Documentation

◆ _disposing()

void basic::ImplRepository::_disposing ( const css::lang::EventObject &  _rSource)
overrideprivatevirtual

Implements utl::OEventListenerAdapter.

Definition at line 558 of file basicmanagerrepository.cxx.

References impl_removeFromRepository(), and m_aStore.

◆ getApplicationBasicManager()

BasicManager * basic::ImplRepository::getApplicationBasicManager ( )
static

Definition at line 249 of file basicmanagerrepository.cxx.

References GetSbData().

Referenced by impl_createApplicationBasicManager().

◆ getDocumentBasicManager()

BasicManager * basic::ImplRepository::getDocumentBasicManager ( const Reference< XModel > &  _rxDocumentModel)

◆ getOrCreateApplicationBasicManager()

BasicManager * basic::ImplRepository::getOrCreateApplicationBasicManager ( )

◆ impl_createApplicationBasicManager()

BasicManager * basic::ImplRepository::impl_createApplicationBasicManager ( )
private

◆ impl_createManagerForModel()

bool basic::ImplRepository::impl_createManagerForModel ( BasicManagerStore::iterator  location,
const Reference< XModel > &  _rxDocumentModel 
)
private

◆ impl_getDefaultAppBasicLibrary()

StarBASIC * basic::ImplRepository::impl_getDefaultAppBasicLibrary ( )
private

◆ impl_getDocumentLibraryContainers_nothrow()

bool basic::ImplRepository::impl_getDocumentLibraryContainers_nothrow ( const Reference< XModel > &  _rxDocument,
Reference< XPersistentLibraryContainer > &  _out_rxBasicLibraries,
Reference< XPersistentLibraryContainer > &  _out_rxDialogLibraries 
)
staticprivate

retrieves the containers for Basic and Dialog libraries for a given document

Parameters
_rxDocumentthe document whose containers are to be retrieved.
_out_rxBasicLibrariestakes the basic library container upon successful return
_out_rxDialogLibrariestakes the dialog library container upon successful return
Returns
<TRUE> if and only if both containers exist, and could successfully be retrieved

Definition at line 521 of file basicmanagerrepository.cxx.

References DBG_UNHANDLED_EXCEPTION, and Exception.

Referenced by impl_createManagerForModel().

◆ impl_getDocumentStorage_nothrow()

bool basic::ImplRepository::impl_getDocumentStorage_nothrow ( const Reference< XModel > &  _rxDocument,
Reference< XStorage > &  _out_rStorage 
)
staticprivate

retrieves the current storage of a given document

Parameters
_rxDocumentthe document whose storage is to be retrieved.
_out_rStoragetakes the storage upon successful return. Note that this might be <NULL> even if <TRUE> is returned. In this case, the document has not yet been saved.
Returns
<TRUE> if the storage could be successfully retrieved (in which case <arg>_out_rStorage</arg> might or might not be <NULL>), <FALSE> otherwise. In the latter case, processing this document should stop.

Definition at line 504 of file basicmanagerrepository.cxx.

References DBG_UNHANDLED_EXCEPTION, and Exception.

Referenced by impl_createManagerForModel().

◆ impl_getLocationForModel()

BasicManagerStore::iterator basic::ImplRepository::impl_getLocationForModel ( const Reference< XModel > &  _rxDocumentModel)
private

retrieves the location at which the BasicManager for the given model is stored.

If previously, the BasicManager for this model has never been requested, then the model is added to the map, with an initial NULL BasicManager.

Parameters
_rxDocumentModelthe model whose BasicManager's location is to be retrieved. Must not be <NULL>.

@precond our mutex is locked

Definition at line 361 of file basicmanagerrepository.cxx.

References DBG_ASSERT, and m_aStore.

Referenced by getDocumentBasicManager().

◆ impl_hasLocationForModel()

bool basic::ImplRepository::impl_hasLocationForModel ( const Reference< XModel > &  _rxDocumentModel) const
private

tests if there is a location set at which the BasicManager for the given model is stored.

Parameters
_rxDocumentModelthe model whose BasicManager's location is to be retrieved. Must not be <NULL>.

@precond our mutex is locked

Definition at line 369 of file basicmanagerrepository.cxx.

References DBG_ASSERT, and m_aStore.

Referenced by impl_createManagerForModel().

◆ impl_initDocLibraryContainers_nothrow()

void basic::ImplRepository::impl_initDocLibraryContainers_nothrow ( const Reference< XPersistentLibraryContainer > &  _rxBasicLibraries,
const Reference< XPersistentLibraryContainer > &  _rxDialogLibraries 
)
staticprivate

initializes the given library containers, which belong to a document

Definition at line 377 of file basicmanagerrepository.cxx.

References DBG_UNHANDLED_EXCEPTION, Exception, and u.

Referenced by impl_createManagerForModel().

◆ impl_notifyCreationListeners()

void basic::ImplRepository::impl_notifyCreationListeners ( const Reference< XModel > &  _rxDocumentModel,
BasicManager _rManager 
)
private

notifies all listeners which expressed interest in the creation of BasicManager instances.

Definition at line 343 of file basicmanagerrepository.cxx.

References m_aCreationListeners.

Referenced by impl_createApplicationBasicManager(), and impl_createManagerForModel().

◆ impl_removeFromRepository()

void basic::ImplRepository::impl_removeFromRepository ( const BasicManagerStore::iterator &  _pos)
private

removes the Model/BasicManager pair given by iterator from our store

Definition at line 540 of file basicmanagerrepository.cxx.

References SfxListener::EndListening(), m_aStore, utl::OEventListenerAdapter::stopComponentListening(), and xModel.

Referenced by _disposing().

◆ Instance()

ImplRepository & basic::ImplRepository::Instance ( )
static

◆ Notify()

void basic::ImplRepository::Notify ( SfxBroadcaster _rBC,
const SfxHint _rHint 
)
overrideprivatevirtual

Reimplemented from SfxListener.

Definition at line 577 of file basicmanagerrepository.cxx.

References SfxHint::GetId(), and m_aStore.

◆ registerCreationListener()

void basic::ImplRepository::registerCreationListener ( BasicManagerCreationListener _rListener)

◆ revokeCreationListener()

void basic::ImplRepository::revokeCreationListener ( BasicManagerCreationListener _rListener)

◆ setApplicationBasicManager()

void basic::ImplRepository::setApplicationBasicManager ( std::unique_ptr< BasicManager _pBasicManager)
static

Member Data Documentation

◆ m_aCreationListeners

CreationListeners basic::ImplRepository::m_aCreationListeners
private

◆ m_aStore

BasicManagerStore basic::ImplRepository::m_aStore
private

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