summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/qt5/Qt5DragAndDrop.hxx21
-rw-r--r--vcl/inc/qt5/Qt5Frame.hxx10
-rw-r--r--vcl/inc/qt5/Qt5Tools.hxx3
-rw-r--r--vcl/inc/qt5/Qt5Transferable.hxx2
-rw-r--r--vcl/inc/qt5/Qt5Widget.hxx2
5 files changed, 16 insertions, 22 deletions
diff --git a/vcl/inc/qt5/Qt5DragAndDrop.hxx b/vcl/inc/qt5/Qt5DragAndDrop.hxx
index dcd6cb5e4048..0ec9ce5bbcb2 100644
--- a/vcl/inc/qt5/Qt5DragAndDrop.hxx
+++ b/vcl/inc/qt5/Qt5DragAndDrop.hxx
@@ -25,7 +25,6 @@ class Qt5DragSource
osl::Mutex m_aMutex;
Qt5Frame* m_pFrame;
css::uno::Reference<css::datatransfer::dnd::XDragSourceListener> m_xListener;
- css::uno::Reference<css::datatransfer::XTransferable> m_xTrans;
public:
Qt5DragSource()
@@ -55,17 +54,7 @@ public:
css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
- void dragFailed();
- void fire_dragEnd(sal_Int8 nAction);
-
- static Qt5DragSource* m_ActiveDragSource;
- static bool m_bDropSuccessSet;
- static bool m_bDropSuccess;
-
- css::uno::Reference<css::datatransfer::XTransferable> const& GetTransferable() const
- {
- return m_xTrans;
- }
+ void fire_dragEnd(sal_Int8 nAction, bool bSuccessful);
};
class Qt5DropTarget
@@ -76,11 +65,11 @@ class Qt5DropTarget
{
osl::Mutex m_aMutex;
Qt5Frame* m_pFrame;
- sal_Int8 mnDragAction;
- sal_Int8 mnDropAction;
+ sal_Int8 m_nDropAction;
bool m_bActive;
sal_Int8 m_nDefaultActions;
std::vector<css::uno::Reference<css::datatransfer::dnd::XDropTargetListener>> m_aListeners;
+ bool m_bDropSuccessful;
public:
Qt5DropTarget();
@@ -115,10 +104,12 @@ public:
css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
void fire_dragEnter(const css::datatransfer::dnd::DropTargetDragEnterEvent& dtde);
+ void fire_dragExit(const css::datatransfer::dnd::DropTargetEvent& dte);
void fire_dragOver(const css::datatransfer::dnd::DropTargetDragEnterEvent& dtde);
void fire_drop(const css::datatransfer::dnd::DropTargetDropEvent& dtde);
- sal_Int8 proposedDragAction() const { return mnDragAction; }
+ sal_Int8 proposedDropAction() const { return m_nDropAction; }
+ bool dropSuccessful() const { return m_bDropSuccessful; }
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/qt5/Qt5Frame.hxx b/vcl/inc/qt5/Qt5Frame.hxx
index 4c94b846bc93..e296ce92db29 100644
--- a/vcl/inc/qt5/Qt5Frame.hxx
+++ b/vcl/inc/qt5/Qt5Frame.hxx
@@ -56,6 +56,8 @@ class Qt5MainWindow;
class Qt5Menu;
class Qt5SvpGraphics;
+class QDragMoveEvent;
+class QDropEvent;
class QImage;
class QMimeData;
class QPaintDevice;
@@ -159,10 +161,10 @@ public:
virtual void deregisterDragSource(Qt5DragSource const* pDragSource);
virtual void registerDropTarget(Qt5DropTarget* pDropTarget);
virtual void deregisterDropTarget(Qt5DropTarget const* pDropTarget);
- void draggingStarted(const int x, const int y, Qt::DropActions eActions,
- Qt::KeyboardModifiers eKeyMod, const QMimeData* pQMimeData);
- void dropping(const int x, const int y, Qt::KeyboardModifiers eKeyMod,
- const QMimeData* pQMimeData);
+
+ void handleDragLeave();
+ void handleDragMove(QDragMoveEvent* pEvent);
+ void handleDrop(QDropEvent* pEvent);
virtual void SetExtendedFrameStyle(SalExtStyle nExtStyle) override;
virtual void Show(bool bVisible, bool bNoActivate = false) override;
diff --git a/vcl/inc/qt5/Qt5Tools.hxx b/vcl/inc/qt5/Qt5Tools.hxx
index 6b1fb1adcc7e..697b703e28f4 100644
--- a/vcl/inc/qt5/Qt5Tools.hxx
+++ b/vcl/inc/qt5/Qt5Tools.hxx
@@ -70,6 +70,7 @@ inline QColor toQColor(const Color& rColor)
Qt::DropActions toQtDropActions(sal_Int8 dragOperation);
sal_Int8 toVclDropActions(Qt::DropActions dragOperation);
+sal_Int8 toVclDropAction(Qt::DropAction dragOperation);
Qt::DropAction getPreferredDropAction(sal_Int8 dragOperation);
inline QList<int> toQList(const css::uno::Sequence<sal_Int32>& aSequence)
@@ -126,8 +127,6 @@ inline sal_uInt16 getFormatBits(QImage::Format eFormat)
}
}
-static const QString sInternalMimeType = "application/x-libreoffice-dnditem";
-
typedef struct _cairo_surface cairo_surface_t;
struct CairoDeleter
{
diff --git a/vcl/inc/qt5/Qt5Transferable.hxx b/vcl/inc/qt5/Qt5Transferable.hxx
index df06661bb9fd..0d1cc70502aa 100644
--- a/vcl/inc/qt5/Qt5Transferable.hxx
+++ b/vcl/inc/qt5/Qt5Transferable.hxx
@@ -117,6 +117,8 @@ public:
QStringList formats() const override;
bool deepCopy(QMimeData** const) const;
+
+ css::datatransfer::XTransferable* xTransferable() const { return m_aContents.get(); }
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/qt5/Qt5Widget.hxx b/vcl/inc/qt5/Qt5Widget.hxx
index 85523951cda2..a69c86876a44 100644
--- a/vcl/inc/qt5/Qt5Widget.hxx
+++ b/vcl/inc/qt5/Qt5Widget.hxx
@@ -57,6 +57,7 @@ class Qt5Widget : public QWidget
virtual void mousePressEvent(QMouseEvent*) override;
virtual void mouseReleaseEvent(QMouseEvent*) override;
virtual void dragEnterEvent(QDragEnterEvent*) override;
+ virtual void dragLeaveEvent(QDragLeaveEvent*) override;
virtual void dragMoveEvent(QDragMoveEvent*) override;
virtual void dropEvent(QDropEvent*) override;
virtual void moveEvent(QMoveEvent*) override;
@@ -74,7 +75,6 @@ public:
Qt5Widget(Qt5Frame& rFrame, Qt::WindowFlags f = Qt::WindowFlags());
Qt5Frame& getFrame() const { return m_rFrame; }
- void startDrag(sal_Int8 nSourceActions);
void endExtTextInput();
static bool handleEvent(Qt5Frame&, const QWidget&, QEvent*);