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 _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
;
45 class Interceptor
: public ::cppu::WeakImplHelper3
< ::com::sun::star::frame::XDispatchProviderInterceptor
,
46 ::com::sun::star::frame::XInterceptorInfo
,
47 ::com::sun::star::frame::XDispatch
>
51 Interceptor( DocumentHolder
* pDocHolder
);
54 void DisconnectDocHolder();
55 // overwritten to release the statuslistner.
60 const com::sun::star::uno::Reference
< com::sun::star::lang::XEventListener
>& xListener
)
61 throw( com::sun::star::uno::RuntimeException
);
64 removeEventListener( const com::sun::star::uno::Reference
< com::sun::star::lang::XEventListener
>& aListener
)
65 throw( com::sun::star::uno::RuntimeException
);
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
);
77 const ::com::sun::star::uno::Reference
<
78 ::com::sun::star::frame::XStatusListener
>& Control
,
79 const ::com::sun::star::util::URL
& URL
)
81 ::com::sun::star::uno::RuntimeException
86 const ::com::sun::star::uno::Reference
<
87 ::com::sun::star::frame::XStatusListener
>& Control
,
88 const ::com::sun::star::util::URL
& URL
)
90 ::com::sun::star::uno::RuntimeException
94 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
>
95 SAL_CALL
getInterceptedURLs( )
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
104 const ::com::sun::star::util::URL
& URL
,
105 const ::rtl::OUString
& TargetFrameName
,
106 sal_Int32 SearchFlags
)
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
115 const ::com::sun::star::uno::Sequence
<
116 ::com::sun::star::frame::DispatchDescriptor
>& Requests
)
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( )
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
)
135 ::com::sun::star::uno::RuntimeException
138 virtual ::com::sun::star::uno::Reference
<
139 ::com::sun::star::frame::XDispatchProvider
> SAL_CALL
140 getMasterDispatchProvider( )
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
)
150 ::com::sun::star::uno::RuntimeException
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
;