LibreOffice Module framework (master) 1
Public Member Functions | Private Attributes | List of all members
framework::StyleDispatcher Class Referencefinal

A dispatcher that serves as a proxy for style commands with arguments i.e. More...

#include <styletoolbarcontroller.hxx>

Inheritance diagram for framework::StyleDispatcher:
[legend]
Collaboration diagram for framework::StyleDispatcher:
[legend]

Public Member Functions

 StyleDispatcher (const css::uno::Reference< css::frame::XFrame > &rFrame, css::uno::Reference< css::util::XURLTransformer > xUrlTransformer, const css::util::URL &rURL)
 
void SAL_CALL dispatch (const css::util::URL &rURL, const css::uno::Sequence< css::beans::PropertyValue > &rArguments) override
 
void SAL_CALL addStatusListener (const css::uno::Reference< css::frame::XStatusListener > &rListener, const css::util::URL &rURL) override
 
void SAL_CALL removeStatusListener (const css::uno::Reference< css::frame::XStatusListener > &rListener, const css::util::URL &rURL) override
 
void SAL_CALL statusChanged (const css::frame::FeatureStateEvent &rEvent) override
 
void SAL_CALL disposing (const css::lang::EventObject &rSource) override
 

Private Attributes

OUString m_aStyleName
 
OUString m_aCommand
 
OUString m_aStatusCommand
 
css::uno::Reference< css::util::XURLTransformer > m_xUrlTransformer
 
css::uno::Reference< css::frame::XDispatchProvider > m_xFrame
 
css::uno::Reference< css::frame::XDispatch > m_xStatusDispatch
 
css::uno::Reference< css::frame::XStatusListener > m_xOwner
 

Detailed Description

A dispatcher that serves as a proxy for style commands with arguments i.e.

.uno:StyleApply?... in order to provide useful status updates to generic UI elements such as toolbars or menubar. It listens to special status commands, and computes a boolean status out of them. Then it forwards that boolean status to the listener, as if it was the status of the original command.

Note that the implementation is minimal: Although the UI element appears to be the owner of the dispatcher, it's still responsible, as usual, to call removeStatusListener same amount of times as addStatusListener, otherwise the dispatcher might not be destructed. In addition this implementation might hold a hard reference on the owner, and it's the responsibility of the owner to destroy the dispatcher first, in order to break the cycle.

Definition at line 33 of file styletoolbarcontroller.hxx.

Constructor & Destructor Documentation

◆ StyleDispatcher()

framework::StyleDispatcher::StyleDispatcher ( const css::uno::Reference< css::frame::XFrame > &  rFrame,
css::uno::Reference< css::util::XURLTransformer >  xUrlTransformer,
const css::util::URL &  rURL 
)

Member Function Documentation

◆ addStatusListener()

void framework::StyleDispatcher::addStatusListener ( const css::uno::Reference< css::frame::XStatusListener > &  rListener,
const css::util::URL &  rURL 
)
override

◆ dispatch()

void framework::StyleDispatcher::dispatch ( const css::util::URL &  rURL,
const css::uno::Sequence< css::beans::PropertyValue > &  rArguments 
)
override

Definition at line 136 of file styletoolbarcontroller.cxx.

References m_xFrame, and xDispatch.

◆ disposing()

void framework::StyleDispatcher::disposing ( const css::lang::EventObject &  rSource)
override

Definition at line 189 of file styletoolbarcontroller.cxx.

References m_xStatusDispatch.

◆ removeStatusListener()

void framework::StyleDispatcher::removeStatusListener ( const css::uno::Reference< css::frame::XStatusListener > &  rListener,
const css::util::URL &  rURL 
)
override

◆ statusChanged()

void framework::StyleDispatcher::statusChanged ( const css::frame::FeatureStateEvent &  rEvent)
override

Definition at line 174 of file styletoolbarcontroller.cxx.

References aEvent, m_aCommand, m_aStyleName, m_xOwner, and m_xUrlTransformer.

Member Data Documentation

◆ m_aCommand

OUString framework::StyleDispatcher::m_aCommand
private

Definition at line 52 of file styletoolbarcontroller.hxx.

Referenced by statusChanged(), and StyleDispatcher().

◆ m_aStatusCommand

OUString framework::StyleDispatcher::m_aStatusCommand
private

◆ m_aStyleName

OUString framework::StyleDispatcher::m_aStyleName
private

Definition at line 52 of file styletoolbarcontroller.hxx.

Referenced by statusChanged(), and StyleDispatcher().

◆ m_xFrame

css::uno::Reference< css::frame::XDispatchProvider > framework::StyleDispatcher::m_xFrame
private

Definition at line 54 of file styletoolbarcontroller.hxx.

Referenced by dispatch(), and StyleDispatcher().

◆ m_xOwner

css::uno::Reference< css::frame::XStatusListener > framework::StyleDispatcher::m_xOwner
private

Definition at line 56 of file styletoolbarcontroller.hxx.

Referenced by addStatusListener(), and statusChanged().

◆ m_xStatusDispatch

css::uno::Reference< css::frame::XDispatch > framework::StyleDispatcher::m_xStatusDispatch
private

◆ m_xUrlTransformer

css::uno::Reference< css::util::XURLTransformer > framework::StyleDispatcher::m_xUrlTransformer
private

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