LibreOffice Module chart2 (master) 1
|
@HTML More...
#include <CommandDispatchContainer.hxx>
Public Member Functions | |
CommandDispatchContainer (const css::uno::Reference< css::uno::XComponentContext > &xContext) | |
void | setModel (const rtl::Reference<::chart::ChartModel > &xModel) |
void | setChartDispatch (const css::uno::Reference< css::frame::XDispatch > &rChartDispatch, o3tl::sorted_vector< OUString > &&rChartCommands) |
Set a chart dispatcher that is used for all commands contained in rChartCommands. More... | |
css::uno::Reference< css::frame::XDispatch > | getDispatchForURL (const css::util::URL &rURL) |
Returns the dispatch that is able to do the command given in rURL, if implemented here. More... | |
css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > | getDispatchesForURLs (const css::uno::Sequence< css::frame::DispatchDescriptor > &aDescriptors) |
void | DisposeAndClear () |
const css::uno::Reference< css::frame::XDispatch > & | getChartDispatcher () const |
void | setDrawCommandDispatch (DrawCommandDispatch *pDispatch) |
DrawCommandDispatch * | getDrawCommandDispatch () |
void | setShapeController (ShapeController *pController) |
ShapeController * | getShapeController () |
Static Public Member Functions | |
static css::uno::Reference< css::frame::XDispatch > | getContainerDispatchForURL (const css::uno::Reference< css::frame::XController > &xChartController, const css::util::URL &rURL) |
Private Types | |
typedef std::map< OUString, css::uno::Reference< css::frame::XDispatch > > | tDispatchMap |
typedef std::vector< css::uno::Reference< css::frame::XDispatch > > | tDisposeVector |
Private Attributes | |
tDispatchMap | m_aCachedDispatches |
tDisposeVector | m_aToBeDisposedDispatches |
css::uno::Reference< css::uno::XComponentContext > | m_xContext |
unotools::WeakReference< ::chart::ChartModel > | m_xModel |
css::uno::Reference< css::frame::XDispatch > | m_xChartDispatcher |
o3tl::sorted_vector< OUString > | m_aChartCommands |
DrawCommandDispatch * | m_pDrawCommandDispatch |
ShapeController * | m_pShapeController |
@HTML
Helper class for implementing the XDispatchProvider
interface of the ChartController. This class handles all commands to queryDispatch and queryDispatches in the following way:
XDispatch
for a given command. If so, use it. XDispatch
implementation, and cache this implementation for later use setChartDispatch()
). The XDispatch
Provider is designed to return different XDispatch
implementations for each command. This class here decides which implementation to use for which command.
As most commands need much information of the controller and are implemented there, the controller handles most of the commands itself (it also implements XDispatch
). Therefore it is set here as chart dispatch.
Definition at line 66 of file CommandDispatchContainer.hxx.
|
private |
Definition at line 116 of file CommandDispatchContainer.hxx.
|
private |
Definition at line 119 of file CommandDispatchContainer.hxx.
|
explicit |
Definition at line 43 of file CommandDispatchContainer.cxx.
void chart::CommandDispatchContainer::DisposeAndClear | ( | ) |
Definition at line 158 of file CommandDispatchContainer.cxx.
References o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::clear(), chart::DisposeHelper::DisposeAllElements(), m_aCachedDispatches, m_aChartCommands, m_aToBeDisposedDispatches, m_pDrawCommandDispatch, m_pShapeController, and m_xChartDispatcher.
Referenced by chart::ChartController::dispose().
|
inline |
Definition at line 105 of file CommandDispatchContainer.hxx.
References m_xChartDispatcher.
Referenced by chart::ChartController::execute_Command().
|
static |
Definition at line 169 of file CommandDispatchContainer.cxx.
References xFrame.
Referenced by getDispatchForURL().
Sequence< Reference< frame::XDispatch > > chart::CommandDispatchContainer::getDispatchesForURLs | ( | const css::uno::Sequence< css::frame::DispatchDescriptor > & | aDescriptors | ) |
Definition at line 143 of file CommandDispatchContainer.cxx.
References getDispatchForURL(), nCount, and nPos.
Referenced by chart::ChartController::queryDispatches().
Reference< frame::XDispatch > chart::CommandDispatchContainer::getDispatchForURL | ( | const css::util::URL & | rURL | ) |
Returns the dispatch that is able to do the command given in rURL, if implemented here.
If the URL is not implemented here, it should be checked whether the command is one of the commands given via the setChartDispatch() method. If so, call the chart dispatch.
If all this fails, return an empty dispatch.
Definition at line 71 of file CommandDispatchContainer.cxx.
References o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::end(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::find(), getContainerDispatchForURL(), chart::FeatureCommandDispatchBase::isFeatureSupported(), chart::DrawCommandDispatch::isFeatureSupported(), m_aCachedDispatches, m_aChartCommands, m_aToBeDisposedDispatches, m_pDrawCommandDispatch, m_pShapeController, m_xChartDispatcher, m_xContext, m_xModel, and xModel.
Referenced by getDispatchesForURLs(), and chart::ChartController::queryDispatch().
|
inline |
Definition at line 108 of file CommandDispatchContainer.hxx.
References m_pDrawCommandDispatch.
Referenced by chart::ChartController::execute_MouseButtonDown().
|
inline |
Definition at line 110 of file CommandDispatchContainer.hxx.
References m_pShapeController.
Referenced by chart::ChartController::impl_ShapeControllerDispatch(), and chart::ControllerCommandDispatch::isShapeControllerCommandAvailable().
void chart::CommandDispatchContainer::setChartDispatch | ( | const css::uno::Reference< css::frame::XDispatch > & | rChartDispatch, |
o3tl::sorted_vector< OUString > && | rChartCommands | ||
) |
Set a chart dispatcher that is used for all commands contained in rChartCommands.
Definition at line 61 of file CommandDispatchContainer.cxx.
References m_aChartCommands, m_aToBeDisposedDispatches, and m_xChartDispatcher.
Referenced by chart::ChartController::attachModel().
void chart::CommandDispatchContainer::setDrawCommandDispatch | ( | DrawCommandDispatch * | pDispatch | ) |
Definition at line 187 of file CommandDispatchContainer.cxx.
References m_aToBeDisposedDispatches, and m_pDrawCommandDispatch.
Referenced by chart::ChartController::attachModel().
void chart::CommandDispatchContainer::setModel | ( | const rtl::Reference<::chart::ChartModel > & | xModel | ) |
Definition at line 51 of file CommandDispatchContainer.cxx.
References chart::DisposeHelper::DisposeAllElements(), m_aCachedDispatches, m_aToBeDisposedDispatches, m_xModel, and xModel.
Referenced by chart::ChartController::attachModel(), and chart::ChartController::impl_releaseThisModel().
void chart::CommandDispatchContainer::setShapeController | ( | ShapeController * | pController | ) |
Definition at line 193 of file CommandDispatchContainer.cxx.
References m_aToBeDisposedDispatches, and m_pShapeController.
Referenced by chart::ChartController::attachModel().
|
mutableprivate |
Definition at line 121 of file CommandDispatchContainer.hxx.
Referenced by DisposeAndClear(), getDispatchForURL(), and setModel().
|
private |
Definition at line 128 of file CommandDispatchContainer.hxx.
Referenced by DisposeAndClear(), getDispatchForURL(), and setChartDispatch().
|
mutableprivate |
Definition at line 122 of file CommandDispatchContainer.hxx.
Referenced by DisposeAndClear(), getDispatchForURL(), setChartDispatch(), setDrawCommandDispatch(), setModel(), and setShapeController().
|
private |
Definition at line 130 of file CommandDispatchContainer.hxx.
Referenced by DisposeAndClear(), getDispatchForURL(), getDrawCommandDispatch(), and setDrawCommandDispatch().
|
private |
Definition at line 131 of file CommandDispatchContainer.hxx.
Referenced by DisposeAndClear(), getDispatchForURL(), getShapeController(), and setShapeController().
|
private |
Definition at line 127 of file CommandDispatchContainer.hxx.
Referenced by DisposeAndClear(), getChartDispatcher(), getDispatchForURL(), and setChartDispatch().
|
private |
Definition at line 124 of file CommandDispatchContainer.hxx.
Referenced by getDispatchForURL().
|
private |
Definition at line 125 of file CommandDispatchContainer.hxx.
Referenced by getDispatchForURL(), and setModel().