LibreOffice Module sd (master) 1
|
Manage the set of active resources. More...
#include <ConfigurationControllerResourceManager.hxx>
Classes | |
class | ResourceComparator |
class | ResourceDescriptor |
For every active resource both the resource itself as well as its creating factory are remembered, so that on deactivation, the resource can be deactivated by this factory. More... | |
Public Member Functions | |
ConfigurationControllerResourceManager (std::shared_ptr< ResourceFactoryManager > pResourceFactoryContainer, std::shared_ptr< ConfigurationControllerBroadcaster > pBroadcaster) | |
A new ResourceManager object is created with the resource factory container for creating resources and the event broadcaster for notifying ConfigurationChangeListeners of activated or deactivated resources. More... | |
~ConfigurationControllerResourceManager () | |
ConfigurationControllerResourceManager (const ConfigurationControllerResourceManager &)=delete | |
Forbid copy construction and copy assignment. More... | |
ConfigurationControllerResourceManager & | operator= (const ConfigurationControllerResourceManager &)=delete |
void | ActivateResources (const ::std::vector< css::uno::Reference< css::drawing::framework::XResourceId > > &rResources, const css::uno::Reference< css::drawing::framework::XConfiguration > &rxConfiguration) |
Activate all the resources that are specified by resource ids in rResources. More... | |
void | DeactivateResources (const ::std::vector< css::uno::Reference< css::drawing::framework::XResourceId > > &rResources, const css::uno::Reference< css::drawing::framework::XConfiguration > &rxConfiguration) |
Deactivate all the resources that are specified by resource ids in rResources. More... | |
ResourceDescriptor | GetResource (const css::uno::Reference< css::drawing::framework::XResourceId > &rxResourceId) |
Return the descriptor for the specified resource. More... | |
Private Types | |
typedef ::std::map< css::uno::Reference< css::drawing::framework::XResourceId >, ResourceDescriptor, ResourceComparator > | ResourceMap |
Private Member Functions | |
void | ActivateResource (const css::uno::Reference< css::drawing::framework::XResourceId > &rxResourceId, const css::uno::Reference< css::drawing::framework::XConfiguration > &rxConfiguration) |
void | DeactivateResource (const css::uno::Reference< css::drawing::framework::XResourceId > &rxResourceId, const css::uno::Reference< css::drawing::framework::XConfiguration > &rxConfiguration) |
void | AddResource (const css::uno::Reference< css::drawing::framework::XResource > &rxResource, const css::uno::Reference< css::drawing::framework::XResourceFactory > &rxFactory) |
ResourceDescriptor | RemoveResource (const css::uno::Reference< css::drawing::framework::XResourceId > &rxResourceId) |
Private Attributes | |
osl::Mutex | maMutex |
ResourceMap | maResourceMap |
std::shared_ptr< ResourceFactoryManager > | mpResourceFactoryContainer |
std::shared_ptr< ConfigurationControllerBroadcaster > | mpBroadcaster |
This broadcaster is used to notify the activation and deactivation of resources. More... | |
Manage the set of active resources.
Activate and deactivate resources.
Definition at line 42 of file ConfigurationControllerResourceManager.hxx.
|
private |
Definition at line 113 of file ConfigurationControllerResourceManager.hxx.
sd::framework::ConfigurationControllerResourceManager::ConfigurationControllerResourceManager | ( | std::shared_ptr< ResourceFactoryManager > | pResourceFactoryContainer, |
std::shared_ptr< ConfigurationControllerBroadcaster > | pBroadcaster | ||
) |
A new ResourceManager object is created with the resource factory container for creating resources and the event broadcaster for notifying ConfigurationChangeListeners of activated or deactivated resources.
Definition at line 40 of file ConfigurationControllerResourceManager.cxx.
sd::framework::ConfigurationControllerResourceManager::~ConfigurationControllerResourceManager | ( | ) |
Definition at line 49 of file ConfigurationControllerResourceManager.cxx.
|
delete |
Forbid copy construction and copy assignment.
|
private |
Definition at line 101 of file ConfigurationControllerResourceManager.cxx.
References AddResource(), DBG_UNHANDLED_EXCEPTION, Exception, mpBroadcaster, mpResourceFactoryContainer, sd::framework::FrameworkHelper::msResourceActivationEvent, sd::framework::FrameworkHelper::ResourceIdToString(), SAL_INFO, and xFactory.
Referenced by ActivateResources().
void sd::framework::ConfigurationControllerResourceManager::ActivateResources | ( | const ::std::vector< css::uno::Reference< css::drawing::framework::XResourceId > > & | rResources, |
const css::uno::Reference< css::drawing::framework::XConfiguration > & | rxConfiguration | ||
) |
Activate all the resources that are specified by resource ids in rResources.
The resource ids of activated resources are added to the given configuration. Activated resources are notified to all interested ConfigurationChangeListeners.
Definition at line 65 of file ConfigurationControllerResourceManager.cxx.
References ActivateResource(), and maMutex.
|
private |
Definition at line 243 of file ConfigurationControllerResourceManager.cxx.
References maResourceMap, sd::framework::ConfigurationControllerResourceManager::ResourceDescriptor::mxResource, sd::framework::ConfigurationControllerResourceManager::ResourceDescriptor::mxResourceFactory, sd::framework::FrameworkHelper::ResourceIdToString(), and SAL_INFO.
Referenced by ActivateResource().
|
private |
Definition at line 173 of file ConfigurationControllerResourceManager.cxx.
References DBG_UNHANDLED_EXCEPTION, mpBroadcaster, mpResourceFactoryContainer, sd::framework::FrameworkHelper::msResourceDeactivationEndEvent, sd::framework::FrameworkHelper::msResourceDeactivationEvent, sd::framework::ConfigurationControllerResourceManager::ResourceDescriptor::mxResource, sd::framework::ConfigurationControllerResourceManager::ResourceDescriptor::mxResourceFactory, RemoveResource(), sd::framework::FrameworkHelper::ResourceIdToString(), and SAL_INFO.
void sd::framework::ConfigurationControllerResourceManager::DeactivateResources | ( | const ::std::vector< css::uno::Reference< css::drawing::framework::XResourceId > > & | rResources, |
const css::uno::Reference< css::drawing::framework::XConfiguration > & | rxConfiguration | ||
) |
Deactivate all the resources that are specified by resource ids in rResources.
The resource ids of deactivated resources are removed from the given configuration. Activated resources are notified to all interested ConfigurationChangeListeners.
Definition at line 77 of file ConfigurationControllerResourceManager.cxx.
References maMutex.
ConfigurationControllerResourceManager::ResourceDescriptor sd::framework::ConfigurationControllerResourceManager::GetResource | ( | const css::uno::Reference< css::drawing::framework::XResourceId > & | rxResourceId | ) |
Return the descriptor for the specified resource.
Definition at line 54 of file ConfigurationControllerResourceManager.cxx.
References maMutex, and maResourceMap.
|
delete |
|
private |
Definition at line 267 of file ConfigurationControllerResourceManager.cxx.
References maResourceMap, sd::framework::FrameworkHelper::ResourceIdToString(), and SAL_INFO.
Referenced by DeactivateResource().
|
private |
Definition at line 100 of file ConfigurationControllerResourceManager.hxx.
Referenced by ActivateResources(), DeactivateResources(), and GetResource().
|
private |
Definition at line 114 of file ConfigurationControllerResourceManager.hxx.
Referenced by AddResource(), GetResource(), and RemoveResource().
|
private |
This broadcaster is used to notify the activation and deactivation of resources.
Definition at line 121 of file ConfigurationControllerResourceManager.hxx.
Referenced by ActivateResource(), and DeactivateResource().
|
private |
Definition at line 116 of file ConfigurationControllerResourceManager.hxx.
Referenced by ActivateResource(), and DeactivateResource().