xref: /aoo42x/main/configmgr/source/services.cxx (revision 3a7cf181)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #include "precompiled_configmgr.hxx"
25 #include "sal/config.h"
26 
27 #include "com/sun/star/uno/Exception.hpp"
28 #include "com/sun/star/uno/Reference.hxx"
29 #include "com/sun/star/uno/XComponentContext.hpp"
30 #include "com/sun/star/uno/XInterface.hpp"
31 #include "cppuhelper/factory.hxx"
32 #include "cppuhelper/implementationentry.hxx"
33 #include "osl/diagnose.h"
34 #include "uno/lbnames.h"
35 #include "sal/types.h"
36 
37 #include "configurationprovider.hxx"
38 #include "configurationregistry.hxx"
39 #include "defaultprovider.hxx"
40 #include "update.hxx"
41 
42 namespace {
43 
44 namespace css = com::sun::star;
45 
dummy(css::uno::Reference<css::uno::XComponentContext> const &)46 css::uno::Reference< css::uno::XInterface > SAL_CALL dummy(
47     css::uno::Reference< css::uno::XComponentContext > const &)
48     SAL_THROW((css::uno::Exception))
49 {
50     OSL_ASSERT(false);
51     return css::uno::Reference< css::uno::XInterface >();
52 }
53 
54 static cppu::ImplementationEntry const services[] = {
55     { &dummy, &configmgr::configuration_provider::getImplementationName,
56       &configmgr::configuration_provider::getSupportedServiceNames,
57       &configmgr::configuration_provider::createFactory, 0, 0 },
58     { &configmgr::default_provider::create,
59       &configmgr::default_provider::getImplementationName,
60       &configmgr::default_provider::getSupportedServiceNames,
61       &cppu::createSingleComponentFactory, 0, 0 },
62     { &configmgr::configuration_registry::create,
63       &configmgr::configuration_registry::getImplementationName,
64       &configmgr::configuration_registry::getSupportedServiceNames,
65       &cppu::createSingleComponentFactory, 0, 0 },
66     { &configmgr::update::create, &configmgr::update::getImplementationName,
67       &configmgr::update::getSupportedServiceNames,
68       &cppu::createSingleComponentFactory, 0, 0 },
69     { 0, 0, 0, 0, 0, 0 }
70 };
71 
72 }
73 
component_getFactory(char const * pImplName,void * pServiceManager,void * pRegistryKey)74 extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
75     char const * pImplName, void * pServiceManager, void * pRegistryKey)
76 {
77     return cppu::component_getFactoryHelper(
78         pImplName, pServiceManager, pRegistryKey, services);
79 }
80 
81 extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
component_getImplementationEnvironment(char const ** ppEnvTypeName,uno_Environment **)82 component_getImplementationEnvironment(
83     char const ** ppEnvTypeName, uno_Environment **)
84 {
85     *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
86 }
87