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 .
20 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
21 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
23 #include "ucbstore.hxx"
24 #include "ucbprops.hxx"
25 #include "provprox.hxx"
27 #include "FileAccess.hxx"
29 using namespace com::sun::star::uno
;
30 using namespace com::sun::star::lang
;
33 extern "C" SAL_DLLPUBLIC_EXPORT
void * SAL_CALL
ucb_component_getFactory(
34 const sal_Char
* pImplName
, void * pServiceManager
, void * )
38 Reference
< XMultiServiceFactory
> xSMgr(
39 static_cast< XMultiServiceFactory
* >( pServiceManager
) );
40 Reference
< XSingleServiceFactory
> xFactory
;
43 // Universal Content Broker.
46 if ( UniversalContentBroker::getImplementationName_Static().
47 equalsAscii( pImplName
) )
49 xFactory
= UniversalContentBroker::createServiceFactory( xSMgr
);
56 else if ( UcbStore::getImplementationName_Static().
57 equalsAscii( pImplName
) )
59 xFactory
= UcbStore::createServiceFactory( xSMgr
);
63 // UCB PropertiesManager.
66 else if ( UcbPropertiesManager::getImplementationName_Static().
67 equalsAscii( pImplName
) )
69 xFactory
= UcbPropertiesManager::createServiceFactory( xSMgr
);
76 else if ( UcbContentProviderProxyFactory::getImplementationName_Static().
77 equalsAscii( pImplName
) )
79 xFactory
= UcbContentProviderProxyFactory::createServiceFactory( xSMgr
);
83 // Command Environment.
86 else if ( ucb_cmdenv::UcbCommandEnvironment::getImplementationName_Static().
87 equalsAscii( pImplName
) )
89 xFactory
= ucb_cmdenv::UcbCommandEnvironment::createServiceFactory( xSMgr
);
93 else if (pServiceManager
&& rtl_str_compare( pImplName
, IMPLEMENTATION_NAME
) == 0)
95 xFactory
= cppu::createSingleFactory(xSMgr
,
96 OUString::createFromAscii( pImplName
),
97 FileAccess_CreateInstance
,
98 FileAccess_getSupportedServiceNames() );
104 pRet
= xFactory
.get();
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */