Add Marathi autocorrect
[LibreOffice.git] / sw / source / uibase / inc / unodispatch.hxx
blob87f1b9baeb9974591cfdab43985265c8608fc224
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;
32 class SwXDispatch;
34 class SwXDispatchProviderInterceptor final : public cppu::WeakImplHelper
36 css::frame::XDispatchProviderInterceptor,
37 css::lang::XEventListener,
38 css::frame::XInterceptorInfo
41 class DispatchMutexLock_Impl
43 //::osl::MutexGuard aGuard; #102295# solar mutex has to be used currently
44 SolarMutexGuard aGuard;
45 public:
46 DispatchMutexLock_Impl();
47 ~DispatchMutexLock_Impl();
49 friend class DispatchMutexLock_Impl;
51 // ::osl::Mutex m_aMutex;#102295# solar mutex has to be used currently
53 // the component which's dispatches we're intercepting
54 css::uno::Reference< css::frame::XDispatchProviderInterception> m_xIntercepted;
56 // chaining
57 css::uno::Reference< css::frame::XDispatchProvider> m_xSlaveDispatcher;
58 css::uno::Reference< css::frame::XDispatchProvider> m_xMasterDispatcher;
60 rtl::Reference<SwXDispatch> m_xDispatch;
62 SwView* m_pView;
64 public:
65 SwXDispatchProviderInterceptor(SwView& rView);
66 virtual ~SwXDispatchProviderInterceptor() override;
68 //XDispatchProvider
69 virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch( const css::util::URL& aURL, const OUString& aTargetFrameName, sal_Int32 nSearchFlags ) override;
70 virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& aDescripts ) override;
72 //XDispatchProviderInterceptor
73 virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL getSlaveDispatchProvider( ) override;
74 virtual void SAL_CALL setSlaveDispatchProvider( const css::uno::Reference< css::frame::XDispatchProvider >& xNewDispatchProvider ) override;
75 virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL getMasterDispatchProvider( ) override;
76 virtual void SAL_CALL setMasterDispatchProvider( const css::uno::Reference< css::frame::XDispatchProvider >& xNewSupplier ) override;
78 // XEventListener
79 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
81 // XInterceptorInfo
82 virtual css::uno::Sequence<OUString> SAL_CALL getInterceptedURLs() override;
84 // view destroyed
85 void Invalidate();
88 struct StatusStruct_Impl
90 css::uno::Reference< css::frame::XStatusListener> xListener;
91 css::util::URL aURL;
93 class SwXDispatch final : public cppu::WeakImplHelper
95 css::frame::XDispatch,
96 css::view::XSelectionChangeListener
99 SwView* m_pView;
100 std::vector< StatusStruct_Impl > m_aStatusListenerVector;
101 bool m_bOldEnable;
102 bool m_bListenerAdded;
103 public:
104 SwXDispatch(SwView& rView);
105 virtual ~SwXDispatch() override;
107 virtual void SAL_CALL dispatch( const css::util::URL& aURL, const css::uno::Sequence< css::beans::PropertyValue >& aArgs ) override;
108 virtual void SAL_CALL addStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xControl, const css::util::URL& aURL ) override;
109 virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xControl, const css::util::URL& aURL ) override;
111 //XSelectionChangeListener
112 virtual void SAL_CALL selectionChanged( const css::lang::EventObject& aEvent ) override;
114 //XEventListener
115 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
117 static const char* GetDBChangeURL();
120 #endif
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */