1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef SC_DISPUNO_HXX
29 #define SC_DISPUNO_HXX
31 #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
32 #include <com/sun/star/view/XSelectionChangeListener.hpp>
33 #include <cppuhelper/implbase2.hxx>
34 #include <svl/lstner.hxx>
35 #include <svl/svarray.hxx>
36 #include "global.hxx" // ScImportParam
39 namespace com
{ namespace sun
{ namespace star
{ namespace frame
{
40 class XDispatchProviderInterception
;
46 typedef ::com::sun::star::uno::Reference
<
47 ::com::sun::star::frame::XStatusListener
>* XStatusListenerPtr
;
48 SV_DECL_PTRARR_DEL( XStatusListenerArr_Impl
, XStatusListenerPtr
, 4, 4 )
51 class ScDispatchProviderInterceptor
: public cppu::WeakImplHelper2
<
52 com::sun::star::frame::XDispatchProviderInterceptor
,
53 com::sun::star::lang::XEventListener
>,
56 ScTabViewShell
* pViewShell
;
58 // the component which's dispatches we're intercepting
59 ::com::sun::star::uno::Reference
<
60 ::com::sun::star::frame::XDispatchProviderInterception
> m_xIntercepted
;
63 ::com::sun::star::uno::Reference
<
64 ::com::sun::star::frame::XDispatchProvider
> m_xSlaveDispatcher
;
65 ::com::sun::star::uno::Reference
<
66 ::com::sun::star::frame::XDispatchProvider
> m_xMasterDispatcher
;
69 ::com::sun::star::uno::Reference
<
70 ::com::sun::star::frame::XDispatch
> m_xMyDispatch
;
74 ScDispatchProviderInterceptor(ScTabViewShell
* pViewSh
);
75 virtual ~ScDispatchProviderInterceptor();
77 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
80 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatch
> SAL_CALL
81 queryDispatch( const ::com::sun::star::util::URL
& aURL
,
82 const ::rtl::OUString
& aTargetFrameName
,
83 sal_Int32 nSearchFlags
)
84 throw(::com::sun::star::uno::RuntimeException
);
85 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
<
86 ::com::sun::star::frame::XDispatch
> > SAL_CALL
87 queryDispatches( const ::com::sun::star::uno::Sequence
<
88 ::com::sun::star::frame::DispatchDescriptor
>& aDescripts
)
89 throw(::com::sun::star::uno::RuntimeException
);
91 // XDispatchProviderInterceptor
92 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProvider
> SAL_CALL
93 getSlaveDispatchProvider() throw(::com::sun::star::uno::RuntimeException
);
94 virtual void SAL_CALL
setSlaveDispatchProvider( const ::com::sun::star::uno::Reference
<
95 ::com::sun::star::frame::XDispatchProvider
>& xNewDispatchProvider
)
96 throw(::com::sun::star::uno::RuntimeException
);
97 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProvider
> SAL_CALL
98 getMasterDispatchProvider() throw(::com::sun::star::uno::RuntimeException
);
99 virtual void SAL_CALL
setMasterDispatchProvider( const ::com::sun::star::uno::Reference
<
100 ::com::sun::star::frame::XDispatchProvider
>& xNewSupplier
)
101 throw(::com::sun::star::uno::RuntimeException
);
104 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& Source
)
105 throw(::com::sun::star::uno::RuntimeException
);
109 class ScDispatch
: public cppu::WeakImplHelper2
<
110 com::sun::star::frame::XDispatch
,
111 com::sun::star::view::XSelectionChangeListener
>,
114 ScTabViewShell
* pViewShell
;
115 XStatusListenerArr_Impl aDataSourceListeners
;
116 ScImportParam aLastImport
;
117 sal_Bool bListeningToView
;
121 ScDispatch(ScTabViewShell
* pViewSh
);
122 virtual ~ScDispatch();
124 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
127 virtual void SAL_CALL
dispatch( const ::com::sun::star::util::URL
& aURL
,
128 const ::com::sun::star::uno::Sequence
<
129 ::com::sun::star::beans::PropertyValue
>& aArgs
)
130 throw(::com::sun::star::uno::RuntimeException
);
131 virtual void SAL_CALL
addStatusListener( const ::com::sun::star::uno::Reference
<
132 ::com::sun::star::frame::XStatusListener
>& xControl
,
133 const ::com::sun::star::util::URL
& aURL
)
134 throw(::com::sun::star::uno::RuntimeException
);
135 virtual void SAL_CALL
removeStatusListener( const ::com::sun::star::uno::Reference
<
136 ::com::sun::star::frame::XStatusListener
>& xControl
,
137 const ::com::sun::star::util::URL
& aURL
)
138 throw(::com::sun::star::uno::RuntimeException
);
140 // XSelectionChangeListener
141 virtual void SAL_CALL
selectionChanged( const ::com::sun::star::lang::EventObject
& aEvent
)
142 throw (::com::sun::star::uno::RuntimeException
);
145 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& Source
)
146 throw (::com::sun::star::uno::RuntimeException
);