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: dispuno.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 SC_DISPUNO_HXX
32 #define SC_DISPUNO_HXX
34 #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
35 #include <com/sun/star/view/XSelectionChangeListener.hpp>
36 #include <cppuhelper/implbase2.hxx>
37 #include <svtools/lstner.hxx>
38 #include <svtools/svarray.hxx>
39 #include "global.hxx" // ScImportParam
42 namespace com
{ namespace sun
{ namespace star
{ namespace frame
{
43 class XDispatchProviderInterception
;
49 typedef ::com::sun::star::uno::Reference
<
50 ::com::sun::star::frame::XStatusListener
>* XStatusListenerPtr
;
51 SV_DECL_PTRARR_DEL( XStatusListenerArr_Impl
, XStatusListenerPtr
, 4, 4 )
54 class ScDispatchProviderInterceptor
: public cppu::WeakImplHelper2
<
55 com::sun::star::frame::XDispatchProviderInterceptor
,
56 com::sun::star::lang::XEventListener
>,
59 ScTabViewShell
* pViewShell
;
61 // the component which's dispatches we're intercepting
62 ::com::sun::star::uno::Reference
<
63 ::com::sun::star::frame::XDispatchProviderInterception
> m_xIntercepted
;
66 ::com::sun::star::uno::Reference
<
67 ::com::sun::star::frame::XDispatchProvider
> m_xSlaveDispatcher
;
68 ::com::sun::star::uno::Reference
<
69 ::com::sun::star::frame::XDispatchProvider
> m_xMasterDispatcher
;
72 ::com::sun::star::uno::Reference
<
73 ::com::sun::star::frame::XDispatch
> m_xMyDispatch
;
77 ScDispatchProviderInterceptor(ScTabViewShell
* pViewSh
);
78 virtual ~ScDispatchProviderInterceptor();
80 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
83 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatch
> SAL_CALL
84 queryDispatch( const ::com::sun::star::util::URL
& aURL
,
85 const ::rtl::OUString
& aTargetFrameName
,
86 sal_Int32 nSearchFlags
)
87 throw(::com::sun::star::uno::RuntimeException
);
88 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
<
89 ::com::sun::star::frame::XDispatch
> > SAL_CALL
90 queryDispatches( const ::com::sun::star::uno::Sequence
<
91 ::com::sun::star::frame::DispatchDescriptor
>& aDescripts
)
92 throw(::com::sun::star::uno::RuntimeException
);
94 // XDispatchProviderInterceptor
95 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProvider
> SAL_CALL
96 getSlaveDispatchProvider() throw(::com::sun::star::uno::RuntimeException
);
97 virtual void SAL_CALL
setSlaveDispatchProvider( const ::com::sun::star::uno::Reference
<
98 ::com::sun::star::frame::XDispatchProvider
>& xNewDispatchProvider
)
99 throw(::com::sun::star::uno::RuntimeException
);
100 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProvider
> SAL_CALL
101 getMasterDispatchProvider() throw(::com::sun::star::uno::RuntimeException
);
102 virtual void SAL_CALL
setMasterDispatchProvider( const ::com::sun::star::uno::Reference
<
103 ::com::sun::star::frame::XDispatchProvider
>& xNewSupplier
)
104 throw(::com::sun::star::uno::RuntimeException
);
107 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& Source
)
108 throw(::com::sun::star::uno::RuntimeException
);
112 class ScDispatch
: public cppu::WeakImplHelper2
<
113 com::sun::star::frame::XDispatch
,
114 com::sun::star::view::XSelectionChangeListener
>,
117 ScTabViewShell
* pViewShell
;
118 XStatusListenerArr_Impl aDataSourceListeners
;
119 ScImportParam aLastImport
;
120 sal_Bool bListeningToView
;
124 ScDispatch(ScTabViewShell
* pViewSh
);
125 virtual ~ScDispatch();
127 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
130 virtual void SAL_CALL
dispatch( const ::com::sun::star::util::URL
& aURL
,
131 const ::com::sun::star::uno::Sequence
<
132 ::com::sun::star::beans::PropertyValue
>& aArgs
)
133 throw(::com::sun::star::uno::RuntimeException
);
134 virtual void SAL_CALL
addStatusListener( const ::com::sun::star::uno::Reference
<
135 ::com::sun::star::frame::XStatusListener
>& xControl
,
136 const ::com::sun::star::util::URL
& aURL
)
137 throw(::com::sun::star::uno::RuntimeException
);
138 virtual void SAL_CALL
removeStatusListener( const ::com::sun::star::uno::Reference
<
139 ::com::sun::star::frame::XStatusListener
>& xControl
,
140 const ::com::sun::star::util::URL
& aURL
)
141 throw(::com::sun::star::uno::RuntimeException
);
143 // XSelectionChangeListener
144 virtual void SAL_CALL
selectionChanged( const ::com::sun::star::lang::EventObject
& aEvent
)
145 throw (::com::sun::star::uno::RuntimeException
);
148 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& Source
)
149 throw (::com::sun::star::uno::RuntimeException
);