1*f6c049e2SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*f6c049e2SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*f6c049e2SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*f6c049e2SAndrew Rist  * distributed with this work for additional information
6*f6c049e2SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*f6c049e2SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*f6c049e2SAndrew Rist  * "License"); you may not use this file except in compliance
9*f6c049e2SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*f6c049e2SAndrew Rist  *
11*f6c049e2SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*f6c049e2SAndrew Rist  *
13*f6c049e2SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*f6c049e2SAndrew Rist  * software distributed under the License is distributed on an
15*f6c049e2SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*f6c049e2SAndrew Rist  * KIND, either express or implied.  See the License for the
17*f6c049e2SAndrew Rist  * specific language governing permissions and limitations
18*f6c049e2SAndrew Rist  * under the License.
19*f6c049e2SAndrew Rist  *
20*f6c049e2SAndrew Rist  *************************************************************/
21*f6c049e2SAndrew Rist 
22*f6c049e2SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _OCONNECTIONPOINTHELPER_HXX
25cdf0e10cSrcweir #define _OCONNECTIONPOINTHELPER_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir //______________________________________________________________________________________________________________
28cdf0e10cSrcweir //	includes of other projects
29cdf0e10cSrcweir //______________________________________________________________________________________________________________
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #include <com/sun/star/lang/XConnectionPointContainer.hpp>
32cdf0e10cSrcweir #include <com/sun/star/lang/XConnectionPoint.hpp>
33cdf0e10cSrcweir #include <cppuhelper/weak.hxx>
34cdf0e10cSrcweir #include <cppuhelper/propshlp.hxx>
35cdf0e10cSrcweir 
36cdf0e10cSrcweir //______________________________________________________________________________________________________________
37cdf0e10cSrcweir //	includes of my own project
38cdf0e10cSrcweir //______________________________________________________________________________________________________________
39cdf0e10cSrcweir #include "OConnectionPointContainerHelper.hxx"
40cdf0e10cSrcweir 
41cdf0e10cSrcweir //______________________________________________________________________________________________________________
42cdf0e10cSrcweir //	namespaces
43cdf0e10cSrcweir //______________________________________________________________________________________________________________
44cdf0e10cSrcweir 
45cdf0e10cSrcweir namespace unocontrols{
46cdf0e10cSrcweir 
47cdf0e10cSrcweir #define	UNO3_ANY										::com::sun::star::uno::Any
48cdf0e10cSrcweir #define	UNO3_SEQUENCE									::com::sun::star::uno::Sequence
49cdf0e10cSrcweir #define	UNO3_TYPE										::com::sun::star::uno::Type
50cdf0e10cSrcweir #define	UNO3_REFERENCE									::com::sun::star::uno::Reference
51cdf0e10cSrcweir #define	UNO3_XCONNECTIONPOINTCONTAINER					::com::sun::star::lang::XConnectionPointContainer
52cdf0e10cSrcweir #define	UNO3_XCONNECTIONPOINT							::com::sun::star::lang::XConnectionPoint
53cdf0e10cSrcweir #define	UNO3_MUTEX										::osl::Mutex
54cdf0e10cSrcweir #define	UNO3_RUNTIMEEXCEPTION							::com::sun::star::uno::RuntimeException
55cdf0e10cSrcweir #define	UNO3_XINTERFACE									::com::sun::star::uno::XInterface
56cdf0e10cSrcweir #define	UNO3_OMULTITYPEINTERFACECONTAINERHELPER			::cppu::OMultiTypeInterfaceContainerHelper
57cdf0e10cSrcweir #define	UNO3_LISTENEREXISTEXCEPTION						::com::sun::star::lang::ListenerExistException
58cdf0e10cSrcweir #define	UNO3_INVALIDLISTENEREXCEPTION					::com::sun::star::lang::InvalidListenerException
59cdf0e10cSrcweir #define	UNO3_WEAKREFERENCE								::com::sun::star::uno::WeakReference
60cdf0e10cSrcweir #define	UNO3_OWEAKOBJECT								::cppu::OWeakObject
61cdf0e10cSrcweir #define	UNO3_OCONNECTIONPOINTCONTAINERHELPER			OConnectionPointContainerHelper
62cdf0e10cSrcweir 
63cdf0e10cSrcweir //______________________________________________________________________________________________________________
64cdf0e10cSrcweir //	defines
65cdf0e10cSrcweir //______________________________________________________________________________________________________________
66cdf0e10cSrcweir 
67cdf0e10cSrcweir //______________________________________________________________________________________________________________
68cdf0e10cSrcweir //	class declaration OConnectionPointHelper
69cdf0e10cSrcweir //______________________________________________________________________________________________________________
70cdf0e10cSrcweir 
71cdf0e10cSrcweir class OConnectionPointHelper	:	public	UNO3_XCONNECTIONPOINT
72cdf0e10cSrcweir 								,	public	UNO3_OWEAKOBJECT
73cdf0e10cSrcweir {
74cdf0e10cSrcweir 
75cdf0e10cSrcweir //______________________________________________________________________________________________________________
76cdf0e10cSrcweir //	public methods
77cdf0e10cSrcweir //______________________________________________________________________________________________________________
78cdf0e10cSrcweir 
79cdf0e10cSrcweir public:
80cdf0e10cSrcweir 
81cdf0e10cSrcweir 	//__________________________________________________________________________________________________________
82cdf0e10cSrcweir 	//	construct/destruct
83cdf0e10cSrcweir 	//__________________________________________________________________________________________________________
84cdf0e10cSrcweir 
85cdf0e10cSrcweir 	/**_________________________________________________________________________________________________________
86cdf0e10cSrcweir 		@short
87cdf0e10cSrcweir 		@descr
88cdf0e10cSrcweir 
89cdf0e10cSrcweir 		@seealso
90cdf0e10cSrcweir 
91cdf0e10cSrcweir 		@param
92cdf0e10cSrcweir 
93cdf0e10cSrcweir 		@return
94cdf0e10cSrcweir 
95cdf0e10cSrcweir 		@onerror
96cdf0e10cSrcweir 	*/
97cdf0e10cSrcweir 
98cdf0e10cSrcweir 	OConnectionPointHelper(	UNO3_MUTEX&				  				aMutex						,
99cdf0e10cSrcweir 							UNO3_OCONNECTIONPOINTCONTAINERHELPER*	pContainerImplementation	,
100cdf0e10cSrcweir 							UNO3_TYPE				  				aType						);
101cdf0e10cSrcweir 
102cdf0e10cSrcweir 	/**_________________________________________________________________________________________________________
103cdf0e10cSrcweir 		@short
104cdf0e10cSrcweir 		@descr
105cdf0e10cSrcweir 
106cdf0e10cSrcweir 		@seealso
107cdf0e10cSrcweir 
108cdf0e10cSrcweir 		@param
109cdf0e10cSrcweir 
110cdf0e10cSrcweir 		@return
111cdf0e10cSrcweir 
112cdf0e10cSrcweir 		@onerror
113cdf0e10cSrcweir 	*/
114cdf0e10cSrcweir 
115cdf0e10cSrcweir 	virtual	~OConnectionPointHelper();
116cdf0e10cSrcweir 
117cdf0e10cSrcweir 	//________________________________________________________________________________________________________
118cdf0e10cSrcweir 	//	XInterface
119cdf0e10cSrcweir 	//________________________________________________________________________________________________________
120cdf0e10cSrcweir 
121cdf0e10cSrcweir 	/**_______________________________________________________________________________________________________
122cdf0e10cSrcweir 		@short		give answer, if interface is supported
123cdf0e10cSrcweir 		@descr		The interfaces are searched by type.
124cdf0e10cSrcweir 
125cdf0e10cSrcweir 		@seealso	XInterface
126cdf0e10cSrcweir 
127cdf0e10cSrcweir 		@param      "rType" is the type of searched interface.
128cdf0e10cSrcweir 
129cdf0e10cSrcweir 		@return		Any		information about found interface
130cdf0e10cSrcweir 
131cdf0e10cSrcweir 		@onerror	A RuntimeException is thrown.
132cdf0e10cSrcweir 	*/
133cdf0e10cSrcweir 
134cdf0e10cSrcweir 	virtual UNO3_ANY SAL_CALL queryInterface( const UNO3_TYPE& aType ) throw( UNO3_RUNTIMEEXCEPTION );
135cdf0e10cSrcweir 
136cdf0e10cSrcweir 	/**_______________________________________________________________________________________________________
137cdf0e10cSrcweir 		@short		increment refcount
138cdf0e10cSrcweir 		@descr		-
139cdf0e10cSrcweir 
140cdf0e10cSrcweir 		@seealso	XInterface
141cdf0e10cSrcweir 		@seealso	release()
142cdf0e10cSrcweir 
143cdf0e10cSrcweir 		@param		-
144cdf0e10cSrcweir 
145cdf0e10cSrcweir 		@return		-
146cdf0e10cSrcweir 
147cdf0e10cSrcweir 		@onerror	A RuntimeException is thrown.
148cdf0e10cSrcweir 	*/
149cdf0e10cSrcweir 
150cdf0e10cSrcweir     virtual void SAL_CALL acquire() throw();
151cdf0e10cSrcweir 
152cdf0e10cSrcweir 	/**_______________________________________________________________________________________________________
153cdf0e10cSrcweir 		@short		decrement refcount
154cdf0e10cSrcweir 		@descr		-
155cdf0e10cSrcweir 
156cdf0e10cSrcweir 		@seealso	XInterface
157cdf0e10cSrcweir 		@seealso	acquire()
158cdf0e10cSrcweir 
159cdf0e10cSrcweir 		@param		-
160cdf0e10cSrcweir 
161cdf0e10cSrcweir 		@return		-
162cdf0e10cSrcweir 
163cdf0e10cSrcweir 		@onerror	A RuntimeException is thrown.
164cdf0e10cSrcweir 	*/
165cdf0e10cSrcweir 
166cdf0e10cSrcweir     virtual void SAL_CALL release() throw();
167cdf0e10cSrcweir 
168cdf0e10cSrcweir 	//__________________________________________________________________________________________________________
169cdf0e10cSrcweir 	//	XConnectionPoint
170cdf0e10cSrcweir 	//__________________________________________________________________________________________________________
171cdf0e10cSrcweir 
172cdf0e10cSrcweir 	/**_________________________________________________________________________________________________________
173cdf0e10cSrcweir 		@short
174cdf0e10cSrcweir 		@descr
175cdf0e10cSrcweir 
176cdf0e10cSrcweir 		@seealso
177cdf0e10cSrcweir 
178cdf0e10cSrcweir 		@param
179cdf0e10cSrcweir 
180cdf0e10cSrcweir 		@return
181cdf0e10cSrcweir 
182cdf0e10cSrcweir 		@onerror
183cdf0e10cSrcweir 	*/
184cdf0e10cSrcweir 
185cdf0e10cSrcweir     virtual UNO3_TYPE SAL_CALL getConnectionType() throw( UNO3_RUNTIMEEXCEPTION );
186cdf0e10cSrcweir 
187cdf0e10cSrcweir 	/**_________________________________________________________________________________________________________
188cdf0e10cSrcweir 		@short
189cdf0e10cSrcweir 		@descr
190cdf0e10cSrcweir 
191cdf0e10cSrcweir 		@seealso
192cdf0e10cSrcweir 
193cdf0e10cSrcweir 		@param
194cdf0e10cSrcweir 
195cdf0e10cSrcweir 		@return
196cdf0e10cSrcweir 
197cdf0e10cSrcweir 		@onerror
198cdf0e10cSrcweir 	*/
199cdf0e10cSrcweir 
200cdf0e10cSrcweir     virtual UNO3_REFERENCE< UNO3_XCONNECTIONPOINTCONTAINER > SAL_CALL getConnectionPointContainer() throw( UNO3_RUNTIMEEXCEPTION );
201cdf0e10cSrcweir 
202cdf0e10cSrcweir 	/**_________________________________________________________________________________________________________
203cdf0e10cSrcweir 		@short
204cdf0e10cSrcweir 		@descr
205cdf0e10cSrcweir 
206cdf0e10cSrcweir 		@seealso
207cdf0e10cSrcweir 
208cdf0e10cSrcweir 		@param
209cdf0e10cSrcweir 
210cdf0e10cSrcweir 		@return
211cdf0e10cSrcweir 
212cdf0e10cSrcweir 		@onerror
213cdf0e10cSrcweir 	*/
214cdf0e10cSrcweir 
215cdf0e10cSrcweir     virtual void SAL_CALL advise( const UNO3_REFERENCE< UNO3_XINTERFACE >& xListener ) throw(	UNO3_LISTENEREXISTEXCEPTION		,
216cdf0e10cSrcweir 																								UNO3_INVALIDLISTENEREXCEPTION	,
217cdf0e10cSrcweir 																								UNO3_RUNTIMEEXCEPTION			);
218cdf0e10cSrcweir 
219cdf0e10cSrcweir 	/**_________________________________________________________________________________________________________
220cdf0e10cSrcweir 		@short
221cdf0e10cSrcweir 		@descr
222cdf0e10cSrcweir 
223cdf0e10cSrcweir 		@seealso
224cdf0e10cSrcweir 
225cdf0e10cSrcweir 		@param
226cdf0e10cSrcweir 
227cdf0e10cSrcweir 		@return
228cdf0e10cSrcweir 
229cdf0e10cSrcweir 		@onerror
230cdf0e10cSrcweir 	*/
231cdf0e10cSrcweir 
232cdf0e10cSrcweir     virtual void SAL_CALL unadvise( const UNO3_REFERENCE< UNO3_XINTERFACE >& xListener ) throw( UNO3_RUNTIMEEXCEPTION );
233cdf0e10cSrcweir 
234cdf0e10cSrcweir 	/**_________________________________________________________________________________________________________
235cdf0e10cSrcweir 		@short
236cdf0e10cSrcweir 		@descr
237cdf0e10cSrcweir 
238cdf0e10cSrcweir 		@seealso
239cdf0e10cSrcweir 
240cdf0e10cSrcweir 		@param
241cdf0e10cSrcweir 
242cdf0e10cSrcweir 		@return
243cdf0e10cSrcweir 
244cdf0e10cSrcweir 		@onerror
245cdf0e10cSrcweir 	*/
246cdf0e10cSrcweir 
247cdf0e10cSrcweir     virtual UNO3_SEQUENCE< UNO3_REFERENCE< UNO3_XINTERFACE > > SAL_CALL getConnections() throw( UNO3_RUNTIMEEXCEPTION );
248cdf0e10cSrcweir 
249cdf0e10cSrcweir //______________________________________________________________________________________________________________
250cdf0e10cSrcweir //	private methods
251cdf0e10cSrcweir //______________________________________________________________________________________________________________
252cdf0e10cSrcweir 
253cdf0e10cSrcweir private:
254cdf0e10cSrcweir 
255cdf0e10cSrcweir 	/**_________________________________________________________________________________________________________
256cdf0e10cSrcweir 		@short
257cdf0e10cSrcweir 		@descr
258cdf0e10cSrcweir 
259cdf0e10cSrcweir 		@seealso
260cdf0e10cSrcweir 
261cdf0e10cSrcweir 		@param
262cdf0e10cSrcweir 
263cdf0e10cSrcweir 		@return
264cdf0e10cSrcweir 
265cdf0e10cSrcweir 		@onerror
266cdf0e10cSrcweir 	*/
267cdf0e10cSrcweir 
268cdf0e10cSrcweir 	sal_Bool impl_LockContainer();
269cdf0e10cSrcweir 
270cdf0e10cSrcweir 	/**_________________________________________________________________________________________________________
271cdf0e10cSrcweir 		@short
272cdf0e10cSrcweir 		@descr
273cdf0e10cSrcweir 
274cdf0e10cSrcweir 		@seealso
275cdf0e10cSrcweir 
276cdf0e10cSrcweir 		@param
277cdf0e10cSrcweir 
278cdf0e10cSrcweir 		@return
279cdf0e10cSrcweir 
280cdf0e10cSrcweir 		@onerror
281cdf0e10cSrcweir 	*/
282cdf0e10cSrcweir 
283cdf0e10cSrcweir 	void impl_UnlockContainer();
284cdf0e10cSrcweir 
285cdf0e10cSrcweir //______________________________________________________________________________________________________________
286cdf0e10cSrcweir //	private variables
287cdf0e10cSrcweir //______________________________________________________________________________________________________________
288cdf0e10cSrcweir 
289cdf0e10cSrcweir private:
290cdf0e10cSrcweir 
291cdf0e10cSrcweir 	UNO3_MUTEX&												m_aSharedMutex				;
292cdf0e10cSrcweir 	UNO3_WEAKREFERENCE< UNO3_XCONNECTIONPOINTCONTAINER >	m_oContainerWeakReference	;	// Reference to container-class!. Don't use Reference<...>
293cdf0e10cSrcweir 																							// It is a ring-reference => and must be a wekreference!
294cdf0e10cSrcweir 	UNO3_OCONNECTIONPOINTCONTAINERHELPER*					m_pContainerImplementation	;
295cdf0e10cSrcweir 	UNO3_TYPE												m_aInterfaceType			;
296cdf0e10cSrcweir 	UNO3_REFERENCE< UNO3_XINTERFACE >						m_xLock						;
297cdf0e10cSrcweir 
298cdf0e10cSrcweir };	// class OConnectionPointHelper
299cdf0e10cSrcweir 
300cdf0e10cSrcweir }	// namespace unocontrols
301cdf0e10cSrcweir 
302cdf0e10cSrcweir #endif	// #ifndef _OCONNECTIONPOINTHELPER_HXX
303