1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
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
34 OConnectionPointContainerHelper( ::osl::Mutex
& aMutex
);
36 virtual ~OConnectionPointContainerHelper() override
;
41 @short give answer, if interface is supported
42 @descr The interfaces are searched by type.
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
;
56 @short increment refcount
59 @onerror A RuntimeException is thrown.
62 virtual void SAL_CALL
acquire() noexcept override
;
65 @short decrement refcount
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
81 virtual void SAL_CALL
advise(
82 const css::uno::Type
& aType
,
83 const css::uno::Reference
< css::uno::XInterface
>& xListener
86 virtual void SAL_CALL
unadvise(
87 const css::uno::Type
& aType
,
88 const css::uno::Reference
< css::uno::XInterface
>& xListener
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
; }
98 ::osl::Mutex
& m_aSharedMutex
;
99 comphelper::OMultiTypeInterfaceContainerHelper2 m_aMultiTypeContainer
; // Container to hold listener
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */