update dev300-m57
[ooovba.git] / svtools / uno / pathservice.cxx
blobf104353cd2128316f66486957d4eefe5d9fd7b19
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: pathservice.cxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svtools.hxx"
34 #include <svtools/pathoptions.hxx>
35 #include "sal/types.h"
36 #include "rtl/ustring.hxx"
37 #include <cppuhelper/implbase2.hxx>
38 #include <com/sun/star/frame/XConfigManager.hpp>
39 #include <com/sun/star/lang/XServiceInfo.hpp>
41 namespace css = com::sun::star;
42 using rtl::OUString;
44 // -----------------------------------------------------------------------
46 class PathService : public ::cppu::WeakImplHelper2< css::frame::XConfigManager, css::lang::XServiceInfo >
48 SvtPathOptions m_aOptions;
50 public:
51 PathService()
54 virtual OUString SAL_CALL getImplementationName()
55 throw(css::uno::RuntimeException)
57 return OUString::createFromAscii("com.sun.star.comp.svtools.PathService");
60 virtual sal_Bool SAL_CALL supportsService (
61 const OUString & rName)
62 throw(css::uno::RuntimeException)
64 return (rName.compareToAscii("com.sun.star.config.SpecialConfigManager") == 0);
67 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
68 throw(css::uno::RuntimeException)
70 css::uno::Sequence< OUString > aRet(1);
71 aRet.getArray()[0] = OUString::createFromAscii("com.sun.star.config.SpecialConfigManager");
72 return aRet;
75 virtual OUString SAL_CALL substituteVariables (
76 const OUString& sText)
77 throw(css::uno::RuntimeException)
79 return m_aOptions.SubstituteVariable( sText );
82 virtual void SAL_CALL addPropertyChangeListener (
83 const OUString &, const css::uno::Reference< css::beans::XPropertyChangeListener > &)
84 throw(css::uno::RuntimeException)
87 virtual void SAL_CALL removePropertyChangeListener (
88 const OUString &, const css::uno::Reference< css::beans::XPropertyChangeListener > &)
89 throw(css::uno::RuntimeException)
92 virtual void SAL_CALL flush()
93 throw(css::uno::RuntimeException)
97 // -----------------------------------------------------------------------
99 css::uno::Reference< css::uno::XInterface > PathService_CreateInstance (
100 const css::uno::Reference< css::lang::XMultiServiceFactory > &)
102 return css::uno::Reference< css::uno::XInterface >(
103 static_cast< cppu::OWeakObject* >(new PathService()));
106 // -----------------------------------------------------------------------