summaryrefslogtreecommitdiff
path: root/vcl/qt5/Qt5Frame.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/qt5/Qt5Frame.cxx')
-rw-r--r--vcl/qt5/Qt5Frame.cxx31
1 files changed, 31 insertions, 0 deletions
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index ae3ae325ccd2..bbf541dea312 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -46,6 +46,8 @@
#include <vcl/layout.hxx>
#include <vcl/syswin.hxx>
+#include <com/sun/star/datatransfer/dnd/DNDConstants.hpp>
+
#include <cairo.h>
#include <headless/svpgdi.hxx>
@@ -63,6 +65,9 @@ Qt5Frame::Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo)
, m_bNullRegion(true)
, m_bGraphicsInUse(false)
, m_ePointerStyle(PointerStyle::Arrow)
+ , m_pDragSource(nullptr)
+ , m_pDropTarget(nullptr)
+ , m_bInDrag(false)
, m_bDefaultSize(true)
, m_bDefaultPos(true)
{
@@ -870,4 +875,30 @@ void Qt5Frame::deregisterDropTarget(Qt5DropTarget const* pDropTarget)
m_pDropTarget = nullptr;
}
+void Qt5Frame::draggingStarted(const int x, const int y)
+{
+ assert(m_pDropTarget);
+
+ css::datatransfer::dnd::DropTargetDragEnterEvent aEvent;
+ aEvent.Source = static_cast<css::datatransfer::dnd::XDropTarget*>(m_pDropTarget);
+ aEvent.Context = static_cast<css::datatransfer::dnd::XDropTargetDragContext*>(m_pDropTarget);
+ aEvent.LocationX = x;
+ aEvent.LocationY = y;
+ aEvent.DropAction = css::datatransfer::dnd::DNDConstants::ACTION_MOVE; //FIXME
+ aEvent.SourceActions = css::datatransfer::dnd::DNDConstants::ACTION_MOVE;
+
+ css::uno::Reference<css::datatransfer::XTransferable> xTransferable;
+ xTransferable = m_pDragSource->GetTransferable();
+
+ if (!m_bInDrag && xTransferable.is())
+ {
+ css::uno::Sequence<css::datatransfer::DataFlavor> aFormats
+ = xTransferable->getTransferDataFlavors();
+ aEvent.SupportedDataFlavors = aFormats;
+
+ m_pDropTarget->fire_dragEnter(aEvent);
+ m_bInDrag = true;
+ }
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */