1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: intercept.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef DBA_INTERCEPT_HXX
32 #define DBA_INTERCEPT_HXX
34 #ifndef _OSL_MUTEX_HXX_
35 #include <osl/mutex.hxx>
37 #ifndef _CPPUHELPER_IMPLBASE4_HXX_
38 #include <cppuhelper/implbase4.hxx>
40 #ifndef _CPPUHELPER_INTERFACECONTAINER_HXX_
41 #include <cppuhelper/interfacecontainer.hxx>
43 #ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDERINTERCEPTOR_HPP_
44 #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
46 #ifndef _COM_SUN_STAR_FRAME_XINTERCEPTORINFO_HPP_
47 #include <com/sun/star/frame/XInterceptorInfo.hpp>
49 #ifndef _COM_SUN_STAR_DOCUMENT_XEVENTLISTENER_HPP_
50 #include <com/sun/star/document/XEventListener.hpp>
52 #ifndef _COM_SUN_STAR_FRAME_XDISPATCH_HPP_
53 #include <com/sun/star/frame/XDispatch.hpp>
55 #ifndef _DBA_COREDATAACCESS_DOCUMENTDEFINITION_HXX_
56 #include "documentdefinition.hxx"
58 #include <vcl/svapp.hxx>
64 class OInterceptor
: public ::cppu::WeakImplHelper4
< ::com::sun::star::frame::XDispatchProviderInterceptor
,
65 ::com::sun::star::frame::XInterceptorInfo
,
66 ::com::sun::star::frame::XDispatch
,
67 ::com::sun::star::document::XEventListener
>
69 DECL_LINK( OnDispatch
, void* _aURL
);
71 virtual ~OInterceptor();
74 OInterceptor( ODocumentDefinition
* _pContentHolder
,sal_Bool _bAllowEditDoc
);
76 void SAL_CALL
dispose() throw(::com::sun::star::uno::RuntimeException
);
81 const ::com::sun::star::util::URL
& URL
,
82 const ::com::sun::star::uno::Sequence
<
83 ::com::sun::star::beans::PropertyValue
>& Arguments
)
84 throw (::com::sun::star::uno::RuntimeException
);
88 const ::com::sun::star::uno::Reference
<
89 ::com::sun::star::frame::XStatusListener
>& Control
,
90 const ::com::sun::star::util::URL
& URL
)
92 ::com::sun::star::uno::RuntimeException
97 const ::com::sun::star::uno::Reference
<
98 ::com::sun::star::frame::XStatusListener
>& Control
,
99 const ::com::sun::star::util::URL
& URL
)
101 ::com::sun::star::uno::RuntimeException
105 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
>
106 SAL_CALL
getInterceptedURLs( )
108 ::com::sun::star::uno::RuntimeException
111 //XDispatchProvider ( inherited by XDispatchProviderInterceptor )
112 virtual ::com::sun::star::uno::Reference
<
113 ::com::sun::star::frame::XDispatch
> SAL_CALL
115 const ::com::sun::star::util::URL
& URL
,
116 const ::rtl::OUString
& TargetFrameName
,
117 sal_Int32 SearchFlags
)
119 ::com::sun::star::uno::RuntimeException
122 virtual ::com::sun::star::uno::Sequence
<
123 ::com::sun::star::uno::Reference
<
124 ::com::sun::star::frame::XDispatch
> > SAL_CALL
126 const ::com::sun::star::uno::Sequence
<
127 ::com::sun::star::frame::DispatchDescriptor
>& Requests
)
129 ::com::sun::star::uno::RuntimeException
133 //XDispatchProviderInterceptor
134 virtual ::com::sun::star::uno::Reference
<
135 ::com::sun::star::frame::XDispatchProvider
> SAL_CALL
136 getSlaveDispatchProvider( )
138 ::com::sun::star::uno::RuntimeException
141 virtual void SAL_CALL
142 setSlaveDispatchProvider(
143 const ::com::sun::star::uno::Reference
<
144 ::com::sun::star::frame::XDispatchProvider
>& NewDispatchProvider
)
146 ::com::sun::star::uno::RuntimeException
149 virtual ::com::sun::star::uno::Reference
<
150 ::com::sun::star::frame::XDispatchProvider
> SAL_CALL
151 getMasterDispatchProvider( )
153 ::com::sun::star::uno::RuntimeException
156 virtual void SAL_CALL
157 setMasterDispatchProvider(
158 const ::com::sun::star::uno::Reference
<
159 ::com::sun::star::frame::XDispatchProvider
>& NewSupplier
)
161 ::com::sun::star::uno::RuntimeException
165 virtual void SAL_CALL
notifyEvent( const ::com::sun::star::document::EventObject
& Event
) throw (::com::sun::star::uno::RuntimeException
);
166 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& Source
) throw (::com::sun::star::uno::RuntimeException
);
173 ODocumentDefinition
* m_pContentHolder
;
175 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProvider
> m_xSlaveDispatchProvider
;
176 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProvider
> m_xMasterDispatchProvider
;
178 ::com::sun::star::uno::Sequence
< ::rtl::OUString
> m_aInterceptedURL
;
180 cppu::OInterfaceContainerHelper
* m_pDisposeEventListeners
;
181 PropertyChangeListenerContainer
* m_pStatCL
;
182 sal_Bool m_bAllowEditDoc
;
186 //........................................................................
187 } // namespace dbaccess
188 //........................................................................
191 #endif //DBA_INTERCEPT_HXX