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: forward.hxx,v $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
32 #ifndef AWT_FORWARD_HXX
33 #define AWT_FORWARD_HXX
35 #include <comphelper/uno3.hxx>
37 #define IMPLEMENT_FORWARD_XTYPEPROVIDER1( classname, baseclass ) \
38 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL classname::getTypes( ) throw (::com::sun::star::uno::RuntimeException) \
39 { return baseclass::getTypes(); } \
40 IMPLEMENT_GET_IMPLEMENTATION_ID( classname )
42 #define IMPLEMENT_2_FORWARD_XINTERFACE1( classname, refcountbase1, refcountbase2 ) \
43 void SAL_CALL classname::acquire() throw() { refcountbase1::acquire(); refcountbase2::acquire(); } \
44 void SAL_CALL classname::release() throw() { refcountbase1::release(); refcountbase2::release(); } \
45 ::com::sun::star::uno::Any SAL_CALL classname::queryInterface( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException) \
47 ::com::sun::star::uno::Any aReturn = refcountbase1::queryInterface( _rType ); \
48 if ( !aReturn.hasValue() ) \
50 aReturn = refcountbase2::queryInterface( _rType ); \
55 #define IMPLEMENT_2_FORWARD_XINTERFACE2( classname, refcountbase1, refcountbase2, baseclass3 ) \
56 void SAL_CALL classname::acquire() throw() { refcountbase1::acquire(); refcountbase2::acquire(); } \
57 void SAL_CALL classname::release() throw() { refcountbase1::release(); refcountbase2::release(); } \
58 ::com::sun::star::uno::Any SAL_CALL classname::queryInterface( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException) \
60 ::com::sun::star::uno::Any aReturn = refcountbase1::queryInterface( _rType ); \
61 if ( !aReturn.hasValue() ) \
63 aReturn = refcountbase2::queryInterface( _rType ); \
64 if ( !aReturn.hasValue() ) \
65 aReturn = baseclass3::queryInterface( _rType ); \
70 #if defined (_MSC_VER) && (_MSC_VER <= 1310)
71 // Windows .Net2003 build fix
72 #define W3K_EXPLICIT_CAST(x) static_cast <XWindow2*> (&x)
73 #else // !(defined (_MSC_VER) && (_MSC_VER <= 1310))
74 #define W3K_EXPLICIT_CAST(x) x
75 #endif // !(defined (_MSC_VER) && (_MSC_VER <= 1310))
77 #endif /* AWT_FORWARD_HXX */