Update ooo320-m1
[ooovba.git] / embeddedobj / source / inc / intercept.hxx
blob58119deadecc15a8abb1cf6304f6964ffc1041ab
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.5 $
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>
42 class StatusChangeListenerContainer;
43 class DocumentHolder;
45 class Interceptor : public ::cppu::WeakImplHelper3< ::com::sun::star::frame::XDispatchProviderInterceptor,
46 ::com::sun::star::frame::XInterceptorInfo,
47 ::com::sun::star::frame::XDispatch>
49 public:
51 Interceptor( DocumentHolder* pDocHolder );
52 ~Interceptor();
54 void DisconnectDocHolder();
55 // overwritten to release the statuslistner.
57 // XComponent
58 virtual void SAL_CALL
59 addEventListener(
60 const com::sun::star::uno::Reference< com::sun::star::lang::XEventListener >& xListener )
61 throw( com::sun::star::uno::RuntimeException );
63 virtual void SAL_CALL
64 removeEventListener( const com::sun::star::uno::Reference< com::sun::star::lang::XEventListener >& aListener )
65 throw( com::sun::star::uno::RuntimeException );
67 //XDispatch
68 virtual void SAL_CALL
69 dispatch(
70 const ::com::sun::star::util::URL& URL,
71 const ::com::sun::star::uno::Sequence<
72 ::com::sun::star::beans::PropertyValue >& Arguments )
73 throw (::com::sun::star::uno::RuntimeException);
75 virtual void SAL_CALL
76 addStatusListener(
77 const ::com::sun::star::uno::Reference<
78 ::com::sun::star::frame::XStatusListener >& Control,
79 const ::com::sun::star::util::URL& URL )
80 throw (
81 ::com::sun::star::uno::RuntimeException
84 virtual void SAL_CALL
85 removeStatusListener(
86 const ::com::sun::star::uno::Reference<
87 ::com::sun::star::frame::XStatusListener >& Control,
88 const ::com::sun::star::util::URL& URL )
89 throw (
90 ::com::sun::star::uno::RuntimeException
93 //XInterceptorInfo
94 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
95 SAL_CALL getInterceptedURLs( )
96 throw (
97 ::com::sun::star::uno::RuntimeException
100 //XDispatchProvider ( inherited by XDispatchProviderInterceptor )
101 virtual ::com::sun::star::uno::Reference<
102 ::com::sun::star::frame::XDispatch > SAL_CALL
103 queryDispatch(
104 const ::com::sun::star::util::URL& URL,
105 const ::rtl::OUString& TargetFrameName,
106 sal_Int32 SearchFlags )
107 throw (
108 ::com::sun::star::uno::RuntimeException
111 virtual ::com::sun::star::uno::Sequence<
112 ::com::sun::star::uno::Reference<
113 ::com::sun::star::frame::XDispatch > > SAL_CALL
114 queryDispatches(
115 const ::com::sun::star::uno::Sequence<
116 ::com::sun::star::frame::DispatchDescriptor >& Requests )
117 throw (
118 ::com::sun::star::uno::RuntimeException
122 //XDispatchProviderInterceptor
123 virtual ::com::sun::star::uno::Reference<
124 ::com::sun::star::frame::XDispatchProvider > SAL_CALL
125 getSlaveDispatchProvider( )
126 throw (
127 ::com::sun::star::uno::RuntimeException
130 virtual void SAL_CALL
131 setSlaveDispatchProvider(
132 const ::com::sun::star::uno::Reference<
133 ::com::sun::star::frame::XDispatchProvider >& NewDispatchProvider )
134 throw (
135 ::com::sun::star::uno::RuntimeException
138 virtual ::com::sun::star::uno::Reference<
139 ::com::sun::star::frame::XDispatchProvider > SAL_CALL
140 getMasterDispatchProvider( )
141 throw (
142 ::com::sun::star::uno::RuntimeException
145 virtual void SAL_CALL
146 setMasterDispatchProvider(
147 const ::com::sun::star::uno::Reference<
148 ::com::sun::star::frame::XDispatchProvider >& NewSupplier )
149 throw (
150 ::com::sun::star::uno::RuntimeException
154 private:
156 osl::Mutex m_aMutex;
158 DocumentHolder* m_pDocHolder;
160 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > m_xSlaveDispatchProvider;
161 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > m_xMasterDispatchProvider;
163 static ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aInterceptedURL;
165 cppu::OInterfaceContainerHelper* m_pDisposeEventListeners;
166 StatusChangeListenerContainer* m_pStatCL;
169 #endif