LibreOffice
LibreOffice 4.2 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
compbase.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 #ifndef INCLUDED_CPPUHELPER_COMPBASE_HXX
20 #define INCLUDED_CPPUHELPER_COMPBASE_HXX
21 
23 #include <cppuhelper/implbase.hxx>
24 
25 /* This header should not be used anymore.
26  @deprecated
27 */
28 
30 
31 #define __DEF_COMPIMPLHELPER_A( N ) \
32 namespace cppu \
33 { \
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 > \
38 { \
39  static ClassData##N s_aCD; \
40 public: \
41  WeakComponentImplHelper##N( ::osl::Mutex & rMutex ) SAL_THROW(()) \
42  : WeakComponentImplHelperBase( rMutex ) \
43  {} \
44  virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException) \
45  { \
46  ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase##N< __IFC##N > *)this ) ); \
47  if (aRet.hasValue()) \
48  return aRet; \
49  return WeakComponentImplHelperBase::queryInterface( rType ); \
50  } \
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(); } \
59 }; \
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 > \
64 { \
65  static ClassData##N s_aCD; \
66 public: \
67  WeakAggComponentImplHelper##N( ::osl::Mutex & rMutex ) SAL_THROW(()) \
68  : WeakAggComponentImplHelperBase( rMutex ) \
69  {} \
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) \
73  { \
74  ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase##N< __IFC##N > *)this ) ); \
75  if (aRet.hasValue()) \
76  return aRet; \
77  return WeakAggComponentImplHelperBase::queryAggregation( rType ); \
78  } \
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(); } \
87 };
88 
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 );
94 
95 #define __DEF_COMPIMPLHELPER_C( N ) \
96 }
97 
98 #define __DEF_COMPIMPLHELPER( N ) \
99 __DEF_COMPIMPLHELPER_A( N ) \
100 __DEF_COMPIMPLHELPER_B( N ) \
101 __DEF_COMPIMPLHELPER_C( N )
102 
104 
105 #endif
106 
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */