LibreOffice LibreOffice 4.1 SDK C/C++ API Reference

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
implbase5.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19 #ifndef _CPPUHELPER_IMPLBASE5_HXX_
20 #define _CPPUHELPER_IMPLBASE5_HXX_
21
22 #include <cppuhelper/implbase_ex.hxx>
23 #include <rtl/instance.hxx>
24
25 namespace cppu
26 {
28
29 struct class_data5
30 {
31 sal_Int16 m_nTypes;
32 sal_Bool m_storedTypeRefs;
33 sal_Bool m_storedId;
34 sal_Int8 m_id[ 16 ];
35 type_entry m_typeEntries[ 5 + 1 ];
36 };
37
38 template< typename Ifc1, typename Ifc2, typename Ifc3, typename Ifc4, typename Ifc5, typename Impl >
39 struct ImplClassData5
40 {
41 class_data* operator ()()
42 {
43 static class_data5 s_cd =
44 {
45 5 +1, sal_False, sal_False,
46 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
47 {
48 { { Ifc1::static_type }, ((sal_IntPtr)(Ifc1 *) (Impl *) 16) - 16 },
49 { { Ifc2::static_type }, ((sal_IntPtr)(Ifc2 *) (Impl *) 16) - 16 },
50 { { Ifc3::static_type }, ((sal_IntPtr)(Ifc3 *) (Impl *) 16) - 16 },
51 { { Ifc4::static_type }, ((sal_IntPtr)(Ifc4 *) (Impl *) 16) - 16 },
52 { { Ifc5::static_type }, ((sal_IntPtr)(Ifc5 *) (Impl *) 16) - 16 },
53 { { com::sun::star::lang::XTypeProvider::static_type }, ((sal_IntPtr)(com::sun::star::lang::XTypeProvider *) (Impl *) 16) - 16 }
54 }
55 };
56 return reinterpret_cast< class_data * >(&s_cd);
57 }
58 };
59
61
70 template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 >
71 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper5
72 : public com::sun::star::lang::XTypeProvider
73 , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5
74 {
75 struct cd : public rtl::StaticAggregate< class_data, ImplClassData5 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, ImplHelper5<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5> > > {};
76 public:
77 virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
78 { return ImplHelper_query( rType, cd::get(), this ); }
79 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
80 { return ImplHelper_getTypes( cd::get() ); }
81 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
82 { return ImplHelper_getImplementationId( cd::get() ); }
83
84 #if !defined _MSC_VER // public -> protected changes mangled names there
85 protected:
86 #endif
87 ~ImplHelper5() throw () {}
88 };
97 template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 >
98 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper5
99 : public OWeakObject
100 , public com::sun::star::lang::XTypeProvider
101 , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5
102 {
103 struct cd : public rtl::StaticAggregate< class_data, ImplClassData5 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, WeakImplHelper5<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5> > > {};
104 public:
105 virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
106 { return WeakImplHelper_query( rType, cd::get(), this, (OWeakObject *)this ); }
107 virtual void SAL_CALL acquire() throw ()
108 { OWeakObject::acquire(); }
109 virtual void SAL_CALL release() throw ()
110 { OWeakObject::release(); }
111 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
112 { return WeakImplHelper_getTypes( cd::get() ); }
113 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
114 { return ImplHelper_getImplementationId( cd::get() ); }
115 };
129 template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 >
130 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper5
131 : public OWeakAggObject
132 , public com::sun::star::lang::XTypeProvider
133 , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5
134 {
135 struct cd : public rtl::StaticAggregate< class_data, ImplClassData5 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, WeakAggImplHelper5<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5> > > {};
136 public:
137 virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
138 { return OWeakAggObject::queryInterface( rType ); }
139 virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
140 { return WeakAggImplHelper_queryAgg( rType, cd::get(), this, (OWeakAggObject *)this ); }
141 virtual void SAL_CALL acquire() throw ()
142 { OWeakAggObject::acquire(); }
143 virtual void SAL_CALL release() throw ()
144 { OWeakAggObject::release(); }
145 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
146 { return WeakAggImplHelper_getTypes( cd::get() ); }
147 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
148 { return ImplHelper_getImplementationId( cd::get() ); }
149 };
166 template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 >
167 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper5
168 : public BaseClass
169 , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5
170 {
171 struct cd : public rtl::StaticAggregate< class_data, ImplClassData5 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, ImplInheritanceHelper5<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5> > > {};
172 protected:
173 template< typename T1 >
174 explicit ImplInheritanceHelper5(T1 const & arg1): BaseClass(arg1) {}
175 template< typename T1, typename T2 >
176 ImplInheritanceHelper5(T1 const & arg1, T2 const & arg2):
177 BaseClass(arg1, arg2) {}
178 template< typename T1, typename T2, typename T3 >
179 ImplInheritanceHelper5(
180 T1 const & arg1, T2 const & arg2, T3 const & arg3):
181 BaseClass(arg1, arg2, arg3) {}
182 template< typename T1, typename T2, typename T3, typename T4 >
183 ImplInheritanceHelper5(
184 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
185 BaseClass(arg1, arg2, arg3, arg4) {}
186 template<
187 typename T1, typename T2, typename T3, typename T4, typename T5 >
188 ImplInheritanceHelper5(
189 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
190 T5 const & arg5):
191 BaseClass(arg1, arg2, arg3, arg4, arg5) {}
192 template<
193 typename T1, typename T2, typename T3, typename T4, typename T5,
194 typename T6 >
195 ImplInheritanceHelper5(
196 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
197 T5 const & arg5, T6 const & arg6):
198 BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
199 public:
200 ImplInheritanceHelper5() {}
201 virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
202 {
203 com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
204 if (aRet.hasValue())
205 return aRet;
206 return BaseClass::queryInterface( rType );
207 }
208 virtual void SAL_CALL acquire() throw ()
209 { BaseClass::acquire(); }
210 virtual void SAL_CALL release() throw ()
211 { BaseClass::release(); }
212 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
213 { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
214 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
215 { return ImplHelper_getImplementationId( cd::get() ); }
216 };
234 template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 >
235 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper5
236 : public BaseClass
237 , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5
238 {
239 struct cd : public rtl::StaticAggregate< class_data, ImplClassData5 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, AggImplInheritanceHelper5<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5> > > {};
240 protected:
241 template< typename T1 >
242 explicit AggImplInheritanceHelper5(T1 const & arg1): BaseClass(arg1) {}
243 template< typename T1, typename T2 >
244 AggImplInheritanceHelper5(T1 const & arg1, T2 const & arg2):
245 BaseClass(arg1, arg2) {}
246 template< typename T1, typename T2, typename T3 >
247 AggImplInheritanceHelper5(
248 T1 const & arg1, T2 const & arg2, T3 const & arg3):
249 BaseClass(arg1, arg2, arg3) {}
250 template< typename T1, typename T2, typename T3, typename T4 >
251 AggImplInheritanceHelper5(
252 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
253 BaseClass(arg1, arg2, arg3, arg4) {}
254 template<
255 typename T1, typename T2, typename T3, typename T4, typename T5 >
256 AggImplInheritanceHelper5(
257 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
258 T5 const & arg5):
259 BaseClass(arg1, arg2, arg3, arg4, arg5) {}
260 template<
261 typename T1, typename T2, typename T3, typename T4, typename T5,
262 typename T6 >
263 AggImplInheritanceHelper5(
264 T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
265 T5 const & arg5, T6 const & arg6):
266 BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
267 public:
268 AggImplInheritanceHelper5() {}
269 virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
270 { return BaseClass::queryInterface( rType ); }
271 virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
272 {
273 com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
274 if (aRet.hasValue())
275 return aRet;
276 return BaseClass::queryAggregation( rType );
277 }
278 virtual void SAL_CALL acquire() throw ()
279 { BaseClass::acquire(); }
280 virtual void SAL_CALL release() throw ()
281 { BaseClass::release(); }
282 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
283 { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
284 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
285 { return ImplHelper_getImplementationId( cd::get() ); }
286 };
287 }
288
289 #endif
290
291 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
implbase_ex.hxx
cppu::ImplHelper5
Implementation helper implementing interface com::sun::star::lang::XTypeProvider and method XInterfac...
Definition: implbase5.hxx:71
cppu::ImplInheritanceHelper5::ImplInheritanceHelper5
ImplInheritanceHelper5(T1 const &arg1, T2 const &arg2, T3 const &arg3)
Definition: implbase5.hxx:179
SAL_NO_VTABLE
#define SAL_NO_VTABLE
Use this for pure virtual classes, e.g.
Definition: types.h:313
cppu::WeakAggImplHelper5::release
virtual void release()
If a delegator is set, then the delegators gets released.
Definition: implbase5.hxx:143
cppu::WeakImplHelper5
Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and com::sun::star:...
Definition: implbase5.hxx:98
cppu::OWeakAggObject::queryInterface
virtual ::com::sun::star::uno::Any queryInterface(const ::com::sun::star::uno::Type &rType)
If a delegator is set, then the delegator is queried for the demanded interface.
sal_Int8
signed char sal_Int8
Definition: types.h:42
cppu::AggImplInheritanceHelper5
Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and com::sun::star:...
Definition: implbase5.hxx:235
cppu::AggImplInheritanceHelper5::AggImplInheritanceHelper5
AggImplInheritanceHelper5(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5)
Definition: implbase5.hxx:256
cppu::ImplInheritanceHelper5::ImplInheritanceHelper5
ImplInheritanceHelper5(T1 const &arg1)
Definition: implbase5.hxx:174
cppu::WeakAggImplHelper5::getTypes
virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > getTypes()
Definition: implbase5.hxx:145
com::sun::star::uno::Any::hasValue
sal_Bool hasValue() const
Tests if any contains a value.
Definition: Any.h:150
cppu::WeakAggImplHelper5::queryInterface
virtual com::sun::star::uno::Any queryInterface(com::sun::star::uno::Type const &rType)
Definition: implbase5.hxx:137
cppu::ImplInheritanceHelper5
Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and com::sun::star:...
Definition: implbase5.hxx:167
cppu::AggImplInheritanceHelper5::AggImplInheritanceHelper5
AggImplInheritanceHelper5(T1 const &arg1, T2 const &arg2)
Definition: implbase5.hxx:244
cppu::AggImplInheritanceHelper5::AggImplInheritanceHelper5
AggImplInheritanceHelper5(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4)
Definition: implbase5.hxx:251
cppu::ImplHelper5::queryInterface
virtual com::sun::star::uno::Any queryInterface(com::sun::star::uno::Type const &rType)
Definition: implbase5.hxx:77
cppu::ImplInheritanceHelper5::ImplInheritanceHelper5
ImplInheritanceHelper5(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4)
Definition: implbase5.hxx:183
cppu::AggImplInheritanceHelper5::queryAggregation
virtual com::sun::star::uno::Any queryAggregation(com::sun::star::uno::Type const &rType)
Definition: implbase5.hxx:271
cppu::ImplInheritanceHelper5::ImplInheritanceHelper5
ImplInheritanceHelper5()
Definition: implbase5.hxx:200
cppu::WeakImplHelper5::queryInterface
virtual com::sun::star::uno::Any queryInterface(com::sun::star::uno::Type const &rType)
Definition: implbase5.hxx:105
cppu::WeakAggImplHelper5::queryAggregation
virtual com::sun::star::uno::Any queryAggregation(com::sun::star::uno::Type const &rType)
Definition: implbase5.hxx:139
cppu::AggImplInheritanceHelper5::AggImplInheritanceHelper5
AggImplInheritanceHelper5(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5, T6 const &arg6)
Definition: implbase5.hxx:263
cppu::WeakImplHelper5::acquire
virtual void acquire()
increasing m_refCount
Definition: implbase5.hxx:107
cppu::queryInterface
inline::com::sun::star::uno::Any queryInterface(const ::com::sun::star::uno::Type &rType, Interface1 *p1)
Compares demanded type to given template argument types.
Definition: queryinterface.hxx:39
cppu::WeakImplHelper5::getTypes
virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > getTypes()
Definition: implbase5.hxx:111
cppu::OWeakObject
Base class to implement an UNO object supporting weak references, i.e.
Definition: weak.hxx:43
cppu::ImplInheritanceHelper5::acquire
virtual void acquire()
Definition: implbase5.hxx:208
cppu::WeakAggImplHelper5::acquire
virtual void acquire()
If a delegator is set, then the delegators gets acquired.
Definition: implbase5.hxx:141
cppu::AggImplInheritanceHelper5::queryInterface
virtual com::sun::star::uno::Any queryInterface(com::sun::star::uno::Type const &rType)
Definition: implbase5.hxx:269
instance.hxx
cppu::ImplHelper5::getImplementationId
virtual com::sun::star::uno::Sequence< sal_Int8 > getImplementationId()
Definition: implbase5.hxx:81
cppu::AggImplInheritanceHelper5::getImplementationId
virtual com::sun::star::uno::Sequence< sal_Int8 > getImplementationId()
Definition: implbase5.hxx:284
sal_Bool
unsigned char sal_Bool
Definition: types.h:37
sal_False
#define sal_False
Definition: types.h:38
cppu::WeakAggImplHelper5
Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and com::sun::star:...
Definition: implbase5.hxx:130
cppu::WeakAggImplHelper5::getImplementationId
virtual com::sun::star::uno::Sequence< sal_Int8 > getImplementationId()
Definition: implbase5.hxx:147
cppu::WeakImplHelper5::release
virtual void release()
decreasing m_refCount
Definition: implbase5.hxx:109
cppu::OWeakObject::release
virtual void release()
decreasing m_refCount
cppu::AggImplInheritanceHelper5::release
virtual void release()
Definition: implbase5.hxx:280
cppu::ImplInheritanceHelper5::getTypes
virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > getTypes()
Definition: implbase5.hxx:212
cppu::OWeakAggObject::release
virtual void release()
If a delegator is set, then the delegators gets released.
cppu::AggImplInheritanceHelper5::AggImplInheritanceHelper5
AggImplInheritanceHelper5()
Definition: implbase5.hxx:268
cppu::AggImplInheritanceHelper5::getTypes
virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > getTypes()
Definition: implbase5.hxx:282
com::sun::star::uno::Sequence
Template C++ class representing an IDL sequence.
Definition: unotype.hxx:33
cppu::ImplHelper5::~ImplHelper5
~ImplHelper5()
Definition: implbase5.hxx:87
cppu::ImplInheritanceHelper5::ImplInheritanceHelper5
ImplInheritanceHelper5(T1 const &arg1, T2 const &arg2)
Definition: implbase5.hxx:176
cppu::OWeakObject::acquire
virtual void acquire()
increasing m_refCount
cppu::OWeakAggObject
Base class to implement an UNO object supporting weak references, i.e.
Definition: weakagg.hxx:40
cppu::ImplInheritanceHelper5::ImplInheritanceHelper5
ImplInheritanceHelper5(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5)
Definition: implbase5.hxx:188
cppu::OWeakAggObject::acquire
virtual void acquire()
If a delegator is set, then the delegators gets acquired.
cppu::ImplHelper5::getTypes
virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > getTypes()
Definition: implbase5.hxx:79
com::sun::star::uno::Any
C++ class representing an IDL any.
Definition: Any.h:46
rtl::StaticAggregate
Helper class for a late-initialized static aggregate, e.g.
Definition: instance.hxx:542
cppu::AggImplInheritanceHelper5::acquire
virtual void acquire()
Definition: implbase5.hxx:278
cppu::AggImplInheritanceHelper5::AggImplInheritanceHelper5
AggImplInheritanceHelper5(T1 const &arg1, T2 const &arg2, T3 const &arg3)
Definition: implbase5.hxx:247
cppu::WeakImplHelper5::getImplementationId
virtual com::sun::star::uno::Sequence< sal_Int8 > getImplementationId()
Definition: implbase5.hxx:113
cppu::ImplInheritanceHelper5::getImplementationId
virtual com::sun::star::uno::Sequence< sal_Int8 > getImplementationId()
Definition: implbase5.hxx:214
cppu::ImplInheritanceHelper5::release
virtual void release()
Definition: implbase5.hxx:210
cppu::ImplInheritanceHelper5::queryInterface
virtual com::sun::star::uno::Any queryInterface(com::sun::star::uno::Type const &rType)
Definition: implbase5.hxx:201
com::sun::star::uno::Type
C++ class representing an IDL meta type.
Definition: Type.h:55
cppu::AggImplInheritanceHelper5::AggImplInheritanceHelper5
AggImplInheritanceHelper5(T1 const &arg1)
Definition: implbase5.hxx:242
cppu::ImplInheritanceHelper5::ImplInheritanceHelper5
ImplInheritanceHelper5(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5, T6 const &arg6)
Definition: implbase5.hxx:195