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_HXX
20 #define INCLUDED_CPPUHELPER_IMPLBASE_EX_HXX
22 #include <cppuhelper/weak.hxx>
23 #include <cppuhelper/weakagg.hxx>
24 #include <com/sun/star/lang/XTypeProvider.hpp>
27 /* If you need to define implementation helper classes that deal with more than
28 12 interfaces, then use macros as follows, e.g. for 3 interfaces:
30 #include <cppuhelper/implbase_ex_pre.hxx>
31 #define __IFC_EX_TYPE_INIT3( class_cast ) \
32 __IFC_EX_TYPE_INIT( class_cast, 1 ), __IFC_EX_TYPE_INIT( class_cast, 2 ), \
33 __IFC_EX_TYPE_INIT( class_cast, 3 )
34 #include <cppuhelper/implbase_ex_post.hxx>
35 __DEF_IMPLHELPER_EX( 3 )
43 /** function pointer signature for getCppuType
45 typedef css::uno::Type
const & (SAL_CALL
* fptr_getCppuType
)( void * );
47 /** single type + object offset
49 struct SAL_WARN_UNUSED type_entry
51 /** the type_entry is initialized with function pointer to ::getCppuType() function first,
52 but holds an unacquired typelib_TypeDescriptionReference * after initialization,
53 thus reusing the memory. Flag class_data::m_storedTypeRefs
57 fptr_getCppuType getCppuType
;
58 typelib_TypeDescriptionReference
* typeRef
;
60 /** offset for interface pointer
65 /** in the future, this can be a constexpr template method */
66 #define CPPUHELPER_DETAIL_TYPEENTRY(Ifc) \
67 { { Ifc::static_type }, \
68 reinterpret_cast<sal_IntPtr>( static_cast<Ifc *>( reinterpret_cast<Impl *>(16) )) - 16 }
70 /** identical dummy struct for casting class_dataN to class_data
72 struct SAL_WARN_UNUSED class_data
74 /** number of supported types in m_typeEntries
78 /** determines whether m_typeEntries is initialized and carries unacquired type refs
80 sal_Bool m_storedTypeRefs
;
82 /** determines whether an implementation id was created in m_id
90 /** type, object offset
92 type_entry m_typeEntries
[ 1 ];
97 CPPUHELPER_DLLPUBLIC
css::uno::Any SAL_CALL
ImplHelper_query(
98 css::uno::Type
const & rType
,
103 CPPUHELPER_DLLPUBLIC
css::uno::Any SAL_CALL
ImplHelper_queryNoXInterface(
104 css::uno::Type
const & rType
,
109 CPPUHELPER_DLLPUBLIC
css::uno::Sequence
< css::uno::Type
>
110 SAL_CALL
ImplHelper_getTypes(
114 CPPUHELPER_DLLPUBLIC
css::uno::Sequence
< css::uno::Type
>
115 SAL_CALL
ImplInhHelper_getTypes(
117 css::uno::Sequence
< css::uno::Type
> const & rAddTypes
);
120 CPPUHELPER_DLLPUBLIC
css::uno::Sequence
< sal_Int8
>
121 SAL_CALL
ImplHelper_getImplementationId(
126 CPPUHELPER_DLLPUBLIC
css::uno::Any SAL_CALL
WeakImplHelper_query(
127 css::uno::Type
const & rType
,
130 ::cppu::OWeakObject
* pBase
);
133 CPPUHELPER_DLLPUBLIC
css::uno::Sequence
< css::uno::Type
>
134 SAL_CALL
WeakImplHelper_getTypes(
137 /** WeakAggImplHelper
139 CPPUHELPER_DLLPUBLIC
css::uno::Any
140 SAL_CALL
WeakAggImplHelper_queryAgg(
141 css::uno::Type
const & rType
,
144 ::cppu::OWeakAggObject
* pBase
);
145 /** WeakAggImplHelper
147 CPPUHELPER_DLLPUBLIC
css::uno::Sequence
< css::uno::Type
>
148 SAL_CALL
WeakAggImplHelper_getTypes(
157 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */