23#include <com/sun/star/frame/AppDispatchProvider.hpp>
27#include <unordered_map>
33 const css::uno::Reference< css::frame::XFrame >& xFrame)
45 css::uno::Sequence< css::uno::Reference< css::frame::XDispatchInformationProvider > > lProvider =
implts_getAllSubProvider();
46 sal_Int32 c1 = lProvider.getLength();
49 ::std::vector< sal_Int16 > lGroups;
51 for (i1=0; i1<c1; ++i1)
54 css::uno::Reference< css::frame::XDispatchInformationProvider > xProvider = lProvider[i1];
58 const css::uno::Sequence< sal_Int16 > lProviderGroups = xProvider->getSupportedCommandGroups();
59 sal_Int32 c2 = lProviderGroups.getLength();
61 for (i2=0; i2<c2; ++i2)
63 const sal_Int16& rGroup = lProviderGroups[i2];
64 ::std::vector< sal_Int16 >::const_iterator pGroup =
65 ::std::find(lGroups.begin(), lGroups.end(), rGroup);
66 if (pGroup == lGroups.end())
67 lGroups.push_back(rGroup);
71 return ::comphelper::containerToSequence(lGroups);
76 css::uno::Sequence< css::uno::Reference< css::frame::XDispatchInformationProvider > > lProvider =
implts_getAllSubProvider();
77 sal_Int32 c1 = lProvider.getLength();
80 std::unordered_map<OUString, css::frame::DispatchInformation> lInfos;
82 for (i1=0; i1<c1; ++i1)
87 css::uno::Reference< css::frame::XDispatchInformationProvider > xProvider = lProvider[i1];
91 const css::uno::Sequence< css::frame::DispatchInformation > lProviderInfos = xProvider->getConfigurableDispatchInformation(nCommandGroup);
92 sal_Int32 c2 = lProviderInfos.getLength();
94 for (i2=0; i2<c2; ++i2)
96 const css::frame::DispatchInformation& rInfo = lProviderInfos[i2];
97 auto pInfo = lInfos.find(rInfo.Command);
98 if (pInfo == lInfos.end())
99 lInfos[rInfo.Command] = rInfo;
102 catch(
const css::uno::RuntimeException&)
104 catch(
const css::uno::Exception&)
115 return css::uno::Sequence< css::uno::Reference< css::frame::XDispatchInformationProvider > >();
119 css::uno::Reference< css::frame::XDispatchInformationProvider >
xController (
xFrame->getController() , css::uno::UNO_QUERY);
120 css::uno::Reference< css::frame::XDispatchInformationProvider > xAppDispatcher = css::frame::AppDispatchProvider::create(
m_xContext);
121 css::uno::Sequence< css::uno::Reference< css::frame::XDispatchInformationProvider > > lProvider{
css::uno::Reference< css::lang::XComponent > m_xFrame
helper to dispatch the URLs ".uno:CloseDoc"/".uno:CloseWin"/".uno:CloseFrame" to close a frame/docume...
css::uno::Reference< css::uno::XComponentContext > m_xContext
css::uno::Sequence< typename M::mapped_type > mapValuesToSequence(M const &map)
Reference< XController > xController
Reference< XFrame > xFrame