24#include <com/sun/star/frame/DispatchResultState.hpp>
30 const css::uno::Reference< css::frame::XFrame >& xOwnerFrame ,
31 OUString sTargetName ,
32 sal_Int32 nSearchFlags)
33 : m_xOwnerFrame (xOwnerFrame )
34 , m_sTarget (
std::move(sTargetName ))
35 , m_nSearchFlags(nSearchFlags)
36 , m_aLoader (xContext )
45 const css::uno::Sequence< css::beans::PropertyValue >& lArguments,
46 const css::uno::Reference< css::frame::XDispatchResultListener >& xListener )
52 const css::uno::Sequence< css::beans::PropertyValue >& lArguments)
54 impl_dispatch(
aURL, lArguments, css::uno::Reference< css::frame::XDispatchResultListener >() );
58 const css::uno::Sequence< css::beans::PropertyValue >& lArguments )
60 return impl_dispatch( rURL, lArguments, css::uno::Reference< css::frame::XDispatchResultListener >());
64 const css::util::URL& )
69 const css::util::URL& )
74 const css::uno::Sequence< css::beans::PropertyValue >& lArguments,
75 const css::uno::Reference< css::frame::XDispatchResultListener >& xListener )
80 css::uno::Reference< css::uno::XInterface > xThis(
static_cast< css::frame::XNotifyingDispatch*
>(
this), css::uno::UNO_QUERY);
92 xListener->dispatchFinished(
93 css::frame::DispatchResultEvent(xThis, css::frame::DispatchResultState::DONTKNOW, css::uno::Any()));
96 css::uno::Reference< css::frame::XFrame > xBaseFrame(
m_xOwnerFrame.get(), css::uno::UNO_QUERY);
97 if (!xBaseFrame.is() && xListener.is())
98 xListener->dispatchFinished(
99 css::frame::DispatchResultEvent(xThis, css::frame::DispatchResultState::FAILURE, css::uno::Any()));
104 css::uno::Reference< css::lang::XComponent > xComponent;
124 <<
" while dispatching <" << rURL.Complete <<
">");
131 xListener->dispatchFinished(
132 css::frame::DispatchResultEvent(xThis, css::frame::DispatchResultState::SUCCESS, css::uno::Any()));
134 xListener->dispatchFinished(
135 css::frame::DispatchResultEvent(xThis, css::frame::DispatchResultState::FAILURE, css::uno::Any()));
140 if ( xComponent.is () )
virtual ~LoadDispatcher() override
used to free internal resources.
css::uno::WeakReference< css::frame::XFrame > m_xOwnerFrame
TODO document me.
virtual void SAL_CALL removeStatusListener(const css::uno::Reference< css::frame::XStatusListener > &xListener, const css::util::URL &aURL) override
css::uno::Any impl_dispatch(const css::util::URL &rURL, const css::uno::Sequence< css::beans::PropertyValue > &lArguments, const css::uno::Reference< css::frame::XDispatchResultListener > &xListener)
virtual css::uno::Any SAL_CALL dispatchWithReturnValue(const css::util::URL &aURL, const css::uno::Sequence< css::beans::PropertyValue > &lArguments) override
LoadEnv m_aLoader
TODO document me.
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
LoadDispatcher(const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::frame::XFrame > &xOwnerFrame, OUString sTargetName, sal_Int32 nSearchFlags)
creates a new instance and initialize it with all necessary parameters.
sal_Int32 m_nSearchFlags
TODO document me.
OUString m_sTarget
TODO document me.
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
specify an exception, which can be used inside the load environment only.
css::uno::Any m_exOriginal
void startLoading(const OUString &sURL, const css::uno::Sequence< css::beans::PropertyValue > &lMediaDescriptor, const css::uno::Reference< css::frame::XFrame > &xBaseFrame, const OUString &sTarget, sal_Int32 nSearchFlags, LoadEnvFeatures eFeature=LoadEnvFeatures::NONE)
start loading of a resource
bool waitWhileLoading(sal_uInt32 nTimeout=0)
wait for an already running load request (started by calling startLoading() before).
css::uno::Reference< css::lang::XComponent > getTargetComponent() const
TODO document me ...
@ WorkWithUI
enable using of UI elements during loading (means progress, interaction handler etcpp....
@ AllowContentHandler
enable loading of resources, which are not related to a target frame! (see concept of ContentHandler)
#define SAL_WARN(area, stream)