2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2000-11-07 13:42:59 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 19:39:42 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-11-07 13:42:59 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-11-07 13:42:59 +00:00
|
|
|
*
|
2008-04-10 19:39:42 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-11-07 13:42:59 +00:00
|
|
|
*
|
2008-04-10 19:39:42 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-11-07 13:42:59 +00:00
|
|
|
*
|
2008-04-10 19:39:42 +00: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-07 13:42:59 +00:00
|
|
|
*
|
2008-04-10 19:39:42 +00: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-07 13:42:59 +00:00
|
|
|
*
|
2008-04-10 19:39:42 +00: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-07 13:42:59 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
#ifndef _UNODISPATCH_HXX
|
|
|
|
#define _UNODISPATCH_HXX
|
|
|
|
|
|
|
|
#include <com/sun/star/frame/XDispatchProviderInterception.hpp>
|
|
|
|
#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
|
2001-03-07 12:46:48 +00:00
|
|
|
#include <com/sun/star/view/XSelectionChangeListener.hpp>
|
2001-10-01 12:14:56 +00:00
|
|
|
#include <com/sun/star/lang/XUnoTunnel.hpp>
|
2000-11-07 13:42:59 +00:00
|
|
|
#include <com/sun/star/frame/XDispatch.hpp>
|
|
|
|
#include <cppuhelper/implbase2.hxx>
|
2001-10-01 12:14:56 +00:00
|
|
|
#include <cppuhelper/implbase3.hxx>
|
2001-03-07 12:46:48 +00:00
|
|
|
#include <list>
|
2010-10-16 03:22:02 -05:00
|
|
|
#include <osl/mutex.hxx>
|
2000-11-07 13:42:59 +00:00
|
|
|
|
|
|
|
class SwView;
|
2010-10-06 23:52:18 +01:00
|
|
|
|
2001-10-01 12:14:56 +00:00
|
|
|
class SwXDispatchProviderInterceptor : public cppu::WeakImplHelper3
|
2000-11-07 13:42:59 +00:00
|
|
|
<
|
|
|
|
::com::sun::star::frame::XDispatchProviderInterceptor,
|
2001-10-01 12:14:56 +00:00
|
|
|
::com::sun::star::lang::XEventListener,
|
|
|
|
::com::sun::star::lang::XUnoTunnel
|
2000-11-07 13:42:59 +00:00
|
|
|
>
|
|
|
|
{
|
2002-09-09 06:03:11 +00:00
|
|
|
class DispatchMutexLock_Impl
|
|
|
|
{
|
|
|
|
//::osl::MutexGuard aGuard; #102295# solar mutex has to be used currently
|
2010-10-20 06:26:34 -05:00
|
|
|
osl::SolarGuard aGuard;
|
2002-09-09 06:03:11 +00:00
|
|
|
DispatchMutexLock_Impl();
|
|
|
|
public:
|
|
|
|
DispatchMutexLock_Impl(SwXDispatchProviderInterceptor&);
|
|
|
|
~DispatchMutexLock_Impl();
|
|
|
|
};
|
|
|
|
friend class DispatchMutexLock_Impl;
|
|
|
|
|
|
|
|
// ::osl::Mutex m_aMutex;#102295# solar mutex has to be used currently
|
2001-03-13 09:45:48 +00:00
|
|
|
|
2000-11-07 13:42:59 +00:00
|
|
|
// 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;
|
|
|
|
|
2001-03-07 12:46:48 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch> m_xDispatch;
|
2000-11-07 13:42:59 +00:00
|
|
|
|
2001-10-01 12:14:56 +00:00
|
|
|
SwView* m_pView;
|
2000-11-07 13:42:59 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
SwXDispatchProviderInterceptor(SwView& rView);
|
|
|
|
~SwXDispatchProviderInterceptor();
|
|
|
|
|
|
|
|
//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-10-01 12:14:56 +00:00
|
|
|
|
|
|
|
//XUnoTunnel
|
|
|
|
static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
|
|
|
|
virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
// view destroyed
|
|
|
|
void Invalidate();
|
2000-11-07 13:42:59 +00:00
|
|
|
};
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2001-03-07 12:46:48 +00:00
|
|
|
struct StatusStruct_Impl
|
|
|
|
{
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener> xListener;
|
|
|
|
::com::sun::star::util::URL aURL;
|
|
|
|
};
|
|
|
|
typedef std::list< StatusStruct_Impl > StatusListenerList;
|
|
|
|
class SwXDispatch : public cppu::WeakImplHelper2
|
2000-11-07 13:42:59 +00:00
|
|
|
<
|
2001-03-07 12:46:48 +00:00
|
|
|
::com::sun::star::frame::XDispatch,
|
|
|
|
::com::sun::star::view::XSelectionChangeListener
|
2000-11-07 13:42:59 +00:00
|
|
|
>
|
|
|
|
{
|
2001-03-09 14:00:15 +00:00
|
|
|
SwView* m_pView;
|
2001-03-07 12:46:48 +00:00
|
|
|
StatusListenerList m_aListenerList;
|
|
|
|
sal_Bool m_bOldEnable;
|
|
|
|
sal_Bool m_bListenerAdded;
|
2000-11-07 13:42:59 +00:00
|
|
|
public:
|
2001-03-07 12:46:48 +00:00
|
|
|
SwXDispatch(SwView& rView);
|
2000-11-07 13:42:59 +00:00
|
|
|
~SwXDispatch();
|
|
|
|
|
|
|
|
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-03-07 12:46:48 +00: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);
|
2001-07-12 12:10:27 +00:00
|
|
|
|
|
|
|
static const sal_Char* GetDBChangeURL();
|
2000-11-07 13:42:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
2010-10-14 08:30:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|