Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / comphelper / source / officeinstdir / officeinstallationdirectories.hxx
blobd0d86b76c4d59b84d2f813961031e10f2d884688
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include <cppuhelper/implbase.hxx>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <com/sun/star/util/XOfficeInstallationDirectories.hpp>
27 #include <mutex>
28 #include <optional>
30 namespace com::sun::star::uno { class XComponentContext; }
32 namespace comphelper {
36 typedef cppu::WeakImplHelper<
37 css::util::XOfficeInstallationDirectories,
38 css::lang::XServiceInfo > OfficeInstallationDirectories_Base;
40 class OfficeInstallationDirectories : public OfficeInstallationDirectories_Base
42 public:
43 explicit OfficeInstallationDirectories(
44 css::uno::Reference< css::uno::XComponentContext > xCtx );
45 virtual ~OfficeInstallationDirectories() override;
47 // XOfficeInstallationDirectories
48 virtual OUString SAL_CALL
49 getOfficeInstallationDirectoryURL() override;
50 virtual OUString SAL_CALL
51 getOfficeUserDataDirectoryURL() override;
52 virtual OUString SAL_CALL
53 makeRelocatableURL( const OUString& URL ) override;
54 virtual OUString SAL_CALL
55 makeAbsoluteURL( const OUString& URL ) override;
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;
65 private:
66 void initDirs();
68 std::mutex m_aMutex;
69 css::uno::Reference< css::uno::XComponentContext > m_xCtx;
70 std::optional<OUString> m_xOfficeBrandDir;
71 std::optional<OUString> m_xUserDir;
74 } // namespace comphelper
76 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */