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_IMPLBASE_EX_POST_HXX
20 #define INCLUDED_CPPUHELPER_IMPLBASE_EX_POST_HXX
24 #define __DEF_CLASS_DATA_INIT_EX( N, class_cast ) \
26 N +1, sal_False, sal_False, \
27 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, \
29 __IFC_EX_TYPE_INIT##N( class_cast ), \
30 __IFC_EX_TYPE_INIT_NAME( class_cast, css::lang::XTypeProvider ) \
34 #define __DEF_IMPLHELPER_EX( N ) \
37 struct class_data##N \
40 sal_Bool m_storedTypeRefs; \
41 sal_Bool m_storedId; \
42 sal_Int8 m_id[ 16 ]; \
43 type_entry m_typeEntries[ N + 1 ]; \
45 template< __CLASS_IFC##N > \
46 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplHelper##N \
47 : public css::lang::XTypeProvider \
50 static class_data##N s_cd; \
52 virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) SAL_OVERRIDE \
53 { return ImplHelper_query( rType, (class_data *)&s_cd, this ); } \
54 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE \
55 { return ImplHelper_getTypes( (class_data *)&s_cd ); } \
56 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() SAL_OVERRIDE \
57 { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \
59 template< __CLASS_IFC##N > \
60 class_data##N ImplHelper##N< __IFC##N >::s_cd = \
61 __DEF_CLASS_DATA_INIT_EX( N, (ImplHelper##N< __IFC##N > *) ); \
62 template< __CLASS_IFC##N > \
63 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakImplHelper##N \
64 : public OWeakObject \
65 , public css::lang::XTypeProvider \
68 static class_data##N s_cd; \
70 virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) SAL_OVERRIDE \
71 { return WeakImplHelper_query( rType, (class_data *)&s_cd, this, static_cast<OWeakObject *>(this) ); } \
72 virtual void SAL_CALL acquire() throw () SAL_OVERRIDE \
73 { OWeakObject::acquire(); } \
74 virtual void SAL_CALL release() throw () SAL_OVERRIDE \
75 { OWeakObject::release(); } \
76 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE \
77 { return WeakImplHelper_getTypes( (class_data *)&s_cd ); } \
78 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() SAL_OVERRIDE \
79 { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \
81 template< __CLASS_IFC##N > \
82 class_data##N WeakImplHelper##N< __IFC##N >::s_cd = \
83 __DEF_CLASS_DATA_INIT_EX( N, (WeakImplHelper##N< __IFC##N > *) ); \
84 template< __CLASS_IFC##N > \
85 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggImplHelper##N \
86 : public OWeakAggObject \
87 , public css::lang::XTypeProvider \
90 static class_data##N s_cd; \
92 virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) SAL_OVERRIDE \
93 { return OWeakAggObject::queryInterface( rType ); } \
94 virtual css::uno::Any SAL_CALL queryAggregation( css::uno::Type const & rType ) SAL_OVERRIDE \
95 { return WeakAggImplHelper_queryAgg( rType, (class_data *)&s_cd, this, static_cast<OWeakAggObject *>(this) ); } \
96 virtual void SAL_CALL acquire() throw () SAL_OVERRIDE \
97 { OWeakAggObject::acquire(); } \
98 virtual void SAL_CALL release() throw () SAL_OVERRIDE \
99 { OWeakAggObject::release(); } \
100 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE \
101 { return WeakAggImplHelper_getTypes( (class_data *)&s_cd ); } \
102 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() SAL_OVERRIDE \
103 { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \
105 template< __CLASS_IFC##N > \
106 class_data##N WeakAggImplHelper##N< __IFC##N >::s_cd = \
107 __DEF_CLASS_DATA_INIT_EX( N, (WeakAggImplHelper##N< __IFC##N > *) ); \
108 template< class BaseClass, __CLASS_IFC##N > \
109 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE ImplInheritanceHelper##N \
113 static class_data##N s_cd; \
115 virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) \
117 css::uno::Any aRet( ImplHelper_queryNoXInterface( rType, (class_data *)&s_cd, this ) ); \
118 if (aRet.hasValue()) \
120 return BaseClass::queryInterface( rType ); \
122 virtual void SAL_CALL acquire() throw () \
123 { BaseClass::acquire(); } \
124 virtual void SAL_CALL release() throw () \
125 { BaseClass::release(); } \
126 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() \
127 { return ImplInhHelper_getTypes( (class_data *)&s_cd, BaseClass::getTypes() ); } \
128 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() \
129 { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \
131 template< class BaseClass, __CLASS_IFC##N > \
132 class_data##N ImplInheritanceHelper##N< BaseClass, __IFC##N >::s_cd = \
133 __DEF_CLASS_DATA_INIT_EX( N, (ImplInheritanceHelper##N< BaseClass, __IFC##N > *) ); \
134 template< class BaseClass, __CLASS_IFC##N > \
135 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE AggImplInheritanceHelper##N \
139 static class_data##N s_cd; \
141 virtual css::uno::Any SAL_CALL queryInterface( css::uno::Type const & rType ) \
142 { return BaseClass::queryInterface( rType ); } \
143 virtual css::uno::Any SAL_CALL queryAggregation( css::uno::Type const & rType ) \
145 css::uno::Any aRet( ImplHelper_queryNoXInterface( rType, (class_data *)&s_cd, this ) ); \
146 if (aRet.hasValue()) \
148 return BaseClass::queryAggregation( rType ); \
150 virtual void SAL_CALL acquire() throw () \
151 { BaseClass::acquire(); } \
152 virtual void SAL_CALL release() throw () \
153 { BaseClass::release(); } \
154 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() \
155 { return ImplInhHelper_getTypes( (class_data *)&s_cd, BaseClass::getTypes() ); } \
156 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() \
157 { return ImplHelper_getImplementationId( (class_data *)&s_cd ); } \
159 template< class BaseClass, __CLASS_IFC##N > \
160 class_data##N AggImplInheritanceHelper##N< BaseClass, __IFC##N >::s_cd = \
161 __DEF_CLASS_DATA_INIT_EX( N, (AggImplInheritanceHelper##N< BaseClass, __IFC##N > *) ); \
168 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */