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 .
20 #ifndef INCLUDED_UNOCONTROLS_SOURCE_INC_OCONNECTIONPOINTCONTAINERHELPER_HXX
21 #define INCLUDED_UNOCONTROLS_SOURCE_INC_OCONNECTIONPOINTCONTAINERHELPER_HXX
23 #include <com/sun/star/lang/XConnectionPointContainer.hpp>
24 #include <cppuhelper/weak.hxx>
25 #include <cppuhelper/interfacecontainer.hxx>
27 namespace com::sun::star::lang
{ class XConnectionPoint
; }
29 namespace unocontrols
{
31 class OConnectionPointContainerHelper
: public css::lang::XConnectionPointContainer
32 , public ::cppu::OWeakObject
35 OConnectionPointContainerHelper( ::osl::Mutex
& aMutex
);
37 virtual ~OConnectionPointContainerHelper() override
;
42 @short give answer, if interface is supported
43 @descr The interfaces are searched by type.
47 @param "rType" is the type of searched interface.
49 @return Any information about found interface
51 @onerror A RuntimeException is thrown.
54 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& aType
) override
;
57 @short increment refcount
60 @onerror A RuntimeException is thrown.
63 virtual void SAL_CALL
acquire() throw() override
;
66 @short decrement refcount
69 @onerror A RuntimeException is thrown.
72 virtual void SAL_CALL
release() throw() override
;
74 // XConnectionPointContainer
76 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getConnectionPointTypes() override
;
78 virtual css::uno::Reference
< css::lang::XConnectionPoint
> SAL_CALL
queryConnectionPoint(
79 const css::uno::Type
& aType
82 virtual void SAL_CALL
advise(
83 const css::uno::Type
& aType
,
84 const css::uno::Reference
< css::uno::XInterface
>& xListener
87 virtual void SAL_CALL
unadvise(
88 const css::uno::Type
& aType
,
89 const css::uno::Reference
< css::uno::XInterface
>& xListener
92 // public but impl method!
93 // Is necessary to get container member at OConnectionPoint-instance.
94 // Impl methods are not threadsafe!
95 // "Parent" function must do this.
96 ::cppu::OMultiTypeInterfaceContainerHelper
& impl_getMultiTypeContainer() { return m_aMultiTypeContainer
; }
99 ::osl::Mutex
& m_aSharedMutex
;
100 ::cppu::OMultiTypeInterfaceContainerHelper m_aMultiTypeContainer
; // Container to hold listener
105 #endif // INCLUDED_UNOCONTROLS_SOURCE_INC_OCONNECTIONPOINTCONTAINERHELPER_HXX
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */