3 #include <osl/mutex.hxx>
4 #include <osl/thread.h>
5 #include <cppuhelper/factory.hxx>
7 #ifndef _COM_SUN_STAR_LANG_XSINGLESERVICEFACTORY_HPP_
8 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
11 #include "LotusWordProImportFilter.hxx"
13 using namespace ::rtl
;
14 using namespace ::cppu
;
15 using namespace ::com::sun::star::uno
;
16 using namespace ::com::sun::star::lang
;
17 using namespace ::com::sun::star::registry
;
21 //==================================================================================================
22 void SAL_CALL
component_getImplementationEnvironment(
23 const sal_Char
** ppEnvTypeName
, uno_Environment
** ppEnv
)
25 *ppEnvTypeName
= CPPU_CURRENT_LANGUAGE_BINDING_NAME
;
27 //==================================================================================================
28 sal_Bool SAL_CALL
component_writeInfo(
29 void * pServiceManager
, void * pRegistryKey
)
36 Reference
< XRegistryKey
> xNewKey(
37 reinterpret_cast< XRegistryKey
* >( pRegistryKey
)->createKey( LotusWordProImportFilter_getImplementationName() ) );
38 xNewKey
= xNewKey
->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) );
40 const Sequence
< OUString
> & rSNL
= LotusWordProImportFilter_getSupportedServiceNames();
41 const OUString
* pArray
= rSNL
.getConstArray();
42 for ( nPos
= rSNL
.getLength(); nPos
--; )
43 xNewKey
->createKey( pArray
[nPos
] );
47 catch (InvalidRegistryException
&)
49 OSL_ENSURE( sal_False
, "### InvalidRegistryException!" );
54 //==================================================================================================
55 void * SAL_CALL
component_getFactory(
56 const sal_Char
* pImplName
, void * pServiceManager
, void * pRegistryKey
)
60 OUString implName
= OUString::createFromAscii( pImplName
);
61 if ( pServiceManager
&& implName
.equals(LotusWordProImportFilter_getImplementationName()) )
63 Reference
< XSingleServiceFactory
> xFactory( createSingleFactory(
64 reinterpret_cast< XMultiServiceFactory
* >( pServiceManager
),
65 OUString::createFromAscii( pImplName
),
66 LotusWordProImportFilter_createInstance
, LotusWordProImportFilter_getSupportedServiceNames() ) );
71 pRet
= xFactory
.get();