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 <com/sun/star/lang/XComponent.hpp>
23#include <com/sun/star/lang/XMultiServiceFactory.hpp>
24#include <com/sun/star/lang/XServiceInfo.hpp>
25#include <com/sun/star/uno/XComponentContext.hpp>
28#include <memory>
29#include <mutex>
30#include <string_view>
31
32
33namespace hierarchy_ucp {
34
35
36class HierarchyDataSource : public cppu::WeakImplHelper<
37 css::lang::XServiceInfo,
38 css::lang::XComponent,
39 css::lang::XMultiServiceFactory>
40{
41 std::mutex m_aMutex;
42 css::uno::Reference< css::uno::XComponentContext > m_xContext;
43 css::uno::Reference< css::lang::XMultiServiceFactory > m_xConfigProvider;
45
46public:
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
69private:
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( std::u16string_view rInPath, OUString & rOutPath );
79};
80
81} // namespace hierarchy_ucp
82
83/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(const OUString &aServiceSpecifier) override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments(const OUString &ServiceSpecifier, const css::uno::Sequence< css::uno::Any > &Arguments) override
css::uno::Reference< css::uno::XComponentContext > m_xContext
comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > m_aDisposeEventListeners
virtual void SAL_CALL dispose() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual OUString SAL_CALL getImplementationName() override
static bool createConfigPath(std::u16string_view rInPath, OUString &rOutPath)
virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() override
css::uno::Reference< css::lang::XMultiServiceFactory > m_xConfigProvider
HierarchyDataSource(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
css::uno::Reference< css::uno::XInterface > createInstanceWithArguments(std::u16string_view ServiceSpecifier, const css::uno::Sequence< css::uno::Any > &Arguments, bool bCheckArgs)
css::uno::Reference< css::lang::XMultiServiceFactory > getConfigProvider()
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
unsigned char sal_Bool