xref: /aoo41x/main/vcl/inc/dndevdis.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _DNDEVDIS_HXX_
29 #define _DNDEVDIS_HXX_
30 
31 #include <com/sun/star/datatransfer/dnd/XDropTargetListener.hpp>
32 #include <com/sun/star/datatransfer/dnd/XDropTargetDragContext.hpp>
33 
34 #ifndef _COM_SUN_STAR_DATATRANSFER_DND_XDRAGESTURERECOGNIZER_HPP_
35 #include <com/sun/star/datatransfer/dnd/XDragGestureRecognizer.hpp>
36 #endif
37 #include <cppuhelper/implbase3.hxx>
38 #include <vcl/window.hxx>
39 
40 class DNDEventDispatcher: public ::cppu::WeakImplHelper3<
41 	::com::sun::star::datatransfer::dnd::XDropTargetListener,
42 	::com::sun::star::datatransfer::dnd::XDropTargetDragContext,
43 	::com::sun::star::datatransfer::dnd::XDragGestureListener >
44 {
45 	Window * m_pTopWindow;
46 	Window * m_pCurrentWindow;
47 
48 	::osl::Mutex m_aMutex;
49 	::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > m_aDataFlavorList;
50 
51 	/*
52 	 * fire the events on the dnd listener container of the specified window
53 	 */
54 
55 	sal_Int32 fireDragEnterEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext,
56 		const sal_Int8 nDropAction,	const Point& rLocation, const sal_Int8 nSourceAction,
57 		const ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor >& aFlavorList ) throw(::com::sun::star::uno::RuntimeException);
58 
59 	sal_Int32 fireDragOverEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext,
60 		const sal_Int8 nDropAction,	const Point& rLocation, const sal_Int8 nSourceAction ) throw(::com::sun::star::uno::RuntimeException);
61 
62 	sal_Int32 fireDragExitEvent( Window *pWindow ) throw(::com::sun::star::uno::RuntimeException);
63 
64 	sal_Int32 fireDropActionChangedEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext,
65 		const sal_Int8 nDropAction,	const Point& rLocation, const sal_Int8 nSourceAction ) throw(::com::sun::star::uno::RuntimeException);
66 
67 	sal_Int32 fireDropEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDropContext >& xContext,
68 		const sal_Int8 nDropAction,	const Point& rLocation, const sal_Int8 nSourceAction,
69 		const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTransferable ) throw(::com::sun::star::uno::RuntimeException);
70 
71 	sal_Int32 fireDragGestureEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >& xSource,
72 		const ::com::sun::star::uno::Any event, const Point& rOrigin, const sal_Int8 nDragAction )throw(::com::sun::star::uno::RuntimeException);
73 
74 public:
75 
76 	DNDEventDispatcher( Window * pTopWindow );
77 	virtual ~DNDEventDispatcher();
78 
79 	/*
80 	 * XDropTargetDragContext
81 	 */
82 
83 	virtual void SAL_CALL acceptDrag( sal_Int8 dropAction ) throw(::com::sun::star::uno::RuntimeException);
84 	virtual void SAL_CALL rejectDrag() throw(::com::sun::star::uno::RuntimeException);
85 
86 	/*
87 	 * XDropTargetListener
88 	 */
89 
90 	virtual void SAL_CALL drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& dtde ) throw(::com::sun::star::uno::RuntimeException);
91 	virtual void SAL_CALL dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ) throw(::com::sun::star::uno::RuntimeException);
92 	virtual void SAL_CALL dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& dte ) throw(::com::sun::star::uno::RuntimeException);
93 	virtual void SAL_CALL dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw(::com::sun::star::uno::RuntimeException);
94 	virtual void SAL_CALL dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw(::com::sun::star::uno::RuntimeException);
95 
96 	/*
97 	 * XDragGestureListener
98 	 */
99 
100     virtual void SAL_CALL dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& dge ) throw(::com::sun::star::uno::RuntimeException);
101 
102 
103 	/*
104 	 * XEventListener
105 	 */
106 
107 	virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& eo ) throw(::com::sun::star::uno::RuntimeException);
108 };
109 
110 //==================================================================================================
111 //
112 //==================================================================================================
113 
114 #endif
115