Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / embeddedobj / source / inc / intercept.hxx
blob2dc14738abe82a2ac130c913744bac2f79be9af2
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 .
20 #pragma once
22 #include <osl/mutex.hxx>
23 #include <cppuhelper/implbase.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>
30 class StatusChangeListenerContainer;
31 class DocumentHolder;
33 class Interceptor : public ::cppu::WeakImplHelper< css::frame::XDispatchProviderInterceptor,
34 css::frame::XInterceptorInfo,
35 css::frame::XDispatch>
37 public:
39 Interceptor( DocumentHolder* pDocHolder );
40 virtual ~Interceptor() override;
42 void DisconnectDocHolder();
44 //XDispatch
45 virtual void SAL_CALL
46 dispatch(
47 const css::util::URL& URL,
48 const css::uno::Sequence<
49 css::beans::PropertyValue >& Arguments ) override;
51 virtual void SAL_CALL
52 addStatusListener(
53 const css::uno::Reference<
54 css::frame::XStatusListener >& Control,
55 const css::util::URL& URL ) override;
57 virtual void SAL_CALL
58 removeStatusListener(
59 const css::uno::Reference<
60 css::frame::XStatusListener >& Control,
61 const css::util::URL& URL ) override;
63 //XInterceptorInfo
64 virtual css::uno::Sequence< OUString >
65 SAL_CALL getInterceptedURLs( ) override;
67 //XDispatchProvider ( inherited by XDispatchProviderInterceptor )
68 virtual css::uno::Reference<
69 css::frame::XDispatch > SAL_CALL
70 queryDispatch(
71 const css::util::URL& URL,
72 const OUString& TargetFrameName,
73 sal_Int32 SearchFlags ) override;
75 virtual css::uno::Sequence<
76 css::uno::Reference<
77 css::frame::XDispatch > > SAL_CALL
78 queryDispatches(
79 const css::uno::Sequence<
80 css::frame::DispatchDescriptor >& Requests ) override;
83 //XDispatchProviderInterceptor
84 virtual css::uno::Reference<
85 css::frame::XDispatchProvider > SAL_CALL
86 getSlaveDispatchProvider( ) override;
88 virtual void SAL_CALL
89 setSlaveDispatchProvider(
90 const css::uno::Reference<
91 css::frame::XDispatchProvider >& NewDispatchProvider ) override;
93 virtual css::uno::Reference<
94 css::frame::XDispatchProvider > SAL_CALL
95 getMasterDispatchProvider( ) override;
97 virtual void SAL_CALL
98 setMasterDispatchProvider(
99 const css::uno::Reference<
100 css::frame::XDispatchProvider >& NewSupplier ) override;
103 private:
105 osl::Mutex m_aMutex;
107 DocumentHolder* m_pDocHolder;
109 css::uno::Reference< css::frame::XDispatchProvider > m_xSlaveDispatchProvider;
110 css::uno::Reference< css::frame::XDispatchProvider > m_xMasterDispatchProvider;
112 static const css::uno::Sequence< OUString > m_aInterceptedURL;
114 std::unique_ptr<StatusChangeListenerContainer> m_pStatCL;
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */