24#include <osl/mutex.hxx>
28using namespace ::
cppu;
35 m_pTopWindow( pTopWindow ),
36 m_pCurrentWindow( nullptr )
55 if(
nullptr == pChildWindow )
64 pChildWinOutDev->
ReMirror( location );
74 designate_currentwindow(
nullptr);
89 std::scoped_lock aImplGuard(
m_aMutex );
91 Point location( dtde.LocationX, dtde.LocationY );
106 sal_Int32 nListeners =
fireDropEvent( pChildWindow, dtde.Context, dtde.DropAction,
107 location, dtde.SourceActions, dtde.Transferable );
110 if( nListeners == 0 ) {
111 SAL_WARN(
"vcl",
"rejecting drop due to missing listeners." );
112 dtde.Context->rejectDrop();
122 std::scoped_lock aImplGuard(
m_aMutex );
123 Point location( dtdee.LocationX, dtdee.LocationY );
132 sal_Int32 nListeners =
fireDragEnterEvent( pChildWindow, dtdee.Context, dtdee.DropAction, location,
133 dtdee.SourceActions, dtdee.SupportedDataFlavors );
136 if( nListeners == 0 ) {
137 SAL_WARN(
"vcl",
"rejecting drag enter due to missing listeners." );
138 dtdee.Context->rejectDrag();
145 std::scoped_lock aImplGuard(
m_aMutex );
156 std::scoped_lock aImplGuard(
m_aMutex );
158 Point location( dtde.LocationX, dtde.LocationY );
159 sal_Int32 nListeners;
172 nListeners =
fireDragEnterEvent( pChildWindow, dtde.Context, dtde.DropAction, location,
178 nListeners =
fireDragOverEvent( pChildWindow, dtde.Context, dtde.DropAction, location,
179 dtde.SourceActions );
183 if( nListeners == 0 )
185 SAL_WARN(
"vcl",
"rejecting drag over due to missing listeners." );
186 dtde.Context->rejectDrag();
192 std::scoped_lock aImplGuard(
m_aMutex );
194 Point location( dtde.LocationX, dtde.LocationY );
195 sal_Int32 nListeners;
208 nListeners =
fireDragEnterEvent( pChildWindow, dtde.Context, dtde.DropAction, location,
215 dtde.SourceActions );
219 if( nListeners == 0 )
221 SAL_WARN(
"vcl",
"rejecting dropActionChanged due to missing listeners." );
222 dtde.Context->rejectDrag();
228 std::scoped_lock aImplGuard(
m_aMutex );
230 Point origin( dge.DragOriginX, dge.DragOriginY );
250 const Reference< XDropTargetDragContext >& xContext,
const sal_Int8 nDropAction,
251 const Point& rLocation,
const sal_Int8 nSourceActions,
const Sequence< DataFlavor >& aFlavorList
261 Reference< XDropTarget > xDropTarget = pWindow->
GetDropTarget();
263 if( xDropTarget.is() )
270 xContext, nDropAction, relLoc.
X(), relLoc.
Y(), nSourceActions, aFlavorList );
278 const Reference< XDropTargetDragContext >& xContext,
const sal_Int8 nDropAction,
289 Reference< XDropTarget > xDropTarget = pWindow->
GetDropTarget();
291 if( xDropTarget.is() )
298 xContext, nDropAction, relLoc.
X(), relLoc.
Y(), nSourceActions );
314 Reference< XDropTarget > xDropTarget = pWindow->
GetDropTarget();
318 if( xDropTarget.is() )
326 const Reference< XDropTargetDragContext >& xContext,
const sal_Int8 nDropAction,
337 Reference< XDropTarget > xDropTarget = pWindow->
GetDropTarget();
339 if( xDropTarget.is() )
346 xContext, nDropAction, relLoc.
X(), relLoc.
Y(), nSourceActions );
354 const Reference< XDropTargetDropContext >& xContext,
const sal_Int8 nDropAction,
const Point& rLocation,
355 const sal_Int8 nSourceActions,
const Reference< XTransferable >& xTransferable
365 Reference< XDropTarget > xDropTarget = pWindow->
GetDropTarget();
370 if( xDropTarget.is() )
377 xContext, nDropAction, relLoc.
X(), relLoc.
Y(), nSourceActions, xTransferable );
385 const Reference< XDragSource >& xSource,
const Any& event,
398 if( xDragGestureRecognizer.is() )
405 nDragAction, relLoc.
X(), relLoc.
Y(), xSource, event );
static bool GetLayoutRTL()
virtual void SAL_CALL drop(const css::datatransfer::dnd::DropTargetDropEvent &dtde) override
static sal_Int32 fireDragGestureEvent(vcl::Window *pWindow, const css::uno::Reference< css::datatransfer::dnd::XDragSource > &xSource, const css::uno::Any &event, const Point &rOrigin, const sal_Int8 nDragAction)
virtual void SAL_CALL dragGestureRecognized(const css::datatransfer::dnd::DragGestureEvent &dge) override
virtual void SAL_CALL disposing(const css::lang::EventObject &eo) override
static sal_Int32 fireDragOverEvent(vcl::Window *pWindow, const css::uno::Reference< css::datatransfer::dnd::XDropTargetDragContext > &xContext, const sal_Int8 nDropAction, const Point &rLocation, const sal_Int8 nSourceAction)
static sal_Int32 fireDropActionChangedEvent(vcl::Window *pWindow, const css::uno::Reference< css::datatransfer::dnd::XDropTargetDragContext > &xContext, const sal_Int8 nDropAction, const Point &rLocation, const sal_Int8 nSourceAction)
void designate_currentwindow(vcl::Window *pWindow)
virtual void SAL_CALL dropActionChanged(const css::datatransfer::dnd::DropTargetDragEvent &dtde) override
virtual void SAL_CALL acceptDrag(sal_Int8 dropAction) override
static sal_Int32 fireDropEvent(vcl::Window *pWindow, const css::uno::Reference< css::datatransfer::dnd::XDropTargetDropContext > &xContext, const sal_Int8 nDropAction, const Point &rLocation, const sal_Int8 nSourceAction, const css::uno::Reference< css::datatransfer::XTransferable > &xTransferable)
VclPtr< vcl::Window > m_pTopWindow
static sal_Int32 fireDragExitEvent(vcl::Window *pWindow)
VclPtr< vcl::Window > m_pCurrentWindow
static sal_Int32 fireDragEnterEvent(vcl::Window *pWindow, const css::uno::Reference< css::datatransfer::dnd::XDropTargetDragContext > &xContext, const sal_Int8 nDropAction, const Point &rLocation, const sal_Int8 nSourceAction, const css::uno::Sequence< css::datatransfer::DataFlavor > &aFlavorList)
virtual void SAL_CALL rejectDrag() override
css::uno::Sequence< css::datatransfer::DataFlavor > m_aDataFlavorList
vcl::Window * findTopLevelWindow(Point &location)
virtual void SAL_CALL dragExit(const css::datatransfer::dnd::DropTargetEvent &dte) override
virtual ~DNDEventDispatcher() override
virtual void SAL_CALL dragOver(const css::datatransfer::dnd::DropTargetDragEvent &dtde) override
DNDEventDispatcher(vcl::Window *pTopWindow)
std::recursive_mutex m_aMutex
virtual void SAL_CALL dragEnter(const css::datatransfer::dnd::DropTargetDragEnterEvent &dtdee) override
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
SAL_DLLPRIVATE bool ImplIsAntiparallel() const
SAL_DLLPRIVATE void ReMirror(Point &rPoint) const
constexpr tools::Long Y() const
constexpr tools::Long X() const
reference_type * get() const
Get the body.
SAL_DLLPRIVATE vcl::Window * ImplFindWindow(const Point &rFramePos)
bool IsInputEnabled() const
void RemoveEventListener(const Link< VclWindowEvent &, void > &rEventListener)
::OutputDevice const * GetOutDev() const
bool IsInModalMode() const
A window is in modal mode if one of its children or subchildren is a running modal window (a modal di...
void AddEventListener(const Link< VclWindowEvent &, void > &rEventListener)
SAL_DLLPRIVATE void ImplMirrorFramePos(Point &pt) const
css::uno::Reference< css::datatransfer::dnd::XDropTarget > GetDropTarget()
Point ScreenToOutputPixel(const Point &rPos) const
css::uno::Reference< css::datatransfer::dnd::XDragGestureRecognizer > GetDragGestureRecognizer()
SAL_DLLPRIVATE vcl::Window * ImplGetClientWindow() const
IMPL_LINK(DNDEventDispatcher, WindowEventListener, VclWindowEvent &, rEvent, void)
#define LINK(Instance, Class, Member)
#define SAL_WARN(area, stream)