Changeset View
Changeset View
Standalone View
Standalone View
src/client/dataoffer.h
Show All 18 Lines | |||||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #ifndef WAYLAND_DATAOFFER_H | 20 | #ifndef WAYLAND_DATAOFFER_H | ||
21 | #define WAYLAND_DATAOFFER_H | 21 | #define WAYLAND_DATAOFFER_H | ||
22 | 22 | | |||
23 | #include <QObject> | 23 | #include <QObject> | ||
24 | 24 | | |||
25 | #include <KWayland/Client/kwaylandclient_export.h> | 25 | #include <KWayland/Client/kwaylandclient_export.h> | ||
26 | 26 | | |||
27 | #include "datadevicemanager.h" | ||||
28 | | ||||
27 | struct wl_data_offer; | 29 | struct wl_data_offer; | ||
28 | 30 | | |||
29 | class QMimeType; | 31 | class QMimeType; | ||
30 | 32 | | |||
31 | namespace KWayland | 33 | namespace KWayland | ||
32 | { | 34 | { | ||
33 | namespace Client | 35 | namespace Client | ||
34 | { | 36 | { | ||
Show All 39 Lines | 50 | public: | |||
74 | **/ | 76 | **/ | ||
75 | bool isValid() const; | 77 | bool isValid() const; | ||
76 | 78 | | |||
77 | QList<QMimeType> offeredMimeTypes() const; | 79 | QList<QMimeType> offeredMimeTypes() const; | ||
78 | 80 | | |||
79 | void receive(const QMimeType &mimeType, qint32 fd); | 81 | void receive(const QMimeType &mimeType, qint32 fd); | ||
80 | void receive(const QString &mimeType, qint32 fd); | 82 | void receive(const QString &mimeType, qint32 fd); | ||
81 | 83 | | |||
84 | /** | ||||
85 | * Notifies the compositor that the drag destination successfully | ||||
86 | * finished the drag-and-drop operation. | ||||
87 | * | ||||
88 | * After this operation it is only allowed to release the DataOffer. | ||||
89 | * | ||||
90 | * @since 5.42 | ||||
91 | **/ | ||||
92 | void dragAndDropFinished(); | ||||
93 | | ||||
94 | /** | ||||
95 | * The actions offered by the DataSource. | ||||
96 | * @since 5.42 | ||||
97 | * @see sourceDragAndDropActionsChanged | ||||
98 | **/ | ||||
99 | DataDeviceManager::DnDActions sourceDragAndDropActions() const; | ||||
100 | | ||||
101 | /** | ||||
102 | * Sets the @p supported and @p preferred Drag and Drop actions. | ||||
103 | * @since 5.42 | ||||
104 | **/ | ||||
105 | void setDragAndDropActions(DataDeviceManager::DnDActions supported, DataDeviceManager::DnDAction preferred); | ||||
106 | | ||||
107 | /** | ||||
108 | * The currently selected drag and drop action by the compositor. | ||||
109 | * @see selectedDragAndDropActionChanged | ||||
110 | * @since 5.42 | ||||
111 | **/ | ||||
112 | DataDeviceManager::DnDAction selectedDragAndDropAction() const; | ||||
113 | | ||||
82 | operator wl_data_offer*(); | 114 | operator wl_data_offer*(); | ||
83 | operator wl_data_offer*() const; | 115 | operator wl_data_offer*() const; | ||
84 | 116 | | |||
85 | Q_SIGNALS: | 117 | Q_SIGNALS: | ||
86 | void mimeTypeOffered(const QString&); | 118 | void mimeTypeOffered(const QString&); | ||
119 | /** | ||||
120 | * Emitted whenever the @link{sourceDragAndDropActions} changed, e.g. on enter or when | ||||
121 | * the DataSource changes the supported actions. | ||||
122 | * @see sourceDragAndDropActions | ||||
123 | * @since 5.42 | ||||
124 | **/ | ||||
125 | void sourceDragAndDropActionsChanged(); | ||||
126 | /** | ||||
127 | * Emitted whenever the selected drag and drop action changes. | ||||
128 | * @see selectedDragAndDropAction | ||||
129 | * @since 5.42 | ||||
130 | **/ | ||||
131 | void selectedDragAndDropActionChanged(); | ||||
87 | 132 | | |||
88 | private: | 133 | private: | ||
89 | friend class DataDevice; | 134 | friend class DataDevice; | ||
90 | explicit DataOffer(DataDevice *parent, wl_data_offer *dataOffer); | 135 | explicit DataOffer(DataDevice *parent, wl_data_offer *dataOffer); | ||
91 | class Private; | 136 | class Private; | ||
92 | QScopedPointer<Private> d; | 137 | QScopedPointer<Private> d; | ||
93 | }; | 138 | }; | ||
94 | 139 | | |||
95 | } | 140 | } | ||
96 | } | 141 | } | ||
97 | 142 | | |||
98 | Q_DECLARE_METATYPE(KWayland::Client::DataOffer*) | 143 | Q_DECLARE_METATYPE(KWayland::Client::DataOffer*) | ||
99 | 144 | | |||
100 | #endif | 145 | #endif |