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 <pdffilter.hxx>
28 #include <pdfdialog.hxx>
29 #include <pdfinteract.hxx>
31 using namespace ::rtl
;
32 using namespace ::cppu
;
33 using namespace ::com::sun::star::uno
;
34 using namespace ::com::sun::star::lang
;
35 using namespace ::com::sun::star::registry
;
39 SAL_DLLPUBLIC_EXPORT
void* SAL_CALL
pdffilter_component_getFactory( const sal_Char
* pImplName
, void * pServiceManager
, void * /*pRegistryKey*/ )
41 OUString
aImplName( OUString::createFromAscii( pImplName
) );
46 Reference
< XSingleServiceFactory
> xFactory
;
48 if( aImplName
.equals( PDFFilter_getImplementationName() ) )
50 xFactory
= createSingleFactory( reinterpret_cast< XMultiServiceFactory
* >( pServiceManager
),
51 OUString::createFromAscii( pImplName
),
52 PDFFilter_createInstance
, PDFFilter_getSupportedServiceNames() );
55 else if( aImplName
.equals( PDFDialog_getImplementationName() ) )
57 xFactory
= createSingleFactory( reinterpret_cast< XMultiServiceFactory
* >( pServiceManager
),
58 OUString::createFromAscii( pImplName
),
59 PDFDialog_createInstance
, PDFDialog_getSupportedServiceNames() );
62 else if( aImplName
.equals( PDFInteractionHandler_getImplementationName() ) )
64 xFactory
= createSingleFactory( reinterpret_cast< XMultiServiceFactory
* >( pServiceManager
),
65 OUString::createFromAscii( pImplName
),
66 PDFInteractionHandler_createInstance
, PDFInteractionHandler_getSupportedServiceNames() );
73 pRet
= xFactory
.get();
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */