1*6da5f311SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*6da5f311SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*6da5f311SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*6da5f311SAndrew Rist * distributed with this work for additional information 6*6da5f311SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*6da5f311SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*6da5f311SAndrew Rist * "License"); you may not use this file except in compliance 9*6da5f311SAndrew Rist * with the License. You may obtain a copy of the License at 10*6da5f311SAndrew Rist * 11*6da5f311SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*6da5f311SAndrew Rist * 13*6da5f311SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*6da5f311SAndrew Rist * software distributed under the License is distributed on an 15*6da5f311SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*6da5f311SAndrew Rist * KIND, either express or implied. See the License for the 17*6da5f311SAndrew Rist * specific language governing permissions and limitations 18*6da5f311SAndrew Rist * under the License. 19*6da5f311SAndrew Rist * 20*6da5f311SAndrew Rist *************************************************************/ 21*6da5f311SAndrew Rist 22*6da5f311SAndrew Rist 23cdf0e10cSrcweir #ifndef _CPPUHELPER_COMPBASE6_HXX_ 24cdf0e10cSrcweir #define _CPPUHELPER_COMPBASE6_HXX_ 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include <cppuhelper/implbase6.hxx> 27cdf0e10cSrcweir #include <cppuhelper/compbase_ex.hxx> 28cdf0e10cSrcweir /* 29cdf0e10cSrcweir __DEF_COMPIMPLHELPER_EX( 6 ) 30cdf0e10cSrcweir */ 31cdf0e10cSrcweir 32cdf0e10cSrcweir namespace cppu 33cdf0e10cSrcweir { 34cdf0e10cSrcweir 35cdf0e10cSrcweir // Suppress warnings about hidden functions in case any of the IfcN has 36cdf0e10cSrcweir // functions named dispose, addEventListener, or removeEventListener: 37cdf0e10cSrcweir #if defined __SUNPRO_CC 38cdf0e10cSrcweir #pragma disable_warn 39cdf0e10cSrcweir #endif 40cdf0e10cSrcweir 41cdf0e10cSrcweir /** Implementation helper supporting ::com::sun::star::lang::XTypeProvider and 42cdf0e10cSrcweir ::com::sun::star::lang::XComponent. 43cdf0e10cSrcweir 44cdf0e10cSrcweir Upon disposing objects of this class, sub-classes receive a disposing() 45cdf0e10cSrcweir call. Objects of this class can be held weakly, i.e. by a 46cdf0e10cSrcweir ::com::sun::star::uno::WeakReference. 47cdf0e10cSrcweir 48cdf0e10cSrcweir @attention 49cdf0e10cSrcweir The life-cycle of the passed mutex reference has to be longer than objects of this class. 50cdf0e10cSrcweir 51cdf0e10cSrcweir @derive 52cdf0e10cSrcweir Inherit from this class giving your interface(s) to be implemented as template argument(s). 53cdf0e10cSrcweir Your sub class defines method implementations for these interface(s). 54cdf0e10cSrcweir */ 55cdf0e10cSrcweir template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 > 56cdf0e10cSrcweir class SAL_NO_VTABLE WeakComponentImplHelper6 57cdf0e10cSrcweir : public WeakComponentImplHelperBase 58cdf0e10cSrcweir , public ::com::sun::star::lang::XTypeProvider 59cdf0e10cSrcweir , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6 60cdf0e10cSrcweir { 61cdf0e10cSrcweir /** @internal */ 62cdf0e10cSrcweir struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, WeakComponentImplHelper6<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {}; 63cdf0e10cSrcweir public: WeakComponentImplHelper6(::osl::Mutex & rMutex)64cdf0e10cSrcweir inline WeakComponentImplHelper6( ::osl::Mutex & rMutex ) throw () 65cdf0e10cSrcweir : WeakComponentImplHelperBase( rMutex ) 66cdf0e10cSrcweir {} queryInterface(::com::sun::star::uno::Type const & rType)67cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) 68cdf0e10cSrcweir { return WeakComponentImplHelper_query( rType, cd::get(), this, (WeakComponentImplHelperBase *)this ); } acquire()69cdf0e10cSrcweir virtual void SAL_CALL acquire() throw () 70cdf0e10cSrcweir { WeakComponentImplHelperBase::acquire(); } release()71cdf0e10cSrcweir virtual void SAL_CALL release() throw () 72cdf0e10cSrcweir { WeakComponentImplHelperBase::release(); } dispose()73cdf0e10cSrcweir virtual void SAL_CALL dispose()throw (::com::sun::star::uno::RuntimeException) 74cdf0e10cSrcweir { WeakComponentImplHelperBase::dispose(); } addEventListener(const::com::sun::star::uno::Reference<::com::sun::star::lang::XEventListener> & xListener)75cdf0e10cSrcweir virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener)throw (::com::sun::star::uno::RuntimeException) 76cdf0e10cSrcweir { WeakComponentImplHelperBase::addEventListener(xListener); } removeEventListener(const::com::sun::star::uno::Reference<::com::sun::star::lang::XEventListener> & xListener)77cdf0e10cSrcweir virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener)throw (::com::sun::star::uno::RuntimeException) 78cdf0e10cSrcweir { WeakComponentImplHelperBase::removeEventListener(xListener); } getTypes()79cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) 80cdf0e10cSrcweir { return WeakComponentImplHelper_getTypes( cd::get() ); } getImplementationId()81cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) 82cdf0e10cSrcweir { return ImplHelper_getImplementationId( cd::get() ); } 83cdf0e10cSrcweir }; 84cdf0e10cSrcweir 85cdf0e10cSrcweir #if defined __SUNPRO_CC 86cdf0e10cSrcweir #pragma enable_warn 87cdf0e10cSrcweir #endif 88cdf0e10cSrcweir 89cdf0e10cSrcweir /** Implementation helper supporting ::com::sun::star::lang::XTypeProvider and 90cdf0e10cSrcweir ::com::sun::star::lang::XComponent. 91cdf0e10cSrcweir 92cdf0e10cSrcweir Upon disposing objects of this class, sub-classes receive a disposing() 93cdf0e10cSrcweir call. Objects of this class can be held weakly, i.e. by a 94cdf0e10cSrcweir ::com::sun::star::uno::WeakReference. Object of this class can be 95cdf0e10cSrcweir aggregated, i.e. incoming queryInterface() calls are delegated. 96cdf0e10cSrcweir 97cdf0e10cSrcweir @attention 98cdf0e10cSrcweir The life-cycle of the passed mutex reference has to be longer than objects of this class. 99cdf0e10cSrcweir 100cdf0e10cSrcweir @derive 101cdf0e10cSrcweir Inherit from this class giving your interface(s) to be implemented as template argument(s). 102cdf0e10cSrcweir Your sub class defines method implementations for these interface(s). 103cdf0e10cSrcweir 104cdf0e10cSrcweir @deprecated 105cdf0e10cSrcweir */ 106cdf0e10cSrcweir template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 > 107cdf0e10cSrcweir class SAL_NO_VTABLE WeakAggComponentImplHelper6 108cdf0e10cSrcweir : public WeakAggComponentImplHelperBase 109cdf0e10cSrcweir , public ::com::sun::star::lang::XTypeProvider 110cdf0e10cSrcweir , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6 111cdf0e10cSrcweir { 112cdf0e10cSrcweir /** @internal */ 113cdf0e10cSrcweir struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, WeakAggComponentImplHelper6<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {}; 114cdf0e10cSrcweir public: WeakAggComponentImplHelper6(::osl::Mutex & rMutex)115cdf0e10cSrcweir inline WeakAggComponentImplHelper6( ::osl::Mutex & rMutex ) throw () 116cdf0e10cSrcweir : WeakAggComponentImplHelperBase( rMutex ) 117cdf0e10cSrcweir {} queryInterface(::com::sun::star::uno::Type const & rType)118cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) 119cdf0e10cSrcweir { return WeakAggComponentImplHelperBase::queryInterface( rType ); } queryAggregation(::com::sun::star::uno::Type const & rType)120cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) 121cdf0e10cSrcweir { return WeakAggComponentImplHelper_queryAgg( rType, cd::get(), this, (WeakAggComponentImplHelperBase *)this ); } acquire()122cdf0e10cSrcweir virtual void SAL_CALL acquire() throw () 123cdf0e10cSrcweir { WeakAggComponentImplHelperBase::acquire(); } release()124cdf0e10cSrcweir virtual void SAL_CALL release() throw () 125cdf0e10cSrcweir { WeakAggComponentImplHelperBase::release(); } getTypes()126cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) 127cdf0e10cSrcweir { return WeakAggComponentImplHelper_getTypes( cd::get() ); } getImplementationId()128cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) 129cdf0e10cSrcweir { return ImplHelper_getImplementationId( cd::get() ); } 130cdf0e10cSrcweir }; 131cdf0e10cSrcweir } 132cdf0e10cSrcweir 133cdf0e10cSrcweir #endif 134