Version 3.6.0.2, tag libreoffice-3.6.0.2
[LibreOffice.git] / embeddedobj / source / inc / intercept.hxx
blob22420b44d7c22b88df0a5fc2959294c32f07effe
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef _INTERCEPT_HXX_
30 #define _INTERCEPT_HXX_
32 #include <osl/mutex.hxx>
33 #include <cppuhelper/implbase3.hxx>
34 #include <cppuhelper/interfacecontainer.hxx>
35 #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
36 #include <com/sun/star/frame/XInterceptorInfo.hpp>
37 #include <com/sun/star/frame/XDispatch.hpp>
40 class StatusChangeListenerContainer;
41 class DocumentHolder;
43 class Interceptor : public ::cppu::WeakImplHelper3< ::com::sun::star::frame::XDispatchProviderInterceptor,
44 ::com::sun::star::frame::XInterceptorInfo,
45 ::com::sun::star::frame::XDispatch>
47 public:
49 Interceptor( DocumentHolder* pDocHolder );
50 ~Interceptor();
52 void DisconnectDocHolder();
53 // overwritten to release the statuslistner.
55 // XComponent
56 virtual void SAL_CALL
57 addEventListener(
58 const com::sun::star::uno::Reference< com::sun::star::lang::XEventListener >& xListener )
59 throw( com::sun::star::uno::RuntimeException );
61 virtual void SAL_CALL
62 removeEventListener( const com::sun::star::uno::Reference< com::sun::star::lang::XEventListener >& aListener )
63 throw( com::sun::star::uno::RuntimeException );
65 //XDispatch
66 virtual void SAL_CALL
67 dispatch(
68 const ::com::sun::star::util::URL& URL,
69 const ::com::sun::star::uno::Sequence<
70 ::com::sun::star::beans::PropertyValue >& Arguments )
71 throw (::com::sun::star::uno::RuntimeException);
73 virtual void SAL_CALL
74 addStatusListener(
75 const ::com::sun::star::uno::Reference<
76 ::com::sun::star::frame::XStatusListener >& Control,
77 const ::com::sun::star::util::URL& URL )
78 throw (
79 ::com::sun::star::uno::RuntimeException
82 virtual void SAL_CALL
83 removeStatusListener(
84 const ::com::sun::star::uno::Reference<
85 ::com::sun::star::frame::XStatusListener >& Control,
86 const ::com::sun::star::util::URL& URL )
87 throw (
88 ::com::sun::star::uno::RuntimeException
91 //XInterceptorInfo
92 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
93 SAL_CALL getInterceptedURLs( )
94 throw (
95 ::com::sun::star::uno::RuntimeException
98 //XDispatchProvider ( inherited by XDispatchProviderInterceptor )
99 virtual ::com::sun::star::uno::Reference<
100 ::com::sun::star::frame::XDispatch > SAL_CALL
101 queryDispatch(
102 const ::com::sun::star::util::URL& URL,
103 const ::rtl::OUString& TargetFrameName,
104 sal_Int32 SearchFlags )
105 throw (
106 ::com::sun::star::uno::RuntimeException
109 virtual ::com::sun::star::uno::Sequence<
110 ::com::sun::star::uno::Reference<
111 ::com::sun::star::frame::XDispatch > > SAL_CALL
112 queryDispatches(
113 const ::com::sun::star::uno::Sequence<
114 ::com::sun::star::frame::DispatchDescriptor >& Requests )
115 throw (
116 ::com::sun::star::uno::RuntimeException
120 //XDispatchProviderInterceptor
121 virtual ::com::sun::star::uno::Reference<
122 ::com::sun::star::frame::XDispatchProvider > SAL_CALL
123 getSlaveDispatchProvider( )
124 throw (
125 ::com::sun::star::uno::RuntimeException
128 virtual void SAL_CALL
129 setSlaveDispatchProvider(
130 const ::com::sun::star::uno::Reference<
131 ::com::sun::star::frame::XDispatchProvider >& NewDispatchProvider )
132 throw (
133 ::com::sun::star::uno::RuntimeException
136 virtual ::com::sun::star::uno::Reference<
137 ::com::sun::star::frame::XDispatchProvider > SAL_CALL
138 getMasterDispatchProvider( )
139 throw (
140 ::com::sun::star::uno::RuntimeException
143 virtual void SAL_CALL
144 setMasterDispatchProvider(
145 const ::com::sun::star::uno::Reference<
146 ::com::sun::star::frame::XDispatchProvider >& NewSupplier )
147 throw (
148 ::com::sun::star::uno::RuntimeException
152 private:
154 osl::Mutex m_aMutex;
156 DocumentHolder* m_pDocHolder;
158 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > m_xSlaveDispatchProvider;
159 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > m_xMasterDispatchProvider;
161 static ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aInterceptedURL;
163 cppu::OInterfaceContainerHelper* m_pDisposeEventListeners;
164 StatusChangeListenerContainer* m_pStatCL;
167 #endif
169 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */