1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir #ifndef _CPPUHELPER_COMPBASE8_HXX_ 28*cdf0e10cSrcweir #define _CPPUHELPER_COMPBASE8_HXX_ 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir #include <cppuhelper/implbase8.hxx> 31*cdf0e10cSrcweir #include <cppuhelper/compbase_ex.hxx> 32*cdf0e10cSrcweir /* 33*cdf0e10cSrcweir __DEF_COMPIMPLHELPER_EX( 8 ) 34*cdf0e10cSrcweir */ 35*cdf0e10cSrcweir 36*cdf0e10cSrcweir namespace cppu 37*cdf0e10cSrcweir { 38*cdf0e10cSrcweir 39*cdf0e10cSrcweir // Suppress warnings about hidden functions in case any of the IfcN has 40*cdf0e10cSrcweir // functions named dispose, addEventListener, or removeEventListener: 41*cdf0e10cSrcweir #if defined __SUNPRO_CC 42*cdf0e10cSrcweir #pragma disable_warn 43*cdf0e10cSrcweir #endif 44*cdf0e10cSrcweir 45*cdf0e10cSrcweir /** Implementation helper supporting ::com::sun::star::lang::XTypeProvider and 46*cdf0e10cSrcweir ::com::sun::star::lang::XComponent. 47*cdf0e10cSrcweir 48*cdf0e10cSrcweir Upon disposing objects of this class, sub-classes receive a disposing() 49*cdf0e10cSrcweir call. Objects of this class can be held weakly, i.e. by a 50*cdf0e10cSrcweir ::com::sun::star::uno::WeakReference. 51*cdf0e10cSrcweir 52*cdf0e10cSrcweir @attention 53*cdf0e10cSrcweir The life-cycle of the passed mutex reference has to be longer than objects of this class. 54*cdf0e10cSrcweir 55*cdf0e10cSrcweir @derive 56*cdf0e10cSrcweir Inherit from this class giving your interface(s) to be implemented as template argument(s). 57*cdf0e10cSrcweir Your sub class defines method implementations for these interface(s). 58*cdf0e10cSrcweir */ 59*cdf0e10cSrcweir template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 > 60*cdf0e10cSrcweir class SAL_NO_VTABLE WeakComponentImplHelper8 61*cdf0e10cSrcweir : public WeakComponentImplHelperBase 62*cdf0e10cSrcweir , public ::com::sun::star::lang::XTypeProvider 63*cdf0e10cSrcweir , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8 64*cdf0e10cSrcweir { 65*cdf0e10cSrcweir /** @internal */ 66*cdf0e10cSrcweir struct cd : public rtl::StaticAggregate< class_data, ImplClassData8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, WeakComponentImplHelper8<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8> > > {}; 67*cdf0e10cSrcweir public: 68*cdf0e10cSrcweir inline WeakComponentImplHelper8( ::osl::Mutex & rMutex ) throw () 69*cdf0e10cSrcweir : WeakComponentImplHelperBase( rMutex ) 70*cdf0e10cSrcweir {} 71*cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) 72*cdf0e10cSrcweir { return WeakComponentImplHelper_query( rType, cd::get(), this, (WeakComponentImplHelperBase *)this ); } 73*cdf0e10cSrcweir virtual void SAL_CALL acquire() throw () 74*cdf0e10cSrcweir { WeakComponentImplHelperBase::acquire(); } 75*cdf0e10cSrcweir virtual void SAL_CALL release() throw () 76*cdf0e10cSrcweir { WeakComponentImplHelperBase::release(); } 77*cdf0e10cSrcweir virtual void SAL_CALL dispose()throw (::com::sun::star::uno::RuntimeException) 78*cdf0e10cSrcweir { WeakComponentImplHelperBase::dispose(); } 79*cdf0e10cSrcweir virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener)throw (::com::sun::star::uno::RuntimeException) 80*cdf0e10cSrcweir { WeakComponentImplHelperBase::addEventListener(xListener); } 81*cdf0e10cSrcweir virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener)throw (::com::sun::star::uno::RuntimeException) 82*cdf0e10cSrcweir { WeakComponentImplHelperBase::removeEventListener(xListener); } 83*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) 84*cdf0e10cSrcweir { return WeakComponentImplHelper_getTypes( cd::get() ); } 85*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) 86*cdf0e10cSrcweir { return ImplHelper_getImplementationId( cd::get() ); } 87*cdf0e10cSrcweir }; 88*cdf0e10cSrcweir 89*cdf0e10cSrcweir #if defined __SUNPRO_CC 90*cdf0e10cSrcweir #pragma enable_warn 91*cdf0e10cSrcweir #endif 92*cdf0e10cSrcweir 93*cdf0e10cSrcweir /** Implementation helper supporting ::com::sun::star::lang::XTypeProvider and 94*cdf0e10cSrcweir ::com::sun::star::lang::XComponent. 95*cdf0e10cSrcweir 96*cdf0e10cSrcweir Upon disposing objects of this class, sub-classes receive a disposing() 97*cdf0e10cSrcweir call. Objects of this class can be held weakly, i.e. by a 98*cdf0e10cSrcweir ::com::sun::star::uno::WeakReference. Object of this class can be 99*cdf0e10cSrcweir aggregated, i.e. incoming queryInterface() calls are delegated. 100*cdf0e10cSrcweir 101*cdf0e10cSrcweir @attention 102*cdf0e10cSrcweir The life-cycle of the passed mutex reference has to be longer than objects of this class. 103*cdf0e10cSrcweir 104*cdf0e10cSrcweir @derive 105*cdf0e10cSrcweir Inherit from this class giving your interface(s) to be implemented as template argument(s). 106*cdf0e10cSrcweir Your sub class defines method implementations for these interface(s). 107*cdf0e10cSrcweir 108*cdf0e10cSrcweir @deprecated 109*cdf0e10cSrcweir */ 110*cdf0e10cSrcweir template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 > 111*cdf0e10cSrcweir class SAL_NO_VTABLE WeakAggComponentImplHelper8 112*cdf0e10cSrcweir : public WeakAggComponentImplHelperBase 113*cdf0e10cSrcweir , public ::com::sun::star::lang::XTypeProvider 114*cdf0e10cSrcweir , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8 115*cdf0e10cSrcweir { 116*cdf0e10cSrcweir /** @internal */ 117*cdf0e10cSrcweir struct cd : public rtl::StaticAggregate< class_data, ImplClassData8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, WeakAggComponentImplHelper8<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8> > > {}; 118*cdf0e10cSrcweir public: 119*cdf0e10cSrcweir inline WeakAggComponentImplHelper8( ::osl::Mutex & rMutex ) throw () 120*cdf0e10cSrcweir : WeakAggComponentImplHelperBase( rMutex ) 121*cdf0e10cSrcweir {} 122*cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) 123*cdf0e10cSrcweir { return WeakAggComponentImplHelperBase::queryInterface( rType ); } 124*cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) 125*cdf0e10cSrcweir { return WeakAggComponentImplHelper_queryAgg( rType, cd::get(), this, (WeakAggComponentImplHelperBase *)this ); } 126*cdf0e10cSrcweir virtual void SAL_CALL acquire() throw () 127*cdf0e10cSrcweir { WeakAggComponentImplHelperBase::acquire(); } 128*cdf0e10cSrcweir virtual void SAL_CALL release() throw () 129*cdf0e10cSrcweir { WeakAggComponentImplHelperBase::release(); } 130*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) 131*cdf0e10cSrcweir { return WeakAggComponentImplHelper_getTypes( cd::get() ); } 132*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) 133*cdf0e10cSrcweir { return ImplHelper_getImplementationId( cd::get() ); } 134*cdf0e10cSrcweir }; 135*cdf0e10cSrcweir } 136*cdf0e10cSrcweir 137*cdf0e10cSrcweir #endif 138