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 INCLUDED_CPPUHELPER_COMPBASE9_HXX
20 #define INCLUDED_CPPUHELPER_COMPBASE9_HXX
22 #include "cppuhelper/implbase9.hxx"
23 #include "cppuhelper/compbase_ex.hxx"
28 /** Implementation helper supporting css::lang::XTypeProvider and
29 css::lang::XComponent.
31 Upon disposing objects of this class, sub-classes receive a disposing()
32 call. Objects of this class can be held weakly, i.e. by a
33 css::uno::WeakReference.
36 The life-cycle of the passed mutex reference has to be longer than objects of this class.
39 Inherit from this class giving your interface(s) to be implemented as template argument(s).
40 Your sub class defines method implementations for these interface(s).
42 template< class Ifc1
, class Ifc2
, class Ifc3
, class Ifc4
, class Ifc5
, class Ifc6
, class Ifc7
, class Ifc8
, class Ifc9
>
43 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakComponentImplHelper9
44 : public WeakComponentImplHelperBase
45 , public css::lang::XTypeProvider
46 , public Ifc1
, public Ifc2
, public Ifc3
, public Ifc4
, public Ifc5
, public Ifc6
, public Ifc7
, public Ifc8
, public Ifc9
48 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
> > > {};
50 WeakComponentImplHelper9( ::osl::Mutex
& rMutex
) throw ()
51 : WeakComponentImplHelperBase( rMutex
)
53 virtual css::uno::Any SAL_CALL
queryInterface( css::uno::Type
const & rType
) SAL_OVERRIDE
54 { return WeakComponentImplHelper_query( rType
, cd::get(), this, static_cast<WeakComponentImplHelperBase
*>(this) ); }
55 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
56 { WeakComponentImplHelperBase::acquire(); }
57 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
58 { WeakComponentImplHelperBase::release(); }
59 virtual void SAL_CALL
dispose() SAL_OVERRIDE
60 { WeakComponentImplHelperBase::dispose(); }
61 virtual void SAL_CALL
addEventListener(const css::uno::Reference
< css::lang::XEventListener
> & xListener
) SAL_OVERRIDE
62 { WeakComponentImplHelperBase::addEventListener(xListener
); }
63 virtual void SAL_CALL
removeEventListener(const css::uno::Reference
< css::lang::XEventListener
> & xListener
) SAL_OVERRIDE
64 { WeakComponentImplHelperBase::removeEventListener(xListener
); }
65 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() SAL_OVERRIDE
66 { return WeakComponentImplHelper_getTypes( cd::get() ); }
67 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() SAL_OVERRIDE
68 { return ImplHelper_getImplementationId( cd::get() ); }
71 /** Same as WeakComponentImplHelper9, except doesn't implement
72 addEventListener, removeEventListener and dispose.
74 This requires derived classes to implement those three methods.
75 This makes it possible to implement classes which are required to
76 implement methods from multiple bases which have different
77 addEventListener/removeEventListener signatures without triggering
78 the g++ overloaded-virtual warning
80 template< class Ifc1
, class Ifc2
, class Ifc3
, class Ifc4
, class Ifc5
, class Ifc6
, class Ifc7
, class Ifc8
, class Ifc9
>
81 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE PartialWeakComponentImplHelper9
82 : public WeakComponentImplHelperBase
83 , public css::lang::XTypeProvider
84 , public Ifc1
, public Ifc2
, public Ifc3
, public Ifc4
, public Ifc5
, public Ifc6
, public Ifc7
, public Ifc8
, public Ifc9
86 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
> > > {};
88 PartialWeakComponentImplHelper9( ::osl::Mutex
& rMutex
) throw ()
89 : WeakComponentImplHelperBase( rMutex
)
91 virtual css::uno::Any SAL_CALL
queryInterface( css::uno::Type
const & rType
) SAL_OVERRIDE
92 { return WeakComponentImplHelper_query( rType
, cd::get(), this, static_cast<WeakComponentImplHelperBase
*>(this) ); }
93 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
94 { WeakComponentImplHelperBase::acquire(); }
95 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
96 { WeakComponentImplHelperBase::release(); }
97 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() SAL_OVERRIDE
98 { return WeakComponentImplHelper_getTypes( cd::get() ); }
99 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() SAL_OVERRIDE
100 { return ImplHelper_getImplementationId( cd::get() ); }
103 /** Implementation helper supporting css::lang::XTypeProvider and
104 css::lang::XComponent.
105 Upon disposing objects of this class, sub-classes receive a disposing()
106 call. Objects of this class can be held weakly, i.e. by a
107 css::uno::WeakReference. Object of this class can be
108 aggregated, i.e. incoming queryInterface() calls are delegated.
111 The life-cycle of the passed mutex reference has to be longer than objects of this class.
114 Inherit from this class giving your interface(s) to be implemented as template argument(s).
115 Your sub class defines method implementations for these interface(s).
119 template< class Ifc1
, class Ifc2
, class Ifc3
, class Ifc4
, class Ifc5
, class Ifc6
, class Ifc7
, class Ifc8
, class Ifc9
>
120 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggComponentImplHelper9
121 : public WeakAggComponentImplHelperBase
122 , public css::lang::XTypeProvider
123 , public Ifc1
, public Ifc2
, public Ifc3
, public Ifc4
, public Ifc5
, public Ifc6
, public Ifc7
, public Ifc8
, public Ifc9
125 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
> > > {};
127 WeakAggComponentImplHelper9( ::osl::Mutex
& rMutex
) throw ()
128 : WeakAggComponentImplHelperBase( rMutex
)
130 virtual css::uno::Any SAL_CALL
queryInterface( css::uno::Type
const & rType
) SAL_OVERRIDE
131 { return WeakAggComponentImplHelperBase::queryInterface( rType
); }
132 virtual css::uno::Any SAL_CALL
queryAggregation( css::uno::Type
const & rType
) SAL_OVERRIDE
133 { return WeakAggComponentImplHelper_queryAgg( rType
, cd::get(), this, static_cast<WeakAggComponentImplHelperBase
*>(this) ); }
134 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
135 { WeakAggComponentImplHelperBase::acquire(); }
136 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
137 { WeakAggComponentImplHelperBase::release(); }
138 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() SAL_OVERRIDE
139 { return WeakAggComponentImplHelper_getTypes( cd::get() ); }
140 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() SAL_OVERRIDE
141 { return ImplHelper_getImplementationId( cd::get() ); }
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */