23#include <com/sun/star/system/SystemShellExecute.hpp>
24#include <com/sun/star/util/PathSubstitution.hpp>
25#include <com/sun/star/util/XStringSubstitution.hpp>
26#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
27#include <com/sun/star/frame/DispatchResultState.hpp>
39 return "com.sun.star.comp.framework.SystemExecute";
65 css::uno::Reference< css::frame::XDispatch > xDispatcher;
71css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL
SystemExec::queryDispatches(
const css::uno::Sequence< css::frame::DispatchDescriptor >& lDescriptor )
73 sal_Int32
nCount = lDescriptor.getLength();
74 css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > lDispatcher(
nCount );
75 auto lDispatcherRange = asNonConstRange(lDispatcher);
79 lDescriptor[
i].FeatureURL,
80 lDescriptor[
i].FrameName,
81 lDescriptor[
i].SearchFlags);
87 const css::uno::Sequence< css::beans::PropertyValue >& lArguments )
93 const css::uno::Sequence< css::beans::PropertyValue >&,
94 const css::uno::Reference< css::frame::XDispatchResultListener >& xListener )
109 css::uno::Reference< css::util::XStringSubstitution > xPathSubst( css::util::PathSubstitution::create(
m_xContext) );
111 OUString sSystemURL = xPathSubst->substituteVariables(sSystemURLWithVariables,
true);
113 css::uno::Reference< css::system::XSystemShellExecute > xShell = css::system::SystemShellExecute::create(
m_xContext );
115 xShell->execute(sSystemURL, OUString(), css::system::SystemShellExecuteFlags::URIS_ONLY);
118 catch(
const css::uno::Exception&)
125 const css::util::URL& )
131 const css::util::URL& )
137 const sal_Int16 nState )
141 css::frame::DispatchResultEvent
aEvent;
143 xListener->dispatchFinished(
aEvent);
149extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
151 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any>
const& )
constexpr OUStringLiteral sServiceName
protocol handler for "systemexec:*" URLs @descr It's a special dispatch/provider object which is regi...
virtual OUString SAL_CALL getImplementationName() override
void impl_notifyResultListener(const css::uno::Reference< css::frame::XDispatchResultListener > &xListener, const sal_Int16 nState)
virtual sal_Bool SAL_CALL supportsService(const OUString &sServiceName) override
virtual void SAL_CALL removeStatusListener(const css::uno::Reference< css::frame::XStatusListener > &xListener, const css::util::URL &aURL) override
css::uno::Reference< css::uno::XComponentContext > m_xContext
reference to global uno service manager which had created us
virtual void SAL_CALL dispatchWithNotification(const css::util::URL &aURL, const css::uno::Sequence< css::beans::PropertyValue > &lArguments, const css::uno::Reference< css::frame::XDispatchResultListener > &xListener) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch(const css::util::URL &aURL, const OUString &sTarget, sal_Int32 nFlags) override
SystemExec(css::uno::Reference< css::uno::XComponentContext > xContext)
virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches(const css::uno::Sequence< css::frame::DispatchDescriptor > &lDescriptor) override
virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener > &xListener, const css::util::URL &aURL) override
virtual void SAL_CALL dispatch(const css::util::URL &aURL, const css::uno::Sequence< css::beans::PropertyValue > &lArguments) override
virtual ~SystemExec() override
css::uno::Reference< css::uno::XComponentContext > m_xContext
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
constexpr OUStringLiteral PROTOCOL_VALUE
constexpr OUStringLiteral SERVICENAME_PROTOCOLHANDLER
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * framework_SystemExecute_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)