xref: /trunk/main/dbaccess/source/core/dataaccess/intercept.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
1*2e2212a7SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*2e2212a7SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*2e2212a7SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*2e2212a7SAndrew Rist  * distributed with this work for additional information
6*2e2212a7SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*2e2212a7SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*2e2212a7SAndrew Rist  * "License"); you may not use this file except in compliance
9*2e2212a7SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*2e2212a7SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*2e2212a7SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*2e2212a7SAndrew Rist  * software distributed under the License is distributed on an
15*2e2212a7SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*2e2212a7SAndrew Rist  * KIND, either express or implied.  See the License for the
17*2e2212a7SAndrew Rist  * specific language governing permissions and limitations
18*2e2212a7SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*2e2212a7SAndrew Rist  *************************************************************/
21*2e2212a7SAndrew Rist 
22*2e2212a7SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef DBA_INTERCEPT_HXX
25cdf0e10cSrcweir #define DBA_INTERCEPT_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #ifndef _OSL_MUTEX_HXX_
28cdf0e10cSrcweir #include <osl/mutex.hxx>
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir #ifndef _CPPUHELPER_IMPLBASE4_HXX_
31cdf0e10cSrcweir #include <cppuhelper/implbase4.hxx>
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir #ifndef _CPPUHELPER_INTERFACECONTAINER_HXX_
34cdf0e10cSrcweir #include <cppuhelper/interfacecontainer.hxx>
35cdf0e10cSrcweir #endif
36cdf0e10cSrcweir #ifndef  _COM_SUN_STAR_FRAME_XDISPATCHPROVIDERINTERCEPTOR_HPP_
37cdf0e10cSrcweir #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
38cdf0e10cSrcweir #endif
39cdf0e10cSrcweir #ifndef _COM_SUN_STAR_FRAME_XINTERCEPTORINFO_HPP_
40cdf0e10cSrcweir #include <com/sun/star/frame/XInterceptorInfo.hpp>
41cdf0e10cSrcweir #endif
42cdf0e10cSrcweir #ifndef _COM_SUN_STAR_DOCUMENT_XEVENTLISTENER_HPP_
43cdf0e10cSrcweir #include <com/sun/star/document/XEventListener.hpp>
44cdf0e10cSrcweir #endif
45cdf0e10cSrcweir #ifndef _COM_SUN_STAR_FRAME_XDISPATCH_HPP_
46cdf0e10cSrcweir #include <com/sun/star/frame/XDispatch.hpp>
47cdf0e10cSrcweir #endif
48cdf0e10cSrcweir #ifndef _DBA_COREDATAACCESS_DOCUMENTDEFINITION_HXX_
49cdf0e10cSrcweir #include "documentdefinition.hxx"
50cdf0e10cSrcweir #endif
51cdf0e10cSrcweir #include <vcl/svapp.hxx>
52cdf0e10cSrcweir 
53cdf0e10cSrcweir namespace dbaccess
54cdf0e10cSrcweir {
55cdf0e10cSrcweir 
56cdf0e10cSrcweir 
57cdf0e10cSrcweir class OInterceptor : public ::cppu::WeakImplHelper4< ::com::sun::star::frame::XDispatchProviderInterceptor,
58cdf0e10cSrcweir                                                     ::com::sun::star::frame::XInterceptorInfo,
59cdf0e10cSrcweir                                                     ::com::sun::star::frame::XDispatch,
60cdf0e10cSrcweir                                                     ::com::sun::star::document::XEventListener>
61cdf0e10cSrcweir {
62cdf0e10cSrcweir     DECL_LINK( OnDispatch, void* _aURL  );
63cdf0e10cSrcweir protected:
64cdf0e10cSrcweir     virtual ~OInterceptor();
65cdf0e10cSrcweir public:
66cdf0e10cSrcweir 
67cdf0e10cSrcweir     OInterceptor( ODocumentDefinition* _pContentHolder,sal_Bool _bAllowEditDoc );
68cdf0e10cSrcweir 
69cdf0e10cSrcweir     void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
70cdf0e10cSrcweir 
71cdf0e10cSrcweir     //XDispatch
72cdf0e10cSrcweir     virtual void SAL_CALL
73cdf0e10cSrcweir     dispatch(
74cdf0e10cSrcweir         const ::com::sun::star::util::URL& URL,
75cdf0e10cSrcweir         const ::com::sun::star::uno::Sequence<
76cdf0e10cSrcweir         ::com::sun::star::beans::PropertyValue >& Arguments )
77cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
78cdf0e10cSrcweir 
79cdf0e10cSrcweir     virtual void SAL_CALL
80cdf0e10cSrcweir     addStatusListener(
81cdf0e10cSrcweir         const ::com::sun::star::uno::Reference<
82cdf0e10cSrcweir         ::com::sun::star::frame::XStatusListener >& Control,
83cdf0e10cSrcweir         const ::com::sun::star::util::URL& URL )
84cdf0e10cSrcweir         throw (
85cdf0e10cSrcweir             ::com::sun::star::uno::RuntimeException
86cdf0e10cSrcweir         );
87cdf0e10cSrcweir 
88cdf0e10cSrcweir     virtual void SAL_CALL
89cdf0e10cSrcweir     removeStatusListener(
90cdf0e10cSrcweir         const ::com::sun::star::uno::Reference<
91cdf0e10cSrcweir         ::com::sun::star::frame::XStatusListener >& Control,
92cdf0e10cSrcweir         const ::com::sun::star::util::URL& URL )
93cdf0e10cSrcweir         throw (
94cdf0e10cSrcweir             ::com::sun::star::uno::RuntimeException
95cdf0e10cSrcweir         );
96cdf0e10cSrcweir 
97cdf0e10cSrcweir     //XInterceptorInfo
98cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
99cdf0e10cSrcweir     SAL_CALL getInterceptedURLs(  )
100cdf0e10cSrcweir         throw (
101cdf0e10cSrcweir             ::com::sun::star::uno::RuntimeException
102cdf0e10cSrcweir         );
103cdf0e10cSrcweir 
104cdf0e10cSrcweir     //XDispatchProvider ( inherited by XDispatchProviderInterceptor )
105cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference<
106cdf0e10cSrcweir     ::com::sun::star::frame::XDispatch > SAL_CALL
107cdf0e10cSrcweir     queryDispatch(
108cdf0e10cSrcweir         const ::com::sun::star::util::URL& URL,
109cdf0e10cSrcweir         const ::rtl::OUString& TargetFrameName,
110cdf0e10cSrcweir         sal_Int32 SearchFlags )
111cdf0e10cSrcweir         throw (
112cdf0e10cSrcweir             ::com::sun::star::uno::RuntimeException
113cdf0e10cSrcweir         );
114cdf0e10cSrcweir 
115cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence<
116cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
117cdf0e10cSrcweir     ::com::sun::star::frame::XDispatch > > SAL_CALL
118cdf0e10cSrcweir     queryDispatches(
119cdf0e10cSrcweir         const ::com::sun::star::uno::Sequence<
120cdf0e10cSrcweir         ::com::sun::star::frame::DispatchDescriptor >& Requests )
121cdf0e10cSrcweir         throw (
122cdf0e10cSrcweir             ::com::sun::star::uno::RuntimeException
123cdf0e10cSrcweir         );
124cdf0e10cSrcweir 
125cdf0e10cSrcweir 
126cdf0e10cSrcweir     //XDispatchProviderInterceptor
127cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference<
128cdf0e10cSrcweir     ::com::sun::star::frame::XDispatchProvider > SAL_CALL
129cdf0e10cSrcweir     getSlaveDispatchProvider(  )
130cdf0e10cSrcweir         throw (
131cdf0e10cSrcweir             ::com::sun::star::uno::RuntimeException
132cdf0e10cSrcweir         );
133cdf0e10cSrcweir 
134cdf0e10cSrcweir     virtual void SAL_CALL
135cdf0e10cSrcweir     setSlaveDispatchProvider(
136cdf0e10cSrcweir         const ::com::sun::star::uno::Reference<
137cdf0e10cSrcweir         ::com::sun::star::frame::XDispatchProvider >& NewDispatchProvider )
138cdf0e10cSrcweir         throw (
139cdf0e10cSrcweir             ::com::sun::star::uno::RuntimeException
140cdf0e10cSrcweir         );
141cdf0e10cSrcweir 
142cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference<
143cdf0e10cSrcweir     ::com::sun::star::frame::XDispatchProvider > SAL_CALL
144cdf0e10cSrcweir     getMasterDispatchProvider(  )
145cdf0e10cSrcweir         throw (
146cdf0e10cSrcweir             ::com::sun::star::uno::RuntimeException
147cdf0e10cSrcweir         );
148cdf0e10cSrcweir 
149cdf0e10cSrcweir     virtual void SAL_CALL
150cdf0e10cSrcweir     setMasterDispatchProvider(
151cdf0e10cSrcweir         const ::com::sun::star::uno::Reference<
152cdf0e10cSrcweir         ::com::sun::star::frame::XDispatchProvider >& NewSupplier )
153cdf0e10cSrcweir         throw (
154cdf0e10cSrcweir             ::com::sun::star::uno::RuntimeException
155cdf0e10cSrcweir         );
156cdf0e10cSrcweir 
157cdf0e10cSrcweir     // XEventListener
158cdf0e10cSrcweir     virtual void SAL_CALL notifyEvent( const ::com::sun::star::document::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException);
159cdf0e10cSrcweir     virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
160cdf0e10cSrcweir 
161cdf0e10cSrcweir 
162cdf0e10cSrcweir private:
163cdf0e10cSrcweir 
164cdf0e10cSrcweir     osl::Mutex   m_aMutex;
165cdf0e10cSrcweir 
166cdf0e10cSrcweir     ODocumentDefinition*   m_pContentHolder;
167cdf0e10cSrcweir 
168cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > m_xSlaveDispatchProvider;
169cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > m_xMasterDispatchProvider;
170cdf0e10cSrcweir 
171cdf0e10cSrcweir     ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aInterceptedURL;
172cdf0e10cSrcweir 
173cdf0e10cSrcweir     cppu::OInterfaceContainerHelper*    m_pDisposeEventListeners;
174cdf0e10cSrcweir     PropertyChangeListenerContainer*    m_pStatCL;
175cdf0e10cSrcweir     sal_Bool                            m_bAllowEditDoc;
176cdf0e10cSrcweir };
177cdf0e10cSrcweir 
178cdf0e10cSrcweir 
179cdf0e10cSrcweir //........................................................................
180cdf0e10cSrcweir }   // namespace dbaccess
181cdf0e10cSrcweir //........................................................................
182cdf0e10cSrcweir 
183cdf0e10cSrcweir 
184cdf0e10cSrcweir #endif //DBA_INTERCEPT_HXX
185