Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _CPPUHELPER_COMPBASE7_HXX_
29 : : #define _CPPUHELPER_COMPBASE7_HXX_
30 : :
31 : : #include <cppuhelper/implbase7.hxx>
32 : : #include <cppuhelper/compbase_ex.hxx>
33 : :
34 : : namespace cppu
35 : : {
36 : :
37 : : // Suppress warnings about hidden functions in case any of the IfcN has
38 : : // functions named dispose, addEventListener, or removeEventListener:
39 : : #if defined __SUNPRO_CC
40 : : #pragma disable_warn
41 : : #endif
42 : :
43 : : /** Implementation helper supporting com::sun::star::lang::XTypeProvider and
44 : : com::sun::star::lang::XComponent.
45 : :
46 : : Upon disposing objects of this class, sub-classes receive a disposing()
47 : : call. Objects of this class can be held weakly, i.e. by a
48 : : com::sun::star::uno::WeakReference.
49 : :
50 : : @attention
51 : : The life-cycle of the passed mutex reference has to be longer than objects of this class.
52 : :
53 : : @derive
54 : : Inherit from this class giving your interface(s) to be implemented as template argument(s).
55 : : Your sub class defines method implementations for these interface(s).
56 : : */
57 : : template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 >
58 [ - + ]: 28162 : class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakComponentImplHelper7
59 : : : public WeakComponentImplHelperBase
60 : : , public ::com::sun::star::lang::XTypeProvider
61 : : , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7
62 : : {
63 : : struct cd : public rtl::StaticAggregate< class_data, ImplClassData7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, WeakComponentImplHelper7<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7> > > {};
64 : : public:
65 : 28652 : inline WeakComponentImplHelper7( ::osl::Mutex & rMutex ) throw ()
66 : 28652 : : WeakComponentImplHelperBase( rMutex )
67 : 28652 : {}
68 : 35722 : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException)
69 : 35722 : { return WeakComponentImplHelper_query( rType, cd::get(), this, (WeakComponentImplHelperBase *)this ); }
70 : 193654 : virtual void SAL_CALL acquire() throw ()
71 : 193654 : { WeakComponentImplHelperBase::acquire(); }
72 : 191982 : virtual void SAL_CALL release() throw ()
73 : 191982 : { WeakComponentImplHelperBase::release(); }
74 : 28162 : virtual void SAL_CALL dispose()throw (::com::sun::star::uno::RuntimeException)
75 : 28162 : { WeakComponentImplHelperBase::dispose(); }
76 : 0 : virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener)throw (::com::sun::star::uno::RuntimeException)
77 : 0 : { WeakComponentImplHelperBase::addEventListener(xListener); }
78 : 0 : virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener)throw (::com::sun::star::uno::RuntimeException)
79 : 0 : { WeakComponentImplHelperBase::removeEventListener(xListener); }
80 : 0 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException)
81 : 0 : { return WeakComponentImplHelper_getTypes( cd::get() ); }
82 : 0 : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException)
83 : 0 : { return ImplHelper_getImplementationId( cd::get() ); }
84 : : };
85 : :
86 : : #if defined __SUNPRO_CC
87 : : #pragma enable_warn
88 : : #endif
89 : :
90 : : /** Same as WeakComponentImplHelper7, except doesn't implement
91 : : addEventListener, removeEventListener and dispose.
92 : :
93 : : This requires derived classes to implement those three methods.
94 : : This makes it possible to implement classes which are required to
95 : : implement methods from multiple bases which have different
96 : : addEventListener/removeEventListener signatures without triggering
97 : : the g++ overloaded-virtual warning
98 : : */
99 : : template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 >
100 : : class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE PartialWeakComponentImplHelper7
101 : : : public WeakComponentImplHelperBase
102 : : , public ::com::sun::star::lang::XTypeProvider
103 : : , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7
104 : : {
105 : : struct cd : public rtl::StaticAggregate< class_data, ImplClassData7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, PartialWeakComponentImplHelper7<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7> > > {};
106 : : public:
107 : : inline PartialWeakComponentImplHelper7( ::osl::Mutex & rMutex ) throw ()
108 : : : WeakComponentImplHelperBase( rMutex )
109 : : {}
110 : : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException)
111 : : { return WeakComponentImplHelper_query( rType, cd::get(), this, (WeakComponentImplHelperBase *)this ); }
112 : : virtual void SAL_CALL acquire() throw ()
113 : : { WeakComponentImplHelperBase::acquire(); }
114 : : virtual void SAL_CALL release() throw ()
115 : : { WeakComponentImplHelperBase::release(); }
116 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException)
117 : : { return WeakComponentImplHelper_getTypes( cd::get() ); }
118 : : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException)
119 : : { return ImplHelper_getImplementationId( cd::get() ); }
120 : : };
121 : :
122 : : /** Implementation helper supporting com::sun::star::lang::XTypeProvider and
123 : : com::sun::star::lang::XComponent.
124 : :
125 : : Upon disposing objects of this class, sub-classes receive a disposing()
126 : : call. Objects of this class can be held weakly, i.e. by a
127 : : com::sun::star::uno::WeakReference. Object of this class can be
128 : : aggregated, i.e. incoming queryInterface() calls are delegated.
129 : :
130 : : @attention
131 : : The life-cycle of the passed mutex reference has to be longer than objects of this class.
132 : :
133 : : @derive
134 : : Inherit from this class giving your interface(s) to be implemented as template argument(s).
135 : : Your sub class defines method implementations for these interface(s).
136 : :
137 : : @deprecated
138 : : */
139 : : template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 >
140 [ # # ]: 0 : class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggComponentImplHelper7
141 : : : public WeakAggComponentImplHelperBase
142 : : , public ::com::sun::star::lang::XTypeProvider
143 : : , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7
144 : : {
145 : : struct cd : public rtl::StaticAggregate< class_data, ImplClassData7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, WeakAggComponentImplHelper7<Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7> > > {};
146 : : public:
147 : 0 : inline WeakAggComponentImplHelper7( ::osl::Mutex & rMutex ) throw ()
148 : 0 : : WeakAggComponentImplHelperBase( rMutex )
149 : 0 : {}
150 : 0 : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException)
151 : 0 : { return WeakAggComponentImplHelperBase::queryInterface( rType ); }
152 : 0 : virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException)
153 : 0 : { return WeakAggComponentImplHelper_queryAgg( rType, cd::get(), this, (WeakAggComponentImplHelperBase *)this ); }
154 : 0 : virtual void SAL_CALL acquire() throw ()
155 : 0 : { WeakAggComponentImplHelperBase::acquire(); }
156 : 0 : virtual void SAL_CALL release() throw ()
157 : 0 : { WeakAggComponentImplHelperBase::release(); }
158 : 0 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException)
159 : 0 : { return WeakAggComponentImplHelper_getTypes( cd::get() ); }
160 : 0 : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException)
161 : 0 : { return ImplHelper_getImplementationId( cd::get() ); }
162 : : };
163 : : }
164 : :
165 : : #endif
166 : :
167 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|