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_IMPLBASE3_HXX_ 00029 #define _CPPUHELPER_IMPLBASE3_HXX_ 00030 00031 #include <cppuhelper/implbase_ex.hxx> 00032 #include <rtl/instance.hxx> 00033 00034 namespace cppu 00035 { 00037 00038 struct class_data3 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[ 3 + 1 ]; 00045 }; 00046 00047 template< typename Ifc1, typename Ifc2, typename Ifc3, typename Impl > struct ImplClassData3 00048 { 00049 class_data* operator ()() 00050 { 00051 static class_data3 s_cd = 00052 { 00053 3 +1, sal_False, sal_False, 00054 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 00055 { 00056 { { Ifc1::static_type }, ((sal_IntPtr)(Ifc1 *) (Impl *) 16) - 16 }, 00057 { { Ifc2::static_type }, ((sal_IntPtr)(Ifc2 *) (Impl *) 16) - 16 }, 00058 { { Ifc3::static_type }, ((sal_IntPtr)(Ifc3 *) (Impl *) 16) - 16 }, 00059 { { com::sun::star::lang::XTypeProvider::static_type }, ((sal_IntPtr)(com::sun::star::lang::XTypeProvider *) (Impl *) 16) - 16 } 00060 } 00061 }; 00062 return reinterpret_cast< class_data * >(&s_cd); 00063 } 00064 }; 00065 00067 00076 template< class Ifc1, class Ifc2, class Ifc3 > 00077 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper3 00078 : public com::sun::star::lang::XTypeProvider 00079 , public Ifc1, public Ifc2, public Ifc3 00080 { 00081 struct cd : public rtl::StaticAggregate< class_data, ImplClassData3 < Ifc1, Ifc2, Ifc3, ImplHelper3<Ifc1, Ifc2, Ifc3> > > {}; 00082 public: 00083 virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00084 { return ImplHelper_query( rType, cd::get(), this ); } 00085 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException) 00086 { return ImplHelper_getTypes( cd::get() ); } 00087 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException) 00088 { return ImplHelper_getImplementationId( cd::get() ); } 00089 00090 #if !defined _MSC_VER // public -> protected changes mangled names there 00091 protected: 00092 #endif 00093 ~ImplHelper3() throw () {} 00094 }; 00103 template< class Ifc1, class Ifc2, class Ifc3 > 00104 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper3 00105 : public OWeakObject 00106 , public com::sun::star::lang::XTypeProvider 00107 , public Ifc1, public Ifc2, public Ifc3 00108 { 00109 struct cd : public rtl::StaticAggregate< class_data, ImplClassData3 < Ifc1, Ifc2, Ifc3, WeakImplHelper3<Ifc1, Ifc2, Ifc3> > > {}; 00110 public: 00111 virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00112 { return WeakImplHelper_query( rType, cd::get(), this, (OWeakObject *)this ); } 00113 virtual void SAL_CALL acquire() throw () 00114 { OWeakObject::acquire(); } 00115 virtual void SAL_CALL release() throw () 00116 { OWeakObject::release(); } 00117 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException) 00118 { return WeakImplHelper_getTypes( cd::get() ); } 00119 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException) 00120 { return ImplHelper_getImplementationId( cd::get() ); } 00121 }; 00135 template< class Ifc1, class Ifc2, class Ifc3 > 00136 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper3 00137 : public OWeakAggObject 00138 , public com::sun::star::lang::XTypeProvider 00139 , public Ifc1, public Ifc2, public Ifc3 00140 { 00141 struct cd : public rtl::StaticAggregate< class_data, ImplClassData3 < Ifc1, Ifc2, Ifc3, WeakAggImplHelper3<Ifc1, Ifc2, Ifc3> > > {}; 00142 public: 00143 virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00144 { return OWeakAggObject::queryInterface( rType ); } 00145 virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00146 { return WeakAggImplHelper_queryAgg( rType, cd::get(), this, (OWeakAggObject *)this ); } 00147 virtual void SAL_CALL acquire() throw () 00148 { OWeakAggObject::acquire(); } 00149 virtual void SAL_CALL release() throw () 00150 { OWeakAggObject::release(); } 00151 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException) 00152 { return WeakAggImplHelper_getTypes( cd::get() ); } 00153 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException) 00154 { return ImplHelper_getImplementationId( cd::get() ); } 00155 }; 00173 template< class BaseClass, class Ifc1, class Ifc2, class Ifc3 > 00174 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper3 00175 : public BaseClass 00176 , public Ifc1, public Ifc2, public Ifc3 00177 { 00178 struct cd : public rtl::StaticAggregate< class_data, ImplClassData3 < Ifc1, Ifc2, Ifc3, ImplInheritanceHelper3<BaseClass, Ifc1, Ifc2, Ifc3> > > {}; 00179 protected: 00180 template< typename T1 > 00181 explicit ImplInheritanceHelper3(T1 const & arg1): BaseClass(arg1) {} 00182 template< typename T1, typename T2 > 00183 ImplInheritanceHelper3(T1 const & arg1, T2 const & arg2): 00184 BaseClass(arg1, arg2) {} 00185 template< typename T1, typename T2, typename T3 > 00186 ImplInheritanceHelper3( 00187 T1 const & arg1, T2 const & arg2, T3 const & arg3): 00188 BaseClass(arg1, arg2, arg3) {} 00189 template< typename T1, typename T2, typename T3, typename T4 > 00190 ImplInheritanceHelper3( 00191 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4): 00192 BaseClass(arg1, arg2, arg3, arg4) {} 00193 template< 00194 typename T1, typename T2, typename T3, typename T4, typename T5 > 00195 ImplInheritanceHelper3( 00196 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4, 00197 T5 const & arg5): 00198 BaseClass(arg1, arg2, arg3, arg4, arg5) {} 00199 template< 00200 typename T1, typename T2, typename T3, typename T4, typename T5, 00201 typename T6 > 00202 ImplInheritanceHelper3( 00203 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4, 00204 T5 const & arg5, T6 const & arg6): 00205 BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {} 00206 public: 00207 ImplInheritanceHelper3() {} 00208 virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00209 { 00210 com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) ); 00211 if (aRet.hasValue()) 00212 return aRet; 00213 return BaseClass::queryInterface( rType ); 00214 } 00215 virtual void SAL_CALL acquire() throw () 00216 { BaseClass::acquire(); } 00217 virtual void SAL_CALL release() throw () 00218 { BaseClass::release(); } 00219 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException) 00220 { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); } 00221 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException) 00222 { return ImplHelper_getImplementationId( cd::get() ); } 00223 }; 00241 template< class BaseClass, class Ifc1, class Ifc2, class Ifc3 > 00242 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper3 00243 : public BaseClass 00244 , public Ifc1, public Ifc2, public Ifc3 00245 { 00246 struct cd : public rtl::StaticAggregate< class_data, ImplClassData3 < Ifc1, Ifc2, Ifc3, AggImplInheritanceHelper3<BaseClass, Ifc1, Ifc2, Ifc3> > > {}; 00247 protected: 00248 template< typename T1 > 00249 explicit AggImplInheritanceHelper3(T1 const & arg1): BaseClass(arg1) {} 00250 template< typename T1, typename T2 > 00251 AggImplInheritanceHelper3(T1 const & arg1, T2 const & arg2): 00252 BaseClass(arg1, arg2) {} 00253 template< typename T1, typename T2, typename T3 > 00254 AggImplInheritanceHelper3( 00255 T1 const & arg1, T2 const & arg2, T3 const & arg3): 00256 BaseClass(arg1, arg2, arg3) {} 00257 template< typename T1, typename T2, typename T3, typename T4 > 00258 AggImplInheritanceHelper3( 00259 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4): 00260 BaseClass(arg1, arg2, arg3, arg4) {} 00261 template< 00262 typename T1, typename T2, typename T3, typename T4, typename T5 > 00263 AggImplInheritanceHelper3( 00264 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4, 00265 T5 const & arg5): 00266 BaseClass(arg1, arg2, arg3, arg4, arg5) {} 00267 template< 00268 typename T1, typename T2, typename T3, typename T4, typename T5, 00269 typename T6 > 00270 AggImplInheritanceHelper3( 00271 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4, 00272 T5 const & arg5, T6 const & arg6): 00273 BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {} 00274 public: 00275 AggImplInheritanceHelper3() {} 00276 virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00277 { return BaseClass::queryInterface( rType ); } 00278 virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00279 { 00280 com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) ); 00281 if (aRet.hasValue()) 00282 return aRet; 00283 return BaseClass::queryAggregation( rType ); 00284 } 00285 virtual void SAL_CALL acquire() throw () 00286 { BaseClass::acquire(); } 00287 virtual void SAL_CALL release() throw () 00288 { BaseClass::release(); } 00289 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException) 00290 { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); } 00291 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException) 00292 { return ImplHelper_getImplementationId( cd::get() ); } 00293 }; 00294 } 00295 00296 #endif 00297 00298 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */