/src/qtbase/src/gui/kernel/qdnd_p.h
Line | Count | Source |
1 | | // Copyright (C) 2016 The Qt Company Ltd. |
2 | | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | | // Qt-Security score:significant reason:default |
4 | | |
5 | | #ifndef QDND_P_H |
6 | | #define QDND_P_H |
7 | | |
8 | | // |
9 | | // W A R N I N G |
10 | | // ------------- |
11 | | // |
12 | | // This file is not part of the Qt API. It exists for the convenience |
13 | | // of other Qt classes. This header file may change from version to |
14 | | // version without notice, or even be removed. |
15 | | // |
16 | | // We mean it. |
17 | | // |
18 | | |
19 | | #include <QtGui/private/qtguiglobal_p.h> |
20 | | #include "QtCore/qobject.h" |
21 | | #include "QtCore/qmap.h" |
22 | | #include "QtCore/qmimedata.h" |
23 | | #include "QtGui/qdrag.h" |
24 | | #include "QtGui/qpixmap.h" |
25 | | #include "QtGui/qcursor.h" |
26 | | #include "QtGui/qwindow.h" |
27 | | #include "QtCore/qpoint.h" |
28 | | #include "private/qobject_p.h" |
29 | | #include "QtGui/qbackingstore.h" |
30 | | |
31 | | #include <QtCore/qpointer.h> |
32 | | |
33 | | QT_REQUIRE_CONFIG(draganddrop); |
34 | | |
35 | | QT_BEGIN_NAMESPACE |
36 | | |
37 | | class QPlatformDrag; |
38 | | |
39 | | class QDragPrivate : public QObjectPrivate |
40 | | { |
41 | | public: |
42 | | QDragPrivate() |
43 | 0 | : source(nullptr) |
44 | 0 | , target(nullptr) |
45 | 0 | , data(nullptr) |
46 | 0 | { } |
47 | | QObject *source; |
48 | | QObject *target; |
49 | | QMimeData *data; |
50 | | QPixmap pixmap; |
51 | | QPoint hotspot; |
52 | | Qt::DropAction executed_action; |
53 | | Qt::DropActions supported_actions; |
54 | | Qt::DropAction default_action; |
55 | | QMap<Qt::DropAction, QPixmap> customCursors; |
56 | | }; |
57 | | |
58 | | class Q_GUI_EXPORT QDragManager : public QObject { |
59 | 0 | Q_OBJECT |
60 | 0 |
|
61 | 0 | public: |
62 | 0 | QDragManager(); |
63 | 0 | ~QDragManager(); |
64 | 0 | static QDragManager *self(); |
65 | 0 |
|
66 | 0 | Qt::DropAction drag(QDrag *); |
67 | 0 |
|
68 | 0 | void setCurrentTarget(QObject *target, bool dropped = false); |
69 | 0 | QObject *currentTarget() const; |
70 | 0 |
|
71 | 0 | QPointer<QDrag> object() const { return m_object; } |
72 | | QObject *source() const; |
73 | | |
74 | | private: |
75 | | QObject *m_currentDropTarget; |
76 | | QPlatformDrag *m_platformDrag; |
77 | | QPointer<QDrag> m_object; |
78 | | |
79 | | friend class QDrag; |
80 | | static QDragManager *m_instance; |
81 | | Q_DISABLE_COPY_MOVE(QDragManager) |
82 | | }; |
83 | | |
84 | | QT_END_NAMESPACE |
85 | | |
86 | | #endif // QDND_P_H |