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