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