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 .
21 * This file is part of LibreOffice published API.
23 #ifndef INCLUDED_CPPUHELPER_IMPLBASE_EX_HXX
24 #define INCLUDED_CPPUHELPER_IMPLBASE_EX_HXX
26 #include "com/sun/star/uno/Any.h"
27 #include "com/sun/star/uno/Sequence.h"
28 #include "com/sun/star/uno/Type.h"
29 #include "com/sun/star/uno/genfunc.h"
30 #include "cppuhelper/cppuhelperdllapi.h"
31 #include "sal/types.h"
33 namespace cppu
{ class OWeakAggObject
; }
34 namespace cppu
{ class OWeakObject
; }
37 /* If you need to define implementation helper classes that deal with more than
38 12 interfaces, then use macros as follows, e.g. for 3 interfaces:
40 #include <cppuhelper/implbase_ex_pre.hxx>
41 #define __IFC_EX_TYPE_INIT3( class_cast ) \
42 __IFC_EX_TYPE_INIT( class_cast, 1 ), __IFC_EX_TYPE_INIT( class_cast, 2 ), \
43 __IFC_EX_TYPE_INIT( class_cast, 3 )
44 #include <cppuhelper/implbase_ex_post.hxx>
45 __DEF_IMPLHELPER_EX( 3 )
53 /** function pointer signature for getCppuType
55 typedef css::uno::Type
const & (SAL_CALL
* fptr_getCppuType
)( void * );
57 /** single type + object offset
59 struct SAL_WARN_UNUSED type_entry
61 /** the type_entry is initialized with function pointer to ::getCppuType() function first,
62 but holds an unacquired typelib_TypeDescriptionReference * after initialization,
63 thus reusing the memory. Flag class_data::m_storedTypeRefs
67 fptr_getCppuType getCppuType
;
68 typelib_TypeDescriptionReference
* typeRef
;
70 /** offset for interface pointer
75 /** in the future, this can be a constexpr template method */
76 #define CPPUHELPER_DETAIL_TYPEENTRY(Ifc) \
77 { { Ifc::static_type }, \
78 reinterpret_cast<sal_IntPtr>( static_cast<Ifc *>( reinterpret_cast<Impl *>(16) )) - 16 }
80 /** identical dummy struct for casting class_dataN to class_data
82 struct SAL_WARN_UNUSED class_data
84 /** number of supported types in m_typeEntries
88 /** determines whether m_typeEntries is initialized and carries unacquired type refs
90 sal_Bool m_storedTypeRefs
;
92 /** determines whether an implementation id was created in m_id
100 /** type, object offset
102 type_entry m_typeEntries
[ 1 ];
107 CPPUHELPER_DLLPUBLIC
css::uno::Any SAL_CALL
ImplHelper_query(
108 css::uno::Type
const & rType
,
113 CPPUHELPER_DLLPUBLIC
css::uno::Any SAL_CALL
ImplHelper_queryNoXInterface(
114 css::uno::Type
const & rType
,
119 CPPUHELPER_DLLPUBLIC
css::uno::Sequence
< css::uno::Type
>
120 SAL_CALL
ImplHelper_getTypes(
124 CPPUHELPER_DLLPUBLIC
css::uno::Sequence
< css::uno::Type
>
125 SAL_CALL
ImplInhHelper_getTypes(
127 css::uno::Sequence
< css::uno::Type
> const & rAddTypes
);
130 CPPUHELPER_DLLPUBLIC
css::uno::Sequence
< sal_Int8
>
131 SAL_CALL
ImplHelper_getImplementationId(
136 CPPUHELPER_DLLPUBLIC
css::uno::Any SAL_CALL
WeakImplHelper_query(
137 css::uno::Type
const & rType
,
140 ::cppu::OWeakObject
* pBase
);
143 CPPUHELPER_DLLPUBLIC
css::uno::Sequence
< css::uno::Type
>
144 SAL_CALL
WeakImplHelper_getTypes(
147 /** WeakAggImplHelper
149 CPPUHELPER_DLLPUBLIC
css::uno::Any
150 SAL_CALL
WeakAggImplHelper_queryAgg(
151 css::uno::Type
const & rType
,
154 ::cppu::OWeakAggObject
* pBase
);
155 /** WeakAggImplHelper
157 CPPUHELPER_DLLPUBLIC
css::uno::Sequence
< css::uno::Type
>
158 SAL_CALL
WeakAggImplHelper_getTypes(
167 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */