Drop
Object Hierarchy:
Description:
[
CCode ( type_id =
"gdk_drop_get_type ()" ) ]
public abstract class Drop :
Object
The `GdkDrop` object represents the target of an ongoing DND operation.
Possible drop sites get informed about the status of the ongoing drag operation with events of type gdk_drag_enter
, gdk_drag_leave, gdk_drag_motion and
gdk_drop_start. The `GdkDrop` object can be obtained from these [class@Gdk.Event] types using [method@Gdk.DNDEvent.get_drop].
The actual data transfer is initiated from the target side via an async read, using one of the `GdkDrop` methods for this purpose: [
method@Gdk.Drop.read_async] or [method@Gdk.Drop.read_value_async].
GTK provides a higher level abstraction based on top of these functions, and so they are not normally needed in GTK applications. See the "Drag
and Drop" section of the GTK documentation for more information.
Content:
Properties:
- public DragAction actions { get; construct; }
The possible actions for this drop
- public Device device { get; construct; }
The `GdkDevice` performing the drop
- public Display display { get; }
The `GdkDisplay` that the drop belongs to.
- public Drag drag { get; construct; }
The `GdkDrag` that initiated this drop
- public ContentFormats formats { get; construct; }
The possible formats that the drop can provide its data in.
- public Surface surface { get; construct; }
The `GdkSurface` the drop happens on
Creation methods:
Methods:
- public void finish (DragAction action)
Ends the drag operation after a drop.
- public DragAction get_actions ()
Returns the possible actions for this `GdkDrop`.
- public unowned Device get_device ()
Returns the `GdkDevice` performing the drop.
- public unowned Display get_display ()
Gets the `GdkDisplay` that this was
created for.
- public unowned Drag? get_drag ()
If this is an in-app drag-and-drop operation, returns the `GdkDrag` that
corresponds to this drop.
- public unowned ContentFormats get_formats ()
Returns the `GdkContentFormats` that the drop offers the data to be read in.
- public unowned Surface get_surface ()
Returns the `GdkSurface` performing the drop.
- public async InputStream? read_async (string[] mime_types, int io_priority, Cancellable? cancellable, out string out_mime_type) throws Error
Asynchronously read the dropped data from a `GdkDrop` in a format that
complies with one of the mime types.
- public async unowned Value? read_value_async (Type type, int io_priority, Cancellable? cancellable) throws Error
Asynchronously request the drag operation's contents converted to the given
type
.
- public void status (DragAction actions, DragAction preferred)
Selects all actions that are potentially supported by the destination.
Inherited Members:
All known members inherited from class GLib.Object