tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / dbaccess / source / core / dataaccess / intercept.hxx
blob7ce53752f19d854d69ee87287ca180fed9d7d5bb
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 <cppuhelper/interfacecontainer.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>
28 #include "documentdefinition.hxx"
29 #include <vcl/svapp.hxx>
31 namespace dbaccess
35 class OInterceptor : public ::cppu::WeakImplHelper< css::frame::XDispatchProviderInterceptor,
36 css::frame::XInterceptorInfo,
37 css::frame::XDispatch >
39 DECL_LINK( OnDispatch, void*, void );
40 protected:
41 virtual ~OInterceptor() override;
42 public:
44 explicit OInterceptor( ODocumentDefinition* _pContentHolder );
46 /// @throws css::uno::RuntimeException
47 void dispose();
49 //XDispatch
50 virtual void SAL_CALL
51 dispatch(
52 const css::util::URL& URL,
53 const css::uno::Sequence< css::beans::PropertyValue >& Arguments ) override;
55 virtual void SAL_CALL
56 addStatusListener(
57 const css::uno::Reference< css::frame::XStatusListener >& Control,
58 const css::util::URL& URL ) override;
60 virtual void SAL_CALL
61 removeStatusListener(
62 const css::uno::Reference< 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< css::frame::XDispatch > SAL_CALL
71 queryDispatch(
72 const css::util::URL& URL,
73 const OUString& TargetFrameName,
74 sal_Int32 SearchFlags ) override;
76 virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL
77 queryDispatches(
78 const css::uno::Sequence< css::frame::DispatchDescriptor >& Requests ) override;
80 //XDispatchProviderInterceptor
81 virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL
82 getSlaveDispatchProvider( ) override;
84 virtual void SAL_CALL
85 setSlaveDispatchProvider(
86 const css::uno::Reference< css::frame::XDispatchProvider >& NewDispatchProvider ) override;
88 virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL
89 getMasterDispatchProvider( ) override;
91 virtual void SAL_CALL
92 setMasterDispatchProvider(
93 const css::uno::Reference< css::frame::XDispatchProvider >& NewSupplier ) override;
95 private:
97 osl::Mutex m_aMutex;
99 ODocumentDefinition* m_pContentHolder;
101 css::uno::Reference< css::frame::XDispatchProvider > m_xSlaveDispatchProvider;
102 css::uno::Reference< css::frame::XDispatchProvider > m_xMasterDispatchProvider;
104 css::uno::Sequence< OUString > m_aInterceptedURL;
106 typedef comphelper::OMultiTypeInterfaceContainerHelperVar3<css::frame::XStatusListener, OUString>
107 StatusListenerContainer;
108 std::unique_ptr<StatusListenerContainer> m_pStatCL;
111 } // namespace dbaccess
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */