LibreOffice
LibreOffice 4.1 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
implbase6.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_IMPLBASE6_HXX_
20 #define _CPPUHELPER_IMPLBASE6_HXX_
21 
23 #include <rtl/instance.hxx>
24 
25 namespace cppu
26 {
28 
29  struct class_data6
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[ 6 + 1 ];
36  };
37 
38  template< typename Ifc1, typename Ifc2, typename Ifc3, typename Ifc4, typename Ifc5, typename Ifc6, typename Impl >
39  struct ImplClassData6
40  {
41  class_data* operator ()()
42  {
43  static class_data6 s_cd =
44  {
45  6 +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  { { Ifc6::static_type }, ((sal_IntPtr)(Ifc6 *) (Impl *) 16) - 16 },
54  { { com::sun::star::lang::XTypeProvider::static_type }, ((sal_IntPtr)(com::sun::star::lang::XTypeProvider *) (Impl *) 16) - 16 }
55  }
56  };
57  return reinterpret_cast< class_data * >(&s_cd);
58  }
59  };
60 
62 
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 com::sun::star::lang::XTypeProvider
74  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6
75  {
76  struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, ImplHelper6<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {};
77  public:
78  virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
79  { return ImplHelper_query( rType, cd::get(), this ); }
80  virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
81  { return ImplHelper_getTypes( cd::get() ); }
82  virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
83  { return ImplHelper_getImplementationId( cd::get() ); }
84 
85 #if !defined _MSC_VER // public -> protected changes mangled names there
86  protected:
87 #endif
88  ~ImplHelper6() throw () {}
89  };
98  template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 >
99  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper6
100  : public OWeakObject
101  , public com::sun::star::lang::XTypeProvider
102  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6
103  {
104  struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, WeakImplHelper6<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {};
105  public:
106  virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
107  { return WeakImplHelper_query( rType, cd::get(), this, (OWeakObject *)this ); }
108  virtual void SAL_CALL acquire() throw ()
109  { OWeakObject::acquire(); }
110  virtual void SAL_CALL release() throw ()
111  { OWeakObject::release(); }
112  virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
113  { return WeakImplHelper_getTypes( cd::get() ); }
114  virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
115  { return ImplHelper_getImplementationId( cd::get() ); }
116  };
130  template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 >
131  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper6
132  : public OWeakAggObject
133  , public com::sun::star::lang::XTypeProvider
134  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6
135  {
136  struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, WeakAggImplHelper6<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {};
137  public:
138  virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
139  { return OWeakAggObject::queryInterface( rType ); }
140  virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
141  { return WeakAggImplHelper_queryAgg( rType, cd::get(), this, (OWeakAggObject *)this ); }
142  virtual void SAL_CALL acquire() throw ()
144  virtual void SAL_CALL release() throw ()
146  virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
147  { return WeakAggImplHelper_getTypes( cd::get() ); }
148  virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
149  { return ImplHelper_getImplementationId( cd::get() ); }
150  };
167  template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 >
168  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper6
169  : public BaseClass
170  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6
171  {
172  struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, ImplInheritanceHelper6<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {};
173  protected:
174  template< typename T1 >
175  explicit ImplInheritanceHelper6(T1 const & arg1): BaseClass(arg1) {}
176  template< typename T1, typename T2 >
177  ImplInheritanceHelper6(T1 const & arg1, T2 const & arg2):
178  BaseClass(arg1, arg2) {}
179  template< typename T1, typename T2, typename T3 >
181  T1 const & arg1, T2 const & arg2, T3 const & arg3):
182  BaseClass(arg1, arg2, arg3) {}
183  template< typename T1, typename T2, typename T3, typename T4 >
185  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
186  BaseClass(arg1, arg2, arg3, arg4) {}
187  template<
188  typename T1, typename T2, typename T3, typename T4, typename T5 >
190  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
191  T5 const & arg5):
192  BaseClass(arg1, arg2, arg3, arg4, arg5) {}
193  template<
194  typename T1, typename T2, typename T3, typename T4, typename T5,
195  typename T6 >
197  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
198  T5 const & arg5, T6 const & arg6):
199  BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
200  public:
202  virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
203  {
204  com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
205  if (aRet.hasValue())
206  return aRet;
207  return BaseClass::queryInterface( rType );
208  }
209  virtual void SAL_CALL acquire() throw ()
210  { BaseClass::acquire(); }
211  virtual void SAL_CALL release() throw ()
212  { BaseClass::release(); }
213  virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
214  { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
215  virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
216  { return ImplHelper_getImplementationId( cd::get() ); }
217  };
235  template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 >
236  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper6
237  : public BaseClass
238  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6
239  {
240  struct cd : public rtl::StaticAggregate< class_data, ImplClassData6 < Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, AggImplInheritanceHelper6<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6> > > {};
241  protected:
242  template< typename T1 >
243  explicit AggImplInheritanceHelper6(T1 const & arg1): BaseClass(arg1) {}
244  template< typename T1, typename T2 >
245  AggImplInheritanceHelper6(T1 const & arg1, T2 const & arg2):
246  BaseClass(arg1, arg2) {}
247  template< typename T1, typename T2, typename T3 >
249  T1 const & arg1, T2 const & arg2, T3 const & arg3):
250  BaseClass(arg1, arg2, arg3) {}
251  template< typename T1, typename T2, typename T3, typename T4 >
253  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
254  BaseClass(arg1, arg2, arg3, arg4) {}
255  template<
256  typename T1, typename T2, typename T3, typename T4, typename T5 >
258  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
259  T5 const & arg5):
260  BaseClass(arg1, arg2, arg3, arg4, arg5) {}
261  template<
262  typename T1, typename T2, typename T3, typename T4, typename T5,
263  typename T6 >
265  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
266  T5 const & arg5, T6 const & arg6):
267  BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
268  public:
270  virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
271  { return BaseClass::queryInterface( rType ); }
272  virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
273  {
274  com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
275  if (aRet.hasValue())
276  return aRet;
277  return BaseClass::queryAggregation( rType );
278  }
279  virtual void SAL_CALL acquire() throw ()
280  { BaseClass::acquire(); }
281  virtual void SAL_CALL release() throw ()
282  { BaseClass::release(); }
283  virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
284  { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
285  virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
286  { return ImplHelper_getImplementationId( cd::get() ); }
287  };
288 }
289 
290 #endif
291 
292 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */