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_IMPLBASE8_HXX
20 #define INCLUDED_CPPUHELPER_IMPLBASE8_HXX
22 #include <cppuhelper/implbase_ex.hxx>
23 #include <rtl/instance.hxx>
32 sal_Bool m_storedTypeRefs
;
35 type_entry m_typeEntries
[ 8 + 1 ];
38 template< typename Ifc1
, typename Ifc2
, typename Ifc3
, typename Ifc4
, typename Ifc5
, typename Ifc6
, typename Ifc7
, typename Ifc8
, typename Impl
>
41 class_data
* operator ()()
43 static class_data8 s_cd
=
45 8 +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(com::sun::star::lang::XTypeProvider
)
59 return reinterpret_cast< class_data
* >(&s_cd
);
65 /** Implementation helper implementing interface com::sun::star::lang::XTypeProvider
66 and method XInterface::queryInterface(), but no reference counting.
69 Inherit from this class giving your interface(s) to be implemented as template argument(s).
70 Your sub class defines method implementations for these interface(s) including acquire()/
71 release() and delegates incoming queryInterface() calls to this base class.
73 template< class Ifc1
, class Ifc2
, class Ifc3
, class Ifc4
, class Ifc5
, class Ifc6
, class Ifc7
, class Ifc8
>
74 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper8
75 : public com::sun::star::lang::XTypeProvider
76 , public Ifc1
, public Ifc2
, public Ifc3
, public Ifc4
, public Ifc5
, public Ifc6
, public Ifc7
, public Ifc8
78 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
> > > {};
80 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
81 { return ImplHelper_query( rType
, cd::get(), this ); }
82 virtual com::sun::star::uno::Sequence
< com::sun::star::uno::Type
> SAL_CALL
getTypes() throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
83 { return ImplHelper_getTypes( cd::get() ); }
84 virtual com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
85 { return ImplHelper_getImplementationId( cd::get() ); }
87 #if !defined _MSC_VER // public -> protected changes mangled names there
90 ~ImplHelper8() throw () {}
92 /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
93 com::sun::star::uno::XInterface which supports weak mechanism to be held weakly
94 (supporting com::sun::star::uno::XWeak through ::cppu::OWeakObject).
97 Inherit from this class giving your interface(s) to be implemented as template argument(s).
98 Your sub class defines method implementations for these interface(s).
100 template< class Ifc1
, class Ifc2
, class Ifc3
, class Ifc4
, class Ifc5
, class Ifc6
, class Ifc7
, class Ifc8
>
101 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper8
103 , public com::sun::star::lang::XTypeProvider
104 , public Ifc1
, public Ifc2
, public Ifc3
, public Ifc4
, public Ifc5
, public Ifc6
, public Ifc7
, public Ifc8
106 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
> > > {};
108 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
109 { return WeakImplHelper_query( rType
, cd::get(), this, static_cast<OWeakObject
*>(this) ); }
110 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
111 { OWeakObject::acquire(); }
112 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
113 { OWeakObject::release(); }
114 virtual com::sun::star::uno::Sequence
< com::sun::star::uno::Type
> SAL_CALL
getTypes() throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
115 { return WeakImplHelper_getTypes( cd::get() ); }
116 virtual com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
117 { return ImplHelper_getImplementationId( cd::get() ); }
119 /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
120 com::sun::star::uno::XInterface which supports weak mechanism to be held weakly
121 (supporting com::sun::star::uno::XWeak through ::cppu::OWeakAggObject).
122 In addition, it supports also aggregation meaning object of this class can be aggregated
123 (com::sun::star::uno::XAggregation through ::cppu::OWeakAggObject).
124 If a delegator is set (this object is aggregated), then incoming queryInterface()
125 calls are delegated to the delegator object. If the delegator does not support the
126 demanded interface, it calls queryAggregation() on its aggregated objects.
129 Inherit from this class giving your interface(s) to be implemented as template argument(s).
130 Your sub class defines method implementations for these interface(s).
132 template< class Ifc1
, class Ifc2
, class Ifc3
, class Ifc4
, class Ifc5
, class Ifc6
, class Ifc7
, class Ifc8
>
133 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper8
134 : public OWeakAggObject
135 , public com::sun::star::lang::XTypeProvider
136 , public Ifc1
, public Ifc2
, public Ifc3
, public Ifc4
, public Ifc5
, public Ifc6
, public Ifc7
, public Ifc8
138 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
> > > {};
140 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
141 { return OWeakAggObject::queryInterface( rType
); }
142 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
143 { return WeakAggImplHelper_queryAgg( rType
, cd::get(), this, static_cast<OWeakAggObject
*>(this) ); }
144 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
145 { OWeakAggObject::acquire(); }
146 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
147 { OWeakAggObject::release(); }
148 virtual com::sun::star::uno::Sequence
< com::sun::star::uno::Type
> SAL_CALL
getTypes() throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
149 { return WeakAggImplHelper_getTypes( cd::get() ); }
150 virtual com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
151 { return ImplHelper_getImplementationId( cd::get() ); }
153 /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
154 com::sun::star::uno::XInterface inherting from a BaseClass.
155 All acquire() and release() calls are delegated to the BaseClass. Upon queryInterface(),
156 if a demanded interface is not supported by this class directly, the request is
157 delegated to the BaseClass.
160 The BaseClass has to be complete in a sense, that com::sun::star::uno::XInterface
161 and com::sun::star::lang::XTypeProvider are implemented properly. The
162 BaseClass must have at least one ctor that can be called with six or
163 fewer arguments, of which none is of non-const reference type.
166 Inherit from this class giving your additional interface(s) to be implemented as
167 template argument(s). Your sub class defines method implementations for these interface(s).
169 template< class BaseClass
, class Ifc1
, class Ifc2
, class Ifc3
, class Ifc4
, class Ifc5
, class Ifc6
, class Ifc7
, class Ifc8
>
170 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper8
172 , public Ifc1
, public Ifc2
, public Ifc3
, public Ifc4
, public Ifc5
, public Ifc6
, public Ifc7
, public Ifc8
174 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
> > > {};
176 template< typename T1
>
177 explicit ImplInheritanceHelper8(T1
const & arg1
): BaseClass(arg1
) {}
178 template< typename T1
, typename T2
>
179 ImplInheritanceHelper8(T1
const & arg1
, T2
const & arg2
):
180 BaseClass(arg1
, arg2
) {}
181 template< typename T1
, typename T2
, typename T3
>
182 ImplInheritanceHelper8(
183 T1
const & arg1
, T2
const & arg2
, T3
const & arg3
):
184 BaseClass(arg1
, arg2
, arg3
) {}
185 template< typename T1
, typename T2
, typename T3
, typename T4
>
186 ImplInheritanceHelper8(
187 T1
const & arg1
, T2
const & arg2
, T3
const & arg3
, T4
const & arg4
):
188 BaseClass(arg1
, arg2
, arg3
, arg4
) {}
190 typename T1
, typename T2
, typename T3
, typename T4
, typename T5
>
191 ImplInheritanceHelper8(
192 T1
const & arg1
, T2
const & arg2
, T3
const & arg3
, T4
const & arg4
,
194 BaseClass(arg1
, arg2
, arg3
, arg4
, arg5
) {}
196 typename T1
, typename T2
, typename T3
, typename T4
, typename T5
,
198 ImplInheritanceHelper8(
199 T1
const & arg1
, T2
const & arg2
, T3
const & arg3
, T4
const & arg4
,
200 T5
const & arg5
, T6
const & arg6
):
201 BaseClass(arg1
, arg2
, arg3
, arg4
, arg5
, arg6
) {}
203 ImplInheritanceHelper8() {}
204 virtual com::sun::star::uno::Any SAL_CALL
queryInterface( com::sun::star::uno::Type
const & rType
) throw (com::sun::star::uno::RuntimeException
) SAL_OVERRIDE
206 com::sun::star::uno::Any
aRet( ImplHelper_queryNoXInterface( rType
, cd::get(), this ) );
209 return BaseClass::queryInterface( rType
);
211 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
212 { BaseClass::acquire(); }
213 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
214 { BaseClass::release(); }
215 virtual com::sun::star::uno::Sequence
< com::sun::star::uno::Type
> SAL_CALL
getTypes() throw (com::sun::star::uno::RuntimeException
) SAL_OVERRIDE
216 { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
217 virtual com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() throw (com::sun::star::uno::RuntimeException
) SAL_OVERRIDE
218 { return ImplHelper_getImplementationId( cd::get() ); }
220 /** Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and
221 com::sun::star::uno::XInterface inherting from a BaseClass.
222 All acquire(), release() and queryInterface() calls are delegated to the BaseClass.
223 Upon queryAggregation(), if a demanded interface is not supported by this class directly,
224 the request is delegated to the BaseClass.
227 The BaseClass has to be complete in a sense, that com::sun::star::uno::XInterface,
228 com::sun::star::uno::XAggregation and com::sun::star::lang::XTypeProvider
229 are implemented properly. The BaseClass must have at least one ctor
230 that can be called with six or fewer arguments, of which none is of
231 non-const reference type.
234 Inherit from this class giving your additional interface(s) to be implemented as
235 template argument(s). Your sub class defines method implementations for these interface(s).
237 template< class BaseClass
, class Ifc1
, class Ifc2
, class Ifc3
, class Ifc4
, class Ifc5
, class Ifc6
, class Ifc7
, class Ifc8
>
238 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper8
240 , public Ifc1
, public Ifc2
, public Ifc3
, public Ifc4
, public Ifc5
, public Ifc6
, public Ifc7
, public Ifc8
242 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
> > > {};
244 template< typename T1
>
245 explicit AggImplInheritanceHelper8(T1
const & arg1
): BaseClass(arg1
) {}
246 template< typename T1
, typename T2
>
247 AggImplInheritanceHelper8(T1
const & arg1
, T2
const & arg2
):
248 BaseClass(arg1
, arg2
) {}
249 template< typename T1
, typename T2
, typename T3
>
250 AggImplInheritanceHelper8(
251 T1
const & arg1
, T2
const & arg2
, T3
const & arg3
):
252 BaseClass(arg1
, arg2
, arg3
) {}
253 template< typename T1
, typename T2
, typename T3
, typename T4
>
254 AggImplInheritanceHelper8(
255 T1
const & arg1
, T2
const & arg2
, T3
const & arg3
, T4
const & arg4
):
256 BaseClass(arg1
, arg2
, arg3
, arg4
) {}
258 typename T1
, typename T2
, typename T3
, typename T4
, typename T5
>
259 AggImplInheritanceHelper8(
260 T1
const & arg1
, T2
const & arg2
, T3
const & arg3
, T4
const & arg4
,
262 BaseClass(arg1
, arg2
, arg3
, arg4
, arg5
) {}
264 typename T1
, typename T2
, typename T3
, typename T4
, typename T5
,
266 AggImplInheritanceHelper8(
267 T1
const & arg1
, T2
const & arg2
, T3
const & arg3
, T4
const & arg4
,
268 T5
const & arg5
, T6
const & arg6
):
269 BaseClass(arg1
, arg2
, arg3
, arg4
, arg5
, arg6
) {}
271 AggImplInheritanceHelper8() {}
272 virtual com::sun::star::uno::Any SAL_CALL
queryInterface( com::sun::star::uno::Type
const & rType
) throw (com::sun::star::uno::RuntimeException
) SAL_OVERRIDE
273 { return BaseClass::queryInterface( rType
); }
274 virtual com::sun::star::uno::Any SAL_CALL
queryAggregation( com::sun::star::uno::Type
const & rType
) throw (com::sun::star::uno::RuntimeException
) SAL_OVERRIDE
276 com::sun::star::uno::Any
aRet( ImplHelper_queryNoXInterface( rType
, cd::get(), this ) );
279 return BaseClass::queryAggregation( rType
);
281 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
282 { BaseClass::acquire(); }
283 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
284 { BaseClass::release(); }
285 virtual com::sun::star::uno::Sequence
< com::sun::star::uno::Type
> SAL_CALL
getTypes() throw (com::sun::star::uno::RuntimeException
) SAL_OVERRIDE
286 { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
287 virtual com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() throw (com::sun::star::uno::RuntimeException
) SAL_OVERRIDE
288 { return ImplHelper_getImplementationId( cd::get() ); }
294 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */