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/Reference.hxx"
28 #include "com/sun/star/uno/Sequence.hxx"
29 #include "com/sun/star/uno/XComponentContext.hpp"
30 #include "com/sun/star/uno/XInterface.hpp"
31 #include "osl/mutex.hxx"
32 #include "rtl/ustring.h"
33 #include "rtl/ustring.hxx"
34 
35 #include "configurationprovider.hxx"
36 #include "defaultprovider.hxx"
37 #include "lock.hxx"
38 
39 namespace configmgr { namespace default_provider {
40 
41 namespace {
42 
43 namespace css = com::sun::star;
44 
45 }
46 
create(css::uno::Reference<css::uno::XComponentContext> const & context)47 css::uno::Reference< css::uno::XInterface > create(
48     css::uno::Reference< css::uno::XComponentContext > const & context)
49 {
50     osl::MutexGuard guard(lock);
51     static css::uno::Reference< css::uno::XInterface > singleton(
52         configuration_provider::createDefault(context));
53     return singleton;
54 }
55 
getImplementationName()56 rtl::OUString getImplementationName() {
57     return rtl::OUString(
58         RTL_CONSTASCII_USTRINGPARAM(
59             "com.sun.star.comp.configuration.DefaultProvider"));
60 }
61 
getSupportedServiceNames()62 css::uno::Sequence< rtl::OUString > getSupportedServiceNames() {
63     rtl::OUString name(
64         RTL_CONSTASCII_USTRINGPARAM(
65             "com.sun.star.configuration.DefaultProvider"));
66     return css::uno::Sequence< rtl::OUString >(&name, 1);
67 }
68 
69 } }
70