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/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"
33 namespace unocontrols
{
35 // class declaration OConnectionPointHelper
37 class OConnectionPointHelper
: public ::com::sun::star::lang::XConnectionPoint
38 , public ::cppu::OWeakObject
47 /**_________________________________________________________________________________________________________
60 OConnectionPointHelper( ::osl::Mutex
& aMutex
,
61 OConnectionPointContainerHelper
* pContainerImplementation
,
62 ::com::sun::star::uno::Type aType
);
64 /**_________________________________________________________________________________________________________
77 virtual ~OConnectionPointHelper();
81 /**_______________________________________________________________________________________________________
82 @short give answer, if interface is supported
83 @descr The interfaces are searched by type.
87 @param "rType" is the type of searched interface.
89 @return Any information about found interface
91 @onerror A RuntimeException is thrown.
94 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface( const ::com::sun::star::uno::Type
& aType
)
95 throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
97 /**_______________________________________________________________________________________________________
98 @short increment refcount
101 @onerror A RuntimeException is thrown.
104 virtual void SAL_CALL
acquire() throw() SAL_OVERRIDE
;
106 /**_______________________________________________________________________________________________________
107 @short decrement refcount
110 @onerror A RuntimeException is thrown.
113 virtual void SAL_CALL
release() throw() SAL_OVERRIDE
;
117 /**_________________________________________________________________________________________________________
130 virtual ::com::sun::star::uno::Type SAL_CALL
getConnectionType()
131 throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
133 /**_________________________________________________________________________________________________________
146 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XConnectionPointContainer
> SAL_CALL
getConnectionPointContainer()
147 throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
149 /**_________________________________________________________________________________________________________
162 virtual void SAL_CALL
advise(
163 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& xListener
165 ::com::sun::star::lang::ListenerExistException
,
166 ::com::sun::star::lang::InvalidListenerException
,
167 ::com::sun::star::uno::RuntimeException
, std::exception
170 /**_________________________________________________________________________________________________________
183 virtual void SAL_CALL
unadvise( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& xListener
)
184 throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
186 /**_________________________________________________________________________________________________________
199 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> > SAL_CALL
getConnections()
200 throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
206 /**_________________________________________________________________________________________________________
219 bool impl_LockContainer();
221 /**_________________________________________________________________________________________________________
234 void impl_UnlockContainer();
240 ::osl::Mutex
& m_aSharedMutex
;
241 ::com::sun::star::uno::WeakReference
< ::com::sun::star::lang::XConnectionPointContainer
> m_oContainerWeakReference
; // Reference to container-class!. Don't use Reference<...>
242 // It is a ring-reference => and must be a wekreference!
243 OConnectionPointContainerHelper
* m_pContainerImplementation
;
244 ::com::sun::star::uno::Type m_aInterfaceType
;
245 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> m_xLock
;
247 }; // class OConnectionPointHelper
249 } // namespace unocontrols
251 #endif // INCLUDED_UNOCONTROLS_SOURCE_INC_OCONNECTIONPOINTHELPER_HXX
253 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */