Update ooo320-m1
[ooovba.git] / UnoControls / source / inc / OConnectionPointHelper.hxx
blobca6b66f3f205bd1f304df69e68094417c4568206
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: OConnectionPointHelper.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _OCONNECTIONPOINTHELPER_HXX
32 #define _OCONNECTIONPOINTHELPER_HXX
34 //______________________________________________________________________________________________________________
35 // includes of other projects
36 //______________________________________________________________________________________________________________
38 #include <com/sun/star/lang/XConnectionPointContainer.hpp>
39 #include <com/sun/star/lang/XConnectionPoint.hpp>
40 #include <cppuhelper/weak.hxx>
41 #include <cppuhelper/propshlp.hxx>
43 //______________________________________________________________________________________________________________
44 // includes of my own project
45 //______________________________________________________________________________________________________________
46 #include "OConnectionPointContainerHelper.hxx"
48 //______________________________________________________________________________________________________________
49 // namespaces
50 //______________________________________________________________________________________________________________
52 namespace unocontrols{
54 #define UNO3_ANY ::com::sun::star::uno::Any
55 #define UNO3_SEQUENCE ::com::sun::star::uno::Sequence
56 #define UNO3_TYPE ::com::sun::star::uno::Type
57 #define UNO3_REFERENCE ::com::sun::star::uno::Reference
58 #define UNO3_XCONNECTIONPOINTCONTAINER ::com::sun::star::lang::XConnectionPointContainer
59 #define UNO3_XCONNECTIONPOINT ::com::sun::star::lang::XConnectionPoint
60 #define UNO3_MUTEX ::osl::Mutex
61 #define UNO3_RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException
62 #define UNO3_XINTERFACE ::com::sun::star::uno::XInterface
63 #define UNO3_OMULTITYPEINTERFACECONTAINERHELPER ::cppu::OMultiTypeInterfaceContainerHelper
64 #define UNO3_LISTENEREXISTEXCEPTION ::com::sun::star::lang::ListenerExistException
65 #define UNO3_INVALIDLISTENEREXCEPTION ::com::sun::star::lang::InvalidListenerException
66 #define UNO3_WEAKREFERENCE ::com::sun::star::uno::WeakReference
67 #define UNO3_OWEAKOBJECT ::cppu::OWeakObject
68 #define UNO3_OCONNECTIONPOINTCONTAINERHELPER OConnectionPointContainerHelper
70 //______________________________________________________________________________________________________________
71 // defines
72 //______________________________________________________________________________________________________________
74 //______________________________________________________________________________________________________________
75 // class declaration OConnectionPointHelper
76 //______________________________________________________________________________________________________________
78 class OConnectionPointHelper : public UNO3_XCONNECTIONPOINT
79 , public UNO3_OWEAKOBJECT
82 //______________________________________________________________________________________________________________
83 // public methods
84 //______________________________________________________________________________________________________________
86 public:
88 //__________________________________________________________________________________________________________
89 // construct/destruct
90 //__________________________________________________________________________________________________________
92 /**_________________________________________________________________________________________________________
93 @short
94 @descr
96 @seealso
98 @param
100 @return
102 @onerror
105 OConnectionPointHelper( UNO3_MUTEX& aMutex ,
106 UNO3_OCONNECTIONPOINTCONTAINERHELPER* pContainerImplementation ,
107 UNO3_TYPE aType );
109 /**_________________________________________________________________________________________________________
110 @short
111 @descr
113 @seealso
115 @param
117 @return
119 @onerror
122 virtual ~OConnectionPointHelper();
124 //________________________________________________________________________________________________________
125 // XInterface
126 //________________________________________________________________________________________________________
128 /**_______________________________________________________________________________________________________
129 @short give answer, if interface is supported
130 @descr The interfaces are searched by type.
132 @seealso XInterface
134 @param "rType" is the type of searched interface.
136 @return Any information about found interface
138 @onerror A RuntimeException is thrown.
141 virtual UNO3_ANY SAL_CALL queryInterface( const UNO3_TYPE& aType ) throw( UNO3_RUNTIMEEXCEPTION );
143 /**_______________________________________________________________________________________________________
144 @short increment refcount
145 @descr -
147 @seealso XInterface
148 @seealso release()
150 @param -
152 @return -
154 @onerror A RuntimeException is thrown.
157 virtual void SAL_CALL acquire() throw();
159 /**_______________________________________________________________________________________________________
160 @short decrement refcount
161 @descr -
163 @seealso XInterface
164 @seealso acquire()
166 @param -
168 @return -
170 @onerror A RuntimeException is thrown.
173 virtual void SAL_CALL release() throw();
175 //__________________________________________________________________________________________________________
176 // XConnectionPoint
177 //__________________________________________________________________________________________________________
179 /**_________________________________________________________________________________________________________
180 @short
181 @descr
183 @seealso
185 @param
187 @return
189 @onerror
192 virtual UNO3_TYPE SAL_CALL getConnectionType() throw( UNO3_RUNTIMEEXCEPTION );
194 /**_________________________________________________________________________________________________________
195 @short
196 @descr
198 @seealso
200 @param
202 @return
204 @onerror
207 virtual UNO3_REFERENCE< UNO3_XCONNECTIONPOINTCONTAINER > SAL_CALL getConnectionPointContainer() throw( UNO3_RUNTIMEEXCEPTION );
209 /**_________________________________________________________________________________________________________
210 @short
211 @descr
213 @seealso
215 @param
217 @return
219 @onerror
222 virtual void SAL_CALL advise( const UNO3_REFERENCE< UNO3_XINTERFACE >& xListener ) throw( UNO3_LISTENEREXISTEXCEPTION ,
223 UNO3_INVALIDLISTENEREXCEPTION ,
224 UNO3_RUNTIMEEXCEPTION );
226 /**_________________________________________________________________________________________________________
227 @short
228 @descr
230 @seealso
232 @param
234 @return
236 @onerror
239 virtual void SAL_CALL unadvise( const UNO3_REFERENCE< UNO3_XINTERFACE >& xListener ) throw( UNO3_RUNTIMEEXCEPTION );
241 /**_________________________________________________________________________________________________________
242 @short
243 @descr
245 @seealso
247 @param
249 @return
251 @onerror
254 virtual UNO3_SEQUENCE< UNO3_REFERENCE< UNO3_XINTERFACE > > SAL_CALL getConnections() throw( UNO3_RUNTIMEEXCEPTION );
256 //______________________________________________________________________________________________________________
257 // private methods
258 //______________________________________________________________________________________________________________
260 private:
262 /**_________________________________________________________________________________________________________
263 @short
264 @descr
266 @seealso
268 @param
270 @return
272 @onerror
275 sal_Bool impl_LockContainer();
277 /**_________________________________________________________________________________________________________
278 @short
279 @descr
281 @seealso
283 @param
285 @return
287 @onerror
290 void impl_UnlockContainer();
292 //______________________________________________________________________________________________________________
293 // private variables
294 //______________________________________________________________________________________________________________
296 private:
298 UNO3_MUTEX& m_aSharedMutex ;
299 UNO3_WEAKREFERENCE< UNO3_XCONNECTIONPOINTCONTAINER > m_oContainerWeakReference ; // Reference to container-class!. Don't use Reference<...>
300 // It is a ring-reference => and must be a wekreference!
301 UNO3_OCONNECTIONPOINTCONTAINERHELPER* m_pContainerImplementation ;
302 UNO3_TYPE m_aInterfaceType ;
303 UNO3_REFERENCE< UNO3_XINTERFACE > m_xLock ;
305 }; // class OConnectionPointHelper
307 } // namespace unocontrols
309 #endif // #ifndef _OCONNECTIONPOINTHELPER_HXX