LibreOffice LibreOffice 25.8 SDK API Reference

Public Member Functions | List of all members
XDragSource Interface Referencepublished

This interface is implemented by a view or window that supports drag operations and will be received as part of a DragGestureEvent through a com::sun::star::datatransfer::dnd::XDragGestureListener::dragGestureRecognized() callback. More...

`import"XDragSource.idl";`

Inheritance diagram for XDragSource:

## Public Member Functions
boolean | isDragImageSupported ()
| In order to query if drag image support is available. More...
long | getDefaultCursor ([in] byte dragAction) raises ( com::sun::star::lang::IllegalArgumentException )
| To get the default cursor for a specified drag action. More...
void | startDrag ([in] DragGestureEvent trigger, [in] byte sourceActions, [in] long cursor, [in] long image, [in] com::sun::star::datatransfer::XTransferable trans, [in] XDragSourceListener listener)
| Starts the drag operation. More...
Public Member Functions inherited from XInterface
any | queryInterface ([in] type aType)
| queries for a new interface to an existing UNO object. More...
void | acquire ()
| increases the reference counter by one. More...
void | release ()
| decreases the reference counter by one. More...

## Detailed Description

This interface is implemented by a view or window that supports drag operations and will be received as part of a DragGestureEvent through a com::sun::star::datatransfer::dnd::XDragGestureListener::dragGestureRecognized() callback.

Differently to Java, the association between view and interface is fixed and can not be changed. Otherwise, the AWT messaging would have to be implemented for any window supporting Drag and Drop operations, which would be a real performance issue.

## Member Function Documentation

## ◆ getDefaultCursor()

long getDefaultCursor | ( | [in] byte | dragAction | ) |
raises | ( | com::sun::star::lang::IllegalArgumentException
| ) |  |

To get the default cursor for a specified drag action.

Parameters

  dragAction | A drag action as specified in DNDConstants.

Returns
  The default drag cursor for the specified drag action.

The returned value may be used as parameter for the method com::sun::star::datatransfer::dnd::XDragSourceContext::setCursor().

## ◆ isDragImageSupported()

boolean isDragImageSupported | ( |  | ) |

In order to query if drag image support is available.

Returns
  A boolean indicating whether or not drag image support is available on the underlying platform.

## ◆ startDrag()

void startDrag | ( | [in] DragGestureEvent | trigger,
|  | [in] byte | sourceActions,
|  | [in] long | cursor,
|  | [in] long | image,
|  | [in] com::sun::star::datatransfer::XTransferable | trans,
|  | [in] XDragSourceListener | listener
| ) |  |

Starts the drag operation.

Note: this call does not block until the drag and drop operation ends. If the Drag and Drop system is unable to initiate a drag operation or if the user attempts to start a drag while an existing drag operation is still executing, the action fails immediately. This is indicated by calling com::sun::star::datatransfer::dnd::XDragSourceListener::dragDropEnd() on the parameter listener with a DragSourceDragEvent showing a failure.

Parameters

  trigger | The DragGestureEvent that initiated the drag.
  sourceActions | The action or actions supported for this transferable as defined in DNDConstants.
  cursor | The initial drag cursor id or 0 as default.
  image | The initial drag image id or 0 as default.
  trans | The transferable object dragged.
  listener | The XDragSourceListener.

See also
  com::sun::star::datatransfer::XTransferable

The documentation for this interface was generated from the following file:

- com/sun/star/datatransfer/dnd/XDragSource.idl