LibreOffice Module ucb (master)  1
hierarchydatasource.hxx
Go to the documentation of this file.
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 #pragma once
21 
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>
30 
31 namespace comphelper { class OInterfaceContainerHelper2; }
32 
33 namespace hierarchy_ucp {
34 
35 
36 class HierarchyDataSource : public cppu::WeakImplHelper<
37  css::lang::XServiceInfo,
38  css::lang::XComponent,
39  css::lang::XMultiServiceFactory>
40 {
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;
45 
46 public:
47  explicit HierarchyDataSource( const css::uno::Reference< css::uno::XComponentContext > & rxContext );
48  virtual ~HierarchyDataSource() override;
49 
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;
54 
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;
59 
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;
66 
67  // Non-Interface methods
68 
69 private:
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 );
75 
76  css::uno::Reference< css::lang::XMultiServiceFactory > getConfigProvider();
77 
78  static bool createConfigPath( const OUString & rInPath, OUString & rOutPath );
79 };
80 
81 } // namespace hierarchy_ucp
82 
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::uno::XComponentContext > m_xContext
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
virtual void SAL_CALL dispose() override
HierarchyDataSource(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
static bool createConfigPath(const OUString &rInPath, OUString &rOutPath)
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments(const OUString &ServiceSpecifier, const css::uno::Sequence< css::uno::Any > &Arguments) override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(const OUString &aServiceSpecifier) override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
css::uno::Reference< css::lang::XMultiServiceFactory > getConfigProvider()
virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() override
unsigned char sal_Bool
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
css::uno::Reference< css::lang::XMultiServiceFactory > m_xConfigProvider
virtual OUString SAL_CALL getImplementationName() override
std::unique_ptr< comphelper::OInterfaceContainerHelper2 > m_pDisposeEventListeners
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override