update dev300-m58
[ooovba.git] / embedserv / source / inc / intercept.hxx
blob3cecea3ce75b55539963e6011f8bb98fc7eccf3c
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.9 $
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 _INTERCEPT_HXX_
32 #define _INTERCEPT_HXX_
34 #include <osl/mutex.hxx>
35 #include <cppuhelper/implbase3.hxx>
36 #include <cppuhelper/interfacecontainer.hxx>
37 #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
38 #include <com/sun/star/frame/XInterceptorInfo.hpp>
39 #include <com/sun/star/frame/XDispatch.hpp>
41 #include <rtl/ref.hxx>
42 #include "embeddocaccess.hxx"
45 class StatusChangeListenerContainer;
46 class EmbedDocument_Impl;
47 class DocumentHolder;
49 class Interceptor
50 : public ::cppu::WeakImplHelper3<
51 ::com::sun::star::frame::XDispatchProviderInterceptor,
52 ::com::sun::star::frame::XInterceptorInfo,
53 ::com::sun::star::frame::XDispatch>
55 public:
57 Interceptor(
58 const ::rtl::Reference< EmbeddedDocumentInstanceAccess_Impl >& xOleAccess,
59 DocumentHolder* pDocH,
60 sal_Bool bLink );
62 ~Interceptor();
64 void DisconnectDocHolder();
66 void generateFeatureStateEvent();
68 // overwritten to release the statuslistner.
71 // XComponent
72 virtual void SAL_CALL
73 addEventListener(
74 const com::sun::star::uno::Reference< com::sun::star::lang::XEventListener >& xListener )
75 throw( com::sun::star::uno::RuntimeException );
77 virtual void SAL_CALL
78 removeEventListener( const com::sun::star::uno::Reference< com::sun::star::lang::XEventListener >& aListener )
79 throw( com::sun::star::uno::RuntimeException );
81 void SAL_CALL
82 dispose() throw(::com::sun::star::uno::RuntimeException);
86 //XDispatch
87 virtual void SAL_CALL
88 dispatch(
89 const ::com::sun::star::util::URL& URL,
90 const ::com::sun::star::uno::Sequence<
91 ::com::sun::star::beans::PropertyValue >& Arguments )
92 throw (::com::sun::star::uno::RuntimeException);
94 virtual void SAL_CALL
95 addStatusListener(
96 const ::com::sun::star::uno::Reference<
97 ::com::sun::star::frame::XStatusListener >& Control,
98 const ::com::sun::star::util::URL& URL )
99 throw (
100 ::com::sun::star::uno::RuntimeException
103 virtual void SAL_CALL
104 removeStatusListener(
105 const ::com::sun::star::uno::Reference<
106 ::com::sun::star::frame::XStatusListener >& Control,
107 const ::com::sun::star::util::URL& URL )
108 throw (
109 ::com::sun::star::uno::RuntimeException
112 //XInterceptorInfo
113 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
114 SAL_CALL getInterceptedURLs( )
115 throw (
116 ::com::sun::star::uno::RuntimeException
120 //XDispatchProvider ( inherited by XDispatchProviderInterceptor )
121 virtual ::com::sun::star::uno::Reference<
122 ::com::sun::star::frame::XDispatch > SAL_CALL
123 queryDispatch(
124 const ::com::sun::star::util::URL& URL,
125 const ::rtl::OUString& TargetFrameName,
126 sal_Int32 SearchFlags )
127 throw (
128 ::com::sun::star::uno::RuntimeException
131 virtual ::com::sun::star::uno::Sequence<
132 ::com::sun::star::uno::Reference<
133 ::com::sun::star::frame::XDispatch > > SAL_CALL
134 queryDispatches(
135 const ::com::sun::star::uno::Sequence<
136 ::com::sun::star::frame::DispatchDescriptor >& Requests )
137 throw (
138 ::com::sun::star::uno::RuntimeException
142 //XDispatchProviderInterceptor
143 virtual ::com::sun::star::uno::Reference<
144 ::com::sun::star::frame::XDispatchProvider > SAL_CALL
145 getSlaveDispatchProvider( )
146 throw (
147 ::com::sun::star::uno::RuntimeException
150 virtual void SAL_CALL
151 setSlaveDispatchProvider(
152 const ::com::sun::star::uno::Reference<
153 ::com::sun::star::frame::XDispatchProvider >& NewDispatchProvider )
154 throw (
155 ::com::sun::star::uno::RuntimeException
158 virtual ::com::sun::star::uno::Reference<
159 ::com::sun::star::frame::XDispatchProvider > SAL_CALL
160 getMasterDispatchProvider( )
161 throw (
162 ::com::sun::star::uno::RuntimeException
165 virtual void SAL_CALL
166 setMasterDispatchProvider(
167 const ::com::sun::star::uno::Reference<
168 ::com::sun::star::frame::XDispatchProvider >& NewSupplier )
169 throw (
170 ::com::sun::star::uno::RuntimeException
174 private:
176 osl::Mutex m_aMutex;
178 ::rtl::Reference< EmbeddedDocumentInstanceAccess_Impl > m_xOleAccess;
180 ::com::sun::star::uno::WeakReference< ::com::sun::star::uno::XInterface > m_xDocHLocker;
181 DocumentHolder* m_pDocH;
183 ::com::sun::star::uno::Reference<
184 ::com::sun::star::frame::XDispatchProvider > m_xSlaveDispatchProvider;
186 ::com::sun::star::uno::Reference<
187 ::com::sun::star::frame::XDispatchProvider > m_xMasterDispatchProvider;
189 static ::com::sun::star::uno::Sequence< ::rtl::OUString >
190 m_aInterceptedURL;
192 cppu::OInterfaceContainerHelper* m_pDisposeEventListeners;
193 StatusChangeListenerContainer* m_pStatCL;
195 sal_Bool m_bLink;
198 #endif