LibreOffice
LibreOffice 4.2 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
implbase7.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 INCLUDED_CPPUHELPER_IMPLBASE7_HXX
20 #define INCLUDED_CPPUHELPER_IMPLBASE7_HXX
21 
23 #include <rtl/instance.hxx>
24 
25 namespace cppu
26 {
28 
29  struct class_data7
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[ 7 + 1 ];
36  };
37 
38  template< typename Ifc1, typename Ifc2, typename Ifc3, typename Ifc4, typename Ifc5, typename Ifc6, typename Ifc7, typename Impl >
39  struct ImplClassData7
40  {
41  class_data* operator ()()
42  {
43  static class_data7 s_cd =
44  {
45  7 +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  { { Ifc7::static_type }, ((sal_IntPtr)(Ifc7 *) (Impl *) 16) - 16 },
55  { { com::sun::star::lang::XTypeProvider::static_type }, ((sal_IntPtr)(com::sun::star::lang::XTypeProvider *) (Impl *) 16) - 16 }
56  }
57  };
58  return reinterpret_cast< class_data * >(&s_cd);
59  }
60  };
61 
63 
72  template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 >
73  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper7
74  : public com::sun::star::lang::XTypeProvider
75  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7
76  {
77  struct cd : public rtl::StaticAggregate< class_data, ImplClassData7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, ImplHelper7<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7> > > {};
78  public:
79  virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
80  { return ImplHelper_query( rType, cd::get(), this ); }
81  virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
82  { return ImplHelper_getTypes( cd::get() ); }
83  virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
84  { return ImplHelper_getImplementationId( cd::get() ); }
85 
86 #if !defined _MSC_VER // public -> protected changes mangled names there
87  protected:
88 #endif
89  ~ImplHelper7() throw () {}
90  };
99  template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 >
100  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper7
101  : public OWeakObject
102  , public com::sun::star::lang::XTypeProvider
103  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7
104  {
105  struct cd : public rtl::StaticAggregate< class_data, ImplClassData7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, WeakImplHelper7<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7> > > {};
106  public:
107  virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
108  { return WeakImplHelper_query( rType, cd::get(), this, (OWeakObject *)this ); }
109  virtual void SAL_CALL acquire() throw ()
110  { OWeakObject::acquire(); }
111  virtual void SAL_CALL release() throw ()
112  { OWeakObject::release(); }
113  virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
114  { return WeakImplHelper_getTypes( cd::get() ); }
115  virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
116  { return ImplHelper_getImplementationId( cd::get() ); }
117  };
131  template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 >
132  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper7
133  : public OWeakAggObject
134  , public com::sun::star::lang::XTypeProvider
135  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7
136  {
137  struct cd : public rtl::StaticAggregate< class_data, ImplClassData7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, WeakAggImplHelper7<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7> > > {};
138  public:
139  virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
140  { return OWeakAggObject::queryInterface( rType ); }
141  virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
142  { return WeakAggImplHelper_queryAgg( rType, cd::get(), this, (OWeakAggObject *)this ); }
143  virtual void SAL_CALL acquire() throw ()
145  virtual void SAL_CALL release() throw ()
147  virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
148  { return WeakAggImplHelper_getTypes( cd::get() ); }
149  virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
150  { return ImplHelper_getImplementationId( cd::get() ); }
151  };
168  template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 >
169  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper7
170  : public BaseClass
171  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7
172  {
173  struct cd : public rtl::StaticAggregate< class_data, ImplClassData7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, ImplInheritanceHelper7<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7> > > {};
174  protected:
175  template< typename T1 >
176  explicit ImplInheritanceHelper7(T1 const & arg1): BaseClass(arg1) {}
177  template< typename T1, typename T2 >
178  ImplInheritanceHelper7(T1 const & arg1, T2 const & arg2):
179  BaseClass(arg1, arg2) {}
180  template< typename T1, typename T2, typename T3 >
182  T1 const & arg1, T2 const & arg2, T3 const & arg3):
183  BaseClass(arg1, arg2, arg3) {}
184  template< typename T1, typename T2, typename T3, typename T4 >
186  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
187  BaseClass(arg1, arg2, arg3, arg4) {}
188  template<
189  typename T1, typename T2, typename T3, typename T4, typename T5 >
191  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
192  T5 const & arg5):
193  BaseClass(arg1, arg2, arg3, arg4, arg5) {}
194  template<
195  typename T1, typename T2, typename T3, typename T4, typename T5,
196  typename T6 >
198  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
199  T5 const & arg5, T6 const & arg6):
200  BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
201  public:
203  virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
204  {
205  com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
206  if (aRet.hasValue())
207  return aRet;
208  return BaseClass::queryInterface( rType );
209  }
210  virtual void SAL_CALL acquire() throw ()
211  { BaseClass::acquire(); }
212  virtual void SAL_CALL release() throw ()
213  { BaseClass::release(); }
214  virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
215  { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
216  virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
217  { return ImplHelper_getImplementationId( cd::get() ); }
218  };
236  template< class BaseClass, class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 >
237  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper7
238  : public BaseClass
239  , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7
240  {
241  struct cd : public rtl::StaticAggregate< class_data, ImplClassData7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, AggImplInheritanceHelper7<BaseClass, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7> > > {};
242  protected:
243  template< typename T1 >
244  explicit AggImplInheritanceHelper7(T1 const & arg1): BaseClass(arg1) {}
245  template< typename T1, typename T2 >
246  AggImplInheritanceHelper7(T1 const & arg1, T2 const & arg2):
247  BaseClass(arg1, arg2) {}
248  template< typename T1, typename T2, typename T3 >
250  T1 const & arg1, T2 const & arg2, T3 const & arg3):
251  BaseClass(arg1, arg2, arg3) {}
252  template< typename T1, typename T2, typename T3, typename T4 >
254  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4):
255  BaseClass(arg1, arg2, arg3, arg4) {}
256  template<
257  typename T1, typename T2, typename T3, typename T4, typename T5 >
259  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
260  T5 const & arg5):
261  BaseClass(arg1, arg2, arg3, arg4, arg5) {}
262  template<
263  typename T1, typename T2, typename T3, typename T4, typename T5,
264  typename T6 >
266  T1 const & arg1, T2 const & arg2, T3 const & arg3, T4 const & arg4,
267  T5 const & arg5, T6 const & arg6):
268  BaseClass(arg1, arg2, arg3, arg4, arg5, arg6) {}
269  public:
271  virtual com::sun::star::uno::Any SAL_CALL queryInterface( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
272  { return BaseClass::queryInterface( rType ); }
273  virtual com::sun::star::uno::Any SAL_CALL queryAggregation( com::sun::star::uno::Type const & rType ) throw (com::sun::star::uno::RuntimeException)
274  {
275  com::sun::star::uno::Any aRet( ImplHelper_queryNoXInterface( rType, cd::get(), this ) );
276  if (aRet.hasValue())
277  return aRet;
278  return BaseClass::queryAggregation( rType );
279  }
280  virtual void SAL_CALL acquire() throw ()
281  { BaseClass::acquire(); }
282  virtual void SAL_CALL release() throw ()
283  { BaseClass::release(); }
284  virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL getTypes() throw (com::sun::star::uno::RuntimeException)
285  { return ImplInhHelper_getTypes( cd::get(), BaseClass::getTypes() ); }
286  virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (com::sun::star::uno::RuntimeException)
287  { return ImplHelper_getImplementationId( cd::get() ); }
288  };
289 }
290 
291 #endif
292 
293 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual com::sun::star::uno::Any queryInterface(com::sun::star::uno::Type const &rType)
Definition: implbase7.hxx:107
Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and com::sun::star:...
Definition: implbase7.hxx:169
virtual void acquire()
increasing m_refCount
virtual com::sun::star::uno::Sequence< sal_Int8 > getImplementationId()
Definition: implbase7.hxx:149
ImplInheritanceHelper7()
Definition: implbase7.hxx:202
virtual void release()
If a delegator is set, then the delegators gets released.
Helper class for a late-initialized static aggregate, e.g.
Definition: instance.hxx:542
virtual void release()
Definition: implbase7.hxx:212
C++ class representing an IDL meta type.
Definition: Type.h:55
ImplInheritanceHelper7(T1 const &arg1, T2 const &arg2, T3 const &arg3)
Definition: implbase7.hxx:181
AggImplInheritanceHelper7(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4)
Definition: implbase7.hxx:253
virtual com::sun::star::uno::Any queryAggregation(com::sun::star::uno::Type const &rType)
Definition: implbase7.hxx:273
Base class to implement an UNO object supporting weak references, i.e.
Definition: weakagg.hxx:40
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
Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and com::sun::star:...
Definition: implbase7.hxx:132
virtual com::sun::star::uno::Any queryInterface(com::sun::star::uno::Type const &rType)
Definition: implbase7.hxx:271
AggImplInheritanceHelper7(T1 const &arg1, T2 const &arg2, T3 const &arg3)
Definition: implbase7.hxx:249
ImplInheritanceHelper7(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4)
Definition: implbase7.hxx:185
#define SAL_NO_VTABLE
Use this for pure virtual classes, e.g.
Definition: types.h:315
ImplInheritanceHelper7(T1 const &arg1, T2 const &arg2)
Definition: implbase7.hxx:178
virtual com::sun::star::uno::Any queryAggregation(com::sun::star::uno::Type const &rType)
Definition: implbase7.hxx:141
~ImplHelper7()
Definition: implbase7.hxx:89
virtual void release()
decreasing m_refCount
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.
ImplInheritanceHelper7(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5)
Definition: implbase7.hxx:190
virtual com::sun::star::uno::Any queryInterface(com::sun::star::uno::Type const &rType)
Definition: implbase7.hxx:79
ImplInheritanceHelper7(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5, T6 const &arg6)
Definition: implbase7.hxx:197
virtual void acquire()
Definition: implbase7.hxx:210
virtual void acquire()
increasing m_refCount
Definition: implbase7.hxx:109
virtual void acquire()
Definition: implbase7.hxx:280
virtual void release()
Definition: implbase7.hxx:282
AggImplInheritanceHelper7(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5, T6 const &arg6)
Definition: implbase7.hxx:265
C++ class representing an IDL any.
Definition: Any.h:46
virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > getTypes()
Definition: implbase7.hxx:147
AggImplInheritanceHelper7()
Definition: implbase7.hxx:270
virtual void release()
If a delegator is set, then the delegators gets released.
Definition: implbase7.hxx:145
Implementation helper implementing interface com::sun::star::lang::XTypeProvider and method XInterfac...
Definition: implbase7.hxx:73
virtual com::sun::star::uno::Any queryInterface(com::sun::star::uno::Type const &rType)
Definition: implbase7.hxx:203
unsigned char sal_Bool
Definition: types.h:46
sal_Bool hasValue() const
Tests if any contains a value.
Definition: Any.h:150
virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > getTypes()
Definition: implbase7.hxx:214
virtual void release()
decreasing m_refCount
Definition: implbase7.hxx:111
virtual com::sun::star::uno::Sequence< sal_Int8 > getImplementationId()
Definition: implbase7.hxx:115
virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > getTypes()
Definition: implbase7.hxx:284
Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and com::sun::star:...
Definition: implbase7.hxx:100
virtual void acquire()
If a delegator is set, then the delegators gets acquired.
Base class to implement an UNO object supporting weak references, i.e.
Definition: weak.hxx:43
ImplInheritanceHelper7(T1 const &arg1)
Definition: implbase7.hxx:176
virtual void acquire()
If a delegator is set, then the delegators gets acquired.
Definition: implbase7.hxx:143
#define sal_False
Definition: types.h:47
virtual com::sun::star::uno::Sequence< sal_Int8 > getImplementationId()
Definition: implbase7.hxx:216
virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > getTypes()
Definition: implbase7.hxx:81
virtual com::sun::star::uno::Sequence< sal_Int8 > getImplementationId()
Definition: implbase7.hxx:286
signed char sal_Int8
Definition: types.h:51
virtual com::sun::star::uno::Sequence< sal_Int8 > getImplementationId()
Definition: implbase7.hxx:83
AggImplInheritanceHelper7(T1 const &arg1, T2 const &arg2, T3 const &arg3, T4 const &arg4, T5 const &arg5)
Definition: implbase7.hxx:258
virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > getTypes()
Definition: implbase7.hxx:113
AggImplInheritanceHelper7(T1 const &arg1)
Definition: implbase7.hxx:244
Template C++ class representing an IDL sequence.
Definition: unotype.hxx:33
virtual com::sun::star::uno::Any queryInterface(com::sun::star::uno::Type const &rType)
Definition: implbase7.hxx:139
Implementation helper implementing interfaces com::sun::star::lang::XTypeProvider and com::sun::star:...
Definition: implbase7.hxx:237
AggImplInheritanceHelper7(T1 const &arg1, T2 const &arg2)
Definition: implbase7.hxx:246