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