19#ifndef INCLUDED_COMPHELPER_INTERFACECONTAINER2_H
20#define INCLUDED_COMPHELPER_INTERFACECONTAINER2_H
26#include <com/sun/star/lang/EventObject.hpp>
28#include <com/sun/star/lang/DisposedException.hpp>
32namespace osl {
class Mutex; }
45 std::vector< css::uno::Reference< css::uno::XInterface > > *
pAsVector;
53class OInterfaceContainerHelper2;
86 {
return nRemain != 0; }
91 css::uno::XInterface * next();
146 std::vector< css::uno::Reference< css::uno::XInterface > > getElements()
const;
164 sal_Int32 addInterface(
const css::uno::Reference< css::uno::XInterface > & rxIFace );
172 sal_Int32 removeInterface(
const css::uno::Reference< css::uno::XInterface > & rxIFace );
174 css::uno::Reference< css::uno::XInterface > getInterface(sal_Int32 nIndex)
const;
179 void disposeAndClear(
const css::lang::EventObject & rEvt );
196 template <
typename ListenerT,
typename FuncT>
197 inline void forEach( FuncT
const& func );
220 template<
typename ListenerT,
typename EventT >
221 inline void notifyEach(
void ( SAL_CALL ListenerT::*NotificationMethod )(
const EventT& ),
const EventT& Event );
243 void copyAndResetInUse();
246 template<
typename ListenerT,
typename EventT >
250 typedef void ( SAL_CALL ListenerT::*NotificationMethod )(
const EventT& );
256 void operator()(
const css::uno::Reference<ListenerT>& listener )
const
263template <
typename ListenerT,
typename FuncT>
268 css::uno::Reference<ListenerT>
const xListener( iter.
next(), css::uno::UNO_QUERY );
269 if (xListener.is()) {
273 catch (css::lang::DisposedException
const& exc) {
274 if (exc.Context == xListener)
281template<
typename ListenerT,
typename EventT >
NotificationMethod const m_pMethod
NotifySingleListener(NotificationMethod method, const EventT &event)
void operator()(const css::uno::Reference< ListenerT > &listener) const
typedef void(SAL_CALL ListenerT::*NotificationMethod)(const EventT &)
A container of interfaces.
void forEach(FuncT const &func)
Executes a functor for each contained listener of specified type, e.g.
void notifyEach(void(SAL_CALL ListenerT::*NotificationMethod)(const EventT &), const EventT &Event)
Calls a UNO listener method for each contained listener.
bool bIsList
TRUE -> aData.pAsVector is of type Sequence< XInterfaceSequence >.
OInterfaceContainerHelper2(const OInterfaceContainerHelper2 &)=delete
bool bInUse
TRUE -> used by an iterator.
OInterfaceContainerHelper2(::osl::Mutex &rMutex)
Create an interface container.
detail::element_alias2 aData
bIsList == TRUE -> aData.pAsVector of type vector< XInterfaceSequence >, otherwise aData....
This is the iterator of an OInterfaceContainerHelper2.
css::uno::XInterface * next()
Return the next element of the iterator.
bool hasMoreElements() const
Return true, if there are more elements in the iterator.
void remove()
Removes the current element (the last one returned by next()) from the underlying container.
OInterfaceContainerHelper2 & rCont
detail::element_alias2 aData
OInterfaceIteratorHelper2(const OInterfaceIteratorHelper2 &)=delete
#define COMPHELPER_DLLPUBLIC
const ContainerEvent & m_rEvent
ContainerApprovalMethod m_pMethod
double getLength(const B2DPolygon &rCandidate)
OUStringBuffer & remove(OUStringBuffer &rIn, sal_Unicode c)
Removes all occurrences of a character from within the source string.
This is here to optimise space in the common case that there are zero or one listeners.
css::uno::XInterface * pAsInterface
std::vector< css::uno::Reference< css::uno::XInterface > > * pAsVector