11#include <uiobject.hxx>
30 maCID(
std::move(aCID)),
31 mxChartWindow(xChartWindow)
46 if (rAction ==
"SELECT")
51 aParams[
"NAME"] =
maCID;
52 pWindow->execute(rAction, aParams);
54 else if (rAction ==
"COMMAND")
60 aParams[
"NAME"] =
maCID;
61 pWindow->execute(
"SELECT", aParams);
63 auto itr = rParameters.find(
"COMMAND");
64 if (itr == rParameters.end())
65 throw css::uno::RuntimeException(
"missing COMMAND parameter");
67 maCommands.emplace_back(
new OUString(itr->second));
68 OUString* pCommand =
maCommands.rbegin()->get();
77 aURL.Path = *
static_cast<OUString*
>(pCommand);
78 mxChartWindow->GetController()->dispatch(
aURL, css::uno::Sequence<css::beans::PropertyValue>());
85 return pWindow->get_child(rID);
92 return pWindow->get_children();
97 return "ChartUIObject for type: ";
102 mxChartWindow(xChartWindow)
114 OUString aSelectedObject;
115 aAny >>= aSelectedObject;
116 aMap[
"SelectedObject"] = aSelectedObject;
125 if (rAction ==
"SELECT")
127 auto itr = rParameters.find(
"NAME");
128 if (itr == rParameters.end())
129 throw css::uno::RuntimeException(
"Missing Parameter 'NAME' for action 'SELECT'");
132 const OUString& rName = itr->second;
137 pController->
select(aAny);
148 throw css::uno::RuntimeException(
"unknown child");
155 std::vector<chart::ObjectIdentifier> aChildIdentifiers = rHierarchy.
getChildren(rID);
156 std::transform(aChildIdentifiers.begin(), aChildIdentifiers.end(), std::inserter(rChildren, rChildren.begin()),
159 return rObject.getObjectCID();
164 recursiveAdd(ID, rChildren, rHierarchy);
171 std::set<OUString> aChildren;
179 chart::ExplicitValueProvider* pValueProvider = xChartView.get();
184 recursiveAdd(aIdentifier, aChildren, aHierarchy);
192 assert(pChartWindow);
199 return "ChartWindowUIObject";
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
ChartUIObject(const VclPtr< chart::ChartWindow > &xChartWindow, OUString aCID)
virtual OUString get_type() const override
virtual std::unique_ptr< UIObject > get_child(const OUString &rID) override
virtual std::set< OUString > get_children() const override
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
VclPtr< chart::ChartWindow > mxChartWindow
std::vector< std::unique_ptr< OUString > > maCommands
StringMap get_state() override
VclPtr< chart::ChartWindow > mxChartWindow
virtual std::set< OUString > get_children() const override
ChartWindowUIObject(const VclPtr< chart::ChartWindow > &xChartWindow)
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
virtual StringMap get_state() override
virtual std::unique_ptr< UIObject > get_child(const OUString &rID) override
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
virtual OUString get_name() const override
reference_type * get() const
virtual StringMap get_state() override
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
rtl::Reference<::chart::ChartModel > getChartModel()
rtl::Reference<::chart::ChartView > const & getChartView() const
virtual css::uno::Any SAL_CALL getSelection() override
virtual sal_Bool SAL_CALL select(const css::uno::Any &rSelection) override
The ChartWindow collects events from the window and forwards them the to the controller thus the cont...
static ObjectIdentifier getRootNodeOID()
const tChildContainer & getChildren(const ObjectIdentifier &rParent) const
static bool isCID(std::u16string_view rName)
const OUString & getObjectCID() const
#define LINK(Instance, Class, Member)
HashMap_OWString_Interface aMap
IMPL_LINK(ChartUIObject, PostCommand, void *, pCommand, void)
std::map< OUString, OUString > StringMap