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 <com/sun/star/lang/XConnectionPoint.hpp>
25 #include <cppuhelper/weak.hxx>
26 #include <cppuhelper/propshlp.hxx>
30 namespace unocontrols
{
32 // class declaration OConnectionPointContainerHelper
34 class OConnectionPointContainerHelper
: public css::lang::XConnectionPointContainer
35 , public ::cppu::OWeakObject
40 OConnectionPointContainerHelper( ::osl::Mutex
& aMutex
);
42 virtual ~OConnectionPointContainerHelper() override
;
46 /**_______________________________________________________________________________________________________
47 @short give answer, if interface is supported
48 @descr The interfaces are searched by type.
52 @param "rType" is the type of searched interface.
54 @return Any information about found interface
56 @onerror A RuntimeException is thrown.
59 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& aType
) override
;
61 /**_______________________________________________________________________________________________________
62 @short increment refcount
65 @onerror A RuntimeException is thrown.
68 virtual void SAL_CALL
acquire() throw() override
;
70 /**_______________________________________________________________________________________________________
71 @short decrement refcount
74 @onerror A RuntimeException is thrown.
77 virtual void SAL_CALL
release() throw() override
;
79 // XConnectionPointContainer
81 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getConnectionPointTypes() override
;
83 virtual css::uno::Reference
< css::lang::XConnectionPoint
> SAL_CALL
queryConnectionPoint(
84 const css::uno::Type
& aType
87 virtual void SAL_CALL
advise(
88 const css::uno::Type
& aType
,
89 const css::uno::Reference
< css::uno::XInterface
>& xListener
92 virtual void SAL_CALL
unadvise(
93 const css::uno::Type
& aType
,
94 const css::uno::Reference
< css::uno::XInterface
>& xListener
97 // public but impl method!
98 // Is necessary to get container member at OConnectionPoint-instance.
99 // Impl methods are not threadsafe!
100 // "Parent" function must do this.
101 ::cppu::OMultiTypeInterfaceContainerHelper
& impl_getMultiTypeContainer() { return m_aMultiTypeContainer
; }
106 ::osl::Mutex
& m_aSharedMutex
;
107 ::cppu::OMultiTypeInterfaceContainerHelper m_aMultiTypeContainer
; // Container to hold listener
109 }; // class OConnectionPointContainerHelper
111 } // namespace unocontrols
113 #endif // INCLUDED_UNOCONTROLS_SOURCE_INC_OCONNECTIONPOINTCONTAINERHELPER_HXX
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */