LibreOffice Module sw (master) 1
unodispatch.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#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_UNODISPATCH_HXX
20#define INCLUDED_SW_SOURCE_UIBASE_INC_UNODISPATCH_HXX
21
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>
28#include <vector>
29#include <vcl/svapp.hxx>
30
31class SwView;
32
33class SwXDispatchProviderInterceptor final : public cppu::WeakImplHelper
34<
35 css::frame::XDispatchProviderInterceptor,
36 css::lang::XEventListener,
37 css::frame::XInterceptorInfo
38>
39{
41 {
42 //::osl::MutexGuard aGuard; #102295# solar mutex has to be used currently
44 public:
47 };
49
50// ::osl::Mutex m_aMutex;#102295# solar mutex has to be used currently
51
52 // the component which's dispatches we're intercepting
53 css::uno::Reference< css::frame::XDispatchProviderInterception> m_xIntercepted;
54
55 // chaining
56 css::uno::Reference< css::frame::XDispatchProvider> m_xSlaveDispatcher;
57 css::uno::Reference< css::frame::XDispatchProvider> m_xMasterDispatcher;
58
59 css::uno::Reference< css::frame::XDispatch> m_xDispatch;
60
62
63public:
65 virtual ~SwXDispatchProviderInterceptor() override;
66
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;
70
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;
76
77 // XEventListener
78 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
79
80 // XInterceptorInfo
81 virtual css::uno::Sequence<OUString> SAL_CALL getInterceptedURLs() override;
82
83 // view destroyed
84 void Invalidate();
85};
86
88{
89 css::uno::Reference< css::frame::XStatusListener> xListener;
90 css::util::URL aURL;
91};
92class SwXDispatch final : public cppu::WeakImplHelper
93<
94 css::frame::XDispatch,
95 css::view::XSelectionChangeListener
96>
97{
99 std::vector< StatusStruct_Impl > m_aStatusListenerVector;
102public:
103 SwXDispatch(SwView& rView);
104 virtual ~SwXDispatch() override;
105
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;
109
110 //XSelectionChangeListener
111 virtual void SAL_CALL selectionChanged( const css::lang::EventObject& aEvent ) override;
112
113 //XEventListener
114 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
115
116 static const char* GetDBChangeURL();
117};
118
119#endif
120
121/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: view.hxx:146
virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches(const css::uno::Sequence< css::frame::DispatchDescriptor > &aDescripts) override
virtual ~SwXDispatchProviderInterceptor() override
Definition: unodispatch.cxx:63
css::uno::Reference< css::frame::XDispatchProviderInterception > m_xIntercepted
Definition: unodispatch.hxx:53
SwXDispatchProviderInterceptor(SwView &rView)
Definition: unodispatch.cxx:45
virtual void SAL_CALL setMasterDispatchProvider(const css::uno::Reference< css::frame::XDispatchProvider > &xNewSupplier) override
css::uno::Reference< css::frame::XDispatch > m_xDispatch
Definition: unodispatch.hxx:59
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
virtual void SAL_CALL setSlaveDispatchProvider(const css::uno::Reference< css::frame::XDispatchProvider > &xNewDispatchProvider) override
css::uno::Reference< css::frame::XDispatchProvider > m_xMasterDispatcher
Definition: unodispatch.hxx:57
css::uno::Reference< css::frame::XDispatchProvider > m_xSlaveDispatcher
Definition: unodispatch.hxx:56
virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL getMasterDispatchProvider() override
virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch(const css::util::URL &aURL, const OUString &aTargetFrameName, sal_Int32 nSearchFlags) override
Definition: unodispatch.cxx:67
virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL getSlaveDispatchProvider() override
virtual css::uno::Sequence< OUString > SAL_CALL getInterceptedURLs() override
Definition: unodispatch.cxx:93
bool m_bListenerAdded
static const char * GetDBChangeURL()
virtual void SAL_CALL selectionChanged(const css::lang::EventObject &aEvent) override
virtual ~SwXDispatch() override
virtual void SAL_CALL dispatch(const css::util::URL &aURL, const css::uno::Sequence< css::beans::PropertyValue > &aArgs) override
SwView * m_pView
Definition: unodispatch.hxx:98
virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener > &xControl, const css::util::URL &aURL) override
std::vector< StatusStruct_Impl > m_aStatusListenerVector
Definition: unodispatch.hxx:99
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
SwXDispatch(SwView &rView)
virtual void SAL_CALL removeStatusListener(const css::uno::Reference< css::frame::XStatusListener > &xControl, const css::util::URL &aURL) override
css::util::URL aURL
Definition: unodispatch.hxx:90
css::uno::Reference< css::frame::XStatusListener > xListener
Definition: unodispatch.hxx:89