1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <sal/config.h>
24 #include <osl/mutex.hxx>
25 #include <osl/thread.h>
26 #include <cppuhelper/factory.hxx>
27 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
29 #include "seinitializer_mscryptimpl.hxx"
30 #include "xmlsignature_mscryptimpl.hxx"
31 #include "xmlencryption_mscryptimpl.hxx"
32 #include "xmlsecuritycontext_mscryptimpl.hxx"
33 #include "securityenvironment_mscryptimpl.hxx"
35 using namespace ::cppu
;
36 using namespace ::com::sun::star::uno
;
37 using namespace ::com::sun::star::lang
;
38 using namespace ::com::sun::star::registry
;
43 void* SAL_CALL
mscrypt_component_getFactory( const sal_Char
* pImplName
, void* pServiceManager
, void* /*pRegistryKey*/ )
46 Reference
< XSingleServiceFactory
> xFactory
;
48 if( pImplName
!= NULL
&& pServiceManager
!= NULL
) {
49 if( XMLSignature_MSCryptImpl::impl_getImplementationName().equals( OUString::createFromAscii( pImplName
) ) ) {
50 xFactory
= XMLSignature_MSCryptImpl::impl_createFactory( reinterpret_cast< XMultiServiceFactory
* >( pServiceManager
) ) ;
51 } else if( XMLSecurityContext_MSCryptImpl::impl_getImplementationName().equals( OUString::createFromAscii( pImplName
) ) ) {
52 xFactory
= XMLSecurityContext_MSCryptImpl::impl_createFactory( reinterpret_cast< XMultiServiceFactory
* >( pServiceManager
) ) ;
53 } else if( SecurityEnvironment_MSCryptImpl::impl_getImplementationName().equals( OUString::createFromAscii( pImplName
) ) ) {
54 xFactory
= SecurityEnvironment_MSCryptImpl::impl_createFactory( reinterpret_cast< XMultiServiceFactory
* >( pServiceManager
) ) ;
55 } else if( XMLEncryption_MSCryptImpl::impl_getImplementationName().equals( OUString::createFromAscii( pImplName
) ) ) {
56 xFactory
= XMLEncryption_MSCryptImpl::impl_createFactory( reinterpret_cast< XMultiServiceFactory
* >( pServiceManager
) ) ;
57 } else if( SEInitializer_MSCryptImpl_getImplementationName().equals( OUString::createFromAscii( pImplName
) ) ) {
58 xFactory
= Reference
< XSingleServiceFactory
>( createSingleFactory(
59 reinterpret_cast< XMultiServiceFactory
* >( pServiceManager
),
60 OUString::createFromAscii( pImplName
),
61 SEInitializer_MSCryptImpl_createInstance
, SEInitializer_MSCryptImpl_getSupportedServiceNames() ) );
67 pRet
= xFactory
.get() ;
75 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */