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 _OCONNECTIONPOINTCONTAINERHELPER_HXX
25cdf0e10cSrcweir #define _OCONNECTIONPOINTCONTAINERHELPER_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 
40cdf0e10cSrcweir //______________________________________________________________________________________________________________
41cdf0e10cSrcweir //	namespaces
42cdf0e10cSrcweir //______________________________________________________________________________________________________________
43cdf0e10cSrcweir 
44cdf0e10cSrcweir namespace unocontrols{
45cdf0e10cSrcweir 
46cdf0e10cSrcweir #define	UNO3_ANY										::com::sun::star::uno::Any
47cdf0e10cSrcweir #define	UNO3_SEQUENCE									::com::sun::star::uno::Sequence
48cdf0e10cSrcweir #define	UNO3_TYPE										::com::sun::star::uno::Type
49cdf0e10cSrcweir #define	UNO3_REFERENCE									::com::sun::star::uno::Reference
50cdf0e10cSrcweir #define	UNO3_XCONNECTIONPOINTCONTAINER					::com::sun::star::lang::XConnectionPointContainer
51cdf0e10cSrcweir #define	UNO3_XCONNECTIONPOINT							::com::sun::star::lang::XConnectionPoint
52cdf0e10cSrcweir #define	UNO3_MUTEX										::osl::Mutex
53cdf0e10cSrcweir #define	UNO3_RUNTIMEEXCEPTION							::com::sun::star::uno::RuntimeException
54cdf0e10cSrcweir #define	UNO3_XINTERFACE									::com::sun::star::uno::XInterface
55cdf0e10cSrcweir #define	UNO3_OMULTITYPEINTERFACECONTAINERHELPER			::cppu::OMultiTypeInterfaceContainerHelper
56cdf0e10cSrcweir #define	UNO3_LISTENEREXISTEXCEPTION						::com::sun::star::lang::ListenerExistException
57cdf0e10cSrcweir #define	UNO3_INVALIDLISTENEREXCEPTION					::com::sun::star::lang::InvalidListenerException
58cdf0e10cSrcweir #define	UNO3_WEAKREFERENCE								::com::sun::star::uno::WeakReference
59cdf0e10cSrcweir #define	UNO3_OWEAKOBJECT								::cppu::OWeakObject
60cdf0e10cSrcweir 
61cdf0e10cSrcweir //______________________________________________________________________________________________________________
62cdf0e10cSrcweir //	defines
63cdf0e10cSrcweir //______________________________________________________________________________________________________________
64cdf0e10cSrcweir 
65cdf0e10cSrcweir //______________________________________________________________________________________________________________
66cdf0e10cSrcweir //	class declaration OConnectionPointContainerHelper
67cdf0e10cSrcweir //______________________________________________________________________________________________________________
68cdf0e10cSrcweir 
69cdf0e10cSrcweir class OConnectionPointContainerHelper	:	public	UNO3_XCONNECTIONPOINTCONTAINER
70cdf0e10cSrcweir 										,	public	UNO3_OWEAKOBJECT
71cdf0e10cSrcweir {
72cdf0e10cSrcweir 
73cdf0e10cSrcweir //______________________________________________________________________________________________________________
74cdf0e10cSrcweir //	public methods
75cdf0e10cSrcweir //______________________________________________________________________________________________________________
76cdf0e10cSrcweir 
77cdf0e10cSrcweir public:
78cdf0e10cSrcweir 
79cdf0e10cSrcweir 	//__________________________________________________________________________________________________________
80cdf0e10cSrcweir 	//	construct/destruct
81cdf0e10cSrcweir 	//__________________________________________________________________________________________________________
82cdf0e10cSrcweir 
83cdf0e10cSrcweir 	/**_________________________________________________________________________________________________________
84cdf0e10cSrcweir 		@short
85cdf0e10cSrcweir 		@descr
86cdf0e10cSrcweir 
87cdf0e10cSrcweir 		@seealso
88cdf0e10cSrcweir 
89cdf0e10cSrcweir 		@param
90cdf0e10cSrcweir 
91cdf0e10cSrcweir 		@return
92cdf0e10cSrcweir 
93cdf0e10cSrcweir 		@onerror
94cdf0e10cSrcweir 	*/
95cdf0e10cSrcweir 
96cdf0e10cSrcweir 	OConnectionPointContainerHelper( UNO3_MUTEX& aMutex );
97cdf0e10cSrcweir 
98cdf0e10cSrcweir 	/**_________________________________________________________________________________________________________
99cdf0e10cSrcweir 		@short
100cdf0e10cSrcweir 		@descr
101cdf0e10cSrcweir 
102cdf0e10cSrcweir 		@seealso
103cdf0e10cSrcweir 
104cdf0e10cSrcweir 		@param
105cdf0e10cSrcweir 
106cdf0e10cSrcweir 		@return
107cdf0e10cSrcweir 
108cdf0e10cSrcweir 		@onerror
109cdf0e10cSrcweir 	*/
110cdf0e10cSrcweir 
111cdf0e10cSrcweir 	virtual	~OConnectionPointContainerHelper();
112cdf0e10cSrcweir 
113cdf0e10cSrcweir 	//________________________________________________________________________________________________________
114cdf0e10cSrcweir 	//	XInterface
115cdf0e10cSrcweir 	//________________________________________________________________________________________________________
116cdf0e10cSrcweir 
117cdf0e10cSrcweir 	/**_______________________________________________________________________________________________________
118cdf0e10cSrcweir 		@short		give answer, if interface is supported
119cdf0e10cSrcweir 		@descr		The interfaces are searched by type.
120cdf0e10cSrcweir 
121cdf0e10cSrcweir 		@seealso	XInterface
122cdf0e10cSrcweir 
123cdf0e10cSrcweir 		@param      "rType" is the type of searched interface.
124cdf0e10cSrcweir 
125cdf0e10cSrcweir 		@return		Any		information about found interface
126cdf0e10cSrcweir 
127cdf0e10cSrcweir 		@onerror	A RuntimeException is thrown.
128cdf0e10cSrcweir 	*/
129cdf0e10cSrcweir 
130cdf0e10cSrcweir 	virtual UNO3_ANY SAL_CALL queryInterface( const UNO3_TYPE& aType ) throw( UNO3_RUNTIMEEXCEPTION );
131cdf0e10cSrcweir 
132cdf0e10cSrcweir 	/**_______________________________________________________________________________________________________
133cdf0e10cSrcweir 		@short		increment refcount
134cdf0e10cSrcweir 		@descr		-
135cdf0e10cSrcweir 
136cdf0e10cSrcweir 		@seealso	XInterface
137cdf0e10cSrcweir 		@seealso	release()
138cdf0e10cSrcweir 
139cdf0e10cSrcweir 		@param		-
140cdf0e10cSrcweir 
141cdf0e10cSrcweir 		@return		-
142cdf0e10cSrcweir 
143cdf0e10cSrcweir 		@onerror	A RuntimeException is thrown.
144cdf0e10cSrcweir 	*/
145cdf0e10cSrcweir 
146cdf0e10cSrcweir     virtual void SAL_CALL acquire() throw();
147cdf0e10cSrcweir 
148cdf0e10cSrcweir 	/**_______________________________________________________________________________________________________
149cdf0e10cSrcweir 		@short		decrement refcount
150cdf0e10cSrcweir 		@descr		-
151cdf0e10cSrcweir 
152cdf0e10cSrcweir 		@seealso	XInterface
153cdf0e10cSrcweir 		@seealso	acquire()
154cdf0e10cSrcweir 
155cdf0e10cSrcweir 		@param		-
156cdf0e10cSrcweir 
157cdf0e10cSrcweir 		@return		-
158cdf0e10cSrcweir 
159cdf0e10cSrcweir 		@onerror	A RuntimeException is thrown.
160cdf0e10cSrcweir 	*/
161cdf0e10cSrcweir 
162cdf0e10cSrcweir     virtual void SAL_CALL release() throw();
163cdf0e10cSrcweir 
164cdf0e10cSrcweir 	//__________________________________________________________________________________________________________
165cdf0e10cSrcweir 	//	XConnectionPointContainer
166cdf0e10cSrcweir 	//__________________________________________________________________________________________________________
167cdf0e10cSrcweir 
168cdf0e10cSrcweir 	/**_________________________________________________________________________________________________________
169cdf0e10cSrcweir 		@short
170cdf0e10cSrcweir 		@descr
171cdf0e10cSrcweir 
172cdf0e10cSrcweir 		@seealso
173cdf0e10cSrcweir 
174cdf0e10cSrcweir 		@param
175cdf0e10cSrcweir 
176cdf0e10cSrcweir 		@return
177cdf0e10cSrcweir 
178cdf0e10cSrcweir 		@onerror
179cdf0e10cSrcweir 	*/
180cdf0e10cSrcweir 
181cdf0e10cSrcweir     virtual UNO3_SEQUENCE< UNO3_TYPE > SAL_CALL getConnectionPointTypes() throw( UNO3_RUNTIMEEXCEPTION );
182cdf0e10cSrcweir 
183cdf0e10cSrcweir 	/**_________________________________________________________________________________________________________
184cdf0e10cSrcweir 		@short
185cdf0e10cSrcweir 		@descr
186cdf0e10cSrcweir 
187cdf0e10cSrcweir 		@seealso
188cdf0e10cSrcweir 
189cdf0e10cSrcweir 		@param
190cdf0e10cSrcweir 
191cdf0e10cSrcweir 		@return
192cdf0e10cSrcweir 
193cdf0e10cSrcweir 		@onerror
194cdf0e10cSrcweir 	*/
195cdf0e10cSrcweir 
196cdf0e10cSrcweir     virtual UNO3_REFERENCE< UNO3_XCONNECTIONPOINT > SAL_CALL queryConnectionPoint( const UNO3_TYPE& aType ) throw( UNO3_RUNTIMEEXCEPTION );
197cdf0e10cSrcweir 
198cdf0e10cSrcweir 	/**_________________________________________________________________________________________________________
199cdf0e10cSrcweir 		@short
200cdf0e10cSrcweir 		@descr
201cdf0e10cSrcweir 
202cdf0e10cSrcweir 		@seealso
203cdf0e10cSrcweir 
204cdf0e10cSrcweir 		@param
205cdf0e10cSrcweir 
206cdf0e10cSrcweir 		@return
207cdf0e10cSrcweir 
208cdf0e10cSrcweir 		@onerror
209cdf0e10cSrcweir 	*/
210cdf0e10cSrcweir 
211cdf0e10cSrcweir     virtual void SAL_CALL advise(	const	UNO3_TYPE&							aType		,
212cdf0e10cSrcweir 									const	UNO3_REFERENCE< UNO3_XINTERFACE >&	xListener	) throw( UNO3_RUNTIMEEXCEPTION );
213cdf0e10cSrcweir 
214cdf0e10cSrcweir 	/**_________________________________________________________________________________________________________
215cdf0e10cSrcweir 		@short
216cdf0e10cSrcweir 		@descr
217cdf0e10cSrcweir 
218cdf0e10cSrcweir 		@seealso
219cdf0e10cSrcweir 
220cdf0e10cSrcweir 		@param
221cdf0e10cSrcweir 
222cdf0e10cSrcweir 		@return
223cdf0e10cSrcweir 
224cdf0e10cSrcweir 		@onerror
225cdf0e10cSrcweir 	*/
226cdf0e10cSrcweir 
227cdf0e10cSrcweir     virtual void SAL_CALL unadvise(	const	UNO3_TYPE&							aType		,
228cdf0e10cSrcweir 									const	UNO3_REFERENCE< UNO3_XINTERFACE >&	xListener	) throw( UNO3_RUNTIMEEXCEPTION );
229cdf0e10cSrcweir 
230cdf0e10cSrcweir 	/**_________________________________________________________________________________________________________
231cdf0e10cSrcweir 		@short
232cdf0e10cSrcweir 		@descr
233cdf0e10cSrcweir 
234cdf0e10cSrcweir 		@seealso
235cdf0e10cSrcweir 
236cdf0e10cSrcweir 		@param
237cdf0e10cSrcweir 
238cdf0e10cSrcweir 		@return
239cdf0e10cSrcweir 
240cdf0e10cSrcweir 		@onerror
241cdf0e10cSrcweir 	*/
242cdf0e10cSrcweir 
243cdf0e10cSrcweir 	UNO3_OMULTITYPEINTERFACECONTAINERHELPER& impl_getMultiTypeContainer();
244cdf0e10cSrcweir 
245cdf0e10cSrcweir //______________________________________________________________________________________________________________
246cdf0e10cSrcweir //	private variables
247cdf0e10cSrcweir //______________________________________________________________________________________________________________
248cdf0e10cSrcweir 
249cdf0e10cSrcweir private:
250cdf0e10cSrcweir 
251cdf0e10cSrcweir 	UNO3_MUTEX&									m_aSharedMutex			;
252cdf0e10cSrcweir 	UNO3_OMULTITYPEINTERFACECONTAINERHELPER		m_aMultiTypeContainer	;	// Container to hold listener
253cdf0e10cSrcweir 
254cdf0e10cSrcweir };	// class OConnectionPointContainerHelper
255cdf0e10cSrcweir 
256cdf0e10cSrcweir }	// namespace unocontrols
257cdf0e10cSrcweir 
258cdf0e10cSrcweir #endif	// #ifndef _OCONNECTIONPOINTCONTAINERHELPER_HXX
259