xref: /aoo4110/main/vcl/inc/dndevdis.hxx (revision b1cdbd2c)
1*b1cdbd2cSJim Jagielski /**************************************************************
2*b1cdbd2cSJim Jagielski  *
3*b1cdbd2cSJim Jagielski  * Licensed to the Apache Software Foundation (ASF) under one
4*b1cdbd2cSJim Jagielski  * or more contributor license agreements.  See the NOTICE file
5*b1cdbd2cSJim Jagielski  * distributed with this work for additional information
6*b1cdbd2cSJim Jagielski  * regarding copyright ownership.  The ASF licenses this file
7*b1cdbd2cSJim Jagielski  * to you under the Apache License, Version 2.0 (the
8*b1cdbd2cSJim Jagielski  * "License"); you may not use this file except in compliance
9*b1cdbd2cSJim Jagielski  * with the License.  You may obtain a copy of the License at
10*b1cdbd2cSJim Jagielski  *
11*b1cdbd2cSJim Jagielski  *   http://www.apache.org/licenses/LICENSE-2.0
12*b1cdbd2cSJim Jagielski  *
13*b1cdbd2cSJim Jagielski  * Unless required by applicable law or agreed to in writing,
14*b1cdbd2cSJim Jagielski  * software distributed under the License is distributed on an
15*b1cdbd2cSJim Jagielski  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b1cdbd2cSJim Jagielski  * KIND, either express or implied.  See the License for the
17*b1cdbd2cSJim Jagielski  * specific language governing permissions and limitations
18*b1cdbd2cSJim Jagielski  * under the License.
19*b1cdbd2cSJim Jagielski  *
20*b1cdbd2cSJim Jagielski  *************************************************************/
21*b1cdbd2cSJim Jagielski 
22*b1cdbd2cSJim Jagielski 
23*b1cdbd2cSJim Jagielski 
24*b1cdbd2cSJim Jagielski #ifndef _DNDEVDIS_HXX_
25*b1cdbd2cSJim Jagielski #define _DNDEVDIS_HXX_
26*b1cdbd2cSJim Jagielski 
27*b1cdbd2cSJim Jagielski #include <com/sun/star/datatransfer/dnd/XDropTargetListener.hpp>
28*b1cdbd2cSJim Jagielski #include <com/sun/star/datatransfer/dnd/XDropTargetDragContext.hpp>
29*b1cdbd2cSJim Jagielski 
30*b1cdbd2cSJim Jagielski #ifndef _COM_SUN_STAR_DATATRANSFER_DND_XDRAGESTURERECOGNIZER_HPP_
31*b1cdbd2cSJim Jagielski #include <com/sun/star/datatransfer/dnd/XDragGestureRecognizer.hpp>
32*b1cdbd2cSJim Jagielski #endif
33*b1cdbd2cSJim Jagielski #include <cppuhelper/implbase3.hxx>
34*b1cdbd2cSJim Jagielski #include <vcl/window.hxx>
35*b1cdbd2cSJim Jagielski 
36*b1cdbd2cSJim Jagielski class DNDEventDispatcher: public ::cppu::WeakImplHelper3<
37*b1cdbd2cSJim Jagielski 	::com::sun::star::datatransfer::dnd::XDropTargetListener,
38*b1cdbd2cSJim Jagielski 	::com::sun::star::datatransfer::dnd::XDropTargetDragContext,
39*b1cdbd2cSJim Jagielski 	::com::sun::star::datatransfer::dnd::XDragGestureListener >
40*b1cdbd2cSJim Jagielski {
41*b1cdbd2cSJim Jagielski 	Window * m_pTopWindow;
42*b1cdbd2cSJim Jagielski 	Window * m_pCurrentWindow;
43*b1cdbd2cSJim Jagielski 
44*b1cdbd2cSJim Jagielski 	::osl::Mutex m_aMutex;
45*b1cdbd2cSJim Jagielski 	::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > m_aDataFlavorList;
46*b1cdbd2cSJim Jagielski 
47*b1cdbd2cSJim Jagielski 	/*
48*b1cdbd2cSJim Jagielski 	 * fire the events on the dnd listener container of the specified window
49*b1cdbd2cSJim Jagielski 	 */
50*b1cdbd2cSJim Jagielski 
51*b1cdbd2cSJim Jagielski 	sal_Int32 fireDragEnterEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext,
52*b1cdbd2cSJim Jagielski 		const sal_Int8 nDropAction,	const Point& rLocation, const sal_Int8 nSourceAction,
53*b1cdbd2cSJim Jagielski 		const ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor >& aFlavorList ) throw(::com::sun::star::uno::RuntimeException);
54*b1cdbd2cSJim Jagielski 
55*b1cdbd2cSJim Jagielski 	sal_Int32 fireDragOverEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext,
56*b1cdbd2cSJim Jagielski 		const sal_Int8 nDropAction,	const Point& rLocation, const sal_Int8 nSourceAction ) throw(::com::sun::star::uno::RuntimeException);
57*b1cdbd2cSJim Jagielski 
58*b1cdbd2cSJim Jagielski 	sal_Int32 fireDragExitEvent( Window *pWindow ) throw(::com::sun::star::uno::RuntimeException);
59*b1cdbd2cSJim Jagielski 
60*b1cdbd2cSJim Jagielski 	sal_Int32 fireDropActionChangedEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext,
61*b1cdbd2cSJim Jagielski 		const sal_Int8 nDropAction,	const Point& rLocation, const sal_Int8 nSourceAction ) throw(::com::sun::star::uno::RuntimeException);
62*b1cdbd2cSJim Jagielski 
63*b1cdbd2cSJim Jagielski 	sal_Int32 fireDropEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDropContext >& xContext,
64*b1cdbd2cSJim Jagielski 		const sal_Int8 nDropAction,	const Point& rLocation, const sal_Int8 nSourceAction,
65*b1cdbd2cSJim Jagielski 		const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTransferable ) throw(::com::sun::star::uno::RuntimeException);
66*b1cdbd2cSJim Jagielski 
67*b1cdbd2cSJim Jagielski 	sal_Int32 fireDragGestureEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >& xSource,
68*b1cdbd2cSJim Jagielski 		const ::com::sun::star::uno::Any event, const Point& rOrigin, const sal_Int8 nDragAction )throw(::com::sun::star::uno::RuntimeException);
69*b1cdbd2cSJim Jagielski 
70*b1cdbd2cSJim Jagielski public:
71*b1cdbd2cSJim Jagielski 
72*b1cdbd2cSJim Jagielski 	DNDEventDispatcher( Window * pTopWindow );
73*b1cdbd2cSJim Jagielski 	virtual ~DNDEventDispatcher();
74*b1cdbd2cSJim Jagielski 
75*b1cdbd2cSJim Jagielski 	/*
76*b1cdbd2cSJim Jagielski 	 * XDropTargetDragContext
77*b1cdbd2cSJim Jagielski 	 */
78*b1cdbd2cSJim Jagielski 
79*b1cdbd2cSJim Jagielski 	virtual void SAL_CALL acceptDrag( sal_Int8 dropAction ) throw(::com::sun::star::uno::RuntimeException);
80*b1cdbd2cSJim Jagielski 	virtual void SAL_CALL rejectDrag() throw(::com::sun::star::uno::RuntimeException);
81*b1cdbd2cSJim Jagielski 
82*b1cdbd2cSJim Jagielski 	/*
83*b1cdbd2cSJim Jagielski 	 * XDropTargetListener
84*b1cdbd2cSJim Jagielski 	 */
85*b1cdbd2cSJim Jagielski 
86*b1cdbd2cSJim Jagielski 	virtual void SAL_CALL drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& dtde ) throw(::com::sun::star::uno::RuntimeException);
87*b1cdbd2cSJim Jagielski 	virtual void SAL_CALL dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ) throw(::com::sun::star::uno::RuntimeException);
88*b1cdbd2cSJim Jagielski 	virtual void SAL_CALL dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& dte ) throw(::com::sun::star::uno::RuntimeException);
89*b1cdbd2cSJim Jagielski 	virtual void SAL_CALL dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw(::com::sun::star::uno::RuntimeException);
90*b1cdbd2cSJim Jagielski 	virtual void SAL_CALL dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw(::com::sun::star::uno::RuntimeException);
91*b1cdbd2cSJim Jagielski 
92*b1cdbd2cSJim Jagielski 	/*
93*b1cdbd2cSJim Jagielski 	 * XDragGestureListener
94*b1cdbd2cSJim Jagielski 	 */
95*b1cdbd2cSJim Jagielski 
96*b1cdbd2cSJim Jagielski     virtual void SAL_CALL dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& dge ) throw(::com::sun::star::uno::RuntimeException);
97*b1cdbd2cSJim Jagielski 
98*b1cdbd2cSJim Jagielski 
99*b1cdbd2cSJim Jagielski 	/*
100*b1cdbd2cSJim Jagielski 	 * XEventListener
101*b1cdbd2cSJim Jagielski 	 */
102*b1cdbd2cSJim Jagielski 
103*b1cdbd2cSJim Jagielski 	virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& eo ) throw(::com::sun::star::uno::RuntimeException);
104*b1cdbd2cSJim Jagielski };
105*b1cdbd2cSJim Jagielski 
106*b1cdbd2cSJim Jagielski //==================================================================================================
107*b1cdbd2cSJim Jagielski //
108*b1cdbd2cSJim Jagielski //==================================================================================================
109*b1cdbd2cSJim Jagielski 
110*b1cdbd2cSJim Jagielski #endif
111