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 .
21 * This file is part of LibreOffice published API.
23 #ifndef INCLUDED_CPPUHELPER_COMPBASE9_HXX
24 #define INCLUDED_CPPUHELPER_COMPBASE9_HXX
26 #include "cppuhelper/implbase9.hxx"
27 #include "cppuhelper/compbase_ex.hxx"
32 /** Implementation helper supporting css::lang::XTypeProvider and
33 css::lang::XComponent.
35 Upon disposing objects of this class, sub-classes receive a disposing()
36 call. Objects of this class can be held weakly, i.e. by a
37 css::uno::WeakReference.
40 The life-cycle of the passed mutex reference has to be longer than objects of this class.
43 Inherit from this class giving your interface(s) to be implemented as template argument(s).
44 Your sub class defines method implementations for these interface(s).
46 template< class Ifc1
, class Ifc2
, class Ifc3
, class Ifc4
, class Ifc5
, class Ifc6
, class Ifc7
, class Ifc8
, class Ifc9
>
47 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakComponentImplHelper9
48 : public WeakComponentImplHelperBase
49 , public css::lang::XTypeProvider
50 , public Ifc1
, public Ifc2
, public Ifc3
, public Ifc4
, public Ifc5
, public Ifc6
, public Ifc7
, public Ifc8
, public Ifc9
52 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
> > > {};
54 WeakComponentImplHelper9( ::osl::Mutex
& rMutex
) SAL_NOEXCEPT
55 : WeakComponentImplHelperBase( rMutex
)
57 virtual css::uno::Any SAL_CALL
queryInterface( css::uno::Type
const & rType
) SAL_OVERRIDE
58 { return WeakComponentImplHelper_query( rType
, cd::get(), this, static_cast<WeakComponentImplHelperBase
*>(this) ); }
59 virtual void SAL_CALL
acquire() SAL_NOEXCEPT SAL_OVERRIDE
60 { WeakComponentImplHelperBase::acquire(); }
61 virtual void SAL_CALL
release() SAL_NOEXCEPT SAL_OVERRIDE
62 { WeakComponentImplHelperBase::release(); }
63 virtual void SAL_CALL
dispose() SAL_OVERRIDE
64 { WeakComponentImplHelperBase::dispose(); }
65 virtual void SAL_CALL
addEventListener(const css::uno::Reference
< css::lang::XEventListener
> & xListener
) SAL_OVERRIDE
66 { WeakComponentImplHelperBase::addEventListener(xListener
); }
67 virtual void SAL_CALL
removeEventListener(const css::uno::Reference
< css::lang::XEventListener
> & xListener
) SAL_OVERRIDE
68 { WeakComponentImplHelperBase::removeEventListener(xListener
); }
69 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() SAL_OVERRIDE
70 { return WeakComponentImplHelper_getTypes( cd::get() ); }
71 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() SAL_OVERRIDE
72 { return ImplHelper_getImplementationId( cd::get() ); }
75 /** Same as WeakComponentImplHelper9, except doesn't implement
76 addEventListener, removeEventListener and dispose.
78 This requires derived classes to implement those three methods.
79 This makes it possible to implement classes which are required to
80 implement methods from multiple bases which have different
81 addEventListener/removeEventListener signatures without triggering
82 the g++ overloaded-virtual warning
84 template< class Ifc1
, class Ifc2
, class Ifc3
, class Ifc4
, class Ifc5
, class Ifc6
, class Ifc7
, class Ifc8
, class Ifc9
>
85 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE PartialWeakComponentImplHelper9
86 : public WeakComponentImplHelperBase
87 , public css::lang::XTypeProvider
88 , public Ifc1
, public Ifc2
, public Ifc3
, public Ifc4
, public Ifc5
, public Ifc6
, public Ifc7
, public Ifc8
, public Ifc9
90 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
> > > {};
92 PartialWeakComponentImplHelper9( ::osl::Mutex
& rMutex
) SAL_NOEXCEPT
93 : WeakComponentImplHelperBase( rMutex
)
95 virtual css::uno::Any SAL_CALL
queryInterface( css::uno::Type
const & rType
) SAL_OVERRIDE
96 { return WeakComponentImplHelper_query( rType
, cd::get(), this, static_cast<WeakComponentImplHelperBase
*>(this) ); }
97 virtual void SAL_CALL
acquire() SAL_NOEXCEPT SAL_OVERRIDE
98 { WeakComponentImplHelperBase::acquire(); }
99 virtual void SAL_CALL
release() SAL_NOEXCEPT SAL_OVERRIDE
100 { WeakComponentImplHelperBase::release(); }
101 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() SAL_OVERRIDE
102 { return WeakComponentImplHelper_getTypes( cd::get() ); }
103 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() SAL_OVERRIDE
104 { return ImplHelper_getImplementationId( cd::get() ); }
107 /** Implementation helper supporting css::lang::XTypeProvider and
108 css::lang::XComponent.
109 Upon disposing objects of this class, sub-classes receive a disposing()
110 call. Objects of this class can be held weakly, i.e. by a
111 css::uno::WeakReference. Object of this class can be
112 aggregated, i.e. incoming queryInterface() calls are delegated.
115 The life-cycle of the passed mutex reference has to be longer than objects of this class.
118 Inherit from this class giving your interface(s) to be implemented as template argument(s).
119 Your sub class defines method implementations for these interface(s).
123 template< class Ifc1
, class Ifc2
, class Ifc3
, class Ifc4
, class Ifc5
, class Ifc6
, class Ifc7
, class Ifc8
, class Ifc9
>
124 class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggComponentImplHelper9
125 : public WeakAggComponentImplHelperBase
126 , public css::lang::XTypeProvider
127 , public Ifc1
, public Ifc2
, public Ifc3
, public Ifc4
, public Ifc5
, public Ifc6
, public Ifc7
, public Ifc8
, public Ifc9
129 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
> > > {};
131 WeakAggComponentImplHelper9( ::osl::Mutex
& rMutex
) SAL_NOEXCEPT
132 : WeakAggComponentImplHelperBase( rMutex
)
134 virtual css::uno::Any SAL_CALL
queryInterface( css::uno::Type
const & rType
) SAL_OVERRIDE
135 { return WeakAggComponentImplHelperBase::queryInterface( rType
); }
136 virtual css::uno::Any SAL_CALL
queryAggregation( css::uno::Type
const & rType
) SAL_OVERRIDE
137 { return WeakAggComponentImplHelper_queryAgg( rType
, cd::get(), this, static_cast<WeakAggComponentImplHelperBase
*>(this) ); }
138 virtual void SAL_CALL
acquire() SAL_NOEXCEPT SAL_OVERRIDE
139 { WeakAggComponentImplHelperBase::acquire(); }
140 virtual void SAL_CALL
release() SAL_NOEXCEPT SAL_OVERRIDE
141 { WeakAggComponentImplHelperBase::release(); }
142 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() SAL_OVERRIDE
143 { return WeakAggComponentImplHelper_getTypes( cd::get() ); }
144 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() SAL_OVERRIDE
145 { return ImplHelper_getImplementationId( cd::get() ); }
151 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */