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