Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / embeddedobj / source / inc / intercept.hxx
blob987792c5431a2a3d4a9c2d5aee43d6e57e85e1f3
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 #ifndef INCLUDED_EMBEDDEDOBJ_SOURCE_INC_INTERCEPT_HXX
21 #define INCLUDED_EMBEDDEDOBJ_SOURCE_INC_INTERCEPT_HXX
23 #include <osl/mutex.hxx>
24 #include <cppuhelper/implbase.hxx>
25 #include <comphelper/interfacecontainer2.hxx>
26 #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
27 #include <com/sun/star/frame/XInterceptorInfo.hpp>
28 #include <com/sun/star/frame/XDispatch.hpp>
29 #include <memory>
32 class StatusChangeListenerContainer;
33 class DocumentHolder;
35 class Interceptor : public ::cppu::WeakImplHelper< css::frame::XDispatchProviderInterceptor,
36 css::frame::XInterceptorInfo,
37 css::frame::XDispatch>
39 public:
41 Interceptor( DocumentHolder* pDocHolder );
42 virtual ~Interceptor() override;
44 void DisconnectDocHolder();
46 //XDispatch
47 virtual void SAL_CALL
48 dispatch(
49 const css::util::URL& URL,
50 const css::uno::Sequence<
51 css::beans::PropertyValue >& Arguments ) override;
53 virtual void SAL_CALL
54 addStatusListener(
55 const css::uno::Reference<
56 css::frame::XStatusListener >& Control,
57 const css::util::URL& URL ) override;
59 virtual void SAL_CALL
60 removeStatusListener(
61 const css::uno::Reference<
62 css::frame::XStatusListener >& Control,
63 const css::util::URL& URL ) override;
65 //XInterceptorInfo
66 virtual css::uno::Sequence< OUString >
67 SAL_CALL getInterceptedURLs( ) override;
69 //XDispatchProvider ( inherited by XDispatchProviderInterceptor )
70 virtual css::uno::Reference<
71 css::frame::XDispatch > SAL_CALL
72 queryDispatch(
73 const css::util::URL& URL,
74 const OUString& TargetFrameName,
75 sal_Int32 SearchFlags ) override;
77 virtual css::uno::Sequence<
78 css::uno::Reference<
79 css::frame::XDispatch > > SAL_CALL
80 queryDispatches(
81 const css::uno::Sequence<
82 css::frame::DispatchDescriptor >& Requests ) override;
85 //XDispatchProviderInterceptor
86 virtual css::uno::Reference<
87 css::frame::XDispatchProvider > SAL_CALL
88 getSlaveDispatchProvider( ) override;
90 virtual void SAL_CALL
91 setSlaveDispatchProvider(
92 const css::uno::Reference<
93 css::frame::XDispatchProvider >& NewDispatchProvider ) override;
95 virtual css::uno::Reference<
96 css::frame::XDispatchProvider > SAL_CALL
97 getMasterDispatchProvider( ) override;
99 virtual void SAL_CALL
100 setMasterDispatchProvider(
101 const css::uno::Reference<
102 css::frame::XDispatchProvider >& NewSupplier ) override;
105 private:
107 osl::Mutex m_aMutex;
109 DocumentHolder* m_pDocHolder;
111 css::uno::Reference< css::frame::XDispatchProvider > m_xSlaveDispatchProvider;
112 css::uno::Reference< css::frame::XDispatchProvider > m_xMasterDispatchProvider;
114 static css::uno::Sequence< OUString > m_aInterceptedURL;
116 std::unique_ptr<StatusChangeListenerContainer> m_pStatCL;
119 #endif
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */