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_OCONNECTIONPOINTHELPER_HXX
21 #define INCLUDED_UNOCONTROLS_SOURCE_INC_OCONNECTIONPOINTHELPER_HXX
23 #include <com/sun/star/lang/XConnectionPoint.hpp>
24 #include <cppuhelper/weak.hxx>
25 #include <cppuhelper/weakref.hxx>
27 namespace com::sun::star::lang
{ class XConnectionPointContainer
; }
28 namespace unocontrols
{ class OConnectionPointContainerHelper
; }
30 namespace unocontrols
{
32 class OConnectionPointHelper
: public css::lang::XConnectionPoint
33 , public ::cppu::OWeakObject
36 OConnectionPointHelper( ::osl::Mutex
& aMutex
,
37 OConnectionPointContainerHelper
* pContainerImplementation
,
38 css::uno::Type
const & aType
);
40 virtual ~OConnectionPointHelper() override
;
45 @short give answer, if interface is supported
46 @descr The interfaces are searched by type.
50 @param "rType" is the type of searched interface.
52 @return Any information about found interface
54 @onerror A RuntimeException is thrown.
57 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& aType
) override
;
60 @short increment refcount
63 @onerror A RuntimeException is thrown.
66 virtual void SAL_CALL
acquire() throw() override
;
69 @short decrement refcount
72 @onerror A RuntimeException is thrown.
75 virtual void SAL_CALL
release() throw() override
;
79 virtual css::uno::Type SAL_CALL
getConnectionType() override
;
81 virtual css::uno::Reference
< css::lang::XConnectionPointContainer
> SAL_CALL
getConnectionPointContainer() override
;
83 virtual void SAL_CALL
advise(
84 const css::uno::Reference
< css::uno::XInterface
>& xListener
87 virtual void SAL_CALL
unadvise( const css::uno::Reference
< css::uno::XInterface
>& xListener
) override
;
89 virtual css::uno::Sequence
< css::uno::Reference
< css::uno::XInterface
> > SAL_CALL
getConnections() override
;
92 bool impl_LockContainer();
94 void impl_UnlockContainer();
98 ::osl::Mutex
& m_aSharedMutex
;
99 css::uno::WeakReference
< css::lang::XConnectionPointContainer
> m_oContainerWeakReference
; // Reference to container-class!. Don't use Reference<...>
100 // It is a ring-reference => and must be a wekreference!
101 OConnectionPointContainerHelper
* m_pContainerImplementation
;
102 css::uno::Type
const m_aInterfaceType
;
103 css::uno::Reference
< css::uno::XInterface
> m_xLock
;
108 #endif // INCLUDED_UNOCONTROLS_SOURCE_INC_OCONNECTIONPOINTHELPER_HXX
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */