LibreOffice Module svl (master) 1
pathservice.cxx
Go to the documentation of this file.
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
22#include <sal/types.h>
23#include <rtl/ustring.hxx>
26#include <com/sun/star/frame/XConfigManager.hpp>
27#include <com/sun/star/lang/XServiceInfo.hpp>
28
29namespace com::sun::star::uno {
30 class XComponentContext;
31}
32
33namespace {
34
35class PathService : public ::cppu::WeakImplHelper< css::frame::XConfigManager, css::lang::XServiceInfo >
36{
37 SvtPathOptions m_aOptions;
38
39public:
40 PathService()
41 {}
42
43 virtual OUString SAL_CALL getImplementationName() override
44 {
45 return "com.sun.star.comp.svl.PathService";
46 }
47
48 virtual sal_Bool SAL_CALL supportsService (
49 const OUString & rName) override
50 {
51 return cppu::supportsService(this, rName);
52 }
53
54 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
55 {
56 css::uno::Sequence< OUString > aRet { "com.sun.star.config.SpecialConfigManager" };
57 return aRet;
58 }
59
60 virtual OUString SAL_CALL substituteVariables (
61 const OUString& sText) override
62 {
63 return m_aOptions.SubstituteVariable( sText );
64 }
65
66 virtual void SAL_CALL addPropertyChangeListener (
67 const OUString &, const css::uno::Reference< css::beans::XPropertyChangeListener > &) override
68 {}
69
70 virtual void SAL_CALL removePropertyChangeListener (
71 const OUString &, const css::uno::Reference< css::beans::XPropertyChangeListener > &) override
72 {}
73
74 virtual void SAL_CALL flush() override
75 {}
76};
77
78}
79
80extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
82 css::uno::Sequence<css::uno::Any> const &)
83{
84 return cppu::acquire(new PathService());
85}
86
87
88/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString SubstituteVariable(const OUString &rVar) const
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_svl_PathService_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
Definition: pathservice.cxx:81
unsigned char sal_Bool