1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_DBACCESS_SOURCE_CORE_DATAACCESS_INTERCEPT_HXX
21 #define INCLUDED_DBACCESS_SOURCE_CORE_DATAACCESS_INTERCEPT_HXX
23 #include <osl/mutex.hxx>
24 #include <cppuhelper/implbase4.hxx>
25 #include <cppuhelper/interfacecontainer.hxx>
26 #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
27 #include <com/sun/star/frame/XInterceptorInfo.hpp>
28 #include <com/sun/star/document/XDocumentEventListener.hpp>
29 #include <com/sun/star/frame/XDispatch.hpp>
30 #include "documentdefinition.hxx"
31 #include <vcl/svapp.hxx>
37 class OInterceptor
: public ::cppu::WeakImplHelper4
< ::com::sun::star::frame::XDispatchProviderInterceptor
,
38 ::com::sun::star::frame::XInterceptorInfo
,
39 ::com::sun::star::frame::XDispatch
,
40 ::com::sun::star::document::XDocumentEventListener
>
42 DECL_LINK( OnDispatch
, void* _aURL
);
44 virtual ~OInterceptor();
47 OInterceptor( ODocumentDefinition
* _pContentHolder
);
49 void SAL_CALL
dispose() throw(::com::sun::star::uno::RuntimeException
);
54 const ::com::sun::star::util::URL
& URL
,
55 const ::com::sun::star::uno::Sequence
<
56 ::com::sun::star::beans::PropertyValue
>& Arguments
)
57 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
61 const ::com::sun::star::uno::Reference
<
62 ::com::sun::star::frame::XStatusListener
>& Control
,
63 const ::com::sun::star::util::URL
& URL
)
65 ::com::sun::star::uno::RuntimeException
, std::exception
70 const ::com::sun::star::uno::Reference
<
71 ::com::sun::star::frame::XStatusListener
>& Control
,
72 const ::com::sun::star::util::URL
& URL
)
74 ::com::sun::star::uno::RuntimeException
, std::exception
78 virtual ::com::sun::star::uno::Sequence
< OUString
>
79 SAL_CALL
getInterceptedURLs( )
81 ::com::sun::star::uno::RuntimeException
, std::exception
84 //XDispatchProvider ( inherited by XDispatchProviderInterceptor )
85 virtual ::com::sun::star::uno::Reference
<
86 ::com::sun::star::frame::XDispatch
> SAL_CALL
88 const ::com::sun::star::util::URL
& URL
,
89 const OUString
& TargetFrameName
,
90 sal_Int32 SearchFlags
)
92 ::com::sun::star::uno::RuntimeException
, std::exception
95 virtual ::com::sun::star::uno::Sequence
<
96 ::com::sun::star::uno::Reference
<
97 ::com::sun::star::frame::XDispatch
> > SAL_CALL
99 const ::com::sun::star::uno::Sequence
<
100 ::com::sun::star::frame::DispatchDescriptor
>& Requests
)
102 ::com::sun::star::uno::RuntimeException
, std::exception
105 //XDispatchProviderInterceptor
106 virtual ::com::sun::star::uno::Reference
<
107 ::com::sun::star::frame::XDispatchProvider
> SAL_CALL
108 getSlaveDispatchProvider( )
110 ::com::sun::star::uno::RuntimeException
, std::exception
113 virtual void SAL_CALL
114 setSlaveDispatchProvider(
115 const ::com::sun::star::uno::Reference
<
116 ::com::sun::star::frame::XDispatchProvider
>& NewDispatchProvider
)
118 ::com::sun::star::uno::RuntimeException
, std::exception
121 virtual ::com::sun::star::uno::Reference
<
122 ::com::sun::star::frame::XDispatchProvider
> SAL_CALL
123 getMasterDispatchProvider( )
125 ::com::sun::star::uno::RuntimeException
, std::exception
128 virtual void SAL_CALL
129 setMasterDispatchProvider(
130 const ::com::sun::star::uno::Reference
<
131 ::com::sun::star::frame::XDispatchProvider
>& NewSupplier
)
133 ::com::sun::star::uno::RuntimeException
, std::exception
136 // XDocumentEventListener
137 virtual void SAL_CALL
documentEventOccured( const ::com::sun::star::document::DocumentEvent
& Event
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
138 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& Source
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
144 ODocumentDefinition
* m_pContentHolder
;
146 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProvider
> m_xSlaveDispatchProvider
;
147 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProvider
> m_xMasterDispatchProvider
;
149 ::com::sun::star::uno::Sequence
< OUString
> m_aInterceptedURL
;
151 cppu::OInterfaceContainerHelper
* m_pDisposeEventListeners
;
152 PropertyChangeListenerContainer
* m_pStatCL
;
155 } // namespace dbaccess
157 #endif // INCLUDED_DBACCESS_SOURCE_CORE_DATAACCESS_INTERCEPT_HXX
159 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */