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 .
22 #include <osl/mutex.hxx>
23 #include <osl/thread.h>
24 #include <cppuhelper/factory.hxx>
25 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
27 #include "decryptorimpl.hxx"
28 #include "encryptorimpl.hxx"
29 #include "signaturecreatorimpl.hxx"
30 #include "signatureverifierimpl.hxx"
31 #include "saxeventkeeperimpl.hxx"
32 #include "xmlencryptiontemplateimpl.hxx"
33 #include "xmlsignaturetemplateimpl.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
;
42 SAL_DLLPUBLIC_EXPORT
void * SAL_CALL
xsec_fw_component_getFactory(
43 const sal_Char
* pImplName
, void * pServiceManager
, void * /*pRegistryKey*/ )
48 OUString implName
= OUString::createFromAscii( pImplName
);
49 if ( pServiceManager
&& implName
.equals(DecryptorImpl_getImplementationName()) )
51 Reference
< XSingleServiceFactory
> xFactory( createSingleFactory(
52 static_cast< XMultiServiceFactory
* >( pServiceManager
),
53 OUString::createFromAscii( pImplName
),
54 DecryptorImpl_createInstance
, DecryptorImpl_getSupportedServiceNames() ) );
59 pRet
= xFactory
.get();
64 if ( pServiceManager
&& implName
.equals(EncryptorImpl_getImplementationName()) )
66 Reference
< XSingleServiceFactory
> xFactory( createSingleFactory(
67 static_cast< XMultiServiceFactory
* >( pServiceManager
),
68 OUString::createFromAscii( pImplName
),
69 EncryptorImpl_createInstance
, EncryptorImpl_getSupportedServiceNames() ) );
74 pRet
= xFactory
.get();
79 if ( pServiceManager
&& implName
.equals(SignatureCreatorImpl_getImplementationName()) )
81 Reference
< XSingleServiceFactory
> xFactory( createSingleFactory(
82 static_cast< XMultiServiceFactory
* >( pServiceManager
),
83 OUString::createFromAscii( pImplName
),
84 SignatureCreatorImpl_createInstance
, SignatureCreatorImpl_getSupportedServiceNames() ) );
89 pRet
= xFactory
.get();
94 if ( pServiceManager
&& implName
.equals(SignatureVerifierImpl_getImplementationName()) )
96 Reference
< XSingleServiceFactory
> xFactory( createSingleFactory(
97 static_cast< XMultiServiceFactory
* >( pServiceManager
),
98 OUString::createFromAscii( pImplName
),
99 SignatureVerifierImpl_createInstance
, SignatureVerifierImpl_getSupportedServiceNames() ) );
104 pRet
= xFactory
.get();
109 if ( pServiceManager
&& implName
.equals(SAXEventKeeperImpl_getImplementationName()) )
111 Reference
< XSingleServiceFactory
> xFactory( createSingleFactory(
112 static_cast< XMultiServiceFactory
* >( pServiceManager
),
113 OUString::createFromAscii( pImplName
),
114 SAXEventKeeperImpl_createInstance
, SAXEventKeeperImpl_getSupportedServiceNames() ) );
119 pRet
= xFactory
.get();
123 //XMLSignatureTemplate
124 if ( pServiceManager
&& implName
.equals( XMLSignatureTemplateImpl::impl_getImplementationName()) )
126 Reference
< XSingleServiceFactory
> xFactory
= XMLSignatureTemplateImpl::impl_createFactory(
127 static_cast< XMultiServiceFactory
* >( pServiceManager
) ) ;
132 pRet
= xFactory
.get();
136 //XMLEncryptionTemplate
137 if ( pServiceManager
&& implName
.equals( XMLEncryptionTemplateImpl::impl_getImplementationName()) )
139 Reference
< XSingleServiceFactory
> xFactory
= XMLEncryptionTemplateImpl::impl_createFactory(
140 static_cast< XMultiServiceFactory
* >( pServiceManager
) ) ;
145 pRet
= xFactory
.get();
153 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */