merged tag ooo/DEV300_m102
[LibreOffice.git] / configmgr / source / services.cxx
blobdd01189be6e2b8ccbf23271a5a3b1d094d4adf88
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #include "precompiled_configmgr.hxx"
29 #include "sal/config.h"
31 #include "com/sun/star/uno/Exception.hpp"
32 #include "com/sun/star/uno/Reference.hxx"
33 #include "com/sun/star/uno/XComponentContext.hpp"
34 #include "com/sun/star/uno/XInterface.hpp"
35 #include "cppuhelper/factory.hxx"
36 #include "cppuhelper/implementationentry.hxx"
37 #include "osl/diagnose.h"
38 #include "uno/lbnames.h"
39 #include "sal/types.h"
41 #include "configurationprovider.hxx"
42 #include "configurationregistry.hxx"
43 #include "defaultprovider.hxx"
44 #include "update.hxx"
46 namespace {
48 namespace css = com::sun::star;
50 css::uno::Reference< css::uno::XInterface > SAL_CALL dummy(
51 css::uno::Reference< css::uno::XComponentContext > const &)
52 SAL_THROW((css::uno::Exception))
54 OSL_ASSERT(false);
55 return css::uno::Reference< css::uno::XInterface >();
58 static cppu::ImplementationEntry const services[] = {
59 { &dummy, &configmgr::configuration_provider::getImplementationName,
60 &configmgr::configuration_provider::getSupportedServiceNames,
61 &configmgr::configuration_provider::createFactory, 0, 0 },
62 { &configmgr::default_provider::create,
63 &configmgr::default_provider::getImplementationName,
64 &configmgr::default_provider::getSupportedServiceNames,
65 &cppu::createSingleComponentFactory, 0, 0 },
66 { &configmgr::configuration_registry::create,
67 &configmgr::configuration_registry::getImplementationName,
68 &configmgr::configuration_registry::getSupportedServiceNames,
69 &cppu::createSingleComponentFactory, 0, 0 },
70 { &configmgr::update::create, &configmgr::update::getImplementationName,
71 &configmgr::update::getSupportedServiceNames,
72 &cppu::createSingleComponentFactory, 0, 0 },
73 { 0, 0, 0, 0, 0, 0 }
78 extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
79 char const * pImplName, void * pServiceManager, void * pRegistryKey)
81 return cppu::component_getFactoryHelper(
82 pImplName, pServiceManager, pRegistryKey, services);
85 extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
86 component_getImplementationEnvironment(
87 char const ** ppEnvTypeName, uno_Environment **)
89 *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;