00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #include "precompiled_starmath.hxx"
00038
00039 #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
00040 #include <com/sun/star/lang/XServiceInfo.hpp>
00041 #endif
00042 #ifndef _COM_SUN_STAR_REGISTRY_XREGISTRYKEY_HPP_
00043 #include <com/sun/star/registry/XRegistryKey.hpp>
00044 #endif
00045 #ifndef _COM_SUN_STAR_UNO_SEQUENCE_H_
00046 #include <com/sun/star/uno/Sequence.h>
00047 #endif
00048 #ifndef _RTL_USTRING_HXX_
00049 #include <rtl/ustring.hxx>
00050 #endif
00051
00052 #include "smdetect.hxx"
00053
00054 using namespace ::rtl;
00055 using namespace ::com::sun::star;
00056 using namespace ::com::sun::star::uno;
00057 using namespace ::com::sun::star::lang;
00058
00059 extern "C" {
00060
00061 void SAL_CALL component_getImplementationEnvironment(
00062 const sal_Char** ppEnvironmentTypeName,
00063 uno_Environment** )
00064 {
00065 *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
00066 }
00067
00068 sal_Bool SAL_CALL component_writeInfo( void* ,
00069 void* pRegistryKey )
00070 {
00071 Reference< ::registry::XRegistryKey >
00072 xKey( reinterpret_cast< ::registry::XRegistryKey* >( pRegistryKey ) ) ;
00073
00074 OUString aDelimiter( RTL_CONSTASCII_USTRINGPARAM("/") );
00075 OUString aUnoServices( RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") );
00076
00077
00078 sal_Int32 i;
00079 Reference< ::registry::XRegistryKey > xNewKey;
00080
00081 xNewKey = xKey->createKey( aDelimiter + SmFilterDetect::impl_getStaticImplementationName() +
00082 aUnoServices );
00083
00084 Sequence< OUString > aServices = SmFilterDetect::impl_getStaticSupportedServiceNames();
00085 for(i = 0; i < aServices.getLength(); i++ )
00086 xNewKey->createKey( aServices.getConstArray()[i] );
00087
00088 return sal_True;
00089 }
00090
00091 void* SAL_CALL component_getFactory( const sal_Char* pImplementationName,
00092 void* pServiceManager,
00093 void* )
00094 {
00095
00096 void* pReturn = NULL ;
00097
00098 if (
00099 ( pImplementationName != NULL ) &&
00100 ( pServiceManager != NULL )
00101 )
00102 {
00103
00104 Reference< XSingleServiceFactory > xFactory ;
00105 Reference< XMultiServiceFactory > xServiceManager( reinterpret_cast< XMultiServiceFactory* >( pServiceManager ) ) ;
00106
00107 if( SmFilterDetect::impl_getStaticImplementationName().equalsAscii( pImplementationName ) )
00108 {
00109 xFactory = ::cppu::createSingleFactory( xServiceManager,
00110 SmFilterDetect::impl_getStaticImplementationName(),
00111 SmFilterDetect::impl_createInstance,
00112 SmFilterDetect::impl_getStaticSupportedServiceNames() );
00113 }
00114
00115
00116 if ( xFactory.is() )
00117 {
00118 xFactory->acquire();
00119 pReturn = xFactory.get();
00120 }
00121 }
00122
00123
00124 return pReturn ;
00125 }
00126 }
00127
00128
00129