Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _CPPUHELPER_IMPLBASE12_HXX_
29 : : #define _CPPUHELPER_IMPLBASE12_HXX_
30 : :
31 : : #include <cppuhelper/implbase_ex.hxx>
32 : : #include <rtl/instance.hxx>
33 : :
34 : : namespace cppu
35 : : {
36 : : /// @cond INTERNAL
37 : :
38 : : struct class_data12
39 : : {
40 : : sal_Int16 m_nTypes;
41 : : sal_Bool m_storedTypeRefs;
42 : : sal_Bool m_storedId;
43 : : sal_Int8 m_id[ 16 ];
44 : : type_entry m_typeEntries[ 12 + 1 ];
45 : : };
46 : :
47 : : template< typename Ifc1, typename Ifc2, typename Ifc3, typename Ifc4, typename Ifc5, typename Ifc6, typename Ifc7, typename Ifc8, typename Ifc9, typename Ifc10, typename Ifc11, typename Ifc12, typename Impl >
48 : : struct ImplClassData12
49 : : {
50 : 181 : class_data* operator ()()
51 : : {
52 : : static class_data12 s_cd =
53 : : {
54 : : 12 +1, sal_False, sal_False,
55 : : { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
56 : : {
57 : : { { Ifc1::static_type }, ((sal_IntPtr)(Ifc1 *) (Impl *) 16) - 16 },
58 : : { { Ifc2::static_type }, ((sal_IntPtr)(Ifc2 *) (Impl *) 16) - 16 },
59 : : { { Ifc3::static_type }, ((sal_IntPtr)(Ifc3 *) (Impl *) 16) - 16 },
60 : : { { Ifc4::static_type }, ((sal_IntPtr)(Ifc4 *) (Impl *) 16) - 16 },
61 : : { { Ifc5::static_type }, ((sal_IntPtr)(Ifc5 *) (Impl *) 16) - 16 },
62 : : { { Ifc6::static_type }, ((sal_IntPtr)(Ifc6 *) (Impl *) 16) - 16 },
63 : : { { Ifc7::static_type }, ((sal_IntPtr)(Ifc7 *) (Impl *) 16) - 16 },
64 : : { { Ifc8::static_type }, ((sal_IntPtr)(Ifc8 *) (Impl *) 16) - 16 },
65 : : { { Ifc9::static_type }, ((sal_IntPtr)(Ifc9 *) (Impl *) 16) - 16 },
66 : : { { Ifc10::static_type }, ((sal_IntPtr)(Ifc10 *) (Impl *) 16) - 16 },
67 : : { { Ifc11::static_type }, ((sal_IntPtr)(Ifc11 *) (Impl *) 16) - 16 },
68 : : { { Ifc12::static_type }, ((sal_IntPtr)(Ifc12 *) (Impl *) 16) - 16 },
69 : : { { com::sun::star::lang::XTypeProvider::static_type }, ((sal_IntPtr)(com::sun::star::lang::XTypeProvider *) (Impl *) 16) - 16 }
70 : : }
71 : : };
72 : 181 : return reinterpret_cast< class_data * >(&s_cd);
73 : : }
74 : : };
75 : :
76 : : /// @endcond
77 : :
78 : : /** Implementation helper implementing interface com::sun::star::lang::XTypeProvider
79 : : and method XInterface::queryInterface(), but no reference counting.
80 : :
81 : : @derive
82 : : Inherit from this class giving your interface(s) to be implemented as template argument(s).
83 : : Your sub class defines method implementations for these interface(s) including acquire()/
84 : : release() and delegates incoming queryInterface() calls to this base class.
85 : : */
86 : : template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11, class Ifc12 >
87 : 278 : class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper12
88 : : : public com::sun::star::lang::XTypeProvider
89 : : , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10, public Ifc11, public Ifc12
90 : : {
91 : : struct cd : public rtl::StaticAggregate< class_data, ImplClassData12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12, ImplHelper12<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12> > > {};
92 : : public:
93 : 34464 : virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
94 : 34464 : { return ImplHelper_query( rType, cd::get(), this ); }
95 : 0 : virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
96 : 0 : { return ImplHelper_getTypes( cd::get() ); }
97 : 0 : virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
98 : 0 : { return ImplHelper_getImplementationId( cd::get() ); }
99 : :
100 : : #if !defined _MSC_VER // public -> protected changes mangled names there
101 : : protected:
102 : : #endif
103 : 271 : ~ImplHelper12() throw () {}
104 : : };
105 : : /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
106 : : com::sun::star::uno::XInterface which supports weak mechanism to be held weakly
107 : : (supporting com::sun::star::uno::XWeak thru ::cppu::OWeakObject).
108 : :
109 : : @derive
110 : : Inherit from this class giving your interface(s) to be implemented as template argument(s).
111 : : Your sub class defines method implementations for these interface(s).
112 : : */
113 : : template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11, class Ifc12 >
114 [ - + ]: 27760 : class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper12
115 : : : public OWeakObject
116 : : , public com::sun::star::lang::XTypeProvider
117 : : , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10, public Ifc11, public Ifc12
118 : : {
119 : : struct cd : public rtl::StaticAggregate< class_data, ImplClassData12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12, WeakImplHelper12<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12> > > {};
120 : : public:
121 : 29466 : virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
122 : 29466 : { return WeakImplHelper_query( rType, cd::get(), this, (OWeakObject *)this ); }
123 : 119748 : virtual void SAL_CALL acquire() throw ()
124 : 119748 : { OWeakObject::acquire(); }
125 : 119748 : virtual void SAL_CALL release() throw ()
126 : 119748 : { OWeakObject::release(); }
127 : 0 : virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
128 : 0 : { return WeakImplHelper_getTypes( cd::get() ); }
129 : 0 : virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
130 : 0 : { return ImplHelper_getImplementationId( cd::get() ); }
131 : : };
132 : : /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
133 : : com::sun::star::uno::XInterface which supports weak mechanism to be held weakly
134 : : (supporting com::sun::star::uno::XWeak thru ::cppu::OWeakAggObject).
135 : : In addition, it supports also aggregation meaning object of this class can be aggregated
136 : : (com::sun::star::uno::XAggregation thru ::cppu::OWeakAggObject).
137 : : If a delegator is set (this object is aggregated), then incoming queryInterface()
138 : : calls are delegated to the delegator object. If the delegator does not support the
139 : : demanded interface, it calls queryAggregation() on its aggregated objects.
140 : :
141 : : @derive
142 : : Inherit from this class giving your interface(s) to be implemented as template argument(s).
143 : : Your sub class defines method implementations for these interface(s).
144 : : */
145 : : template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11, class Ifc12 >
146 [ - + ]: 310552 : class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper12
147 : : : public OWeakAggObject
148 : : , public com::sun::star::lang::XTypeProvider
149 : : , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10, public Ifc11, public Ifc12
150 : : {
151 : : struct cd : public rtl::StaticAggregate< class_data, ImplClassData12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12, WeakAggImplHelper12<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12> > > {};
152 : : public:
153 : 1289064 : virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
154 : 1289064 : { return OWeakAggObject::queryInterface( rType ); }
155 : 1180060 : virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
156 : 1180060 : { return WeakAggImplHelper_queryAgg( rType, cd::get(), this, (OWeakAggObject *)this ); }
157 : 3501458 : virtual void SAL_CALL acquire() throw ()
158 : 3501458 : { OWeakAggObject::acquire(); }
159 : 3501458 : virtual void SAL_CALL release() throw ()
160 : 3501458 : { OWeakAggObject::release(); }
161 : 0 : virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
162 : 0 : { return WeakAggImplHelper_getTypes( cd::get() ); }
163 : 0 : virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
164 : 0 : { return ImplHelper_getImplementationId( cd::get() ); }
165 : : };
166 : : /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
167 : : com::sun::star::uno::XInterface inherting from a BaseClass.
168 : : All acquire() and release() calls are delegated to the BaseClass. Upon queryInterface(),
169 : : if a demanded interface is not supported by this class directly, the request is
170 : : delegated to the BaseClass.
171 : :
172 : : @attention
173 : : The BaseClass has to be complete in a sense, that com::sun::star::uno::XInterface
174 : : and com::sun::star::lang::XTypeProvider are implemented properly. The
175 : : BaseClass must have at least one ctor that can be called with six or
176 : : fewer arguments, of which none is of non-const reference type.
177 : :
178 : : @derive
179 : : Inherit from this class giving your additional interface(s) to be implemented as
180 : : template argument(s). Your sub class defines method implementations for these interface(s).
181 : : */
182 : : template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11, class Ifc12 >
183 : : class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper12
184 : : : public BaseClass
185 : : , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10, public Ifc11, public Ifc12
186 : : {
187 : : struct cd : public rtl::StaticAggregate< class_data, ImplClassData12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12, ImplInheritanceHelper12<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12> > > {};
188 : : protected:
189 : : template< typename T1 >
190 : : explicit ImplInheritanceHelper12(T1 const & arg1): BaseClass(arg1) {}
191 : : template< typename T1, typename T2 >
192 : : ImplInheritanceHelper12(T1 const & arg1, T2 const & arg2):
193 : : BaseClass(arg1, arg2) {}
194 : : template< typename T1, typename T2, typename T3 >
195 : : ImplInheritanceHelper12(
196 : : T1 const & arg1, T2 const & arg2, T3 const & arg3):
197 : : BaseClass(arg1, arg2, arg3) {}
198 : : template< typename T1, typename T2, typename T3, typename T4 >
199 : : ImplInheritanceHelper12(
200 : : T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
201 : : BaseClass(arg1, arg2, arg3, arg4) {}
202 : : template<
203 : : typename T1, typename T2, typename T3, typename T4, typename T5 >
204 : : ImplInheritanceHelper12(
205 : : T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
206 : : T5 const & arg5):
207 : : BaseClass(arg1, arg2, arg3, arg4, arg5) {}
208 : : template<
209 : : typename T1, typename T2, typename T3, typename T4, typename T5,
210 : : typename T6 >
211 : : ImplInheritanceHelper12(
212 : : T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
213 : : T5 const & arg5, T6 const & arg6):
214 : : BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
215 : : public:
216 : : ImplInheritanceHelper12() {}
217 : : virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
218 : : {
219 : : com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
220 : : if (aRet.hasValue())
221 : : return aRet;
222 : : return BaseClass::queryInterface( rType );
223 : : }
224 : : virtual void SAL_CALL acquire() throw ()
225 : : { BaseClass::acquire(); }
226 : : virtual void SAL_CALL release() throw ()
227 : : { BaseClass::release(); }
228 : : virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
229 : : { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
230 : : virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
231 : : { return ImplHelper_getImplementationId( cd::get() ); }
232 : : };
233 : : /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
234 : : com::sun::star::uno::XInterface inherting from a BaseClass.
235 : : All acquire(), release() and queryInterface() calls are delegated to the BaseClass.
236 : : Upon queryAggregation(), if a demanded interface is not supported by this class directly,
237 : : the request is delegated to the BaseClass.
238 : :
239 : : @attention
240 : : The BaseClass has to be complete in a sense, that com::sun::star::uno::XInterface,
241 : : com::sun::star::uno::XAggregation and com::sun::star::lang::XTypeProvider
242 : : are implemented properly. The BaseClass must have at least one ctor
243 : : that can be called with six or fewer arguments, of which none is of
244 : : non-const reference type.
245 : :
246 : : @derive
247 : : Inherit from this class giving your additional interface(s) to be implemented as
248 : : template argument(s). Your sub class defines method implementations for these interface(s).
249 : : */
250 : : template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11, class Ifc12 >
251 : : class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper12
252 : : : public BaseClass
253 : : , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10, public Ifc11, public Ifc12
254 : : {
255 : : struct cd : public rtl::StaticAggregate< class_data, ImplClassData12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12, AggImplInheritanceHelper12<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12> > > {};
256 : : protected:
257 : : template< typename T1 >
258 : : explicit AggImplInheritanceHelper12(T1 const & arg1): BaseClass(arg1) {}
259 : : template< typename T1, typename T2 >
260 : : AggImplInheritanceHelper12(T1 const & arg1, T2 const & arg2):
261 : : BaseClass(arg1, arg2) {}
262 : : template< typename T1, typename T2, typename T3 >
263 : : AggImplInheritanceHelper12(
264 : : T1 const & arg1, T2 const & arg2, T3 const & arg3):
265 : : BaseClass(arg1, arg2, arg3) {}
266 : : template< typename T1, typename T2, typename T3, typename T4 >
267 : : AggImplInheritanceHelper12(
268 : : T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
269 : : BaseClass(arg1, arg2, arg3, arg4) {}
270 : : template<
271 : : typename T1, typename T2, typename T3, typename T4, typename T5 >
272 : : AggImplInheritanceHelper12(
273 : : T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
274 : : T5 const & arg5):
275 : : BaseClass(arg1, arg2, arg3, arg4, arg5) {}
276 : : template<
277 : : typename T1, typename T2, typename T3, typename T4, typename T5,
278 : : typename T6 >
279 : : AggImplInheritanceHelper12(
280 : : T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
281 : : T5 const & arg5, T6 const & arg6):
282 : : BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
283 : : public:
284 : : AggImplInheritanceHelper12() {}
285 : : virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
286 : : { return BaseClass::queryInterface( rType ); }
287 : : virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
288 : : {
289 : : com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
290 : : if (aRet.hasValue())
291 : : return aRet;
292 : : return BaseClass::queryAggregation( rType );
293 : : }
294 : : virtual void SAL_CALL acquire() throw ()
295 : : { BaseClass::acquire(); }
296 : : virtual void SAL_CALL release() throw ()
297 : : { BaseClass::release(); }
298 : : virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
299 : : { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
300 : : virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
301 : : { return ImplHelper_getImplementationId( cd::get() ); }
302 : : };
303 : : }
304 : :
305 : : #endif
306 : :
307 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|