LibreOffice Module UnoControls (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
unocontrols::OMRCListenerMultiplexerHelper Class Referencefinal

#include <multiplexer.hxx>

Inheritance diagram for unocontrols::OMRCListenerMultiplexerHelper:
[legend]
Collaboration diagram for unocontrols::OMRCListenerMultiplexerHelper:
[legend]

Public Member Functions

 OMRCListenerMultiplexerHelper (const css::uno::Reference< css::awt::XWindow > &xControl, const css::uno::Reference< css::awt::XWindow > &xPeer)
 constructor @descr Create a Multiplexer of XWindowEvents. More...
 
 OMRCListenerMultiplexerHelper (const OMRCListenerMultiplexerHelper &aCopyInstance)
 copy-constructor @descr More...
 
virtual ~OMRCListenerMultiplexerHelper () override
 
virtual css::uno::Any SAL_CALL queryInterface (const css::uno::Type &aType) override
 give answer, if interface is supported @descr The interfaces are searched by type. More...
 
virtual void SAL_CALL acquire () noexcept override
 increment refcount @seealso XInterface @seealso release() @onerror A RuntimeException is thrown. More...
 
virtual void SAL_CALL release () noexcept override
 decrement refcount @seealso XInterface @seealso acquire() @onerror A RuntimeException is thrown. More...
 
OMRCListenerMultiplexerHelperoperator= (const OMRCListenerMultiplexerHelper &aCopyInstance)
 
void setPeer (const css::uno::Reference< css::awt::XWindow > &xPeer)
 Remove all listeners from the previous set peer and add the needed listeners to rPeer. More...
 
void disposeAndClear ()
 Remove all listeners and send a disposing message. More...
 
void advise (const css::uno::Type &aType, const css::uno::Reference< css::uno::XInterface > &xListener)
 Add the specified listener to the source. More...
 
void unadvise (const css::uno::Type &aType, const css::uno::Reference< css::uno::XInterface > &xListener)
 Remove the specified listener from the source. More...
 
virtual void SAL_CALL disposing (const css::lang::EventObject &aSource) override
 
virtual void SAL_CALL focusGained (const css::awt::FocusEvent &aEvent) override
 
virtual void SAL_CALL focusLost (const css::awt::FocusEvent &aEvent) override
 
virtual void SAL_CALL windowResized (const css::awt::WindowEvent &aEvent) override
 
virtual void SAL_CALL windowMoved (const css::awt::WindowEvent &aEvent) override
 
virtual void SAL_CALL windowShown (const css::lang::EventObject &aEvent) override
 
virtual void SAL_CALL windowHidden (const css::lang::EventObject &aEvent) override
 
virtual void SAL_CALL keyPressed (const css::awt::KeyEvent &aEvent) override
 
virtual void SAL_CALL keyReleased (const css::awt::KeyEvent &aEvent) override
 
virtual void SAL_CALL mousePressed (const css::awt::MouseEvent &aEvent) override
 
virtual void SAL_CALL mouseReleased (const css::awt::MouseEvent &aEvent) override
 
virtual void SAL_CALL mouseEntered (const css::awt::MouseEvent &aEvent) override
 
virtual void SAL_CALL mouseExited (const css::awt::MouseEvent &aEvent) override
 
virtual void SAL_CALL mouseDragged (const css::awt::MouseEvent &aEvent) override
 
virtual void SAL_CALL mouseMoved (const css::awt::MouseEvent &aEvent) override
 
virtual void SAL_CALL windowPaint (const css::awt::PaintEvent &aEvent) override
 
virtual void SAL_CALL windowOpened (const css::lang::EventObject &aEvent) override
 
virtual void SAL_CALL windowClosing (const css::lang::EventObject &aEvent) override
 
virtual void SAL_CALL windowClosed (const css::lang::EventObject &aEvent) override
 
virtual void SAL_CALL windowMinimized (const css::lang::EventObject &aEvent) override
 
virtual void SAL_CALL windowNormalized (const css::lang::EventObject &aEvent) override
 
virtual void SAL_CALL windowActivated (const css::lang::EventObject &aEvent) override
 
virtual void SAL_CALL windowDeactivated (const css::lang::EventObject &aEvent) override
 
- Public Member Functions inherited from cppu::OWeakObject
 OWeakObject ()
 
 OWeakObject (const OWeakObject &)
 
OWeakObject &SAL_CALL operator= (const OWeakObject &)
 
virtual css::uno::Any SAL_CALL queryInterface (const css::uno::Type &rType) SAL_OVERRIDE
 
virtual void SAL_CALL acquire () SAL_NOEXCEPT SAL_OVERRIDE
 
virtual void SAL_CALL release () SAL_NOEXCEPT SAL_OVERRIDE
 
virtual css::uno::Reference< css::uno::XAdapter > SAL_CALL queryAdapter () SAL_OVERRIDE
 
SAL_CALL operator css::uno::Reference< css::uno::XInterface > ()
 

Private Member Functions

void impl_adviseToPeer (const css::uno::Reference< css::awt::XWindow > &xPeer, const css::uno::Type &aType)
 Remove the listener from the peer. More...
 
void impl_unadviseFromPeer (const css::uno::Reference< css::awt::XWindow > &xPeer, const css::uno::Type &aType)
 Add the listener to the peer. More...
 

Private Attributes

::osl::Mutex m_aMutex
 
css::uno::Reference< css::awt::XWindow > m_xPeer
 
css::uno::WeakReference< css::awt::XWindow > m_xControl
 The source of the events. Normally this is the peer object. More...
 
comphelper::OMultiTypeInterfaceContainerHelper2 m_aListenerHolder
 

Additional Inherited Members

- Protected Member Functions inherited from cppu::OWeakObject
virtual ~OWeakObject () COVERITY_NOEXCEPT_FALSE
 
void disposeWeakConnectionPoint ()
 
- Protected Attributes inherited from cppu::OWeakObject
oslInterlockedCount m_refCount
 

Detailed Description

Definition at line 41 of file multiplexer.hxx.

Constructor & Destructor Documentation

◆ OMRCListenerMultiplexerHelper() [1/2]

unocontrols::OMRCListenerMultiplexerHelper::OMRCListenerMultiplexerHelper ( const css::uno::Reference< css::awt::XWindow > &  xControl,
const css::uno::Reference< css::awt::XWindow > &  xPeer 
)

constructor @descr Create a Multiplexer of XWindowEvents.

Parameters
rControlThe control. All listeners think that this is the original broadcaster.
rPeerThe peer from which the original events are dispatched. Null is allowed.

◆ OMRCListenerMultiplexerHelper() [2/2]

unocontrols::OMRCListenerMultiplexerHelper::OMRCListenerMultiplexerHelper ( const OMRCListenerMultiplexerHelper aCopyInstance)

copy-constructor @descr

Parameters
rCopyInstanceC++-Reference to instance to make copy from.

Definition at line 75 of file multiplexer.cxx.

References m_aMutex.

◆ ~OMRCListenerMultiplexerHelper()

unocontrols::OMRCListenerMultiplexerHelper::~OMRCListenerMultiplexerHelper ( )
overridevirtual

Definition at line 88 of file multiplexer.cxx.

Member Function Documentation

◆ acquire()

void SAL_CALL unocontrols::OMRCListenerMultiplexerHelper::acquire ( )
overridevirtualnoexcept

increment refcount @seealso XInterface @seealso release() @onerror A RuntimeException is thrown.

Reimplemented from cppu::OWeakObject.

Definition at line 128 of file multiplexer.cxx.

◆ advise()

void unocontrols::OMRCListenerMultiplexerHelper::advise ( const css::uno::Type &  aType,
const css::uno::Reference< css::uno::XInterface > &  xListener 
)

◆ disposeAndClear()

void unocontrols::OMRCListenerMultiplexerHelper::disposeAndClear ( )

Remove all listeners and send a disposing message.

Definition at line 177 of file multiplexer.cxx.

References aEvent, comphelper::OMultiTypeInterfaceContainerHelper2::disposeAndClear(), m_aListenerHolder, and m_xControl.

◆ disposing()

void SAL_CALL unocontrols::OMRCListenerMultiplexerHelper::disposing ( const css::lang::EventObject &  aSource)
overridevirtual

Definition at line 218 of file multiplexer.cxx.

References m_aMutex, and m_xPeer.

◆ focusGained()

void unocontrols::OMRCListenerMultiplexerHelper::focusGained ( const css::awt::FocusEvent &  aEvent)
overridevirtual

Definition at line 227 of file multiplexer.cxx.

References aEvent, focusGained(), and MULTIPLEX.

Referenced by focusGained().

◆ focusLost()

void unocontrols::OMRCListenerMultiplexerHelper::focusLost ( const css::awt::FocusEvent &  aEvent)
overridevirtual

Definition at line 234 of file multiplexer.cxx.

References aEvent, focusLost(), and MULTIPLEX.

Referenced by focusLost().

◆ impl_adviseToPeer()

void unocontrols::OMRCListenerMultiplexerHelper::impl_adviseToPeer ( const css::uno::Reference< css::awt::XWindow > &  xPeer,
const css::uno::Type &  aType 
)
private

Remove the listener from the peer.

Parameters
xPeerThe peer from which the listener is removed.
rTypeThe listener type, which specify the type of the listener.

Definition at line 381 of file multiplexer.cxx.

Referenced by advise(), and setPeer().

◆ impl_unadviseFromPeer()

void unocontrols::OMRCListenerMultiplexerHelper::impl_unadviseFromPeer ( const css::uno::Reference< css::awt::XWindow > &  xPeer,
const css::uno::Type &  aType 
)
private

Add the listener to the peer.

Parameters
xPeerThe peer to which the listener is added.
rTypeThe listener type, which specify the type of the listener.

Definition at line 411 of file multiplexer.cxx.

Referenced by setPeer(), and unadvise().

◆ keyPressed()

void unocontrols::OMRCListenerMultiplexerHelper::keyPressed ( const css::awt::KeyEvent &  aEvent)
overridevirtual

Definition at line 269 of file multiplexer.cxx.

References aEvent, keyPressed(), and MULTIPLEX.

Referenced by keyPressed().

◆ keyReleased()

void unocontrols::OMRCListenerMultiplexerHelper::keyReleased ( const css::awt::KeyEvent &  aEvent)
overridevirtual

Definition at line 276 of file multiplexer.cxx.

References aEvent, keyReleased(), and MULTIPLEX.

Referenced by keyReleased().

◆ mouseDragged()

void unocontrols::OMRCListenerMultiplexerHelper::mouseDragged ( const css::awt::MouseEvent &  aEvent)
overridevirtual

Definition at line 311 of file multiplexer.cxx.

References aEvent, mouseDragged(), and MULTIPLEX.

Referenced by mouseDragged().

◆ mouseEntered()

void unocontrols::OMRCListenerMultiplexerHelper::mouseEntered ( const css::awt::MouseEvent &  aEvent)
overridevirtual

Definition at line 297 of file multiplexer.cxx.

References aEvent, mouseEntered(), and MULTIPLEX.

Referenced by mouseEntered().

◆ mouseExited()

void unocontrols::OMRCListenerMultiplexerHelper::mouseExited ( const css::awt::MouseEvent &  aEvent)
overridevirtual

Definition at line 304 of file multiplexer.cxx.

References aEvent, mouseExited(), and MULTIPLEX.

Referenced by mouseExited().

◆ mouseMoved()

void unocontrols::OMRCListenerMultiplexerHelper::mouseMoved ( const css::awt::MouseEvent &  aEvent)
overridevirtual

Definition at line 318 of file multiplexer.cxx.

References aEvent, mouseMoved(), and MULTIPLEX.

Referenced by mouseMoved().

◆ mousePressed()

void unocontrols::OMRCListenerMultiplexerHelper::mousePressed ( const css::awt::MouseEvent &  aEvent)
overridevirtual

Definition at line 283 of file multiplexer.cxx.

References aEvent, mousePressed(), and MULTIPLEX.

Referenced by mousePressed().

◆ mouseReleased()

void unocontrols::OMRCListenerMultiplexerHelper::mouseReleased ( const css::awt::MouseEvent &  aEvent)
overridevirtual

Definition at line 290 of file multiplexer.cxx.

References aEvent, mouseReleased(), and MULTIPLEX.

Referenced by mouseReleased().

◆ operator=()

OMRCListenerMultiplexerHelper & unocontrols::OMRCListenerMultiplexerHelper::operator= ( const OMRCListenerMultiplexerHelper aCopyInstance)

◆ queryInterface()

Any SAL_CALL unocontrols::OMRCListenerMultiplexerHelper::queryInterface ( const css::uno::Type &  aType)
overridevirtual

give answer, if interface is supported @descr The interfaces are searched by type.

@seealso XInterface

Parameters
rTypeis the type of searched interface.
Returns
Any information about found interface

@onerror A RuntimeException is thrown.

Reimplemented from cppu::OWeakObject.

Definition at line 94 of file multiplexer.cxx.

References Any.

◆ release()

void SAL_CALL unocontrols::OMRCListenerMultiplexerHelper::release ( )
overridevirtualnoexcept

decrement refcount @seealso XInterface @seealso acquire() @onerror A RuntimeException is thrown.

Reimplemented from cppu::OWeakObject.

Definition at line 139 of file multiplexer.cxx.

◆ setPeer()

void unocontrols::OMRCListenerMultiplexerHelper::setPeer ( const css::uno::Reference< css::awt::XWindow > &  xPeer)

Remove all listeners from the previous set peer and add the needed listeners to rPeer.

Parameters
rPeerThe peer from which the original events are dispatched. Null is allowed.

Definition at line 150 of file multiplexer.cxx.

References comphelper::OMultiTypeInterfaceContainerHelper2::getContainedTypes(), impl_adviseToPeer(), impl_unadviseFromPeer(), m_aListenerHolder, m_aMutex, and m_xPeer.

◆ unadvise()

void unocontrols::OMRCListenerMultiplexerHelper::unadvise ( const css::uno::Type &  aType,
const css::uno::Reference< css::uno::XInterface > &  xListener 
)

◆ windowActivated()

void unocontrols::OMRCListenerMultiplexerHelper::windowActivated ( const css::lang::EventObject &  aEvent)
overridevirtual

Definition at line 367 of file multiplexer.cxx.

References aEvent, MULTIPLEX, and windowActivated().

Referenced by windowActivated().

◆ windowClosed()

void unocontrols::OMRCListenerMultiplexerHelper::windowClosed ( const css::lang::EventObject &  aEvent)
overridevirtual

Definition at line 346 of file multiplexer.cxx.

References aEvent, MULTIPLEX, and windowClosed().

Referenced by windowClosed().

◆ windowClosing()

void unocontrols::OMRCListenerMultiplexerHelper::windowClosing ( const css::lang::EventObject &  aEvent)
overridevirtual

Definition at line 339 of file multiplexer.cxx.

References aEvent, MULTIPLEX, and windowClosing().

Referenced by windowClosing().

◆ windowDeactivated()

void unocontrols::OMRCListenerMultiplexerHelper::windowDeactivated ( const css::lang::EventObject &  aEvent)
overridevirtual

Definition at line 374 of file multiplexer.cxx.

References aEvent, MULTIPLEX, and windowDeactivated().

Referenced by windowDeactivated().

◆ windowHidden()

void unocontrols::OMRCListenerMultiplexerHelper::windowHidden ( const css::lang::EventObject &  aEvent)
overridevirtual

Definition at line 262 of file multiplexer.cxx.

References aEvent, MULTIPLEX, and windowHidden().

Referenced by windowHidden().

◆ windowMinimized()

void unocontrols::OMRCListenerMultiplexerHelper::windowMinimized ( const css::lang::EventObject &  aEvent)
overridevirtual

Definition at line 353 of file multiplexer.cxx.

References aEvent, MULTIPLEX, and windowMinimized().

Referenced by windowMinimized().

◆ windowMoved()

void unocontrols::OMRCListenerMultiplexerHelper::windowMoved ( const css::awt::WindowEvent &  aEvent)
overridevirtual

Definition at line 248 of file multiplexer.cxx.

References aEvent, MULTIPLEX, and windowMoved().

Referenced by windowMoved().

◆ windowNormalized()

void unocontrols::OMRCListenerMultiplexerHelper::windowNormalized ( const css::lang::EventObject &  aEvent)
overridevirtual

Definition at line 360 of file multiplexer.cxx.

References aEvent, MULTIPLEX, and windowNormalized().

Referenced by windowNormalized().

◆ windowOpened()

void unocontrols::OMRCListenerMultiplexerHelper::windowOpened ( const css::lang::EventObject &  aEvent)
overridevirtual

Definition at line 332 of file multiplexer.cxx.

References aEvent, MULTIPLEX, and windowOpened().

Referenced by windowOpened().

◆ windowPaint()

void unocontrols::OMRCListenerMultiplexerHelper::windowPaint ( const css::awt::PaintEvent &  aEvent)
overridevirtual

Definition at line 325 of file multiplexer.cxx.

References aEvent, MULTIPLEX, and windowPaint().

Referenced by windowPaint().

◆ windowResized()

void unocontrols::OMRCListenerMultiplexerHelper::windowResized ( const css::awt::WindowEvent &  aEvent)
overridevirtual

Definition at line 241 of file multiplexer.cxx.

References aEvent, MULTIPLEX, and windowResized().

Referenced by windowResized().

◆ windowShown()

void unocontrols::OMRCListenerMultiplexerHelper::windowShown ( const css::lang::EventObject &  aEvent)
overridevirtual

Definition at line 255 of file multiplexer.cxx.

References aEvent, MULTIPLEX, and windowShown().

Referenced by windowShown().

Member Data Documentation

◆ m_aListenerHolder

comphelper::OMultiTypeInterfaceContainerHelper2 unocontrols::OMRCListenerMultiplexerHelper::m_aListenerHolder
private

Definition at line 226 of file multiplexer.hxx.

Referenced by advise(), disposeAndClear(), setPeer(), and unadvise().

◆ m_aMutex

::osl::Mutex unocontrols::OMRCListenerMultiplexerHelper::m_aMutex
private

Definition at line 223 of file multiplexer.hxx.

Referenced by advise(), disposing(), setPeer(), and unadvise().

◆ m_xControl

css::uno::WeakReference< css::awt::XWindow > unocontrols::OMRCListenerMultiplexerHelper::m_xControl
private

The source of the events. Normally this is the peer object.

Definition at line 225 of file multiplexer.hxx.

Referenced by disposeAndClear().

◆ m_xPeer

css::uno::Reference< css::awt::XWindow > unocontrols::OMRCListenerMultiplexerHelper::m_xPeer
private

Definition at line 224 of file multiplexer.hxx.

Referenced by advise(), disposing(), setPeer(), and unadvise().


The documentation for this class was generated from the following files: