Interface WlDataOfferRequestsV2
- All Superinterfaces:
WlDataOfferRequests
- All Known Subinterfaces:
WlDataOfferRequestsV3
A wl_data_offer represents a piece of data offered for transfer by another client (the source client). It is used by the copy-and-paste and drag-and-drop mechanisms. The offer describes the different mime types that the data can be converted to and provides the mechanism for transferring the data directly from the source client.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(WlDataOfferResource requester, int serial, String mimeType) accept one of the offered mime typesvoid
destroy
(WlDataOfferResource requester) destroy data offervoid
receive
(WlDataOfferResource requester, String mimeType, int fd) request that the data is transferred
-
Field Details
-
VERSION
static final int VERSION- See Also:
-
-
Method Details
-
accept
accept one of the offered mime typesIndicate that the client can accept the given mime type, or NULL for not accepted.
For objects of version 2 or older, this request is used by the client to give feedback whether the client can receive the given mime type, or NULL if none is accepted; the feedback does not determine whether the drag-and-drop operation succeeds or not.
For objects of version 3 or newer, this request determines the final result of the drag-and-drop operation. If the end result is that no mime types were accepted, the drag-and-drop operation will be cancelled and the corresponding drag source will receive wl_data_source.cancelled. Clients may still use this event in conjunction with wl_data_source.action for feedback.
- Specified by:
accept
in interfaceWlDataOfferRequests
- Parameters:
requester
- The protocol object that made the request.serial
- serial number of the accept requestmimeType
- mime type accepted by the client
-
receive
request that the data is transferredTo transfer the offered data, the client issues this request and indicates the mime type it wants to receive. The transfer happens through the passed file descriptor (typically created with the pipe system call). The source client writes the data in the mime type representation requested and then closes the file descriptor.
The receiving client reads from the read end of the pipe until EOF and then closes its end, at which point the transfer is complete.
This request may happen multiple times for different mime types, both before and after wl_data_device.drop. Drag-and-drop destination clients may preemptively fetch data or examine it more closely to determine acceptance.
- Specified by:
receive
in interfaceWlDataOfferRequests
- Parameters:
requester
- The protocol object that made the request.mimeType
- mime type desired by receiverfd
- file descriptor for data transfer
-
destroy
destroy data offerDestroy the data offer.
- Specified by:
destroy
in interfaceWlDataOfferRequests
- Parameters:
requester
- The protocol object that made the request.
-