2010-10-14 01:27:31 -05:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2001-02-05 02:45:05 -06:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-11 03:08:14 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2001-02-05 02:45:05 -06:00
|
|
|
*
|
2010-02-12 08:01:35 -06:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2001-02-05 02:45:05 -06:00
|
|
|
*
|
2008-04-11 03:08:14 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2001-02-05 02:45:05 -06:00
|
|
|
*
|
2008-04-11 03:08:14 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2001-02-05 02:45:05 -06:00
|
|
|
*
|
2008-04-11 03:08:14 -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.
|
2001-02-05 02:45:05 -06:00
|
|
|
*
|
2008-04-11 03:08:14 -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).
|
2001-02-05 02:45:05 -06:00
|
|
|
*
|
2008-04-11 03:08:14 -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.
|
2001-02-05 02:45:05 -06:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _DNDEVDIS_HXX_
|
|
|
|
#define _DNDEVDIS_HXX_
|
|
|
|
|
|
|
|
#include <com/sun/star/datatransfer/dnd/XDropTargetListener.hpp>
|
2001-02-12 05:26:06 -06:00
|
|
|
#include <com/sun/star/datatransfer/dnd/XDropTargetDragContext.hpp>
|
|
|
|
|
2002-04-30 07:27:16 -05:00
|
|
|
#include <com/sun/star/datatransfer/dnd/XDragGestureRecognizer.hpp>
|
|
|
|
#include <cppuhelper/implbase3.hxx>
|
2007-06-27 14:30:14 -05:00
|
|
|
#include <vcl/window.hxx>
|
2001-02-05 02:45:05 -06:00
|
|
|
|
2002-04-30 07:27:16 -05:00
|
|
|
class DNDEventDispatcher: public ::cppu::WeakImplHelper3<
|
2001-02-12 05:26:06 -06:00
|
|
|
::com::sun::star::datatransfer::dnd::XDropTargetListener,
|
2002-04-30 07:27:16 -05:00
|
|
|
::com::sun::star::datatransfer::dnd::XDropTargetDragContext,
|
|
|
|
::com::sun::star::datatransfer::dnd::XDragGestureListener >
|
2001-02-05 02:45:05 -06:00
|
|
|
{
|
|
|
|
Window * m_pTopWindow;
|
|
|
|
Window * m_pCurrentWindow;
|
|
|
|
|
2001-02-12 05:26:06 -06:00
|
|
|
::osl::Mutex m_aMutex;
|
|
|
|
::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > m_aDataFlavorList;
|
|
|
|
|
2010-10-14 22:12:16 -05:00
|
|
|
Window* findTopLevelWindow(Point location);
|
2001-02-12 05:26:06 -06:00
|
|
|
/*
|
|
|
|
* fire the events on the dnd listener container of the specified window
|
|
|
|
*/
|
|
|
|
|
|
|
|
sal_Int32 fireDragEnterEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext,
|
|
|
|
const sal_Int8 nDropAction, const Point& rLocation, const sal_Int8 nSourceAction,
|
|
|
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor >& aFlavorList ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
sal_Int32 fireDragOverEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext,
|
|
|
|
const sal_Int8 nDropAction, const Point& rLocation, const sal_Int8 nSourceAction ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
sal_Int32 fireDragExitEvent( Window *pWindow ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
sal_Int32 fireDropActionChangedEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext,
|
|
|
|
const sal_Int8 nDropAction, const Point& rLocation, const sal_Int8 nSourceAction ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
sal_Int32 fireDropEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDropContext >& xContext,
|
|
|
|
const sal_Int8 nDropAction, const Point& rLocation, const sal_Int8 nSourceAction,
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTransferable ) throw(::com::sun::star::uno::RuntimeException);
|
2001-02-05 02:45:05 -06:00
|
|
|
|
2002-04-30 07:27:16 -05:00
|
|
|
sal_Int32 fireDragGestureEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >& xSource,
|
|
|
|
const ::com::sun::star::uno::Any event, const Point& rOrigin, const sal_Int8 nDragAction )throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
2001-02-05 02:45:05 -06:00
|
|
|
public:
|
|
|
|
|
|
|
|
DNDEventDispatcher( Window * pTopWindow );
|
|
|
|
virtual ~DNDEventDispatcher();
|
|
|
|
|
2001-02-12 05:26:06 -06:00
|
|
|
/*
|
|
|
|
* XDropTargetDragContext
|
|
|
|
*/
|
|
|
|
|
2001-02-13 06:12:53 -06:00
|
|
|
virtual void SAL_CALL acceptDrag( sal_Int8 dropAction ) throw(::com::sun::star::uno::RuntimeException);
|
2001-02-12 05:26:06 -06:00
|
|
|
virtual void SAL_CALL rejectDrag() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
2001-02-05 02:45:05 -06:00
|
|
|
/*
|
|
|
|
* XDropTargetListener
|
|
|
|
*/
|
|
|
|
|
|
|
|
virtual void SAL_CALL drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& dtde ) throw(::com::sun::star::uno::RuntimeException);
|
2001-02-09 08:59:18 -06:00
|
|
|
virtual void SAL_CALL dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ) throw(::com::sun::star::uno::RuntimeException);
|
2001-02-05 02:45:05 -06:00
|
|
|
virtual void SAL_CALL dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& dte ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
2002-04-30 07:27:16 -05:00
|
|
|
/*
|
|
|
|
* XDragGestureListener
|
|
|
|
*/
|
|
|
|
|
|
|
|
virtual void SAL_CALL dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& dge ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
|
2001-02-05 02:45:05 -06:00
|
|
|
/*
|
|
|
|
* XEventListener
|
|
|
|
*/
|
|
|
|
|
|
|
|
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& eo ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
};
|
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
//
|
|
|
|
//==================================================================================================
|
|
|
|
|
|
|
|
#endif
|
2010-10-14 01:27:31 -05:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|