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_COMPBASE_HXX_
20 #define _CPPUHELPER_COMPBASE_HXX_
22 #include <cppuhelper/compbase_ex.hxx>
23 #include <cppuhelper/implbase.hxx>
25 /* This header should not be used anymore.
31 #define __DEF_COMPIMPLHELPER_A( N ) \
34 template< __CLASS_IFC##N > \
35 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakComponentImplHelper##N \
36 : public ::cppu::WeakComponentImplHelperBase \
37 , public ImplHelperBase##N< __IFC##N > \
39 static ClassData##N s_aCD; \
41 WeakComponentImplHelper##N( ::osl::Mutex & rMutex ) SAL_THROW(()) \
42 : WeakComponentImplHelperBase( rMutex ) \
44 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
46 ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase##N< __IFC##N > *)this ) ); \
47 if (aRet.hasValue()) \
49 return WeakComponentImplHelperBase::queryInterface( rType ); \
51 virtual void SAL_CALL acquire() throw () \
52 { WeakComponentImplHelperBase::acquire(); } \
53 virtual void SAL_CALL release() throw () \
54 { WeakComponentImplHelperBase::release(); } \
55 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \
56 { return getClassData( s_aCD ).getTypes(); } \
57 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \
58 { return getClassData( s_aCD ).getImplementationId(); } \
60 template< __CLASS_IFC##N > \
61 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggComponentImplHelper##N \
62 : public ::cppu::WeakAggComponentImplHelperBase \
63 , public ImplHelperBase##N< __IFC##N > \
65 static ClassData##N s_aCD; \
67 WeakAggComponentImplHelper##N( ::osl::Mutex & rMutex ) SAL_THROW(()) \
68 : WeakAggComponentImplHelperBase( rMutex ) \
70 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
71 { return WeakAggComponentImplHelperBase::queryInterface( rType ); } \
72 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
74 ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase##N< __IFC##N > *)this ) ); \
75 if (aRet.hasValue()) \
77 return WeakAggComponentImplHelperBase::queryAggregation( rType ); \
79 virtual void SAL_CALL acquire() throw () \
80 { WeakAggComponentImplHelperBase::acquire(); } \
81 virtual void SAL_CALL release() throw () \
82 { WeakAggComponentImplHelperBase::release(); } \
83 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) \
84 { return getClassData( s_aCD ).getTypes(); } \
85 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) \
86 { return getClassData( s_aCD ).getImplementationId(); } \
89 #define __DEF_COMPIMPLHELPER_B( N ) \
90 template< __CLASS_IFC##N > \
91 ClassData##N WeakComponentImplHelper##N< __IFC##N >::s_aCD = ClassData##N( 4 ); \
92 template< __CLASS_IFC##N > \
93 ClassData##N WeakAggComponentImplHelper##N< __IFC##N >::s_aCD = ClassData##N( 3 );
95 #define __DEF_COMPIMPLHELPER_C( N ) \
98 #define __DEF_COMPIMPLHELPER( N ) \
99 __DEF_COMPIMPLHELPER_A( N ) \
100 __DEF_COMPIMPLHELPER_B( N ) \
101 __DEF_COMPIMPLHELPER_C( N )
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */