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_IMPLBASE8_HXX_ 00029 #define _CPPUHELPER_IMPLBASE8_HXX_ 00030 00031 #include <cppuhelper/implbase_ex.hxx> 00032 #include <rtl/instance.hxx> 00033 00034 namespace cppu 00035 { 00037 00038 struct class_data8 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[ 8 + 1 ]; 00045 }; 00046 00047 template< typename Ifc1, typename Ifc2, typename Ifc3, typename Ifc4, typename Ifc5, typename Ifc6, typename Ifc7, typename Ifc8, typename Impl > 00048 struct ImplClassData8 00049 { 00050 class_data* operator ()() 00051 { 00052 static class_data8 s_cd = 00053 { 00054 8 +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 { { Ifc6::static_type }, ((sal_IntPtr)(Ifc6 *) (Impl *) 16) - 16 }, 00063 { { Ifc7::static_type }, ((sal_IntPtr)(Ifc7 *) (Impl *) 16) - 16 }, 00064 { { Ifc8::static_type }, ((sal_IntPtr)(Ifc8 *) (Impl *) 16) - 16 }, 00065 { { com::sun::star::lang::XTypeProvider::static_type }, ((sal_IntPtr)(com::sun::star::lang::XTypeProvider *) (Impl *) 16) - 16 } 00066 } 00067 }; 00068 return reinterpret_cast< class_data * >(&s_cd); 00069 } 00070 }; 00071 00073 00082 template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 > 00083 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper8 00084 : public com::sun::star::lang::XTypeProvider 00085 , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8 00086 { 00087 struct cd : public rtl::StaticAggregate< class_data, ImplClassData8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, ImplHelper8<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8> > > {}; 00088 public: 00089 virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00090 { return ImplHelper_query( rType, cd::get(), this ); } 00091 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException) 00092 { return ImplHelper_getTypes( cd::get() ); } 00093 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException) 00094 { return ImplHelper_getImplementationId( cd::get() ); } 00095 00096 #if !defined _MSC_VER // public -> protected changes mangled names there 00097 protected: 00098 #endif 00099 ~ImplHelper8() throw () {} 00100 }; 00109 template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 > 00110 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper8 00111 : public OWeakObject 00112 , public com::sun::star::lang::XTypeProvider 00113 , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8 00114 { 00115 struct cd : public rtl::StaticAggregate< class_data, ImplClassData8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, WeakImplHelper8<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8> > > {}; 00116 public: 00117 virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00118 { return WeakImplHelper_query( rType, cd::get(), this, (OWeakObject *)this ); } 00119 virtual void SAL_CALL acquire() throw () 00120 { OWeakObject::acquire(); } 00121 virtual void SAL_CALL release() throw () 00122 { OWeakObject::release(); } 00123 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException) 00124 { return WeakImplHelper_getTypes( cd::get() ); } 00125 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException) 00126 { return ImplHelper_getImplementationId( cd::get() ); } 00127 }; 00141 template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 > 00142 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper8 00143 : public OWeakAggObject 00144 , public com::sun::star::lang::XTypeProvider 00145 , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8 00146 { 00147 struct cd : public rtl::StaticAggregate< class_data, ImplClassData8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, WeakAggImplHelper8<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8> > > {}; 00148 public: 00149 virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00150 { return OWeakAggObject::queryInterface( rType ); } 00151 virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00152 { return WeakAggImplHelper_queryAgg( rType, cd::get(), this, (OWeakAggObject *)this ); } 00153 virtual void SAL_CALL acquire() throw () 00154 { OWeakAggObject::acquire(); } 00155 virtual void SAL_CALL release() throw () 00156 { OWeakAggObject::release(); } 00157 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException) 00158 { return WeakAggImplHelper_getTypes( cd::get() ); } 00159 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException) 00160 { return ImplHelper_getImplementationId( cd::get() ); } 00161 }; 00178 template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 > 00179 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper8 00180 : public BaseClass 00181 , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8 00182 { 00183 struct cd : public rtl::StaticAggregate< class_data, ImplClassData8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, ImplInheritanceHelper8<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8> > > {}; 00184 protected: 00185 template< typename T1 > 00186 explicit ImplInheritanceHelper8(T1 const & arg1): BaseClass(arg1) {} 00187 template< typename T1, typename T2 > 00188 ImplInheritanceHelper8(T1 const & arg1, T2 const & arg2): 00189 BaseClass(arg1, arg2) {} 00190 template< typename T1, typename T2, typename T3 > 00191 ImplInheritanceHelper8( 00192 T1 const & arg1, T2 const & arg2, T3 const & arg3): 00193 BaseClass(arg1, arg2, arg3) {} 00194 template< typename T1, typename T2, typename T3, typename T4 > 00195 ImplInheritanceHelper8( 00196 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4): 00197 BaseClass(arg1, arg2, arg3, arg4) {} 00198 template< 00199 typename T1, typename T2, typename T3, typename T4, typename T5 > 00200 ImplInheritanceHelper8( 00201 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4, 00202 T5 const & arg5): 00203 BaseClass(arg1, arg2, arg3, arg4, arg5) {} 00204 template< 00205 typename T1, typename T2, typename T3, typename T4, typename T5, 00206 typename T6 > 00207 ImplInheritanceHelper8( 00208 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4, 00209 T5 const & arg5, T6 const & arg6): 00210 BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {} 00211 public: 00212 ImplInheritanceHelper8() {} 00213 virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00214 { 00215 com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) ); 00216 if (aRet.hasValue()) 00217 return aRet; 00218 return BaseClass::queryInterface( rType ); 00219 } 00220 virtual void SAL_CALL acquire() throw () 00221 { BaseClass::acquire(); } 00222 virtual void SAL_CALL release() throw () 00223 { BaseClass::release(); } 00224 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException) 00225 { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); } 00226 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException) 00227 { return ImplHelper_getImplementationId( cd::get() ); } 00228 }; 00246 template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 > 00247 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper8 00248 : public BaseClass 00249 , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8 00250 { 00251 struct cd : public rtl::StaticAggregate< class_data, ImplClassData8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, AggImplInheritanceHelper8<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8> > > {}; 00252 protected: 00253 template< typename T1 > 00254 explicit AggImplInheritanceHelper8(T1 const & arg1): BaseClass(arg1) {} 00255 template< typename T1, typename T2 > 00256 AggImplInheritanceHelper8(T1 const & arg1, T2 const & arg2): 00257 BaseClass(arg1, arg2) {} 00258 template< typename T1, typename T2, typename T3 > 00259 AggImplInheritanceHelper8( 00260 T1 const & arg1, T2 const & arg2, T3 const & arg3): 00261 BaseClass(arg1, arg2, arg3) {} 00262 template< typename T1, typename T2, typename T3, typename T4 > 00263 AggImplInheritanceHelper8( 00264 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4): 00265 BaseClass(arg1, arg2, arg3, arg4) {} 00266 template< 00267 typename T1, typename T2, typename T3, typename T4, typename T5 > 00268 AggImplInheritanceHelper8( 00269 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4, 00270 T5 const & arg5): 00271 BaseClass(arg1, arg2, arg3, arg4, arg5) {} 00272 template< 00273 typename T1, typename T2, typename T3, typename T4, typename T5, 00274 typename T6 > 00275 AggImplInheritanceHelper8( 00276 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4, 00277 T5 const & arg5, T6 const & arg6): 00278 BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {} 00279 public: 00280 AggImplInheritanceHelper8() {} 00281 virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00282 { return BaseClass::queryInterface( rType ); } 00283 virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00284 { 00285 com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) ); 00286 if (aRet.hasValue()) 00287 return aRet; 00288 return BaseClass::queryAggregation( rType ); 00289 } 00290 virtual void SAL_CALL acquire() throw () 00291 { BaseClass::acquire(); } 00292 virtual void SAL_CALL release() throw () 00293 { BaseClass::release(); } 00294 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException) 00295 { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); } 00296 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException) 00297 { return ImplHelper_getImplementationId( cd::get() ); } 00298 }; 00299 } 00300 00301 #endif 00302 00303 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */