1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_CPPUHELPER_IMPLBASE11_HXX
20 #define INCLUDED_CPPUHELPER_IMPLBASE11_HXX
22 #include <cppuhelper/implbase_ex.hxx>
23 #include <rtl/instance.hxx>
32 sal_Bool m_storedTypeRefs
;
35 type_entry m_typeEntries
[ 11 + 1 ];
38 template< typename Ifc1
, typename Ifc2
, typename Ifc3
, typename Ifc4
, typename Ifc5
, typename Ifc6
, typename Ifc7
, typename Ifc8
, typename Ifc9
, typename Ifc10
, typename Ifc11
, typename Impl
>
39 struct ImplClassData11
41 class_data
* operator ()()
43 static class_data11 s_cd
=
45 11 +1, sal_False
, sal_False
,
46 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
48 CPPUHELPER_DETAIL_TYPEENTRY(Ifc1
),
49 CPPUHELPER_DETAIL_TYPEENTRY(Ifc2
),
50 CPPUHELPER_DETAIL_TYPEENTRY(Ifc3
),
51 CPPUHELPER_DETAIL_TYPEENTRY(Ifc4
),
52 CPPUHELPER_DETAIL_TYPEENTRY(Ifc5
),
53 CPPUHELPER_DETAIL_TYPEENTRY(Ifc6
),
54 CPPUHELPER_DETAIL_TYPEENTRY(Ifc7
),
55 CPPUHELPER_DETAIL_TYPEENTRY(Ifc8
),
56 CPPUHELPER_DETAIL_TYPEENTRY(Ifc9
),
57 CPPUHELPER_DETAIL_TYPEENTRY(Ifc10
),
58 CPPUHELPER_DETAIL_TYPEENTRY(Ifc11
),
59 CPPUHELPER_DETAIL_TYPEENTRY(com::sun::star::lang::XTypeProvider
)
62 return reinterpret_cast< class_data
* >(&s_cd
);
68 /** Implementation helper implementing interface com::sun::star::lang::XTypeProvider
69 and method XInterface::queryInterface(), but no reference counting.
72 Inherit from this class giving your interface(s) to be implemented as template argument(s).
73 Your sub class defines method implementations for these interface(s) including acquire()/
74 release() and delegates incoming queryInterface() calls to this base class.
76 template< class Ifc1
, class Ifc2
, class Ifc3
, class Ifc4
, class Ifc5
, class Ifc6
, class Ifc7
, class Ifc8
, class Ifc9
, class Ifc10
, class Ifc11
>
77 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper11
78 : public com::sun::star::lang::XTypeProvider
79 , public Ifc1
, public Ifc2
, public Ifc3
, public Ifc4
, public Ifc5
, public Ifc6
, public Ifc7
, public Ifc8
, public Ifc9
, public Ifc10
, public Ifc11
81 struct cd
: public rtl::StaticAggregate
< class_data
, ImplClassData11
< Ifc1
, Ifc2
, Ifc3
, Ifc4
, Ifc5
, Ifc6
, Ifc7
, Ifc8
, Ifc9
, Ifc10
, Ifc11
, ImplHelper11
<Ifc1
, Ifc2
, Ifc3
, Ifc4
, Ifc5
, Ifc6
, Ifc7
, Ifc8
, Ifc9
, Ifc10
, Ifc11
> > > {};
83 virtual com::sun::star::uno::Any SAL_CALL
queryInterface( com::sun::star::uno::Type
const & rType
) throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
84 { return ImplHelper_query( rType
, cd::get(), this ); }
85 virtual com::sun::star::uno::Sequence
< com::sun::star::uno::Type
> SAL_CALL
getTypes() throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
86 { return ImplHelper_getTypes( cd::get() ); }
87 virtual com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
88 { return ImplHelper_getImplementationId( cd::get() ); }
90 #if !defined _MSC_VER // public -> protected changes mangled names there
93 ~ImplHelper11() throw () {}
95 /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
96 com::sun::star::uno::XInterface which supports weak mechanism to be held weakly
97 (supporting com::sun::star::uno::XWeak through ::cppu::OWeakObject).
100 Inherit from this class giving your interface(s) to be implemented as template argument(s).
101 Your sub class defines method implementations for these interface(s).
103 template< class Ifc1
, class Ifc2
, class Ifc3
, class Ifc4
, class Ifc5
, class Ifc6
, class Ifc7
, class Ifc8
, class Ifc9
, class Ifc10
, class Ifc11
>
104 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper11
106 , public com::sun::star::lang::XTypeProvider
107 , public Ifc1
, public Ifc2
, public Ifc3
, public Ifc4
, public Ifc5
, public Ifc6
, public Ifc7
, public Ifc8
, public Ifc9
, public Ifc10
, public Ifc11
109 struct cd
: public rtl::StaticAggregate
< class_data
, ImplClassData11
< Ifc1
, Ifc2
, Ifc3
, Ifc4
, Ifc5
, Ifc6
, Ifc7
, Ifc8
, Ifc9
, Ifc10
, Ifc11
, WeakImplHelper11
<Ifc1
, Ifc2
, Ifc3
, Ifc4
, Ifc5
, Ifc6
, Ifc7
, Ifc8
, Ifc9
, Ifc10
, Ifc11
> > > {};
111 virtual com::sun::star::uno::Any SAL_CALL
queryInterface( com::sun::star::uno::Type
const & rType
) throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
112 { return WeakImplHelper_query( rType
, cd::get(), this, static_cast<OWeakObject
*>(this) ); }
113 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
114 { OWeakObject::acquire(); }
115 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
116 { OWeakObject::release(); }
117 virtual com::sun::star::uno::Sequence
< com::sun::star::uno::Type
> SAL_CALL
getTypes() throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
118 { return WeakImplHelper_getTypes( cd::get() ); }
119 virtual com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
120 { return ImplHelper_getImplementationId( cd::get() ); }
122 /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
123 com::sun::star::uno::XInterface which supports weak mechanism to be held weakly
124 (supporting com::sun::star::uno::XWeak through ::cppu::OWeakAggObject).
125 In addition, it supports also aggregation meaning object of this class can be aggregated
126 (com::sun::star::uno::XAggregation through ::cppu::OWeakAggObject).
127 If a delegator is set (this object is aggregated), then incoming queryInterface()
128 calls are delegated to the delegator object. If the delegator does not support the
129 demanded interface, it calls queryAggregation() on its aggregated objects.
132 Inherit from this class giving your interface(s) to be implemented as template argument(s).
133 Your sub class defines method implementations for these interface(s).
135 template< class Ifc1
, class Ifc2
, class Ifc3
, class Ifc4
, class Ifc5
, class Ifc6
, class Ifc7
, class Ifc8
, class Ifc9
, class Ifc10
, class Ifc11
>
136 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper11
137 : public OWeakAggObject
138 , public com::sun::star::lang::XTypeProvider
139 , public Ifc1
, public Ifc2
, public Ifc3
, public Ifc4
, public Ifc5
, public Ifc6
, public Ifc7
, public Ifc8
, public Ifc9
, public Ifc10
, public Ifc11
141 struct cd
: public rtl::StaticAggregate
< class_data
, ImplClassData11
< Ifc1
, Ifc2
, Ifc3
, Ifc4
, Ifc5
, Ifc6
, Ifc7
, Ifc8
, Ifc9
, Ifc10
, Ifc11
, WeakAggImplHelper11
<Ifc1
, Ifc2
, Ifc3
, Ifc4
, Ifc5
, Ifc6
, Ifc7
, Ifc8
, Ifc9
, Ifc10
, Ifc11
> > > {};
143 virtual com::sun::star::uno::Any SAL_CALL
queryInterface( com::sun::star::uno::Type
const & rType
) throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
144 { return OWeakAggObject::queryInterface( rType
); }
145 virtual com::sun::star::uno::Any SAL_CALL
queryAggregation( com::sun::star::uno::Type
const & rType
) throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
146 { return WeakAggImplHelper_queryAgg( rType
, cd::get(), this, static_cast<OWeakAggObject
*>(this) ); }
147 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
148 { OWeakAggObject::acquire(); }
149 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
150 { OWeakAggObject::release(); }
151 virtual com::sun::star::uno::Sequence
< com::sun::star::uno::Type
> SAL_CALL
getTypes() throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
152 { return WeakAggImplHelper_getTypes( cd::get() ); }
153 virtual com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
154 { return ImplHelper_getImplementationId( cd::get() ); }
156 /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
157 com::sun::star::uno::XInterface inherting from a BaseClass.
158 All acquire() and release() calls are delegated to the BaseClass. Upon queryInterface(),
159 if a demanded interface is not supported by this class directly, the request is
160 delegated to the BaseClass.
163 The BaseClass has to be complete in a sense, that com::sun::star::uno::XInterface
164 and com::sun::star::lang::XTypeProvider are implemented properly. The
165 BaseClass must have at least one ctor that can be called with six or
166 fewer arguments, of which none is of non-const reference type.
169 Inherit from this class giving your additional interface(s) to be implemented as
170 template argument(s). Your sub class defines method implementations for these interface(s).
172 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
>
173 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper11
175 , public Ifc1
, public Ifc2
, public Ifc3
, public Ifc4
, public Ifc5
, public Ifc6
, public Ifc7
, public Ifc8
, public Ifc9
, public Ifc10
, public Ifc11
177 struct cd
: public rtl::StaticAggregate
< class_data
, ImplClassData11
< Ifc1
, Ifc2
, Ifc3
, Ifc4
, Ifc5
, Ifc6
, Ifc7
, Ifc8
, Ifc9
, Ifc10
, Ifc11
, ImplInheritanceHelper11
<BaseClass
, Ifc1
, Ifc2
, Ifc3
, Ifc4
, Ifc5
, Ifc6
, Ifc7
, Ifc8
, Ifc9
, Ifc10
, Ifc11
> > > {};
179 template< typename T1
>
180 explicit ImplInheritanceHelper11(T1
const & arg1
): BaseClass(arg1
) {}
181 template< typename T1
, typename T2
>
182 ImplInheritanceHelper11(T1
const & arg1
, T2
const & arg2
):
183 BaseClass(arg1
, arg2
) {}
184 template< typename T1
, typename T2
, typename T3
>
185 ImplInheritanceHelper11(
186 T1
const & arg1
, T2
const & arg2
, T3
const & arg3
):
187 BaseClass(arg1
, arg2
, arg3
) {}
188 template< typename T1
, typename T2
, typename T3
, typename T4
>
189 ImplInheritanceHelper11(
190 T1
const & arg1
, T2
const & arg2
, T3
const & arg3
, T4
const & arg4
):
191 BaseClass(arg1
, arg2
, arg3
, arg4
) {}
193 typename T1
, typename T2
, typename T3
, typename T4
, typename T5
>
194 ImplInheritanceHelper11(
195 T1
const & arg1
, T2
const & arg2
, T3
const & arg3
, T4
const & arg4
,
197 BaseClass(arg1
, arg2
, arg3
, arg4
, arg5
) {}
199 typename T1
, typename T2
, typename T3
, typename T4
, typename T5
,
201 ImplInheritanceHelper11(
202 T1
const & arg1
, T2
const & arg2
, T3
const & arg3
, T4
const & arg4
,
203 T5
const & arg5
, T6
const & arg6
):
204 BaseClass(arg1
, arg2
, arg3
, arg4
, arg5
, arg6
) {}
206 ImplInheritanceHelper11() {}
207 virtual com::sun::star::uno::Any SAL_CALL
queryInterface( com::sun::star::uno::Type
const & rType
) throw (com::sun::star::uno::RuntimeException
) SAL_OVERRIDE
209 com::sun::star::uno::Any
aRet( ImplHelper_queryNoXInterface( rType
, cd::get(), this ) );
212 return BaseClass::queryInterface( rType
);
214 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
215 { BaseClass::acquire(); }
216 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
217 { BaseClass::release(); }
218 virtual com::sun::star::uno::Sequence
< com::sun::star::uno::Type
> SAL_CALL
getTypes() throw (com::sun::star::uno::RuntimeException
) SAL_OVERRIDE
219 { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
220 virtual com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() throw (com::sun::star::uno::RuntimeException
) SAL_OVERRIDE
221 { return ImplHelper_getImplementationId( cd::get() ); }
223 /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
224 com::sun::star::uno::XInterface inherting from a BaseClass.
225 All acquire(), release() and queryInterface() calls are delegated to the BaseClass.
226 Upon queryAggregation(), if a demanded interface is not supported by this class directly,
227 the request is delegated to the BaseClass.
230 The BaseClass has to be complete in a sense, that com::sun::star::uno::XInterface,
231 com::sun::star::uno::XAggregation and com::sun::star::lang::XTypeProvider
232 are implemented properly. The BaseClass must have at least one ctor
233 that can be called with six or fewer arguments, of which none is of
234 non-const reference type.
237 Inherit from this class giving your additional interface(s) to be implemented as
238 template argument(s). Your sub class defines method implementations for these interface(s).
240 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
>
241 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper11
243 , public Ifc1
, public Ifc2
, public Ifc3
, public Ifc4
, public Ifc5
, public Ifc6
, public Ifc7
, public Ifc8
, public Ifc9
, public Ifc10
, public Ifc11
245 struct cd
: public rtl::StaticAggregate
< class_data
, ImplClassData11
< Ifc1
, Ifc2
, Ifc3
, Ifc4
, Ifc5
, Ifc6
, Ifc7
, Ifc8
, Ifc9
, Ifc10
, Ifc11
, AggImplInheritanceHelper11
<BaseClass
, Ifc1
, Ifc2
, Ifc3
, Ifc4
, Ifc5
, Ifc6
, Ifc7
, Ifc8
, Ifc9
, Ifc10
, Ifc11
> > > {};
247 template< typename T1
>
248 explicit AggImplInheritanceHelper11(T1
const & arg1
): BaseClass(arg1
) {}
249 template< typename T1
, typename T2
>
250 AggImplInheritanceHelper11(T1
const & arg1
, T2
const & arg2
):
251 BaseClass(arg1
, arg2
) {}
252 template< typename T1
, typename T2
, typename T3
>
253 AggImplInheritanceHelper11(
254 T1
const & arg1
, T2
const & arg2
, T3
const & arg3
):
255 BaseClass(arg1
, arg2
, arg3
) {}
256 template< typename T1
, typename T2
, typename T3
, typename T4
>
257 AggImplInheritanceHelper11(
258 T1
const & arg1
, T2
const & arg2
, T3
const & arg3
, T4
const & arg4
):
259 BaseClass(arg1
, arg2
, arg3
, arg4
) {}
261 typename T1
, typename T2
, typename T3
, typename T4
, typename T5
>
262 AggImplInheritanceHelper11(
263 T1
const & arg1
, T2
const & arg2
, T3
const & arg3
, T4
const & arg4
,
265 BaseClass(arg1
, arg2
, arg3
, arg4
, arg5
) {}
267 typename T1
, typename T2
, typename T3
, typename T4
, typename T5
,
269 AggImplInheritanceHelper11(
270 T1
const & arg1
, T2
const & arg2
, T3
const & arg3
, T4
const & arg4
,
271 T5
const & arg5
, T6
const & arg6
):
272 BaseClass(arg1
, arg2
, arg3
, arg4
, arg5
, arg6
) {}
274 AggImplInheritanceHelper11() {}
275 virtual com::sun::star::uno::Any SAL_CALL
queryInterface( com::sun::star::uno::Type
const & rType
) throw (com::sun::star::uno::RuntimeException
) SAL_OVERRIDE
276 { return BaseClass::queryInterface( rType
); }
277 virtual com::sun::star::uno::Any SAL_CALL
queryAggregation( com::sun::star::uno::Type
const & rType
) throw (com::sun::star::uno::RuntimeException
) SAL_OVERRIDE
279 com::sun::star::uno::Any
aRet( ImplHelper_queryNoXInterface( rType
, cd::get(), this ) );
282 return BaseClass::queryAggregation( rType
);
284 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
285 { BaseClass::acquire(); }
286 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
287 { BaseClass::release(); }
288 virtual com::sun::star::uno::Sequence
< com::sun::star::uno::Type
> SAL_CALL
getTypes() throw (com::sun::star::uno::RuntimeException
) SAL_OVERRIDE
289 { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
290 virtual com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() throw (com::sun::star::uno::RuntimeException
) SAL_OVERRIDE
291 { return ImplHelper_getImplementationId( cd::get() ); }
297 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */