Branch data 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 : : #ifndef INCLUDED_OFFICEINSTALLATIONDIRECTORIES_HXX
21 : : #define INCLUDED_OFFICEINSTALLATIONDIRECTORIES_HXX
22 : :
23 : : #include "osl/mutex.hxx"
24 : : #include "cppuhelper/implbase2.hxx"
25 : :
26 : : #include "com/sun/star/lang/XServiceInfo.hpp"
27 : : #include "com/sun/star/uno/XComponentContext.hpp"
28 : : #include "com/sun/star/util/XOfficeInstallationDirectories.hpp"
29 : :
30 : : namespace comphelper {
31 : :
32 : : //=========================================================================
33 : :
34 : : typedef cppu::WeakImplHelper2<
35 : : com::sun::star::util::XOfficeInstallationDirectories,
36 : : com::sun::star::lang::XServiceInfo > UnoImplBase;
37 : :
38 : 4 : struct mutex_holder
39 : : {
40 : : osl::Mutex m_aMutex;
41 : : };
42 : :
43 : : class OfficeInstallationDirectories : public mutex_holder, public UnoImplBase
44 : : {
45 : : public:
46 : : OfficeInstallationDirectories(
47 : : const com::sun::star::uno::Reference<
48 : : com::sun::star::uno::XComponentContext > & xCtx );
49 : : virtual ~OfficeInstallationDirectories();
50 : :
51 : : // XOfficeInstallationDirectories
52 : : virtual ::rtl::OUString SAL_CALL
53 : : getOfficeInstallationDirectoryURL()
54 : : throw (::com::sun::star::uno::RuntimeException);
55 : : virtual ::rtl::OUString SAL_CALL
56 : : getOfficeUserDataDirectoryURL()
57 : : throw (::com::sun::star::uno::RuntimeException);
58 : : virtual ::rtl::OUString SAL_CALL
59 : : makeRelocatableURL( const ::rtl::OUString& URL )
60 : : throw (::com::sun::star::uno::RuntimeException);
61 : : virtual ::rtl::OUString SAL_CALL
62 : : makeAbsoluteURL( const ::rtl::OUString& URL )
63 : : throw (::com::sun::star::uno::RuntimeException);
64 : :
65 : : // XServiceInfo
66 : : virtual ::rtl::OUString SAL_CALL
67 : : getImplementationName()
68 : : throw (::com::sun::star::uno::RuntimeException);
69 : : virtual sal_Bool SAL_CALL
70 : : supportsService( const ::rtl::OUString& ServiceName )
71 : : throw (::com::sun::star::uno::RuntimeException);
72 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
73 : : getSupportedServiceNames()
74 : : throw (::com::sun::star::uno::RuntimeException);
75 : :
76 : : // XServiceInfo - static versions (used for component registration)
77 : : static ::rtl::OUString SAL_CALL
78 : : getImplementationName_static();
79 : : static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
80 : : getSupportedServiceNames_static();
81 : : static ::rtl::OUString SAL_CALL
82 : : getSingletonName_static();
83 : : static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
84 : : Create( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& );
85 : :
86 : : private:
87 : : void initDirs();
88 : :
89 : : rtl::OUString m_aOfficeBrandDirMacro;
90 : : rtl::OUString m_aOfficeBaseDirMacro;
91 : : rtl::OUString m_aUserDirMacro;
92 : : com::sun::star::uno::Reference<
93 : : com::sun::star::uno::XComponentContext > m_xCtx;
94 : : rtl::OUString * m_pOfficeBrandDir;
95 : : rtl::OUString * m_pUserDir;
96 : : };
97 : :
98 : : } // namespace comphelper
99 : :
100 : : #endif /* !INCLUDED_OFFICEINSTALLATIONDIRECTORIES_HXX */
101 : :
102 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|