LibreOffice Module embeddedobj (master) 1
intercept.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
20#pragma once
21
22#include <osl/mutex.hxx>
24#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
25#include <com/sun/star/frame/XInterceptorInfo.hpp>
26#include <com/sun/star/frame/XDispatch.hpp>
27#include <memory>
28
29
31class DocumentHolder;
32
33class Interceptor : public ::cppu::WeakImplHelper< css::frame::XDispatchProviderInterceptor,
34 css::frame::XInterceptorInfo,
35 css::frame::XDispatch>
36{
37public:
38
39 Interceptor( DocumentHolder* pDocHolder );
40 virtual ~Interceptor() override;
41
43
44 //XDispatch
45 virtual void SAL_CALL
47 const css::util::URL& URL,
48 const css::uno::Sequence<
49 css::beans::PropertyValue >& Arguments ) override;
50
51 virtual void SAL_CALL
53 const css::uno::Reference<
54 css::frame::XStatusListener >& Control,
55 const css::util::URL& URL ) override;
56
57 virtual void SAL_CALL
59 const css::uno::Reference<
60 css::frame::XStatusListener >& Control,
61 const css::util::URL& URL ) override;
62
63 //XInterceptorInfo
64 virtual css::uno::Sequence< OUString >
65 SAL_CALL getInterceptedURLs( ) override;
66
67 //XDispatchProvider ( inherited by XDispatchProviderInterceptor )
68 virtual css::uno::Reference<
69 css::frame::XDispatch > SAL_CALL
71 const css::util::URL& URL,
72 const OUString& TargetFrameName,
73 sal_Int32 SearchFlags ) override;
74
75 virtual css::uno::Sequence<
76 css::uno::Reference<
77 css::frame::XDispatch > > SAL_CALL
79 const css::uno::Sequence<
80 css::frame::DispatchDescriptor >& Requests ) override;
81
82
83 //XDispatchProviderInterceptor
84 virtual css::uno::Reference<
85 css::frame::XDispatchProvider > SAL_CALL
86 getSlaveDispatchProvider( ) override;
87
88 virtual void SAL_CALL
90 const css::uno::Reference<
91 css::frame::XDispatchProvider >& NewDispatchProvider ) override;
92
93 virtual css::uno::Reference<
94 css::frame::XDispatchProvider > SAL_CALL
95 getMasterDispatchProvider( ) override;
96
97 virtual void SAL_CALL
99 const css::uno::Reference<
100 css::frame::XDispatchProvider >& NewSupplier ) override;
101
102
103private:
104
105 osl::Mutex m_aMutex;
106
107 DocumentHolder* m_pDocHolder;
108
109 css::uno::Reference< css::frame::XDispatchProvider > m_xSlaveDispatchProvider;
110 css::uno::Reference< css::frame::XDispatchProvider > m_xMasterDispatchProvider;
111
112 static const css::uno::Sequence< OUString > m_aInterceptedURL;
113
114 std::unique_ptr<StatusChangeListenerContainer> m_pStatCL;
115};
116
117/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch(const css::util::URL &URL, const OUString &TargetFrameName, sal_Int32 SearchFlags) override
virtual css::uno::Sequence< OUString > SAL_CALL getInterceptedURLs() override
Definition: intercept.cxx:211
void DisconnectDocHolder()
Definition: intercept.cxx:47
virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL getSlaveDispatchProvider() override
Definition: intercept.cxx:281
osl::Mutex m_aMutex
Definition: intercept.hxx:105
static const css::uno::Sequence< OUString > m_aInterceptedURL
Definition: intercept.hxx:112
virtual void SAL_CALL removeStatusListener(const css::uno::Reference< css::frame::XStatusListener > &Control, const css::util::URL &URL) override
virtual void SAL_CALL setSlaveDispatchProvider(const css::uno::Reference< css::frame::XDispatchProvider > &NewDispatchProvider) override
css::uno::Reference< css::frame::XDispatchProvider > m_xSlaveDispatchProvider
Definition: intercept.hxx:109
virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches(const css::uno::Sequence< css::frame::DispatchDescriptor > &Requests) override
virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener > &Control, const css::util::URL &URL) override
~Interceptor() override
Definition: intercept.cxx:58
StatusChangeListenerContainer * m_pStatCL
virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL getMasterDispatchProvider() override
Definition: intercept.cxx:297
Interceptor(const ::rtl::Reference< EmbeddedDocumentInstanceAccess_Impl > &xOleAccess, DocumentHolder *pDocH, bool bLink)
virtual void SAL_CALL dispatch(const css::util::URL &URL, const css::uno::Sequence< css::beans::PropertyValue > &Arguments) override
css::uno::Reference< css::frame::XDispatchProvider > m_xMasterDispatchProvider
Definition: intercept.hxx:110
virtual void SAL_CALL setMasterDispatchProvider(const css::uno::Reference< css::frame::XDispatchProvider > &NewSupplier) override