LibreOffice Module sd (master) 1
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
sd::framework::ResourceFactoryManager Class Reference

Container of resource factories of the drawing framework. More...

#include <ResourceFactoryManager.hxx>

Collaboration diagram for sd::framework::ResourceFactoryManager:
[legend]

Public Member Functions

 ResourceFactoryManager (const rtl::Reference<::sd::DrawController > &rxManager)
 
 ~ResourceFactoryManager ()
 
void AddFactory (const OUString &rsURL, const css::uno::Reference< css::drawing::framework::XResourceFactory > &rxFactory)
 Register a resource factory for one type of resource. More...
 
void RemoveFactoryForURL (const OUString &rsURL)
 Unregister the specified factory. More...
 
void RemoveFactoryForReference (const css::uno::Reference< css::drawing::framework::XResourceFactory > &rxFactory)
 Unregister the specified factory. More...
 
css::uno::Reference< css::drawing::framework::XResourceFactory > GetFactory (const OUString &rsURL)
 Return a factory that can create resources specified by the given URL. More...
 

Private Types

typedef std::unordered_map< OUString, css::uno::Reference< css::drawing::framework::XResourceFactory > > FactoryMap
 
typedef ::std::vector< ::std::pair< OUString, css::uno::Reference< css::drawing::framework::XResourceFactory > > > FactoryPatternList
 

Private Member Functions

css::uno::Reference< css::drawing::framework::XResourceFactory > FindFactory (const OUString &rsURLBase)
 Look up the factory for the given URL. More...
 

Private Attributes

std::mutex maMutex
 
FactoryMap maFactoryMap
 
FactoryPatternList maFactoryPatternList
 
rtl::Reference<::sd::DrawControllermxControllerManager
 
css::uno::Reference< css::util::XURLTransformer > mxURLTransformer
 

Detailed Description

Container of resource factories of the drawing framework.

Definition at line 42 of file ResourceFactoryManager.hxx.

Member Typedef Documentation

◆ FactoryMap

typedef std::unordered_map< OUString, css::uno::Reference<css::drawing::framework::XResourceFactory> > sd::framework::ResourceFactoryManager::FactoryMap
private

Definition at line 94 of file ResourceFactoryManager.hxx.

◆ FactoryPatternList

typedef ::std::vector< ::std::pair< OUString, css::uno::Reference<css::drawing::framework::XResourceFactory> > > sd::framework::ResourceFactoryManager::FactoryPatternList
private

Definition at line 101 of file ResourceFactoryManager.hxx.

Constructor & Destructor Documentation

◆ ResourceFactoryManager()

sd::framework::ResourceFactoryManager::ResourceFactoryManager ( const rtl::Reference<::sd::DrawController > &  rxManager)
explicit

Definition at line 41 of file ResourceFactoryManager.cxx.

References mxURLTransformer.

◆ ~ResourceFactoryManager()

sd::framework::ResourceFactoryManager::~ResourceFactoryManager ( )

Definition at line 49 of file ResourceFactoryManager.cxx.

References maFactoryMap, and mxURLTransformer.

Member Function Documentation

◆ AddFactory()

void sd::framework::ResourceFactoryManager::AddFactory ( const OUString &  rsURL,
const css::uno::Reference< css::drawing::framework::XResourceFactory > &  rxFactory 
)

Register a resource factory for one type of resource.

Parameters
rsURLThe type of the resource that will be created by the factory.
rxFactoryThe factory that will create resource objects of the specified type.
Exceptions
css::uno::RuntimeException

Definition at line 64 of file ResourceFactoryManager.cxx.

References maFactoryMap, maFactoryPatternList, maMutex, and SAL_INFO.

◆ FindFactory()

Reference< XResourceFactory > sd::framework::ResourceFactoryManager::FindFactory ( const OUString &  rsURLBase)
private

Look up the factory for the given URL.

Parameters
rsURLBaseThe css::tools::URL.Main part of a URL. Arguments have to be stripped off by the caller.
Returns
When the factory has not yet been added then return NULL.
Exceptions
css::uno::RuntimeException

Definition at line 176 of file ResourceFactoryManager.cxx.

References maFactoryMap, maFactoryPatternList, and maMutex.

Referenced by GetFactory().

◆ GetFactory()

Reference< XResourceFactory > sd::framework::ResourceFactoryManager::GetFactory ( const OUString &  rsURL)

Return a factory that can create resources specified by the given URL.

Parameters
rsCompleteURLThis URL specifies the type of the resource. It may contain arguments.
Returns
When a factory for the specified URL has been registered by a previous call to AddFactory() then a reference to that factory is returned. Otherwise an empty reference is returned.
Exceptions
css::uno::RuntimeException

Definition at line 145 of file ResourceFactoryManager.cxx.

References aURL, FindFactory(), mxControllerManager, mxURLTransformer, and xFactory.

◆ RemoveFactoryForReference()

void sd::framework::ResourceFactoryManager::RemoveFactoryForReference ( const css::uno::Reference< css::drawing::framework::XResourceFactory > &  rxFactory)

Unregister the specified factory.

Parameters
rxFactoryUnregister the this factory for all URLs that it has been registered for.
Exceptions
css::uno::RuntimeException

Definition at line 120 of file ResourceFactoryManager.cxx.

References maFactoryMap, maFactoryPatternList, and maMutex.

◆ RemoveFactoryForURL()

void sd::framework::ResourceFactoryManager::RemoveFactoryForURL ( const OUString &  rsURL)

Unregister the specified factory.

Parameters
rsURLUnregister only the factory for this URL. When the same factory is registered for other URLs then these remain registered.
Exceptions
css::uno::RuntimeException

Definition at line 94 of file ResourceFactoryManager.cxx.

References maFactoryMap, maFactoryPatternList, and maMutex.

Member Data Documentation

◆ maFactoryMap

FactoryMap sd::framework::ResourceFactoryManager::maFactoryMap
private

◆ maFactoryPatternList

FactoryPatternList sd::framework::ResourceFactoryManager::maFactoryPatternList
private

◆ maMutex

std::mutex sd::framework::ResourceFactoryManager::maMutex
private

◆ mxControllerManager

rtl::Reference<::sd::DrawController> sd::framework::ResourceFactoryManager::mxControllerManager
private

Definition at line 104 of file ResourceFactoryManager.hxx.

Referenced by GetFactory().

◆ mxURLTransformer

css::uno::Reference<css::util::XURLTransformer> sd::framework::ResourceFactoryManager::mxURLTransformer
private

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