LibreOffice Module sc (master)  1
dispuno.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_SC_INC_DISPUNO_HXX
21 #define INCLUDED_SC_INC_DISPUNO_HXX
22 
23 #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
24 #include <com/sun/star/view/XSelectionChangeListener.hpp>
25 #include <cppuhelper/implbase.hxx>
26 #include <svl/lstner.hxx>
27 #include "global.hxx"
28 
29 namespace com::sun::star::frame { class XDispatchProviderInterception; }
30 class ScTabViewShell;
31 
32 class ScDispatchProviderInterceptor final : public cppu::WeakImplHelper<
33  css::frame::XDispatchProviderInterceptor,
34  css::lang::XEventListener>,
35  public SfxListener
36 {
38 
40  css::uno::Reference< css::frame::XDispatchProviderInterception> m_xIntercepted;
41 
43  css::uno::Reference< css::frame::XDispatchProvider> m_xSlaveDispatcher;
44  css::uno::Reference< css::frame::XDispatchProvider> m_xMasterDispatcher;
45 
47  css::uno::Reference< css::frame::XDispatch> m_xMyDispatch;
48 
49 public:
50 
52  virtual ~ScDispatchProviderInterceptor() override;
53 
54  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
55 
57  virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL
58  queryDispatch( const css::util::URL& aURL,
59  const OUString& aTargetFrameName,
60  sal_Int32 nSearchFlags ) override;
61  virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL
62  queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& aDescripts ) override;
63 
65  virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL
66  getSlaveDispatchProvider() override;
67  virtual void SAL_CALL setSlaveDispatchProvider( const css::uno::Reference<
68  css::frame::XDispatchProvider >& xNewDispatchProvider ) override;
69  virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL
70  getMasterDispatchProvider() override;
71  virtual void SAL_CALL setMasterDispatchProvider( const css::uno::Reference<
72  css::frame::XDispatchProvider >& xNewSupplier ) override;
73 
75  virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
76 };
77 
78 class ScDispatch final : public cppu::WeakImplHelper<
79  css::frame::XDispatch,
80  css::view::XSelectionChangeListener >,
81  public SfxListener
82 {
84  std::vector< css::uno::Reference< css::frame::XStatusListener > >
88 
89 public:
90 
91  ScDispatch(ScTabViewShell* pViewSh);
92  virtual ~ScDispatch() override;
93 
94  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
95 
97  virtual void SAL_CALL dispatch( const css::util::URL& aURL,
98  const css::uno::Sequence< css::beans::PropertyValue >& aArgs ) override;
99  virtual void SAL_CALL addStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xControl,
100  const css::util::URL& aURL ) override;
101  virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xControl,
102  const css::util::URL& aURL ) override;
103 
105  virtual void SAL_CALL selectionChanged( const css::lang::EventObject& aEvent ) override;
106 
108  virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
109 };
110 
111 #endif
112 
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL removeStatusListener(const css::uno::Reference< css::frame::XStatusListener > &xControl, const css::util::URL &aURL) override
Definition: dispuno.cxx:290
virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener > &xControl, const css::util::URL &aURL) override
Definition: dispuno.cxx:253
virtual void SAL_CALL setSlaveDispatchProvider(const css::uno::Reference< css::frame::XDispatchProvider > &xNewDispatchProvider) override
Definition: dispuno.cxx:137
virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch(const css::util::URL &aURL, const OUString &aTargetFrameName, sal_Int32 nSearchFlags) override
XDispatchProvider.
Definition: dispuno.cxx:91
virtual void SAL_CALL selectionChanged(const css::lang::EventObject &aEvent) override
XSelectionChangeListener.
Definition: dispuno.cxx:321
css::uno::Reference< css::frame::XDispatchProvider > m_xMasterDispatcher
Definition: dispuno.hxx:44
ScDispatch(ScTabViewShell *pViewSh)
Definition: dispuno.cxx:177
virtual void SAL_CALL setMasterDispatchProvider(const css::uno::Reference< css::frame::XDispatchProvider > &xNewSupplier) override
Definition: dispuno.cxx:151
ScImportParam aLastImport
Definition: dispuno.hxx:86
std::vector< css::uno::Reference< css::frame::XStatusListener > > aDataSourceListeners
Definition: dispuno.hxx:85
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: dispuno.cxx:198
virtual ~ScDispatchProviderInterceptor() override
Definition: dispuno.cxx:77
virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL getSlaveDispatchProvider() override
XDispatchProviderInterceptor.
Definition: dispuno.cxx:131
ScTabViewShell * pViewShell
Definition: dispuno.hxx:37
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: dispuno.cxx:83
ScDispatchProviderInterceptor(ScTabViewShell *pViewSh)
Definition: dispuno.cxx:52
virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL getMasterDispatchProvider() override
Definition: dispuno.cxx:145
css::uno::Reference< css::frame::XDispatch > m_xMyDispatch
own dispatch
Definition: dispuno.hxx:47
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
XEventListener.
Definition: dispuno.cxx:355
css::uno::Reference< css::frame::XDispatchProviderInterception > m_xIntercepted
the component which's dispatches we're intercepting
Definition: dispuno.hxx:40
ScTabViewShell * pViewShell
Definition: dispuno.hxx:83
virtual void SAL_CALL dispatch(const css::util::URL &aURL, const css::uno::Sequence< css::beans::PropertyValue > &aArgs) override
XDispatch.
Definition: dispuno.cxx:206
css::uno::Reference< css::frame::XDispatchProvider > m_xSlaveDispatcher
chaining
Definition: dispuno.hxx:43
bool bListeningToView
Definition: dispuno.hxx:87
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
XEventListener.
Definition: dispuno.cxx:160
virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches(const css::uno::Sequence< css::frame::DispatchDescriptor > &aDescripts) override
Definition: dispuno.cxx:116
virtual ~ScDispatch() override
Definition: dispuno.cxx:185