LibreOffice Module dbaccess (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>
25#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
26#include <com/sun/star/frame/XInterceptorInfo.hpp>
27#include <com/sun/star/frame/XDispatch.hpp>
29#include <vcl/svapp.hxx>
30
31namespace dbaccess
32{
33
34
35class OInterceptor : public ::cppu::WeakImplHelper< css::frame::XDispatchProviderInterceptor,
36 css::frame::XInterceptorInfo,
37 css::frame::XDispatch >
38{
39 DECL_LINK( OnDispatch, void*, void );
40protected:
41 virtual ~OInterceptor() override;
42public:
43
44 explicit OInterceptor( ODocumentDefinition* _pContentHolder );
45
47 void dispose();
48
49 //XDispatch
50 virtual void SAL_CALL
52 const css::util::URL& URL,
53 const css::uno::Sequence< css::beans::PropertyValue >& Arguments ) override;
54
55 virtual void SAL_CALL
57 const css::uno::Reference< css::frame::XStatusListener >& Control,
58 const css::util::URL& URL ) override;
59
60 virtual void SAL_CALL
62 const css::uno::Reference< css::frame::XStatusListener >& Control,
63 const css::util::URL& URL ) override;
64
65 //XInterceptorInfo
66 virtual css::uno::Sequence< OUString >
67 SAL_CALL getInterceptedURLs( ) override;
68
69 //XDispatchProvider ( inherited by XDispatchProviderInterceptor )
70 virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL
72 const css::util::URL& URL,
73 const OUString& TargetFrameName,
74 sal_Int32 SearchFlags ) override;
75
76 virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL
78 const css::uno::Sequence< css::frame::DispatchDescriptor >& Requests ) override;
79
80 //XDispatchProviderInterceptor
81 virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL
82 getSlaveDispatchProvider( ) override;
83
84 virtual void SAL_CALL
86 const css::uno::Reference< css::frame::XDispatchProvider >& NewDispatchProvider ) override;
87
88 virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL
89 getMasterDispatchProvider( ) override;
90
91 virtual void SAL_CALL
93 const css::uno::Reference< css::frame::XDispatchProvider >& NewSupplier ) override;
94
95private:
96
97 osl::Mutex m_aMutex;
98
100
101 css::uno::Reference< css::frame::XDispatchProvider > m_xSlaveDispatchProvider;
102 css::uno::Reference< css::frame::XDispatchProvider > m_xMasterDispatchProvider;
103
104 css::uno::Sequence< OUString > m_aInterceptedURL;
105
108 std::unique_ptr<StatusListenerContainer> m_pStatCL;
109};
110
111} // namespace dbaccess
112
113/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener > &Control, const css::util::URL &URL) override
Definition: intercept.cxx:186
DECL_LINK(OnDispatch, void *, void)
virtual void SAL_CALL dispatch(const css::util::URL &URL, const css::uno::Sequence< css::beans::PropertyValue > &Arguments) override
Definition: intercept.cxx:94
OInterceptor(ODocumentDefinition *_pContentHolder)
Definition: intercept.cxx:66
virtual ~OInterceptor() override
Definition: intercept.cxx:79
virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches(const css::uno::Sequence< css::frame::DispatchDescriptor > &Requests) override
Definition: intercept.cxx:304
css::uno::Reference< css::frame::XDispatchProvider > m_xMasterDispatchProvider
Definition: intercept.hxx:102
virtual void SAL_CALL setSlaveDispatchProvider(const css::uno::Reference< css::frame::XDispatchProvider > &NewDispatchProvider) override
Definition: intercept.cxx:340
virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL getMasterDispatchProvider() override
Definition: intercept.cxx:347
virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch(const css::util::URL &URL, const OUString &TargetFrameName, sal_Int32 SearchFlags) override
Definition: intercept.cxx:287
css::uno::Reference< css::frame::XDispatchProvider > m_xSlaveDispatchProvider
Definition: intercept.hxx:101
virtual css::uno::Sequence< OUString > SAL_CALL getInterceptedURLs() override
Definition: intercept.cxx:278
css::uno::Sequence< OUString > m_aInterceptedURL
Definition: intercept.hxx:104
ODocumentDefinition * m_pContentHolder
Definition: intercept.hxx:99
comphelper::OMultiTypeInterfaceContainerHelperVar3< css::frame::XStatusListener, OUString > StatusListenerContainer
Definition: intercept.hxx:107
virtual void SAL_CALL setMasterDispatchProvider(const css::uno::Reference< css::frame::XDispatchProvider > &NewSupplier) override
Definition: intercept.cxx:354
virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL getSlaveDispatchProvider() override
Definition: intercept.cxx:333
std::unique_ptr< StatusListenerContainer > m_pStatCL
Definition: intercept.hxx:108
virtual void SAL_CALL removeStatusListener(const css::uno::Reference< css::frame::XStatusListener > &Control, const css::util::URL &URL) override
Definition: intercept.cxx:262