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#pragma once
21
22#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
23#include <com/sun/star/view/XSelectionChangeListener.hpp>
25#include <svl/lstner.hxx>
26#include "global.hxx"
27
28namespace com::sun::star::frame { class XDispatchProviderInterception; }
29class ScTabViewShell;
30
31class ScDispatchProviderInterceptor final : public cppu::WeakImplHelper<
32 css::frame::XDispatchProviderInterceptor,
33 css::lang::XEventListener>,
34 public SfxListener
35{
37
39 css::uno::Reference< css::frame::XDispatchProviderInterception> m_xIntercepted;
40
42 css::uno::Reference< css::frame::XDispatchProvider> m_xSlaveDispatcher;
43 css::uno::Reference< css::frame::XDispatchProvider> m_xMasterDispatcher;
44
46 css::uno::Reference< css::frame::XDispatch> m_xMyDispatch;
47
48public:
49
51 virtual ~ScDispatchProviderInterceptor() override;
52
53 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
54
56 virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL
57 queryDispatch( const css::util::URL& aURL,
58 const OUString& aTargetFrameName,
59 sal_Int32 nSearchFlags ) override;
60 virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL
61 queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& aDescripts ) override;
62
64 virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL
65 getSlaveDispatchProvider() override;
66 virtual void SAL_CALL setSlaveDispatchProvider( const css::uno::Reference<
67 css::frame::XDispatchProvider >& xNewDispatchProvider ) override;
68 virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL
70 virtual void SAL_CALL setMasterDispatchProvider( const css::uno::Reference<
71 css::frame::XDispatchProvider >& xNewSupplier ) override;
72
74 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
75};
76
77class ScDispatch final : public cppu::WeakImplHelper<
78 css::frame::XDispatch,
79 css::view::XSelectionChangeListener >,
80 public SfxListener
81{
83 std::vector< css::uno::Reference< css::frame::XStatusListener > >
87
88public:
89
90 ScDispatch(ScTabViewShell* pViewSh);
91 virtual ~ScDispatch() override;
92
93 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
94
96 virtual void SAL_CALL dispatch( const css::util::URL& aURL,
97 const css::uno::Sequence< css::beans::PropertyValue >& aArgs ) override;
98 virtual void SAL_CALL addStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xControl,
99 const css::util::URL& aURL ) override;
100 virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xControl,
101 const css::util::URL& aURL ) override;
102
104 virtual void SAL_CALL selectionChanged( const css::lang::EventObject& aEvent ) override;
105
107 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
108};
109
110/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL setMasterDispatchProvider(const css::uno::Reference< css::frame::XDispatchProvider > &xNewSupplier) override
Definition: dispuno.cxx:151
ScTabViewShell * pViewShell
Definition: dispuno.hxx:36
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
css::uno::Reference< css::frame::XDispatchProvider > m_xMasterDispatcher
Definition: dispuno.hxx:43
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
XEventListener.
Definition: dispuno.cxx:160
virtual ~ScDispatchProviderInterceptor() override
Definition: dispuno.cxx:77
virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL getSlaveDispatchProvider() override
XDispatchProviderInterceptor.
Definition: dispuno.cxx:131
virtual void SAL_CALL setSlaveDispatchProvider(const css::uno::Reference< css::frame::XDispatchProvider > &xNewDispatchProvider) override
Definition: dispuno.cxx:137
css::uno::Reference< css::frame::XDispatch > m_xMyDispatch
own dispatch
Definition: dispuno.hxx:46
ScDispatchProviderInterceptor(ScTabViewShell *pViewSh)
Definition: dispuno.cxx:52
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 css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL getMasterDispatchProvider() override
Definition: dispuno.cxx:145
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: dispuno.cxx:83
css::uno::Reference< css::frame::XDispatchProvider > m_xSlaveDispatcher
chaining
Definition: dispuno.hxx:42
css::uno::Reference< css::frame::XDispatchProviderInterception > m_xIntercepted
the component which's dispatches we're intercepting
Definition: dispuno.hxx:39
ScDispatch(ScTabViewShell *pViewSh)
Definition: dispuno.cxx:177
virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener > &xControl, const css::util::URL &aURL) override
Definition: dispuno.cxx:253
bool bListeningToView
Definition: dispuno.hxx:86
ScTabViewShell * pViewShell
Definition: dispuno.hxx:82
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 disposing(const css::lang::EventObject &Source) override
XEventListener.
Definition: dispuno.cxx:355
virtual void SAL_CALL selectionChanged(const css::lang::EventObject &aEvent) override
XSelectionChangeListener.
Definition: dispuno.cxx:321
ScImportParam aLastImport
Definition: dispuno.hxx:85
virtual void SAL_CALL dispatch(const css::util::URL &aURL, const css::uno::Sequence< css::beans::PropertyValue > &aArgs) override
XDispatch.
Definition: dispuno.cxx:206
std::vector< css::uno::Reference< css::frame::XStatusListener > > aDataSourceListeners
Definition: dispuno.hxx:84
virtual ~ScDispatch() override
Definition: dispuno.cxx:185
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: dispuno.cxx:198