merge the formfield patch from ooo-build
[ooovba.git] / comphelper / source / officeinstdir / officeinstallationdirectories.hxx
blob145fe3eddecf64221f86edf8e8a7a87f59aca509
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: officeinstallationdirectories.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef INCLUDED_OFFICEINSTALLATIONDIRECTORIES_HXX
32 #define INCLUDED_OFFICEINSTALLATIONDIRECTORIES_HXX
34 #include "osl/mutex.hxx"
35 #include "cppuhelper/implbase2.hxx"
37 #include "com/sun/star/lang/XServiceInfo.hpp"
38 #include "com/sun/star/uno/XComponentContext.hpp"
39 #include "com/sun/star/util/XOfficeInstallationDirectories.hpp"
41 namespace comphelper {
43 //=========================================================================
45 typedef cppu::WeakImplHelper2<
46 com::sun::star::util::XOfficeInstallationDirectories,
47 com::sun::star::lang::XServiceInfo > UnoImplBase;
49 struct mutex_holder
51 osl::Mutex m_aMutex;
54 class OfficeInstallationDirectories : public mutex_holder, public UnoImplBase
56 public:
57 OfficeInstallationDirectories(
58 const com::sun::star::uno::Reference<
59 com::sun::star::uno::XComponentContext > & xCtx );
60 virtual ~OfficeInstallationDirectories();
62 // XOfficeInstallationDirectories
63 virtual ::rtl::OUString SAL_CALL
64 getOfficeInstallationDirectoryURL()
65 throw (::com::sun::star::uno::RuntimeException);
66 virtual ::rtl::OUString SAL_CALL
67 getOfficeUserDataDirectoryURL()
68 throw (::com::sun::star::uno::RuntimeException);
69 virtual ::rtl::OUString SAL_CALL
70 makeRelocatableURL( const ::rtl::OUString& URL )
71 throw (::com::sun::star::uno::RuntimeException);
72 virtual ::rtl::OUString SAL_CALL
73 makeAbsoluteURL( const ::rtl::OUString& URL )
74 throw (::com::sun::star::uno::RuntimeException);
76 // XServiceInfo
77 virtual ::rtl::OUString SAL_CALL
78 getImplementationName()
79 throw (::com::sun::star::uno::RuntimeException);
80 virtual sal_Bool SAL_CALL
81 supportsService( const ::rtl::OUString& ServiceName )
82 throw (::com::sun::star::uno::RuntimeException);
83 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
84 getSupportedServiceNames()
85 throw (::com::sun::star::uno::RuntimeException);
87 // XServiceInfo - static versions (used for component registration)
88 static ::rtl::OUString SAL_CALL
89 getImplementationName_static();
90 static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
91 getSupportedServiceNames_static();
92 static ::rtl::OUString SAL_CALL
93 getSingletonName_static();
94 static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
95 Create( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& );
97 private:
98 void initDirs();
100 rtl::OUString m_aOfficeDirMacro;
101 rtl::OUString m_aUserDirMacro;
102 com::sun::star::uno::Reference<
103 com::sun::star::uno::XComponentContext > m_xCtx;
104 rtl::OUString * m_pOfficeDir;
105 rtl::OUString * m_pUserDir;
108 } // namespace comphelper
110 #endif /* !INCLUDED_OFFICEINSTALLATIONDIRECTORIES_HXX */