xref: /aoo41x/main/svl/source/uno/pathservice.cxx (revision 40df464e)
1*40df464eSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*40df464eSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*40df464eSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*40df464eSAndrew Rist  * distributed with this work for additional information
6*40df464eSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*40df464eSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*40df464eSAndrew Rist  * "License"); you may not use this file except in compliance
9*40df464eSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*40df464eSAndrew Rist  *
11*40df464eSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*40df464eSAndrew Rist  *
13*40df464eSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*40df464eSAndrew Rist  * software distributed under the License is distributed on an
15*40df464eSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*40df464eSAndrew Rist  * KIND, either express or implied.  See the License for the
17*40df464eSAndrew Rist  * specific language governing permissions and limitations
18*40df464eSAndrew Rist  * under the License.
19*40df464eSAndrew Rist  *
20*40df464eSAndrew Rist  *************************************************************/
21*40df464eSAndrew Rist 
22*40df464eSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_svl.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <unotools/pathoptions.hxx>
28cdf0e10cSrcweir #include "sal/types.h"
29cdf0e10cSrcweir #include "rtl/ustring.hxx"
30cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx>
31cdf0e10cSrcweir #include <com/sun/star/frame/XConfigManager.hpp>
32cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
33cdf0e10cSrcweir 
34cdf0e10cSrcweir namespace css = com::sun::star;
35cdf0e10cSrcweir using rtl::OUString;
36cdf0e10cSrcweir 
37cdf0e10cSrcweir // -----------------------------------------------------------------------
38cdf0e10cSrcweir 
39cdf0e10cSrcweir class PathService : public ::cppu::WeakImplHelper2< css::frame::XConfigManager, css::lang::XServiceInfo >
40cdf0e10cSrcweir {
41cdf0e10cSrcweir 	SvtPathOptions m_aOptions;
42cdf0e10cSrcweir 
43cdf0e10cSrcweir public:
PathService()44cdf0e10cSrcweir 	PathService()
45cdf0e10cSrcweir 		{}
46cdf0e10cSrcweir 
getImplementationName()47cdf0e10cSrcweir     virtual OUString SAL_CALL getImplementationName()
48cdf0e10cSrcweir 		throw(css::uno::RuntimeException)
49cdf0e10cSrcweir 		{
50cdf0e10cSrcweir 			return OUString::createFromAscii("com.sun.star.comp.svl.PathService");
51cdf0e10cSrcweir 		}
52cdf0e10cSrcweir 
supportsService(const OUString & rName)53cdf0e10cSrcweir     virtual sal_Bool SAL_CALL supportsService (
54cdf0e10cSrcweir 		const OUString & rName)
55cdf0e10cSrcweir 		throw(css::uno::RuntimeException)
56cdf0e10cSrcweir 		{
57cdf0e10cSrcweir 			return (rName.compareToAscii("com.sun.star.config.SpecialConfigManager") == 0);
58cdf0e10cSrcweir 		}
59cdf0e10cSrcweir 
getSupportedServiceNames()60cdf0e10cSrcweir     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
61cdf0e10cSrcweir 		throw(css::uno::RuntimeException)
62cdf0e10cSrcweir 		{
63cdf0e10cSrcweir 			css::uno::Sequence< OUString > aRet(1);
64cdf0e10cSrcweir 			aRet.getArray()[0] = OUString::createFromAscii("com.sun.star.config.SpecialConfigManager");
65cdf0e10cSrcweir 			return aRet;
66cdf0e10cSrcweir 		}
67cdf0e10cSrcweir 
substituteVariables(const OUString & sText)68cdf0e10cSrcweir     virtual OUString SAL_CALL substituteVariables (
69cdf0e10cSrcweir 		const OUString& sText)
70cdf0e10cSrcweir 		throw(css::uno::RuntimeException)
71cdf0e10cSrcweir 		{
72cdf0e10cSrcweir 			return m_aOptions.SubstituteVariable( sText );
73cdf0e10cSrcweir 		}
74cdf0e10cSrcweir 
addPropertyChangeListener(const OUString &,const css::uno::Reference<css::beans::XPropertyChangeListener> &)75cdf0e10cSrcweir     virtual void SAL_CALL addPropertyChangeListener (
76cdf0e10cSrcweir 		const OUString &, const css::uno::Reference< css::beans::XPropertyChangeListener > &)
77cdf0e10cSrcweir 		throw(css::uno::RuntimeException)
78cdf0e10cSrcweir 		{}
79cdf0e10cSrcweir 
removePropertyChangeListener(const OUString &,const css::uno::Reference<css::beans::XPropertyChangeListener> &)80cdf0e10cSrcweir     virtual void SAL_CALL removePropertyChangeListener (
81cdf0e10cSrcweir 		const OUString &, const css::uno::Reference< css::beans::XPropertyChangeListener > &)
82cdf0e10cSrcweir 		throw(css::uno::RuntimeException)
83cdf0e10cSrcweir 		{}
84cdf0e10cSrcweir 
flush()85cdf0e10cSrcweir     virtual void SAL_CALL flush()
86cdf0e10cSrcweir 		throw(css::uno::RuntimeException)
87cdf0e10cSrcweir 		{}
88cdf0e10cSrcweir };
89cdf0e10cSrcweir 
90cdf0e10cSrcweir // -----------------------------------------------------------------------
91cdf0e10cSrcweir 
PathService_CreateInstance(const css::uno::Reference<css::lang::XMultiServiceFactory> &)92cdf0e10cSrcweir css::uno::Reference< css::uno::XInterface > PathService_CreateInstance (
93cdf0e10cSrcweir 	const css::uno::Reference< css::lang::XMultiServiceFactory > &)
94cdf0e10cSrcweir {
95cdf0e10cSrcweir 	return css::uno::Reference< css::uno::XInterface >(
96cdf0e10cSrcweir 		static_cast< cppu::OWeakObject* >(new PathService()));
97cdf0e10cSrcweir }
98cdf0e10cSrcweir 
99cdf0e10cSrcweir // -----------------------------------------------------------------------
100