Line data Source code
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 _CPPUHELPER_COMPBASE9_HXX_
20 : #define _CPPUHELPER_COMPBASE9_HXX_
21 :
22 : #include <cppuhelper/implbase9.hxx>
23 : #include <cppuhelper/compbase_ex.hxx>
24 :
25 : namespace cppu
26 : {
27 :
28 : // Suppress warnings about hidden functions in case any of the IfcN has
29 : // functions named dispose, addEventListener, or removeEventListener:
30 : #if defined __SUNPRO_CC
31 : #pragma disable_warn
32 : #endif
33 :
34 : /** Implementation helper supporting com::sun::star::lang::XTypeProvider and
35 : com::sun::star::lang::XComponent.
36 :
37 : Upon disposing objects of this class, sub-classes receive a disposing()
38 : call. Objects of this class can be held weakly, i.e. by a
39 : com::sun::star::uno::WeakReference.
40 :
41 : @attention
42 : The life-cycle of the passed mutex reference has to be longer than objects of this class.
43 :
44 : @derive
45 : Inherit from this class giving your interface(s) to be implemented as template argument(s).
46 : Your sub class defines method implementations for these interface(s).
47 : */
48 : template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9 >
49 514 : class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakComponentImplHelper9
50 : : public WeakComponentImplHelperBase
51 : , public ::com::sun::star::lang::XTypeProvider
52 : , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9
53 : {
54 : struct cd : public rtl::StaticAggregate< class_data, ImplClassData9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, WeakComponentImplHelper9<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9> > > {};
55 : public:
56 856 : inline WeakComponentImplHelper9( ::osl::Mutex & rMutex ) throw ()
57 856 : : WeakComponentImplHelperBase( rMutex )
58 856 : {}
59 7013 : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException)
60 7013 : { return WeakComponentImplHelper_query( rType, cd::get(), this, (WeakComponentImplHelperBase *)this ); }
61 18053 : virtual void SAL_CALL acquire() throw ()
62 18053 : { WeakComponentImplHelperBase::acquire(); }
63 16971 : virtual void SAL_CALL release() throw ()
64 16971 : { WeakComponentImplHelperBase::release(); }
65 513 : virtual void SAL_CALL dispose()throw (::com::sun::star::uno::RuntimeException)
66 513 : { WeakComponentImplHelperBase::dispose(); }
67 0 : virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener)throw (::com::sun::star::uno::RuntimeException)
68 0 : { WeakComponentImplHelperBase::addEventListener(xListener); }
69 0 : virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener)throw (::com::sun::star::uno::RuntimeException)
70 0 : { WeakComponentImplHelperBase::removeEventListener(xListener); }
71 14 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException)
72 14 : { return WeakComponentImplHelper_getTypes( cd::get() ); }
73 14 : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException)
74 14 : { return ImplHelper_getImplementationId( cd::get() ); }
75 : };
76 :
77 : #if defined __SUNPRO_CC
78 : #pragma enable_warn
79 : #endif
80 :
81 : /** Same as WeakComponentImplHelper9, except doesn't implement
82 : addEventListener, removeEventListener and dispose.
83 :
84 : This requires derived classes to implement those three methods.
85 : This makes it possible to implement classes which are required to
86 : implement methods from multiple bases which have different
87 : addEventListener/removeEventListener signatures without triggering
88 : the g++ overloaded-virtual warning
89 : */
90 : template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9 >
91 0 : class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE PartialWeakComponentImplHelper9
92 : : public WeakComponentImplHelperBase
93 : , public ::com::sun::star::lang::XTypeProvider
94 : , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9
95 : {
96 : struct cd : public rtl::StaticAggregate< class_data, ImplClassData9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, PartialWeakComponentImplHelper9<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9> > > {};
97 : public:
98 0 : inline PartialWeakComponentImplHelper9( ::osl::Mutex & rMutex ) throw ()
99 0 : : WeakComponentImplHelperBase( rMutex )
100 0 : {}
101 0 : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException)
102 0 : { return WeakComponentImplHelper_query( rType, cd::get(), this, (WeakComponentImplHelperBase *)this ); }
103 0 : virtual void SAL_CALL acquire() throw ()
104 0 : { WeakComponentImplHelperBase::acquire(); }
105 0 : virtual void SAL_CALL release() throw ()
106 0 : { WeakComponentImplHelperBase::release(); }
107 0 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException)
108 0 : { return WeakComponentImplHelper_getTypes( cd::get() ); }
109 0 : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException)
110 0 : { return ImplHelper_getImplementationId( cd::get() ); }
111 : };
112 :
113 : /** Implementation helper supporting com::sun::star::lang::XTypeProvider and
114 : com::sun::star::lang::XComponent.
115 : Upon disposing objects of this class, sub-classes receive a disposing()
116 : call. Objects of this class can be held weakly, i.e. by a
117 : com::sun::star::uno::WeakReference. Object of this class can be
118 : aggregated, i.e. incoming queryInterface() calls are delegated.
119 :
120 : @attention
121 : The life-cycle of the passed mutex reference has to be longer than objects of this class.
122 :
123 : @derive
124 : Inherit from this class giving your interface(s) to be implemented as template argument(s).
125 : Your sub class defines method implementations for these interface(s).
126 :
127 : @deprecated
128 : */
129 : template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9 >
130 : class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggComponentImplHelper9
131 : : public WeakAggComponentImplHelperBase
132 : , public ::com::sun::star::lang::XTypeProvider
133 : , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9
134 : {
135 : struct cd : public rtl::StaticAggregate< class_data, ImplClassData9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, WeakAggComponentImplHelper9<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9> > > {};
136 : public:
137 : inline WeakAggComponentImplHelper9( ::osl::Mutex & rMutex ) throw ()
138 : : WeakAggComponentImplHelperBase( rMutex )
139 : {}
140 : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException)
141 : { return WeakAggComponentImplHelperBase::queryInterface( rType ); }
142 : virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException)
143 : { return WeakAggComponentImplHelper_queryAgg( rType, cd::get(), this, (WeakAggComponentImplHelperBase *)this ); }
144 : virtual void SAL_CALL acquire() throw ()
145 : { WeakAggComponentImplHelperBase::acquire(); }
146 : virtual void SAL_CALL release() throw ()
147 : { WeakAggComponentImplHelperBase::release(); }
148 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException)
149 : { return WeakAggComponentImplHelper_getTypes( cd::get() ); }
150 : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException)
151 : { return ImplHelper_getImplementationId( cd::get() ); }
152 : };
153 : }
154 :
155 : #endif
156 :
157 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|