bump product version to 4.1.6.2
[LibreOffice.git] / include / cppuhelper / implbase_ex.hxx
blob4eb111de898ac649f13a883ed795de438c80da61
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 _CPPUHELPER_IMPLBASE_EX_HXX_
20 #define _CPPUHELPER_IMPLBASE_EX_HXX_
22 #include <cppuhelper/weak.hxx>
23 #include <cppuhelper/weakagg.hxx>
24 #include <com/sun/star/lang/XTypeProvider.hpp>
26 // Despite the fact that the following include is not used in this header, it has to remain,
27 // because it is expected by files including cppuhelper/implbaseN.hxx.
28 // So maybe we can omit it some time in the future...
29 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
31 /* If you need to define implementation helper classes that deal with more than
32 12 interfaces, then use macros as follows, e.g. for 3 interfaces:
34 #include <cppuhelper/implbase_ex_pre.hxx>
35 #define __IFC_EX_TYPE_INIT3( class_cast ) \
36 __IFC_EX_TYPE_INIT( class_cast, 1 ), __IFC_EX_TYPE_INIT( class_cast, 2 ), \
37 __IFC_EX_TYPE_INIT( class_cast, 3 )
38 #include <cppuhelper/implbase_ex_post.hxx>
39 __DEF_IMPLHELPER_EX( 3 )
42 /// @cond INTERNAL
44 namespace cppu
47 /** function pointer signature for getCppuType
49 typedef ::com::sun::star::uno::Type const & (SAL_CALL * fptr_getCppuType)( void * ) SAL_THROW(());
51 /** single type + object offset
53 struct type_entry
55 /** the type_entry is initialized with function pointer to ::getCppuType() function first,
56 but holds an unacquired typelib_TypeDescriptionReference * after initialization,
57 thus reusing the memory. Flag class_data::m_storedTypeRefs
59 union
61 fptr_getCppuType getCppuType;
62 typelib_TypeDescriptionReference * typeRef;
63 } m_type;
64 /** offset for interface pointer
66 sal_IntPtr m_offset;
69 /** identical dummy struct for casting class_dataN to class_data
71 struct class_data
73 /** number of supported types in m_typeEntries
75 sal_Int16 m_nTypes;
77 /** determines whether m_typeEntries is initialized and carries unacquired type refs
79 sal_Bool m_storedTypeRefs;
81 /** determines whether an implementation id was created in m_id
83 sal_Bool m_createdId;
85 /** implementation id
87 sal_Int8 m_id[ 16 ];
89 /** type, object offset
91 type_entry m_typeEntries[ 1 ];
94 /** ImplHelper
96 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Any SAL_CALL ImplHelper_query(
97 ::com::sun::star::uno::Type const & rType,
98 class_data * cd,
99 void * that )
100 SAL_THROW( (::com::sun::star::uno::RuntimeException) );
101 /** ImplHelper
103 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Any SAL_CALL ImplHelper_queryNoXInterface(
104 ::com::sun::star::uno::Type const & rType,
105 class_data * cd,
106 void * that )
107 SAL_THROW( (::com::sun::star::uno::RuntimeException) );
108 /** ImplHelper
110 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >
111 SAL_CALL ImplHelper_getTypes(
112 class_data * cd )
113 SAL_THROW( (::com::sun::star::uno::RuntimeException) );
114 /** ImplHelper
116 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >
117 SAL_CALL ImplInhHelper_getTypes(
118 class_data * cd,
119 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > const & rAddTypes )
120 SAL_THROW( (::com::sun::star::uno::RuntimeException) );
121 /** ImplHelper
123 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Sequence< sal_Int8 >
124 SAL_CALL ImplHelper_getImplementationId(
125 class_data * cd )
126 SAL_THROW( (::com::sun::star::uno::RuntimeException) );
128 /** WeakImplHelper
130 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Any SAL_CALL WeakImplHelper_query(
131 ::com::sun::star::uno::Type const & rType,
132 class_data * cd,
133 void * that,
134 ::cppu::OWeakObject * pBase )
135 SAL_THROW( (::com::sun::star::uno::RuntimeException) );
136 /** WeakImplHelper
138 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >
139 SAL_CALL WeakImplHelper_getTypes(
140 class_data * cd )
141 SAL_THROW( (::com::sun::star::uno::RuntimeException) );
143 /** WeakAggImplHelper
145 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Any
146 SAL_CALL WeakAggImplHelper_queryAgg(
147 ::com::sun::star::uno::Type const & rType,
148 class_data * cd,
149 void * that,
150 ::cppu::OWeakAggObject * pBase )
151 SAL_THROW( (::com::sun::star::uno::RuntimeException) );
152 /** WeakAggImplHelper
154 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >
155 SAL_CALL WeakAggImplHelper_getTypes(
156 class_data * cd )
157 SAL_THROW( (::com::sun::star::uno::RuntimeException) );
161 /// @endcond
163 #endif
165 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */