21#include <osl/diagnose.h>
22#include <rtl/ustring.hxx>
29#include <com/sun/star/loader/XImplementationLoader.hpp>
30#include <com/sun/star/lang/XMultiServiceFactory.hpp>
31#include <com/sun/star/lang/XServiceInfo.hpp>
32#include <com/sun/star/lang/XInitialization.hpp>
33#include <com/sun/star/uno/XComponentContext.hpp>
38using namespace css::uno;
39using namespace css::loader;
40using namespace css::lang;
41using namespace css::registry;
47class DllComponentLoader
48 :
public WeakImplHelper< XImplementationLoader,
53 explicit DllComponentLoader(
const Reference<XComponentContext> & xCtx );
61 virtual void SAL_CALL initialize(
const css::uno::Sequence< css::uno::Any >& aArguments )
override;
64 virtual Reference<XInterface> SAL_CALL activate(
const OUString& implementationName,
const OUString& implementationLoaderUrl,
const OUString& locationUrl,
const Reference<XRegistryKey>& xKey )
override;
65 virtual sal_Bool SAL_CALL writeRegistryInfo(
const Reference<XRegistryKey>& xKey,
const OUString& implementationLoaderUrl,
const OUString& locationUrl )
override;
68 Reference<XMultiServiceFactory>
m_xSMgr;
72DllComponentLoader::DllComponentLoader(
const Reference<XComponentContext> & xCtx )
74 m_xSMgr.set( xCtx->getServiceManager(), UNO_QUERY );
77OUString SAL_CALL DllComponentLoader::getImplementationName( )
79 return "com.sun.star.comp.stoc.DLLComponentLoader";
82sal_Bool SAL_CALL DllComponentLoader::supportsService(
const OUString& ServiceName )
87Sequence<OUString> SAL_CALL DllComponentLoader::getSupportedServiceNames( )
89 return {
"com.sun.star.loader.SharedLibrary" };
93void DllComponentLoader::initialize(
const css::uno::Sequence< css::uno::Any >& )
95 OSL_FAIL(
"dllcomponentloader::initialize should not be called !" );
117Reference<XInterface> SAL_CALL DllComponentLoader::activate(
118 const OUString & rImplName,
const OUString &,
const OUString & rLibName,
119 const Reference< XRegistryKey > & )
123 css::uno::Reference<css::registry::XRegistryKey>());
127sal_Bool SAL_CALL DllComponentLoader::writeRegistryInfo(
128 const Reference< XRegistryKey > & xKey,
const OUString &,
const OUString & rLibName )
130#ifdef DISABLE_DYNLOADING
133 OSL_FAIL(
"DllComponentLoader::writeRegistryInfo() should not be called I think?" );
144extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
146 css::uno::XComponentContext *context,
147 css::uno::Sequence<css::uno::Any>
const &)
149 return cppu::acquire(
new DllComponentLoader(context));
Reference< lang::XMultiComponentFactory > m_xSMgr
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_stoc_DLLComponentLoader_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
SAL_DLLPUBLIC_EXPORT css::uno::Reference< css::uno::XInterface > SAL_CALL loadSharedLibComponentFactory(OUString const &, OUString const &, OUString const &, css::uno::Reference< css::lang::XMultiServiceFactory > const &, css::uno::Reference< css::registry::XRegistryKey > const &, OUString const &)
CPPUHELPER_DLLPUBLIC void SAL_CALL writeSharedLibComponentInfo(::rtl::OUString const &uri, ::rtl::OUString const &rPath, css::uno::Reference< css::lang::XMultiServiceFactory > const &xMgr, css::uno::Reference< css::registry::XRegistryKey > const &xKey)
OUString bootstrap_expandUri(OUString const &uri)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)