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