20#include <com/sun/star/frame/DispatchResultState.hpp>
21#include <com/sun/star/frame/Desktop.hpp>
31#include <sfx2/sfxsids.hrc>
37extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
39 uno::Sequence<uno::Any>
const& )
46void SAL_CALL
SwUnoModule::dispatchWithNotification(
const util::URL& aURL,
const uno::Sequence< beans::PropertyValue >& aArgs,
const uno::Reference< frame::XDispatchResultListener >& xListener )
51 uno::Reference< uno::XInterface > xThis(
static_cast< frame::XNotifyingDispatch*
>(
this));
57 sal_Int16 aState = frame::DispatchResultState::DONTKNOW;
59 aState = frame::DispatchResultState::FAILURE;
65 css::uno::Reference<css::frame::XDesktop2> xDesktop = css::frame::Desktop::create(::comphelper::getProcessComponentContext());
66 css::uno::Reference<css::frame::XFrame> xCurrentFrame = xDesktop->getCurrentFrame();
67 if (xCurrentFrame.is())
73 aState = frame::DispatchResultState::SUCCESS;
75 aState = frame::DispatchResultState::FAILURE;
80 xListener->dispatchFinished(
81 frame::DispatchResultEvent(
93 const uno::Reference< frame::XStatusListener > & ,
99 const uno::Reference< frame::XStatusListener > & ,
105 const uno::Sequence< frame::DispatchDescriptor >& seqDescripts )
107 sal_Int32
nCount = seqDescripts.getLength();
108 uno::Sequence< uno::Reference< frame::XDispatch > > lDispatcher(
nCount );
110 std::transform(seqDescripts.begin(), seqDescripts.end(), lDispatcher.getArray(),
111 [
this](
const frame::DispatchDescriptor& rDescr) -> uno::Reference< frame::XDispatch > {
112 return queryDispatch( rDescr.FeatureURL, rDescr.FrameName, rDescr.SearchFlags ); });
119 const util::URL& aURL,
const OUString& ,
122 uno::Reference< frame::XDispatch > xReturn;
136 return "com.sun.star.comp.Writer.WriterModule";
146 uno::Sequence<OUString>
aSeq {
"com.sun.star.text.ModuleDispatcher" };
constexpr OUStringLiteral sServiceName
SfxApplication * SfxGetpApp()
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void SetInternalArgs_Impl(const SfxAllItemSet &rArgs)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL dispatchWithNotification(const css::util::URL &aURL, const css::uno::Sequence< css::beans::PropertyValue > &aArgs, const css::uno::Reference< css::frame::XDispatchResultListener > &xListener) override
virtual void SAL_CALL dispatch(const css::util::URL &aURL, const css::uno::Sequence< css::beans::PropertyValue > &aArgs) override
virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch(const css::util::URL &aURL, const OUString &sTargetFrameName, sal_Int32 eSearchFlags) override
virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener > &xControl, const css::util::URL &aURL) override
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches(const css::uno::Sequence< css::frame::DispatchDescriptor > &seqDescriptor) override
virtual void SAL_CALL removeStatusListener(const css::uno::Reference< css::frame::XStatusListener > &xControl, const css::util::URL &aURL) override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Sequence< sal_Int8 > aSeq
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_Writer_WriterModule_get_implementation(uno::XComponentContext *, uno::Sequence< uno::Any > const &)