1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: OConnectionPointContainerHelper.hxx,v $
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 //______________________________________________________________________________________________________________
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 //______________________________________________________________________________________________________________
70 //______________________________________________________________________________________________________________
72 //______________________________________________________________________________________________________________
73 // class declaration OConnectionPointContainerHelper
74 //______________________________________________________________________________________________________________
76 class OConnectionPointContainerHelper
: public UNO3_XCONNECTIONPOINTCONTAINER
77 , public UNO3_OWEAKOBJECT
80 //______________________________________________________________________________________________________________
82 //______________________________________________________________________________________________________________
86 //__________________________________________________________________________________________________________
88 //__________________________________________________________________________________________________________
90 /**_________________________________________________________________________________________________________
103 OConnectionPointContainerHelper( UNO3_MUTEX
& aMutex
);
105 /**_________________________________________________________________________________________________________
118 virtual ~OConnectionPointContainerHelper();
120 //________________________________________________________________________________________________________
122 //________________________________________________________________________________________________________
124 /**_______________________________________________________________________________________________________
125 @short give answer, if interface is supported
126 @descr The interfaces are searched by type.
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
150 @onerror A RuntimeException is thrown.
153 virtual void SAL_CALL
acquire() throw();
155 /**_______________________________________________________________________________________________________
156 @short decrement refcount
166 @onerror A RuntimeException is thrown.
169 virtual void SAL_CALL
release() throw();
171 //__________________________________________________________________________________________________________
172 // XConnectionPointContainer
173 //__________________________________________________________________________________________________________
175 /**_________________________________________________________________________________________________________
188 virtual UNO3_SEQUENCE
< UNO3_TYPE
> SAL_CALL
getConnectionPointTypes() throw( UNO3_RUNTIMEEXCEPTION
);
190 /**_________________________________________________________________________________________________________
203 virtual UNO3_REFERENCE
< UNO3_XCONNECTIONPOINT
> SAL_CALL
queryConnectionPoint( const UNO3_TYPE
& aType
) throw( UNO3_RUNTIMEEXCEPTION
);
205 /**_________________________________________________________________________________________________________
218 virtual void SAL_CALL
advise( const UNO3_TYPE
& aType
,
219 const UNO3_REFERENCE
< UNO3_XINTERFACE
>& xListener
) throw( UNO3_RUNTIMEEXCEPTION
);
221 /**_________________________________________________________________________________________________________
234 virtual void SAL_CALL
unadvise( const UNO3_TYPE
& aType
,
235 const UNO3_REFERENCE
< UNO3_XINTERFACE
>& xListener
) throw( UNO3_RUNTIMEEXCEPTION
);
237 /**_________________________________________________________________________________________________________
250 UNO3_OMULTITYPEINTERFACECONTAINERHELPER
& impl_getMultiTypeContainer();
252 //______________________________________________________________________________________________________________
254 //______________________________________________________________________________________________________________
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