20#ifndef INCLUDED_TOOLKIT_HELPER_LISTENERMULTIPLEXER_HXX
21#define INCLUDED_TOOLKIT_HELPER_LISTENERMULTIPLEXER_HXX
23#include <config_options.h>
25#include <com/sun/star/lang/XEventListener.hpp>
26#include <com/sun/star/awt/XFocusListener.hpp>
27#include <com/sun/star/awt/XWindowListener.hpp>
28#include <com/sun/star/awt/XVclContainerListener.hpp>
29#include <com/sun/star/awt/XKeyListener.hpp>
30#include <com/sun/star/awt/XMouseListener.hpp>
31#include <com/sun/star/awt/XMouseMotionListener.hpp>
32#include <com/sun/star/awt/XPaintListener.hpp>
33#include <com/sun/star/awt/XTopWindowListener.hpp>
34#include <com/sun/star/awt/XTextListener.hpp>
35#include <com/sun/star/awt/XActionListener.hpp>
36#include <com/sun/star/awt/XItemListener.hpp>
37#include <com/sun/star/awt/XTabListener.hpp>
38#include <com/sun/star/container/XContainerListener.hpp>
39#include <com/sun/star/awt/XSpinListener.hpp>
40#include <com/sun/star/awt/XAdjustmentListener.hpp>
41#include <com/sun/star/awt/XMenuListener.hpp>
42#include <com/sun/star/awt/tree/XTreeExpansionListener.hpp>
43#include <com/sun/star/awt/tree/XTreeEditListener.hpp>
44#include <com/sun/star/view/XSelectionChangeListener.hpp>
49#include <com/sun/star/awt/grid/XGridSelectionListener.hpp>
50#include <com/sun/star/awt/tab/XTabPageContainerListener.hpp>
54template <
class ListenerT>
56 public css::uno::XInterface
77 css::uno::Any SAL_CALL
queryInterface(
const css::uno::Type & rType)
override
79 return ::cppu::queryInterface(rType,
static_cast<css::uno::XInterface*
>(
this));
82 void SAL_CALL acquire() noexcept
override {
mrContext.acquire(); }
83 void SAL_CALL release() noexcept
override {
mrContext.release(); }
85 void addInterface(
const css::uno::Reference<ListenerT>& l)
87 std::unique_lock g(m_aMutex);
91 void removeInterface(
const css::uno::Reference<ListenerT>& l)
93 std::unique_lock g(m_aMutex);
97 void disposeAndClear(
const css::lang::EventObject& rDisposeEvent)
99 std::unique_lock g(m_aMutex);
103 void disposeAndClear(std::unique_lock<std::mutex>& rGuard,
const css::lang::EventObject& rDisposeEvent)
110 std::unique_lock g(m_aMutex);
114 template <
typename EventT>
115 inline void notifyEach(
void (SAL_CALL ListenerT::*NotificationMethod)(
const EventT&),
116 const EventT& Event)
const
118 std::unique_lock g(m_aMutex);
119 return maListeners.
notifyEach(g, NotificationMethod, Event);
132 void SAL_CALL
focusGained( const css::awt::FocusEvent& e ) override;
133 void SAL_CALL
focusLost( const css::awt::FocusEvent& e ) override;
141 void SAL_CALL
windowMoved( const css::awt::WindowEvent& e ) override;
142 void SAL_CALL
windowShown( const css::lang::EventObject& e ) override;
143 void SAL_CALL
windowHidden( const css::lang::EventObject& e ) override;
150 void SAL_CALL
windowAdded( const css::awt::VclContainerEvent& e ) override;
151 void SAL_CALL
windowRemoved( const css::awt::VclContainerEvent& e ) override;
184 void SAL_CALL
windowPaint( const css::awt::PaintEvent& e ) override;
191 void SAL_CALL
windowOpened( const css::lang::EventObject& e ) override;
193 void SAL_CALL
windowClosed( const css::lang::EventObject& e ) override;
204 void SAL_CALL
textChanged( const css::awt::TextEvent& rEvent ) override;
226 void SAL_CALL
removed( ::sal_Int32 ID ) override;
227 void SAL_CALL
changed( ::sal_Int32 ID, const css::
uno::Sequence< css::beans::NamedValue >& Properties ) override;
236 void SAL_CALL
elementInserted( const css::container::ContainerEvent& Event ) override;
237 void SAL_CALL
elementRemoved( const css::container::ContainerEvent& Event ) override;
238 void SAL_CALL
elementReplaced( const css::container::ContainerEvent& Event ) override;
245 void SAL_CALL
up( const css::awt::SpinEvent& rEvent ) override;
246 void SAL_CALL
down( const css::awt::SpinEvent& rEvent ) override;
247 void SAL_CALL
first( const css::awt::SpinEvent& rEvent ) override;
248 void SAL_CALL
last( const css::awt::SpinEvent& rEvent ) override;
263 void SAL_CALL
itemSelected( const css::awt::MenuEvent& rEvent ) override;
279 virtual
void SAL_CALL
requestChildNodes( const css::awt::tree::TreeExpansionEvent& aEvent ) override;
280 virtual
void SAL_CALL
treeExpanding( const css::awt::tree::TreeExpansionEvent& aEvent ) override;
281 virtual
void SAL_CALL
treeCollapsing( const css::awt::tree::TreeExpansionEvent& aEvent ) override;
282 virtual
void SAL_CALL
treeExpanded( const css::awt::tree::TreeExpansionEvent& aEvent ) override;
283 virtual
void SAL_CALL
treeCollapsed( const css::awt::tree::TreeExpansionEvent& aEvent ) override;
290 virtual
void SAL_CALL
nodeEditing( const css::
uno::Reference< css::awt::tree::XTreeNode >&
Node ) override;
291 virtual
void SAL_CALL
nodeEdited( const css::
uno::Reference< css::awt::tree::XTreeNode >&
Node, const OUString& NewText ) override;
298 void SAL_CALL
selectionChanged( const css::awt::grid::GridSelectionEvent& aEvent ) override;
305 void SAL_CALL
tabPageActivated( const css::awt::tab::TabPageActivatedEvent& aEvent ) override;
const NodeContext & mrContext
sal_Int32 addInterface(std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< ListenerT > &rxIFace)
void notifyEach(std::unique_lock< std::mutex > &rGuard, void(SAL_CALL ListenerT::*NotificationMethod)(const EventT &), const EventT &Event) const
void disposeAndClear(::std::unique_lock<::std::mutex > &rGuard, const css::lang::EventObject &rEvt)
sal_Int32 getLength(std::unique_lock< std::mutex > &rGuard) const
sal_Int32 removeInterface(std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< ListenerT > &rxIFace)
void SAL_CALL windowClosed(const css::lang::EventObject &e) override
void SAL_CALL windowMinimized(const css::lang::EventObject &e) override
DECL_LISTENERMULTIPLEXER_END void SAL_CALL actionPerformed(const css::awt::ActionEvent &rEvent) override
void SAL_CALL windowDeactivated(const css::lang::EventObject &e) override
void SAL_CALL itemDeactivated(const css::awt::MenuEvent &rEvent) override
virtual void SAL_CALL nodeEdited(const css::uno::Reference< css::awt::tree::XTreeNode > &Node, const OUString &NewText) override
virtual void SAL_CALL treeExpanded(const css::awt::tree::TreeExpansionEvent &aEvent) override
DECL_LISTENERMULTIPLEXER_END void SAL_CALL textChanged(const css::awt::TextEvent &rEvent) override
void SAL_CALL windowHidden(const css::lang::EventObject &e) override
void SAL_CALL windowActivated(const css::lang::EventObject &e) override
void SAL_CALL deactivated(::sal_Int32 ID) override
DECL_LISTENERMULTIPLEXER_END void SAL_CALL up(const css::awt::SpinEvent &rEvent) override
DECL_LISTENERMULTIPLEXER_END void SAL_CALL windowResized(const css::awt::WindowEvent &e) override
void SAL_CALL mouseReleased(const css::awt::MouseEvent &e) override
DECL_LISTENERMULTIPLEXER_END void SAL_CALL windowAdded(const css::awt::VclContainerEvent &e) override
void SAL_CALL mouseExited(const css::awt::MouseEvent &e) override
void SAL_CALL itemActivated(const css::awt::MenuEvent &rEvent) override
void SAL_CALL down(const css::awt::SpinEvent &rEvent) override
virtual DECL_LISTENERMULTIPLEXER_END void SAL_CALL selectionChanged(const css::lang::EventObject &aEvent) override
void SAL_CALL elementReplaced(const css::container::ContainerEvent &Event) override
DECL_LISTENERMULTIPLEXER_END void SAL_CALL itemHighlighted(const css::awt::MenuEvent &rEvent) override
DECL_LISTENERMULTIPLEXER_END void SAL_CALL inserted(::sal_Int32 ID) override
void SAL_CALL changed(::sal_Int32 ID, const css::uno::Sequence< css::beans::NamedValue > &Properties) override
void SAL_CALL mouseMoved(const css::awt::MouseEvent &e) override
DECL_LISTENERMULTIPLEXER_END void SAL_CALL windowPaint(const css::awt::PaintEvent &e) override
void SAL_CALL elementRemoved(const css::container::ContainerEvent &Event) override
virtual DECL_LISTENERMULTIPLEXER_END void SAL_CALL nodeEditing(const css::uno::Reference< css::awt::tree::XTreeNode > &Node) override
DECL_LISTENERMULTIPLEXER_END void SAL_CALL mousePressed(const css::awt::MouseEvent &e) override
void SAL_CALL last(const css::awt::SpinEvent &rEvent) override
void SAL_CALL first(const css::awt::SpinEvent &rEvent) override
DECL_LISTENERMULTIPLEXER_END void SAL_CALL windowOpened(const css::lang::EventObject &e) override
void SAL_CALL windowClosing(const css::lang::EventObject &e) override
DECL_LISTENERMULTIPLEXER_END void SAL_CALL elementInserted(const css::container::ContainerEvent &Event) override
void SAL_CALL mouseEntered(const css::awt::MouseEvent &e) override
DECL_LISTENERMULTIPLEXER_END void SAL_CALL itemStateChanged(const css::awt::ItemEvent &rEvent) override
void SAL_CALL removed(::sal_Int32 ID) override
void SAL_CALL windowRemoved(const css::awt::VclContainerEvent &e) override
DECL_LISTENERMULTIPLEXER_END void SAL_CALL keyPressed(const css::awt::KeyEvent &e) override
virtual void SAL_CALL treeCollapsed(const css::awt::tree::TreeExpansionEvent &aEvent) override
void SAL_CALL keyReleased(const css::awt::KeyEvent &e) override
class UNLESS_MERGELIBS(TOOLKIT_DLLPUBLIC) ListenerMultiplexerBase DECL_LISTENERMULTIPLEXER_END void SAL_CALL focusGained(const css::awt::FocusEvent &e) override
void SAL_CALL focusLost(const css::awt::FocusEvent &e) override
virtual void SAL_CALL treeExpanding(const css::awt::tree::TreeExpansionEvent &aEvent) override
void SAL_CALL itemSelected(const css::awt::MenuEvent &rEvent) override
void SAL_CALL windowShown(const css::lang::EventObject &e) override
DECL_LISTENERMULTIPLEXER_END void SAL_CALL tabPageActivated(const css::awt::tab::TabPageActivatedEvent &aEvent) override
void SAL_CALL activated(::sal_Int32 ID) override
virtual DECL_LISTENERMULTIPLEXER_END void SAL_CALL requestChildNodes(const css::awt::tree::TreeExpansionEvent &aEvent) override
DECL_LISTENERMULTIPLEXER_END void SAL_CALL adjustmentValueChanged(const css::awt::AdjustmentEvent &rEvent) override
DECL_LISTENERMULTIPLEXER_END void SAL_CALL mouseDragged(const css::awt::MouseEvent &e) override
virtual void SAL_CALL treeCollapsing(const css::awt::tree::TreeExpansionEvent &aEvent) override
void SAL_CALL windowNormalized(const css::lang::EventObject &e) override
void SAL_CALL windowMoved(const css::awt::WindowEvent &e) override
#define DECL_LISTENERMULTIPLEXER_START(ClassName, InterfaceName)
#define DECL_LISTENERMULTIPLEXER_END
#define DECL_LISTENERMULTIPLEXER_START_DLLPUB(ClassName, InterfaceName)
double getLength(const B2DPolygon &rCandidate)
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)