1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
29 #include <vcl/svapp.hxx>
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
;
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
;
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
;
64 SwXDispatchProviderInterceptor(SwView
& rView
);
65 virtual ~SwXDispatchProviderInterceptor() override
;
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
;
78 virtual void SAL_CALL
disposing( const css::lang::EventObject
& Source
) override
;
81 virtual css::uno::Sequence
<OUString
> SAL_CALL
getInterceptedURLs() override
;
87 struct StatusStruct_Impl
89 css::uno::Reference
< css::frame::XStatusListener
> xListener
;
92 class SwXDispatch final
: public cppu::WeakImplHelper
94 css::frame::XDispatch
,
95 css::view::XSelectionChangeListener
99 std::vector
< StatusStruct_Impl
> m_aStatusListenerVector
;
101 bool m_bListenerAdded
;
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
;
114 virtual void SAL_CALL
disposing( const css::lang::EventObject
& Source
) override
;
116 static const char* GetDBChangeURL();
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */