1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dndevdis.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _DNDEVDIS_HXX_
32 #define _DNDEVDIS_HXX_
34 #include <com/sun/star/datatransfer/dnd/XDropTargetListener.hpp>
35 #include <com/sun/star/datatransfer/dnd/XDropTargetDragContext.hpp>
37 #ifndef _COM_SUN_STAR_DATATRANSFER_DND_XDRAGESTURERECOGNIZER_HPP_
38 #include <com/sun/star/datatransfer/dnd/XDragGestureRecognizer.hpp>
40 #include <cppuhelper/implbase3.hxx>
41 #include <vcl/window.hxx>
43 class DNDEventDispatcher
: public ::cppu::WeakImplHelper3
<
44 ::com::sun::star::datatransfer::dnd::XDropTargetListener
,
45 ::com::sun::star::datatransfer::dnd::XDropTargetDragContext
,
46 ::com::sun::star::datatransfer::dnd::XDragGestureListener
>
48 Window
* m_pTopWindow
;
49 Window
* m_pCurrentWindow
;
51 ::osl::Mutex m_aMutex
;
52 ::com::sun::star::uno::Sequence
< ::com::sun::star::datatransfer::DataFlavor
> m_aDataFlavorList
;
55 * fire the events on the dnd listener container of the specified window
58 sal_Int32
fireDragEnterEvent( Window
*pWindow
, const ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext
>& xContext
,
59 const sal_Int8 nDropAction
, const Point
& rLocation
, const sal_Int8 nSourceAction
,
60 const ::com::sun::star::uno::Sequence
< ::com::sun::star::datatransfer::DataFlavor
>& aFlavorList
) throw(::com::sun::star::uno::RuntimeException
);
62 sal_Int32
fireDragOverEvent( Window
*pWindow
, const ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext
>& xContext
,
63 const sal_Int8 nDropAction
, const Point
& rLocation
, const sal_Int8 nSourceAction
) throw(::com::sun::star::uno::RuntimeException
);
65 sal_Int32
fireDragExitEvent( Window
*pWindow
) throw(::com::sun::star::uno::RuntimeException
);
67 sal_Int32
fireDropActionChangedEvent( Window
*pWindow
, const ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext
>& xContext
,
68 const sal_Int8 nDropAction
, const Point
& rLocation
, const sal_Int8 nSourceAction
) throw(::com::sun::star::uno::RuntimeException
);
70 sal_Int32
fireDropEvent( Window
*pWindow
, const ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::dnd::XDropTargetDropContext
>& xContext
,
71 const sal_Int8 nDropAction
, const Point
& rLocation
, const sal_Int8 nSourceAction
,
72 const ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::XTransferable
>& xTransferable
) throw(::com::sun::star::uno::RuntimeException
);
74 sal_Int32
fireDragGestureEvent( Window
*pWindow
, const ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::dnd::XDragSource
>& xSource
,
75 const ::com::sun::star::uno::Any event
, const Point
& rOrigin
, const sal_Int8 nDragAction
)throw(::com::sun::star::uno::RuntimeException
);
79 DNDEventDispatcher( Window
* pTopWindow
);
80 virtual ~DNDEventDispatcher();
83 * XDropTargetDragContext
86 virtual void SAL_CALL
acceptDrag( sal_Int8 dropAction
) throw(::com::sun::star::uno::RuntimeException
);
87 virtual void SAL_CALL
rejectDrag() throw(::com::sun::star::uno::RuntimeException
);
93 virtual void SAL_CALL
drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent
& dtde
) throw(::com::sun::star::uno::RuntimeException
);
94 virtual void SAL_CALL
dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent
& dtdee
) throw(::com::sun::star::uno::RuntimeException
);
95 virtual void SAL_CALL
dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent
& dte
) throw(::com::sun::star::uno::RuntimeException
);
96 virtual void SAL_CALL
dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent
& dtde
) throw(::com::sun::star::uno::RuntimeException
);
97 virtual void SAL_CALL
dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent
& dtde
) throw(::com::sun::star::uno::RuntimeException
);
100 * XDragGestureListener
103 virtual void SAL_CALL
dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent
& dge
) throw(::com::sun::star::uno::RuntimeException
);
110 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& eo
) throw(::com::sun::star::uno::RuntimeException
);
113 //==================================================================================================
115 //==================================================================================================