diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-10-15 14:44:29 +0200 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-10-19 10:05:00 +0200 |
commit | 5ebef042bd44e9babd58f53b4458616aa3215beb (patch) | |
tree | 2ba2ad7304390d6bcce33954e79d88cb406c0057 /vcl/qt5/Qt5Frame.cxx | |
parent | 2c1b7e8d6a7fa22cb91919238418816671c3a497 (diff) |
Kick-start beginning of drag event
Change-Id: Iaad25a7acdc7d64013bc3dd0d9410e7d2d5c6762
Reviewed-on: https://gerrit.libreoffice.org/61791
Tested-by: Jenkins
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'vcl/qt5/Qt5Frame.cxx')
-rw-r--r-- | vcl/qt5/Qt5Frame.cxx | 31 |
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: */ |