LibreOffice Module comphelper (master) 1
officeinstallationdirectories.hxx
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#pragma once
21
24
25#include <com/sun/star/lang/XServiceInfo.hpp>
26#include <com/sun/star/util/XOfficeInstallationDirectories.hpp>
27
28#include <optional>
29
30namespace com::sun::star::uno { class XComponentContext; }
31
32namespace comphelper {
33
34
35
36typedef cppu::WeakImplHelper<
37 css::util::XOfficeInstallationDirectories,
38 css::lang::XServiceInfo > UnoImplBase;
39
41{
42public:
44 css::uno::Reference< css::uno::XComponentContext > xCtx );
45 virtual ~OfficeInstallationDirectories() override;
46
47 // XOfficeInstallationDirectories
48 virtual OUString SAL_CALL
50 virtual OUString SAL_CALL
52 virtual OUString SAL_CALL
53 makeRelocatableURL( const OUString& URL ) override;
54 virtual OUString SAL_CALL
55 makeAbsoluteURL( const OUString& URL ) override;
56
57 // XServiceInfo
58 virtual OUString SAL_CALL
59 getImplementationName() override;
60 virtual sal_Bool SAL_CALL
61 supportsService( const OUString& ServiceName ) override;
62 virtual css::uno::Sequence< OUString > SAL_CALL
63 getSupportedServiceNames() override;
64
65private:
66 void initDirs();
67
68 css::uno::Reference< css::uno::XComponentContext > m_xCtx;
69 std::optional<OUString> m_xOfficeBrandDir;
70 std::optional<OUString> m_xUserDir;
71};
72
73} // namespace comphelper
74
75/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual OUString SAL_CALL getImplementationName() override
virtual OUString SAL_CALL makeRelocatableURL(const OUString &URL) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual OUString SAL_CALL makeAbsoluteURL(const OUString &URL) override
css::uno::Reference< css::uno::XComponentContext > m_xCtx
virtual OUString SAL_CALL getOfficeInstallationDirectoryURL() override
OfficeInstallationDirectories(css::uno::Reference< css::uno::XComponentContext > xCtx)
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual OUString SAL_CALL getOfficeUserDataDirectoryURL() override
cppu::WeakImplHelper< css::util::XOfficeInstallationDirectories, css::lang::XServiceInfo > UnoImplBase
unsigned char sal_Bool