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 ::com::sun::star::lang::XConnectionPointContainer
35 , public ::cppu::OWeakObject
44 /**_________________________________________________________________________________________________________
57 OConnectionPointContainerHelper( ::osl::Mutex
& aMutex
);
59 /**_________________________________________________________________________________________________________
72 virtual ~OConnectionPointContainerHelper();
76 /**_______________________________________________________________________________________________________
77 @short give answer, if interface is supported
78 @descr The interfaces are searched by type.
82 @param "rType" is the type of searched interface.
84 @return Any information about found interface
86 @onerror A RuntimeException is thrown.
89 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface( const ::com::sun::star::uno::Type
& aType
)
90 throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
92 /**_______________________________________________________________________________________________________
93 @short increment refcount
96 @onerror A RuntimeException is thrown.
99 virtual void SAL_CALL
acquire() throw() SAL_OVERRIDE
;
101 /**_______________________________________________________________________________________________________
102 @short decrement refcount
105 @onerror A RuntimeException is thrown.
108 virtual void SAL_CALL
release() throw() SAL_OVERRIDE
;
110 // XConnectionPointContainer
112 /**_________________________________________________________________________________________________________
125 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getConnectionPointTypes()
126 throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
128 /**_________________________________________________________________________________________________________
141 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XConnectionPoint
> SAL_CALL
queryConnectionPoint(
142 const ::com::sun::star::uno::Type
& aType
143 ) throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
145 /**_________________________________________________________________________________________________________
158 virtual void SAL_CALL
advise(
159 const ::com::sun::star::uno::Type
& aType
,
160 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& xListener
161 ) throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
163 /**_________________________________________________________________________________________________________
176 virtual void SAL_CALL
unadvise(
177 const ::com::sun::star::uno::Type
& aType
,
178 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& xListener
179 ) throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
181 // public but impl method!
182 // Is necessary to get container member at OConnectionPoint-instance.
183 // Impl methods are not threadsafe!
184 // "Parent" function must do this.
185 ::cppu::OMultiTypeInterfaceContainerHelper
& impl_getMultiTypeContainer() { return m_aMultiTypeContainer
; }
192 ::osl::Mutex
& m_aSharedMutex
;
193 ::cppu::OMultiTypeInterfaceContainerHelper m_aMultiTypeContainer
; // Container to hold listener
195 }; // class OConnectionPointContainerHelper
197 } // namespace unocontrols
199 #endif // INCLUDED_UNOCONTROLS_SOURCE_INC_OCONNECTIONPOINTCONTAINERHELPER_HXX
201 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */