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_IMPLBASE6_HXX
20 #define INCLUDED_CPPUHELPER_IMPLBASE6_HXX
22 #include <cppuhelper/implbase_ex.hxx>
23 #include <rtl/instance.hxx>
32 sal_Bool m_storedTypeRefs
;
35 type_entry m_typeEntries
[ 6 + 1 ];
38 template< typename Ifc1
, typename Ifc2
, typename Ifc3
, typename Ifc4
, typename Ifc5
, typename Ifc6
, typename Impl
>
41 class_data
* operator ()()
43 static class_data6 s_cd
=
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(css::lang::XTypeProvider
)
57 return reinterpret_cast< class_data
* >(&s_cd
);
63 /** Implementation helper implementing interface css::lang::XTypeProvider
64 and method XInterface::queryInterface(), but no reference counting.
67 Inherit from this class giving your interface(s) to be implemented as template argument(s).
68 Your sub class defines method implementations for these interface(s) including acquire()/
69 release() and delegates incoming queryInterface() calls to this base class.
71 template< class Ifc1
, class Ifc2
, class Ifc3
, class Ifc4
, class Ifc5
, class Ifc6
>
72 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper6
73 : public css::lang::XTypeProvider
74 , public Ifc1
, public Ifc2
, public Ifc3
, public Ifc4
, public Ifc5
, public Ifc6
76 struct cd
: public rtl::StaticAggregate
< class_data
, ImplClassData6
< Ifc1
, Ifc2
, Ifc3
, Ifc4
, Ifc5
, Ifc6
, ImplHelper6
<Ifc1
, Ifc2
, Ifc3
, Ifc4
, Ifc5
, Ifc6
> > > {};
78 virtual css::uno::Any SAL_CALL
queryInterface( css::uno::Type
const & rType
) throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
79 { return ImplHelper_query( rType
, cd::get(), this ); }
80 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
81 { return ImplHelper_getTypes( cd::get() ); }
82 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
83 { return ImplHelper_getImplementationId( cd::get() ); }
85 #if !defined _MSC_VER // public -> protected changes mangled names there
87 #elif defined __clang__
88 #pragma clang diagnostic push
89 #pragma clang diagnostic ignored "-Wnon-virtual-dtor"
91 ~ImplHelper6() throw () {}
92 #if defined _MSC_VER && defined __clang__
93 #pragma clang diagnostic pop
96 /** Implementation helper implementing interfaces css::lang::XTypeProvider and
97 css::uno::XInterface which supports weak mechanism to be held weakly
98 (supporting css::uno::XWeak through ::cppu::OWeakObject).
101 Inherit from this class giving your interface(s) to be implemented as template argument(s).
102 Your sub class defines method implementations for these interface(s).
104 template< class Ifc1
, class Ifc2
, class Ifc3
, class Ifc4
, class Ifc5
, class Ifc6
>
105 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper6
107 , public css::lang::XTypeProvider
108 , public Ifc1
, public Ifc2
, public Ifc3
, public Ifc4
, public Ifc5
, public Ifc6
110 struct cd
: public rtl::StaticAggregate
< class_data
, ImplClassData6
< Ifc1
, Ifc2
, Ifc3
, Ifc4
, Ifc5
, Ifc6
, WeakImplHelper6
<Ifc1
, Ifc2
, Ifc3
, Ifc4
, Ifc5
, Ifc6
> > > {};
112 virtual css::uno::Any SAL_CALL
queryInterface( css::uno::Type
const & rType
) throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
113 { return WeakImplHelper_query( rType
, cd::get(), this, static_cast<OWeakObject
*>(this) ); }
114 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
115 { OWeakObject::acquire(); }
116 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
117 { OWeakObject::release(); }
118 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
119 { return WeakImplHelper_getTypes( cd::get() ); }
120 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
121 { return ImplHelper_getImplementationId( cd::get() ); }
123 /** Implementation helper implementing interfaces css::lang::XTypeProvider and
124 css::uno::XInterface which supports weak mechanism to be held weakly
125 (supporting css::uno::XWeak through ::cppu::OWeakAggObject).
126 In addition, it supports also aggregation meaning object of this class can be aggregated
127 (css::uno::XAggregation through ::cppu::OWeakAggObject).
128 If a delegator is set (this object is aggregated), then incoming queryInterface()
129 calls are delegated to the delegator object. If the delegator does not support the
130 demanded interface, it calls queryAggregation() on its aggregated objects.
133 Inherit from this class giving your interface(s) to be implemented as template argument(s).
134 Your sub class defines method implementations for these interface(s).
136 template< class Ifc1
, class Ifc2
, class Ifc3
, class Ifc4
, class Ifc5
, class Ifc6
>
137 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper6
138 : public OWeakAggObject
139 , public css::lang::XTypeProvider
140 , public Ifc1
, public Ifc2
, public Ifc3
, public Ifc4
, public Ifc5
, public Ifc6
142 struct cd
: public rtl::StaticAggregate
< class_data
, ImplClassData6
< Ifc1
, Ifc2
, Ifc3
, Ifc4
, Ifc5
, Ifc6
, WeakAggImplHelper6
<Ifc1
, Ifc2
, Ifc3
, Ifc4
, Ifc5
, Ifc6
> > > {};
144 virtual css::uno::Any SAL_CALL
queryInterface( css::uno::Type
const & rType
) throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
145 { return OWeakAggObject::queryInterface( rType
); }
146 virtual css::uno::Any SAL_CALL
queryAggregation( css::uno::Type
const & rType
) throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
147 { return WeakAggImplHelper_queryAgg( rType
, cd::get(), this, static_cast<OWeakAggObject
*>(this) ); }
148 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
149 { OWeakAggObject::acquire(); }
150 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
151 { OWeakAggObject::release(); }
152 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
153 { return WeakAggImplHelper_getTypes( cd::get() ); }
154 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
155 { return ImplHelper_getImplementationId( cd::get() ); }
157 /** Implementation helper implementing interfaces css::lang::XTypeProvider and
158 css::uno::XInterface inherting from a BaseClass.
159 All acquire() and release() calls are delegated to the BaseClass. Upon queryInterface(),
160 if a demanded interface is not supported by this class directly, the request is
161 delegated to the BaseClass.
164 The BaseClass has to be complete in a sense, that css::uno::XInterface
165 and css::lang::XTypeProvider are implemented properly. The
166 BaseClass must have at least one ctor that can be called with six or
167 fewer arguments, of which none is of non-const reference type.
170 Inherit from this class giving your additional interface(s) to be implemented as
171 template argument(s). Your sub class defines method implementations for these interface(s).
173 template< class BaseClass
, class Ifc1
, class Ifc2
, class Ifc3
, class Ifc4
, class Ifc5
, class Ifc6
>
174 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper6
176 , public Ifc1
, public Ifc2
, public Ifc3
, public Ifc4
, public Ifc5
, public Ifc6
178 struct cd
: public rtl::StaticAggregate
< class_data
, ImplClassData6
< Ifc1
, Ifc2
, Ifc3
, Ifc4
, Ifc5
, Ifc6
, ImplInheritanceHelper6
<BaseClass
, Ifc1
, Ifc2
, Ifc3
, Ifc4
, Ifc5
, Ifc6
> > > {};
180 template< typename T1
>
181 explicit ImplInheritanceHelper6(T1
const & arg1
): BaseClass(arg1
) {}
182 template< typename T1
, typename T2
>
183 ImplInheritanceHelper6(T1
const & arg1
, T2
const & arg2
):
184 BaseClass(arg1
, arg2
) {}
185 template< typename T1
, typename T2
, typename T3
>
186 ImplInheritanceHelper6(
187 T1
const & arg1
, T2
const & arg2
, T3
const & arg3
):
188 BaseClass(arg1
, arg2
, arg3
) {}
189 template< typename T1
, typename T2
, typename T3
, typename T4
>
190 ImplInheritanceHelper6(
191 T1
const & arg1
, T2
const & arg2
, T3
const & arg3
, T4
const & arg4
):
192 BaseClass(arg1
, arg2
, arg3
, arg4
) {}
194 typename T1
, typename T2
, typename T3
, typename T4
, typename T5
>
195 ImplInheritanceHelper6(
196 T1
const & arg1
, T2
const & arg2
, T3
const & arg3
, T4
const & arg4
,
198 BaseClass(arg1
, arg2
, arg3
, arg4
, arg5
) {}
200 typename T1
, typename T2
, typename T3
, typename T4
, typename T5
,
202 ImplInheritanceHelper6(
203 T1
const & arg1
, T2
const & arg2
, T3
const & arg3
, T4
const & arg4
,
204 T5
const & arg5
, T6
const & arg6
):
205 BaseClass(arg1
, arg2
, arg3
, arg4
, arg5
, arg6
) {}
207 ImplInheritanceHelper6() {}
208 virtual css::uno::Any SAL_CALL
queryInterface( css::uno::Type
const & rType
) throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
210 css::uno::Any
aRet( ImplHelper_queryNoXInterface( rType
, cd::get(), this ) );
213 return BaseClass::queryInterface( rType
);
215 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
216 { BaseClass::acquire(); }
217 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
218 { BaseClass::release(); }
219 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
220 { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
221 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
222 { return ImplHelper_getImplementationId( cd::get() ); }
224 /** Implementation helper implementing interfaces css::lang::XTypeProvider and
225 css::uno::XInterface inherting from a BaseClass.
226 All acquire(), release() and queryInterface() calls are delegated to the BaseClass.
227 Upon queryAggregation(), if a demanded interface is not supported by this class directly,
228 the request is delegated to the BaseClass.
231 The BaseClass has to be complete in a sense, that css::uno::XInterface,
232 css::uno::XAggregation and css::lang::XTypeProvider
233 are implemented properly. The BaseClass must have at least one ctor
234 that can be called with six or fewer arguments, of which none is of
235 non-const reference type.
238 Inherit from this class giving your additional interface(s) to be implemented as
239 template argument(s). Your sub class defines method implementations for these interface(s).
241 template< class BaseClass
, class Ifc1
, class Ifc2
, class Ifc3
, class Ifc4
, class Ifc5
, class Ifc6
>
242 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper6
244 , public Ifc1
, public Ifc2
, public Ifc3
, public Ifc4
, public Ifc5
, public Ifc6
246 struct cd
: public rtl::StaticAggregate
< class_data
, ImplClassData6
< Ifc1
, Ifc2
, Ifc3
, Ifc4
, Ifc5
, Ifc6
, AggImplInheritanceHelper6
<BaseClass
, Ifc1
, Ifc2
, Ifc3
, Ifc4
, Ifc5
, Ifc6
> > > {};
248 template< typename T1
>
249 explicit AggImplInheritanceHelper6(T1
const & arg1
): BaseClass(arg1
) {}
250 template< typename T1
, typename T2
>
251 AggImplInheritanceHelper6(T1
const & arg1
, T2
const & arg2
):
252 BaseClass(arg1
, arg2
) {}
253 template< typename T1
, typename T2
, typename T3
>
254 AggImplInheritanceHelper6(
255 T1
const & arg1
, T2
const & arg2
, T3
const & arg3
):
256 BaseClass(arg1
, arg2
, arg3
) {}
257 template< typename T1
, typename T2
, typename T3
, typename T4
>
258 AggImplInheritanceHelper6(
259 T1
const & arg1
, T2
const & arg2
, T3
const & arg3
, T4
const & arg4
):
260 BaseClass(arg1
, arg2
, arg3
, arg4
) {}
262 typename T1
, typename T2
, typename T3
, typename T4
, typename T5
>
263 AggImplInheritanceHelper6(
264 T1
const & arg1
, T2
const & arg2
, T3
const & arg3
, T4
const & arg4
,
266 BaseClass(arg1
, arg2
, arg3
, arg4
, arg5
) {}
268 typename T1
, typename T2
, typename T3
, typename T4
, typename T5
,
270 AggImplInheritanceHelper6(
271 T1
const & arg1
, T2
const & arg2
, T3
const & arg3
, T4
const & arg4
,
272 T5
const & arg5
, T6
const & arg6
):
273 BaseClass(arg1
, arg2
, arg3
, arg4
, arg5
, arg6
) {}
275 AggImplInheritanceHelper6() {}
276 virtual css::uno::Any SAL_CALL
queryInterface( css::uno::Type
const & rType
) throw (css::uno::RuntimeException
) SAL_OVERRIDE
277 { return BaseClass::queryInterface( rType
); }
278 virtual css::uno::Any SAL_CALL
queryAggregation( css::uno::Type
const & rType
) throw (css::uno::RuntimeException
) SAL_OVERRIDE
280 css::uno::Any
aRet( ImplHelper_queryNoXInterface( rType
, cd::get(), this ) );
283 return BaseClass::queryAggregation( rType
);
285 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
286 { BaseClass::acquire(); }
287 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
288 { BaseClass::release(); }
289 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() throw (css::uno::RuntimeException
) SAL_OVERRIDE
290 { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
291 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() throw (css::uno::RuntimeException
) SAL_OVERRIDE
292 { return ImplHelper_getImplementationId( cd::get() ); }
298 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */