|
UDK 3.2.7 C/C++ API Reference
|
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 00002 /* 00003 * This file is part of the LibreOffice project. 00004 * 00005 * This Source Code Form is subject to the terms of the Mozilla Public 00006 * License, v. 2.0. If a copy of the MPL was not distributed with this 00007 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 00008 * 00009 * This file incorporates work covered by the following license notice: 00010 * 00011 * Licensed to the Apache Software Foundation (ASF) under one or more 00012 * contributor license agreements. See the NOTICE file distributed 00013 * with this work for additional information regarding copyright 00014 * ownership. The ASF licenses this file to you under the Apache 00015 * License, Version 2.0 (the "License"); you may not use this file 00016 * except in compliance with the License. You may obtain a copy of 00017 * the License at http://www.apache.org/licenses/LICENSE-2.0 . 00018 */ 00019 #ifndef _CPPUHELPER_IMPLBASE4_HXX_ 00020 #define _CPPUHELPER_IMPLBASE4_HXX_ 00021 00022 #include <cppuhelper/implbase_ex.hxx> 00023 #include <rtl/instance.hxx> 00024 00025 namespace cppu 00026 { 00028 00029 struct class_data4 00030 { 00031 sal_Int16 m_nTypes; 00032 sal_Bool m_storedTypeRefs; 00033 sal_Bool m_storedId; 00034 sal_Int8 m_id[ 16 ]; 00035 type_entry m_typeEntries[ 4 + 1 ]; 00036 }; 00037 00038 template< typename Ifc1, typename Ifc2, typename Ifc3, typename Ifc4, typename Impl > 00039 struct ImplClassData4 00040 { 00041 class_data* operator ()() 00042 { 00043 static class_data4 s_cd = 00044 { 00045 4 +1, sal_False, sal_False, 00046 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 00047 { 00048 { { Ifc1::static_type }, ((sal_IntPtr)(Ifc1 *) (Impl *) 16) - 16 }, 00049 { { Ifc2::static_type }, ((sal_IntPtr)(Ifc2 *) (Impl *) 16) - 16 }, 00050 { { Ifc3::static_type }, ((sal_IntPtr)(Ifc3 *) (Impl *) 16) - 16 }, 00051 { { Ifc4::static_type }, ((sal_IntPtr)(Ifc4 *) (Impl *) 16) - 16 }, 00052 { { com::sun::star::lang::XTypeProvider::static_type }, ((sal_IntPtr)(com::sun::star::lang::XTypeProvider *) (Impl *) 16) - 16 } 00053 } 00054 }; 00055 return reinterpret_cast< class_data * >(&s_cd); 00056 } 00057 }; 00058 00060 00069 template< class Ifc1, class Ifc2, class Ifc3, class Ifc4 > 00070 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper4 00071 : public com::sun::star::lang::XTypeProvider 00072 , public Ifc1, public Ifc2, public Ifc3, public Ifc4 00073 { 00074 struct cd : public rtl::StaticAggregate< class_data, ImplClassData4 < Ifc1, Ifc2, Ifc3, Ifc4, ImplHelper4<Ifc1, Ifc2, Ifc3, Ifc4> > > {}; 00075 public: 00076 virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00077 { return ImplHelper_query( rType, cd::get(), this ); } 00078 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException) 00079 { return ImplHelper_getTypes( cd::get() ); } 00080 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException) 00081 { return ImplHelper_getImplementationId( cd::get() ); } 00082 00083 #if !defined _MSC_VER // public -> protected changes mangled names there 00084 protected: 00085 #endif 00086 ~ImplHelper4() throw () {} 00087 }; 00096 template< class Ifc1, class Ifc2, class Ifc3, class Ifc4 > 00097 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper4 00098 : public OWeakObject 00099 , public com::sun::star::lang::XTypeProvider 00100 , public Ifc1, public Ifc2, public Ifc3, public Ifc4 00101 { 00102 struct cd : public rtl::StaticAggregate< class_data, ImplClassData4 < Ifc1, Ifc2, Ifc3, Ifc4, WeakImplHelper4<Ifc1, Ifc2, Ifc3, Ifc4> > > {}; 00103 public: 00104 virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00105 { return WeakImplHelper_query( rType, cd::get(), this, (OWeakObject *)this ); } 00106 virtual void SAL_CALL acquire() throw () 00107 { OWeakObject::acquire(); } 00108 virtual void SAL_CALL release() throw () 00109 { OWeakObject::release(); } 00110 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException) 00111 { return WeakImplHelper_getTypes( cd::get() ); } 00112 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException) 00113 { return ImplHelper_getImplementationId( cd::get() ); } 00114 }; 00128 template< class Ifc1, class Ifc2, class Ifc3, class Ifc4 > 00129 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper4 00130 : public OWeakAggObject 00131 , public com::sun::star::lang::XTypeProvider 00132 , public Ifc1, public Ifc2, public Ifc3, public Ifc4 00133 { 00134 struct cd : public rtl::StaticAggregate< class_data, ImplClassData4 < Ifc1, Ifc2, Ifc3, Ifc4, WeakAggImplHelper4<Ifc1, Ifc2, Ifc3, Ifc4> > > {}; 00135 public: 00136 virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00137 { return OWeakAggObject::queryInterface( rType ); } 00138 virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00139 { return WeakAggImplHelper_queryAgg( rType, cd::get(), this, (OWeakAggObject *)this ); } 00140 virtual void SAL_CALL acquire() throw () 00141 { OWeakAggObject::acquire(); } 00142 virtual void SAL_CALL release() throw () 00143 { OWeakAggObject::release(); } 00144 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException) 00145 { return WeakAggImplHelper_getTypes( cd::get() ); } 00146 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException) 00147 { return ImplHelper_getImplementationId( cd::get() ); } 00148 }; 00165 template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4 > 00166 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper4 00167 : public BaseClass 00168 , public Ifc1, public Ifc2, public Ifc3, public Ifc4 00169 { 00170 struct cd : public rtl::StaticAggregate< class_data, ImplClassData4 < Ifc1, Ifc2, Ifc3, Ifc4, ImplInheritanceHelper4<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4> > > {}; 00171 protected: 00172 template< typename T1 > 00173 explicit ImplInheritanceHelper4(T1 const & arg1): BaseClass(arg1) {} 00174 template< typename T1, typename T2 > 00175 ImplInheritanceHelper4(T1 const & arg1, T2 const & arg2): 00176 BaseClass(arg1, arg2) {} 00177 template< typename T1, typename T2, typename T3 > 00178 ImplInheritanceHelper4( 00179 T1 const & arg1, T2 const & arg2, T3 const & arg3): 00180 BaseClass(arg1, arg2, arg3) {} 00181 template< typename T1, typename T2, typename T3, typename T4 > 00182 ImplInheritanceHelper4( 00183 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4): 00184 BaseClass(arg1, arg2, arg3, arg4) {} 00185 template< 00186 typename T1, typename T2, typename T3, typename T4, typename T5 > 00187 ImplInheritanceHelper4( 00188 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4, 00189 T5 const & arg5): 00190 BaseClass(arg1, arg2, arg3, arg4, arg5) {} 00191 template< 00192 typename T1, typename T2, typename T3, typename T4, typename T5, 00193 typename T6 > 00194 ImplInheritanceHelper4( 00195 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4, 00196 T5 const & arg5, T6 const & arg6): 00197 BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {} 00198 public: 00199 ImplInheritanceHelper4() {} 00200 virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00201 { 00202 com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) ); 00203 if (aRet.hasValue()) 00204 return aRet; 00205 return BaseClass::queryInterface( rType ); 00206 } 00207 virtual void SAL_CALL acquire() throw () 00208 { BaseClass::acquire(); } 00209 virtual void SAL_CALL release() throw () 00210 { BaseClass::release(); } 00211 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException) 00212 { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); } 00213 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException) 00214 { return ImplHelper_getImplementationId( cd::get() ); } 00215 }; 00233 template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4 > 00234 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper4 00235 : public BaseClass 00236 , public Ifc1, public Ifc2, public Ifc3, public Ifc4 00237 { 00238 struct cd : public rtl::StaticAggregate< class_data, ImplClassData4 < Ifc1, Ifc2, Ifc3, Ifc4, AggImplInheritanceHelper4<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4> > > {}; 00239 protected: 00240 template< typename T1 > 00241 explicit AggImplInheritanceHelper4(T1 const & arg1): BaseClass(arg1) {} 00242 template< typename T1, typename T2 > 00243 AggImplInheritanceHelper4(T1 const & arg1, T2 const & arg2): 00244 BaseClass(arg1, arg2) {} 00245 template< typename T1, typename T2, typename T3 > 00246 AggImplInheritanceHelper4( 00247 T1 const & arg1, T2 const & arg2, T3 const & arg3): 00248 BaseClass(arg1, arg2, arg3) {} 00249 template< typename T1, typename T2, typename T3, typename T4 > 00250 AggImplInheritanceHelper4( 00251 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4): 00252 BaseClass(arg1, arg2, arg3, arg4) {} 00253 template< 00254 typename T1, typename T2, typename T3, typename T4, typename T5 > 00255 AggImplInheritanceHelper4( 00256 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4, 00257 T5 const & arg5): 00258 BaseClass(arg1, arg2, arg3, arg4, arg5) {} 00259 template< 00260 typename T1, typename T2, typename T3, typename T4, typename T5, 00261 typename T6 > 00262 AggImplInheritanceHelper4( 00263 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4, 00264 T5 const & arg5, T6 const & arg6): 00265 BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {} 00266 public: 00267 AggImplInheritanceHelper4() {} 00268 virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00269 { return BaseClass::queryInterface( rType ); } 00270 virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException) 00271 { 00272 com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) ); 00273 if (aRet.hasValue()) 00274 return aRet; 00275 return BaseClass::queryAggregation( rType ); 00276 } 00277 virtual void SAL_CALL acquire() throw () 00278 { BaseClass::acquire(); } 00279 virtual void SAL_CALL release() throw () 00280 { BaseClass::release(); } 00281 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException) 00282 { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); } 00283 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException) 00284 { return ImplHelper_getImplementationId( cd::get() ); } 00285 }; 00286 } 00287 00288 #endif 00289 00290 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
1.7.3