fix build
[LibreOffice.git] / UnoControls / source / inc / OConnectionPointContainerHelper.hxx
blobc1e46b457f798e142ce52aa8ed0cffc3b2f367c4
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 <com/sun/star/lang/XConnectionPointContainer.hpp>
23 #include <cppuhelper/weak.hxx>
24 #include <comphelper/multicontainer2.hxx>
26 namespace com::sun::star::lang { class XConnectionPoint; }
28 namespace unocontrols {
30 class OConnectionPointContainerHelper final : public css::lang::XConnectionPointContainer
31 , public ::cppu::OWeakObject
33 public:
34 OConnectionPointContainerHelper( ::osl::Mutex& aMutex );
36 virtual ~OConnectionPointContainerHelper() override;
38 // XInterface
40 /**
41 @short give answer, if interface is supported
42 @descr The interfaces are searched by type.
44 @seealso XInterface
46 @param "rType" is the type of searched interface.
48 @return Any information about found interface
50 @onerror A RuntimeException is thrown.
53 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
55 /**
56 @short increment refcount
57 @seealso XInterface
58 @seealso release()
59 @onerror A RuntimeException is thrown.
62 virtual void SAL_CALL acquire() noexcept override;
64 /**
65 @short decrement refcount
66 @seealso XInterface
67 @seealso acquire()
68 @onerror A RuntimeException is thrown.
71 virtual void SAL_CALL release() noexcept override;
73 // XConnectionPointContainer
75 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getConnectionPointTypes() override;
77 virtual css::uno::Reference< css::lang::XConnectionPoint > SAL_CALL queryConnectionPoint(
78 const css::uno::Type& aType
79 ) override;
81 virtual void SAL_CALL advise(
82 const css::uno::Type& aType ,
83 const css::uno::Reference< css::uno::XInterface >& xListener
84 ) override;
86 virtual void SAL_CALL unadvise(
87 const css::uno::Type& aType ,
88 const css::uno::Reference< css::uno::XInterface >& xListener
89 ) override;
91 // public but impl method!
92 // Is necessary to get container member at OConnectionPoint-instance.
93 // Impl methods are not threadsafe!
94 // "Parent" function must do this.
95 comphelper::OMultiTypeInterfaceContainerHelper2& impl_getMultiTypeContainer() { return m_aMultiTypeContainer; }
97 private:
98 ::osl::Mutex& m_aSharedMutex;
99 comphelper::OMultiTypeInterfaceContainerHelper2 m_aMultiTypeContainer; // Container to hold listener
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */