build fix
[LibreOffice.git] / sc / inc / dispuno.hxx
blobb54ad2fd5ae69f72a698401d8fd7b0afb7fe258e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SC_INC_DISPUNO_HXX
21 #define INCLUDED_SC_INC_DISPUNO_HXX
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"
29 namespace com { namespace sun { namespace star { namespace frame {
30 class XDispatchProviderInterception;
31 } } } }
33 class ScTabViewShell;
35 class ScDispatchProviderInterceptor : public cppu::WeakImplHelper<
36 css::frame::XDispatchProviderInterceptor,
37 css::lang::XEventListener>,
38 public SfxListener
40 ScTabViewShell* pViewShell;
42 /// the component which's dispatches we're intercepting
43 css::uno::Reference< css::frame::XDispatchProviderInterception> m_xIntercepted;
45 /// chaining
46 css::uno::Reference< css::frame::XDispatchProvider> m_xSlaveDispatcher;
47 css::uno::Reference< css::frame::XDispatchProvider> m_xMasterDispatcher;
49 /// own dispatch
50 css::uno::Reference< css::frame::XDispatch> m_xMyDispatch;
52 public:
54 ScDispatchProviderInterceptor(ScTabViewShell* pViewSh);
55 virtual ~ScDispatchProviderInterceptor() override;
57 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
59 /// XDispatchProvider
60 virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL
61 queryDispatch( const css::util::URL& aURL,
62 const OUString& aTargetFrameName,
63 sal_Int32 nSearchFlags )
64 throw(css::uno::RuntimeException, std::exception) override;
65 virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL
66 queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& aDescripts )
67 throw(css::uno::RuntimeException, std::exception) override;
69 /// XDispatchProviderInterceptor
70 virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL
71 getSlaveDispatchProvider() throw(css::uno::RuntimeException, std::exception) override;
72 virtual void SAL_CALL setSlaveDispatchProvider( const css::uno::Reference<
73 css::frame::XDispatchProvider >& xNewDispatchProvider )
74 throw(css::uno::RuntimeException, std::exception) override;
75 virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL
76 getMasterDispatchProvider() throw(css::uno::RuntimeException, std::exception) override;
77 virtual void SAL_CALL setMasterDispatchProvider( const css::uno::Reference<
78 css::frame::XDispatchProvider >& xNewSupplier )
79 throw(css::uno::RuntimeException, std::exception) override;
81 /// XEventListener
82 virtual void SAL_CALL disposing( const css::lang::EventObject& Source )
83 throw(css::uno::RuntimeException, std::exception) override;
86 class ScDispatch : public cppu::WeakImplHelper<
87 css::frame::XDispatch,
88 css::view::XSelectionChangeListener >,
89 public SfxListener
91 ScTabViewShell* pViewShell;
92 std::vector< css::uno::Reference< css::frame::XStatusListener > >
93 aDataSourceListeners;
94 ScImportParam aLastImport;
95 bool bListeningToView;
97 public:
99 ScDispatch(ScTabViewShell* pViewSh);
100 virtual ~ScDispatch() override;
102 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
104 /// XDispatch
105 virtual void SAL_CALL dispatch( const css::util::URL& aURL,
106 const css::uno::Sequence< css::beans::PropertyValue >& aArgs )
107 throw(css::uno::RuntimeException, std::exception) override;
108 virtual void SAL_CALL addStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xControl,
109 const css::util::URL& aURL )
110 throw(css::uno::RuntimeException,
111 std::exception) override;
112 virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xControl,
113 const css::util::URL& aURL )
114 throw(css::uno::RuntimeException, std::exception) override;
116 /// XSelectionChangeListener
117 virtual void SAL_CALL selectionChanged( const css::lang::EventObject& aEvent )
118 throw (css::uno::RuntimeException,
119 std::exception) override;
121 /// XEventListener
122 virtual void SAL_CALL disposing( const css::lang::EventObject& Source )
123 throw (css::uno::RuntimeException, std::exception) override;
126 #endif
128 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */