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 0 : 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 OUString SAL_CALL
53 : getOfficeInstallationDirectoryURL()
54 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
55 : virtual OUString SAL_CALL
56 : getOfficeUserDataDirectoryURL()
57 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
58 : virtual OUString SAL_CALL
59 : makeRelocatableURL( const OUString& URL )
60 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
61 : virtual OUString SAL_CALL
62 : makeAbsoluteURL( const OUString& URL )
63 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
64 :
65 : // XServiceInfo
66 : virtual OUString SAL_CALL
67 : getImplementationName()
68 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
69 : virtual sal_Bool SAL_CALL
70 : supportsService( const OUString& ServiceName )
71 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
72 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL
73 : getSupportedServiceNames()
74 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
75 :
76 : // XServiceInfo - static versions (used for component registration)
77 : static OUString SAL_CALL
78 : getImplementationName_static();
79 : static ::com::sun::star::uno::Sequence< OUString > SAL_CALL
80 : getSupportedServiceNames_static();
81 : static 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 : OUString m_aOfficeBrandDirMacro;
90 : OUString m_aOfficeBaseDirMacro;
91 : OUString m_aUserDirMacro;
92 : com::sun::star::uno::Reference<
93 : com::sun::star::uno::XComponentContext > m_xCtx;
94 : OUString * m_pOfficeBrandDir;
95 : OUString * m_pUserDir;
96 : };
97 :
98 : } // namespace comphelper
99 :
100 : #endif /* !INCLUDED_OFFICEINSTALLATIONDIRECTORIES_HXX */
101 :
102 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|