merge the formfield patch from ooo-build
[ooovba.git] / dbaccess / source / core / dataaccess / intercept.hxx
bloba35f38538a461d80283c9d505dd597eedd7cad9a
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: intercept.hxx,v $
10 * $Revision: 1.6 $
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>
36 #endif
37 #ifndef _CPPUHELPER_IMPLBASE4_HXX_
38 #include <cppuhelper/implbase4.hxx>
39 #endif
40 #ifndef _CPPUHELPER_INTERFACECONTAINER_HXX_
41 #include <cppuhelper/interfacecontainer.hxx>
42 #endif
43 #ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDERINTERCEPTOR_HPP_
44 #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
45 #endif
46 #ifndef _COM_SUN_STAR_FRAME_XINTERCEPTORINFO_HPP_
47 #include <com/sun/star/frame/XInterceptorInfo.hpp>
48 #endif
49 #ifndef _COM_SUN_STAR_DOCUMENT_XEVENTLISTENER_HPP_
50 #include <com/sun/star/document/XEventListener.hpp>
51 #endif
52 #ifndef _COM_SUN_STAR_FRAME_XDISPATCH_HPP_
53 #include <com/sun/star/frame/XDispatch.hpp>
54 #endif
55 #ifndef _DBA_COREDATAACCESS_DOCUMENTDEFINITION_HXX_
56 #include "documentdefinition.hxx"
57 #endif
58 #include <vcl/svapp.hxx>
60 namespace dbaccess
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 );
70 protected:
71 virtual ~OInterceptor();
72 public:
74 OInterceptor( ODocumentDefinition* _pContentHolder,sal_Bool _bAllowEditDoc );
76 void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
78 //XDispatch
79 virtual void SAL_CALL
80 dispatch(
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);
86 virtual void SAL_CALL
87 addStatusListener(
88 const ::com::sun::star::uno::Reference<
89 ::com::sun::star::frame::XStatusListener >& Control,
90 const ::com::sun::star::util::URL& URL )
91 throw (
92 ::com::sun::star::uno::RuntimeException
95 virtual void SAL_CALL
96 removeStatusListener(
97 const ::com::sun::star::uno::Reference<
98 ::com::sun::star::frame::XStatusListener >& Control,
99 const ::com::sun::star::util::URL& URL )
100 throw (
101 ::com::sun::star::uno::RuntimeException
104 //XInterceptorInfo
105 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
106 SAL_CALL getInterceptedURLs( )
107 throw (
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
114 queryDispatch(
115 const ::com::sun::star::util::URL& URL,
116 const ::rtl::OUString& TargetFrameName,
117 sal_Int32 SearchFlags )
118 throw (
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
125 queryDispatches(
126 const ::com::sun::star::uno::Sequence<
127 ::com::sun::star::frame::DispatchDescriptor >& Requests )
128 throw (
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( )
137 throw (
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 )
145 throw (
146 ::com::sun::star::uno::RuntimeException
149 virtual ::com::sun::star::uno::Reference<
150 ::com::sun::star::frame::XDispatchProvider > SAL_CALL
151 getMasterDispatchProvider( )
152 throw (
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 )
160 throw (
161 ::com::sun::star::uno::RuntimeException
164 // XEventListener
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);
169 private:
171 osl::Mutex m_aMutex;
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