1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SC_INC_DISPUNO_HXX
21 #define INCLUDED_SC_INC_DISPUNO_HXX
23 #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
24 #include <com/sun/star/view/XSelectionChangeListener.hpp>
25 #include <cppuhelper/implbase2.hxx>
26 #include <svl/lstner.hxx>
28 #include <boost/ptr_container/ptr_vector.hpp>
31 namespace com
{ namespace sun
{ namespace star
{ namespace frame
{
32 class XDispatchProviderInterception
;
38 typedef ::com::sun::star::uno::Reference
<
39 ::com::sun::star::frame::XStatusListener
> XStatusListenerRef
;
40 typedef boost::ptr_vector
<XStatusListenerRef
> XStatusListenerArr_Impl
;
43 class ScDispatchProviderInterceptor
: public cppu::WeakImplHelper2
<
44 com::sun::star::frame::XDispatchProviderInterceptor
,
45 com::sun::star::lang::XEventListener
>,
48 ScTabViewShell
* pViewShell
;
50 /// the component which's dispatches we're intercepting
51 ::com::sun::star::uno::Reference
<
52 ::com::sun::star::frame::XDispatchProviderInterception
> m_xIntercepted
;
55 ::com::sun::star::uno::Reference
<
56 ::com::sun::star::frame::XDispatchProvider
> m_xSlaveDispatcher
;
57 ::com::sun::star::uno::Reference
<
58 ::com::sun::star::frame::XDispatchProvider
> m_xMasterDispatcher
;
61 ::com::sun::star::uno::Reference
<
62 ::com::sun::star::frame::XDispatch
> m_xMyDispatch
;
66 ScDispatchProviderInterceptor(ScTabViewShell
* pViewSh
);
67 virtual ~ScDispatchProviderInterceptor();
69 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
) SAL_OVERRIDE
;
72 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatch
> SAL_CALL
73 queryDispatch( const ::com::sun::star::util::URL
& aURL
,
74 const OUString
& aTargetFrameName
,
75 sal_Int32 nSearchFlags
)
76 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
77 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
<
78 ::com::sun::star::frame::XDispatch
> > SAL_CALL
79 queryDispatches( const ::com::sun::star::uno::Sequence
<
80 ::com::sun::star::frame::DispatchDescriptor
>& aDescripts
)
81 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
83 /// XDispatchProviderInterceptor
84 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProvider
> SAL_CALL
85 getSlaveDispatchProvider() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
86 virtual void SAL_CALL
setSlaveDispatchProvider( const ::com::sun::star::uno::Reference
<
87 ::com::sun::star::frame::XDispatchProvider
>& xNewDispatchProvider
)
88 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
89 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProvider
> SAL_CALL
90 getMasterDispatchProvider() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
91 virtual void SAL_CALL
setMasterDispatchProvider( const ::com::sun::star::uno::Reference
<
92 ::com::sun::star::frame::XDispatchProvider
>& xNewSupplier
)
93 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
96 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& Source
)
97 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
101 class ScDispatch
: public cppu::WeakImplHelper2
<
102 com::sun::star::frame::XDispatch
,
103 com::sun::star::view::XSelectionChangeListener
>,
106 ScTabViewShell
* pViewShell
;
107 XStatusListenerArr_Impl aDataSourceListeners
;
108 ScImportParam aLastImport
;
109 bool bListeningToView
;
113 ScDispatch(ScTabViewShell
* pViewSh
);
114 virtual ~ScDispatch();
116 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
) SAL_OVERRIDE
;
119 virtual void SAL_CALL
dispatch( const ::com::sun::star::util::URL
& aURL
,
120 const ::com::sun::star::uno::Sequence
<
121 ::com::sun::star::beans::PropertyValue
>& aArgs
)
122 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
123 virtual void SAL_CALL
addStatusListener( const ::com::sun::star::uno::Reference
<
124 ::com::sun::star::frame::XStatusListener
>& xControl
,
125 const ::com::sun::star::util::URL
& aURL
)
126 throw(::com::sun::star::uno::RuntimeException
,
127 std::exception
) SAL_OVERRIDE
;
128 virtual void SAL_CALL
removeStatusListener( const ::com::sun::star::uno::Reference
<
129 ::com::sun::star::frame::XStatusListener
>& xControl
,
130 const ::com::sun::star::util::URL
& aURL
)
131 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
133 /// XSelectionChangeListener
134 virtual void SAL_CALL
selectionChanged( const ::com::sun::star::lang::EventObject
& aEvent
)
135 throw (::com::sun::star::uno::RuntimeException
,
136 std::exception
) SAL_OVERRIDE
;
139 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& Source
)
140 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
146 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */