UDK 3.2.7 C/C++ API Reference
|
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 00002 /************************************************************************* 00003 * 00004 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 00005 * 00006 * Copyright 2000, 2010 Oracle and/or its affiliates. 00007 * 00008 * OpenOffice.org - a multi-platform office productivity suite 00009 * 00010 * This file is part of OpenOffice.org. 00011 * 00012 * OpenOffice.org is free software: you can redistribute it and/or modify 00013 * it under the terms of the GNU Lesser General Public License version 3 00014 * only, as published by the Free Software Foundation. 00015 * 00016 * OpenOffice.org is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Lesser General Public License version 3 for more details 00020 * (a copy is included in the LICENSE file that accompanied this code). 00021 * 00022 * You should have received a copy of the GNU Lesser General Public License 00023 * version 3 along with OpenOffice.org. If not, see 00024 * <http://www.openoffice.org/license.html> 00025 * for a copy of the LGPLv3 License. 00026 * 00027 ************************************************************************/ 00028 #ifndef _CPPUHELPER_IMPLBASE5_HXX_ 00029 #define _CPPUHELPER_IMPLBASE5_HXX_ 00030 00031 #include <cppuhelper/implbase_ex.hxx> 00032 #include <rtl/instance.hxx> 00033 00034 namespace cppu 00035 { 00037 00038 struct class_data5 00039 { 00040 sal_Int16 m_nTypes; 00041 sal_Bool m_storedTypeRefs; 00042 sal_Bool m_storedId; 00043 sal_Int8 m_id[ 16 ]; 00044 type_entry m_typeEntries[ 5 + 1 ]; 00045 }; 00046 00047 template< typename Ifc1, typename Ifc2, typename Ifc3, typename Ifc4, typename Ifc5, typename Impl > 00048 struct ImplClassData5 00049 { 00050 class_data* operator ()() 00051 { 00052 static class_data5 s_cd = 00053 { 00054 5 +1, sal_False, sal_False, 00055 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 00056 { 00057 { { Ifc1::static_type }, ((sal_IntPtr)(Ifc1 *) (Impl *) 16) - 16 }, 00058 { { Ifc2::static_type }, ((sal_IntPtr)(Ifc2 *) (Impl *) 16) - 16 }, 00059 { { Ifc3::static_type }, ((sal_IntPtr)(Ifc3 *) (Impl *) 16) - 16 }, 00060 { { Ifc4::static_type }, ((sal_IntPtr)(Ifc4 *) (Impl *) 16) - 16 }, 00061 { { Ifc5::static_type }, ((sal_IntPtr)(Ifc5 *) (Impl *) 16) - 16 }, 00062 { { com::sun::star::lang::XTypeProvider::static_type }, ((sal_IntPtr)(com::sun::star::lang::XTypeProvider *) (Impl *) 16) - 16 } 00063 } 00064 }; 00065 return reinterpret_cast< class_data * >(&s_cd); 00066 } 00067 }; 00068 00070 00079 template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 > 00080 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper5 00081 : public com::sun::star::lang::XTypeProvider 00082 , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5 00083 { 00084 struct cd : public rtl::StaticAggregate< class_data, ImplClassData5 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, ImplHelper5<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5> > > {}; 00085 public: 00086 virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00087 { return ImplHelper_query( rType, cd::get(), this ); } 00088 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException) 00089 { return ImplHelper_getTypes( cd::get() ); } 00090 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException) 00091 { return ImplHelper_getImplementationId( cd::get() ); } 00092 00093 #if !defined _MSC_VER // public -> protected changes mangled names there 00094 protected: 00095 #endif 00096 ~ImplHelper5() throw () {} 00097 }; 00106 template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 > 00107 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper5 00108 : public OWeakObject 00109 , public com::sun::star::lang::XTypeProvider 00110 , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5 00111 { 00112 struct cd : public rtl::StaticAggregate< class_data, ImplClassData5 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, WeakImplHelper5<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5> > > {}; 00113 public: 00114 virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00115 { return WeakImplHelper_query( rType, cd::get(), this, (OWeakObject *)this ); } 00116 virtual void SAL_CALL acquire() throw () 00117 { OWeakObject::acquire(); } 00118 virtual void SAL_CALL release() throw () 00119 { OWeakObject::release(); } 00120 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException) 00121 { return WeakImplHelper_getTypes( cd::get() ); } 00122 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException) 00123 { return ImplHelper_getImplementationId( cd::get() ); } 00124 }; 00138 template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 > 00139 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper5 00140 : public OWeakAggObject 00141 , public com::sun::star::lang::XTypeProvider 00142 , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5 00143 { 00144 struct cd : public rtl::StaticAggregate< class_data, ImplClassData5 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, WeakAggImplHelper5<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5> > > {}; 00145 public: 00146 virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00147 { return OWeakAggObject::queryInterface( rType ); } 00148 virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00149 { return WeakAggImplHelper_queryAgg( rType, cd::get(), this, (OWeakAggObject *)this ); } 00150 virtual void SAL_CALL acquire() throw () 00151 { OWeakAggObject::acquire(); } 00152 virtual void SAL_CALL release() throw () 00153 { OWeakAggObject::release(); } 00154 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException) 00155 { return WeakAggImplHelper_getTypes( cd::get() ); } 00156 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException) 00157 { return ImplHelper_getImplementationId( cd::get() ); } 00158 }; 00175 template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 > 00176 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper5 00177 : public BaseClass 00178 , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5 00179 { 00180 struct cd : public rtl::StaticAggregate< class_data, ImplClassData5 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, ImplInheritanceHelper5<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5> > > {}; 00181 protected: 00182 template< typename T1 > 00183 explicit ImplInheritanceHelper5(T1 const & arg1): BaseClass(arg1) {} 00184 template< typename T1, typename T2 > 00185 ImplInheritanceHelper5(T1 const & arg1, T2 const & arg2): 00186 BaseClass(arg1, arg2) {} 00187 template< typename T1, typename T2, typename T3 > 00188 ImplInheritanceHelper5( 00189 T1 const & arg1, T2 const & arg2, T3 const & arg3): 00190 BaseClass(arg1, arg2, arg3) {} 00191 template< typename T1, typename T2, typename T3, typename T4 > 00192 ImplInheritanceHelper5( 00193 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4): 00194 BaseClass(arg1, arg2, arg3, arg4) {} 00195 template< 00196 typename T1, typename T2, typename T3, typename T4, typename T5 > 00197 ImplInheritanceHelper5( 00198 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4, 00199 T5 const & arg5): 00200 BaseClass(arg1, arg2, arg3, arg4, arg5) {} 00201 template< 00202 typename T1, typename T2, typename T3, typename T4, typename T5, 00203 typename T6 > 00204 ImplInheritanceHelper5( 00205 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4, 00206 T5 const & arg5, T6 const & arg6): 00207 BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {} 00208 public: 00209 ImplInheritanceHelper5() {} 00210 virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00211 { 00212 com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) ); 00213 if (aRet.hasValue()) 00214 return aRet; 00215 return BaseClass::queryInterface( rType ); 00216 } 00217 virtual void SAL_CALL acquire() throw () 00218 { BaseClass::acquire(); } 00219 virtual void SAL_CALL release() throw () 00220 { BaseClass::release(); } 00221 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException) 00222 { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); } 00223 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException) 00224 { return ImplHelper_getImplementationId( cd::get() ); } 00225 }; 00243 template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 > 00244 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper5 00245 : public BaseClass 00246 , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5 00247 { 00248 struct cd : public rtl::StaticAggregate< class_data, ImplClassData5 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, AggImplInheritanceHelper5<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5> > > {}; 00249 protected: 00250 template< typename T1 > 00251 explicit AggImplInheritanceHelper5(T1 const & arg1): BaseClass(arg1) {} 00252 template< typename T1, typename T2 > 00253 AggImplInheritanceHelper5(T1 const & arg1, T2 const & arg2): 00254 BaseClass(arg1, arg2) {} 00255 template< typename T1, typename T2, typename T3 > 00256 AggImplInheritanceHelper5( 00257 T1 const & arg1, T2 const & arg2, T3 const & arg3): 00258 BaseClass(arg1, arg2, arg3) {} 00259 template< typename T1, typename T2, typename T3, typename T4 > 00260 AggImplInheritanceHelper5( 00261 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4): 00262 BaseClass(arg1, arg2, arg3, arg4) {} 00263 template< 00264 typename T1, typename T2, typename T3, typename T4, typename T5 > 00265 AggImplInheritanceHelper5( 00266 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4, 00267 T5 const & arg5): 00268 BaseClass(arg1, arg2, arg3, arg4, arg5) {} 00269 template< 00270 typename T1, typename T2, typename T3, typename T4, typename T5, 00271 typename T6 > 00272 AggImplInheritanceHelper5( 00273 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4, 00274 T5 const & arg5, T6 const & arg6): 00275 BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {} 00276 public: 00277 AggImplInheritanceHelper5() {} 00278 virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00279 { return BaseClass::queryInterface( rType ); } 00280 virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00281 { 00282 com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) ); 00283 if (aRet.hasValue()) 00284 return aRet; 00285 return BaseClass::queryAggregation( rType ); 00286 } 00287 virtual void SAL_CALL acquire() throw () 00288 { BaseClass::acquire(); } 00289 virtual void SAL_CALL release() throw () 00290 { BaseClass::release(); } 00291 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException) 00292 { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); } 00293 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException) 00294 { return ImplHelper_getImplementationId( cd::get() ); } 00295 }; 00296 } 00297 00298 #endif 00299 00300 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */