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>
23 #include <cppuhelper/factory.hxx>
25 #include "serialnumberadapter.hxx"
26 #include "xmlelementwrapper_xmlsecimpl.hxx"
27 #include "xmldocumentwrapper_xmlsecimpl.hxx"
29 using namespace ::cppu
;
30 using namespace ::com::sun::star::uno
;
31 using namespace ::com::sun::star::lang
;
36 extern void* nss_component_getFactory( const sal_Char
*, void*, void* );
38 #if defined( XMLSEC_CRYPTO_MSCRYPTO )
39 extern void* mscrypt_component_getFactory( const sal_Char
*, void*, void* );
42 SAL_DLLPUBLIC_EXPORT
void* SAL_CALL
xsec_xmlsec_component_getFactory( const sal_Char
* pImplName
, void* pServiceManager
, void* pRegistryKey
)
45 Reference
< XInterface
> xFactory
;
47 if( pImplName
!= NULL
) {
48 if( XMLElementWrapper_XmlSecImpl_getImplementationName().equals( OUString::createFromAscii( pImplName
) ) )
50 xFactory
= cppu::createSingleComponentFactory(
51 XMLElementWrapper_XmlSecImpl_createInstance
,
52 OUString::createFromAscii( pImplName
),
53 XMLElementWrapper_XmlSecImpl_getSupportedServiceNames() );
55 else if( XMLDocumentWrapper_XmlSecImpl_getImplementationName().equals( OUString::createFromAscii( pImplName
) ) )
57 xFactory
= cppu::createSingleComponentFactory(
58 XMLDocumentWrapper_XmlSecImpl_createInstance
,
59 OUString::createFromAscii( pImplName
),
60 XMLDocumentWrapper_XmlSecImpl_getSupportedServiceNames() );
62 else if( xml_security::serial_number_adapter::implementationName().equals( OUString::createFromAscii( pImplName
) ) )
64 xFactory
= ::cppu::createSingleComponentFactory(
65 xml_security::serial_number_adapter::create
,
66 OUString::createFromAscii( pImplName
),
67 xml_security::serial_number_adapter::serviceNames() );
73 pRet
= xFactory
.get() ;
75 pRet
= nss_component_getFactory( pImplName
, pServiceManager
, pRegistryKey
) ;
79 #if defined( XMLSEC_CRYPTO_MSCRYPTO )
80 pRet
= mscrypt_component_getFactory( pImplName
, pServiceManager
, pRegistryKey
) ;
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */