Bump version to 6.4-15
[LibreOffice.git] / embedserv / source / inc / intercept.hxx
blobab3fb63cad8f5943caa223fa4dd019224c440d26
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_EMBEDSERV_SOURCE_INC_INTERCEPT_HXX
21 #define INCLUDED_EMBEDSERV_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>
30 #include <rtl/ref.hxx>
31 #include "embeddocaccess.hxx"
34 class StatusChangeListenerContainer;
35 class EmbedDocument_Impl;
36 class DocumentHolder;
38 class Interceptor
39 : public ::cppu::WeakImplHelper<
40 css::frame::XDispatchProviderInterceptor,
41 css::frame::XInterceptorInfo,
42 css::frame::XDispatch>
44 public:
46 Interceptor(
47 const ::rtl::Reference< EmbeddedDocumentInstanceAccess_Impl >& xOleAccess,
48 DocumentHolder* pDocH,
49 bool bLink );
51 ~Interceptor() override;
53 void DisconnectDocHolder();
55 void generateFeatureStateEvent();
57 // overwritten to release the statuslistener.
60 // XComponent
61 /// @throws css::uno::RuntimeException
62 virtual void
63 addEventListener(
64 const css::uno::Reference< css::lang::XEventListener >& xListener );
66 /// @throws css::uno::RuntimeException
67 virtual void
68 removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener );
70 /// @throws css::uno::RuntimeException
71 void
72 dispose();
75 //XDispatch
76 virtual void SAL_CALL
77 dispatch(
78 const css::util::URL& URL,
79 const css::uno::Sequence< css::beans::PropertyValue >& Arguments ) override;
81 virtual void SAL_CALL
82 addStatusListener(
83 const css::uno::Reference< css::frame::XStatusListener >& Control,
84 const css::util::URL& URL ) override;
86 virtual void SAL_CALL
87 removeStatusListener(
88 const css::uno::Reference< css::frame::XStatusListener >& Control,
89 const css::util::URL& URL ) override;
91 //XInterceptorInfo
92 virtual css::uno::Sequence< OUString >
93 SAL_CALL getInterceptedURLs( ) override;
96 //XDispatchProvider ( inherited by XDispatchProviderInterceptor )
97 virtual css::uno::Reference<
98 css::frame::XDispatch > SAL_CALL
99 queryDispatch(
100 const css::util::URL& URL,
101 const OUString& TargetFrameName,
102 sal_Int32 SearchFlags ) override;
104 virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL
105 queryDispatches(
106 const css::uno::Sequence<
107 css::frame::DispatchDescriptor >& Requests ) override;
110 //XDispatchProviderInterceptor
111 virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL
112 getSlaveDispatchProvider( ) override;
114 virtual void SAL_CALL
115 setSlaveDispatchProvider(
116 const css::uno::Reference< css::frame::XDispatchProvider >& NewDispatchProvider ) override;
118 virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL
119 getMasterDispatchProvider( ) override;
121 virtual void SAL_CALL
122 setMasterDispatchProvider(
123 const css::uno::Reference< css::frame::XDispatchProvider >& NewSupplier ) override;
126 private:
128 osl::Mutex m_aMutex;
130 ::rtl::Reference< EmbeddedDocumentInstanceAccess_Impl > m_xOleAccess;
132 css::uno::WeakReference< css::uno::XInterface > m_xDocHLocker;
133 DocumentHolder* m_pDocH;
135 css::uno::Reference< css::frame::XDispatchProvider > m_xSlaveDispatchProvider;
137 css::uno::Reference< css::frame::XDispatchProvider > m_xMasterDispatchProvider;
139 static css::uno::Sequence< OUString > m_aInterceptedURL;
141 comphelper::OInterfaceContainerHelper2* m_pDisposeEventListeners;
142 StatusChangeListenerContainer* m_pStatCL;
144 bool m_bLink;
147 #endif
149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */