1 /****************************************************************************
2 **
3 ** DQt - D bindings for the Qt Toolkit
4 **
5 ** GNU Lesser General Public License Usage
6 ** This file may be used under the terms of the GNU Lesser
7 ** General Public License version 3 as published by the Free Software
8 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
9 ** packaging of this file. Please review the following information to
10 ** ensure the GNU Lesser General Public License version 3 requirements
11 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
12 **
13 ****************************************************************************/
14 module qt.gui.drag;
15 extern(C++):
16 
17 import qt.config;
18 import qt.core.mimedata;
19 import qt.core.namespace;
20 import qt.core.object;
21 import qt.core.point;
22 import qt.gui.pixmap;
23 import qt.helpers;
24 
25 /+ QT_REQUIRE_CONFIG(draganddrop);
26 
27 
28 class QMimeData; +/
29 extern(C++, class) struct QDragPrivate;
30 /+ class QPixmap;
31 class QPoint; +/
32 extern(C++, class) struct QDragManager;
33 
34 
35 class /+ Q_GUI_EXPORT +/ QDrag : QObject
36 {
37     mixin(Q_OBJECT);
38     /+ Q_DECLARE_PRIVATE(QDrag) +/
39 public:
40     /+ explicit +/this(QObject dragSource);
41     ~this();
42 
43     final void setMimeData(QMimeData data);
44     final QMimeData mimeData() const;
45 
46     final void setPixmap(ref const(QPixmap) );
47     final QPixmap pixmap() const;
48 
49     final void setHotSpot(ref const(QPoint) hotspot);
50     final QPoint hotSpot() const;
51 
52     final QObject source() const;
53     final QObject target() const;
54 
55 /+ #if QT_DEPRECATED_SINCE(5, 13) +/
56     /+ QT_DEPRECATED_X("Use QDrag::exec() instead") +/
57         final /+ Qt:: +/qt.core.namespace.DropAction start(/+ Qt:: +/qt.core.namespace.DropActions supportedActions = /+ Qt:: +/qt.core.namespace.DropAction.CopyAction);
58 /+ #endif +/
59     final /+ Qt:: +/qt.core.namespace.DropAction exec(/+ Qt:: +/qt.core.namespace.DropActions supportedActions = /+ Qt:: +/qt.core.namespace.DropAction.MoveAction);
60     final /+ Qt:: +/qt.core.namespace.DropAction exec(/+ Qt:: +/qt.core.namespace.DropActions supportedActions, /+ Qt:: +/qt.core.namespace.DropAction defaultAction);
61 
62     final void setDragCursor(ref const(QPixmap) cursor, /+ Qt:: +/qt.core.namespace.DropAction action);
63     final QPixmap dragCursor(/+ Qt:: +/qt.core.namespace.DropAction action) const;
64 
65     final /+ Qt:: +/qt.core.namespace.DropActions supportedActions() const;
66     final /+ Qt:: +/qt.core.namespace.DropAction defaultAction() const;
67 
68     static void cancel();
69 
70 /+ Q_SIGNALS +/public:
71     @QSignal final void actionChanged(/+ Qt:: +/qt.core.namespace.DropAction action);
72     @QSignal final void targetChanged(QObject newTarget);
73 
74 private:
75     /+ friend class QDragManager; +/
76     /+ Q_DISABLE_COPY(QDrag) +/
77 }
78