LibreOffice Module chart2 (master) 1
Public Member Functions | Protected Member Functions | Private Types | Private Attributes | List of all members
chart::CommandDispatch Class Referenceabstract

This is the base class for an XDispatch. More...

#include <CommandDispatch.hxx>

Inheritance diagram for chart::CommandDispatch:
[legend]
Collaboration diagram for chart::CommandDispatch:
[legend]

Public Member Functions

 CommandDispatch (const css::uno::Reference< css::uno::XComponentContext > &xContext)
 
virtual ~CommandDispatch () override
 
virtual void initialize ()
 
- Public Member Functions inherited from comphelper::WeakComponentImplHelper< typename... Ifc >
virtual void SAL_CALL acquire () noexcept override
 
virtual void SAL_CALL release () noexcept override
 
virtual void SAL_CALL dispose () noexcept final override
 
virtual void SAL_CALL addEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) final override
 
virtual void SAL_CALL removeEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) final override
 
virtual css::uno::Any SAL_CALL queryInterface (css::uno::Type const &rType) override
 
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () override
 
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () override
 
- Public Member Functions inherited from comphelper::WeakComponentImplHelperBase
virtual ~WeakComponentImplHelperBase () override
 
virtual void SAL_CALL dispose () override
 
virtual void SAL_CALL addEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) override
 
virtual void SAL_CALL removeEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) override
 
virtual css::uno::Any SAL_CALL queryInterface (css::uno::Type const &rType) override
 
virtual void disposing (std::unique_lock< std::mutex > &)
 
- Public Member Functions inherited from comphelper::UnoImplBase
virtual ~UnoImplBase ()
 

Protected Member Functions

virtual void fireStatusEvent (const OUString &rURL, const css::uno::Reference< css::frame::XStatusListener > &xSingleListener)=0
 sends a status event for a specific command to all registered listeners or only the one given when set. More...
 
void fireAllStatusEvents (const css::uno::Reference< css::frame::XStatusListener > &xSingleListener)
 calls fireStatusEvent( OUString, xSingleListener ) More...
 
void fireStatusEventForURL (const OUString &rURL, const css::uno::Any &rState, bool bEnabled, const css::uno::Reference< css::frame::XStatusListener > &xSingleListener)
 sends a status event for a specific command to all registered listeners or only the one given when set. More...
 
virtual void SAL_CALL dispatch (const css::util::URL &URL, const css::uno::Sequence< css::beans::PropertyValue > &Arguments) override
 
virtual void SAL_CALL addStatusListener (const css::uno::Reference< css::frame::XStatusListener > &Control, const css::util::URL &URL) override
 
virtual void SAL_CALL removeStatusListener (const css::uno::Reference< css::frame::XStatusListener > &Control, const css::util::URL &URL) override
 
virtual void disposing (std::unique_lock< std::mutex > &rGuard) override
 is called when this is disposed More...
 
virtual void SAL_CALL modified (const css::lang::EventObject &aEvent) override
 
virtual void SAL_CALL disposing (const css::lang::EventObject &Source) override
 
- Protected Member Functions inherited from comphelper::WeakComponentImplHelperBase
void throwIfDisposed (std::unique_lock< std::mutex > &)
 

Private Types

typedef std::map< OUString, ::comphelper::OInterfaceContainerHelper4< css::frame::XStatusListener > > tListenerMap
 

Private Attributes

css::uno::Reference< css::uno::XComponentContext > m_xContext
 
css::uno::Reference< css::util::XURLTransformer > m_xURLTransformer
 
tListenerMap m_aListeners
 

Additional Inherited Members

- Protected Attributes inherited from comphelper::WeakComponentImplHelperBase
comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > maEventListeners
 
- Protected Attributes inherited from comphelper::UnoImplBase
std::mutex m_aMutex
 
bool m_bDisposed
 

Detailed Description

This is the base class for an XDispatch.

Definition at line 45 of file CommandDispatch.hxx.

Member Typedef Documentation

◆ tListenerMap

typedef std::map< OUString, ::comphelper::OInterfaceContainerHelper4<css::frame::XStatusListener> > chart::CommandDispatch::tListenerMap
private

Definition at line 122 of file CommandDispatch.hxx.

Constructor & Destructor Documentation

◆ CommandDispatch()

chart::CommandDispatch::CommandDispatch ( const css::uno::Reference< css::uno::XComponentContext > &  xContext)
explicit

Definition at line 32 of file CommandDispatch.cxx.

◆ ~CommandDispatch()

chart::CommandDispatch::~CommandDispatch ( )
overridevirtual

Definition at line 38 of file CommandDispatch.cxx.

Member Function Documentation

◆ addStatusListener()

void SAL_CALL chart::CommandDispatch::addStatusListener ( const css::uno::Reference< css::frame::XStatusListener > &  Control,
const css::util::URL &  URL 
)
overrideprotectedvirtual

◆ dispatch()

void SAL_CALL chart::CommandDispatch::dispatch ( const css::util::URL &  URL,
const css::uno::Sequence< css::beans::PropertyValue > &  Arguments 
)
overrideprotectedvirtual

Reimplemented in chart::FeatureCommandDispatchBase, and chart::UndoCommandDispatch.

Definition at line 55 of file CommandDispatch.cxx.

◆ disposing() [1/2]

virtual void SAL_CALL chart::CommandDispatch::disposing ( const css::lang::EventObject &  Source)
overrideprotectedvirtual

◆ disposing() [2/2]

void chart::CommandDispatch::disposing ( std::unique_lock< std::mutex > &  rGuard)
overrideprotectedvirtual

is called when this is disposed

Reimplemented from comphelper::WeakComponentImplHelperBase.

Reimplemented in chart::DrawCommandDispatch, chart::ShapeController, and chart::UndoCommandDispatch.

Definition at line 46 of file CommandDispatch.cxx.

References m_aListeners.

◆ fireAllStatusEvents()

void chart::CommandDispatch::fireAllStatusEvents ( const css::uno::Reference< css::frame::XStatusListener > &  xSingleListener)
protected

calls fireStatusEvent( OUString, xSingleListener )

Definition at line 95 of file CommandDispatch.cxx.

References fireStatusEvent().

Referenced by modified().

◆ fireStatusEvent()

virtual void chart::CommandDispatch::fireStatusEvent ( const OUString &  rURL,
const css::uno::Reference< css::frame::XStatusListener > &  xSingleListener 
)
protectedpure virtual

sends a status event for a specific command to all registered listeners or only the one given when set.

This method should be overridden. The implementation should call fireStatusEventForURL and pass the xSingleListener argument to this method unchanged.

Parameters
rURLIf empty, all available status events must be fired, otherwise only the one for the given command.
xSingleListenerIf set, the event is only sent to this listener rather than to all registered ones. Whenever a listener adds itself, this method is called with this parameter set to give an initial state.

Implemented in chart::FeatureCommandDispatchBase, and chart::UndoCommandDispatch.

Referenced by addStatusListener(), and fireAllStatusEvents().

◆ fireStatusEventForURL()

void chart::CommandDispatch::fireStatusEventForURL ( const OUString &  rURL,
const css::uno::Any &  rState,
bool  bEnabled,
const css::uno::Reference< css::frame::XStatusListener > &  xSingleListener 
)
protected

sends a status event for a specific command to all registered listeners or only the one given when set.

Parameters
xSingleListenerIf set, the event is only sent to this listener rather than to all registered ones. Whenever a listener adds itself, this method is called with this parameter set to give an initial state.

Definition at line 101 of file CommandDispatch.cxx.

References aURL, m_aListeners, comphelper::UnoImplBase::m_aMutex, m_xContext, and m_xURLTransformer.

Referenced by chart::FeatureCommandDispatchBase::fireStatusEvent(), and chart::UndoCommandDispatch::fireStatusEvent().

◆ initialize()

void chart::CommandDispatch::initialize ( )
virtual

◆ modified()

void SAL_CALL chart::CommandDispatch::modified ( const css::lang::EventObject &  aEvent)
overrideprotectedvirtual

◆ removeStatusListener()

void SAL_CALL chart::CommandDispatch::removeStatusListener ( const css::uno::Reference< css::frame::XStatusListener > &  Control,
const css::util::URL &  URL 
)
overrideprotectedvirtual

Definition at line 77 of file CommandDispatch.cxx.

References m_aListeners, comphelper::UnoImplBase::m_aMutex, and URL.

Member Data Documentation

◆ m_aListeners

tListenerMap chart::CommandDispatch::m_aListeners
private

◆ m_xContext

css::uno::Reference< css::uno::XComponentContext > chart::CommandDispatch::m_xContext
private

Definition at line 118 of file CommandDispatch.hxx.

Referenced by fireStatusEventForURL().

◆ m_xURLTransformer

css::uno::Reference< css::util::XURLTransformer > chart::CommandDispatch::m_xURLTransformer
private

Definition at line 119 of file CommandDispatch.hxx.

Referenced by fireStatusEventForURL().


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