2010-10-27 06:43:08 -05:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2000-11-13 12:22:32 -06:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 12:25:29 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-11-13 12:22:32 -06:00
|
|
|
*
|
2010-02-12 08:01:35 -06:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-11-13 12:22:32 -06:00
|
|
|
*
|
2008-04-10 12:25:29 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-11-13 12:22:32 -06:00
|
|
|
*
|
2008-04-10 12:25:29 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-11-13 12:22:32 -06:00
|
|
|
*
|
2008-04-10 12:25:29 -05:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-11-13 12:22:32 -06:00
|
|
|
*
|
2008-04-10 12:25:29 -05:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-11-13 12:22:32 -06:00
|
|
|
*
|
2008-04-10 12:25:29 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-11-13 12:22:32 -06:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifndef SC_DISPUNO_HXX
|
|
|
|
#define SC_DISPUNO_HXX
|
|
|
|
|
|
|
|
#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
|
2001-07-18 04:18:09 -05:00
|
|
|
#include <com/sun/star/view/XSelectionChangeListener.hpp>
|
2000-11-13 12:22:32 -06:00
|
|
|
#include <cppuhelper/implbase2.hxx>
|
2009-10-15 17:05:16 -05:00
|
|
|
#include <svl/lstner.hxx>
|
|
|
|
#include <svl/svarray.hxx>
|
2001-07-18 04:18:09 -05:00
|
|
|
#include "global.hxx" // ScImportParam
|
|
|
|
|
|
|
|
|
2000-11-13 12:22:32 -06:00
|
|
|
namespace com { namespace sun { namespace star { namespace frame {
|
|
|
|
class XDispatchProviderInterception;
|
|
|
|
} } } }
|
|
|
|
|
|
|
|
class ScTabViewShell;
|
|
|
|
|
|
|
|
|
2001-07-18 04:18:09 -05:00
|
|
|
typedef ::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::frame::XStatusListener >* XStatusListenerPtr;
|
2007-02-27 04:56:50 -06:00
|
|
|
SV_DECL_PTRARR_DEL( XStatusListenerArr_Impl, XStatusListenerPtr, 4, 4 )
|
2001-07-18 04:18:09 -05:00
|
|
|
|
|
|
|
|
2000-11-13 12:22:32 -06:00
|
|
|
class ScDispatchProviderInterceptor : public cppu::WeakImplHelper2<
|
|
|
|
com::sun::star::frame::XDispatchProviderInterceptor,
|
2002-08-16 03:27:33 -05:00
|
|
|
com::sun::star::lang::XEventListener>,
|
|
|
|
public SfxListener
|
2000-11-13 12:22:32 -06:00
|
|
|
{
|
|
|
|
ScTabViewShell* pViewShell;
|
|
|
|
|
|
|
|
// the component which's dispatches we're intercepting
|
|
|
|
::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::frame::XDispatchProviderInterception> m_xIntercepted;
|
|
|
|
|
|
|
|
// chaining
|
|
|
|
::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::frame::XDispatchProvider> m_xSlaveDispatcher;
|
|
|
|
::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::frame::XDispatchProvider> m_xMasterDispatcher;
|
|
|
|
|
|
|
|
// own dispatch
|
|
|
|
::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::frame::XDispatch> m_xMyDispatch;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
ScDispatchProviderInterceptor(ScTabViewShell* pViewSh);
|
|
|
|
virtual ~ScDispatchProviderInterceptor();
|
|
|
|
|
2002-08-16 03:27:33 -05:00
|
|
|
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
|
|
|
|
|
2000-11-13 12:22:32 -06:00
|
|
|
// XDispatchProvider
|
|
|
|
virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SAL_CALL
|
|
|
|
queryDispatch( const ::com::sun::star::util::URL& aURL,
|
|
|
|
const ::rtl::OUString& aTargetFrameName,
|
|
|
|
sal_Int32 nSearchFlags )
|
|
|
|
throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::frame::XDispatch > > SAL_CALL
|
|
|
|
queryDispatches( const ::com::sun::star::uno::Sequence<
|
|
|
|
::com::sun::star::frame::DispatchDescriptor >& aDescripts )
|
|
|
|
throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
// XDispatchProviderInterceptor
|
|
|
|
virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > SAL_CALL
|
|
|
|
getSlaveDispatchProvider() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setSlaveDispatchProvider( const ::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::frame::XDispatchProvider >& xNewDispatchProvider )
|
|
|
|
throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > SAL_CALL
|
|
|
|
getMasterDispatchProvider() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setMasterDispatchProvider( const ::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::frame::XDispatchProvider >& xNewSupplier )
|
|
|
|
throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
// XEventListener
|
|
|
|
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source )
|
|
|
|
throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-07-18 04:18:09 -05:00
|
|
|
class ScDispatch : public cppu::WeakImplHelper2<
|
|
|
|
com::sun::star::frame::XDispatch,
|
2002-08-16 03:27:33 -05:00
|
|
|
com::sun::star::view::XSelectionChangeListener >,
|
|
|
|
public SfxListener
|
2000-11-13 12:22:32 -06:00
|
|
|
{
|
2001-07-18 04:18:09 -05:00
|
|
|
ScTabViewShell* pViewShell;
|
|
|
|
XStatusListenerArr_Impl aDataSourceListeners;
|
|
|
|
ScImportParam aLastImport;
|
|
|
|
sal_Bool bListeningToView;
|
2000-11-13 12:22:32 -06:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
ScDispatch(ScTabViewShell* pViewSh);
|
|
|
|
virtual ~ScDispatch();
|
|
|
|
|
2002-08-16 03:27:33 -05:00
|
|
|
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
|
|
|
|
|
2000-11-13 12:22:32 -06:00
|
|
|
// XDispatch
|
|
|
|
virtual void SAL_CALL dispatch( const ::com::sun::star::util::URL& aURL,
|
|
|
|
const ::com::sun::star::uno::Sequence<
|
|
|
|
::com::sun::star::beans::PropertyValue >& aArgs )
|
|
|
|
throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL addStatusListener( const ::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::frame::XStatusListener >& xControl,
|
|
|
|
const ::com::sun::star::util::URL& aURL )
|
|
|
|
throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL removeStatusListener( const ::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::frame::XStatusListener >& xControl,
|
|
|
|
const ::com::sun::star::util::URL& aURL )
|
|
|
|
throw(::com::sun::star::uno::RuntimeException);
|
2001-07-18 04:18:09 -05:00
|
|
|
|
|
|
|
// XSelectionChangeListener
|
|
|
|
virtual void SAL_CALL selectionChanged( const ::com::sun::star::lang::EventObject& aEvent )
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
// XEventListener
|
|
|
|
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source )
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
2000-11-13 12:22:32 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2010-10-27 06:43:08 -05:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|