bump product version to 7.2.5.1
[LibreOffice.git] / ucb / source / ucp / hierarchy / hierarchydatasource.hxx
blob9806f98f8036caf5add8b485215140ee9703ff8c
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 <osl/mutex.hxx>
23 #include <com/sun/star/lang/XComponent.hpp>
24 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
25 #include <com/sun/star/lang/XServiceInfo.hpp>
26 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
27 #include <com/sun/star/uno/XComponentContext.hpp>
28 #include <cppuhelper/implbase.hxx>
29 #include <memory>
31 namespace comphelper { class OInterfaceContainerHelper2; }
33 namespace hierarchy_ucp {
36 class HierarchyDataSource : public cppu::WeakImplHelper<
37 css::lang::XServiceInfo,
38 css::lang::XComponent,
39 css::lang::XMultiServiceFactory>
41 osl::Mutex m_aMutex;
42 css::uno::Reference< css::uno::XComponentContext > m_xContext;
43 css::uno::Reference< css::lang::XMultiServiceFactory > m_xConfigProvider;
44 std::unique_ptr<comphelper::OInterfaceContainerHelper2> m_pDisposeEventListeners;
46 public:
47 explicit HierarchyDataSource( const css::uno::Reference< css::uno::XComponentContext > & rxContext );
48 virtual ~HierarchyDataSource() override;
50 // XServiceInfo
51 virtual OUString SAL_CALL getImplementationName() override;
52 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
53 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
55 // XComponent
56 virtual void SAL_CALL dispose() override;
57 virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener > & xListener ) override;
58 virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener > & aListener ) override;
60 // XMultiServiceFactory
61 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( const OUString & aServiceSpecifier ) override;
62 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments( const OUString & ServiceSpecifier,
63 const css::uno::Sequence<
64 css::uno::Any > & Arguments ) override;
65 virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() override;
67 // Non-Interface methods
69 private:
70 /// @throws css::uno::Exception
71 css::uno::Reference< css::uno::XInterface > createInstanceWithArguments( std::u16string_view ServiceSpecifier,
72 const css::uno::Sequence<
73 css::uno::Any > & Arguments,
74 bool bCheckArgs );
76 css::uno::Reference< css::lang::XMultiServiceFactory > getConfigProvider();
78 static bool createConfigPath( const OUString & rInPath, OUString & rOutPath );
81 } // namespace hierarchy_ucp
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */