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 #ifndef INCLUDED_UCB_SOURCE_UCP_HIERARCHY_HIERARCHYDATASOURCE_HXX
21 #define INCLUDED_UCB_SOURCE_UCP_HIERARCHY_HIERARCHYDATASOURCE_HXX
22 
23 #include <osl/mutex.hxx>
24 #include <com/sun/star/lang/XComponent.hpp>
25 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
26 #include <com/sun/star/lang/XServiceInfo.hpp>
27 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
28 #include <com/sun/star/uno/XComponentContext.hpp>
29 #include <cppuhelper/implbase.hxx>
30 #include <memory>
31 
32 namespace comphelper { class OInterfaceContainerHelper2; }
33 
34 namespace hierarchy_ucp {
35 
36 
37 class HierarchyDataSource : public cppu::WeakImplHelper<
38  css::lang::XServiceInfo,
39  css::lang::XComponent,
40  css::lang::XMultiServiceFactory>
41 {
42  osl::Mutex m_aMutex;
43  css::uno::Reference< css::uno::XComponentContext > m_xContext;
44  css::uno::Reference< css::lang::XMultiServiceFactory > m_xConfigProvider;
45  std::unique_ptr<comphelper::OInterfaceContainerHelper2> m_pDisposeEventListeners;
46 
47 public:
48  explicit HierarchyDataSource( const css::uno::Reference< css::uno::XComponentContext > & rxContext );
49  virtual ~HierarchyDataSource() override;
50 
51  // XServiceInfo
52  virtual OUString SAL_CALL getImplementationName() override;
53  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
54  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
55 
56  static OUString getImplementationName_Static();
57  static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
58 
59  static css::uno::Reference< css::lang::XSingleServiceFactory > createServiceFactory( const css::uno::Reference<
60  css::lang::XMultiServiceFactory >& rxServiceMgr );
61 
62  // XComponent
63  virtual void SAL_CALL dispose() override;
64  virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener > & xListener ) override;
65  virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener > & aListener ) override;
66 
67  // XMultiServiceFactory
68  virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( const OUString & aServiceSpecifier ) override;
69  virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments( const OUString & ServiceSpecifier,
70  const css::uno::Sequence<
71  css::uno::Any > & Arguments ) override;
72  virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() override;
73 
74  // Non-Interface methods
75 
76 private:
78  css::uno::Reference< css::uno::XInterface > createInstanceWithArguments( const OUString & ServiceSpecifier,
79  const css::uno::Sequence<
80  css::uno::Any > & Arguments,
81  bool bCheckArgs );
82 
83  css::uno::Reference< css::lang::XMultiServiceFactory > getConfigProvider();
84 
85  static bool createConfigPath( const OUString & rInPath, OUString & rOutPath );
86 };
87 
88 } // namespace hierarchy_ucp
89 
90 #endif // INCLUDED_UCB_SOURCE_UCP_HIERARCHY_HIERARCHYDATASOURCE_HXX
91 
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::uno::XComponentContext > m_xContext
static OUString getImplementationName_Static()
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)
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
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 css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
static css::uno::Reference< css::lang::XSingleServiceFactory > createServiceFactory(const css::uno::Reference< css::lang::XMultiServiceFactory > &rxServiceMgr)
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
virtual OUString SAL_CALL getImplementationName() override
css::uno::Reference< css::lang::XMultiServiceFactory > m_xConfigProvider
std::unique_ptr< comphelper::OInterfaceContainerHelper2 > m_pDisposeEventListeners
static css::uno::Sequence< OUString > getSupportedServiceNames_Static()