Bump version to 6.0-36
[LibreOffice.git] / UnoControls / source / inc / OConnectionPointHelper.hxx
blob77a788651b7716a0b22ef143fc5014d8d39789a7
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 #ifndef INCLUDED_UNOCONTROLS_SOURCE_INC_OCONNECTIONPOINTHELPER_HXX
21 #define INCLUDED_UNOCONTROLS_SOURCE_INC_OCONNECTIONPOINTHELPER_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/weakref.hxx>
27 #include <cppuhelper/propshlp.hxx>
29 #include "OConnectionPointContainerHelper.hxx"
31 // namespaces
33 namespace unocontrols{
35 // class declaration OConnectionPointHelper
37 class OConnectionPointHelper : public css::lang::XConnectionPoint
38 , public ::cppu::OWeakObject
41 public:
43 OConnectionPointHelper( ::osl::Mutex& aMutex ,
44 OConnectionPointContainerHelper* pContainerImplementation ,
45 css::uno::Type const & aType );
47 virtual ~OConnectionPointHelper() override;
49 // XInterface
51 /**_______________________________________________________________________________________________________
52 @short give answer, if interface is supported
53 @descr The interfaces are searched by type.
55 @seealso XInterface
57 @param "rType" is the type of searched interface.
59 @return Any information about found interface
61 @onerror A RuntimeException is thrown.
64 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
66 /**_______________________________________________________________________________________________________
67 @short increment refcount
68 @seealso XInterface
69 @seealso release()
70 @onerror A RuntimeException is thrown.
73 virtual void SAL_CALL acquire() throw() override;
75 /**_______________________________________________________________________________________________________
76 @short decrement refcount
77 @seealso XInterface
78 @seealso acquire()
79 @onerror A RuntimeException is thrown.
82 virtual void SAL_CALL release() throw() override;
84 // XConnectionPoint
86 virtual css::uno::Type SAL_CALL getConnectionType() override;
88 virtual css::uno::Reference< css::lang::XConnectionPointContainer > SAL_CALL getConnectionPointContainer() override;
90 virtual void SAL_CALL advise(
91 const css::uno::Reference< css::uno::XInterface >& xListener
92 ) override;
94 virtual void SAL_CALL unadvise( const css::uno::Reference< css::uno::XInterface >& xListener ) override;
96 virtual css::uno::Sequence< css::uno::Reference< css::uno::XInterface > > SAL_CALL getConnections() override;
98 private:
100 bool impl_LockContainer();
102 void impl_UnlockContainer();
104 private:
106 ::osl::Mutex& m_aSharedMutex;
107 css::uno::WeakReference< css::lang::XConnectionPointContainer > m_oContainerWeakReference; // Reference to container-class!. Don't use Reference<...>
108 // It is a ring-reference => and must be a wekreference!
109 OConnectionPointContainerHelper* m_pContainerImplementation;
110 css::uno::Type m_aInterfaceType;
111 css::uno::Reference< css::uno::XInterface > m_xLock;
113 }; // class OConnectionPointHelper
115 } // namespace unocontrols
117 #endif // INCLUDED_UNOCONTROLS_SOURCE_INC_OCONNECTIONPOINTHELPER_HXX
119 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */