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 _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 )
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
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
61 fptr_getCppuType getCppuType
;
62 typelib_TypeDescriptionReference
* typeRef
;
64 /** offset for interface pointer
69 /** identical dummy struct for casting class_dataN to class_data
73 /** number of supported types in m_typeEntries
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
89 /** type, object offset
91 type_entry m_typeEntries
[ 1 ];
96 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Any SAL_CALL
ImplHelper_query(
97 ::com::sun::star::uno::Type
const & rType
,
100 SAL_THROW( (::com::sun::star::uno::RuntimeException
) );
103 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Any SAL_CALL
ImplHelper_queryNoXInterface(
104 ::com::sun::star::uno::Type
const & rType
,
107 SAL_THROW( (::com::sun::star::uno::RuntimeException
) );
110 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
>
111 SAL_CALL
ImplHelper_getTypes(
113 SAL_THROW( (::com::sun::star::uno::RuntimeException
) );
116 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
>
117 SAL_CALL
ImplInhHelper_getTypes(
119 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> const & rAddTypes
)
120 SAL_THROW( (::com::sun::star::uno::RuntimeException
) );
123 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Sequence
< sal_Int8
>
124 SAL_CALL
ImplHelper_getImplementationId(
126 SAL_THROW( (::com::sun::star::uno::RuntimeException
) );
130 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Any SAL_CALL
WeakImplHelper_query(
131 ::com::sun::star::uno::Type
const & rType
,
134 ::cppu::OWeakObject
* pBase
)
135 SAL_THROW( (::com::sun::star::uno::RuntimeException
) );
138 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
>
139 SAL_CALL
WeakImplHelper_getTypes(
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
,
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(
157 SAL_THROW( (::com::sun::star::uno::RuntimeException
) );
165 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */