LibreOffice Module cppuhelper (master) 1
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
cppuhelper::ServiceManager Class Reference

#include <servicemanager.hxx>

Inheritance diagram for cppuhelper::ServiceManager:
[legend]
Collaboration diagram for cppuhelper::ServiceManager:
[legend]

Classes

struct  Data
 

Public Member Functions

 ServiceManager ()
 
 ServiceManager (const ServiceManager &)=delete
 
const ServiceManageroperator= (const ServiceManager &)=delete
 
void init (std::u16string_view rdbUris)
 
void setContext (css::uno::Reference< css::uno::XComponentContext > const &context)
 
void addSingletonContextEntries (std::vector< cppu::ContextEntry_Init > *entries)
 
css::uno::Reference< css::uno::XComponentContext > const & getContext () const
 
void loadImplementation (css::uno::Reference< css::uno::XComponentContext > const &context, std::shared_ptr< Data::Implementation > const &implementation)
 
virtual void SAL_CALL acquire () noexcept override
 increasing m_refCount More...
 
virtual void SAL_CALL release () noexcept override
 decreasing m_refCount More...
 
- Public Member Functions inherited from cppuhelper::WeakComponentImplHelper2< Ifc >
virtual void SAL_CALL acquire () noexcept override
 increasing m_refCount More...
 
virtual void SAL_CALL release () noexcept override
 decreasing m_refCount More...
 
virtual void SAL_CALL dispose () noexcept final override
 
virtual void SAL_CALL addEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) final override
 
virtual void SAL_CALL removeEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) final override
 
virtual css::uno::Any SAL_CALL queryInterface (css::uno::Type const &rType) override
 Basic queryInterface() implementation supporting com::sun::star::uno::XWeak and com::sun::star::uno::XInterface. More...
 
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () override
 
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () override
 
- Public Member Functions inherited from cppuhelper::WeakComponentImplHelperBase2
virtual ~WeakComponentImplHelperBase2 () override
 
virtual void SAL_CALL dispose () override
 
virtual void SAL_CALL addEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) override
 
virtual void SAL_CALL removeEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) override
 
virtual css::uno::Any SAL_CALL queryInterface (css::uno::Type const &rType) override
 Basic queryInterface() implementation supporting com::sun::star::uno::XWeak and com::sun::star::uno::XInterface. More...
 
virtual void disposing (std::unique_lock< std::mutex > &)
 Called by dispose for subclasses to do dispose() work. More...
 
- Public Member Functions inherited from cppuhelper::UnoImplBase
virtual ~UnoImplBase ()
 
- Public Member Functions inherited from cppu::OWeakObject
 OWeakObject ()
 Default Constructor. More...
 
 OWeakObject (const OWeakObject &)
 Dummy copy constructor. More...
 
OWeakObject &SAL_CALL operator= (const OWeakObject &)
 Dummy assignment operator. More...
 
virtual css::uno::Any SAL_CALL queryInterface (const css::uno::Type &rType) SAL_OVERRIDE
 Basic queryInterface() implementation supporting com::sun::star::uno::XWeak and com::sun::star::uno::XInterface. More...
 
virtual void SAL_CALL acquire () SAL_NOEXCEPT SAL_OVERRIDE
 increasing m_refCount More...
 
virtual void SAL_CALL release () SAL_NOEXCEPT SAL_OVERRIDE
 decreasing m_refCount More...
 
virtual css::uno::Reference< css::uno::XAdapter > SAL_CALL queryAdapter () SAL_OVERRIDE
 XWeak::queryAdapter() implementation. More...
 
SAL_CALL operator css::uno::Reference< css::uno::XInterface > ()
 Cast operator to XInterface reference. More...
 

Private Member Functions

virtual ~ServiceManager () override
 
virtual void disposing (std::unique_lock< std::mutex > &) override
 Called by dispose for subclasses to do dispose() work. More...
 
virtual OUString SAL_CALL getImplementationName () override
 
virtual sal_Bool SAL_CALL supportsService (OUString const &ServiceName) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance (OUString const &aServiceSpecifier) override
 
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments (OUString const &ServiceSpecifier, css::uno::Sequence< css::uno::Any > const &Arguments) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames () override
 
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithContext (OUString const &aServiceSpecifier, css::uno::Reference< css::uno::XComponentContext > const &Context) override
 
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArgumentsAndContext (OUString const &ServiceSpecifier, css::uno::Sequence< css::uno::Any > const &Arguments, css::uno::Reference< css::uno::XComponentContext > const &Context) override
 
