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 _OCONNECTIONPOINTHELPER_HXX
21 #define _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/propshlp.hxx>
28 #include "OConnectionPointContainerHelper.hxx"
30 //______________________________________________________________________________________________________________
32 //______________________________________________________________________________________________________________
34 namespace unocontrols
{
36 //______________________________________________________________________________________________________________
37 // class declaration OConnectionPointHelper
38 //______________________________________________________________________________________________________________
40 class OConnectionPointHelper
: public ::com::sun::star::lang::XConnectionPoint
41 , public ::cppu::OWeakObject
44 //______________________________________________________________________________________________________________
46 //______________________________________________________________________________________________________________
50 //__________________________________________________________________________________________________________
52 //__________________________________________________________________________________________________________
54 /**_________________________________________________________________________________________________________
67 OConnectionPointHelper( ::osl::Mutex
& aMutex
,
68 OConnectionPointContainerHelper
* pContainerImplementation
,
69 ::com::sun::star::uno::Type aType
);
71 /**_________________________________________________________________________________________________________
84 virtual ~OConnectionPointHelper();
86 //________________________________________________________________________________________________________
88 //________________________________________________________________________________________________________
90 /**_______________________________________________________________________________________________________
91 @short give answer, if interface is supported
92 @descr The interfaces are searched by type.
96 @param "rType" is the type of searched interface.
98 @return Any information about found interface
100 @onerror A RuntimeException is thrown.
103 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface( const ::com::sun::star::uno::Type
& aType
)
104 throw( ::com::sun::star::uno::RuntimeException
);
106 /**_______________________________________________________________________________________________________
107 @short increment refcount
117 @onerror A RuntimeException is thrown.
120 virtual void SAL_CALL
acquire() throw();
122 /**_______________________________________________________________________________________________________
123 @short decrement refcount
133 @onerror A RuntimeException is thrown.
136 virtual void SAL_CALL
release() throw();
138 //__________________________________________________________________________________________________________
140 //__________________________________________________________________________________________________________
142 /**_________________________________________________________________________________________________________
155 virtual ::com::sun::star::uno::Type SAL_CALL
getConnectionType()
156 throw( ::com::sun::star::uno::RuntimeException
);
158 /**_________________________________________________________________________________________________________
171 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XConnectionPointContainer
> SAL_CALL
getConnectionPointContainer()
172 throw( ::com::sun::star::uno::RuntimeException
);
174 /**_________________________________________________________________________________________________________
187 virtual void SAL_CALL
advise(
188 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& xListener
190 ::com::sun::star::lang::ListenerExistException
,
191 ::com::sun::star::lang::InvalidListenerException
,
192 ::com::sun::star::uno::RuntimeException
195 /**_________________________________________________________________________________________________________
208 virtual void SAL_CALL
unadvise( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& xListener
)
209 throw( ::com::sun::star::uno::RuntimeException
);
211 /**_________________________________________________________________________________________________________
224 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> > SAL_CALL
getConnections()
225 throw( ::com::sun::star::uno::RuntimeException
);
227 //______________________________________________________________________________________________________________
229 //______________________________________________________________________________________________________________
233 /**_________________________________________________________________________________________________________
246 sal_Bool
impl_LockContainer();
248 /**_________________________________________________________________________________________________________
261 void impl_UnlockContainer();
263 //______________________________________________________________________________________________________________
265 //______________________________________________________________________________________________________________
269 ::osl::Mutex
& m_aSharedMutex
;
270 ::com::sun::star::uno::WeakReference
< ::com::sun::star::lang::XConnectionPointContainer
> m_oContainerWeakReference
; // Reference to container-class!. Don't use Reference<...>
271 // It is a ring-reference => and must be a wekreference!
272 OConnectionPointContainerHelper
* m_pContainerImplementation
;
273 ::com::sun::star::uno::Type m_aInterfaceType
;
274 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> m_xLock
;
276 }; // class OConnectionPointHelper
278 } // namespace unocontrols
280 #endif // #ifndef _OCONNECTIONPOINTHELPER_HXX
282 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */