Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / source / uibase / inc / unodispatch.hxx
blob961637788f5a34518b380c5156705680054c0612
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 .
19 #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_UNODISPATCH_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_UNODISPATCH_HXX
22 #include <com/sun/star/frame/XDispatchProviderInterception.hpp>
23 #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
24 #include <com/sun/star/view/XSelectionChangeListener.hpp>
25 #include <com/sun/star/frame/XDispatch.hpp>
26 #include <com/sun/star/frame/XInterceptorInfo.hpp>
27 #include <cppuhelper/implbase.hxx>
28 #include <vector>
29 #include <vcl/svapp.hxx>
31 class SwView;
33 class SwXDispatchProviderInterceptor final : public cppu::WeakImplHelper
35 css::frame::XDispatchProviderInterceptor,
36 css::lang::XEventListener,
37 css::frame::XInterceptorInfo
40 class DispatchMutexLock_Impl
42 //::osl::MutexGuard aGuard; #102295# solar mutex has to be used currently
43 SolarMutexGuard aGuard;
44 public:
45 DispatchMutexLock_Impl();
46 ~DispatchMutexLock_Impl();
48 friend class DispatchMutexLock_Impl;
50 // ::osl::Mutex m_aMutex;#102295# solar mutex has to be used currently
52 // the component which's dispatches we're intercepting
53 css::uno::Reference< css::frame::XDispatchProviderInterception> m_xIntercepted;
55 // chaining
56 css::uno::Reference< css::frame::XDispatchProvider> m_xSlaveDispatcher;
57 css::uno::Reference< css::frame::XDispatchProvider> m_xMasterDispatcher;
59 css::uno::Reference< css::frame::XDispatch> m_xDispatch;
61 SwView* m_pView;
63 public:
64 SwXDispatchProviderInterceptor(SwView& rView);
65 virtual ~SwXDispatchProviderInterceptor() override;
67 //XDispatchProvider
68 virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch( const css::util::URL& aURL, const OUString& aTargetFrameName, sal_Int32 nSearchFlags ) override;
69 virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& aDescripts ) override;
71 //XDispatchProviderInterceptor
72 virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL getSlaveDispatchProvider( ) override;
73 virtual void SAL_CALL setSlaveDispatchProvider( const css::uno::Reference< css::frame::XDispatchProvider >& xNewDispatchProvider ) override;
74 virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL getMasterDispatchProvider( ) override;
75 virtual void SAL_CALL setMasterDispatchProvider( const css::uno::Reference< css::frame::XDispatchProvider >& xNewSupplier ) override;
77 // XEventListener
78 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
80 // XInterceptorInfo
81 virtual css::uno::Sequence<OUString> SAL_CALL getInterceptedURLs() override;
83 // view destroyed
84 void Invalidate();
87 struct StatusStruct_Impl
89 css::uno::Reference< css::frame::XStatusListener> xListener;
90 css::util::URL aURL;
92 class SwXDispatch final : public cppu::WeakImplHelper
94 css::frame::XDispatch,
95 css::view::XSelectionChangeListener
98 SwView* m_pView;
99 std::vector< StatusStruct_Impl > m_aStatusListenerVector;
100 bool m_bOldEnable;
101 bool m_bListenerAdded;
102 public:
103 SwXDispatch(SwView& rView);
104 virtual ~SwXDispatch() override;
106 virtual void SAL_CALL dispatch( const css::util::URL& aURL, const css::uno::Sequence< css::beans::PropertyValue >& aArgs ) override;
107 virtual void SAL_CALL addStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xControl, const css::util::URL& aURL ) override;
108 virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xControl, const css::util::URL& aURL ) override;
110 //XSelectionChangeListener
111 virtual void SAL_CALL selectionChanged( const css::lang::EventObject& aEvent ) override;
113 //XEventListener
114 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
116 static const char* GetDBChangeURL();
119 #endif
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */