Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 :
21 : #include <unotools/pathoptions.hxx>
22 : #include <sal/types.h>
23 : #include <rtl/ustring.hxx>
24 : #include <cppuhelper/implbase2.hxx>
25 : #include <cppuhelper/supportsservice.hxx>
26 : #include <com/sun/star/frame/XConfigManager.hpp>
27 : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
28 : #include <com/sun/star/lang/XServiceInfo.hpp>
29 :
30 : namespace com { namespace sun { namespace star { namespace uno {
31 : class XComponentContext;
32 : } } } }
33 :
34 2 : class PathService : public ::cppu::WeakImplHelper2< css::frame::XConfigManager, css::lang::XServiceInfo >
35 : {
36 : SvtPathOptions m_aOptions;
37 :
38 : public:
39 1 : PathService()
40 1 : {}
41 :
42 0 : virtual OUString SAL_CALL getImplementationName()
43 : throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE
44 : {
45 0 : return OUString("com.sun.star.comp.svl.PathService");
46 : }
47 :
48 0 : virtual sal_Bool SAL_CALL supportsService (
49 : const OUString & rName)
50 : throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE
51 : {
52 0 : return cppu::supportsService(this, rName);
53 : }
54 :
55 0 : virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
56 : throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE
57 : {
58 0 : css::uno::Sequence< OUString > aRet(1);
59 0 : aRet.getArray()[0] = "com.sun.star.config.SpecialConfigManager";
60 0 : return aRet;
61 : }
62 :
63 2 : virtual OUString SAL_CALL substituteVariables (
64 : const OUString& sText)
65 : throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE
66 : {
67 2 : return m_aOptions.SubstituteVariable( sText );
68 : }
69 :
70 0 : virtual void SAL_CALL addPropertyChangeListener (
71 : const OUString &, const css::uno::Reference< css::beans::XPropertyChangeListener > &)
72 : throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE
73 0 : {}
74 :
75 0 : virtual void SAL_CALL removePropertyChangeListener (
76 : const OUString &, const css::uno::Reference< css::beans::XPropertyChangeListener > &)
77 : throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE
78 0 : {}
79 :
80 0 : virtual void SAL_CALL flush()
81 : throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE
82 0 : {}
83 : };
84 :
85 :
86 : extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
87 1 : com_sun_star_comp_svl_PathService_get_implementation(::com::sun::star::uno::XComponentContext*,
88 : ::com::sun::star::uno::Sequence<css::uno::Any> const &)
89 : {
90 1 : return cppu::acquire(new PathService());
91 : }
92 :
93 :
94 :
95 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|