25 #include <com/sun/star/frame/XDispatchProviderInterception.hpp>
26 #include <com/sun/star/view/XSelectionSupplier.hpp>
27 #include <com/sun/star/sdb/CommandType.hpp>
46 return uno::Reference<view::XSelectionSupplier>( pViewFrame->
GetFrame().
GetController(), uno::UNO_QUERY );
49 return uno::Reference<view::XSelectionSupplier>();
64 static_cast<frame::XDispatchProviderInterceptor*>(
this));
67 uno::Reference<lang::XComponent> xInterceptedComponent(
m_xIntercepted, uno::UNO_QUERY);
68 if (xInterceptedComponent.is())
69 xInterceptedComponent->addEventListener(static_cast<lang::XEventListener*>(
this));
85 if ( rHint.
GetId() == SfxHintId::Dying )
92 const util::URL& aURL,
const OUString& aTargetFrameName,
93 sal_Int32 nSearchFlags )
97 uno::Reference<frame::XDispatch> xResult;
115 uno::Sequence< uno::Reference<frame::XDispatch> > SAL_CALL
117 const uno::Sequence<frame::DispatchDescriptor>& aDescripts )
121 uno::Sequence< uno::Reference< frame::XDispatch> > aReturn(aDescripts.getLength());
122 std::transform(aDescripts.begin(), aDescripts.end(), aReturn.getArray(),
123 [
this](
const frame::DispatchDescriptor& rDescr) -> uno::Reference<frame::XDispatch> {
124 return queryDispatch(rDescr.FeatureURL, rDescr.FrameName, rDescr.SearchFlags); });
130 uno::Reference<frame::XDispatchProvider> SAL_CALL
138 const uno::Reference<frame::XDispatchProvider>& xNewDispatchProvider )
144 uno::Reference<frame::XDispatchProvider> SAL_CALL
152 const uno::Reference<frame::XDispatchProvider>& xNewSupplier )
167 static_cast<frame::XDispatchProviderInterceptor*>(
this));
168 uno::Reference<lang::XComponent> xInterceptedComponent(
m_xIntercepted, uno::UNO_QUERY);
169 if (xInterceptedComponent.is())
170 xInterceptedComponent->removeEventListener(static_cast<lang::XEventListener*>(
this));
178 pViewShell( pViewSh ),
179 bListeningToView(
false )
193 if ( xSupplier.is() )
194 xSupplier->removeSelectionChangeListener(
this);
200 if ( rHint.
GetId() == SfxHintId::Dying )
207 const uno::Sequence<beans::PropertyValue>& aArgs )
224 throw uno::RuntimeException();
229 rEvent.IsEnabled = rParam.
bImport;
234 sal_Int32
nType = rParam.
bSql ? sdb::CommandType::COMMAND :
254 const uno::Reference<frame::XStatusListener>& xListener,
255 const util::URL& aURL)
260 throw uno::RuntimeException();
263 frame::FeatureStateEvent
aEvent;
264 aEvent.IsEnabled =
true;
265 aEvent.Source.set(static_cast<cppu::OWeakObject*>(
this));
266 aEvent.FeatureURL = aURL;
275 if ( xSupplier.is() )
276 xSupplier->addSelectionChangeListener(
this);
287 xListener->statusChanged( aEvent );
291 const uno::Reference<frame::XStatusListener>& xListener,
292 const util::URL& aURL )
300 for ( sal_uInt16
n=nCount;
n--; )
303 if ( rObj == xListener )
313 if ( xSupplier.is() )
314 xSupplier->removeSelectionChangeListener(
this);
341 frame::FeatureStateEvent
aEvent;
342 aEvent.Source.set(static_cast<cppu::OWeakObject*>(
this));
348 xDataSourceListener->statusChanged( aEvent );
357 uno::Reference<view::XSelectionSupplier> xSupplier(rSource.Source, uno::UNO_QUERY);
358 xSupplier->removeSelectionChangeListener(
this);
362 aEvent.Source.set(static_cast<cppu::OWeakObject*>(
this));
364 xDataSourceListener->disposing( aEvent );
SfxViewFrame * GetViewFrame() const
virtual void SAL_CALL removeStatusListener(const css::uno::Reference< css::frame::XStatusListener > &xControl, const css::util::URL &aURL) override
virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener > &xControl, const css::util::URL &aURL) override
virtual void SAL_CALL setSlaveDispatchProvider(const css::uno::Reference< css::frame::XDispatchProvider > &xNewDispatchProvider) override
ScDBData * GetDBData(bool bMarkArea=true, ScGetDBMode eMode=SC_DB_MAKE, ScGetDBSelection eSel=ScGetDBSelection::Keep)
ScDocShell * GetDocShell() const
virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch(const css::util::URL &aURL, const OUString &aTargetFrameName, sal_Int32 nSearchFlags) override
XDispatchProvider.
void setDataSource(const OUString &_sDataSourceNameOrLocation)
virtual void SAL_CALL selectionChanged(const css::lang::EventObject &aEvent) override
XSelectionChangeListener.
css::uno::Reference< css::frame::XDispatchProvider > m_xMasterDispatcher
ScDispatch(ScTabViewShell *pViewSh)
virtual void SAL_CALL setMasterDispatchProvider(const css::uno::Reference< css::frame::XDispatchProvider > &xNewSupplier) override
css::uno::Sequence< css::beans::PropertyValue > const & createPropertyValueSequence()
ScImportParam aLastImport
std::vector< css::uno::Reference< css::frame::XStatusListener > > aDataSourceListeners
constexpr OUStringLiteral cURLDocDataSource
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
SfxFrame & GetFrame() const
ScViewData & GetViewData()
static void lcl_FillDataSource(frame::FeatureStateEvent &rEvent, const ScImportParam &rParam)
virtual ~ScDispatchProviderInterceptor() override
virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL getSlaveDispatchProvider() override
XDispatchProviderInterceptor.
ScTabViewShell * pViewShell
void DoImportUno(const ScAddress &rPos, const css::uno::Sequence< css::beans::PropertyValue > &aArgs)
void GetImportParam(ScImportParam &rImportParam) const
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
ScDispatchProviderInterceptor(ScTabViewShell *pViewSh)
virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL getMasterDispatchProvider() override
css::uno::Reference< css::frame::XDispatch > m_xMyDispatch
own dispatch
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
XEventListener.
css::uno::Reference< css::frame::XController > GetController() const
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
css::uno::Reference< css::frame::XDispatchProviderInterception > m_xIntercepted
the component which's dispatches we're intercepting
const char cURLInsertColumns[]
ScTabViewShell * pViewShell
virtual void SAL_CALL dispatch(const css::util::URL &aURL, const css::uno::Sequence< css::beans::PropertyValue > &aArgs) override
XDispatch.
css::uno::Reference< css::frame::XDispatchProvider > m_xSlaveDispatcher
chaining
static uno::Reference< view::XSelectionSupplier > lcl_GetSelectionSupplier(const SfxViewShell *pViewShell)
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
XEventListener.
virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches(const css::uno::Sequence< css::frame::DispatchDescriptor > &aDescripts) override
virtual ~ScDispatch() override
bool m_bDetectedRangeSegmentation false