Changeset View
Changeset View
Standalone View
Standalone View
src/server/dataoffer_interface.h
Show All 19 Lines | |||||
20 | #ifndef WAYLAND_SERVER_DATA_OFFER_INTERFACE_H | 20 | #ifndef WAYLAND_SERVER_DATA_OFFER_INTERFACE_H | ||
21 | #define WAYLAND_SERVER_DATA_OFFER_INTERFACE_H | 21 | #define WAYLAND_SERVER_DATA_OFFER_INTERFACE_H | ||
22 | 22 | | |||
23 | #include <QObject> | 23 | #include <QObject> | ||
24 | 24 | | |||
25 | #include <KWayland/Server/kwaylandserver_export.h> | 25 | #include <KWayland/Server/kwaylandserver_export.h> | ||
26 | 26 | | |||
27 | #include "resource.h" | 27 | #include "resource.h" | ||
28 | #include "datadevicemanager_interface.h" | ||||
28 | 29 | | |||
29 | namespace KWayland | 30 | namespace KWayland | ||
30 | { | 31 | { | ||
31 | namespace Server | 32 | namespace Server | ||
32 | { | 33 | { | ||
33 | 34 | | |||
34 | class DataDeviceInterface; | 35 | class DataDeviceInterface; | ||
35 | class DataSourceInterface; | 36 | class DataSourceInterface; | ||
36 | 37 | | |||
37 | /** | 38 | /** | ||
38 | * @brief Represents the Resource for the wl_data_offer interface. | 39 | * @brief Represents the Resource for the wl_data_offer interface. | ||
39 | * | 40 | * | ||
40 | **/ | 41 | **/ | ||
41 | class KWAYLANDSERVER_EXPORT DataOfferInterface : public Resource | 42 | class KWAYLANDSERVER_EXPORT DataOfferInterface : public Resource | ||
42 | { | 43 | { | ||
43 | Q_OBJECT | 44 | Q_OBJECT | ||
44 | public: | 45 | public: | ||
45 | virtual ~DataOfferInterface(); | 46 | virtual ~DataOfferInterface(); | ||
46 | 47 | | |||
47 | void sendAllOffers(); | 48 | void sendAllOffers(); | ||
48 | 49 | | |||
50 | /** | ||||
51 | * @returns The Drag and Drop actions supported by this DataOfferInterface. | ||||
52 | * @since 5.42 | ||||
53 | **/ | ||||
54 | DataDeviceManagerInterface::DnDActions supportedDragAndDropActions() const; | ||||
55 | | ||||
56 | /** | ||||
57 | * @returns The preferred Drag and Drop action of this DataOfferInterface. | ||||
58 | * @since 5.42 | ||||
59 | **/ | ||||
60 | DataDeviceManagerInterface::DnDAction preferredDragAndDropAction() const; | ||||
61 | | ||||
62 | /** | ||||
63 | * This event indicates the @p action selected by the compositor after matching the | ||||
64 | * source/destination side actions. Only one action (or none) will be offered here. | ||||
65 | * @since 5.42 | ||||
66 | **/ | ||||
67 | void dndAction(DataDeviceManagerInterface::DnDAction action); | ||||
68 | | ||||
69 | Q_SIGNALS: | ||||
70 | /** | ||||
71 | * Emitted whenever the supported or preferred Drag and Drop actions changed. | ||||
72 | * @since 5.42 | ||||
73 | **/ | ||||
74 | void dragAndDropActionsChanged(); | ||||
75 | | ||||
49 | private: | 76 | private: | ||
50 | friend class DataDeviceInterface; | 77 | friend class DataDeviceInterface; | ||
51 | explicit DataOfferInterface(DataSourceInterface *source, DataDeviceInterface *parentInterface, wl_resource *parentResource); | 78 | explicit DataOfferInterface(DataSourceInterface *source, DataDeviceInterface *parentInterface, wl_resource *parentResource); | ||
52 | 79 | | |||
53 | class Private; | 80 | class Private; | ||
54 | Private *d_func() const; | 81 | Private *d_func() const; | ||
55 | }; | 82 | }; | ||
56 | 83 | | |||
57 | } | 84 | } | ||
58 | } | 85 | } | ||
59 | 86 | | |||
60 | Q_DECLARE_METATYPE(KWayland::Server::DataOfferInterface*) | 87 | Q_DECLARE_METATYPE(KWayland::Server::DataOfferInterface*) | ||
61 | 88 | | |||
62 | #endif | 89 | #endif |