LibreOffice Module chart2 (master) 1
CommandDispatchContainer.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19#pragma once
20
21#include <unotools/weakref.hxx>
23
24#include <map>
25#include <vector>
26
27namespace com::sun::star::frame { class XController; }
28namespace com::sun::star::frame { class XDispatch; }
29namespace com::sun::star::frame { class XModel; }
30namespace com::sun::star::frame { struct DispatchDescriptor; }
31namespace com::sun::star::uno { class XComponentContext; }
32namespace com::sun::star::util { struct URL; }
33
34namespace chart
35{
36class ChartModel;
37class DrawCommandDispatch;
38class ShapeController;
39
67{
68public:
69 // note: the chart dispatcher should be removed when all commands are
70 // handled by other dispatchers. (Chart is currently the controller
71 // itself)
73 const css::uno::Reference< css::uno::XComponentContext > & xContext );
74
75 void setModel(
77
82 const css::uno::Reference< css::frame::XDispatch >& rChartDispatch,
83 o3tl::sorted_vector< OUString > && rChartCommands );
84
92 css::uno::Reference< css::frame::XDispatch > getDispatchForURL(
93 const css::util::URL & rURL );
94
95 css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > getDispatchesForURLs(
96 const css::uno::Sequence< css::frame::DispatchDescriptor > & aDescriptors );
97
98 void DisposeAndClear();
99
100 static css::uno::Reference< css::frame::XDispatch >
102 const css::uno::Reference< css::frame::XController > & xChartController,
103 const css::util::URL & rURL );
104
105 const css::uno::Reference< css::frame::XDispatch > & getChartDispatcher() const { return m_xChartDispatcher; }
106
109 void setShapeController( ShapeController* pController );
111
112private:
113 typedef
114 std::map< OUString,
115 css::uno::Reference< css::frame::XDispatch > >
117
118 typedef
119 std::vector< css::uno::Reference< css::frame::XDispatch > > tDisposeVector;
120
123
124 css::uno::Reference< css::uno::XComponentContext > m_xContext;
126
127 css::uno::Reference< css::frame::XDispatch > m_xChartDispatcher;
129
132};
133
134} // namespace chart
135
136/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::vector< css::uno::Reference< css::frame::XDispatch > > tDisposeVector
void setModel(const rtl::Reference<::chart::ChartModel > &xModel)
void setDrawCommandDispatch(DrawCommandDispatch *pDispatch)
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.
DrawCommandDispatch * getDrawCommandDispatch()
css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > getDispatchesForURLs(const css::uno::Sequence< css::frame::DispatchDescriptor > &aDescriptors)
const css::uno::Reference< css::frame::XDispatch > & getChartDispatcher() const
std::map< OUString, css::uno::Reference< css::frame::XDispatch > > tDispatchMap
css::uno::Reference< css::frame::XDispatch > m_xChartDispatcher
css::uno::Reference< css::uno::XComponentContext > m_xContext
CommandDispatchContainer(const css::uno::Reference< css::uno::XComponentContext > &xContext)
static css::uno::Reference< css::frame::XDispatch > getContainerDispatchForURL(const css::uno::Reference< css::frame::XController > &xChartController, const css::util::URL &rURL)
o3tl::sorted_vector< OUString > m_aChartCommands
void setShapeController(ShapeController *pController)
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.
unotools::WeakReference< ::chart::ChartModel > m_xModel
This is a CommandDispatch implementation for drawing objects.
This is a CommandDispatch implementation for shapes.
Reference< XModel > xModel