virtual css::uno::Type SAL_CALL getElementType () override
 
virtual sal_Bool SAL_CALL hasElements () override
 
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration () override
 
virtual sal_Bool SAL_CALL has (css::uno::Any const &aElement) override
 
virtual void SAL_CALL insert (css::uno::Any const &aElement) override
 
virtual void SAL_CALL remove (css::uno::Any const &aElement) override
 
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createContentEnumeration (OUString const &aServiceName) override
 
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo () override
 
virtual void SAL_CALL setPropertyValue (OUString const &aPropertyName, css::uno::Any const &aValue) override
 
virtual css::uno::Any SAL_CALL getPropertyValue (OUString const &PropertyName) override
 
virtual void SAL_CALL addPropertyChangeListener (OUString const &aPropertyName, css::uno::Reference< css::beans::XPropertyChangeListener > const &xListener) override
 
virtual void SAL_CALL removePropertyChangeListener (OUString const &aPropertyName, css::uno::Reference< css::beans::XPropertyChangeListener > const &aListener) override
 
virtual void SAL_CALL addVetoableChangeListener (OUString const &PropertyName, css::uno::Reference< css::beans::XVetoableChangeListener > const &aListener) override
 
virtual void SAL_CALL removeVetoableChangeListener (OUString const &PropertyName, css::uno::Reference< css::beans::XVetoableChangeListener > const &aListener) override
 
virtual css::uno::Sequence< css::beans::Property > SAL_CALL getProperties () override
 
virtual css::beans::Property SAL_CALL getPropertyByName (OUString const &aName) override
 
virtual sal_Bool SAL_CALL hasPropertyByName (OUString const &Name) override
 
virtual void SAL_CALL disposing (css::lang::EventObject const &Source) override
 
virtual void SAL_CALL initialize (css::uno::Sequence< css::uno::Any > const &aArguments) override
 
void removeEventListenerFromComponent (css::uno::Reference< css::lang::XComponent > const &component)
 
void readRdbDirectory (std::u16string_view uri, bool optional)
 
void readRdbFile (OUString const &uri, bool optional)
 
bool readLegacyRdbFile (OUString const &uri)
 
OUString readLegacyRdbString (std::u16string_view uri, RegistryKey &key, OUString const &path)
 
void readLegacyRdbStrings (std::u16string_view uri, RegistryKey &key, OUString const &path, std::vector< OUString > *strings)
 
void insertRdbFiles (std::vector< OUString > const &uris, css::uno::Reference< css::uno::XComponentContext > const &alientContext)
 
void insertLegacyFactory (css::uno::Reference< css::lang::XServiceInfo > const &factoryInfo)
 
bool insertExtraData (Data const &extra)
 
void removeRdbFiles (std::vector< OUString > const &uris)
 
bool removeLegacyFactory (css::uno::Reference< css::lang::XServiceInfo > const &factoryInfo, bool removeListener)
 
void removeImplementation (const OUString &name)
 
std::shared_ptr< Data::ImplementationfindServiceImplementation (css::uno::Reference< css::uno::XComponentContext > const &context, OUString const &specifier)
 
void preloadImplementations ()
 Used only by LibreOfficeKit when used by Online to pre-initialize. More...
 

Private Attributes

css::uno::Reference< css::uno::XComponentContext > context_
 
Data data_
 

Additional Inherited Members

- Protected Member Functions inherited from cppuhelper::WeakComponentImplHelperBase2
void throwIfDisposed (std::unique_lock< std::mutex > &)
 
- Protected Member Functions inherited from cppu::OWeakObject
virtual ~OWeakObject () COVERITY_NOEXCEPT_FALSE
 Virtual dtor. More...
 
void disposeWeakConnectionPoint ()
 disposes and resets m_pWeakConnectionPoint More...
 
- Protected Attributes inherited from cppuhelper::WeakComponentImplHelperBase2
OInterfaceContainerHelper4< css::lang::XEventListener > maEventListeners
 
- Protected Attributes inherited from cppuhelper::UnoImplBase
std::mutex m_aMutex
 
bool m_bDisposed = false
 
- Protected Attributes inherited from cppu::OWeakObject
oslInterlockedCount m_refCount
 reference count. More...
 

Detailed Description

Definition at line 64 of file servicemanager.hxx.

Constructor & Destructor Documentation

◆ ServiceManager() [1/2]

cppuhelper::ServiceManager::ServiceManager ( )
inline

Definition at line 186 of file servicemanager.hxx.

◆ ServiceManager() [2/2]

cppuhelper::ServiceManager::ServiceManager ( const ServiceManager )
delete

◆ ~ServiceManager()

cppuhelper::ServiceManager::~ServiceManager ( )
overrideprivatevirtual

Definition at line 1286 of file servicemanager.cxx.

Member Function Documentation

◆ acquire()

virtual void SAL_CALL cppuhelper::WeakComponentImplHelper2< Ifc >::acquire ( )
inlineoverridevirtualnoexcept

increasing m_refCount

Reimplemented from cppuhelper::WeakComponentImplHelper2< Ifc >.

Definition at line 80 of file cppuhelper/inc/compbase2.hxx.

◆ addPropertyChangeListener()

void cppuhelper::ServiceManager::addPropertyChangeListener ( OUString const &  aPropertyName,
css::uno::Reference< css::beans::XPropertyChangeListener > const &  xListener 
)
overrideprivatevirtual

◆ addSingletonContextEntries()

void cppuhelper::ServiceManager::addSingletonContextEntries ( std::vector< cppu::ContextEntry_Init > *  entries)

◆ addVetoableChangeListener()

void cppuhelper::ServiceManager::addVetoableChangeListener ( OUString const &  PropertyName,
css::uno::Reference< css::beans::XVetoableChangeListener > const &  aListener 
)
overrideprivatevirtual

◆ createContentEnumeration()

css::uno::Reference< css::container::XEnumeration > cppuhelper::ServiceManager::createContentEnumeration ( OUString const &  aServiceName)
overrideprivatevirtual

◆ createEnumeration()

css::uno::Reference< css::container::XEnumeration > cppuhelper::ServiceManager::createEnumeration ( )
overrideprivatevirtual

Definition at line 1036 of file servicemanager.cxx.

◆ createInstance()

css::uno::Reference< css::uno::XInterface > cppuhelper::ServiceManager::createInstance ( OUString const &  aServiceSpecifier)
overrideprivatevirtual

Definition at line 967 of file servicemanager.cxx.

References context_, and createInstanceWithContext().

◆ createInstanceWithArguments()

css::uno::Reference< css::uno::XInterface > cppuhelper::ServiceManager::createInstanceWithArguments ( OUString const &  ServiceSpecifier,
css::uno::Sequence< css::uno::Any > const &  Arguments 
)
overrideprivatevirtual

Definition at line 975 of file servicemanager.cxx.

References context_, and createInstanceWithArgumentsAndContext().

◆ createInstanceWithArgumentsAndContext()

css::uno::Reference< css::uno::XInterface > cppuhelper::ServiceManager::createInstanceWithArgumentsAndContext ( OUString const &  ServiceSpecifier,
css::uno::Sequence< css::uno::Any > const &  Arguments,
css::uno::Reference< css::uno::XComponentContext > const &  Context 
)
overrideprivatevirtual

Definition at line 1011 of file servicemanager.cxx.

References findServiceImplementation().

Referenced by createInstanceWithArguments().

◆ createInstanceWithContext()

css::uno::Reference< css::uno::XInterface > cppuhelper::ServiceManager::createInstanceWithContext ( OUString const &  aServiceSpecifier,
css::uno::Reference< css::uno::XComponentContext > const &  Context 
)
overrideprivatevirtual

Definition at line 1000 of file servicemanager.cxx.

References findServiceImplementation().

Referenced by createInstance().

◆ disposing() [1/2]

void cppuhelper::ServiceManager::disposing ( css::lang::EventObject const &  Source)
overrideprivatevirtual

Definition at line 1288 of file servicemanager.cxx.

References removeLegacyFactory(), and Source.

◆ disposing() [2/2]

void cppuhelper::ServiceManager::disposing ( std::unique_lock< std::mutex > &  )
overrideprivatevirtual

Called by dispose for subclasses to do dispose() work.

The mutex is held when called, and subclasses can unlock() the guard if necessary.

Reimplemented from cppuhelper::WeakComponentImplHelperBase2.

Definition at line 885 of file servicemanager.cxx.

References data_, cppuhelper::ServiceManager::Data::dynamicImplementations, cppuhelper::ServiceManager::Data::namedImplementations, removeEventListenerFromComponent(), SAL_WARN, cppuhelper::ServiceManager::Data::services, and cppuhelper::ServiceManager::Data::singletons.

◆ findServiceImplementation()

std::shared_ptr< cppuhelper::ServiceManager::Data::Implementation > cppuhelper::ServiceManager::findServiceImplementation ( css::uno::Reference< css::uno::XComponentContext > const &  context,
OUString const &  specifier 
)
private

◆ getAvailableServiceNames()

css::uno::Sequence< OUString > cppuhelper::ServiceManager::getAvailableServiceNames ( )
overrideprivatevirtual

◆ getContext()

css::uno::Reference< css::uno::XComponentContext > const & cppuhelper::ServiceManager::getContext ( ) const
inline

Definition at line 207 of file servicemanager.hxx.

References context_.

◆ getElementType()

css::uno::Type cppuhelper::ServiceManager::getElementType ( )
overrideprivatevirtual

Definition at line 1022 of file servicemanager.cxx.

◆ getImplementationName()

OUString cppuhelper::ServiceManager::getImplementationName ( )
overrideprivatevirtual

Definition at line 948 of file servicemanager.cxx.

◆ getProperties()

css::uno::Sequence< css::beans::Property > cppuhelper::ServiceManager::getProperties ( )
overrideprivatevirtual

Definition at line 1266 of file servicemanager.cxx.

◆ getPropertyByName()

css::beans::Property cppuhelper::ServiceManager::getPropertyByName ( OUString const &  aName)
overrideprivatevirtual

Definition at line 1270 of file servicemanager.cxx.

References aName.

◆ getPropertySetInfo()

css::uno::Reference< css::beans::XPropertySetInfo > cppuhelper::ServiceManager::getPropertySetInfo ( )
overrideprivatevirtual

Definition at line 1185 of file servicemanager.cxx.

◆ getPropertyValue()

css::uno::Any cppuhelper::ServiceManager::getPropertyValue ( OUString const &  PropertyName)
overrideprivatevirtual

Definition at line 1202 of file servicemanager.cxx.

References context_.

◆ getSupportedServiceNames()

css::uno::Sequence< OUString > cppuhelper::ServiceManager::getSupportedServiceNames ( )
overrideprivatevirtual

Definition at line 961 of file servicemanager.cxx.

◆ has()

sal_Bool cppuhelper::ServiceManager::has ( css::uno::Any const &  aElement)
overrideprivatevirtual

Definition at line 1043 of file servicemanager.cxx.

◆ hasElements()

sal_Bool cppuhelper::ServiceManager::hasElements ( )
overrideprivatevirtual

◆ hasPropertyByName()

sal_Bool cppuhelper::ServiceManager::hasPropertyByName ( OUString const &  Name)
overrideprivatevirtual

Definition at line 1280 of file servicemanager.cxx.

References Name.

◆ init()

void cppuhelper::ServiceManager::init ( std::u16string_view  rdbUris)

◆ initialize()

void cppuhelper::ServiceManager::initialize ( css::uno::Sequence< css::uno::Any > const &  aArguments)
overrideprivatevirtual

Definition at line 934 of file servicemanager.cxx.

References aArguments, and preloadImplementations().

◆ insert()

void cppuhelper::ServiceManager::insert ( css::uno::Any const &  aElement)
overrideprivatevirtual

Definition at line 1050 of file servicemanager.cxx.

References args, insertLegacyFactory(), and insertRdbFiles().

◆ insertExtraData()

bool cppuhelper::ServiceManager::insertExtraData ( Data const &  extra)
private

◆ insertLegacyFactory()

void cppuhelper::ServiceManager::insertLegacyFactory ( css::uno::Reference< css::lang::XServiceInfo > const &  factoryInfo)
private

◆ insertRdbFiles()

void cppuhelper::ServiceManager::insertRdbFiles ( std::vector< OUString > const &  uris,
css::uno::Reference< css::uno::XComponentContext > const &  alientContext 
)
private

Definition at line 1515 of file servicemanager.cxx.

References insertExtraData().

Referenced by insert().

◆ loadImplementation()

void cppuhelper::ServiceManager::loadImplementation ( css::uno::Reference< css::uno::XComponentContext > const &  context,
std::shared_ptr< Data::Implementation > const &  implementation 
)

◆ operator=()

const ServiceManager & cppuhelper::ServiceManager::operator= ( const ServiceManager )
delete

◆ preloadImplementations()

void cppuhelper::ServiceManager::preloadImplementations ( )
private

Used only by LibreOfficeKit when used by Online to pre-initialize.

Allow external callers & testers to disable certain components

Definition at line 1813 of file servicemanager.cxx.

References cppu::bootstrap_expandUri(), COMPONENT_GETFACTORY, data_, cppuhelper::detail::getEnvironment(), i, cppuhelper::UnoImplBase::m_aMutex, cppuhelper::ServiceManager::Data::namedImplementations, OUStringToOString(), simplifyModule(), cppuhelper::ServiceManager::Data::Implementation::STATUS_LOADED, and xFactory.

Referenced by initialize().

◆ readLegacyRdbFile()

bool cppuhelper::ServiceManager::readLegacyRdbFile ( OUString const &  uri)
private

◆ readLegacyRdbString()

OUString cppuhelper::ServiceManager::readLegacyRdbString ( std::u16string_view  uri,
RegistryKey key,
OUString const &  path 
)
private

◆ readLegacyRdbStrings()

void cppuhelper::ServiceManager::readLegacyRdbStrings ( std::u16string_view  uri,
RegistryKey key,
OUString const &  path,
std::vector< OUString > *  strings 
)
private

◆ readRdbDirectory()

void cppuhelper::ServiceManager::readRdbDirectory ( std::u16string_view  uri,
bool  optional 
)
private

Definition at line 1327 of file servicemanager.cxx.

References cppu::nextDirectoryItem(), readRdbFile(), and SAL_INFO.

Referenced by init().

◆ readRdbFile()

void cppuhelper::ServiceManager::readRdbFile ( OUString const &  uri,
bool  optional 
)
private

Definition at line 1354 of file servicemanager.cxx.

References data_, readLegacyRdbFile(), and SAL_INFO.

Referenced by init(), and readRdbDirectory().

◆ release()

virtual void SAL_CALL cppuhelper::WeakComponentImplHelper2< Ifc >::release ( )
inlineoverridevirtualnoexcept

decreasing m_refCount

Reimplemented from cppuhelper::WeakComponentImplHelper2< Ifc >.

Definition at line 82 of file cppuhelper/inc/compbase2.hxx.

◆ remove()

void cppuhelper::ServiceManager::remove ( css::uno::Any const &  aElement)
overrideprivatevirtual

◆ removeEventListenerFromComponent()

void cppuhelper::ServiceManager::removeEventListenerFromComponent ( css::uno::Reference< css::lang::XComponent > const &  component)
private

Definition at line 1297 of file servicemanager.cxx.

References SAL_INFO.

Referenced by disposing(), and removeLegacyFactory().

◆ removeImplementation()

void cppuhelper::ServiceManager::removeImplementation ( const OUString &  name)
private

◆ removeLegacyFactory()

bool cppuhelper::ServiceManager::removeLegacyFactory ( css::uno::Reference< css::lang::XServiceInfo > const &  factoryInfo,
bool  removeListener 
)
private

◆ removePropertyChangeListener()

void cppuhelper::ServiceManager::removePropertyChangeListener ( OUString const &  aPropertyName,
css::uno::Reference< css::beans::XPropertyChangeListener > const &  aListener 
)
overrideprivatevirtual

◆ removeRdbFiles()

void cppuhelper::ServiceManager::removeRdbFiles ( std::vector< OUString > const &  uris)
private

◆ removeVetoableChangeListener()

void cppuhelper::ServiceManager::removeVetoableChangeListener ( OUString const &  PropertyName,
css::uno::Reference< css::beans::XVetoableChangeListener > const &  aListener 
)
overrideprivatevirtual

◆ setContext()

void cppuhelper::ServiceManager::setContext ( css::uno::Reference< css::uno::XComponentContext > const &  context)
inline

Definition at line 196 of file servicemanager.hxx.

References context_.

◆ setPropertyValue()

void cppuhelper::ServiceManager::setPropertyValue ( OUString const &  aPropertyName,
css::uno::Any const &  aValue 
)
overrideprivatevirtual

Definition at line 1190 of file servicemanager.cxx.

◆ supportsService()

sal_Bool cppuhelper::ServiceManager::supportsService ( OUString const &  ServiceName)
overrideprivatevirtual

Definition at line 954 of file servicemanager.cxx.

References ServiceName, and cppu::supportsService().

Member Data Documentation

◆ context_

css::uno::Reference< css::uno::XComponentContext > cppuhelper::ServiceManager::context_
private

◆ data_

Data cppuhelper::ServiceManager::data_
private

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