Changeset View
Changeset View
Standalone View
Standalone View
src/server/dataoffer_interface_p.h
- This file was added.
1 | /******************************************************************** | ||||
---|---|---|---|---|---|
2 | Copyright 2017 Martin Flöser <mgraesslin@kde.org> | ||||
3 | | ||||
4 | This library is free software; you can redistribute it and/or | ||||
5 | modify it under the terms of the GNU Lesser General Public | ||||
6 | License as published by the Free Software Foundation; either | ||||
7 | version 2.1 of the License, or (at your option) version 3, or any | ||||
8 | later version accepted by the membership of KDE e.V. (or its | ||||
9 | successor approved by the membership of KDE e.V.), which shall | ||||
10 | act as a proxy defined in Section 6 of version 3 of the license. | ||||
11 | | ||||
12 | This library is distributed in the hope that it will be useful, | ||||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
15 | Lesser General Public License for more details. | ||||
16 | | ||||
17 | You should have received a copy of the GNU Lesser General Public | ||||
18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||||
19 | *********************************************************************/ | ||||
20 | #ifndef KWAYLAND_SERVER_DATAOFFERINTERFACE_P_H | ||||
21 | #define KWAYLAND_SERVER_DATAOFFERINTERFACE_P_H | ||||
22 | #include "dataoffer_interface.h" | ||||
23 | #include "datasource_interface.h" | ||||
24 | #include "resource_p.h" | ||||
25 | #include <wayland-server.h> | ||||
26 | | ||||
27 | namespace KWayland | ||||
28 | { | ||||
29 | namespace Server | ||||
30 | { | ||||
31 | | ||||
32 | class Q_DECL_HIDDEN DataOfferInterface::Private : public Resource::Private | ||||
33 | { | ||||
34 | public: | ||||
35 | Private(DataSourceInterface *source, DataDeviceInterface *parentInterface, DataOfferInterface *q, wl_resource *parentResource); | ||||
36 | ~Private(); | ||||
37 | DataSourceInterface *source; | ||||
38 | DataDeviceInterface *dataDevice; | ||||
39 | // defaults are set to sensible values for < version 3 interfaces | ||||
40 | DataDeviceManagerInterface::DnDActions supportedDnDActions = DataDeviceManagerInterface::DnDAction::Copy | DataDeviceManagerInterface::DnDAction::Move; | ||||
41 | DataDeviceManagerInterface::DnDAction preferredDnDAction = DataDeviceManagerInterface::DnDAction::Copy; | ||||
42 | | ||||
43 | void sendSourceActions(); | ||||
44 | | ||||
45 | private: | ||||
46 | DataOfferInterface *q_func() { | ||||
47 | return reinterpret_cast<DataOfferInterface *>(q); | ||||
48 | } | ||||
49 | void receive(const QString &mimeType, qint32 fd); | ||||
50 | static void acceptCallback(wl_client *client, wl_resource *resource, uint32_t serial, const char *mimeType); | ||||
51 | static void receiveCallback(wl_client *client, wl_resource *resource, const char *mimeType, int32_t fd); | ||||
52 | static void finishCallback(wl_client *client, wl_resource *resource); | ||||
53 | static void setActionsCallback(wl_client *client, wl_resource *resource, uint32_t dnd_actions, uint32_t preferred_action); | ||||
54 | | ||||
55 | static const struct wl_data_offer_interface s_interface; | ||||
56 | }; | ||||
57 | | ||||
58 | } | ||||
59 | } | ||||
60 | | ||||
61 | #endif |