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