bump product version to 6.3.0.0.beta1
[LibreOffice.git] / include / cppuhelper / implbase_ex.hxx
blob75f758d460949add9fd1e4cb27043a129b274b05
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 INCLUDED_CPPUHELPER_IMPLBASE_EX_HXX
20 #define INCLUDED_CPPUHELPER_IMPLBASE_EX_HXX
22 #include "com/sun/star/uno/Any.h"
23 #include "com/sun/star/uno/Sequence.h"
24 #include "com/sun/star/uno/Type.h"
25 #include "com/sun/star/uno/genfunc.h"
26 #include "cppuhelper/cppuhelperdllapi.h"
27 #include "sal/types.h"
29 namespace cppu { class OWeakAggObject; }
30 namespace cppu { class OWeakObject; }
33 /* If you need to define implementation helper classes that deal with more than
34 12 interfaces, then use macros as follows, e.g. for 3 interfaces:
36 #include <cppuhelper/implbase_ex_pre.hxx>
37 #define __IFC_EX_TYPE_INIT3( class_cast ) \
38 __IFC_EX_TYPE_INIT( class_cast, 1 ), __IFC_EX_TYPE_INIT( class_cast, 2 ), \
39 __IFC_EX_TYPE_INIT( class_cast, 3 )
40 #include <cppuhelper/implbase_ex_post.hxx>
41 __DEF_IMPLHELPER_EX( 3 )
44 /// @cond INTERNAL
46 namespace cppu
49 /** function pointer signature for getCppuType
51 typedef css::uno::Type const & (SAL_CALL * fptr_getCppuType)( void * );
53 /** single type + object offset
55 struct SAL_WARN_UNUSED type_entry
57 /** the type_entry is initialized with function pointer to ::getCppuType() function first,
58 but holds an unacquired typelib_TypeDescriptionReference * after initialization,
59 thus reusing the memory. Flag class_data::m_storedTypeRefs
61 union
63 fptr_getCppuType getCppuType;
64 typelib_TypeDescriptionReference * typeRef;
65 } m_type;
66 /** offset for interface pointer
68 sal_IntPtr m_offset;
71 /** in the future, this can be a constexpr template method */
72 #define CPPUHELPER_DETAIL_TYPEENTRY(Ifc) \
73 { { Ifc::static_type }, \
74 reinterpret_cast<sal_IntPtr>( static_cast<Ifc *>( reinterpret_cast<Impl *>(16) )) - 16 }
76 /** identical dummy struct for casting class_dataN to class_data
78 struct SAL_WARN_UNUSED class_data
80 /** number of supported types in m_typeEntries
82 sal_Int16 m_nTypes;
84 /** determines whether m_typeEntries is initialized and carries unacquired type refs
86 sal_Bool m_storedTypeRefs;
88 /** determines whether an implementation id was created in m_id
90 sal_Bool m_createdId;
92 /** implementation id
94 sal_Int8 m_id[ 16 ];
96 /** type, object offset
98 type_entry m_typeEntries[ 1 ];
101 /** ImplHelper
103 CPPUHELPER_DLLPUBLIC css::uno::Any SAL_CALL ImplHelper_query(
104 css::uno::Type const & rType,
105 class_data * cd,
106 void * that );
107 /** ImplHelper
109 CPPUHELPER_DLLPUBLIC css::uno::Any SAL_CALL ImplHelper_queryNoXInterface(
110 css::uno::Type const & rType,
111 class_data * cd,
112 void * that );
113 /** ImplHelper
115 CPPUHELPER_DLLPUBLIC css::uno::Sequence< css::uno::Type >
116 SAL_CALL ImplHelper_getTypes(
117 class_data * cd );
118 /** ImplHelper
120 CPPUHELPER_DLLPUBLIC css::uno::Sequence< css::uno::Type >
121 SAL_CALL ImplInhHelper_getTypes(
122 class_data * cd,
123 css::uno::Sequence< css::uno::Type > const & rAddTypes );
124 /** ImplHelper
126 CPPUHELPER_DLLPUBLIC css::uno::Sequence< sal_Int8 >
127 SAL_CALL ImplHelper_getImplementationId(
128 class_data * cd );
130 /** WeakImplHelper
132 CPPUHELPER_DLLPUBLIC css::uno::Any SAL_CALL WeakImplHelper_query(
133 css::uno::Type const & rType,
134 class_data * cd,
135 void * that,
136 ::cppu::OWeakObject * pBase );
137 /** WeakImplHelper
139 CPPUHELPER_DLLPUBLIC css::uno::Sequence< css::uno::Type >
140 SAL_CALL WeakImplHelper_getTypes(
141 class_data * cd );
143 /** WeakAggImplHelper
145 CPPUHELPER_DLLPUBLIC css::uno::Any
146 SAL_CALL WeakAggImplHelper_queryAgg(
147 css::uno::Type const & rType,
148 class_data * cd,
149 void * that,
150 ::cppu::OWeakAggObject * pBase );
151 /** WeakAggImplHelper
153 CPPUHELPER_DLLPUBLIC css::uno::Sequence< css::uno::Type >
154 SAL_CALL WeakAggImplHelper_getTypes(
155 class_data * cd );
159 /// @endcond
161 #endif
163 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */