Update ooo320-m1
[ooovba.git] / UnoControls / source / inc / OConnectionPointContainerHelper.hxx
blob29ba60704e0042b7175ca60e43b16bb06a2ff618
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: OConnectionPointContainerHelper.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 _OCONNECTIONPOINTCONTAINERHELPER_HXX
32 #define _OCONNECTIONPOINTCONTAINERHELPER_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 //______________________________________________________________________________________________________________
47 //______________________________________________________________________________________________________________
48 // namespaces
49 //______________________________________________________________________________________________________________
51 namespace unocontrols{
53 #define UNO3_ANY ::com::sun::star::uno::Any
54 #define UNO3_SEQUENCE ::com::sun::star::uno::Sequence
55 #define UNO3_TYPE ::com::sun::star::uno::Type
56 #define UNO3_REFERENCE ::com::sun::star::uno::Reference
57 #define UNO3_XCONNECTIONPOINTCONTAINER ::com::sun::star::lang::XConnectionPointContainer
58 #define UNO3_XCONNECTIONPOINT ::com::sun::star::lang::XConnectionPoint
59 #define UNO3_MUTEX ::osl::Mutex
60 #define UNO3_RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException
61 #define UNO3_XINTERFACE ::com::sun::star::uno::XInterface
62 #define UNO3_OMULTITYPEINTERFACECONTAINERHELPER ::cppu::OMultiTypeInterfaceContainerHelper
63 #define UNO3_LISTENEREXISTEXCEPTION ::com::sun::star::lang::ListenerExistException
64 #define UNO3_INVALIDLISTENEREXCEPTION ::com::sun::star::lang::InvalidListenerException
65 #define UNO3_WEAKREFERENCE ::com::sun::star::uno::WeakReference
66 #define UNO3_OWEAKOBJECT ::cppu::OWeakObject
68 //______________________________________________________________________________________________________________
69 // defines
70 //______________________________________________________________________________________________________________
72 //______________________________________________________________________________________________________________
73 // class declaration OConnectionPointContainerHelper
74 //______________________________________________________________________________________________________________
76 class OConnectionPointContainerHelper : public UNO3_XCONNECTIONPOINTCONTAINER
77 , public UNO3_OWEAKOBJECT
80 //______________________________________________________________________________________________________________
81 // public methods
82 //______________________________________________________________________________________________________________
84 public:
86 //__________________________________________________________________________________________________________
87 // construct/destruct
88 //__________________________________________________________________________________________________________
90 /**_________________________________________________________________________________________________________
91 @short
92 @descr
94 @seealso
96 @param
98 @return
100 @onerror
103 OConnectionPointContainerHelper( UNO3_MUTEX& aMutex );
105 /**_________________________________________________________________________________________________________
106 @short
107 @descr
109 @seealso
111 @param
113 @return
115 @onerror
118 virtual ~OConnectionPointContainerHelper();
120 //________________________________________________________________________________________________________
121 // XInterface
122 //________________________________________________________________________________________________________
124 /**_______________________________________________________________________________________________________
125 @short give answer, if interface is supported
126 @descr The interfaces are searched by type.
128 @seealso XInterface
130 @param "rType" is the type of searched interface.
132 @return Any information about found interface
134 @onerror A RuntimeException is thrown.
137 virtual UNO3_ANY SAL_CALL queryInterface( const UNO3_TYPE& aType ) throw( UNO3_RUNTIMEEXCEPTION );
139 /**_______________________________________________________________________________________________________
140 @short increment refcount
141 @descr -
143 @seealso XInterface
144 @seealso release()
146 @param -
148 @return -
150 @onerror A RuntimeException is thrown.
153 virtual void SAL_CALL acquire() throw();
155 /**_______________________________________________________________________________________________________
156 @short decrement refcount
157 @descr -
159 @seealso XInterface
160 @seealso acquire()
162 @param -
164 @return -
166 @onerror A RuntimeException is thrown.
169 virtual void SAL_CALL release() throw();
171 //__________________________________________________________________________________________________________
172 // XConnectionPointContainer
173 //__________________________________________________________________________________________________________
175 /**_________________________________________________________________________________________________________
176 @short
177 @descr
179 @seealso
181 @param
183 @return
185 @onerror
188 virtual UNO3_SEQUENCE< UNO3_TYPE > SAL_CALL getConnectionPointTypes() throw( UNO3_RUNTIMEEXCEPTION );
190 /**_________________________________________________________________________________________________________
191 @short
192 @descr
194 @seealso
196 @param
198 @return
200 @onerror
203 virtual UNO3_REFERENCE< UNO3_XCONNECTIONPOINT > SAL_CALL queryConnectionPoint( const UNO3_TYPE& aType ) throw( UNO3_RUNTIMEEXCEPTION );
205 /**_________________________________________________________________________________________________________
206 @short
207 @descr
209 @seealso
211 @param
213 @return
215 @onerror
218 virtual void SAL_CALL advise( const UNO3_TYPE& aType ,
219 const UNO3_REFERENCE< UNO3_XINTERFACE >& xListener ) throw( UNO3_RUNTIMEEXCEPTION );
221 /**_________________________________________________________________________________________________________
222 @short
223 @descr
225 @seealso
227 @param
229 @return
231 @onerror
234 virtual void SAL_CALL unadvise( const UNO3_TYPE& aType ,
235 const UNO3_REFERENCE< UNO3_XINTERFACE >& xListener ) throw( UNO3_RUNTIMEEXCEPTION );
237 /**_________________________________________________________________________________________________________
238 @short
239 @descr
241 @seealso
243 @param
245 @return
247 @onerror
250 UNO3_OMULTITYPEINTERFACECONTAINERHELPER& impl_getMultiTypeContainer();
252 //______________________________________________________________________________________________________________
253 // private variables
254 //______________________________________________________________________________________________________________
256 private:
258 UNO3_MUTEX& m_aSharedMutex ;
259 UNO3_OMULTITYPEINTERFACECONTAINERHELPER m_aMultiTypeContainer ; // Container to hold listener
261 }; // class OConnectionPointContainerHelper
263 } // namespace unocontrols
265 #endif // #ifndef _OCONNECTIONPOINTCONTAINERHELPER_HXX